From patchwork Thu Sep 19 10:52:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 11152173 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4AA2114DB for ; Thu, 19 Sep 2019 10:55:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1CC4C2196E for ; Thu, 19 Sep 2019 10:55:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="bF4YMzoL" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389132AbfISKwj (ORCPT ); Thu, 19 Sep 2019 06:52:39 -0400 Received: from mail-eopbgr700070.outbound.protection.outlook.com ([40.107.70.70]:25057 "EHLO NAM04-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2387501AbfISKwj (ORCPT ); Thu, 19 Sep 2019 06:52:39 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=neyUv3k9LleBOICbKRqCvkPZw3px+potVJLM6iwCUM5dTwh7SOaeMlIyUz6jNloo2FHsoelIhv7I5Z3hiCtpH4iPgGSQmJyf4iaE43JgNJAsAoYXkvDAE7cYwi41QkeFI1nfBrXGOfXaoZ6ccOGdd+enNBd9zXWe80SiuZLf4Kh+7L6GMFmexZFbNYP/tzlMAMedVBlSMYkspvmUgtlWVUWFpH0hy5qru5/FcprT3Llw2qO4A3GxNApg0aKZ0Ahx9DJI0U/5TNB1bEr3vs4EFK/pVeA1x70Sb6K8Nj1JGAu8AlwjOrHdkYY05bMOtTZv+4gbPXW89KpiwnE8uyhJDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uzs3Q62jhIjXKenG6BKkrmzRAFJrR/dX+BYk1MBOtQs=; b=WB8coY76UTiYVsnIPhh//xz97KfrU0wxiNRsRnofwtkW7FkX32otWxz1AXMkxXiilJ1k6qvQBXrnMWVbWktDo/clRC+0bdOUl1qWx3uPh4YNZpQKoszCxKTUG5U+weOd+7bUS7+y1eT8ho7d2YZBu9roACpnVxO03NYGGLeKeFnZkol9lixYpLm3GxNmA/1NigaZ0f5YwK/6hhcMGTAFUk96RmrmXzDT/ozJheoN7Zl6NT/4arIoFv0s4OtKYUbvk3CxteT9NrhXzrHYQIezngxnDoJ/IxWJDsptBfXzTTI8xOIQmnKkFJw4lRlXyvetku7B/Ml/O4Xy9vvwwFX9nQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=silabs.com; dmarc=pass action=none header.from=silabs.com; dkim=pass header.d=silabs.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silabs.onmicrosoft.com; s=selector2-silabs-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uzs3Q62jhIjXKenG6BKkrmzRAFJrR/dX+BYk1MBOtQs=; b=bF4YMzoLoxeaqevk3SG/PRqI60HaNaAMV5Ius5oG97+kr5zXg/M4ger613MbDMqztBqskUWed/6kTCFGwdQHtnSzUnPm3AiDGieQj0j/mQbtG/1MopFbnbkZubEKuw2AAmZGOBF8HThWSXsoNWvTTkvPWF7UOOCa6EwDVVpvKcs= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (20.179.149.217) by MN2PR11MB3775.namprd11.prod.outlook.com (20.178.253.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2263.17; Thu, 19 Sep 2019 10:52:34 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::45dc:e073:4446:4bf8]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::45dc:e073:4446:4bf8%3]) with mapi id 15.20.2263.023; Thu, 19 Sep 2019 10:52:34 +0000 From: Jerome Pouiller To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , David Le Goff , Jerome Pouiller Subject: [PATCH 00/20] Add support for Silicon Labs WiFi chip WF200 and further Thread-Topic: [PATCH 00/20] Add support for Silicon Labs WiFi chip WF200 and further Thread-Index: AQHVbthX+pfBONMKyU+hu+poCWe07A== Date: Thu, 19 Sep 2019 10:52:34 +0000 Message-ID: <20190919105153.15285-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 80c43d06-0a03-435a-cf29-08d73cef7a3b x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(5600167)(711020)(4605104)(1401327)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7193020);SRVR:MN2PR11MB3775; x-ms-traffictypediagnostic: MN2PR11MB3775: x-ms-exchange-purlcount: 2 x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:469; x-forefront-prvs: 016572D96D x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6029001)(366004)(376002)(346002)(39850400004)(136003)(396003)(53754006)(199004)(189003)(86362001)(256004)(14444005)(8936002)(4326008)(66066001)(36756003)(14454004)(305945005)(64756008)(5660300002)(66476007)(66556008)(66446008)(316002)(476003)(966005)(110136005)(2616005)(66946007)(478600001)(91956017)(25786009)(76116006)(7736002)(71190400001)(81166006)(1076003)(2501003)(6506007)(186003)(6436002)(486006)(81156014)(3846002)(6116002)(8676002)(102836004)(107886003)(54906003)(6306002)(2906002)(26005)(66574012)(99286004)(6486002)(71200400001)(6512007);DIR:OUT;SFP:1101;SCL:1;SRVR:MN2PR11MB3775;H:MN2PR11MB4063.namprd11.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: VPKDC/4gHi8bktVEUdiX8QWcCfM6c/4IkXeQY13DDuvT+nO98Xjl8u0s867xj30yuP4yaL4zK18bdoxiYyVHaBVx2/OnrRZDX8uFuU4DGoLpg1SG2s1wNA8jkwRzHeszEgOZPnn2PTnZJJfYgmQ65G+pMG3UEH0RLydwkaeVfzfu49vXj/FJQcEptGW0sPpTZlEDAN6EwOqFPWYKyRbYzzlczWV4LLIICun3A07vt8OOL+g5pD0sbldKOIRtnNKR962nKb+S6/+Of79Yf29ktEONJlTpjump0VIpsoZfv35vd/nITxY6dR8p2h3PhHf6OJcSI4N3x5km73XEQvB35B095l4Dlun+hdjA1/SLOSQ9zgq3Qv2TBmhYJipdcMCq04irYSpltCzJ6O+83PWLOplEUIRxclVbhv4k+zIjrIY= Content-ID: <3D88C0D7570AA6498E8AF58EDCF6D001@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 80c43d06-0a03-435a-cf29-08d73cef7a3b X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Sep 2019 10:52:34.0605 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 54dbd822-5231-4b20-944d-6f4abcd541fb X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Vt29wb8jChEO9dLkWTqHFC6mxOvB5C2n8vrq66imFRAO5hZHXr5see9d+Y2uz0hqlUIyIzKQS6FmjdYaJzrpyg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3775 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller Hello all, This series add support for Silicon Labs WiFi chip WF200 and further: https://www.silabs.com/documents/public/data-sheets/wf200-datasheet.pdf This driver is an export from: https://github.com/SiliconLabs/wfx-linux-driver/ I squashed all commits from github (it definitely does not make sense to import history). Then I split it in comprehensible (at least try to be) commits. I hope it will help readers to understand driver architecture. IMHO, firsts commits are clean enough to be reviewed. Things get more difficult when I introduce mac8011 API. I tried to extract important parts like Rx/Tx process but, big and complex patches seem unavoidable in this part. Architecture itself is described in commit messages. The series below is aligned on version 2.3.1 on github. If compare this series with github, you will find traditional differences between external and a in-tree driver: Documentation, build infrastructure, etc... In add, I dropped all code in CONFIG_WFX_SECURE_LINK. Indeed, "Secure Link" feature depends on mbedtls and I don't think to pull mbedtls in kernel is an option (see "To be done" below). What need to be done in this driver to leave staging area? - I kept wfx_version.h in order to ensure synchronization with github waiting for development goes entirely in kernel - I also kept compatibility code for earlier Linux kernel version. I may drop it in future. Maybe I will maintain compatibility with older kernels in a external set of patches. - I have to make decision about secure link support. I can: - drop completely - keep it in an external patch (my preferred option) - replace call to mbedtls with kernel crypto API (necessitate a bunch of work) - pull mbedtls in kernel (non-realistic) - mac80211 interface does not (yet) have expected quality to be placed outside of staging: - Some processings are redundant with mac80211 ones - Many members from wfx_dev/wfx_vif can be retrieved from mac80211 structures - Some functions are too complex - ... Jérôme Pouiller (20): staging: wfx: add infrastructure for new driver staging: wfx: add support for I/O access staging: wfx: add I/O API staging: wfx: add tracepoints for I/O access staging: wfx: load firmware staging: wfx: import HIF API headers staging: wfx: add IRQ handling staging: wfx: add tracepoints for HIF staging: wfx: add support for start-up indication staging: wfx: instantiate mac80211 data staging: wfx: allow to send commands to chip staging: wfx: add HIF commands helpers staging: wfx: introduce "secure link" staging: wfx: setup initial chip configuration staging: wfx: add debug files and trace debug events staging: wfx: allow to send 802.11 frames staging: wfx: allow to receive 802.11 frames staging: wfx: allow to scan networks staging: wfx: implement 802.11 key handling staging: wfx: implement the rest of mac80211 API MAINTAINERS | 5 + drivers/staging/Kconfig | 2 + drivers/staging/Makefile | 1 + .../bindings/net/wireless/siliabs,wfx.txt | 97 + drivers/staging/wfx/Kconfig | 7 + drivers/staging/wfx/Makefile | 24 + drivers/staging/wfx/bh.c | 316 ++++ drivers/staging/wfx/bh.h | 32 + drivers/staging/wfx/bus.h | 34 + drivers/staging/wfx/bus_sdio.c | 268 +++ drivers/staging/wfx/bus_spi.c | 335 ++++ drivers/staging/wfx/data_rx.c | 213 +++ drivers/staging/wfx/data_rx.h | 18 + drivers/staging/wfx/data_tx.c | 799 ++++++++ drivers/staging/wfx/data_tx.h | 93 + drivers/staging/wfx/debug.c | 322 ++++ drivers/staging/wfx/debug.h | 19 + drivers/staging/wfx/fwio.c | 397 ++++ drivers/staging/wfx/fwio.h | 15 + drivers/staging/wfx/hif_api_cmd.h | 681 +++++++ drivers/staging/wfx/hif_api_general.h | 437 +++++ drivers/staging/wfx/hif_api_mib.h | 558 ++++++ drivers/staging/wfx/hif_rx.c | 336 ++++ drivers/staging/wfx/hif_rx.h | 18 + drivers/staging/wfx/hif_tx.c | 470 +++++ drivers/staging/wfx/hif_tx.h | 67 + drivers/staging/wfx/hif_tx_mib.h | 281 +++ drivers/staging/wfx/hwio.c | 338 ++++ drivers/staging/wfx/hwio.h | 75 + drivers/staging/wfx/key.c | 272 +++ drivers/staging/wfx/key.h | 22 + drivers/staging/wfx/main.c | 504 +++++ drivers/staging/wfx/main.h | 48 + drivers/staging/wfx/queue.c | 606 ++++++ drivers/staging/wfx/queue.h | 59 + drivers/staging/wfx/scan.c | 298 +++ drivers/staging/wfx/scan.h | 42 + drivers/staging/wfx/secure_link.h | 46 + drivers/staging/wfx/sta.c | 1682 +++++++++++++++++ drivers/staging/wfx/sta.h | 116 ++ drivers/staging/wfx/traces.h | 439 +++++ drivers/staging/wfx/wfx.h | 234 +++ drivers/staging/wfx/wfx_version.h | 3 + 43 files changed, 10629 insertions(+) create mode 100644 drivers/staging/wfx/Documentation/devicetree/bindings/net/wireless/siliabs,wfx.txt create mode 100644 drivers/staging/wfx/Kconfig create mode 100644 drivers/staging/wfx/Makefile create mode 100644 drivers/staging/wfx/bh.c create mode 100644 drivers/staging/wfx/bh.h create mode 100644 drivers/staging/wfx/bus.h create mode 100644 drivers/staging/wfx/bus_sdio.c create mode 100644 drivers/staging/wfx/bus_spi.c create mode 100644 drivers/staging/wfx/data_rx.c create mode 100644 drivers/staging/wfx/data_rx.h create mode 100644 drivers/staging/wfx/data_tx.c create mode 100644 drivers/staging/wfx/data_tx.h create mode 100644 drivers/staging/wfx/debug.c create mode 100644 drivers/staging/wfx/debug.h create mode 100644 drivers/staging/wfx/fwio.c create mode 100644 drivers/staging/wfx/fwio.h create mode 100644 drivers/staging/wfx/hif_api_cmd.h create mode 100644 drivers/staging/wfx/hif_api_general.h create mode 100644 drivers/staging/wfx/hif_api_mib.h create mode 100644 drivers/staging/wfx/hif_rx.c create mode 100644 drivers/staging/wfx/hif_rx.h create mode 100644 drivers/staging/wfx/hif_tx.c create mode 100644 drivers/staging/wfx/hif_tx.h create mode 100644 drivers/staging/wfx/hif_tx_mib.h create mode 100644 drivers/staging/wfx/hwio.c create mode 100644 drivers/staging/wfx/hwio.h create mode 100644 drivers/staging/wfx/key.c create mode 100644 drivers/staging/wfx/key.h create mode 100644 drivers/staging/wfx/main.c create mode 100644 drivers/staging/wfx/main.h create mode 100644 drivers/staging/wfx/queue.c create mode 100644 drivers/staging/wfx/queue.h create mode 100644 drivers/staging/wfx/scan.c create mode 100644 drivers/staging/wfx/scan.h create mode 100644 drivers/staging/wfx/secure_link.h create mode 100644 drivers/staging/wfx/sta.c create mode 100644 drivers/staging/wfx/sta.h create mode 100644 drivers/staging/wfx/traces.h create mode 100644 drivers/staging/wfx/wfx.h create mode 100644 drivers/staging/wfx/wfx_version.h