diff options
author | Guangbin Huang <huangguangbin2@huawei.com> | 2020-09-27 15:12:43 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-09-27 13:25:22 -0700 |
commit | 4cc86cb58a9993a318a56aff1d7dacdf5252b2bc (patch) | |
tree | 1bac4b0848296df2c2142dc9e277fd14b0b7e0b0 /drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | |
parent | 74ba23a1d24934191f628a8d60dbbf437a4d0ba6 (diff) |
net: hns3: use capabilities queried from firmware
In order to improve code maintainability and compatibility, the
capabilities of new features are queried from firmware.
The member flag in struct hnae3_ae_dev indicates not only
capabilities, but some initialized status. As capabilities bits
queried from firmware is too many, it is better to use new member
to indicate them. So adds member capabs in struce hnae3_ae_dev.
Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c')
-rw-r--r-- | drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c index c57ec5ed447a..bf3504d6d70a 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c @@ -1368,7 +1368,7 @@ static int hns3_get_fecparam(struct net_device *netdev, u8 fec_ability; u8 fec_mode; - if (!hnae3_get_bit(ae_dev->flag, HNAE3_DEV_SUPPORT_FEC_B)) + if (!test_bit(HNAE3_DEV_SUPPORT_FEC_B, ae_dev->caps)) return -EOPNOTSUPP; if (!ops->get_fec) @@ -1390,7 +1390,7 @@ static int hns3_set_fecparam(struct net_device *netdev, const struct hnae3_ae_ops *ops = handle->ae_algo->ops; u32 fec_mode; - if (!hnae3_get_bit(ae_dev->flag, HNAE3_DEV_SUPPORT_FEC_B)) + if (!test_bit(HNAE3_DEV_SUPPORT_FEC_B, ae_dev->caps)) return -EOPNOTSUPP; if (!ops->set_fec) |