net: hns3: Add get_media_type ops support for VF
[linux-2.6-microblaze.git] / drivers / net / ethernet / hisilicon / hns3 / hns3vf / hclgevf_main.c
index b644187..9781931 100644 (file)
@@ -1340,6 +1340,8 @@ static int hclgevf_configure(struct hclgevf_dev *hdev)
 {
        int ret;
 
+       hdev->hw.mac.media_type = HNAE3_MEDIA_TYPE_NONE;
+
        /* get queue configuration from PF */
        ret = hclgevf_get_queue_info(hdev);
        if (ret)
@@ -2009,6 +2011,14 @@ void hclgevf_update_speed_duplex(struct hclgevf_dev *hdev, u32 speed,
        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 = {
        .init_ae_dev = hclgevf_init_ae_dev,
        .uninit_ae_dev = hclgevf_uninit_ae_dev,
@@ -2046,6 +2056,7 @@ static const struct hnae3_ae_ops hclgevf_ops = {
        .get_tqps_and_rss_info = hclgevf_get_tqps_and_rss_info,
        .get_status = hclgevf_get_status,
        .get_ksettings_an_result = hclgevf_get_ksettings_an_result,
+       .get_media_type = hclgevf_get_media_type,
 };
 
 static struct hnae3_ae_algo ae_algovf = {