Commit 0448825b authored by Hao Lan's avatar Hao Lan Committed by David S. Miller

net: hns3: Disable SerDes serial loopback for HiLink H60

When the hilink version is H60, the serdes serial loopback test is not
supported. This patch add hilink version detection. When the version
is H60, the serdes serial loopback test will be disable.
Signed-off-by: default avatarHao Lan <lanhao@huawei.com>
Signed-off-by: default avatarJijie Shao <shaojijie@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent dd1f65f0
...@@ -388,6 +388,7 @@ struct hnae3_dev_specs { ...@@ -388,6 +388,7 @@ struct hnae3_dev_specs {
u16 mc_mac_size; u16 mc_mac_size;
u32 mac_stats_num; u32 mac_stats_num;
u8 tnl_num; u8 tnl_num;
u8 hilink_version;
}; };
struct hnae3_client_ops { struct hnae3_client_ops {
......
...@@ -1097,6 +1097,8 @@ hns3_dbg_dev_specs(struct hnae3_handle *h, char *buf, int len, int *pos) ...@@ -1097,6 +1097,8 @@ hns3_dbg_dev_specs(struct hnae3_handle *h, char *buf, int len, int *pos)
*pos += scnprintf(buf + *pos, len - *pos, *pos += scnprintf(buf + *pos, len - *pos,
"TX timeout threshold: %d seconds\n", "TX timeout threshold: %d seconds\n",
dev->watchdog_timeo / HZ); dev->watchdog_timeo / HZ);
*pos += scnprintf(buf + *pos, len - *pos, "Hilink Version: %u\n",
dev_specs->hilink_version);
} }
static int hns3_dbg_dev_info(struct hnae3_handle *h, char *buf, int len) static int hns3_dbg_dev_info(struct hnae3_handle *h, char *buf, int len)
......
...@@ -828,7 +828,8 @@ struct hclge_dev_specs_1_cmd { ...@@ -828,7 +828,8 @@ struct hclge_dev_specs_1_cmd {
__le16 mc_mac_size; __le16 mc_mac_size;
u8 rsv1[6]; u8 rsv1[6];
u8 tnl_num; u8 tnl_num;
u8 rsv2[5]; u8 hilink_version;
u8 rsv2[4];
}; };
/* mac speed type defined in firmware command */ /* mac speed type defined in firmware command */
......
...@@ -645,8 +645,12 @@ static int hclge_get_sset_count(struct hnae3_handle *handle, int stringset) ...@@ -645,8 +645,12 @@ static int hclge_get_sset_count(struct hnae3_handle *handle, int stringset)
handle->flags |= HNAE3_SUPPORT_APP_LOOPBACK; handle->flags |= HNAE3_SUPPORT_APP_LOOPBACK;
} }
if (hdev->ae_dev->dev_specs.hilink_version !=
HCLGE_HILINK_H60) {
count += 1; count += 1;
handle->flags |= HNAE3_SUPPORT_SERDES_SERIAL_LOOPBACK; handle->flags |= HNAE3_SUPPORT_SERDES_SERIAL_LOOPBACK;
}
count += 1; count += 1;
handle->flags |= HNAE3_SUPPORT_SERDES_PARALLEL_LOOPBACK; handle->flags |= HNAE3_SUPPORT_SERDES_PARALLEL_LOOPBACK;
count += 1; count += 1;
...@@ -1358,6 +1362,7 @@ static void hclge_parse_dev_specs(struct hclge_dev *hdev, ...@@ -1358,6 +1362,7 @@ static void hclge_parse_dev_specs(struct hclge_dev *hdev,
ae_dev->dev_specs.umv_size = le16_to_cpu(req1->umv_size); ae_dev->dev_specs.umv_size = le16_to_cpu(req1->umv_size);
ae_dev->dev_specs.mc_mac_size = le16_to_cpu(req1->mc_mac_size); ae_dev->dev_specs.mc_mac_size = le16_to_cpu(req1->mc_mac_size);
ae_dev->dev_specs.tnl_num = req1->tnl_num; ae_dev->dev_specs.tnl_num = req1->tnl_num;
ae_dev->dev_specs.hilink_version = req1->hilink_version;
} }
static void hclge_check_dev_specs(struct hclge_dev *hdev) static void hclge_check_dev_specs(struct hclge_dev *hdev)
......
...@@ -256,6 +256,12 @@ enum HCLGE_MAC_DUPLEX { ...@@ -256,6 +256,12 @@ enum HCLGE_MAC_DUPLEX {
HCLGE_MAC_FULL HCLGE_MAC_FULL
}; };
/* hilink version */
enum hclge_hilink_version {
HCLGE_HILINK_H32 = 0,
HCLGE_HILINK_H60 = 1,
};
#define QUERY_SFP_SPEED 0 #define QUERY_SFP_SPEED 0
#define QUERY_ACTIVE_SPEED 1 #define QUERY_ACTIVE_SPEED 1
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment