Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1705imm; Fri, 21 Sep 2018 08:44:20 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZrwFU8m5JM0nKEovLn40Wd3Q3fd6Qn7HmGmFcuNlp9ALWJYNsLfpeJQi2i7lCedTpQuEt1 X-Received: by 2002:a17:902:3c5:: with SMTP id d63-v6mr44690124pld.145.1537544660007; Fri, 21 Sep 2018 08:44:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537544659; cv=none; d=google.com; s=arc-20160816; b=tJVNhtRugcs5XoZZLLKhV4YzwbRFBx6EbJ6qlO0D3gMoCzPfpcJ5fs8BXcZavtzYb3 rEMMQrbwNWMavy6O8OuBYGdVcDZT0BE0R/qG6uOTak5v/ddAlqCDM/6KpxUA5dRgghL7 H5/a+HFRBJz5SzQmnxX6RCJq9RSveZ09Z8rXgPdHyhb30mkSUdsU6/INmG69TqTP8S0c uNJVVIfMxFdO32dHopvijwT03zELTfsIK8RBt7Gip1CWcufdwLe6kIV/GlPSLUjv4TAV 0KiNUF77RC+XSCG149Z6ViCFigMnWsiIAFba5gRtObm3vPWthifkY/zFgRA+Wnl6UGP1 gCDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=/kHTPqa6fEgOL1f3dg9kLI6/K9KFgF8SouFaFCL3A4k=; b=AyThj9Mu7RtfL3h13Uch+0V5qkzujfrCxpu6NELlm7Xls1Z1BJbzEkkfuGMSXEEoJ1 R5njfcZYVW6OQDRv0XaSMer/mxgdGdbNIsHehQiZ62i68AgvUuEtvNZdCepx3n32NyKX gPn2L9Mt950MPnBO44fb7cIBSEcL1qWpRL64DVQvLf3uaTa01/LkXzv6JihABgz+5xEA IENOd0duLIpICWGOlduDezuvE1wNsDIzalzBpwXr7j8gaQY4vi0TaaRlKVm4LVDlbtAw KcUVX2PwORIjoyl3sHrLWUqYIEOQ0YP3DNjmMw6e6qKqLVaWKPKc6vgnnvO+A0w96E5j h3vA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i126-v6si27811367pgd.332.2018.09.21.08.43.59; Fri, 21 Sep 2018 08:44:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390800AbeIUVcx (ORCPT + 99 others); Fri, 21 Sep 2018 17:32:53 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:13099 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2390757AbeIUVcw (ORCPT ); Fri, 21 Sep 2018 17:32:52 -0400 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 3CEDD5135832C; Fri, 21 Sep 2018 23:43:18 +0800 (CST) Received: from S00293818-DELL1.china.huawei.com (10.202.226.54) by DGGEMS401-HUB.china.huawei.com (10.3.19.201) with Microsoft SMTP Server id 14.3.399.0; Fri, 21 Sep 2018 23:43:09 +0800 From: Salil Mehta To: CC: , , , , , , , Fuyun Liang Subject: [PATCH net-next 10/12] net: hns3: Add get_media_type ops support for VF Date: Fri, 21 Sep 2018 16:41:46 +0100 Message-ID: <20180921154148.26756-11-salil.mehta@huawei.com> X-Mailer: git-send-email 2.8.3 In-Reply-To: <20180921154148.26756-1-salil.mehta@huawei.com> References: <20180921154148.26756-1-salil.mehta@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.202.226.54] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Peng Li This patch adds the ops of get_media_type support for VF. Signed-off-by: Fuyun Liang Signed-off-by: Peng Li Signed-off-by: Salil Mehta --- drivers/net/ethernet/hisilicon/hns3/hnae3.h | 1 + drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 11 +++++++++++ drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h | 1 + 3 files changed, 13 insertions(+) diff --git a/drivers/net/ethernet/hisilicon/hns3/hnae3.h b/drivers/net/ethernet/hisilicon/hns3/hnae3.h index 17db631..fc87e1b 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hnae3.h +++ b/drivers/net/ethernet/hisilicon/hns3/hnae3.h @@ -107,6 +107,7 @@ enum hnae3_media_type { HNAE3_MEDIA_TYPE_FIBER, HNAE3_MEDIA_TYPE_COPPER, HNAE3_MEDIA_TYPE_BACKPLANE, + HNAE3_MEDIA_TYPE_NONE, }; enum hnae3_reset_notify_type { diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c index b644187..9781931 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c @@ -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 = { diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h index b23ba17..2af01f1 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h +++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h @@ -66,6 +66,7 @@ enum hclgevf_states { #define HCLGEVF_MPF_ENBALE 1 struct hclgevf_mac { + u8 media_type; u8 mac_addr[ETH_ALEN]; int link; u8 duplex; -- 2.7.4