From patchwork Mon Nov 26 09:32:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Russkikh X-Patchwork-Id: 10697865 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 9F2DA15A8 for ; Mon, 26 Nov 2018 09:33:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8CF9429815 for ; Mon, 26 Nov 2018 09:33:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7C5122981A; Mon, 26 Nov 2018 09:33:05 +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 615E129815 for ; Mon, 26 Nov 2018 09:33:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726224AbeKZU0e (ORCPT ); Mon, 26 Nov 2018 15:26:34 -0500 Received: from mail-eopbgr770049.outbound.protection.outlook.com ([40.107.77.49]:37536 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726165AbeKZU0e (ORCPT ); Mon, 26 Nov 2018 15:26:34 -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=v4P1MzR/bivGpy8M8Kzo51N83JRRX7oosTCOxkMFJBg=; b=cVf2WNZ5vJCzmcuPlwjhiTvqcf4bvZ6GKxViu4fNWiQiVneTTNJcOuO+3TRYStXfighJOkPIdySa5XoxjSMjzWr70AMc3RX4acYRyCzuJiSSjOzBZqf8ONZdL8QOyC1knlSXrwCa6IfhZevNVhiNahRKaGGW+iN3IPCab7pG4Y4= Received: from BY1PR0701MB1660.namprd07.prod.outlook.com (10.162.110.22) by BY1PR0701MB1909.namprd07.prod.outlook.com (10.162.143.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1361.19; Mon, 26 Nov 2018 09:32:57 +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.019; Mon, 26 Nov 2018 09:32:57 +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 v4 net-next 00/21] Add support for Aquantia AQtion USB to 5/2.5GbE devices Thread-Topic: [PATCH v4 net-next 00/21] Add support for Aquantia AQtion USB to 5/2.5GbE devices Thread-Index: AQHUhWsDU51zrd/YN0ewXX5RZkSzxw== Date: Mon, 26 Nov 2018 09:32:56 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM6PR03CA0024.eurprd03.prod.outlook.com (2603:10a6:20b::37) 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;BY1PR0701MB1909;6:2bH2tj3W51gP6OAuI8qr60J/tZjBXfAmyN4QvgUH4VDJJe0NFIOBKK9YothyZ/rMbjoQvr+mEw16bfkIIuc/5D8hGV0phqbe5HCy7U+P25oz3fAClqyBn6OEKdPDERjPSKTPf5XpYHu9QOXq5MQsDjcPgNVd1LHMw5CZvCQ27oorkfYZK6R8TTxnZ3ip1HJNyXfuhzTYAj2bHnIJ/ugbSPwP2YRJ6LNAfw3vRqvfyM4qiXIkPMhkkPm7mTdwbT7+MajH4+xz1KW+NdLp5WNu4k9c7lM/8CfYdXI/QW2UcGn9NGbRmnNiJ2JqKQAheAXYy8PyXNXz6bUPiJ4UGL60jHruOyOIQ8pLo35lp74K0LnFtU2D96EOSR6OztUhxmNcDPSAvNuzwk/TDucTT/3SEbvxkC+tmAdCArSNvx9w7CgihuL29EI+vxrqtjT/FdecRoprj1Anw+cIAESdBKcmCQ==;5:RG7elzDrjI1y4NM1lgj2vRMfhAZkqhuZrBMlWVqzbeT8oejUyPNv9EA9bkRAyzpBx7E1Ovi68eKHjaMgmVzHAD/eqvJ4feCFwbMFe09KosjT1voJZciHSlMCwqcy6zZdcmRDhk0KBVotu39+Aqu/jEKe4b+SYy1L045fwejfni4=;7:T5H7UCoGkOv+QD/bdi/SgSpOCS91UPq898/dh4bL9BYro1og6wgALuGIolFsmRfUTfVG7YRDhI28X+PwooEJ9dBL7gcDuZ3ofWxbe4jHZ4AQJI20OhuP6gN08/a3e4luPaWrJIwRpuyAGIO3BZ8WKA== x-ms-office365-filtering-correlation-id: 06dc07a0-3d5d-4496-d8be-08d653822588 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390098)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:BY1PR0701MB1909; x-ms-traffictypediagnostic: BY1PR0701MB1909: 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)(3231443)(944501410)(52105112)(10201501046)(93006095)(93001095)(148016)(149066)(150057)(6041310)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(20161123558120)(201708071742011)(7699051)(76991095);SRVR:BY1PR0701MB1909;BCL:0;PCL:0;RULEID:;SRVR:BY1PR0701MB1909; x-forefront-prvs: 086831DFB4 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(376002)(346002)(366004)(136003)(396003)(39840400004)(189003)(199004)(186003)(107886003)(316002)(44832011)(6436002)(26005)(97736004)(2906002)(6486002)(53936002)(3846002)(8676002)(6512007)(71200400001)(5660300001)(7736002)(305945005)(486006)(476003)(2616005)(72206003)(256004)(106356001)(25786009)(14444005)(386003)(36756003)(6506007)(102836004)(105586002)(54906003)(110136005)(52116002)(66066001)(99286004)(71190400001)(478600001)(2501003)(4326008)(68736007)(6116002)(14454004)(86362001)(81166006)(2201001)(81156014)(8936002);DIR:OUT;SFP:1101;SCL:1;SRVR:BY1PR0701MB1909;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: Jtiq02fgy4vkCP7/2VrLLePadInLoK/CzTKWwn4K/Lo91g9BbLqzjhwjGDNkWKp9obkh8PmkxrPp6Bzf48nUJNRRH09ARtdfr27+Sh4dItvg9sanF2YIqm55AprZllMTh+XTRHR7hf7whUwzoSez904znx2cSmr23pSvEDcmRln06ggx0s8ESdL0eSSJ4WlSyoXW7Heu4WFoRNe9pHOoRVNcoO0qAIRED7fqJ0kjyb61ychlIcfi9ULMboXtcRHTR3l4YnGVIXIpxvf666XYw8xyhpvN5iPLous4Ow+RBbHkJy5fy07+BN5hS/9tgVH1CQHlr6TnFz41etoNIdB8uc6d3puPAwVbBia/kpYCArc= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: aquantia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 06dc07a0-3d5d-4496-d8be-08d653822588 X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Nov 2018 09:32:56.9146 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 83e2e134-991c-4ede-8ced-34d47e38e6b1 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1909 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 Patchset v3 includes following changes: - Use linkmode_copy instead of bitmap_copy - Remove Direct PHY access code since production HW will not have this mode anymore - Fix line over 80 symbols and alignments in cdc_ether patch - Add match for ECM configuration On start our HW reports both ECM and vendor configs. Linux prefers to use ECM driver and chooses active configuration which is for ecm driver (not for vendor specific). We need to match this configuration and forcibly switch configuration to vendor specific. Patchset v4 includes following changes: - Set gso_max_size. - Optimize accessing to descriptors - Use SKB_TRUESIZE macro. 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 | 1457 +++++++++++++++++++++++++++++++++++ drivers/net/usb/aqc111.h | 232 ++++++ drivers/net/usb/cdc_ether.c | 26 + 5 files changed, 1728 insertions(+) create mode 100644 drivers/net/usb/aqc111.c create mode 100644 drivers/net/usb/aqc111.h