Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net: atlantic: convert EEE handling to use linkmode bitmaps

Convert EEE handling to use linkmode bitmaps. This prepares for
removing the legacy bitmaps from struct ethtool_keee.
No functional change intended.

Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Link: https://lore.kernel.org/r/c5a61d57-d2b0-427f-93b3-fcf7721165f3@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Heiner Kallweit and committed by
Jakub Kicinski
32b80333 1c96a63a

+9 -12
+9 -12
drivers/net/ethernet/aquantia/atlantic/aq_ethtool.c
··· 15 15 #include "aq_macsec.h" 16 16 #include "aq_main.h" 17 17 18 + #include <linux/linkmode.h> 18 19 #include <linux/ptp_clock_kernel.h> 19 20 20 21 static void aq_ethtool_get_regs(struct net_device *ndev, ··· 682 681 return 0; 683 682 } 684 683 685 - static u32 eee_mask_to_ethtool_mask(u32 speed) 684 + static void eee_mask_to_ethtool_mask(unsigned long *mode, u32 speed) 686 685 { 687 - u32 rate = 0; 688 - 689 686 if (speed & AQ_NIC_RATE_EEE_10G) 690 - rate |= SUPPORTED_10000baseT_Full; 687 + linkmode_set_bit(ETHTOOL_LINK_MODE_10000baseT_Full_BIT, mode); 691 688 692 689 if (speed & AQ_NIC_RATE_EEE_1G) 693 - rate |= SUPPORTED_1000baseT_Full; 690 + linkmode_set_bit(ETHTOOL_LINK_MODE_1000baseT_Full_BIT, mode); 694 691 695 692 if (speed & AQ_NIC_RATE_EEE_100M) 696 - rate |= SUPPORTED_100baseT_Full; 697 - 698 - return rate; 693 + linkmode_set_bit(ETHTOOL_LINK_MODE_100baseT_Full_BIT, mode); 699 694 } 700 695 701 696 static int aq_ethtool_get_eee(struct net_device *ndev, struct ethtool_keee *eee) ··· 710 713 if (err < 0) 711 714 return err; 712 715 713 - eee->supported_u32 = eee_mask_to_ethtool_mask(supported_rates); 716 + eee_mask_to_ethtool_mask(eee->supported, supported_rates); 714 717 715 718 if (aq_nic->aq_nic_cfg.eee_speeds) 716 - eee->advertised_u32 = eee->supported_u32; 719 + linkmode_copy(eee->advertised, eee->supported); 717 720 718 - eee->lp_advertised_u32 = eee_mask_to_ethtool_mask(rate); 721 + eee_mask_to_ethtool_mask(eee->lp_advertised, rate); 719 722 720 - eee->eee_enabled = !!eee->advertised_u32; 723 + eee->eee_enabled = !linkmode_empty(eee->advertised); 721 724 722 725 eee->tx_lpi_enabled = eee->eee_enabled; 723 726 if ((supported_rates & rate) & AQ_NIC_RATE_EEE_MSK)