From patchwork Tue Nov 13 14:44:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Russkikh X-Patchwork-Id: 10680853 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 72B581759 for ; Tue, 13 Nov 2018 14:44:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6025628D48 for ; Tue, 13 Nov 2018 14:44:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5493629208; Tue, 13 Nov 2018 14:44:43 +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 E737928D48 for ; Tue, 13 Nov 2018 14:44:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387757AbeKNAnG (ORCPT ); Tue, 13 Nov 2018 19:43:06 -0500 Received: from mail-eopbgr810040.outbound.protection.outlook.com ([40.107.81.40]:18907 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732577AbeKNAnG (ORCPT ); Tue, 13 Nov 2018 19:43:06 -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=aB+Sx7IEzbJ2O82eokGKQ1EVH92OATrJpMS/fu2bkj0=; b=tBBXlxczWmKc5hWQO/oSrFMcelIsFFkCJsfCoyL/K/yrFgqeXT76v+2A1g7YmB21z1vtS4XdDbYxikANy1naSQoPRejYGIdRhFI3UnFe2ibhunElHyhVBjovCaBAqxA1dL9QCs2fnieGhhg7DRpBwRt0FERCbFb5xxcl5BBe4qk= Received: from BY1PR0701MB1660.namprd07.prod.outlook.com (10.162.110.22) by BY1PR0701MB1208.namprd07.prod.outlook.com (10.160.105.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.36; Tue, 13 Nov 2018 14:44:35 +0000 Received: from BY1PR0701MB1660.namprd07.prod.outlook.com ([fe80::c031:16d9:9580:3d11]) by BY1PR0701MB1660.namprd07.prod.outlook.com ([fe80::c031:16d9:9580:3d11%6]) with mapi id 15.20.1294.045; Tue, 13 Nov 2018 14:44:35 +0000 From: Igor Russkikh To: "David S . Miller" CC: "linux-usb@vger.kernel.org" , "netdev@vger.kernel.org" , Dmitry Bezrukov , Igor Russkikh Subject: [PATCH v2 net-next 02/21] net: usb: aqc111: Add bind and empty unbind callbacks Thread-Topic: [PATCH v2 net-next 02/21] net: usb: aqc111: Add bind and empty unbind callbacks Thread-Index: AQHUe19lZ0HbvBaCq0S2EQ3bTSXF/Q== Date: Tue, 13 Nov 2018 14:44:35 +0000 Message-ID: <8580ea95ea83ae043db71b7404465a7c4bb934ca.1542119058.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: AM5P189CA0013.EURP189.PROD.OUTLOOK.COM (2603:10a6:206:15::26) 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;BY1PR0701MB1208;6:oXmbnLkcN8GkFyq6CL36zjhR9F0yRptdhPdfdmMha7LdmRZyevDaTGROL2pgP7/qgK5dyMp0xwWYdSB4v5XAYGSdJS9mzWGAYAz6NvnZOx0ZFb8ZOkrKOVRpejrkA5wBuC9p6quCkuR9TQFVAg3vB5yyFMwmVm7+HqP7J3VH+TrTe6hhepx8YwNsghH61u332r8cBgfz05BfZvbuG7Yqs4ItOD/hYc4fdeVK0bgtWo7lUjmysk4nGuj5SdSKDB5DfL7oyC3DubtOttxQjgtMsalmDzyZ8fWPN6g0FmViLUgPrK5sfvsi7Kr0Fq+FbBGbkbOx+zVRHaHjIUFk9cvXRJeKVPyK248GM7iwwpalYuJO0Kqm3Wrmt7Q3LLsDGXOaIW2M44ZJI90RPlZMW7rWG335e0+bOqUKm0khK0zCiu9iqxORZhxoJJEHqJx4H0oB2H6hGnPXqDl0HMngKp4b0g==;5:vA3Da9tvkvA89hrscjtMHgy1io12psVQ7SLXsdeJL1+xbrpz97t9+s+V4tPekyR8tkbdsTqegQu6aTXqzeHfH1kug0ACPsw2RInjyuagDyNxx9xyqRosPZzc6dJybMoDoklLG6G1s9M6w84WRF3kz+zgLHn9vgl46skuSKwj8lU=;7:Xw11UBixQCflTXchkZiUgl55RmS0yEUn3BsP1IeMefpa0d16s8NYTXXoYFCi+g/7uDP7T7YG+pc/tt0s0FbLszRDJrb4ef/2wMqVQhlU7tmwYIG0qriDaI8jEmS5VUF0Hpi79VTzuOm003FCuiaLZw== x-ms-office365-filtering-correlation-id: 530c9936-1c83-4a0c-1b5e-08d6497687c4 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390060)(7020095)(4652040)(8989299)(5600074)(711020)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020);SRVR:BY1PR0701MB1208; x-ms-traffictypediagnostic: BY1PR0701MB1208: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(8121501046)(5005006)(3231406)(944501410)(52105112)(10201501046)(93006095)(93001095)(3002001)(148016)(149066)(150057)(6041310)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095);SRVR:BY1PR0701MB1208;BCL:0;PCL:0;RULEID:;SRVR:BY1PR0701MB1208; x-forefront-prvs: 085551F5A8 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(39850400004)(346002)(376002)(396003)(366004)(136003)(199004)(189003)(71190400001)(71200400001)(54906003)(72206003)(44832011)(305945005)(2906002)(66066001)(4326008)(118296001)(107886003)(105586002)(106356001)(36756003)(99286004)(52116002)(2900100001)(76176011)(476003)(14454004)(2616005)(6916009)(6506007)(186003)(386003)(486006)(86362001)(8676002)(8936002)(102836004)(11346002)(446003)(5660300001)(6486002)(256004)(81156014)(81166006)(53936002)(25786009)(68736007)(26005)(97736004)(316002)(7736002)(3846002)(478600001)(6116002)(6436002)(6512007);DIR:OUT;SFP:1101;SCL:1;SRVR:BY1PR0701MB1208;H:BY1PR0701MB1660.namprd07.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: aquantia.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: DfdFbsZh/1pvqKXq5NIfTe9zVF+t//pIoy2K5/omnTJkS/vGH5zm61qDEX3BYlNDevAg5FNJw1P7ErdFNXZmgGkrDwT+fZI1qosHXykulVZKGVlFIP2zZw1XN4szILJVEzXQY+ETRYSrXK7W+XaW9fXsoZlKPzgzy243JR4W9lve5AUpYGj4TyycjaEYd+oWPUh4Wqlchc9f2JjXHOJTv/3DzjlLoi5QQ6ZFozoffY01ySUymJT5gFVjqjqHMy8QLegZ+oMiSNp3cGZpLCbaFes345tTu19dz/ORs2xF/w4Vuj6FI9D7h0thtVCC/gCgl0XOKziXXoTMjemkRJ12EE+X6BrK1d4QkYkkn3uZ3Ag= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: aquantia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 530c9936-1c83-4a0c-1b5e-08d6497687c4 X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Nov 2018 14:44:35.5150 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 83e2e134-991c-4ede-8ced-34d47e38e6b1 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1208 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 Initialize net_device_ops structure Signed-off-by: Dmitry Bezrukov Signed-off-by: Igor Russkikh --- drivers/net/usb/aqc111.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/drivers/net/usb/aqc111.c b/drivers/net/usb/aqc111.c index aaea2a4fcc9f..b54bb4a98ee3 100644 --- a/drivers/net/usb/aqc111.c +++ b/drivers/net/usb/aqc111.c @@ -14,8 +14,43 @@ #include #include +static const struct net_device_ops aqc111_netdev_ops = { + .ndo_open = usbnet_open, + .ndo_stop = usbnet_stop, +}; + +static int aqc111_bind(struct usbnet *dev, struct usb_interface *intf) +{ + struct usb_device *udev = interface_to_usbdev(intf); + int ret; + + /* Check if vendor configuration */ + if (udev->actconfig->desc.bConfigurationValue != 1) { + usb_driver_set_configuration(udev, 1); + return -ENODEV; + } + + usb_reset_configuration(dev->udev); + + ret = usbnet_get_endpoints(dev, intf); + if (ret < 0) { + netdev_dbg(dev->net, "usbnet_get_endpoints failed"); + return ret; + } + + dev->net->netdev_ops = &aqc111_netdev_ops; + + return 0; +} + +static void aqc111_unbind(struct usbnet *dev, struct usb_interface *intf) +{ +} + static const struct driver_info aqc111_info = { .description = "Aquantia AQtion USB to 5GbE Controller", + .bind = aqc111_bind, + .unbind = aqc111_unbind, }; #define AQC111_USB_ETH_DEV(vid, pid, table) \