From patchwork Wed Nov 21 10:13:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Russkikh X-Patchwork-Id: 10692295 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0982113BB for ; Wed, 21 Nov 2018 10:15:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EC1912B8E8 for ; Wed, 21 Nov 2018 10:15:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DEFE22B8F5; Wed, 21 Nov 2018 10:15:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 66EA62B8E8 for ; Wed, 21 Nov 2018 10:15:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729466AbeKUUrw (ORCPT ); Wed, 21 Nov 2018 15:47:52 -0500 Received: from mail-eopbgr740085.outbound.protection.outlook.com ([40.107.74.85]:32160 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729143AbeKUUrv (ORCPT ); Wed, 21 Nov 2018 15:47:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=AQUANTIA1COM.onmicrosoft.com; s=selector1-aquantia-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=INLZZZuVG8s7jQdeaHK25GtUqwH9zAXd+GmlCMf1LWI=; b=vwomcPBML7G7Up2daFlQrlZBj1nwO1KsmEXQLhs4wMQ5T8DiOcylsPlG4xWmOamWq9CRQmWdaIWcBa0v2yJytIU2y1HB3nSinDl3CRVOX5R6Mx89iQxC/+llQWbrJWAKhPgLXHMdJbCCp32nhrfG3z34VO7WSPqqwUvGxRCzQ0Q= Received: from BY1PR0701MB1660.namprd07.prod.outlook.com (10.162.110.22) by BY1PR0701MB1287.namprd07.prod.outlook.com (10.160.108.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1339.26; Wed, 21 Nov 2018 10:13:58 +0000 Received: from BY1PR0701MB1660.namprd07.prod.outlook.com ([fe80::f8ee:2260:e410:fffd]) by BY1PR0701MB1660.namprd07.prod.outlook.com ([fe80::f8ee:2260:e410:fffd%3]) with mapi id 15.20.1361.015; Wed, 21 Nov 2018 10:13:58 +0000 From: Igor Russkikh To: "linux-usb@vger.kernel.org" , "davem@davemloft.net" , "netdev@vger.kernel.org" CC: "andrew@lunn.ch" , Dmitry Bezrukov , Igor Russkikh Subject: [PATCH v3 net-next 17/21] net: usb: aqc111: Initialize ethtool_ops structure Thread-Topic: [PATCH v3 net-next 17/21] net: usb: aqc111: Initialize ethtool_ops structure Thread-Index: AQHUgYLqPK/GzhQwv0GPRa8C5ocqjw== Date: Wed, 21 Nov 2018 10:13:58 +0000 Message-ID: <5cfaa9b4dfdca8dbcf8a88b13eac864ec9187866.1542794577.git.igor.russkikh@aquantia.com> References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM6PR0402CA0007.eurprd04.prod.outlook.com (2603:10a6:209::20) To BY1PR0701MB1660.namprd07.prod.outlook.com (2a01:111:e400:522a::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Igor.Russkikh@aquantia.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [95.79.108.179] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BY1PR0701MB1287;6:6w0vZhtIkypr9s83UWZ19fofSoEgm8c9oogJSt67+bcZCqexmmxz2Jwf5eKkZQqE1jzCJY2h7Z4iMR8DzPV+elACIvz4IF85y4DiqNMGnLSXaNtHCt3n88n7Dr8yEnFl8+jc1w9uZ08o034V9zdeI8T+cJME7fcW7HUdqlhKJo+xilbDjm8+WoUNA7NWoftkSq+l/cFqsaC9ovVKttfX9nbJravDSdMB0V7Qu/P5dN+WYJkdByoQb/KUUq4dXk8yeyxB0fzWpndnp9H/o3IUDSI9t9f6Yj9wuWLplEKUO8OuvG8Kzfs6JPnCQVB4Qh2fSU5UEZVjhO/kZye4XcoxOCCe2J/61ywsna0GrKaVKqv4jb4IJqaSbJyv51JX4V3SJbUsyKgD2mIaOI+d6+VCC9EDWR7NVgtaYc3xBAl8KgbvKkkjD8Ls5LRMSrUt/+xor4LhXX/ijcnM8GkftdO2diWeZBs/RI+6wazQEeyQSLk=;5:lF7x9GVTpiGjqeoe9oriZTKEg9qrfskkh+ophxz8E7ixO+yGmWr5vh+wlNf5xcnqpzXahBVCGwZyxi85GLUj5J+01KnP0sivv3YSjXP5nazTSscG5UnY+IIZpy18jPhg9+Ra1BJQWcwA9O/rbMlrvVG3jleM+V7rjgKopYXXYTw=;7:tACuMMrD45cnGz9IJ1cON44us1uT4cyABa8WfzaaE0CbY8q89bca+Ig408UC0oWqXVZSFxUoq6gJ8JBTD2qdISCDzB7YzLBgPPbDoFIjJYI6fxxz0Z0czt60uPOJrg1fSxtCuHEH7vSNeF2mMfl2fQ== x-ms-office365-filtering-correlation-id: 14c0a818-e76d-47b0-934a-08d64f9a0cb7 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390098)(7020095)(4652040)(8989299)(5600074)(711020)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020);SRVR:BY1PR0701MB1287; x-ms-traffictypediagnostic: BY1PR0701MB1287: x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(8121501046)(5005006)(3002001)(10201501046)(93006095)(93001095)(3231442)(944501410)(52105112)(148016)(149066)(150057)(6041310)(20161123560045)(20161123562045)(20161123558120)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095);SRVR:BY1PR0701MB1287;BCL:0;PCL:0;RULEID:;SRVR:BY1PR0701MB1287; x-forefront-prvs: 08635C03D4 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(39850400004)(396003)(346002)(136003)(366004)(376002)(189003)(199004)(106356001)(25786009)(66066001)(5660300001)(2906002)(7736002)(305945005)(97736004)(6512007)(2900100001)(2501003)(110136005)(2201001)(478600001)(36756003)(68736007)(54906003)(316002)(6436002)(14454004)(105586002)(72206003)(81156014)(386003)(6506007)(102836004)(4326008)(76176011)(81166006)(71200400001)(186003)(26005)(8676002)(8936002)(71190400001)(107886003)(99286004)(256004)(118296001)(52116002)(86362001)(44832011)(53936002)(6486002)(3846002)(6116002)(476003)(11346002)(486006)(2616005)(446003);DIR:OUT;SFP:1101;SCL:1;SRVR:BY1PR0701MB1287;H:BY1PR0701MB1660.namprd07.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: aquantia.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: FmA9KVXD2S58TJzoUPlbV8H/kIJZ3ux75KUs5WbvuotinjJxLdTrwG93LuJFqA6Vl5izNOkNTB2kwzB3JRx22vtIKemlyLgC6aPCo7yZTEyWuP8LFFyFgTLfz9BcX4CJ05RReeh7nPSxq00fDV9TscyZ/9vU/fVLXDYOWuB3lY2cDILANCSIS7+t4Wq1DBkSJ2s0mIG0Xa8LZyYvLQ2iLIWLRawESECY+Ijowm3NfCMRpdWL8SHtka7q33e8S4VMReYFJ2NQfDVonAFgDi4hDksXIJfIaECqMVp8y9mnNWNvEwf2cqXLu57pAJMiz09OwZXhBKc6fwMXvJ/xvjLttnL37KICGpAm62K/wUHWk9w= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: aquantia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 14c0a818-e76d-47b0-934a-08d64f9a0cb7 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Nov 2018 10:13:58.0325 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 83e2e134-991c-4ede-8ced-34d47e38e6b1 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1287 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Dmitry Bezrukov Implement get_drvinfo, set/get_msglevel, get_link callbacks Signed-off-by: Dmitry Bezrukov Signed-off-by: Igor Russkikh --- drivers/net/usb/aqc111.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/drivers/net/usb/aqc111.c b/drivers/net/usb/aqc111.c index 89b7ee1fad22..2028db453df9 100644 --- a/drivers/net/usb/aqc111.c +++ b/drivers/net/usb/aqc111.c @@ -9,6 +9,7 @@ #include #include +#include #include #include #include @@ -18,6 +19,8 @@ #include "aqc111.h" +#define DRIVER_NAME "aqc111" + static int aqc111_read_cmd_nopm(struct usbnet *dev, u8 cmd, u16 value, u16 index, u16 size, void *data) { @@ -178,6 +181,23 @@ static int aqc111_write16_cmd_async(struct usbnet *dev, u8 cmd, u16 value, sizeof(tmp), &tmp); } +static void aqc111_get_drvinfo(struct net_device *net, + struct ethtool_drvinfo *info) +{ + struct usbnet *dev = netdev_priv(net); + struct aqc111_data *aqc111_data = dev->driver_priv; + + /* Inherit standard device info */ + usbnet_get_drvinfo(net, info); + strlcpy(info->driver, DRIVER_NAME, sizeof(info->driver)); + snprintf(info->fw_version, sizeof(info->fw_version), "%u.%u.%u", + aqc111_data->fw_ver.major, + aqc111_data->fw_ver.minor, + aqc111_data->fw_ver.rev); + info->eedump_len = 0x00; + info->regdump_len = 0x00; +} + static void aqc111_set_phy_speed(struct usbnet *dev, u8 autoneg, u16 speed) { struct aqc111_data *aqc111_data = dev->driver_priv; @@ -225,6 +245,13 @@ static void aqc111_set_phy_speed(struct usbnet *dev, u8 autoneg, u16 speed) aqc111_write32_cmd(dev, AQ_PHY_OPS, 0, 0, &aqc111_data->phy_cfg); } +static const struct ethtool_ops aqc111_ethtool_ops = { + .get_drvinfo = aqc111_get_drvinfo, + .get_msglevel = usbnet_get_msglevel, + .set_msglevel = usbnet_set_msglevel, + .get_link = ethtool_op_get_link, +}; + static int aqc111_change_mtu(struct net_device *net, int new_mtu) { struct usbnet *dev = netdev_priv(net); @@ -533,6 +560,7 @@ static int aqc111_bind(struct usbnet *dev, struct usb_interface *intf) dev->net->max_mtu = 16334; dev->net->netdev_ops = &aqc111_netdev_ops; + dev->net->ethtool_ops = &aqc111_ethtool_ops; if (usb_device_no_sg_constraint(dev->udev)) dev->can_dma_sg = 1;