From patchwork Fri Oct 5 10:24:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Russkikh X-Patchwork-Id: 10627827 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 EEE3915A6 for ; Fri, 5 Oct 2018 10:24:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DFCEA28FD5 for ; Fri, 5 Oct 2018 10:24:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D0A8128FE7; Fri, 5 Oct 2018 10:24:47 +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 16C3F28FDE for ; Fri, 5 Oct 2018 10:24:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728072AbeJERWx (ORCPT ); Fri, 5 Oct 2018 13:22:53 -0400 Received: from mail-bn3nam01on0079.outbound.protection.outlook.com ([104.47.33.79]:58664 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727879AbeJERWw (ORCPT ); Fri, 5 Oct 2018 13:22:52 -0400 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=Yr8LkLODv/nRGgH3X2izvJs1G8OwXjEh4TU9/2V0NEI=; b=TUoqbdnwlp0oYntmNZQaQXzA7iAvrfK38T4vWGfVizIrvwvk07LcmRkKC3Lh7+RV57jg63doEsIYFX9bfAKSN9UCagrpoVCLWUS2HyTZHohTN5zudLCIjsBRriJkxDGP9ObQor2NMOH/mo6WoG6Sp4OlTxlhscVP2inrk+mW35A= Received: from BY1PR0701MB1660.namprd07.prod.outlook.com (10.162.110.22) by BY1PR0701MB1641.namprd07.prod.outlook.com (10.162.110.158) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1207.21; Fri, 5 Oct 2018 10:24:40 +0000 Received: from BY1PR0701MB1660.namprd07.prod.outlook.com ([fe80::346d:e756:e70e:17]) by BY1PR0701MB1660.namprd07.prod.outlook.com ([fe80::346d:e756:e70e:17%2]) with mapi id 15.20.1207.021; Fri, 5 Oct 2018 10:24:40 +0000 From: Igor Russkikh To: "David S . Miller" CC: "linux-usb@vger.kernel.org" , "netdev@vger.kernel.org" , Igor Russkikh , Dmitry Bezrukov Subject: [PATCH net-next 01/19] net: usb: aqc111: Driver skeleton for Aquantia AQtion USB to 5GbE Thread-Topic: [PATCH net-next 01/19] net: usb: aqc111: Driver skeleton for Aquantia AQtion USB to 5GbE Thread-Index: AQHUXJWfV3v5aQacOk2/wRxlMm4j7w== Date: Fri, 5 Oct 2018 10:24:39 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM5PR0602CA0024.eurprd06.prod.outlook.com (2603:10a6:203:a3::34) 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;BY1PR0701MB1641;6:VJPNBsS6srBwmTFD5WyaUKIlLlaGdr+0daVvC0DZsNonfk141hw9Me4FweKvWgXm5d2GdPtE8lEPBYQoKI4GKAtW3RGXbDxFhcw6MSbEyXO/3vQguaeYtMgNVbm0bLxs4YulvldptC0GaQLqrbEBrEg3o40yxCqBrYj8Gkea6wRrpLkLsChuz+YtoQ+oyASKAMDQQoDPbOhRiSQlWluXLPDGq++d1Ihahx9tBcpCdTc5D8r5mNBxf0l/EwAvMw1/5Fzb/JP8En36cP0mGj4VKxqpTnAw6pl6dvdjpHlUJFkqZuvKmqAwubUDQST9+52aoE0it6UClSa5bkOg7KK5S4VXxkSl8SBX6g9+ldS0d7afHJEDSqmUrZzCPZb+kAWGmNO831+T81NN2+UDXfD5cz0JQTw0UoLu2LNqHJ8HJvKOlaaoWvt0WdetlAN+XTIVqgpxldR2gFqJE0Jqeif2vw==;5:D0lvK/nHik0Ip0wWTZvK81JvkcZpA0Z62dyivoQb/P+ZWArhROFpDuJ6LWPV7JmJ05IG+P/EK+dPeyxiy6lCU8DF5L3X4fhdEgUy6Iemh5M0K/NwPn2MW3w6gElk9SUjtkQNynsGgCytyYBEzRVkwDOlHTUMfOfalBqxynhmWyI=;7:mTrDMDyDxn/VbrnHbuHsamdgGQdllSbVjpiA+0kP/gmnTV5z0C6+cCMfFLiouYLjHIPHIAH8CiTO2YHpUkwbTsW2+WCOeNF0mop2VR7myNAIJ4o/XhAmbggcL/fbEJyw3rdrQtrDBM8t7fD5W1KgR0xGQQE/ecRP1c6syW0O5IJmC/pfg6j19JNu+NqY6BYAb/bts/vvZTBxLUrsYqn29iVOPVblwBIOT38Zyf9R9F/MR3XUykAMIIkgDipaE4LC x-ms-office365-filtering-correlation-id: d3e0cb3b-9697-4c73-6a5c-08d62aacc1cf x-microsoft-antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:BY1PR0701MB1641; x-ms-traffictypediagnostic: BY1PR0701MB1641: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(112561432440764); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(8121501046)(5005006)(3231355)(944501410)(52105095)(3002001)(10201501046)(93006095)(93001095)(149066)(150057)(6041310)(20161123564045)(20161123562045)(20161123558120)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051);SRVR:BY1PR0701MB1641;BCL:0;PCL:0;RULEID:;SRVR:BY1PR0701MB1641; x-forefront-prvs: 0816F1D86E x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(376002)(366004)(346002)(136003)(39850400004)(396003)(199004)(189003)(81166006)(81156014)(6436002)(86362001)(8676002)(118296001)(316002)(14454004)(6512007)(8936002)(66066001)(256004)(386003)(2900100001)(11346002)(2906002)(6506007)(6486002)(52116002)(36756003)(107886003)(3846002)(486006)(53936002)(71190400001)(476003)(99286004)(105586002)(97736004)(26005)(44832011)(2616005)(68736007)(54906003)(186003)(5660300001)(5250100002)(71200400001)(446003)(76176011)(7736002)(4326008)(102836004)(106356001)(305945005)(478600001)(6116002)(6916009)(72206003)(25786009);DIR:OUT;SFP:1101;SCL:1;SRVR:BY1PR0701MB1641;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: FKdWWZuoGiTb/H+ZQMkXtAIi8OsYOJnkQWRrbmVY02TJUSKnRD0JwLdgClKNNEXBBcdUg5azgWRkBSVymiZYWTz+Ko6PXVY70rHOnlUlxpUrFF4oAxVu+t4q/zegK3bcx3J+vbKxLIwViVkQJSlIRuuzAJ7Eu/NR82ImPrsF2b11FzwBBM7LMYnFMCtQlbfq1vp7x9Uv7P5vZp3prdGUsx+3St9h7D6FPjujjQLeGIDBhfrp8iV5A4zf4YrN9Gs/f5+r5NhKxlaa0ZhiDmQExpoNONXW9ueyzbF1N69lDsrbROkJ1fDp8qiKKgYJx50xy4Ft84R6nOzTL4e/r6FssFx5WlCCD5s2cwHIDOiYYTc= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: aquantia.com X-MS-Exchange-CrossTenant-Network-Message-Id: d3e0cb3b-9697-4c73-6a5c-08d62aacc1cf X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Oct 2018 10:24:39.9622 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 83e2e134-991c-4ede-8ced-34d47e38e6b1 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1641 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 usb_driver structure skeleton Signed-off-by: Dmitry Bezrukov Signed-off-by: Igor Russkikh --- drivers/net/usb/Kconfig | 12 +++++++++++ drivers/net/usb/Makefile | 1 + drivers/net/usb/aqc111.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 65 insertions(+) create mode 100644 drivers/net/usb/aqc111.c diff --git a/drivers/net/usb/Kconfig b/drivers/net/usb/Kconfig index 418b0904cecb..e5fb8ef2d815 100644 --- a/drivers/net/usb/Kconfig +++ b/drivers/net/usb/Kconfig @@ -613,4 +613,16 @@ config USB_NET_CH9200 To compile this driver as a module, choose M here: the module will be called ch9200. +config USB_NET_AQC111 + tristate "Aquantia AQtion USB to 5/2.5GbE Controllers support" + depends on USB_USBNET + select CRC32 + default y + help + This option adds support for Aquantia AQtion USB + Ethernet adapters based on AQC111U/AQC112 chips. + + This driver should work with at least the following devices: + * Aquantia AQtion USB to 5GbE + endif # USB_NET_DRIVERS diff --git a/drivers/net/usb/Makefile b/drivers/net/usb/Makefile index 27307a4ab003..99fd12be2111 100644 --- a/drivers/net/usb/Makefile +++ b/drivers/net/usb/Makefile @@ -40,3 +40,4 @@ obj-$(CONFIG_USB_VL600) += lg-vl600.o obj-$(CONFIG_USB_NET_QMI_WWAN) += qmi_wwan.o obj-$(CONFIG_USB_NET_CDC_MBIM) += cdc_mbim.o obj-$(CONFIG_USB_NET_CH9200) += ch9200.o +obj-$(CONFIG_USB_NET_AQC111) += aqc111.o diff --git a/drivers/net/usb/aqc111.c b/drivers/net/usb/aqc111.c new file mode 100644 index 000000000000..250e8ff65110 --- /dev/null +++ b/drivers/net/usb/aqc111.c @@ -0,0 +1,52 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* Aquantia Corp. Aquantia AQtion USB to 5GbE Controller + * Copyright (C) 2003-2005 David Hollis + * Copyright (C) 2005 Phil Chang + * Copyright (C) 2002-2003 TiVo Inc. + * Copyright (C) 2017-2018 ASIX + * Copyright (C) 2018 Aquantia Corp. + */ + +#include +#include +#include +#include +#include +#include + +static const struct driver_info aqc111_info = { + .description = "Aquantia AQtion USB to 5GbE Controller", +}; + +#define AQC111_USB_ETH_DEV(vid, pid, table) \ + .match_flags = USB_DEVICE_ID_MATCH_DEVICE | \ + USB_DEVICE_ID_MATCH_INT_CLASS, \ + USB_DEVICE(vid, pid), \ + .bInterfaceClass = USB_CLASS_VENDOR_SPEC, \ + .driver_info = (unsigned long)&table, \ +}, \ +{ \ + .match_flags = USB_DEVICE_ID_MATCH_DEVICE | \ + USB_DEVICE_ID_MATCH_INT_INFO, \ + USB_DEVICE(vid, pid), \ + .bInterfaceClass = USB_CLASS_COMM, \ + .bInterfaceSubClass = USB_CDC_SUBCLASS_ETHERNET, \ + .bInterfaceProtocol = USB_CDC_PROTO_NONE + +static const struct usb_device_id products[] = { + {AQC111_USB_ETH_DEV(0x2eca, 0xc101, aqc111_info)}, + { },/* END */ +}; +MODULE_DEVICE_TABLE(usb, products); + +static struct usb_driver aq_driver = { + .name = "aqc111", + .id_table = products, + .probe = usbnet_probe, + .disconnect = usbnet_disconnect, +}; + +module_usb_driver(aq_driver); + +MODULE_DESCRIPTION("Aquantia AQtion USB to 5/2.5GbE Controllers"); +MODULE_LICENSE("GPL");