From patchwork Wed Nov 21 10:13:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Russkikh X-Patchwork-Id: 10692249 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 C4E2613BB for ; Wed, 21 Nov 2018 10:13:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B2F8529412 for ; Wed, 21 Nov 2018 10:13:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A4C132975D; Wed, 21 Nov 2018 10:13:36 +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 423E829412 for ; Wed, 21 Nov 2018 10:13:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729060AbeKUUrT (ORCPT ); Wed, 21 Nov 2018 15:47:19 -0500 Received: from mail-eopbgr790082.outbound.protection.outlook.com ([40.107.79.82]:39040 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728819AbeKUUrR (ORCPT ); Wed, 21 Nov 2018 15:47:17 -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=il5hEo6qo93YqtsC/s7st6mFX8OCl+reC3l9+lO/g30=; b=dGZENPIKX+qbc0yhvd54tzbEVfRmEpoehkW1bSaCzgUQxf9aWHS0A2qw/knfgyiWTYXrNAHv3UdfDvL+Mk86Ku8OFJj4ecYfwcXPXp9MrIHr9TP+T/3tg7aUWX35d/8tIQKIMy0ENjxsvOZmznta4x6U3oMM/rY8ctH+Pwg8Pp4= Received: from BY1PR0701MB1660.namprd07.prod.outlook.com (10.162.110.22) by BY1PR0701MB1159.namprd07.prod.outlook.com (10.160.105.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.36; Wed, 21 Nov 2018 10:13:24 +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:24 +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 02/21] net: usb: aqc111: Add bind and empty unbind callbacks Thread-Topic: [PATCH v3 net-next 02/21] net: usb: aqc111: Add bind and empty unbind callbacks Thread-Index: AQHUgYLW0BgGhCR8Uk2b5nvFyMW3LA== Date: Wed, 21 Nov 2018 10:13:24 +0000 Message-ID: <3d48ecb94cb10a4bb38de171c71368cb78bb23de.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;BY1PR0701MB1159;6:1pVDah5jPE88sPNjhrixKMNT1LaqMfRRn+PBlqhf4iTY34jLa+/49Mzegoya+R9egnPAspvPcMs9ZN1vPrAvPHwz8mytmiP4kvL4MsvV14HGNZehccK+uU7XkbssVj6IRM1eMJcpgKDvKlTWm6C65jTSYD7r/a8nq9wfRxWwwxzwmUpFXFwU+cfJQQBN+P13Mpte1NOv1/PM+Old/YxOAxgzXso5ZMKQzal2DUC4m6tAwXtN2CT3LJK1moWUoDB/o2zsunGnWROUYB+n4AY296Ox3YU1bD7NWJV9sLHqWqpK6y2Wfhqbd+cGiqXQOTeQlHZy8S8bh9tud+eD3bXNe9TY1cHqz9V0usbVV9xf3NoZ5hneDcgBQILxfb9BpNI7YWEqgRLL0yhDHDjQH8OTxKpczHngPkaNLc/3a1kCl6hN/S03pNXmpsA5lra/2y14df62uiPmIcqgMgPAOdst8EZqhS/jspfP5IckQGbiY30=;5:7LOCJDug9OYLbqfk9xfR2QwgbrcxfCl9M8x8FLxiqd4xoCXyI8LdgCAd2lycgAksvAjI6bxU8WcMM5ODX1/0MIWkNySdY8uNOSH0ldR4lDF35vmZA557jLM82PsWiZdyyjoLTf2h22MRp20XbjgS8NU/W+xCMBRubE8zKCMILcg=;7:UK1TMymsA7yj5DZ0xCv/DFTxzenUaQdszmD7VfVsHpXIEGEFdfhVgEqll9P3sn/qfuPZ4a3LF3+1BlSnkA9IYUX/y7WgdOteflY9WQzAoGnRGILWPDWNtqWG+P5mqLhZhSNW5uFHf0tJyTerEzrmGw== x-ms-office365-filtering-correlation-id: f1e1ea3a-0da1-49fe-548b-08d64f99f892 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390098)(7020095)(4652040)(8989299)(5600074)(711020)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020);SRVR:BY1PR0701MB1159; x-ms-traffictypediagnostic: BY1PR0701MB1159: 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)(93006095)(93001095)(3231442)(944501410)(52105112)(10201501046)(3002001)(148016)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123562045)(20161123560045)(201708071742011)(7699051)(76991095);SRVR:BY1PR0701MB1159;BCL:0;PCL:0;RULEID:;SRVR:BY1PR0701MB1159; x-forefront-prvs: 08635C03D4 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(346002)(39850400004)(396003)(376002)(366004)(136003)(189003)(199004)(186003)(386003)(446003)(44832011)(71200400001)(476003)(2616005)(66066001)(256004)(6506007)(97736004)(71190400001)(81166006)(8936002)(102836004)(2900100001)(81156014)(118296001)(11346002)(68736007)(26005)(486006)(99286004)(52116002)(14454004)(305945005)(7736002)(2906002)(478600001)(6512007)(86362001)(76176011)(5660300001)(3846002)(53936002)(6116002)(107886003)(106356001)(4326008)(105586002)(110136005)(316002)(25786009)(72206003)(36756003)(54906003)(8676002)(2201001)(2501003)(6436002)(6486002);DIR:OUT;SFP:1101;SCL:1;SRVR:BY1PR0701MB1159;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: pEgWuvBWaaY8B+DSBY9524U2sU/xcFtq3e3vIEKz8mm54MAXtKSzMPrPheRUvCIyBtE9vuDg+Q51J9Slz2fYptUdFZqN5oMhcQFi1HrO80mG3ppamIQht3XKHuKTEeJRP7TJJBlJTiC47o9WUK9UMrgMz1QQWsP3mIaDfUvkWw+0ze2gXrWQfvm1Igz2yBwvR/wq0paZjDn6GxmmwriKyi4CKg6gSCgsfmQauGv9G64riNiiX8zbZD/Pv0pQbldNDL7z/SdqFcbCk/yOdgLj5nwmvMq7kv8XDu9KDdP4QZS5JEPmj+ozRe+u2LYiHutLD5OCwSzcR+5u5plbksDt2c234wvtYIpbenretvfWGVA= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: aquantia.com X-MS-Exchange-CrossTenant-Network-Message-Id: f1e1ea3a-0da1-49fe-548b-08d64f99f892 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Nov 2018 10:13:24.2184 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 83e2e134-991c-4ede-8ced-34d47e38e6b1 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1159 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 96aca929b570..a2628856c580 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) \