Commit c136b884 authored by Peng Li's avatar Peng Li Committed by David S. Miller

net: hns3: Add get_media_type ops support for VF

This patch adds the ops of get_media_type support for VF.
Signed-off-by: default avatarFuyun Liang <liangfuyun1@huawei.com>
Signed-off-by: default avatarPeng Li <lipeng321@huawei.com>
Signed-off-by: default avatarSalil Mehta <salil.mehta@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 75e98535
...@@ -107,6 +107,7 @@ enum hnae3_media_type { ...@@ -107,6 +107,7 @@ enum hnae3_media_type {
HNAE3_MEDIA_TYPE_FIBER, HNAE3_MEDIA_TYPE_FIBER,
HNAE3_MEDIA_TYPE_COPPER, HNAE3_MEDIA_TYPE_COPPER,
HNAE3_MEDIA_TYPE_BACKPLANE, HNAE3_MEDIA_TYPE_BACKPLANE,
HNAE3_MEDIA_TYPE_NONE,
}; };
enum hnae3_reset_notify_type { enum hnae3_reset_notify_type {
......
...@@ -1340,6 +1340,8 @@ static int hclgevf_configure(struct hclgevf_dev *hdev) ...@@ -1340,6 +1340,8 @@ static int hclgevf_configure(struct hclgevf_dev *hdev)
{ {
int ret; int ret;
hdev->hw.mac.media_type = HNAE3_MEDIA_TYPE_NONE;
/* get queue configuration from PF */ /* get queue configuration from PF */
ret = hclgevf_get_queue_info(hdev); ret = hclgevf_get_queue_info(hdev);
if (ret) if (ret)
...@@ -2009,6 +2011,14 @@ void hclgevf_update_speed_duplex(struct hclgevf_dev *hdev, u32 speed, ...@@ -2009,6 +2011,14 @@ void hclgevf_update_speed_duplex(struct hclgevf_dev *hdev, u32 speed,
hdev->hw.mac.duplex = duplex; hdev->hw.mac.duplex = duplex;
} }
static void hclgevf_get_media_type(struct hnae3_handle *handle,
u8 *media_type)
{
struct hclgevf_dev *hdev = hclgevf_ae_get_hdev(handle);
if (media_type)
*media_type = hdev->hw.mac.media_type;
}
static const struct hnae3_ae_ops hclgevf_ops = { static const struct hnae3_ae_ops hclgevf_ops = {
.init_ae_dev = hclgevf_init_ae_dev, .init_ae_dev = hclgevf_init_ae_dev,
.uninit_ae_dev = hclgevf_uninit_ae_dev, .uninit_ae_dev = hclgevf_uninit_ae_dev,
...@@ -2046,6 +2056,7 @@ static const struct hnae3_ae_ops hclgevf_ops = { ...@@ -2046,6 +2056,7 @@ static const struct hnae3_ae_ops hclgevf_ops = {
.get_tqps_and_rss_info = hclgevf_get_tqps_and_rss_info, .get_tqps_and_rss_info = hclgevf_get_tqps_and_rss_info,
.get_status = hclgevf_get_status, .get_status = hclgevf_get_status,
.get_ksettings_an_result = hclgevf_get_ksettings_an_result, .get_ksettings_an_result = hclgevf_get_ksettings_an_result,
.get_media_type = hclgevf_get_media_type,
}; };
static struct hnae3_ae_algo ae_algovf = { static struct hnae3_ae_algo ae_algovf = {
......
...@@ -66,6 +66,7 @@ enum hclgevf_states { ...@@ -66,6 +66,7 @@ enum hclgevf_states {
#define HCLGEVF_MPF_ENBALE 1 #define HCLGEVF_MPF_ENBALE 1
struct hclgevf_mac { struct hclgevf_mac {
u8 media_type;
u8 mac_addr[ETH_ALEN]; u8 mac_addr[ETH_ALEN];
int link; int link;
u8 duplex; u8 duplex;
......
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