From patchwork Fri Sep 21 15:41:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 147297 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp971298ljw; Fri, 21 Sep 2018 08:43:30 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdbtv7CwSHBdBaNvCXqCLb4EgV7vsfcck/8IP6KBrg7V66cZohzjvToR4MG3OSNUf9WTvVe5 X-Received: by 2002:a17:902:e088:: with SMTP id cb8-v6mr44885197plb.189.1537544610628; Fri, 21 Sep 2018 08:43:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537544610; cv=none; d=google.com; s=arc-20160816; b=wIGrS+J/Oc17JiJOB4In7A6/mIzFK7uE3IIIkLAeohcOsXPvZ+RGcag2jOCKv6gLEQ HVM8Lpfk/KNFYiE8uWERGoS/C0ElMnb6LUdKKPtx5qPRTm0NnHUGbGIsJv4ITpdkyqQF oqG6hoTzuH7G86596fOCe5p/5Z3huREAzjLgLcmmm83dxjIEOMqJENMhjFm6inHyp459 CQbrbedhklxjj/SbD7vxnQbKuKFbqgMOTl+Gv+FdaAJtNq3kYiy/+z7Q99oz/W6GJVQy ZBbIG7lZB3CzKwccvrlFcmsz89vmfzY2NicMiAKWBagOdMJXow0PzaOWWr+iaKLwGI5Z 9A4Q== 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 q16-v6si26279970pgm.185.2018.09.21.08.43.30; Fri, 21 Sep 2018 08:43:30 -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 S2390804AbeIUVcx (ORCPT + 32 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 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(+) -- 2.7.4 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;