提交 49acadc5 编写于 作者: H Hao Chen 提交者: Jiantao Xiao

net: hns3: add support for getting GE port lanes

driver inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I7A712
CVE: NA

----------------------------------------------------------------------

The number of lanes on the electrical port is 0, which does not
meet the expectation. The patch add support for getting GE port
lanes.
Signed-off-by: NHao Chen <chenhao418@huawei.com>
上级 f5432d46
......@@ -7,11 +7,16 @@
static ssize_t lane_num_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
#define HCLGE_GE_PORT_ONE_LANE 1
struct pci_dev *pdev = container_of(dev, struct pci_dev, dev);
struct hnae3_ae_dev *ae_dev = pci_get_drvdata(pdev);
struct hclge_dev *hdev = ae_dev->priv;
return scnprintf(buf, PAGE_SIZE, "%u\n", hdev->hw.mac.lane_num);
if (hdev->hw.mac.media_type == HNAE3_MEDIA_TYPE_COPPER)
return scnprintf(buf, PAGE_SIZE, "%u\n",
HCLGE_GE_PORT_ONE_LANE);
else
return scnprintf(buf, PAGE_SIZE, "%u\n", hdev->hw.mac.lane_num);
}
static ssize_t lane_num_store(struct device *dev,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册