net: hns3: convert mac advertize and supported from u32 to link mode
authorJian Shen <shenjian15@huawei.com>
Wed, 20 Feb 2019 02:32:42 +0000 (10:32 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 22 Feb 2019 00:29:04 +0000 (16:29 -0800)
The link mode with bits has been up to more than 31 for some MAC
and phy. Convert to using a linkmode bitmap, which can support all
link modes.

Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c

index 75ec3094bbf9297fb2be863526189a8de4196ebb..9a442f3c682a29346708c43eee57317ebe06562e 100644 (file)
@@ -839,27 +839,27 @@ static void hclge_parse_fiber_link_mode(struct hclge_dev *hdev,
        unsigned long *supported = hdev->hw.mac.supported;
 
        if (speed_ability & HCLGE_SUPPORT_1G_BIT)
-               set_bit(ETHTOOL_LINK_MODE_1000baseX_Full_BIT,
-                       supported);
+               linkmode_set_bit(ETHTOOL_LINK_MODE_1000baseX_Full_BIT,
+                                supported);
 
        if (speed_ability & HCLGE_SUPPORT_10G_BIT)
-               set_bit(ETHTOOL_LINK_MODE_10000baseSR_Full_BIT,
-                       supported);
+               linkmode_set_bit(ETHTOOL_LINK_MODE_10000baseSR_Full_BIT,
+                                supported);
 
        if (speed_ability & HCLGE_SUPPORT_25G_BIT)
-               set_bit(ETHTOOL_LINK_MODE_25000baseSR_Full_BIT,
-                       supported);
+               linkmode_set_bit(ETHTOOL_LINK_MODE_25000baseSR_Full_BIT,
+                                supported);
 
        if (speed_ability & HCLGE_SUPPORT_50G_BIT)
-               set_bit(ETHTOOL_LINK_MODE_50000baseSR2_Full_BIT,
-                       supported);
+               linkmode_set_bit(ETHTOOL_LINK_MODE_50000baseSR2_Full_BIT,
+                                supported);
 
        if (speed_ability & HCLGE_SUPPORT_100G_BIT)
-               set_bit(ETHTOOL_LINK_MODE_100000baseSR4_Full_BIT,
-                       supported);
+               linkmode_set_bit(ETHTOOL_LINK_MODE_100000baseSR4_Full_BIT,
+                                supported);
 
-       set_bit(ETHTOOL_LINK_MODE_FIBRE_BIT, supported);
-       set_bit(ETHTOOL_LINK_MODE_Pause_BIT, supported);
+       linkmode_set_bit(ETHTOOL_LINK_MODE_FIBRE_BIT, supported);
+       linkmode_set_bit(ETHTOOL_LINK_MODE_Pause_BIT, supported);
 }
 
 static void hclge_parse_link_mode(struct hclge_dev *hdev, u8 speed_ability)