From patchwork Tue May 24 12:06:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Singh X-Patchwork-Id: 576825 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 526ACC433EF for ; Tue, 24 May 2022 12:06:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237151AbiEXMGc (ORCPT ); Tue, 24 May 2022 08:06:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234556AbiEXMG2 (ORCPT ); Tue, 24 May 2022 08:06:28 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E5DB13FB6 for ; Tue, 24 May 2022 05:06:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1653393986; x=1684929986; h=from:to:cc:subject:date:message-id: content-transfer-encoding:mime-version; bh=odeIMyRM/MeJ6/NrTOUkM7IkOttnM6ngr8bg966M+0M=; b=xwac0JfAEU3lcawSwAHZ+r4wJ0jLT4jaPljTU5aZlqxbqG1pLJtoO7DL U9qC6UvuUeZTOcZF0XxULObeedSUI8us9eA2ZTTeqOpBogdLoUbfjD6f2 +9RHpgN1PS/fagSHLfCgc0PO25pK9YpA+ErpGNVOLCLu5isEIdZDjbLyW 0fS3oV/yc3DZiyIAtse8Tl/g2WuAC2o6ci2EdnPTqLLOryUofbODwJoLF dw1p2wnqguqxKCmcisv9sFKeDhyTae10hL0spkwsOtDsVjoS/GlTF5cbQ 4NnjHBHxIvuVDtNSY56vvNVjRo5T7bgh54KS5uBE73s3EM/vICb5U6yc9 w==; X-IronPort-AV: E=Sophos;i="5.91,248,1647327600"; d="scan'208";a="174813198" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 24 May 2022 05:06:26 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.17; Tue, 24 May 2022 05:06:26 -0700 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.87.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.17 via Frontend Transport; Tue, 24 May 2022 05:06:26 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hnAIntz1IMHPoTq3W7uBps8ieE/+H6I5PVv77wS87bAMoWIFzMjLkIKsIQaJDS/uGnm3EC+D01Cs26GaFMpTidN/sxmDn+yp6kYsJAH1V/BOUZ+L++9HWVCJQ17d2D3CAbVJPOecISh40tmP1Oa29/HNvp5yuQc4HuyQa6PWRuzzg+1JnKFWqgokUv0YnYmmhuetuawYZDXRncakOZBVyJIF8kaPWkR37dd1IMJOArqJrfrWu7rGeQLLgwTFpEptJhTQJXaLj0J8KMlhMPCOBKOg/SwjbDPhMzJibOc/fqmbyIwtCinVUak1s+0KaPMWNCXEeq7/Dv0v1lLexrHysw== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=zuzuXEBwgX88iu5rDvWvQin8cRwv3ihbnYSJdAVkO5g=; b=hHiHGhPMZosgjJBQKvgnkB1dCSYjdGu0c9gu/Pzxy6CC2ZIgBd5LG1/iQET3pWc/6nytpuO7lJRiKG7CYA3vqL2RMn8CP66LGRWyExFD/LiUBvGrlIIuT09ToSfSJ9QbEKNBaY2rvuNGIWgniRxZ7eucfFipCma9P5hbdmG4h1JdYdGgmGsSnRmInE5DabzvP/URKkHiVVPEg/xWxt88xsd7P+ILPUI1DU45m9r2Ljcl6w2Pype7J66mKUMFySW0K++XeH6nQhI6OZeaOZ6GDGFJ7vnkfXpFvzt1qcMID7K1GGCXfcy9Izipm19kr7Bl0Y7GDdDJncF2cJA2V9b5SQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microchip.com; dmarc=pass action=none header.from=microchip.com; dkim=pass header.d=microchip.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector2-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zuzuXEBwgX88iu5rDvWvQin8cRwv3ihbnYSJdAVkO5g=; b=lsLhOgXYZY+8EgT2UZx1ddN6xZUaFlNE7l0xSNkYjdYghAxqhICKHvSTc8whR6WRT7zLIFKJfChBg+Rvc6ZNljHeuzLqJ6790bMl9IOvKAOj0JLQoGfmX9c6s/6rXEO4bVogIc7Nf8KRpCW5lCNkyxa9BEnvh88fU0xUwiWkW4U= Received: from PH0PR11MB5176.namprd11.prod.outlook.com (2603:10b6:510:3f::5) by CH0PR11MB5412.namprd11.prod.outlook.com (2603:10b6:610:d3::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.14; Tue, 24 May 2022 12:06:19 +0000 Received: from PH0PR11MB5176.namprd11.prod.outlook.com ([fe80::d0fc:845b:ce0b:11fa]) by PH0PR11MB5176.namprd11.prod.outlook.com ([fe80::d0fc:845b:ce0b:11fa%8]) with mapi id 15.20.5273.023; Tue, 24 May 2022 12:06:19 +0000 From: To: CC: , , Subject: [PATCH v3 1/4] wilc1000: use correct sequence of RESET for chip Power-UP/Down Thread-Topic: [PATCH v3 1/4] wilc1000: use correct sequence of RESET for chip Power-UP/Down Thread-Index: AQHYb2atM/50sN/76EaQWN5Ft5lV2g== Date: Tue, 24 May 2022 12:06:19 +0000 Message-ID: <20220524120606.9675-1-ajay.kathat@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.25.1 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=microchip.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: b8fd5642-7702-4399-17bd-08da3d7dd001 x-ms-traffictypediagnostic: CH0PR11MB5412:EE_ x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: rNNWrOqsKX5LapahpzoC6irOGYHDMpBJKhMgGYFdgBfE8friepx1Zdb/ofVqm7Uasi8CsGK34sTZX1QDN3uGsrKMEuas0oscuReCovOXN75KpHOczx56fRviP4IwnnfA0A1Pcwe3rfHr4ZQLe3v5vVo7ykaD08E0BH4ZAZ27tilHJe8VMV2fixRozHmEHiFQQCXC5y4kuVGV2dFUXHM8l9q3NMab+5SpB65fDIObNftTjdPftWAc0oUPJFGlkB5qmeIg/fQ5lDW0T2OkqvBplYl7Ya17+vgFWEVwUFzngQq2zM0z3zfkvfysLO236/6T3s1ThDFrdIljX/Q3afZe3UyITIuICWC31MMESCNquOUwgKqC8+wUKYJyYfOU/Npzw6akpoJ+dMH7ts2BRmPPsC25Jo7aYYEo0+shQqxlN1NT3XhsRPnpNfo8nG2ypqzHG+h0RNfQRQIN0nL83+YF9BIxsKAoQ6oyF8oew4b3w2If9DpSxzOxuvrwXZReTVjyvnKNlKonmypnf7tBe9M5MjuI4f7vwA/EAqz++PG44AsYNPPc/3929f24WDaq+1Ea8fY8rzmaDxnAsSStQhkd0ajOpjaWiN6qgnmFUAviddlHGllEac9SZ/0d9F3DlHmaqLz5izZrJFTKK7gHo5h07ntQfZ+WbpJ7/3S6kPQ5WLso5s3gIIWdAkD0F2IwPINqdM/6hd5L2mQ2y9zEyMi3FQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB5176.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(54906003)(83380400001)(2906002)(8936002)(1076003)(2616005)(6486002)(5660300002)(86362001)(508600001)(26005)(107886003)(38100700002)(38070700005)(36756003)(316002)(122000001)(8676002)(4326008)(6512007)(66946007)(66476007)(6506007)(186003)(66446008)(76116006)(91956017)(64756008)(71200400001)(66556008)(6916009); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?cec2utwFbtCjUsoJSdWsZ+U?= =?iso-8859-1?q?WPZlPXTVKB45i0kkw8Lv57IlhXMRk7cU0TlGnyEJbp9qmaN9fi0JBK7TEzhy?= =?iso-8859-1?q?Mi037XFtP5iXsbv9dHvbTsX5gK/fttmt8jSLcnDlv6Hh4RG4E4bAFRM1nym8?= =?iso-8859-1?q?u42gGAJGdhshfLUUwrY+r2PjbHHQIz7oFHF5Sg/PhPYG8/MJF7OczWtui3tT?= =?iso-8859-1?q?sOXR6pf5MDta4R3aBCoERGLBXcN+sytF+jWeRG7SFkylJVw6IYBh0bNQtd0z?= =?iso-8859-1?q?zunhHJ6YT8O9ONZUXE/wTgw6dxZSKehiKa2JRVtVYMmcwWFMGt7ZJ+/AMiPn?= =?iso-8859-1?q?ETtzay08L53wXYVoFo34UAEtOSDj5Bl9kE4qoAWCVMr/vlA4fGVo/2hDWruM?= =?iso-8859-1?q?kSXir/mI6P4mAEQK0gKstkTipjIiRHZSI0D6MZAXk+i/7NSWMLSmcaGxXKTr?= =?iso-8859-1?q?AegLO1am0cnhkYgCl+v/PqCLYWaUjGBeGm5nj72ktBYRSe6nP88hvZIu5Vss?= =?iso-8859-1?q?QFo/opeS84vPSq/frbuEKtE7PzOjY35TffifMYof/tRL9wFTmzLbh2E3BWHC?= =?iso-8859-1?q?TWh7u3LZA4H8vJFn+gkpof3h1fH8rnFBNna5ZfxBgNODvXiIKwO0KVD7xHHq?= =?iso-8859-1?q?L0UmVFLuDH/qkQHtP/s6fAuhH/kB7JcrLwMfHm0rUOcB4mm3o3hdJ6pt4Xmt?= =?iso-8859-1?q?pAMKT3j8L9g/CUMmxpFIQNWyfYygxaRnGWlnlXDgjffjIMAsPRITHH2i2drF?= =?iso-8859-1?q?slEpmpkuDoGuilbGl8oinveLr2jUHbfZ/85WHAwtLhiOadgpwIZzSlkVAETZ?= =?iso-8859-1?q?DTRAZ5KB/jZCsSf9iVygupvLcPD/yAUKrS0WeSe7bvRC1/qv1SFlYvh/TGKc?= =?iso-8859-1?q?JpYwsnQ5zsHb5IpEkuFnrRNitIU1nqFp37IAgXOnizS5WbawDZI439/qr7yu?= =?iso-8859-1?q?Ka/sFyfeGbjOButmOtfHGQ9CY2sISRpBT6l7jHSnlwrnvHOdlBOp1NTMvY8T?= =?iso-8859-1?q?Of79Yf1O/c9lQke34Jp9Zd4Alhhbi/ogRFG/IJALo1E5B3rcB8e0Oe/4xFy5?= =?iso-8859-1?q?WXanL+CT1V+S0xT+mRZjXEwpuLUXY9N5AA8hgfh76bnas/QLBujg+KihXPFJ?= =?iso-8859-1?q?tpINlnnNQPzEZhe4P6ScZi1UD4GQvdfeYM/rntZzJk9i1N2KARYv7HdprVZ8?= =?iso-8859-1?q?VTYwJflmWRY5TFeCDGpa1sft7yfXbdegQsvb0cWVf9hbW8nlFMiU6n6KVqQ9?= =?iso-8859-1?q?DduP0SbsD458YVip31CzlI+Kc1l1Zq3A7IOhHTGkzOvUu6rIHeiFPpxyo+eu?= =?iso-8859-1?q?YuHzxqjIg1H+sDfPx2Y7/g7m/dOAsdER0yZlDBYIFXs8iaVfYQHnlDl9AmHI?= =?iso-8859-1?q?XmT5S3arC65RJm1a1E9U/sL0fyswNHYgk43ilNNcwGY6qou39VruPbmHTwpA?= =?iso-8859-1?q?ISQgFaKHpWCYuZHETa3E54xjyPmVJoCp9PoVRYwKVMquiUmQIBiE+PwvCGF5?= =?iso-8859-1?q?n1iqENjjAVwpeuvhZFJi97SPeaGnQ3yM/+tAV+MPwvlFhgLlAZDIk9EgDVTu?= =?iso-8859-1?q?deRQidBcnAMYueMatHZImzIkoFnjC34vYeoyn+0rIOZDDKuHtssTBDNe/Czd?= =?iso-8859-1?q?XVPMVfxz6rP15o+88tU7ek+YMKHf2o83lyLM28R4jydx+NBMgF+BdkwQMU9Q?= =?iso-8859-1?q?77GTnDvQRRVp4uorUPupggz1L+mY/TFgDFp/X5qiFRtwo+yLC8CLwl+faFfX?= =?iso-8859-1?q?g2JwxRdGVo5RiAo5iG9/KEbdsrndX8eXECQYmpO+td+Y4ZNHkLz9hFPHuVGO?= =?iso-8859-1?q?Sc1ki3VX8HxV92y4k+DT5ghD96ctB?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5176.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: b8fd5642-7702-4399-17bd-08da3d7dd001 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 May 2022 12:06:19.5972 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: u6eU3P5sM/OAJe5AU7wgi3l44KpMeTZnAqpgmdsyYWNFd6dWrjD3CbiXbrXE8Skv8nYxVUxov3aveB64D9rjXsyT0vai20pn1cvjC4kbXx0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR11MB5412 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Ajay Singh For power-up sequence, WILC expects RESET set to high 5ms after making chip_en(enable) so corrected chip power-up sequence by making RESET high. For Power-Down sequence, the correct sequence make RESET and CHIP_EN low without any extra delay. Fixes: ec031ac4792c ("wilc1000: Add reset/enable GPIO support to SPI driver") Signed-off-by: Ajay Singh --- v2: No changes v3: add "Fixes" tag in commit description drivers/net/wireless/microchip/wilc1000/spi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/microchip/wilc1000/spi.c b/drivers/net/wireless/microchip/wilc1000/spi.c index 18420e954402..2ae8dd3411ac 100644 --- a/drivers/net/wireless/microchip/wilc1000/spi.c +++ b/drivers/net/wireless/microchip/wilc1000/spi.c @@ -191,11 +191,11 @@ static void wilc_wlan_power(struct wilc *wilc, bool on) /* assert ENABLE: */ gpiod_set_value(gpios->enable, 1); mdelay(5); - /* deassert RESET: */ - gpiod_set_value(gpios->reset, 0); - } else { /* assert RESET: */ gpiod_set_value(gpios->reset, 1); + } else { + /* deassert RESET: */ + gpiod_set_value(gpios->reset, 0); /* deassert ENABLE: */ gpiod_set_value(gpios->enable, 0); } From patchwork Tue May 24 12:06:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Singh X-Patchwork-Id: 575944 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1452BC433F5 for ; Tue, 24 May 2022 12:06:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234556AbiEXMGd (ORCPT ); Tue, 24 May 2022 08:06:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236706AbiEXMGb (ORCPT ); Tue, 24 May 2022 08:06:31 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 775B8140F3 for ; Tue, 24 May 2022 05:06:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1653393988; x=1684929988; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=QvPShWavlqycyc7emBoGM/bci8w1HSNyYRjB+2WLsK8=; b=i2NRht1I17UFJR6cIYw8khlz0+JJBCjeELBcrgzqjVkyGnse+CvRMTSH Yo6c3gAP+XKL/jUhl3m2sl7BgS01amSscBgx5sWHjFH9AAKx17cmpn75j MCx86wajAPboZ9ZgUx/UHZQ9LyoxUI3AYTqtWOnmyMMleYJ5zAZdiBWiT lHtmkKFf/paiZKjxQCxSOwO6sW+Fe8zT1AozPvIsO2FPFAnzRIZx4p0Ov txASup3T/6hMfQyAVGRB4JX+wELKIRh3c5OjK5eefbTvwVPmImtPV8nTS H1vLUENFnTC7/wZfkP0iQfze0ttzjf0nr+rpbi3hBhIYibB6+vpagOv5o w==; X-IronPort-AV: E=Sophos;i="5.91,248,1647327600"; d="scan'208";a="174813202" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 24 May 2022 05:06:26 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.17; Tue, 24 May 2022 05:06:26 -0700 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.87.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.17 via Frontend Transport; Tue, 24 May 2022 05:06:26 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=glSzV3ks8HiMqlhP79RfFRnv4hoAEYhyCouSzeqQu/QrSK5Dld0AwRFPDsqVymc0Ovi7zZg09fZ8dM+cqyOdZZmqQKNtR+qmueG/buc0KDKvnHOEeFfl5A9U5k1TFWLaG5HyYa5gQtEKJT/I7ihZXbFZZM/ksZwnvkSYZBWTQUlANBVQx/sAvi21Vk43gkAlV1O/BoqR1YwTBpZslJePc01/ZCW1aQezVqGbUOsM/BQG6/jsdHBAPUGQm7MngfeOZCzy+35zGMJK5beZhz/Xrm82dgMyPiaVZIhBRl6hovdvE49kEHKnHIqVc3oEhirZ7kojeK4m76b8VEVWbnMxXw== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=O6OPWaXFTzPjXUf2LRzjG60TuPUkZcQmmsfiZeowXhQ=; b=ag326NpbeE0iAXvv+SBJ2QubF4EvZv5sxbD5ikV/pRBOu6LCL9fkLG2lV+cjQlzdtRo9FOi52/1is71B1h+gz9K4Nr64sbmDE0p5zzzZL/QWNlFBGZhUvUMvOfb8G2w00Uuy1tn8h5hKcp1nvaY9CBScACQ6sF4x0PbnNBzpG0GqDMxsLCjDkBLWtfMaE3RpU4H1t7hlvS89rrd86Fq/1ZB0UrHImLN1ha3YCak92r5rBeILKkCHaJ2Yw8GSrxj5l+xyGkZKHr2tpJuMJfgesTpXUJ4edYqFcX74PRc7rIPtGhX4wfVtSnWO2uMW9e7pWU5ot5blYUA1hVaErl1Rfw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microchip.com; dmarc=pass action=none header.from=microchip.com; dkim=pass header.d=microchip.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector2-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=O6OPWaXFTzPjXUf2LRzjG60TuPUkZcQmmsfiZeowXhQ=; b=WPj9ZHiIy2Rxeu6QC1soDlkXWehalohDF1yXoC+tMTdjxGjV7UUiB7whdGLGaKl/dpAH280p/S6iHdjB4/Vt3/7wWSPs91MV1WBaUYzrl6XNzdWnI3ML8cFoCPNRN2WZulbzzzs714M+C3Ipaii5CqblcFZYjyMjow/Wm92hzVY= Received: from PH0PR11MB5176.namprd11.prod.outlook.com (2603:10b6:510:3f::5) by CH0PR11MB5412.namprd11.prod.outlook.com (2603:10b6:610:d3::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.14; Tue, 24 May 2022 12:06:20 +0000 Received: from PH0PR11MB5176.namprd11.prod.outlook.com ([fe80::d0fc:845b:ce0b:11fa]) by PH0PR11MB5176.namprd11.prod.outlook.com ([fe80::d0fc:845b:ce0b:11fa%8]) with mapi id 15.20.5273.023; Tue, 24 May 2022 12:06:20 +0000 From: To: CC: , , Subject: [PATCH v3 2/4] wilc1000: remove WEP security support Thread-Topic: [PATCH v3 2/4] wilc1000: remove WEP security support Thread-Index: AQHYb2atc0Rv+0c5GkCRWFtb0Wyyww== Date: Tue, 24 May 2022 12:06:20 +0000 Message-ID: <20220524120606.9675-2-ajay.kathat@microchip.com> References: <20220524120606.9675-1-ajay.kathat@microchip.com> In-Reply-To: <20220524120606.9675-1-ajay.kathat@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.25.1 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=microchip.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 4c01cd2c-7109-4e2d-711b-08da3d7dd060 x-ms-traffictypediagnostic: CH0PR11MB5412:EE_ x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: RaZw5hQkwYnEugvaNiKmmn6nJxjBb9ZtZ4KkVd9AZGXXY0+m04dF9lOQENWDHzX2mMAx1Z4LT4m2ptttDTi/tWbNVqrDVGMEmEoSBbl1pWiU7zI6TRxKXvBiKL5BoBbruWVxrODE70MQprUT3lW5vNbUhYXSDmZyR395gYys0xmLQ61Ux9dRjiuRQ/1NvoxjGpcRDh/cYDBN2t3iVPojoaQCIgO4yhLmiB381MoPXIv7XOUPuP2mpxPlscwbVBo97iyw4tcGGF0kAufAGh3aJxT+TNtpwkCJIBwxnoNZV3QYvutoPwGw+nF4fvGu1ZOznSAUDznJgYyoe/JOVqV49tJ9C8qqNonuUon/ZtvK4cStbWpUudm+5SNAWWub/nZQggxpYdHZronVCRhkNwi9taoZl0hsZ+Ct9C+n3KJrJDgEJaH0bqyuZjOWLdil36wKZLAj4Y3hDBR4HzzzZZpgMLQZLitLoN69in/NZJfX8KmThUeAQMBbpWxNvejXToZ2HDoWL8NqtlKCDQmb+/XcR2GWK2zLVFCYlB7T2/ODELvG2ERU69cLO6sDihrqXLsoDK1MMfY4DWr9HmEgxrdgpiFHQIpDr3bW6FHxUJXLM6HpIYQb3ZjChA89K7W9+3BUrZq/3b1PWFbY2kG+CkldOyRltuBJRN6rovsbpU7kIN53krTxD4VllEWwHVMq02WHj0jbUjDunzGP8aOYwrhzxg== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB5176.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(54906003)(83380400001)(2906002)(8936002)(1076003)(2616005)(6486002)(5660300002)(86362001)(508600001)(26005)(15650500001)(107886003)(38100700002)(38070700005)(36756003)(316002)(122000001)(8676002)(4326008)(6512007)(66946007)(66476007)(6506007)(186003)(66446008)(76116006)(91956017)(64756008)(71200400001)(66556008)(6916009); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?34TevHvIErgbBmE7yneD0kt?= =?iso-8859-1?q?6NCLwkhnbCY8wpZCDt6+O89OBZNmBuOTwDD9xR9fhEPXZZFWq4Ep8ZmT4DjK?= =?iso-8859-1?q?B03MrPGki2f1NlAuKc/76qqzUSkZSStSEqu0dQQlE/jP51Rm0EwASrymBiaf?= =?iso-8859-1?q?vLWt+i4eBdT72CplZkp824qbQivM3SXx10srZP8jWJ2w9rLXc7y0JWL4tXqS?= =?iso-8859-1?q?13sRZXjo1rbWxd0VEU/9jLVU9ja6+PKqs+Ehy7j9dW+hCpTSjhGqxurYanc2?= =?iso-8859-1?q?D8hfGUubY4/7b7/pa5XIdTqcqMhzQ+t6Ns7hSWNyeitZLvCm3QJ55/3TofUP?= =?iso-8859-1?q?huu28hOPyb1rARbhgIXcDkZZXHlOEhfYaem38mbvKsHHYcw6AznIvQYm4cbn?= =?iso-8859-1?q?A8QSPNU+i5r5ropgMsPibZ7mc9eIhBUpcIOvH3B8c3qjHyDE0YvE+vDcpWjL?= =?iso-8859-1?q?EPLF6b6JrRyIwpCd+f3eyE3HqKHAhKAeR0rBjxJKSbVFQQtM0N8EAFSqzVe7?= =?iso-8859-1?q?2nhlTEIyUQYdpl5LbMpuNLuBRLpxOWzpxKpQxhn5y55I6NJPqw6XYpOkQLAU?= =?iso-8859-1?q?hwYpUp8hhr5wk8/5OMqHr1FyGISvMzNMGhpvdhsJIHmL9v42LCKwHj2geaQe?= =?iso-8859-1?q?9KbVt2YAthg3o876ddp55LJoBJx2eTpC0d5V1y8wvKBdYH934GFqyNYNeO1c?= =?iso-8859-1?q?PVeUABMKYXbEN8CEXduZNRdQDPwS9+CGx9anr9/uPFMXUOQn0dZBbwNqy7B2?= =?iso-8859-1?q?sR1GPsKdmj1rRiClaVMI6f6lo4qzfauVHmYvbh/W6X7x5pzoieCBXsIRkBAf?= =?iso-8859-1?q?BJXrabW83mKY0PexDgplMTCtHJ/5nCgF55eEkPKnAAX03bSypmfVVIKaPVlp?= =?iso-8859-1?q?yEFIjXiry9qoLCppqtn2Sb50DcJ/Tm7Q+HIZ9nKReKYvz6NowpTCI3K4kHPs?= =?iso-8859-1?q?F6jPP53wttqsbG9vhCd+PIC+3oksM8t7PhRieaVUpPWmaAPqeJdyf56GZf0E?= =?iso-8859-1?q?BAz3t9fw406Xyup2RMFu3sMrPo+fFuvgE5VdO+TBnNn1a6rK0blTDSHETSs1?= =?iso-8859-1?q?MF+XsejIjiTBHAItrvoOqzj45GEJS/8uAened5H2IBhB3JjB5wOrMTBQ9WMI?= =?iso-8859-1?q?vMckuTl109ukIMPXT5PfvUW+ufKHRCA9eLAnRYSUcvE0G7TyvE5OZZo16Dux?= =?iso-8859-1?q?e8Lldym8x4X3ETmbP0L658ofH4264rWGiM9n7+2cYE4tZ4gnGpzluoTXu+x+?= =?iso-8859-1?q?Yt7/9apAaRKBe6GQR1rujOn76DhgWiDRGSwx2OcrcvGSX2vKUkSuYChJFozZ?= =?iso-8859-1?q?Qk3sFka7sRsq0OJb7ixFbKeap7qDvmgCwSnTt5zsah0frlHUGHEEtROz+6dg?= =?iso-8859-1?q?9qgRnVIQEWCzuBxugGSVYZn97jZqLEaT83jcIfYZjapZycMZKxvK2kcDowhQ?= =?iso-8859-1?q?Pq+PfuWdk3yJKl0N5i8SimYZkGr9YgNYGouIMIGRwQzlwp5OlA7Yyt5eoLqt?= =?iso-8859-1?q?9pC3aJuGMIbgQ9jsmOiQCXwOP5zApYOo+NTwvRnGGqdPAv0kbBPxTytAU5um?= =?iso-8859-1?q?l6nd00VbB/maeH84L3WjfAL+GsmMZim5LAE8NJ3bLP+TfteZFk2213BmoWvH?= =?iso-8859-1?q?cv3BYhnVVBzieVhJuZ8bMKj6jlMUYAmOAhxHBVlewVSY1xEEOl6fNUAlsRHr?= =?iso-8859-1?q?lpHqFA+19eNRaCTTQHyJzyL2xI3nOn3nQ62cibUC9tbPkJODo/w0d+4wHCr9?= =?iso-8859-1?q?J+HQaJUWVir45J4/1eFd7s/v9WBG2nw+QEmulQgbaslIFWOj0dpBnaXBXN9X?= =?iso-8859-1?q?Qy1rjU4RadF0Mt05igqeyjJwROX1t?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5176.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4c01cd2c-7109-4e2d-711b-08da3d7dd060 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 May 2022 12:06:20.2065 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: AYZELRLbcpOOy2emfc8Cg3MH5xO8A5md8NJZQS8rhU0GORQdkAjPNTPI6BjqbmJiDf/BU6pOL050sa6YtbvJF4Yrbw34kUS4TWKvUoyPnAw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR11MB5412 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Ajay Singh Deprecated WEP security for WILC driver as well as in firmware from 15.6 FW release onwards. After WEP security removal, freeup some codespace which helped to add new features like WPA3 etc. Signed-off-by: Ajay Singh --- .../wireless/microchip/wilc1000/cfg80211.c | 76 +------------ drivers/net/wireless/microchip/wilc1000/fw.h | 6 -- drivers/net/wireless/microchip/wilc1000/hif.c | 102 ------------------ drivers/net/wireless/microchip/wilc1000/hif.h | 6 -- .../net/wireless/microchip/wilc1000/netdev.h | 10 -- 5 files changed, 2 insertions(+), 198 deletions(-) diff --git a/drivers/net/wireless/microchip/wilc1000/cfg80211.c b/drivers/net/wireless/microchip/wilc1000/cfg80211.c index 8d8378bafd9b..256026d57a70 100644 --- a/drivers/net/wireless/microchip/wilc1000/cfg80211.c +++ b/drivers/net/wireless/microchip/wilc1000/cfg80211.c @@ -313,32 +313,9 @@ static int connect(struct wiphy *wiphy, struct net_device *dev, vif->connecting = true; - memset(priv->wep_key, 0, sizeof(priv->wep_key)); - memset(priv->wep_key_len, 0, sizeof(priv->wep_key_len)); - cipher_group = sme->crypto.cipher_group; if (cipher_group != 0) { - if (cipher_group == WLAN_CIPHER_SUITE_WEP40) { - security = WILC_FW_SEC_WEP; - - priv->wep_key_len[sme->key_idx] = sme->key_len; - memcpy(priv->wep_key[sme->key_idx], sme->key, - sme->key_len); - - wilc_set_wep_default_keyid(vif, sme->key_idx); - wilc_add_wep_key_bss_sta(vif, sme->key, sme->key_len, - sme->key_idx); - } else if (cipher_group == WLAN_CIPHER_SUITE_WEP104) { - security = WILC_FW_SEC_WEP_EXTENDED; - - priv->wep_key_len[sme->key_idx] = sme->key_len; - memcpy(priv->wep_key[sme->key_idx], sme->key, - sme->key_len); - - wilc_set_wep_default_keyid(vif, sme->key_idx); - wilc_add_wep_key_bss_sta(vif, sme->key, sme->key_len, - sme->key_idx); - } else if (sme->crypto.wpa_versions & NL80211_WPA_VERSION_2) { + if (sme->crypto.wpa_versions & NL80211_WPA_VERSION_2) { if (cipher_group == WLAN_CIPHER_SUITE_TKIP) security = WILC_FW_SEC_WPA2_TKIP; else @@ -373,10 +350,6 @@ static int connect(struct wiphy *wiphy, struct net_device *dev, auth_type = WILC_FW_AUTH_OPEN_SYSTEM; break; - case NL80211_AUTHTYPE_SHARED_KEY: - auth_type = WILC_FW_AUTH_SHARED_KEY; - break; - default: break; } @@ -487,14 +460,6 @@ static int disconnect(struct wiphy *wiphy, struct net_device *dev, return ret; } -static inline void wilc_wfi_cfg_copy_wep_info(struct wilc_priv *priv, - u8 key_index, - struct key_params *params) -{ - priv->wep_key_len[key_index] = params->key_len; - memcpy(priv->wep_key[key_index], params->key, params->key_len); -} - static int wilc_wfi_cfg_allocate_wpa_entry(struct wilc_priv *priv, u8 idx) { if (!priv->wilc_gtk[idx]) { @@ -552,33 +517,6 @@ static int add_key(struct wiphy *wiphy, struct net_device *netdev, u8 key_index, struct wilc_priv *priv = &vif->priv; switch (params->cipher) { - case WLAN_CIPHER_SUITE_WEP40: - case WLAN_CIPHER_SUITE_WEP104: - if (priv->wdev.iftype == NL80211_IFTYPE_AP) { - wilc_wfi_cfg_copy_wep_info(priv, key_index, params); - - if (params->cipher == WLAN_CIPHER_SUITE_WEP40) - mode = WILC_FW_SEC_WEP; - else - mode = WILC_FW_SEC_WEP_EXTENDED; - - ret = wilc_add_wep_key_bss_ap(vif, params->key, - params->key_len, - key_index, mode, - WILC_FW_AUTH_OPEN_SYSTEM); - break; - } - if (memcmp(params->key, priv->wep_key[key_index], - params->key_len)) { - wilc_wfi_cfg_copy_wep_info(priv, key_index, params); - - ret = wilc_add_wep_key_bss_sta(vif, params->key, - params->key_len, - key_index); - } - - break; - case WLAN_CIPHER_SUITE_TKIP: case WLAN_CIPHER_SUITE_CCMP: if (priv->wdev.iftype == NL80211_IFTYPE_AP || @@ -676,13 +614,6 @@ static int del_key(struct wiphy *wiphy, struct net_device *netdev, priv->wilc_ptk[key_index] = NULL; } - if (key_index <= 3 && priv->wep_key_len[key_index]) { - memset(priv->wep_key[key_index], 0, - priv->wep_key_len[key_index]); - priv->wep_key_len[key_index] = 0; - wilc_remove_wep_key(vif, key_index); - } - return 0; } @@ -713,13 +644,10 @@ static int get_key(struct wiphy *wiphy, struct net_device *netdev, u8 key_index, return 0; } +/* wiphy_new_nm() will WARNON if not present */ static int set_default_key(struct wiphy *wiphy, struct net_device *netdev, u8 key_index, bool unicast, bool multicast) { - struct wilc_vif *vif = netdev_priv(netdev); - - wilc_set_wep_default_keyid(vif, key_index); - return 0; } diff --git a/drivers/net/wireless/microchip/wilc1000/fw.h b/drivers/net/wireless/microchip/wilc1000/fw.h index 1114530d03e4..237ca348d1f8 100644 --- a/drivers/net/wireless/microchip/wilc1000/fw.h +++ b/drivers/net/wireless/microchip/wilc1000/fw.h @@ -41,12 +41,6 @@ struct wilc_drv_handler { u8 mode; } __packed; -struct wilc_wep_key { - u8 index; - u8 key_len; - u8 key[]; -} __packed; - struct wilc_sta_wpa_ptk { u8 mac_addr[ETH_ALEN]; u8 key_len; diff --git a/drivers/net/wireless/microchip/wilc1000/hif.c b/drivers/net/wireless/microchip/wilc1000/hif.c index 71b44cfe0dfc..573750356007 100644 --- a/drivers/net/wireless/microchip/wilc1000/hif.c +++ b/drivers/net/wireless/microchip/wilc1000/hif.c @@ -1038,108 +1038,6 @@ static void timer_connect_cb(struct timer_list *t) kfree(msg); } -int wilc_remove_wep_key(struct wilc_vif *vif, u8 index) -{ - struct wid wid; - int result; - - wid.id = WID_REMOVE_WEP_KEY; - wid.type = WID_STR; - wid.size = sizeof(char); - wid.val = &index; - - result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1); - if (result) - netdev_err(vif->ndev, - "Failed to send remove wep key config packet\n"); - return result; -} - -int wilc_set_wep_default_keyid(struct wilc_vif *vif, u8 index) -{ - struct wid wid; - int result; - - wid.id = WID_KEY_ID; - wid.type = WID_CHAR; - wid.size = sizeof(char); - wid.val = &index; - result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1); - if (result) - netdev_err(vif->ndev, - "Failed to send wep default key config packet\n"); - - return result; -} - -int wilc_add_wep_key_bss_sta(struct wilc_vif *vif, const u8 *key, u8 len, - u8 index) -{ - struct wid wid; - int result; - struct wilc_wep_key *wep_key; - - wid.id = WID_ADD_WEP_KEY; - wid.type = WID_STR; - wid.size = sizeof(*wep_key) + len; - wep_key = kzalloc(wid.size, GFP_KERNEL); - if (!wep_key) - return -ENOMEM; - - wid.val = (u8 *)wep_key; - - wep_key->index = index; - wep_key->key_len = len; - memcpy(wep_key->key, key, len); - - result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1); - if (result) - netdev_err(vif->ndev, - "Failed to add wep key config packet\n"); - - kfree(wep_key); - return result; -} - -int wilc_add_wep_key_bss_ap(struct wilc_vif *vif, const u8 *key, u8 len, - u8 index, u8 mode, enum authtype auth_type) -{ - struct wid wid_list[3]; - int result; - struct wilc_wep_key *wep_key; - - wid_list[0].id = WID_11I_MODE; - wid_list[0].type = WID_CHAR; - wid_list[0].size = sizeof(char); - wid_list[0].val = &mode; - - wid_list[1].id = WID_AUTH_TYPE; - wid_list[1].type = WID_CHAR; - wid_list[1].size = sizeof(char); - wid_list[1].val = (s8 *)&auth_type; - - wid_list[2].id = WID_WEP_KEY_VALUE; - wid_list[2].type = WID_STR; - wid_list[2].size = sizeof(*wep_key) + len; - wep_key = kzalloc(wid_list[2].size, GFP_KERNEL); - if (!wep_key) - return -ENOMEM; - - wid_list[2].val = (u8 *)wep_key; - - wep_key->index = index; - wep_key->key_len = len; - memcpy(wep_key->key, key, len); - result = wilc_send_config_pkt(vif, WILC_SET_CFG, wid_list, - ARRAY_SIZE(wid_list)); - if (result) - netdev_err(vif->ndev, - "Failed to add wep ap key config packet\n"); - - kfree(wep_key); - return result; -} - int wilc_add_ptk(struct wilc_vif *vif, const u8 *ptk, u8 ptk_key_len, const u8 *mac_addr, const u8 *rx_mic, const u8 *tx_mic, u8 mode, u8 cipher_mode, u8 index) diff --git a/drivers/net/wireless/microchip/wilc1000/hif.h b/drivers/net/wireless/microchip/wilc1000/hif.h index 77616fc77575..c9740457ed58 100644 --- a/drivers/net/wireless/microchip/wilc1000/hif.h +++ b/drivers/net/wireless/microchip/wilc1000/hif.h @@ -151,12 +151,6 @@ struct host_if_drv { }; struct wilc_vif; -int wilc_remove_wep_key(struct wilc_vif *vif, u8 index); -int wilc_set_wep_default_keyid(struct wilc_vif *vif, u8 index); -int wilc_add_wep_key_bss_sta(struct wilc_vif *vif, const u8 *key, u8 len, - u8 index); -int wilc_add_wep_key_bss_ap(struct wilc_vif *vif, const u8 *key, u8 len, - u8 index, u8 mode, enum authtype auth_type); int wilc_add_ptk(struct wilc_vif *vif, const u8 *ptk, u8 ptk_key_len, const u8 *mac_addr, const u8 *rx_mic, const u8 *tx_mic, u8 mode, u8 cipher_mode, u8 index); diff --git a/drivers/net/wireless/microchip/wilc1000/netdev.h b/drivers/net/wireless/microchip/wilc1000/netdev.h index a067274c2014..630b1e85e68f 100644 --- a/drivers/net/wireless/microchip/wilc1000/netdev.h +++ b/drivers/net/wireless/microchip/wilc1000/netdev.h @@ -45,12 +45,6 @@ struct wilc_wfi_key { u32 cipher; }; -struct wilc_wfi_wep_key { - u8 *key; - u8 key_len; - u8 key_idx; -}; - struct sta_info { u8 sta_associated_bss[WILC_MAX_NUM_STA][ETH_ALEN]; }; @@ -63,8 +57,6 @@ struct wilc_wfi_p2p_listen_params { }; static const u32 wilc_cipher_suites[] = { - WLAN_CIPHER_SUITE_WEP40, - WLAN_CIPHER_SUITE_WEP104, WLAN_CIPHER_SUITE_TKIP, WLAN_CIPHER_SUITE_CCMP, WLAN_CIPHER_SUITE_AES_CMAC @@ -132,8 +124,6 @@ struct wilc_priv { struct net_device *dev; struct host_if_drv *hif_drv; struct wilc_pmkid_attr pmkid_list; - u8 wep_key[4][WLAN_KEY_LEN_WEP104]; - u8 wep_key_len[4]; /* The real interface that the monitor is on */ struct net_device *real_ndev; From patchwork Tue May 24 12:06:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Singh X-Patchwork-Id: 575943 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 747ECC433F5 for ; Tue, 24 May 2022 12:06:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237157AbiEXMGh (ORCPT ); Tue, 24 May 2022 08:06:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33372 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236706AbiEXMGe (ORCPT ); Tue, 24 May 2022 08:06:34 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E165118350 for ; Tue, 24 May 2022 05:06:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1653393991; x=1684929991; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=KsH5sYE2u2YRHQc9eXQt5Tfd+tPOiENJz897/d76V4Y=; b=L/KQdHu8hbTVu41OrrHJ9ReQVZHWldgH0bQomlw2Wg9DbWa29Hyj2uM8 5xYa5h6MPCVCZgwl2N0KkR6gxGsPrlifeYXRYr2FBxwTtfned0y9NE9hp TQK0Q6e2bAMjWD/FhEwcHKpB03H1vmxr46prvC6NDS/ZzaQZOhtXZC41A 7+RXYN86m7u8rpgHzyA8Ej7UQ+rkTe52k91jQbHa7QUB8F43LxXVBi1+j oYCx/vnaFPPlNvUIfJR2EtXlBWvdn81YDXXCivSAhFJM8ib7i+okqI+ZG faWxmU0BUR5Lku8smD39S2BV0kZwBuw7bMVfgvTEfaqPjXcEAOfpmgWGd g==; X-IronPort-AV: E=Sophos;i="5.91,248,1647327600"; d="scan'208";a="174813214" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 24 May 2022 05:06:27 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.17; Tue, 24 May 2022 05:06:27 -0700 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.87.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.17 via Frontend Transport; Tue, 24 May 2022 05:06:27 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TfyrMv8wGYBmoInTNxJes/v0Kt/04Rfh5doXlJrOHITrgxmTsFSjoykiarViPgZ5pjcuJlLNGrK9KUuztQgE+jYdbKATD4nEvnLzddA+MqccyFjlJpja2l6PpeM9Muc2qeRRVC/aIq3WISghG2bQbQ+J5aJiY8ZfqEDOKDVvhqGixU4TGJUg7c1y7IbyUOkfaYwPpU3DxmpizI6Z4FW5OnoCPxbdyESvujZTQ1gS8f1yA4oUYiIwPNZR8wwR80HprcROiVk6frPHRRKMt4Ldvvu/uaWzYInsEwx2cP0G7bGc+mft5bqyvH2LMQJ4044zDV9vHL/V83sfXpP825dt9g== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=tH34q5DUTaS4NO+saZpHmJDS1O8nIf305oT33HboKPY=; b=TOOmPC3v5nSIFs/tWolRQDjUNOAbha76cYEpYNJo755SBklYvc2qkoH0qnfevvScDL8WxbJBBYI8rQvCcWdss9odY1Vf1zQpPP3G3Adk8GJlvZPMa3jp9lur4njcUo3dAePSWTkMlfhvj3tg1IyJdqSN4+lc0YWTWfXE6rfpFJ9p9ckG3lEt/CZX4Wa8yGZEMQiO3p75fyldIg+nn9tMf4RYPIEgbYV4fmu/W0RUaidkBt8xLY05w3ryxaJaLKdCdTF6+Ly5JTYYFM5V74t3hpVQ72GNMMxeApt+xgupXoCjoVsiq5Dm5P7pTQb26wqTOBkjpVaLK9evdaiQjEQ5vQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microchip.com; dmarc=pass action=none header.from=microchip.com; dkim=pass header.d=microchip.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector2-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tH34q5DUTaS4NO+saZpHmJDS1O8nIf305oT33HboKPY=; b=KtIs5bRaYmOBIlXS97ILMxWEwmsKGnYbvTg8u6TFqC34pbD+DkYSYKIiPPx/8S+5bM5RZNWG1YQf/p7OXdhdlEutgGLvpu19vd6Ka1LmiohJj2QDrQRAgeUVmcXPngNft1UgL3vVPzUvjbaCe+LLV6R9YCvUKkY6Iz2bRDDID+I= Received: from PH0PR11MB5176.namprd11.prod.outlook.com (2603:10b6:510:3f::5) by CH0PR11MB5412.namprd11.prod.outlook.com (2603:10b6:610:d3::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.14; Tue, 24 May 2022 12:06:20 +0000 Received: from PH0PR11MB5176.namprd11.prod.outlook.com ([fe80::d0fc:845b:ce0b:11fa]) by PH0PR11MB5176.namprd11.prod.outlook.com ([fe80::d0fc:845b:ce0b:11fa%8]) with mapi id 15.20.5273.023; Tue, 24 May 2022 12:06:20 +0000 From: To: CC: , , Subject: [PATCH v3 3/4] wilc1000: add WPA3 SAE support Thread-Topic: [PATCH v3 3/4] wilc1000: add WPA3 SAE support Thread-Index: AQHYb2au9j/HVVIQJUaDvl60vbhx4A== Date: Tue, 24 May 2022 12:06:20 +0000 Message-ID: <20220524120606.9675-3-ajay.kathat@microchip.com> References: <20220524120606.9675-1-ajay.kathat@microchip.com> In-Reply-To: <20220524120606.9675-1-ajay.kathat@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.25.1 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=microchip.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 90d0eda7-aee6-4fe7-ca7c-08da3d7dd0bf x-ms-traffictypediagnostic: CH0PR11MB5412:EE_ x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: rsYmxEXS5h1Ag3Op1VhWxTr9FklShbKQx0XsryWOBtG4By1Px+xrTHeuFu2kr1Ss5S/IXD1gU8ssVqjImANpmjIUquGK0Mx4dzCt2jq3d/Ac9MN577s4XXJfs6N4Y3c2GyiKCS3pDTxDqTYIxJH9Ds/e/V4xzoI4lUrensIkI4qdu9rdzQW2If4jFHMTRFnTmItLMCk42IOqkpeoYLI5qzVlWOkIY1D9Q7f8rW59zHZpypJgIRRAsLPw2RP8QM5/f+PybP+tLLN2onV8WT6CnbK7hCAxfwopw5xf63E925kKStyynQDxOAxPPjPjIoVceJoNA4gKAYPRDe8QgVw7JqMT4+52vUBjIXFX4iH9y19bSEC6DFLkkOKow4FFbvlZGnz/5EeOpedQlw8fd8qnIV6uOPCfae8YIU35JYwljExADrQFnC/v3HWq1XUrdCOPoXwnZwQEdRmWsBER5eXdnijEBNS6CWeJR2im6YLsxhxIW414BKrOYs+wQZdX+YJ5PJOLGobLZiy9ofwQiDDa3bIHaQRdCzp8I+uikd6RN82tCR1uW+cawK1tKYJGT+xlz233mDXFnctikMwPMDlYO2jWk1OC8JqNiU5dgyfwfu4c8IQVYzFyv0L3b54V+UTypAo+Zljg/XJW2T2aQ19No/46oVY6Tx9qdxkTVUkCWC5AgWJABwx5B3yO849hWWVXMz3dlZRxgsSwCv0SVTdWqw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB5176.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(54906003)(83380400001)(2906002)(30864003)(8936002)(1076003)(2616005)(6486002)(5660300002)(86362001)(508600001)(26005)(107886003)(38100700002)(38070700005)(36756003)(316002)(122000001)(8676002)(4326008)(6512007)(66946007)(66476007)(6506007)(186003)(66446008)(76116006)(91956017)(64756008)(71200400001)(66556008)(6916009); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?QXI/CFMgbmBtWprerq68kix?= =?iso-8859-1?q?z6fRIURVyaz+rLv+xXaSiHPoOQfA05RmXyMI1rE6GTpI84Q3QUmzeDCH2K9s?= =?iso-8859-1?q?I+h+/zlnOVCrXnRuBm/eAu2eF2kQYraYygVdLHM+LHoREjVg/NIZ+CTvEaXg?= =?iso-8859-1?q?2pCEuhmKxbG4DVMAk0X1m+OaiLTHnS1efKTFNns9jhO8TofhSFAfvtCGgUTV?= =?iso-8859-1?q?mp3SJvkTnNQIJkh7Q3mrnfFH/ZBib9FVZi/vM+pcjjIRxamHqAPkFJUgkGL2?= =?iso-8859-1?q?t0yEy+cV4CabBVbIIM45btCcC/cTrCVAhAX3+ouwJyZ2g8wFGLi5APM0lHj4?= =?iso-8859-1?q?4SPVvlQt/BLfumw+iNEMfL9kd97rFXCbdbSQvNGr4j+lr8PFh4zxAsuCrcrE?= =?iso-8859-1?q?CXhJwFEVIhIvPtFRJKTcv8v3Po7FpYQH29a62bVeQhjl4WhUDNCPdVOYtkMY?= =?iso-8859-1?q?6JA9MkWlZCunjAkgbVuL21WTEoUxb44wHJbLTkY9ZwO9pxw/MLzCpdL31QjN?= =?iso-8859-1?q?1paCrzm/mOvupUR/ER7eit6urTA+BbYjFCM9RW+cpPjc79Bi/KTPEHEYPlfD?= =?iso-8859-1?q?an7LjSZOVneZ+f+3Ni6w67UJZFh2qfUunnVhrR180EtU2pxb6MdIhWzZI7qR?= =?iso-8859-1?q?5cjBXo2k+uYn3T93U3MCopoE1s49MvSRW3mbhh6NSIZkUXTikCVUoX9RCdMN?= =?iso-8859-1?q?zzKHp1wkRN4AILuDgncL4PTAM2T6eHQr64UvcRPyTsGBX6WyHm5ykS8CDRjS?= =?iso-8859-1?q?1CpnganOiERdHCGUUJyI1Xqf4hfSNPsFAx6RU9YXUfAAM3OD6ZClN8mSIamw?= =?iso-8859-1?q?Wk3eisheXCnE/yc2tApW1xZmIPQHRfx8HUbrX5j3bivQ4v9xr9XNFlrt3T5W?= =?iso-8859-1?q?zy1oMzUfWhLhiMQsnLHb4n3+oRx2qAVcwXbGzD9K6zUAhozNdMG153u+E0Ch?= =?iso-8859-1?q?eGf7z7UpWo7zRv0sIERBd4tPEmJZJSS3MphV3sKiJw/94j2UZ2rS1EnQwRrl?= =?iso-8859-1?q?UGH2O+UDVIPi1SWQVKWPMgze/I4NhACMOtAMvPuHYiaEprPPjJXLBcmk9qpw?= =?iso-8859-1?q?n+I4cEDpk56slU1VoYSpGavsBNSZ5HdfpIeLzyMz9hh9GoLWL+oyNUNQSqhp?= =?iso-8859-1?q?oEvNhErlnM8hiWIdTnvtUPCBszL0Xazl4gRztqXLadC3TVZvYASC/jNqTohQ?= =?iso-8859-1?q?vUulAlSmfmHSNk5a2e+VbF/d4AVCfujKNon5tWuRanLwD/REmRvH5/UhnvCw?= =?iso-8859-1?q?FRXJUd9QAj5Y0SI0HNrkddw3aRIyMB/N4nvJwp8Z8Zxnuj2wjFX9kZX0J2ie?= =?iso-8859-1?q?1XiiE4fSDrj/YNgOnCBIv1KqenRw0WmJOjok70crurJ6f6djyWaGR31hTYDC?= =?iso-8859-1?q?A0zxHCjXpyakzBCvwSt4WHviyiGW6eWzAIqyYiCPLtlJTYp/bTLOwxWajJ+O?= =?iso-8859-1?q?C7sX4CnfOnnx/QT7yHCS7CI8Uk2sAL5nLTO7UaP+fTM/k6nfikgeFTIq87jE?= =?iso-8859-1?q?WjAv20cQVHAQg7yofRikgHwLZwLDR1cPkEl/D5HgWAMDg8TQm0pYcG8TwtH3?= =?iso-8859-1?q?3cn70qF/axHKVgX1wcDO/h+f7Bao+lqzIy+X9LgKRUuZkVD6fIQYW1GRLU1p?= =?iso-8859-1?q?2GV/V3Cs3GA0MXRgFlTPVVNIUPZk8Wkva0LDvySD+qFcrwMtPXcC+VgfBzGP?= =?iso-8859-1?q?i/0yl/Xya7Zv9PK0Viz1wnaI9O/nngWAVTYniJR55iDUTeLD2Of2+d1iPX9w?= =?iso-8859-1?q?ZLY+iVzVqaM965T/Zarm75STaftFKmrU7fIECHtKd1G9xhcSz3v8RqMQ7hF4?= =?iso-8859-1?q?/N82ZZJ9eMgsdecZfsYaSdlr74fk1?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5176.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 90d0eda7-aee6-4fe7-ca7c-08da3d7dd0bf X-MS-Exchange-CrossTenant-originalarrivaltime: 24 May 2022 12:06:20.8158 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 32plqAyosUjgud2JOhiNObTY9yIlTLT/BhjXYPiSTbe3uoGk3SxRnDMq1EC0tzgnkqxDjt9XMurAv0AxAA4ciFTTbD8p2Ghv7kqivZHFFyw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR11MB5412 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Ajay Singh Enable SAE authentication for AP and STA mode. In STA mode, allow the driver to pass the auth frames which are received from firmware to userspace application(hostapd) so that SAE authentication is offloaded to userspace. Signed-off-by: Ajay Singh --- v2: remove unused variable reported by kernel test robot .../wireless/microchip/wilc1000/cfg80211.c | 62 +++++++++++++++++-- drivers/net/wireless/microchip/wilc1000/fw.h | 9 +++ drivers/net/wireless/microchip/wilc1000/hif.c | 44 ++++++++++++- drivers/net/wireless/microchip/wilc1000/hif.h | 3 + .../net/wireless/microchip/wilc1000/netdev.c | 11 +++- .../net/wireless/microchip/wilc1000/netdev.h | 3 +- .../net/wireless/microchip/wilc1000/wlan.c | 3 +- .../net/wireless/microchip/wilc1000/wlan.h | 2 + .../net/wireless/microchip/wilc1000/wlan_if.h | 10 ++- 9 files changed, 133 insertions(+), 14 deletions(-) diff --git a/drivers/net/wireless/microchip/wilc1000/cfg80211.c b/drivers/net/wireless/microchip/wilc1000/cfg80211.c index 256026d57a70..ea59ce9fd991 100644 --- a/drivers/net/wireless/microchip/wilc1000/cfg80211.c +++ b/drivers/net/wireless/microchip/wilc1000/cfg80211.c @@ -20,9 +20,11 @@ static const struct ieee80211_txrx_stypes wilc_wfi_cfg80211_mgmt_types[NUM_NL80211_IFTYPES] = { [NL80211_IFTYPE_STATION] = { - .tx = 0xffff, + .tx = BIT(IEEE80211_STYPE_ACTION >> 4) | + BIT(IEEE80211_STYPE_AUTH >> 4), .rx = BIT(IEEE80211_STYPE_ACTION >> 4) | - BIT(IEEE80211_STYPE_PROBE_REQ >> 4) + BIT(IEEE80211_STYPE_PROBE_REQ >> 4) | + BIT(IEEE80211_STYPE_AUTH >> 4) }, [NL80211_IFTYPE_AP] = { .tx = 0xffff, @@ -350,6 +352,16 @@ static int connect(struct wiphy *wiphy, struct net_device *dev, auth_type = WILC_FW_AUTH_OPEN_SYSTEM; break; + case NL80211_AUTHTYPE_SAE: + auth_type = WILC_FW_AUTH_SAE; + if (sme->ssid_len) { + memcpy(vif->auth.ssid.ssid, sme->ssid, sme->ssid_len); + vif->auth.ssid.ssid_len = sme->ssid_len; + } + vif->auth.key_mgmt_suite = cpu_to_be32(sme->crypto.akm_suites[0]); + ether_addr_copy(vif->auth.bssid, sme->bssid); + break; + default: break; } @@ -357,6 +369,10 @@ static int connect(struct wiphy *wiphy, struct net_device *dev, if (sme->crypto.n_akm_suites) { if (sme->crypto.akm_suites[0] == WLAN_AKM_SUITE_8021X) auth_type = WILC_FW_AUTH_IEEE8021; + else if (sme->crypto.akm_suites[0] == WLAN_AKM_SUITE_PSK_SHA256) + auth_type = WILC_FW_AUTH_OPEN_SYSTEM_SHA256; + else if (sme->crypto.akm_suites[0] == WLAN_AKM_SUITE_8021X_SHA256) + auth_type = WILC_FW_AUTH_IEE8021X_SHA256; } if (wfi_drv->usr_scan_req.scan_result) { @@ -905,6 +921,18 @@ static inline void wilc_wfi_cfg_parse_ch_attr(u8 *buf, u32 len, u8 sta_ch) } } +bool wilc_wfi_mgmt_frame_rx(struct wilc_vif *vif, u8 *buff, u32 size) +{ + struct wilc *wl = vif->wilc; + struct wilc_priv *priv = &vif->priv; + int freq, ret; + + freq = ieee80211_channel_to_frequency(wl->op_ch, NL80211_BAND_2GHZ); + ret = cfg80211_rx_mgmt(&priv->wdev, freq, 0, buff, size, 0); + + return ret; +} + void wilc_wfi_p2p_rx(struct wilc_vif *vif, u8 *buff, u32 size) { struct wilc *wl = vif->wilc; @@ -1090,8 +1118,14 @@ static int mgmt_tx(struct wiphy *wiphy, goto out_txq_add_pkt; } - if (!ieee80211_is_public_action((struct ieee80211_hdr *)buf, len)) + if (!ieee80211_is_public_action((struct ieee80211_hdr *)buf, len)) { + if (chan) + wilc_set_mac_chnl_num(vif, chan->hw_value); + else + wilc_set_mac_chnl_num(vif, vif->wilc->op_ch); + goto out_set_timeout; + } d = (struct wilc_p2p_pub_act_frame *)(&mgmt->u.action); if (d->oui_type != WLAN_OUI_TYPE_WFA_P2P || @@ -1158,6 +1192,7 @@ void wilc_update_mgmt_frame_registrations(struct wiphy *wiphy, struct wilc_vif *vif = netdev_priv(wdev->netdev); u32 presp_bit = BIT(IEEE80211_STYPE_PROBE_REQ >> 4); u32 action_bit = BIT(IEEE80211_STYPE_ACTION >> 4); + u32 pauth_bit = BIT(IEEE80211_STYPE_AUTH >> 4); if (wl->initialized) { bool prev = vif->mgmt_reg_stypes & presp_bit; @@ -1171,10 +1206,26 @@ void wilc_update_mgmt_frame_registrations(struct wiphy *wiphy, if (now != prev) wilc_frame_register(vif, IEEE80211_STYPE_ACTION, now); + + prev = vif->mgmt_reg_stypes & pauth_bit; + now = upd->interface_stypes & pauth_bit; + if (now != prev) + wilc_frame_register(vif, IEEE80211_STYPE_AUTH, now); } vif->mgmt_reg_stypes = - upd->interface_stypes & (presp_bit | action_bit); + upd->interface_stypes & (presp_bit | action_bit | pauth_bit); +} + +static int external_auth(struct wiphy *wiphy, struct net_device *dev, + struct cfg80211_external_auth_params *auth) +{ + struct wilc_vif *vif = netdev_priv(dev); + + if (auth->status == WLAN_STATUS_SUCCESS) + wilc_set_external_auth_param(vif, auth); + + return 0; } static int set_cqm_rssi_config(struct wiphy *wiphy, struct net_device *dev, @@ -1590,6 +1641,7 @@ static const struct cfg80211_ops wilc_cfg80211_ops = { .change_bss = change_bss, .set_wiphy_params = set_wiphy_params, + .external_auth = external_auth, .set_pmksa = set_pmksa, .del_pmksa = del_pmksa, .flush_pmksa = flush_pmksa, @@ -1732,7 +1784,7 @@ struct wilc *wilc_create_wiphy(struct device *dev) BIT(NL80211_IFTYPE_P2P_GO) | BIT(NL80211_IFTYPE_P2P_CLIENT); wiphy->flags |= WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL; - + wiphy->features |= NL80211_FEATURE_SAE; set_wiphy_dev(wiphy, dev); wl->wiphy = wiphy; ret = wiphy_register(wiphy); diff --git a/drivers/net/wireless/microchip/wilc1000/fw.h b/drivers/net/wireless/microchip/wilc1000/fw.h index 237ca348d1f8..9449c5d0b472 100644 --- a/drivers/net/wireless/microchip/wilc1000/fw.h +++ b/drivers/net/wireless/microchip/wilc1000/fw.h @@ -110,4 +110,13 @@ struct wilc_join_bss_param { struct wilc_noa_opp_enable opp_en; }; } __packed; + +struct wilc_external_auth_param { + u8 action; + u8 bssid[ETH_ALEN]; + u8 ssid[IEEE80211_MAX_SSID_LEN]; + u8 ssid_len; + __le32 key_mgmt_suites; + __le16 status; +} __packed; #endif diff --git a/drivers/net/wireless/microchip/wilc1000/hif.c b/drivers/net/wireless/microchip/wilc1000/hif.c index 573750356007..5d9d3aba737c 100644 --- a/drivers/net/wireless/microchip/wilc1000/hif.c +++ b/drivers/net/wireless/microchip/wilc1000/hif.c @@ -306,7 +306,10 @@ static int wilc_send_connect_wid(struct wilc_vif *vif) netdev_err(vif->ndev, "failed to send config packet\n"); goto error; } else { - hif_drv->hif_state = HOST_IF_WAITING_CONN_RESP; + if (conn_attr->auth_type == WILC_FW_AUTH_SAE) + hif_drv->hif_state = HOST_IF_EXTERNAL_AUTH; + else + hif_drv->hif_state = HOST_IF_WAITING_CONN_RESP; } return 0; @@ -665,7 +668,12 @@ static void handle_rcvd_gnrl_async_info(struct work_struct *work) goto free_msg; } - if (hif_drv->hif_state == HOST_IF_WAITING_CONN_RESP) { + + if (hif_drv->hif_state == HOST_IF_EXTERNAL_AUTH) { + cfg80211_external_auth_request(vif->ndev, &vif->auth, + GFP_KERNEL); + hif_drv->hif_state = HOST_IF_WAITING_CONN_RESP; + } else if (hif_drv->hif_state == HOST_IF_WAITING_CONN_RESP) { host_int_parse_assoc_resp_info(vif, mac_info->status); } else if (mac_info->status == WILC_MAC_STATUS_DISCONNECTED) { if (hif_drv->hif_state == HOST_IF_CONNECTED) { @@ -710,7 +718,8 @@ int wilc_disconnect(struct wilc_vif *vif) } if (conn_info->conn_result) { - if (hif_drv->hif_state == HOST_IF_WAITING_CONN_RESP) + if (hif_drv->hif_state == HOST_IF_WAITING_CONN_RESP || + hif_drv->hif_state == HOST_IF_EXTERNAL_AUTH) del_timer(&hif_drv->connect_timer); conn_info->conn_result(CONN_DISCONN_EVENT_DISCONN_NOTIF, 0, @@ -986,6 +995,31 @@ void wilc_set_wowlan_trigger(struct wilc_vif *vif, bool enabled) pr_err("Failed to send wowlan trigger config packet\n"); } +int wilc_set_external_auth_param(struct wilc_vif *vif, + struct cfg80211_external_auth_params *auth) +{ + int ret; + struct wid wid; + struct wilc_external_auth_param *param; + + wid.id = WID_EXTERNAL_AUTH_PARAM; + wid.type = WID_BIN_DATA; + wid.size = sizeof(*param); + param = kzalloc(sizeof(*param), GFP_KERNEL); + if (!param) + return -EINVAL; + + wid.val = (u8 *)param; + param->action = auth->action; + ether_addr_copy(param->bssid, auth->bssid); + memcpy(param->ssid, auth->ssid.ssid, auth->ssid.ssid_len); + param->ssid_len = auth->ssid.ssid_len; + ret = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1); + + kfree(param); + return ret; +} + static void handle_scan_timer(struct work_struct *work) { struct host_if_msg *msg = container_of(work, struct host_if_msg, work); @@ -1647,6 +1681,10 @@ void wilc_frame_register(struct wilc_vif *vif, u16 frame_type, bool reg) reg_frame.reg_id = WILC_FW_PROBE_REQ_IDX; break; + case IEEE80211_STYPE_AUTH: + reg_frame.reg_id = WILC_FW_AUTH_REQ_IDX; + break; + default: break; } diff --git a/drivers/net/wireless/microchip/wilc1000/hif.h b/drivers/net/wireless/microchip/wilc1000/hif.h index c9740457ed58..f1a0a1f042ca 100644 --- a/drivers/net/wireless/microchip/wilc1000/hif.h +++ b/drivers/net/wireless/microchip/wilc1000/hif.h @@ -47,6 +47,7 @@ enum host_if_state { HOST_IF_WAITING_CONN_RESP = 3, HOST_IF_CONNECTED = 4, HOST_IF_P2P_LISTEN = 5, + HOST_IF_EXTERNAL_AUTH = 6, HOST_IF_FORCE_32BIT = 0xFFFFFFFF }; @@ -202,6 +203,8 @@ int wilc_get_vif_idx(struct wilc_vif *vif); int wilc_set_tx_power(struct wilc_vif *vif, u8 tx_power); int wilc_get_tx_power(struct wilc_vif *vif, u8 *tx_power); void wilc_set_wowlan_trigger(struct wilc_vif *vif, bool enabled); +int wilc_set_external_auth_param(struct wilc_vif *vif, + struct cfg80211_external_auth_params *param); void wilc_scan_complete_received(struct wilc *wilc, u8 *buffer, u32 length); void wilc_network_info_received(struct wilc *wilc, u8 *buffer, u32 length); void wilc_gnrl_async_info_received(struct wilc *wilc, u8 *buffer, u32 length); diff --git a/drivers/net/wireless/microchip/wilc1000/netdev.c b/drivers/net/wireless/microchip/wilc1000/netdev.c index 3c292e3464c2..fcc4e61592ee 100644 --- a/drivers/net/wireless/microchip/wilc1000/netdev.c +++ b/drivers/net/wireless/microchip/wilc1000/netdev.c @@ -835,15 +835,24 @@ void wilc_frmw_to_host(struct wilc *wilc, u8 *buff, u32 size, } } -void wilc_wfi_mgmt_rx(struct wilc *wilc, u8 *buff, u32 size) +void wilc_wfi_mgmt_rx(struct wilc *wilc, u8 *buff, u32 size, bool is_auth) { int srcu_idx; struct wilc_vif *vif; srcu_idx = srcu_read_lock(&wilc->srcu); list_for_each_entry_rcu(vif, &wilc->vif_list, list) { + struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)buff; u16 type = le16_to_cpup((__le16 *)buff); u32 type_bit = BIT(type >> 4); + u32 auth_bit = BIT(IEEE80211_STYPE_AUTH >> 4); + + if ((vif->mgmt_reg_stypes & auth_bit && + ieee80211_is_auth(mgmt->frame_control)) && + vif->iftype == WILC_STATION_MODE && is_auth) { + wilc_wfi_mgmt_frame_rx(vif, buff, size); + break; + } if (vif->priv.p2p_listen_state && vif->mgmt_reg_stypes & type_bit) diff --git a/drivers/net/wireless/microchip/wilc1000/netdev.h b/drivers/net/wireless/microchip/wilc1000/netdev.h index 630b1e85e68f..a0d9e981500e 100644 --- a/drivers/net/wireless/microchip/wilc1000/netdev.h +++ b/drivers/net/wireless/microchip/wilc1000/netdev.h @@ -185,6 +185,7 @@ struct wilc_vif { struct wilc_priv priv; struct list_head list; struct cfg80211_bss *bss; + struct cfg80211_external_auth_params auth; }; struct wilc_tx_queue_status { @@ -278,7 +279,7 @@ struct wilc_wfi_mon_priv { void wilc_frmw_to_host(struct wilc *wilc, u8 *buff, u32 size, u32 pkt_offset); void wilc_mac_indicate(struct wilc *wilc); void wilc_netdev_cleanup(struct wilc *wilc); -void wilc_wfi_mgmt_rx(struct wilc *wilc, u8 *buff, u32 size); +void wilc_wfi_mgmt_rx(struct wilc *wilc, u8 *buff, u32 size, bool is_auth); void wilc_wlan_set_bssid(struct net_device *wilc_netdev, const u8 *bssid, u8 mode); struct wilc_vif *wilc_netdev_ifc_init(struct wilc *wl, const char *name, diff --git a/drivers/net/wireless/microchip/wilc1000/wlan.c b/drivers/net/wireless/microchip/wilc1000/wlan.c index 48441f0389ca..f3f504d12873 100644 --- a/drivers/net/wireless/microchip/wilc1000/wlan.c +++ b/drivers/net/wireless/microchip/wilc1000/wlan.c @@ -968,7 +968,8 @@ static void wilc_wlan_handle_rx_buff(struct wilc *wilc, u8 *buffer, int size) if (pkt_offset & IS_MANAGMEMENT) { buff_ptr += HOST_HDR_OFFSET; - wilc_wfi_mgmt_rx(wilc, buff_ptr, pkt_len); + wilc_wfi_mgmt_rx(wilc, buff_ptr, pkt_len, + pkt_offset & IS_MGMT_AUTH_PKT); } else { if (!is_cfg_packet) { wilc_frmw_to_host(wilc, buff_ptr, pkt_len, diff --git a/drivers/net/wireless/microchip/wilc1000/wlan.h b/drivers/net/wireless/microchip/wilc1000/wlan.h index eb7978166d73..b45e72789a0e 100644 --- a/drivers/net/wireless/microchip/wilc1000/wlan.h +++ b/drivers/net/wireless/microchip/wilc1000/wlan.h @@ -305,6 +305,7 @@ #define IS_MANAGMEMENT 0x100 #define IS_MANAGMEMENT_CALLBACK 0x080 #define IS_MGMT_STATUS_SUCCES 0x040 +#define IS_MGMT_AUTH_PKT 0x010 #define WILC_WID_TYPE GENMASK(15, 12) #define WILC_VMM_ENTRY_FULL_RETRY 1 @@ -423,6 +424,7 @@ int wilc_wlan_get_num_conn_ifcs(struct wilc *wilc); netdev_tx_t wilc_mac_xmit(struct sk_buff *skb, struct net_device *dev); void wilc_wfi_p2p_rx(struct wilc_vif *vif, u8 *buff, u32 size); +bool wilc_wfi_mgmt_frame_rx(struct wilc_vif *vif, u8 *buff, u32 size); void host_wakeup_notify(struct wilc *wilc); void host_sleep_notify(struct wilc *wilc); void chip_allow_sleep(struct wilc *wilc); diff --git a/drivers/net/wireless/microchip/wilc1000/wlan_if.h b/drivers/net/wireless/microchip/wilc1000/wlan_if.h index 6eb7eb4ac294..18f13b5643e8 100644 --- a/drivers/net/wireless/microchip/wilc1000/wlan_if.h +++ b/drivers/net/wireless/microchip/wilc1000/wlan_if.h @@ -85,7 +85,10 @@ enum authtype { WILC_FW_AUTH_OPEN_SYSTEM = 1, WILC_FW_AUTH_SHARED_KEY = 2, WILC_FW_AUTH_ANY = 3, - WILC_FW_AUTH_IEEE8021 = 5 + WILC_FW_AUTH_IEEE8021 = 5, + WILC_FW_AUTH_SAE = 7, + WILC_FW_AUTH_IEE8021X_SHA256 = 9, + WILC_FW_AUTH_OPEN_SYSTEM_SHA256 = 13 }; enum site_survey { @@ -176,7 +179,8 @@ enum { enum { WILC_FW_ACTION_FRM_IDX = 0, - WILC_FW_PROBE_REQ_IDX = 1 + WILC_FW_PROBE_REQ_IDX = 1, + WILC_FW_AUTH_REQ_IDX = 2 }; enum wid_type { @@ -789,7 +793,7 @@ enum { WID_ADD_BEACON = 0x408a, WID_SETUP_MULTICAST_FILTER = 0x408b, - + WID_EXTERNAL_AUTH_PARAM = 0x408d, /* Miscellaneous WIDs */ WID_ALL = 0x7FFE, WID_MAX = 0xFFFF From patchwork Tue May 24 12:06:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Singh X-Patchwork-Id: 576824 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C784DC4332F for ; Tue, 24 May 2022 12:06:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237155AbiEXMGg (ORCPT ); Tue, 24 May 2022 08:06:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236629AbiEXMGb (ORCPT ); Tue, 24 May 2022 08:06:31 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A414114D04 for ; Tue, 24 May 2022 05:06:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1653393988; x=1684929988; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=+atr0/0MXTn7B0bydlEGXJeZuoDpzYPQdLS76n4uN5k=; b=zLltXAS7/gso5o0LzTkd8nDpg0JmAkSYH6cGnJ1owLl7d6z9A0x1exRU D0bomEJbT/6DapyFB+2NGykEFBHTLKI7ZINEqFDtcshZnfw+Dm3ynhmxm Uot/OIfsyB/nTWXkZ64iCAoT9e1h/bPKPlrgqsA20TM/kuSdtHgU/Xt9v Am3W+8eCJ6MWKwIVhbN6cCmrpzOa5A9MGrzYx6D+OfFFpLOMgrxdtSu+E CzE0G1dK9h7GepZYSueJrzZxXrcHfnG1uT8SGg6vKKdTsllKTTa5yuFAX fGnzVzqyKVVSd2QNDjRiKSiRL9qXTOO875p8qoio7VQHetSTXyJ33OUWU w==; X-IronPort-AV: E=Sophos;i="5.91,248,1647327600"; d="scan'208";a="174813211" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 24 May 2022 05:06:27 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.17; Tue, 24 May 2022 05:06:26 -0700 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.87.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.17 via Frontend Transport; Tue, 24 May 2022 05:06:26 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XFhtRxzG8Wx248HbiQx9xUUMo14Shw4pDipRhCfEJJmNgl65x7+Warid78z4m/+j3nWMHqCn591QO/2+qkleaex3u6/3e23BxZobmuKAsfCeKEPWvk1trvL2eUArbtq/vya6XvKSnVxtyONIJrwsgu0q9VD1UxgbzUSo1siNpQqb9d0A9plFXkbAASV3wZI+D1KwqGUmL7yF8Tt71V13SMtdlXAFvZaRXoeHsvnIc17SG8004K6BY6vAq/eZ3R2fY46OpRUfUQcm7BhBkpW76dozo8vXAj8K03nSN5hUgdKh+PqW/hSlv/BlNbVGGfdDKaJfywb7h9aLsD67rotdQg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=I/RbBnx9MuTxXy3AIuE07M1tgT9K4llkesdWxxCcjfc=; b=UbLqrKbHnQwWbhsKQy0aGoiWsGIk1wksLU19ZX9zuV4yzdgT4I5bbPdTjzYvKKXwZw7vM7ZCORPJe+xa+1U1JfBy1BJcLM1MkZJcNHiqN6E5VvwIVZ2WVRyQeM4rIzsc/zzu7W2IzmjV0xE+rwj1WM20Eeqk1ASWUMHkUpRIxDS58RSC096WeFRu4a51/C3i4aoi7f0m/lbDkoU1ZsvaZnvljB5Ig0CUGJ5KPZrmj24ZGDDPhNPM39Vs07xICn7ypzJCbaKcdP0+85cY93SdMC7cWBFh0kwVC2FH1IT6V42va7jrF1Oo/W+HxSwDa1RGKBARpuQABSV6Mc7mUpKIfg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microchip.com; dmarc=pass action=none header.from=microchip.com; dkim=pass header.d=microchip.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector2-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=I/RbBnx9MuTxXy3AIuE07M1tgT9K4llkesdWxxCcjfc=; b=IBc+GXfXo4EpeNi1kgwnZvll7uIPbL69FpdGfUDsjzzuV9CxwMVFu3LUgtoYVUMZBjAuy4V2YDT2mzMHt+WhNjzvcsHp6FLwojZE6N3+GWN0HCnDhKw59/dkVx4te442BU0IZfHxHNkwJgnrgklTSFrafCFEcyZn9nW4Gz5gd+s= Received: from PH0PR11MB5176.namprd11.prod.outlook.com (2603:10b6:510:3f::5) by CH0PR11MB5412.namprd11.prod.outlook.com (2603:10b6:610:d3::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.14; Tue, 24 May 2022 12:06:21 +0000 Received: from PH0PR11MB5176.namprd11.prod.outlook.com ([fe80::d0fc:845b:ce0b:11fa]) by PH0PR11MB5176.namprd11.prod.outlook.com ([fe80::d0fc:845b:ce0b:11fa%8]) with mapi id 15.20.5273.023; Tue, 24 May 2022 12:06:21 +0000 From: To: CC: , , Subject: [PATCH v3 4/4] wilc1000: add IGTK support Thread-Topic: [PATCH v3 4/4] wilc1000: add IGTK support Thread-Index: AQHYb2auW9f8DZDbGUG0dS+gu75M8A== Date: Tue, 24 May 2022 12:06:21 +0000 Message-ID: <20220524120606.9675-4-ajay.kathat@microchip.com> References: <20220524120606.9675-1-ajay.kathat@microchip.com> In-Reply-To: <20220524120606.9675-1-ajay.kathat@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.25.1 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=microchip.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: d4d17769-541d-4b4c-55c8-08da3d7dd11f x-ms-traffictypediagnostic: CH0PR11MB5412:EE_ x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: xeQxt+mfoE5Ck2hCQW+PcRImyPBPClWXVH7RC7RaRCrY29b/6wdcIqMT71yeSZ8S/FZBf9QR6mS7PdydEtxqmwDqlNjSE5BFHERU27nS4w09lwT1g96Vkw1FkcamBpPsufDtQarYc+x5ScCWgaNkCR+JZz16Q1jMFWu0k3eby7Y9hM7BkDmDFcMzM6QVD+o3BwWDHesmLVfoeJ7xB5kdd4PZBX8ZU2ad8bIcv5RhRavh9jt5ciyVh+mj62hoU5Jp3WKXJBDN9f2j9GLQjuvWsbD/iofpOEvcAbW9uCdxkfPThirNOn+siR2SBIZO61Gn3FAg9RkAYy+gBwOPXVFtwBL2Lzesybu1i7vjl3NjTjL9+hUoQ0PALW+IT/G3NRd/UC/Uj0nnAiNsGUBPt8lmRmgFTPIb5NgwslOsrHxbO6khhnR2j310Ek1FQ9NCQ8AG0IFUnfxlPtR6ZDTMujHY1XdQyncRthgQSrAFyXV9aVnSOnvHN0O4j0oHuuQjc0t5CuNa/kVbGDpzG3P2SUZvJzKulz9Y/3ikwMGh9rqLHATgMyGu8O6vWbLeXqKFSBjl39PkPNXh9mZxtDwWr0s7CiPjV0NagBouhIHNlSuF8fYGyzvuZdqa3MQ/NBQEVXP1hHbNSo1OJUXphoSTDKLQg2Wf8klVTal0yFDboUU09aBWh65A0So/Odfstzurq/lqtJ16ykHckctzauXs0pFqPA== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB5176.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(54906003)(83380400001)(2906002)(30864003)(8936002)(1076003)(2616005)(6486002)(5660300002)(86362001)(508600001)(26005)(107886003)(38100700002)(38070700005)(36756003)(316002)(122000001)(8676002)(4326008)(6512007)(66946007)(66476007)(6506007)(186003)(66446008)(76116006)(91956017)(64756008)(71200400001)(66556008)(6916009); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?mNsaVZL3qy/Msh5j2ABO241?= =?iso-8859-1?q?CTbJK8+u1cV9FGFmSRiV2JgZM4VCTFG4U7xhI361QZxh/3OMJjcROZt2fRO9?= =?iso-8859-1?q?HtD+hUi93E1vDviPAo97CNsCFzYs1lxnUIb6HwwVh5DuM8WBfE7N8VREfnhs?= =?iso-8859-1?q?F6aORw4tCI/gye7A4BrC626pA0zaYTn81uwNiSbKC+DbeRvYDM4PFsCB+xui?= =?iso-8859-1?q?MOFvgOIhGNnpALhy94NwN0/CXXQQKssWYtuCCA/txeboL+5wKR4x+k3fdi1/?= =?iso-8859-1?q?Sx5pyaopJD+lNVrTGC94pAPCo1nAiTMmLQNBi0S2GHetEpBIkt0YeG4V+J1t?= =?iso-8859-1?q?WXFBTyKptnBC9+YTrSpM1fCHRy9cOZsTDwK4xClzQgxYtMRduXpjiGEX2gi8?= =?iso-8859-1?q?9S3NsQkZkw80VgSA+qsCvRsUI+VBKFykI8z11r16U/z/akCLN3c2KshSKc5T?= =?iso-8859-1?q?QHjN/PwcdvDG1tnyD87clMcIjdeb3uSzNQFa4RXyBSGTD00kLzt62tTNnVhk?= =?iso-8859-1?q?jcRhPb2Bk5PTmAgH/lVhXNM6ganxXY6AdZSoWsmF1uxxFxHmd4tNmN0/tx2G?= =?iso-8859-1?q?3WtOdb/4CVP8O2FqMRuQmVLWR8SyuVX10lIuHeXSJKMhnfLurGsqlRhFWbxU?= =?iso-8859-1?q?c46vKAYbEghUeui/DST/vFlYdsRfNZL3b7/kfzV9071eqtMw2wBUtSbADhVU?= =?iso-8859-1?q?YkKVyI2QkxU6WHzFWhBmko9AOOvWVj6W6fpstJbg6ktFwl27OYEUDlEKSK9p?= =?iso-8859-1?q?g+Nwi7QzUdr47WarkZIzgn9kUIj46z7bmhbTwiooqXIhbsnucOoLLbjqQG43?= =?iso-8859-1?q?uz1+RlZ2H0WzwLuFneZT1wtr3cD9A8qXFV0ljBUj071mA0ZPH0DTIBx398EQ?= =?iso-8859-1?q?MMztDzHvfvh5MN2aaCHJHOjURjUHnJxdkz8dOMqkYkAEmHaf+fXuArJ3hbcV?= =?iso-8859-1?q?0pTjN/LuH7Go8J4cJB6B5CzsKCHc+EGsQXCBsqMaA75qBk87GnMdyMVeNjxe?= =?iso-8859-1?q?sfY1SYnOSHCDEGrvkKbxskSv8YHQrrSSJWxgIvqN4/o3xFuyjZvmfairq+6J?= =?iso-8859-1?q?+hWKpgzO1fByejchjSytsys+KhPWdhF3+HqkDm19lEWBdI3xBHik1JaGD5Ej?= =?iso-8859-1?q?Rs7B1ZkTWbW2YmzD/C2p3Pnb73hlPSUlxqJSFDsd6i4BAtUi73GjPIQiU8KL?= =?iso-8859-1?q?rMNU1eIsIjVhEOmRgul5LzOZo9UeHZQJYwJDpWthw9Bo+qdT8LYfxw0Z+sUe?= =?iso-8859-1?q?6o2e/WKQzq0os4jSqhKXcJUiHrejhzq/ISLCFQkzaDRtbu08sfHHsEh4MlKd?= =?iso-8859-1?q?ctiGQ5Z214Wrvmz+2exW6t6nbnaGBdpSY+Lcclg5jS8doE4kS/T3Bmd0JXzt?= =?iso-8859-1?q?xM5h7otlgk238BK8bv3VtwJC69WXOM5IVqOfaPYAml6i+UGqh5OsV95f5Pu6?= =?iso-8859-1?q?JUGjjeuRAOaic6V11zGkQf+zq4pkTSYHICBXLiBDbPgza2kyYfW0Eo/jKJLr?= =?iso-8859-1?q?yqm1ml4v871uKiVhbo/bAJIk1edINrWaHNr1ES0ZdotPvShn7KHiHD7yIg6j?= =?iso-8859-1?q?md6EuQ48YPMuBnR4/xAxGwkxjOZ46GRNiq7OQRZE5waLKL1CeW0eu14ZrT1o?= =?iso-8859-1?q?io7/Tr3odZeGny8knQnRCNm4aYjOv8uxkFi12VuCK9b7gL6nna7cLTPSYPTW?= =?iso-8859-1?q?SBUXT4v62SH3IVavbS2a6dJZEE9HOB9ssJ+qJQHmgfNw/Ltuq6SimV6btAwu?= =?iso-8859-1?q?cwSmSL5V94LhoY0kitZMQDvg3LGEItnwVPTH8Zs0PRDKvGX3stL1x1S8u6Fs?= =?iso-8859-1?q?utEihSX3WVakn+CkH4YBkpjRpQxDc?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5176.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: d4d17769-541d-4b4c-55c8-08da3d7dd11f X-MS-Exchange-CrossTenant-originalarrivaltime: 24 May 2022 12:06:21.4732 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: cRn/GvstMnNGcegv5OPzWCDSFq4tiZ02mFOuXaFDdCC7P/OEYZmwbKIdPjO7ZHR4RRiX2bBZ9bOiON2YfwHGCZOnbhn/uQutMLetf1za4jg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR11MB5412 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Ajay Singh Add support to handle IGTK keys which are required for MFP to FW. Index ID 4 and 5 are used to store the IGTK key. Signed-off-by: Ajay Singh --- .../wireless/microchip/wilc1000/cfg80211.c | 114 ++++++++++++++---- drivers/net/wireless/microchip/wilc1000/fw.h | 8 ++ drivers/net/wireless/microchip/wilc1000/hif.c | 56 ++++++++- drivers/net/wireless/microchip/wilc1000/hif.h | 5 + .../net/wireless/microchip/wilc1000/netdev.h | 1 + .../net/wireless/microchip/wilc1000/wlan_if.h | 10 ++ 6 files changed, 171 insertions(+), 23 deletions(-) diff --git a/drivers/net/wireless/microchip/wilc1000/cfg80211.c b/drivers/net/wireless/microchip/wilc1000/cfg80211.c index ea59ce9fd991..1ac4684fab25 100644 --- a/drivers/net/wireless/microchip/wilc1000/cfg80211.c +++ b/drivers/net/wireless/microchip/wilc1000/cfg80211.c @@ -307,6 +307,7 @@ static int connect(struct wiphy *wiphy, struct net_device *dev, int ret; u32 i; u8 security = WILC_FW_SEC_NO; + enum mfptype mfp_type = WILC_FW_MFP_NONE; enum authtype auth_type = WILC_FW_AUTH_ANY; u32 cipher_group; struct cfg80211_bss *bss; @@ -416,6 +417,13 @@ static int connect(struct wiphy *wiphy, struct net_device *dev, wfi_drv->conn_info.arg = priv; wfi_drv->conn_info.param = join_params; + if (sme->mfp == NL80211_MFP_OPTIONAL) + mfp_type = WILC_FW_MFP_OPTIONAL; + else if (sme->mfp == NL80211_MFP_REQUIRED) + mfp_type = WILC_FW_MFP_REQUIRED; + + wfi_drv->conn_info.mfp_type = mfp_type; + ret = wilc_set_join_req(vif, bss->bssid, sme->ie, sme->ie_len); if (ret) { netdev_err(dev, "wilc_set_join_req(): Error\n"); @@ -495,6 +503,18 @@ static int wilc_wfi_cfg_allocate_wpa_entry(struct wilc_priv *priv, u8 idx) return 0; } +static int wilc_wfi_cfg_allocate_wpa_igtk_entry(struct wilc_priv *priv, u8 idx) +{ + idx -= 4; + if (!priv->wilc_igtk[idx]) { + priv->wilc_igtk[idx] = kzalloc(sizeof(*priv->wilc_igtk[idx]), + GFP_KERNEL); + if (!priv->wilc_igtk[idx]) + return -ENOMEM; + } + return 0; +} + static int wilc_wfi_cfg_copy_wpa_info(struct wilc_wfi_key *key_info, struct key_params *params) { @@ -531,6 +551,7 @@ static int add_key(struct wiphy *wiphy, struct net_device *netdev, u8 key_index, u8 op_mode; struct wilc_vif *vif = netdev_priv(netdev); struct wilc_priv *priv = &vif->priv; + struct wilc_wfi_key *key; switch (params->cipher) { case WLAN_CIPHER_SUITE_TKIP: @@ -594,6 +615,26 @@ static int add_key(struct wiphy *wiphy, struct net_device *netdev, u8 key_index, key_index); break; + case WLAN_CIPHER_SUITE_AES_CMAC: + ret = wilc_wfi_cfg_allocate_wpa_igtk_entry(priv, key_index); + if (ret) + return -ENOMEM; + + key = priv->wilc_igtk[key_index - 4]; + ret = wilc_wfi_cfg_copy_wpa_info(key, params); + if (ret) + return -ENOMEM; + + if (priv->wdev.iftype == NL80211_IFTYPE_AP || + priv->wdev.iftype == NL80211_IFTYPE_P2P_GO) + op_mode = WILC_AP_MODE; + else + op_mode = WILC_STATION_MODE; + + ret = wilc_add_igtk(vif, params->key, keylen, params->seq, + params->seq_len, mac_addr, op_mode, + key_index); + break; default: netdev_err(netdev, "%s: Unsupported cipher\n", __func__); @@ -611,23 +652,34 @@ static int del_key(struct wiphy *wiphy, struct net_device *netdev, struct wilc_vif *vif = netdev_priv(netdev); struct wilc_priv *priv = &vif->priv; - if (priv->wilc_gtk[key_index]) { - kfree(priv->wilc_gtk[key_index]->key); - priv->wilc_gtk[key_index]->key = NULL; - kfree(priv->wilc_gtk[key_index]->seq); - priv->wilc_gtk[key_index]->seq = NULL; - - kfree(priv->wilc_gtk[key_index]); - priv->wilc_gtk[key_index] = NULL; - } - - if (priv->wilc_ptk[key_index]) { - kfree(priv->wilc_ptk[key_index]->key); - priv->wilc_ptk[key_index]->key = NULL; - kfree(priv->wilc_ptk[key_index]->seq); - priv->wilc_ptk[key_index]->seq = NULL; - kfree(priv->wilc_ptk[key_index]); - priv->wilc_ptk[key_index] = NULL; + if (!pairwise && (key_index == 4 || key_index == 5)) { + key_index -= 4; + if (priv->wilc_igtk[key_index]) { + kfree(priv->wilc_igtk[key_index]->key); + priv->wilc_igtk[key_index]->key = NULL; + kfree(priv->wilc_igtk[key_index]->seq); + priv->wilc_igtk[key_index]->seq = NULL; + kfree(priv->wilc_igtk[key_index]); + priv->wilc_igtk[key_index] = NULL; + } + } else { + if (priv->wilc_gtk[key_index]) { + kfree(priv->wilc_gtk[key_index]->key); + priv->wilc_gtk[key_index]->key = NULL; + kfree(priv->wilc_gtk[key_index]->seq); + priv->wilc_gtk[key_index]->seq = NULL; + + kfree(priv->wilc_gtk[key_index]); + priv->wilc_gtk[key_index] = NULL; + } + if (priv->wilc_ptk[key_index]) { + kfree(priv->wilc_ptk[key_index]->key); + priv->wilc_ptk[key_index]->key = NULL; + kfree(priv->wilc_ptk[key_index]->seq); + priv->wilc_ptk[key_index]->seq = NULL; + kfree(priv->wilc_ptk[key_index]); + priv->wilc_ptk[key_index] = NULL; + } } return 0; @@ -642,11 +694,20 @@ static int get_key(struct wiphy *wiphy, struct net_device *netdev, u8 key_index, struct key_params key_params; if (!pairwise) { - key_params.key = priv->wilc_gtk[key_index]->key; - key_params.cipher = priv->wilc_gtk[key_index]->cipher; - key_params.key_len = priv->wilc_gtk[key_index]->key_len; - key_params.seq = priv->wilc_gtk[key_index]->seq; - key_params.seq_len = priv->wilc_gtk[key_index]->seq_len; + if (key_index == 4 || key_index == 5) { + key_index -= 4; + key_params.key = priv->wilc_igtk[key_index]->key; + key_params.cipher = priv->wilc_igtk[key_index]->cipher; + key_params.key_len = priv->wilc_igtk[key_index]->key_len; + key_params.seq = priv->wilc_igtk[key_index]->seq; + key_params.seq_len = priv->wilc_igtk[key_index]->seq_len; + } else { + key_params.key = priv->wilc_gtk[key_index]->key; + key_params.cipher = priv->wilc_gtk[key_index]->cipher; + key_params.key_len = priv->wilc_gtk[key_index]->key_len; + key_params.seq = priv->wilc_gtk[key_index]->seq; + key_params.seq_len = priv->wilc_gtk[key_index]->seq_len; + } } else { key_params.key = priv->wilc_ptk[key_index]->key; key_params.cipher = priv->wilc_ptk[key_index]->cipher; @@ -667,6 +728,14 @@ static int set_default_key(struct wiphy *wiphy, struct net_device *netdev, return 0; } +static int set_default_mgmt_key(struct wiphy *wiphy, struct net_device *netdev, + u8 key_index) +{ + struct wilc_vif *vif = netdev_priv(netdev); + + return wilc_set_default_mgmt_key_index(vif, key_index); +} + static int get_station(struct wiphy *wiphy, struct net_device *dev, const u8 *mac, struct station_info *sinfo) { @@ -1626,6 +1695,7 @@ static const struct cfg80211_ops wilc_cfg80211_ops = { .del_key = del_key, .get_key = get_key, .set_default_key = set_default_key, + .set_default_mgmt_key = set_default_mgmt_key, .add_virtual_intf = add_virtual_intf, .del_virtual_intf = del_virtual_intf, .change_virtual_intf = change_virtual_intf, diff --git a/drivers/net/wireless/microchip/wilc1000/fw.h b/drivers/net/wireless/microchip/wilc1000/fw.h index 9449c5d0b472..5c5cac4aab02 100644 --- a/drivers/net/wireless/microchip/wilc1000/fw.h +++ b/drivers/net/wireless/microchip/wilc1000/fw.h @@ -54,6 +54,14 @@ struct wilc_ap_wpa_ptk { u8 key[]; } __packed; +struct wilc_wpa_igtk { + u8 index; + u8 pn_len; + u8 pn[6]; + u8 key_len; + u8 key[]; +} __packed; + struct wilc_gtk_key { u8 mac_addr[ETH_ALEN]; u8 rsc[8]; diff --git a/drivers/net/wireless/microchip/wilc1000/hif.c b/drivers/net/wireless/microchip/wilc1000/hif.c index 5d9d3aba737c..4038a254465f 100644 --- a/drivers/net/wireless/microchip/wilc1000/hif.c +++ b/drivers/net/wireless/microchip/wilc1000/hif.c @@ -271,12 +271,19 @@ int wilc_scan(struct wilc_vif *vif, u8 scan_source, u8 scan_type, static int wilc_send_connect_wid(struct wilc_vif *vif) { int result = 0; - struct wid wid_list[4]; + struct wid wid_list[5]; u32 wid_cnt = 0; struct host_if_drv *hif_drv = vif->hif_drv; struct wilc_conn_info *conn_attr = &hif_drv->conn_info; struct wilc_join_bss_param *bss_param = conn_attr->param; + + wid_list[wid_cnt].id = WID_SET_MFP; + wid_list[wid_cnt].type = WID_CHAR; + wid_list[wid_cnt].size = sizeof(char); + wid_list[wid_cnt].val = (s8 *)&conn_attr->mfp_type; + wid_cnt++; + wid_list[wid_cnt].id = WID_INFO_ELEMENT_ASSOCIATE; wid_list[wid_cnt].type = WID_BIN_DATA; wid_list[wid_cnt].val = conn_attr->req_ies; @@ -1143,6 +1150,36 @@ int wilc_add_ptk(struct wilc_vif *vif, const u8 *ptk, u8 ptk_key_len, return result; } +int wilc_add_igtk(struct wilc_vif *vif, const u8 *igtk, u8 igtk_key_len, + const u8 *pn, u8 pn_len, const u8 *mac_addr, u8 mode, u8 index) +{ + int result = 0; + u8 t_key_len = igtk_key_len; + struct wid wid; + struct wilc_wpa_igtk *key_buf; + + key_buf = kzalloc(sizeof(*key_buf) + t_key_len, GFP_KERNEL); + if (!key_buf) + return -ENOMEM; + + key_buf->index = index; + + memcpy(&key_buf->pn[0], pn, pn_len); + key_buf->pn_len = pn_len; + + memcpy(&key_buf->key[0], igtk, igtk_key_len); + key_buf->key_len = t_key_len; + + wid.id = WID_ADD_IGTK; + wid.type = WID_STR; + wid.size = sizeof(*key_buf) + t_key_len; + wid.val = (s8 *)key_buf; + result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1); + kfree(key_buf); + + return result; +} + int wilc_add_rx_gtk(struct wilc_vif *vif, const u8 *rx_gtk, u8 gtk_key_len, u8 index, u32 key_rsc_len, const u8 *key_rsc, const u8 *rx_mic, const u8 *tx_mic, u8 mode, @@ -1932,3 +1969,20 @@ int wilc_get_tx_power(struct wilc_vif *vif, u8 *tx_power) return wilc_send_config_pkt(vif, WILC_GET_CFG, &wid, 1); } + +int wilc_set_default_mgmt_key_index(struct wilc_vif *vif, u8 index) +{ + struct wid wid; + int result; + + wid.id = WID_DEFAULT_MGMT_KEY_ID; + wid.type = WID_CHAR; + wid.size = sizeof(char); + wid.val = &index; + result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1); + if (result) + netdev_err(vif->ndev, + "Failed to send default mgmt key index\n"); + + return result; +} diff --git a/drivers/net/wireless/microchip/wilc1000/hif.h b/drivers/net/wireless/microchip/wilc1000/hif.h index f1a0a1f042ca..d8dd94dcfe14 100644 --- a/drivers/net/wireless/microchip/wilc1000/hif.h +++ b/drivers/net/wireless/microchip/wilc1000/hif.h @@ -108,6 +108,7 @@ struct wilc_conn_info { u8 bssid[ETH_ALEN]; u8 security; enum authtype auth_type; + enum mfptype mfp_type; u8 ch; u8 *req_ies; size_t req_ies_len; @@ -155,6 +156,9 @@ struct wilc_vif; int wilc_add_ptk(struct wilc_vif *vif, const u8 *ptk, u8 ptk_key_len, const u8 *mac_addr, const u8 *rx_mic, const u8 *tx_mic, u8 mode, u8 cipher_mode, u8 index); +int wilc_add_igtk(struct wilc_vif *vif, const u8 *igtk, u8 igtk_key_len, + const u8 *pn, u8 pn_len, const u8 *mac_addr, u8 mode, + u8 index); s32 wilc_get_inactive_time(struct wilc_vif *vif, const u8 *mac, u32 *out_val); int wilc_add_rx_gtk(struct wilc_vif *vif, const u8 *rx_gtk, u8 gtk_key_len, @@ -210,4 +214,5 @@ void wilc_network_info_received(struct wilc *wilc, u8 *buffer, u32 length); void wilc_gnrl_async_info_received(struct wilc *wilc, u8 *buffer, u32 length); void *wilc_parse_join_bss_param(struct cfg80211_bss *bss, struct cfg80211_crypto_settings *crypto); +int wilc_set_default_mgmt_key_index(struct wilc_vif *vif, u8 index); #endif diff --git a/drivers/net/wireless/microchip/wilc1000/netdev.h b/drivers/net/wireless/microchip/wilc1000/netdev.h index a0d9e981500e..822e65d00f53 100644 --- a/drivers/net/wireless/microchip/wilc1000/netdev.h +++ b/drivers/net/wireless/microchip/wilc1000/netdev.h @@ -129,6 +129,7 @@ struct wilc_priv { struct net_device *real_ndev; struct wilc_wfi_key *wilc_gtk[WILC_MAX_NUM_STA]; struct wilc_wfi_key *wilc_ptk[WILC_MAX_NUM_STA]; + struct wilc_wfi_key *wilc_igtk[2]; u8 wilc_groupkey; /* mutexes */ diff --git a/drivers/net/wireless/microchip/wilc1000/wlan_if.h b/drivers/net/wireless/microchip/wilc1000/wlan_if.h index 18f13b5643e8..df2f5a63bdf6 100644 --- a/drivers/net/wireless/microchip/wilc1000/wlan_if.h +++ b/drivers/net/wireless/microchip/wilc1000/wlan_if.h @@ -91,6 +91,12 @@ enum authtype { WILC_FW_AUTH_OPEN_SYSTEM_SHA256 = 13 }; +enum mfptype { + WILC_FW_MFP_NONE = 0x0, + WILC_FW_MFP_OPTIONAL = 0x1, + WILC_FW_MFP_REQUIRED = 0x2 +}; + enum site_survey { WILC_FW_SITE_SURVEY_1CH = 0, WILC_FW_SITE_SURVEY_ALL_CH = 1, @@ -661,6 +667,9 @@ enum { WID_LOG_TERMINAL_SWITCH = 0x00CD, WID_TX_POWER = 0x00CE, WID_WOWLAN_TRIGGER = 0X00CF, + WID_SET_MFP = 0x00D0, + + WID_DEFAULT_MGMT_KEY_ID = 0x00D2, /* EMAC Short WID list */ /* RTS Threshold */ /* @@ -750,6 +759,7 @@ enum { WID_REMOVE_KEY = 0x301E, WID_ASSOC_REQ_INFO = 0x301F, WID_ASSOC_RES_INFO = 0x3020, + WID_ADD_IGTK = 0x3022, WID_MANUFACTURER = 0x3026, /* Added for CAPI tool */ WID_MODEL_NAME = 0x3027, /* Added for CAPI tool */ WID_MODEL_NUM = 0x3028, /* Added for CAPI tool */