net: nvethernet: Fix build for Linux v6.9

For Linux v6.9, the structure 'ethtool_eee' was replaced by
'ethtool_keee' and this new structure uses bitmaps for the structure
fields 'supported', 'advertised' and 'lp_advertised' as opposed to
'u32' types.

Add a test to conftest to detect the presence of the new 'ethtool_keee'
structure and update the nvethernet driver to use the various
linkmode_xxx helper functions for accessing the bitmap structure fields.

Bug 4471899

Change-Id: I275becfa665a36ed90e8bc227eaa4122825faa6a
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3110494
(cherry picked from commit 72761b8276)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3111548
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Jon Hunter
2024-04-05 19:37:48 +01:00
committed by mobile promotions
parent 044cc6adda
commit 315ceb951b
3 changed files with 52 additions and 1 deletions

View File

@@ -115,6 +115,7 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += drm_fb_helper_unregister_info
NV_CONFTEST_FUNCTION_COMPILE_TESTS += drm_fb_helper_struct_has_info_arg
NV_CONFTEST_FUNCTION_COMPILE_TESTS += drm_mode_config_struct_has_fb_base_arg
NV_CONFTEST_FUNCTION_COMPILE_TESTS += drm_scdc_get_set_has_struct_drm_connector_arg
NV_CONFTEST_FUNCTION_COMPILE_TESTS += ethtool_keee_struct_present
NV_CONFTEST_FUNCTION_COMPILE_TESTS += ethtool_ops_get_set_coalesce_has_coal_and_extack_args
NV_CONFTEST_FUNCTION_COMPILE_TESTS += ethtool_ops_get_set_ringparam_has_ringparam_and_extack_args
NV_CONFTEST_FUNCTION_COMPILE_TESTS += ethtool_ops_get_set_rxfh_has_rxfh_param_args

View File

@@ -6954,6 +6954,23 @@ compile_test() {
"NV_DRM_SCDC_GET_SET_HAS_STRUCT_DRM_CONNECTOR_ARG" "" "types"
;;
ethtool_keee_struct_present)
#
# Determine if the 'struct ethtool_keee' is present.
#
# Commit d80a52335374 ("ethtool: replace struct ethtool_eee with a
# new struct ethtool_keee on kernel side") replaced struct
# ethtool_eee with ethtool_keee in Linux v6.9.
#
CODE="
#include <linux/ethtool.h>
int conftest_ethtool_keee_struct_present(struct ethtool_keee *keee) {
return 0;
}"
compile_check_conftest "$CODE" "NV_ETHTOOL_KEEE_STRUCT_PRESENT" "" "types"
;;
ethtool_ops_get_set_coalesce_has_coal_and_extack_args)
#
# Determine if the 'get_coalesce' and 'set_coalesce' ethtool_ops