Netdev List
 help / color / mirror / Atom feed
From: Huazhong Tan <tanhuazhong@huawei.com>
To: <davem@davemloft.net>
Cc: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<salil.mehta@huawei.com>, <yisen.zhuang@huawei.com>,
	<linuxarm@huawei.com>, Jian Shen <shenjian15@huawei.com>,
	Peng Li <lipeng321@huawei.com>,
	"Huazhong Tan" <tanhuazhong@huawei.com>
Subject: [Patch net-next 03/12] net: hns3: convert mac advertize and supported from u32 to link mode
Date: Wed, 20 Feb 2019 10:32:42 +0800	[thread overview]
Message-ID: <1550629971-23999-4-git-send-email-tanhuazhong@huawei.com> (raw)
In-Reply-To: <1550629971-23999-1-git-send-email-tanhuazhong@huawei.com>

From: Jian Shen <shenjian15@huawei.com>

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>
---
 .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c    | 24 +++++++++++-----------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
index 75ec309..9a442f3 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
@@ -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)
-- 
2.7.4


  parent reply	other threads:[~2019-02-20  2:34 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-20  2:32 [Patch net-next 00/12] code optimizations & bugfixes for HNS3 driver Huazhong Tan
2019-02-20  2:32 ` [Patch net-next 01/12] net: hns3: add pointer checking at the beginning of the exported functions Huazhong Tan
2019-02-20  2:32 ` [Patch net-next 02/12] net: hns3: Check variable is valid before assigning it to another Huazhong Tan
2019-02-20  2:32 ` Huazhong Tan [this message]
2019-02-20  2:32 ` [Patch net-next 04/12] net: hns3: fix port info query issue for copper port Huazhong Tan
2019-02-20  2:32 ` [Patch net-next 05/12] net: hns3: modify print message of ssu common ecc errors Huazhong Tan
2019-02-20  2:32 ` [Patch net-next 06/12] net: hns3: some bugfix of ppu(rcb) ras errors Huazhong Tan
2019-02-20  2:32 ` [Patch net-next 07/12] net: hns3: enable 8~11th bit of mac common msi-x error Huazhong Tan
2019-02-20  2:32 ` [Patch net-next 08/12] net: hns3: fix 6th bit of ppp mpf abnormal errors Huazhong Tan
2019-02-20  2:32 ` [Patch net-next 09/12] net: hns3: Record VF unicast and multicast tables Huazhong Tan
2019-02-20  2:32 ` [Patch net-next 10/12] net: hns3: Record VF vlan tables Huazhong Tan
2019-02-20  2:32 ` [Patch net-next 11/12] net: hns3: uninitialize command queue while unloading PF driver Huazhong Tan
2019-02-20  2:32 ` [Patch net-next 12/12] net: hns3: clear command queue's registers when unloading VF driver Huazhong Tan
2019-02-22  0:34 ` [Patch net-next 00/12] code optimizations & bugfixes for HNS3 driver David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1550629971-23999-4-git-send-email-tanhuazhong@huawei.com \
    --to=tanhuazhong@huawei.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=lipeng321@huawei.com \
    --cc=netdev@vger.kernel.org \
    --cc=salil.mehta@huawei.com \
    --cc=shenjian15@huawei.com \
    --cc=yisen.zhuang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox