From patchwork Tue Nov 13 14:44:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Russkikh X-Patchwork-Id: 10680849 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 BD36C13BF for ; Tue, 13 Nov 2018 14:44:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AAFE228D48 for ; Tue, 13 Nov 2018 14:44:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9EFE129208; Tue, 13 Nov 2018 14:44:37 +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 12FE828D48 for ; Tue, 13 Nov 2018 14:44:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387733AbeKNAnA (ORCPT ); Tue, 13 Nov 2018 19:43:00 -0500 Received: from mail-eopbgr810050.outbound.protection.outlook.com ([40.107.81.50]:34752 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726846AbeKNAnA (ORCPT ); Tue, 13 Nov 2018 19:43:00 -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=di/XUKQucEcmNPz5T3QN/FRmUymEhrLTDdV0dhDXwrk=; b=SsrXpvA/ON1z01TLU/8hi7OzFXaIcT2U8rn4VBOCd4kQ51QOGGEubGgFNfSiVOpaBiIHtu6wPxbvyWYamLrEslepkuWgm8sJluIWJTfbZgiyHYEbS5J9XSY1a1bvZHHgsgTwJ3PS10bazMTce7So5VQXbzkgKJd68TGclLtYSmQ= 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:31 +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:31 +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 00/21] Add support for Aquantia AQtion USB to 5/2.5GbE devices Thread-Topic: [PATCH v2 net-next 00/21] Add support for Aquantia AQtion USB to 5/2.5GbE devices Thread-Index: AQHUe19iX3SDMh4Ntkqa0goSLOnngg== Date: Tue, 13 Nov 2018 14:44:30 +0000 Message-ID: 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:jjaY4Jg+XrhoXMlftTGEoe3QhQ2mmZ8YRKFPoEn6kN6U1BYz3fNeutSzNeLGNwb8dHB36FsBUqmVD7Zjo6Qp3QoXynRJo04wG/203TJkscDhRShr0wSD6HhI7EmvHguky70YqBiqYwGx2xRpvNfpuZY+H0NRJdZ3aHUtLqMBbrgnwkepR0BMhYa2fNkOV7Is7/Lf41nIh4VLHk6KfOcdQOYdF3/GBe6mpspwvrSEEQhouYcefl4niJRRtG0Q97Y1VQ69pyazTzgjOTdiM5zQdIEbG26f95F5m5G/RB61mWUVFOGa09gNqS0qzSUTCi1YFjJQMJ1aIE4sSELY7lmLPrW9ejBn8HJthz1d6ojHLQN/DccRmxI1UhdM3dD88NR3tQ467Hgeq7vPpYcG8BXyxrwojDVszA5vfbjlqSWsGLVbTDwYZS/Q+Zl6CWBWA9kipDIEvUQuxIom07IGWYMOLw==;5:1tVPHkwZRkXZL6yrsGFWGNhPb7xARl3SfSIs4V/YMoF3RQvdAdJter3gilpDrDfA0Go58C/b2S3HSkyL9ZRWRmGYm97D4R9oziRLak6DsvjtVG6A6menpEa0Zqk49PozLVEhkzzVsu3ocxqNOqz7Zo7YSmyZhqF2uTOcGiFONvI=;7:Pva/HNy3vI0o3K+Hg3E7ftYHannz8wFIMdp5hUZciKhjq1qi9W4+FNAN8dMPX/5x5P/MvSqOExGk24GyD/gc5ArGGMw9vESLeN4vy+jWz8x5no/A+J+/MM0s5QVybT2t6eLTbd7tHvhLwv3+dIlZgA== x-ms-office365-filtering-correlation-id: 06ac6aa4-651f-47cd-60fa-08d6497684e2 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)(107886003)(105586002)(106356001)(36756003)(99286004)(52116002)(2900100001)(476003)(14454004)(2616005)(6916009)(6506007)(186003)(386003)(486006)(86362001)(8676002)(8936002)(102836004)(5660300001)(6486002)(256004)(81156014)(14444005)(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: jFVxy+Hu2nX/zxZ9Le47aex1l+6mr9R5npU93+7EU0chLLE9+/Q8qTYTdtqZG9eovh7uYQj1uEwq4xb6M129dch4ervCk18Xn/9vu8B2WlbYzpGTB0QjuERTlkwkxGj942/Fp4HXcRrzX1oG9R+SAf1MsY5KTrWUXQa5gHZqsczsVtapN2psbvhaQcXIFsn7X7w2U1aflTkHNC5z+zDwRm+V/rbuTxq9vrtraJXhw4fa6diX8gPJEi2/POlkHMT+yvxkGWEFrF2kbwrEKulNa86vmN9dbRouUVjOZlUFKDM6zIUfkabAJ/2oD3XFaPSJbXA/F4HFcvg5vjMPf7qDcq/OBgP4BUKIyNfzMOSDX1Y= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: aquantia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 06ac6aa4-651f-47cd-60fa-08d6497684e2 X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Nov 2018 14:44:30.8994 (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 This patchset introduces support for new multigig ethernet to USB dongle, developed jointly by Aquantia (Phy) and ASIX (USB MAC). The driver has similar structure with other ASIX MAC drivers (AX88179), but with a number of important differences: - Driver supports both direct Phy and custom firmware interface for Phy programming. This is due to different firmware modules available with this product. - Driver handles new 2.5G/5G link speed configuration and reporting. - Device support all speeds from 100M up to 5G. - Device supports MTU up to 16K. Device supports various standard networking features, like checksum offloads, vlan tagging/filtering, TSO. The code of this driver is based on original ASIX sources and was extended by Aquantia for 5G multigig support. Patchset v2 includes following changes: - Function variables declarions fixed to reverse xmass tree - Improve patch layout structure - Remove unnecessary curly braces in switch/case statements - Use 'packed' attribute for HW structures only - Use eth_mac_addr function in set_mac_addr callback - Remove unnecessary 'memset' calls. - Read MAC address from EEPROM function has now better name - Use driver_priv field to store context. It avoids ugly cast. - Set max_mtu field. Remove check for MTU size - Rewrite read/write functions. Add helpers for read/write 16/32 bit values - Use mask and shifts instead of bitfields to support BE platforms. - Use stack allocated buffer for configuring mcast filters - Use AUTONEG_ENABLE when go to suspend state - Pad out wol_cfg field from context structure. Use stack allocated instead - Remove driver version - Check field 'duplex' in set_link_ksetting callback as well - Use already created defines in usb matching macro - Rename phy_ops struct to phy_cfg - Use ether_addr_copy for copying mac address - Add fall-through comment in switch/case for avoid checkpatch warning - Remove match for CDC ether device - Add ASIX's HW id-s to match this driver - Add all HW id-s with which driver can work to blacklist of cdc_ether driver Dmitry Bezrukov (21): net: usb: aqc111: Driver skeleton for Aquantia AQtion USB to 5GbE net: usb: aqc111: Add bind and empty unbind callbacks net: usb: aqc111: Add implementation of read and write commands net: usb: aqc111: Various callbacks implementation net: usb: aqc111: Introduce PHY access net: usb: aqc111: Introduce link management net: usb: aqc111: Add support for getting and setting of MAC address net: usb: aqc111: Implement TX data path net: usb: aqc111: Implement RX data path net: usb: aqc111: Add checksum offload support net: usb: aqc111: Add support for changing MTU net: usb: aqc111: Add support for enable/disable checksum offload net: usb: aqc111: Add support for TSO net: usb: aqc111: Implement set_rx_mode callback net: usb: aqc111: Add support for VLAN_CTAG_TX/RX offload net: usb: aqc111: Add RX VLAN filtering support net: usb: aqc111: Initialize ethtool_ops structure net: usb: aqc111: Implement get/set_link_ksettings callbacks net: usb: aqc111: Add support for wake on LAN by MAGIC packet net: usb: aqc111: Add ASIX's HW ids net: usb: aqc111: Extend cdc_ether blacklist drivers/net/usb/Kconfig | 12 + drivers/net/usb/Makefile | 1 + drivers/net/usb/aqc111.c | 1605 +++++++++++++++++++++++++++++++++++++++++++ drivers/net/usb/aqc111.h | 275 ++++++++ drivers/net/usb/cdc_ether.c | 23 + 5 files changed, 1916 insertions(+) create mode 100644 drivers/net/usb/aqc111.c create mode 100644 drivers/net/usb/aqc111.h