Skip to content

Commit

Permalink
net/hns3: fix device capabilities for copper media type
Browse files Browse the repository at this point in the history
[ upstream commit 68ed5ee ]

The configuration operation for PHY is implemented by firmware. And
a capability flag will be report to driver, which means the firmware
supports the PHY driver.  However, the current implementation only
supports obtaining the capability bit, but some basic functions of
copper ports in driver, such as, the query of link status and link
info, are not supported.

Therefore, it is necessary for driver to set the copper capability
bit to zero when the firmware supports the configuration of the PHY.

Fixes: 4387523 ("net/hns3: get device capability from firmware")
Fixes: 95e5032 ("net/hns3: support copper media type")

Signed-off-by: Huisong Li <lihuisong@huawei.com>
  • Loading branch information
LiHuiSong1 authored and steevenlee committed May 8, 2021
1 parent 4371d3b commit e4e0a65
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/net/hns3/hns3_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -424,8 +424,14 @@ static void hns3_parse_capability(struct hns3_hw *hw,
hns3_set_bit(hw->capability, HNS3_DEV_SUPPORT_PTP_B, 1);
if (hns3_get_bit(caps, HNS3_CAPS_TX_PUSH_B))
hns3_set_bit(hw->capability, HNS3_DEV_SUPPORT_TX_PUSH_B, 1);
/*
* Currently, the query of link status and link info on copper ports
* are not supported. So it is necessary for driver to set the copper
* capability bit to zero when the firmware supports the configuration
* of the PHY.
*/
if (hns3_get_bit(caps, HNS3_CAPS_PHY_IMP_B))
hns3_set_bit(hw->capability, HNS3_DEV_SUPPORT_COPPER_B, 1);
hns3_set_bit(hw->capability, HNS3_DEV_SUPPORT_COPPER_B, 0);
if (hns3_get_bit(caps, HNS3_CAPS_TQP_TXRX_INDEP_B))
hns3_set_bit(hw->capability, HNS3_DEV_SUPPORT_INDEP_TXRX_B, 1);
if (hns3_get_bit(caps, HNS3_CAPS_STASH_B))
Expand Down

0 comments on commit e4e0a65

Please sign in to comment.