From patchwork Fri May 13 17:17:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Singh X-Patchwork-Id: 572489 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 6A8AAC433F5 for ; Fri, 13 May 2022 17:18:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355540AbiEMRSG (ORCPT ); Fri, 13 May 2022 13:18:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49448 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1382424AbiEMRSB (ORCPT ); Fri, 13 May 2022 13:18:01 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50A5232062 for ; Fri, 13 May 2022 10:17:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1652462278; x=1683998278; h=from:to:cc:subject:date:message-id: content-transfer-encoding:mime-version; bh=DGYy6pWqRpWJayPSAm4jMGEeasBD1ITm4BDm9LKSWG8=; b=pj8PZfZT23d+quXvd6trnw1W4y59vFC5mJsV0RD12Lf8BNvlMHmBAkhW I+2tjTwTN0oHQyswOyqN28kQOa9YA+Yvlw5smM2LCeaiDK+9JIH2Ta61p vI2nvx8libZqdIJ4PtUz/7lsosd1yv6JGF0Bz0VeR/s19kzC0/7R0dgzg QOUxZaDjN6Y7ZVdKXDPd4FFsysVkG7NoDg365yPpBGL5/FoLsjjCQDVAE qhzQU6qANoXKccb2HbR0bLnW6tGT/bvm+Q2LFYqlmN3oZpBrQ/f+9hgtd LcmUZAlfKPcEUHdPLnwVhg6l6IO33kYNTpWkRdsyMQEsHL2Bqyb4ce3cl Q==; X-IronPort-AV: E=Sophos;i="5.91,223,1647327600"; d="scan'208";a="155983585" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 13 May 2022 10:17:57 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) 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; Fri, 13 May 2022 10:17:56 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.87.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.17 via Frontend Transport; Fri, 13 May 2022 10:17:56 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mW+bcZ2B1U2TTDk6ELC6I63S3/QwnZ8z0qxmn6LHEUP/D635t0W67hE+dauUJRNFGwkURRxKdxBmO25/aNFaBaArEMGcaxB8OFy9va12iNLLiI5JTEcFRTxhHgwW/b4QD/4K1NcWWnHde5EJsObQEVcLYtjLwSS/eYQCHWOFNnMJ3qKzc6yezXPa/2iu6r7/WPLgLA8su4rF6t6eNz+auhJy2X07FSECWxlUrCFNId7IBb48r0pnHPDJqilluFg40DLaj8q4vskNpX49U7YJwX59pAkkeU3pwJj1ngaaJ3SilFdCFn3Sen41eyGpgOmMUG4sq1PRmWkEpdH33SPRuw== 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=osrhlwpEFFhhR0wpe1YAkbvHKhLHXzcBTB1i7NRwLIA=; b=exWF37/wcIQm75l0FQGh0QmgKkLSLkaMUYgr3pxXiHCHGARfvXNa4iegSjlZIum+D5q3D2xJGfRDhPd+EgN5VBt8gxrkPDcvN/uztHegtaoaBxXW3bvXpeHxzPmfl+Eg6RJo4runq/6sVGdiI/c1rW/69j9l6iLbnhbRdbM7XXKTWI88wpkXSSBv9Tb+KWGDBzNtN9+zyFI5EINiIUTjzd6YRKAWsFhIn+ixbzKRMOtxLePOlWcMZOwJhTRliq6PUME2fM04NOkA2c7sLCT/r9c0Gy2r/ZRc8Im+IRmtJAjrPqOm+OJrp7a0eheM61jOJDNZ94XnkVvbzXsO9fC05Q== 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=osrhlwpEFFhhR0wpe1YAkbvHKhLHXzcBTB1i7NRwLIA=; b=VloMQVjmUUc29ryF21uX8Kqg7o3yL9r2PnVi8kk5/7kNzIwsxiBJMErYS+ww/H6lzDwH0gmoOONyHXWJV4KwxHsALOCmWRYqKhcMZp+VJTOVQ8/YoynJK8j1BxWmR8M1xRlOtZCHUvWTeuykl0c6cSwnXCEWngKueW0U/BMekTA= Received: from PH0PR11MB5176.namprd11.prod.outlook.com (2603:10b6:510:3f::5) by BL0PR11MB3441.namprd11.prod.outlook.com (2603:10b6:208:6a::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5250.15; Fri, 13 May 2022 17:17:51 +0000 Received: from PH0PR11MB5176.namprd11.prod.outlook.com ([fe80::d0fc:845b:ce0b:11fa]) by PH0PR11MB5176.namprd11.prod.outlook.com ([fe80::d0fc:845b:ce0b:11fa%9]) with mapi id 15.20.5250.015; Fri, 13 May 2022 17:17:51 +0000 From: To: CC: , , Subject: [PATCH 1/4] wilc1000: use correct sequence of RESET for chip Power-UP/Down Thread-Topic: [PATCH 1/4] wilc1000: use correct sequence of RESET for chip Power-UP/Down Thread-Index: AQHYZu1gNkQs7R/wY0+9DcjVPDuCAw== Date: Fri, 13 May 2022 17:17:51 +0000 Message-ID: <20220513171741.26701-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: c60fa923-f070-4ed9-db4e-08da350482c4 x-ms-traffictypediagnostic: BL0PR11MB3441: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: ufC16Ui/q5ZbNuudLCV0WAlZTfI77yDp3E4I7vC3MV4sdfqlInHDuf8qA1C+NpCj/nzf2EuD3huILk/lZ0DQtQ116e3eeJdm0f8jhAOW8gg1tfhj1n6D91iOXwAjUCMEsNfeevjTOBvW6+wz6xSdcYrKyVA4uMZ7TvESPcblNGQGV97AkNc8iD613mldTYh5AYMflhS1x2fqk4KynXcVbKwtmrLhIOZXeTpw8S75tRHguezM3e/uV6jcU1S9mlyzaii7uJvt1XAm45VdnlCnZNsDeTrzZdzxG209clvAzdGCFmJO7AWNSIVbKjq4zxSDjrjxFHg3lq8/jUGvHKvrW2pFW9Ir39yHxO/JuimBF0/yHgr/tOoLNLbeJMScVy0GaMvQHVRw80lKlDs7VGw1v0o6BHLAfsVkHwTc3I9ycni4eA+sp2GqnsrAdW7h8azLj2+tdIXxmyMbRKEfdLl4ROUOS+NBBVyvSksm1sLhm6zAqt+k84FWpnXMoysYNtAmP3zBlp9W5I++7DGbHQ64CHzJhjx6r/o9ZV2R+dhC+UAYBd0sVFuN3pxM35Yf6r6IVnjpwem1tbSTbKXtZxy4tEbmUpftf5NOTyG+ua/WO2jlgMeJlCZ2QqFoTZWNkmlhhAGZerw5VjjNkqe63gHbtXfBhtn+GPgRiCBKWtX+54Wl802rr2zQv3AH5gkXwIqvhOBsvRqg54Hww6Bz5N+Nrg== 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)(316002)(54906003)(38070700005)(38100700002)(1076003)(36756003)(186003)(83380400001)(107886003)(6486002)(508600001)(8936002)(2906002)(5660300002)(86362001)(6506007)(91956017)(6916009)(122000001)(4326008)(8676002)(6512007)(71200400001)(26005)(2616005)(66476007)(66946007)(66556008)(76116006)(66446008)(64756008); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?+ISPq7feXi/1ZBILRm8KvQs?= =?iso-8859-1?q?f+OkMsQ8omO4yG7pv3tHK+AkvEjFHSI3O/7qJI7VcGX/ye3OTNyJZVFWH/yx?= =?iso-8859-1?q?xXK7HRZBUOpMz5J1JGfsi6jTVLlzpVbJAZ5b60EJCMyRgnOdFi9/BM4IDtOU?= =?iso-8859-1?q?/Zth4sNbHco9kMn3hz9EJk0sfQiadyCc/7aeuiWexx+h8vdGbzOKlIWsfIPT?= =?iso-8859-1?q?SnMDukWDW8gGtWeGBH+8K9LZln6rXlv8ej4fiS4XqFjYCFDJdQ1GqDnQSqr2?= =?iso-8859-1?q?QLN/uweoakm/ZQEorxpAeJAWqGq9tWWZFSs98q7tX2GFjLxNdY7HnXKWitiT?= =?iso-8859-1?q?XfvgBf5E3QXoQQLruoM5u+giMWbwkBhoqFbdfA+jbzg7Do9lwqCs6Sz75+1a?= =?iso-8859-1?q?Q00bPBFFR0AjYEhKNHpoxJdWPkqY+FytmEMhommoUrax6g+186xZpoI2LNVA?= =?iso-8859-1?q?ljX7mMlk+wWj+6NqV7Lx2buuMhEZb6KHozCCSB4DojHvPc+OCVSHQiIrf34L?= =?iso-8859-1?q?hpnW1z0qoA4bZf0Qo950Ejmn0oCXgow1hnm+C5cC/kTnNUrSv/sx33/L0D45?= =?iso-8859-1?q?IV19PJtcV1sRGjkm37aqUkpnkiMKiLFrTXpBWRhnM6RdubjqN3rbhjKq+zgv?= =?iso-8859-1?q?iH2jAm8IzOx8gVp+lsDwrGq2IGdBHbLwcbwtqqZeMvQ6aXDldFb8bVisc7O1?= =?iso-8859-1?q?hbTnhATQf/MN6V/hmSnZs9RJT5qGICOkd3toLsa9mb7llGf/o7eBmsHfcqsE?= =?iso-8859-1?q?LPa82KYFXFGqjY9xHt4PQyYXGyRfsEmKwjqarZhUU+9vETVZ/MOMl5QdA9+G?= =?iso-8859-1?q?5L58UaoSr/G+bLbr36/DolSC3MO2LcEuH1nvNJwO3BT8MLjoGxGJoVm+RU1i?= =?iso-8859-1?q?FBOFH9SnwLEXKloUzg+dZme8bN7QHWzAq60Pd0zFkmqnblps2TIfhYom5NOC?= =?iso-8859-1?q?iKIBGBj17W5Co5eEirMklclgJuj9MjnARUYt9FE8MMfnihEtWjXwOjMky6m0?= =?iso-8859-1?q?UIhdNrtAA6X4YKwevIurxYByzbnfSmvYDaktd70izIrMzVX/hlotgF927To0?= =?iso-8859-1?q?ywV0dBec+U6xjRnQaUAYcK7FZJCosjeIn7Zv4blnlyTDUhqeV1Xw0mJdX1qD?= =?iso-8859-1?q?78kRnFz1m8pNEt9kMzzApProhYhPXOzqvyIz/gI9IxjF01A2sOk097pArqoE?= =?iso-8859-1?q?TfyUYuOFdGtB+9UtFfaqyNBF9EUIC2h+to78WVTny9zZRER3MaNWEEio+Hgz?= =?iso-8859-1?q?4UTavg6sT9eLE4R+U0j+ryTXZF7bu7rulo4689hsXA7qG/BoYDON/1VTjYrq?= =?iso-8859-1?q?Neli9XkA8tRDSj6At3w/HsC/hOoEMPpjuUYJ03x2ECPPunZyfWDdA1A3NXA6?= =?iso-8859-1?q?EkLrE9HvCv6vAdAm3AmFkac33xCM3eBmyXsGJj14zqtI5QobDLn3eUMEh8WV?= =?iso-8859-1?q?jfllvmpAOKe1oOgBl2sa/CflqdyPz33JyPtNMgNOR9tX7R9jIlGiuelJzpQU?= =?iso-8859-1?q?g6DQmr7OVqDcMxHumwwMpm3v28sq7e1KaKtsTjn53Rh6UVqIXtK6kEQwyQYb?= =?iso-8859-1?q?imqPqPd5821/gitQ27FiF3RydHFMNkxxNSLbx+hFwthmRbF7kqRpKhE5NN4t?= =?iso-8859-1?q?WiDiNQnbyg/JxJ+lts7YCRbW8+6pl9HIgEUmMYamKvFp7ncy8YkL0eD4NOAs?= =?iso-8859-1?q?zfF9byXwnUJEgIvfXdIEIyCK4DsKJoQk8jk17tEl0ss6GHJjqxDHA1tFBe6C?= =?iso-8859-1?q?PZCkBi4ViJ/6MZg7tTt3JdwXnLAOETvq0ockmsG2G7j07wiC7SzHXP0EKMA/?= =?iso-8859-1?q?jfWejnQ7EYS8nd2uabDQR6IdwCpeE?= 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: c60fa923-f070-4ed9-db4e-08da350482c4 X-MS-Exchange-CrossTenant-originalarrivaltime: 13 May 2022 17:17:51.5802 (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: dA7Gbk/rQBJJMUr0eOWVjqIXO86TwSWk54S2pwxjVwVpUcYUHE7cmfmviSedvogxOs0XrW5wGXta40/t0cDsbeCIFo9ap3/YWcrcJau5Dd0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR11MB3441 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. Signed-off-by: Ajay Singh --- 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 Fri May 13 17:17:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Singh X-Patchwork-Id: 572488 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 64585C433FE for ; Fri, 13 May 2022 17:18:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376785AbiEMRSK (ORCPT ); Fri, 13 May 2022 13:18:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351346AbiEMRSC (ORCPT ); Fri, 13 May 2022 13:18:02 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 170A9AE62 for ; Fri, 13 May 2022 10:18:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1652462282; x=1683998282; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=QvPShWavlqycyc7emBoGM/bci8w1HSNyYRjB+2WLsK8=; b=dNETtf0K/8SNPJOQ6pndQmzdbZJ6BlqytjDLPyj8TXxSyP856hDbf5BH tz0mqnI0ssPfxclCrzxVNQVPKE8HRAwkncIQLV+AZy3/yX98jbuOXQx84 0cDWKPo12SMFuFHZPRSwL7zhyTptTYQhhghRASZNMzhS+BMJMk70qtYtK SjyyUqbJ8f9HGg+WmAanUz8u3M/WcRdCpuA2CobM9ATsBSEKlChfhP/Ra BF5Xl5Hv+lAqN+LqebZRIVUe1PpgtZNsk4jzyRG5czrirsVSrj1ysr5Nk BTHEj6HeatEt221sz4HREYOYG7yqYX0F1VsNpDl3q0oy+1OX04t3xZAj7 w==; X-IronPort-AV: E=Sophos;i="5.91,223,1647327600"; d="scan'208";a="155983588" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 13 May 2022 10:17:58 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) 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; Fri, 13 May 2022 10:17:56 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.87.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.17 via Frontend Transport; Fri, 13 May 2022 10:17:56 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RaA+cBDoUaijtpQZ+teb6sQfC/BYXqYAGzL8FROS3OqhpEQbkoGkXFLNdoQtPBQFvWjDhvIJGjRD+1gBoXqWEO7U3F4MvEwukXWRirVo3m3UrEV2hwWGi9h9xLJ4nhrvB/LP5FSK0nwT1uH6rVenjPb2zYbjRfwhTqu3AP5tOxRwidhOoyrNJXQ7zMrj57VHPAtur0tdPZuElzR5yka2qD+qMALnEr8zGn601uAVlI3172zlOVyeBs/rdSQrC4SHyWs9hUSh6vRuKKIg0qnPdQKjJ6z2GlyHOdUQWMh4bny2ATNsHiRidiLrruN+Zl6GNRkH6vFyzSW0o4iou5fzxw== 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=JwGuBiLnjpeBd47fb382MzVDHiwWZ3phR8wGa4I8OmC5SeDrBqqrIwUAYA5tB5QKZ/rtDKmQR4S4TbRSjJqu0YSFVJ1xVx7E8dn3q5PLYiQ+qjuXQvNGg7h4PGHvm5sMqMTu+PJj1Wqw3LOtR17qtrRr7LzMS1wbRp6WjGK7sps9PULccCfO9LCCj/HClCyT+mMH0mOUuCuHJhX/eTIfCCOd9NT6rdujU9Kxl9JA/5gsZ+bgE69unD1ZavmdryDim1VBwMyWsTmro2b+8Lg3VLLInoznaZ/UvLQimnTaGPC8AZ+kVbqj9aQfp6WhlxZlB9ZgUR/Tr16MP9gVVeC1Kg== 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=YJnoD1xOzyVpXjkVuT5RBoWm7T1KFn3cMDbOEcD3MrAxTQvaLiAKsxbSEn7CSkbaw+nwC85sbuGBxkKbmPB1MQQkuohXxfSq2bTJiKBCiAJ8Oc05mdyyNsd0thnJdpi/MwUYjVgRyDVXTvERSVUpjigQSy+UfOGyNZMM8vBchDA= Received: from PH0PR11MB5176.namprd11.prod.outlook.com (2603:10b6:510:3f::5) by BL0PR11MB3441.namprd11.prod.outlook.com (2603:10b6:208:6a::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5250.15; Fri, 13 May 2022 17:17:52 +0000 Received: from PH0PR11MB5176.namprd11.prod.outlook.com ([fe80::d0fc:845b:ce0b:11fa]) by PH0PR11MB5176.namprd11.prod.outlook.com ([fe80::d0fc:845b:ce0b:11fa%9]) with mapi id 15.20.5250.015; Fri, 13 May 2022 17:17:52 +0000 From: To: CC: , , Subject: [PATCH 2/4] wilc1000: remove WEP security support Thread-Topic: [PATCH 2/4] wilc1000: remove WEP security support Thread-Index: AQHYZu1gY4UNGguFWUSVWAd/9KDHRQ== Date: Fri, 13 May 2022 17:17:52 +0000 Message-ID: <20220513171741.26701-2-ajay.kathat@microchip.com> References: <20220513171741.26701-1-ajay.kathat@microchip.com> In-Reply-To: <20220513171741.26701-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: 4676d97e-e898-4d64-a01b-08da35048326 x-ms-traffictypediagnostic: BL0PR11MB3441: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: NNY6T/AS0Jt73ahGpUzc2oDs0X8RcyM8GlZS/edE3W1DPUTV53v5HMMy/Qgw/PCIOIU6eYsBm4Dozthsyc2wykdfE4eS8Mej6o5mf39syt9eZkaFt9ltPXPv+LVYh2jHrSI5Mzk7mO+ElgAjlxG4ahz5WJtv7r3g4ZkjXMwZyv7SNmoYw13HGdlNJS/wv9mqef2oICQp4qDlvFRkwlO3qHzGSYOD1AX4+Rg2ahG9cVp2ykdNYsHd1+IVKalt2XKk444jiQUIHbunhv/Za9iQ8zgD/0VTtHHHw9ak1+p4byIAqoi1v3PdeEN4VVHdYmysZ2UjWma6UiTihwODi0Z+nTI54apoNMFwtGKs71FeV3Tcf1Lr+vUB1nbxW6tfcjrrUjQDO4Iu+88N+j7VCrHDdCRle9pY50iazzGf5v5JfCx0X1VBl2lTdQA4v7e1fEYEXadES93FF6rElkQVLYvmNLRCkxu0NHZ9bYjOeym5luEYOKMOKruG8kTjySC/TdRC8AOD060u5ETcw3FaHaCrpzUtC0OWLZql8rcNzlHYip4FPWxEbEbHqowV0IpLYr1Dxn6HX8nJpXFqaFBOvv0xpJ1a353u0c5I6JKmY08Ygx9He5ut9hOp4esWMTYsC0QWYwQq/5qQbsRx5JzbCU2nLitr9pMTEH3WFQ8GGZPNOyjD4DEVuzDiJVFjvoKzei4Sd8lK9RP5C7SEbiy1wkcyxA== 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)(316002)(54906003)(38070700005)(38100700002)(1076003)(36756003)(186003)(83380400001)(107886003)(6486002)(508600001)(8936002)(15650500001)(2906002)(5660300002)(86362001)(6506007)(91956017)(6916009)(122000001)(4326008)(8676002)(6512007)(71200400001)(26005)(2616005)(66476007)(66946007)(66556008)(76116006)(66446008)(64756008); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?tba7mu+s+4u08M1SPAs3HNB?= =?iso-8859-1?q?Tz0uEOVPFwqWEpXoxo9iHN5o8fUXdHmXFaWlBGk9Ie0HztEUASKmu7k0Tf7f?= =?iso-8859-1?q?eRZGCw5bix1wcLEs6KCvbDLrlaXPsDIixiOMv0S8WD+/T7KV9lnMtkHPeBRM?= =?iso-8859-1?q?jU2k4x6vGDvxbsmy+9AHs+M0fp/02j5fAAmg+Muya+doSo5eD53UNhrHorOH?= =?iso-8859-1?q?g7SuewWhA5MJfR8L3TkL1O4ogW36zJShvK0Af1zv5WBTOl25APcSJcKUhffM?= =?iso-8859-1?q?2VNiHbH1uglUKIi+g5c0JIF/Amz4NxtGcMNqSvybJB82oda+hnc71upbX1kB?= =?iso-8859-1?q?O6UJ9hKKbSLGADBmGqY84UYWZyuFiDTyXcn+fSqIYKgjcc3g4I7nREaN7Y3P?= =?iso-8859-1?q?kLfIIj60TY04i8kyaIXIu2pwrsrxuYZhnSzSmWLTUaStTP6+ng2jw+MiKpg7?= =?iso-8859-1?q?+Bl2gc8TcIcbqn0Dz+B7+lqUxXa0aNX6hQ4DOOfIWL5eI3n9SXpzZjZrxcKk?= =?iso-8859-1?q?gUFHAR4cPdOkKphtH7M5yd1qoMMDuwfUBk1F650m98M47/keZ+7gJifOerF3?= =?iso-8859-1?q?AwEyx0qtnolPYHlKa2U+tqVeuZ+zE4PdhcbVrG2qlAZsgVGcY9pILnQP2JZ5?= =?iso-8859-1?q?czx9DfIug84WBbsPIRiTK10J22jzJsn8l1UtAhacNx7m2VleTdUwcJu/tSco?= =?iso-8859-1?q?fHUBcOMGPNLFw4YpcLaz9ffa8i8ZPyjS8rS67eygsm5hzitDISbWKrp3P7mS?= =?iso-8859-1?q?Txj7yrUIJ1rpllFzBeg9XrpZPGElhhtpeAXeO0ctnWcC9niZrZFBeOR0rmPq?= =?iso-8859-1?q?zblxHzlWC+M3TSKBBLrOVoFCRkTqvqvVPouUSLk+hDlHja8Ez7aGTZowC7Rj?= =?iso-8859-1?q?10lAsDr7NMqBEwEZ2puLns8CYuCUpm3j1U8Uff/AkrzxkdCKTGmzAEANrCVc?= =?iso-8859-1?q?HpFo5Zor6XCpKpdnAuUdVJLj5X6sg7wLXaLO29JN8qACEO4VWJ2XBs0+PML/?= =?iso-8859-1?q?VvC9OyW5EldE2zHRKVVf94iFV/MlIvd/sPTVcKTjJYKD8qqLhCTk1uyVGZn2?= =?iso-8859-1?q?E2JYR8EwGkf6WmEE3n4mQSEWCUzbnZRZvhXihW3pJcs/+uZkF7k3ye9hTQ/p?= =?iso-8859-1?q?cMAQPFR7KH6qzTrzyBp4nK1UWip8eD9JntIAzkx1TaVAgEtXW1a8kCD2BClz?= =?iso-8859-1?q?lrzpwY3B3w9nTxChwnSQ+hTcJOXK8zrF8B5MoE0aidIpnqFSKJQbPwAO/Myd?= =?iso-8859-1?q?WU3kHnBMkjGFyyCZyj2bfv2LMqWTpS7F+NtQacb/WJeozRglf9bGqw80JvRd?= =?iso-8859-1?q?FOxfcvQtv5MbmJC/foJ0LQVbSbWvuanGdEUjmbHfjMhGrlTpduvvAAJmqth+?= =?iso-8859-1?q?FfLQh6O1n7nbiIYrcB0NHJPmFC+PDMONDv9y10HOXjMFQ0xt9HO0Lt371Nij?= =?iso-8859-1?q?f/zdUBE/LFt4XfrYk57i52dwM1oNpPhYbIKZtj2yVD9BjBbYKBYBDsSjjmdW?= =?iso-8859-1?q?TTO7jLH90lbpLzybaHPVyrJ1M/7iMXgHaMAyU5C02HF/DaE5QG2AUEGarz1e?= =?iso-8859-1?q?0TVMvbAv+L0OLST6LAprk3YmYZaZ2J9hUHVq0hE6HSW7IZSeWNniF53l3C9J?= =?iso-8859-1?q?0fzNm0hvZk67gPa9uy7R47JNYaeQxVQ51gMhJsIPTjk/KCiQsuuiqtb8VLqY?= =?iso-8859-1?q?h6oGFSr+pn11nGPWIf8Z1vtyXknvibKVpCfszMiqc86o7+aQeenfgi2/gHXI?= =?iso-8859-1?q?fXPzDMEvF4VenyrzjQoy7L9x5hnG9R5/5K333YkHiLQ68x0RYEt+vAc/+Q0c?= =?iso-8859-1?q?1IjV0T2vzLZnwSPGthRzs7K83qfBo?= 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: 4676d97e-e898-4d64-a01b-08da35048326 X-MS-Exchange-CrossTenant-originalarrivaltime: 13 May 2022 17:17:52.2522 (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: q6atOWHG1EW090r97GM9DKV/jPpM6xg9S6oKSQL299OyvEE/DLTqFnCzFcFJDEpT35Qhwumgp17WK9EK6gfPfq6uaJgj9/vYtizGim0GQdI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR11MB3441 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 Fri May 13 17:17:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Singh X-Patchwork-Id: 572777 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 DEC7CC4332F for ; Fri, 13 May 2022 17:18:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1358943AbiEMRSL (ORCPT ); Fri, 13 May 2022 13:18:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242563AbiEMRSD (ORCPT ); Fri, 13 May 2022 13:18:03 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 562EEDE96 for ; Fri, 13 May 2022 10:18:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1652462282; x=1683998282; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=IhT2NfWmxVRWlbfqSlP/fzKzzP1qCdcO0mVCpmGEZa4=; b=s97vtcCjyva9KOBdLJTt6ttyziWtnRWtXR9KXGawn5b/ZkpWT4nnm8Gf HERBZYlgmtLfFkgi0dCcuKIgLFp0Tn/tlBLGM9KmwcsGafTSn8s2lK/LS iBlOwannFLXXAmItIW38U3LVksI48Qn6FKdATC7JRHN5hUGRSDWvVeC7m CMa5rrf6u78nqsJqdGFsTHkHY0ZmOvftdXWdnOl3ae+OgOhmWi6gm5vGS 0o6kcTT7hRFBY7qulu2VyaL0AwX8nilNC/KxJY2HrwmZ8mjsRsIBydO5u VIhsCfNccdTzHBVyULMPslf/f8Gtbcd7EctZIY1XGbBwvNUDwlsWPEEZX A==; X-IronPort-AV: E=Sophos;i="5.91,223,1647327600"; d="scan'208";a="155983590" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 13 May 2022 10:17:58 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) 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; Fri, 13 May 2022 10:17:57 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.87.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.17 via Frontend Transport; Fri, 13 May 2022 10:17:57 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hXiZFgG9x5F/X1NleH/9T/gXzHPtZco3m9+imrw0OmKDEw0b8oHC+/6xwfoQol0ZZO1nBVFFtOwz/Ub5Tn//VMdnL5qLJEsqOFQDDyGB4AoIFAhJHhhrNecN+5mNdSntYXMLJfvGrCMZiT8o947jOLFKKi4gi9xEpdF3DHF84Nnwc/vCzG6gFSIV8Tt3Pj+ki58gDHcacjiO9796oGD6rdxxzh6hrQMneieCR0YMd10x33kOyEdpciSgA7w7ktEMGDDsDGgh2zacioMqLs421zhmgkCSshXinN5SgNSnZathK+N6YZQQSqZ7rhy4VDbE1mb8m+Yd6eCV8qEa0i07jw== 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=kCan1DL3Ze61y1TL9Q5Wr8xTbYicK6XEQjhlsYqKI2I=; b=Wdm5soYdiX4GR7XFCYp+VuQ24mktLuBCg0B2RLQ/616igCeXXpRdgMOBC2CAsXykZLRKN/zzGBw2paUIIKIiNYehNe2eWzuhH3O/WESgP1kfo+BZcv4+SeAtY1imlffNKOV8opEAw6TqlwQ5LqQ4B901Wcg+KMA/6bFrFgFG/68fpjILuWbNZ/jqc8lG+WCM3PxqjMXGeyAnHJOEP47pqLaSxwB64PUVgmgO4NoEVy5CSRu2CpMPiNLOtc+wk8X0CW0UxkHKhtit2FzSPHbfDVIjcHVpV/LgLu1fV3uFgXJb5Z56OFY7ARpnnzTXh1+6/0npQPVToE895m86l/JK3A== 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=kCan1DL3Ze61y1TL9Q5Wr8xTbYicK6XEQjhlsYqKI2I=; b=cZXpm6y2nVvt0C2bx6AGOZcVDnVwIxTwIkcA4z+phkZOR3BBQRba9YBpALKAX7p6z3I/1ttcE4eOIlihZsP2FublFyzJxlqLdmKmWheB5z8g8hiR6IiEbBaR9Hs8blrzuMBS3+7Ie3VQ5/fQZRVrCTOs6wOM5BtdxD+ocjykazU= Received: from PH0PR11MB5176.namprd11.prod.outlook.com (2603:10b6:510:3f::5) by BL0PR11MB3441.namprd11.prod.outlook.com (2603:10b6:208:6a::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5250.15; Fri, 13 May 2022 17:17:53 +0000 Received: from PH0PR11MB5176.namprd11.prod.outlook.com ([fe80::d0fc:845b:ce0b:11fa]) by PH0PR11MB5176.namprd11.prod.outlook.com ([fe80::d0fc:845b:ce0b:11fa%9]) with mapi id 15.20.5250.015; Fri, 13 May 2022 17:17:53 +0000 From: To: CC: , , Subject: [PATCH 3/4] wilc1000: add WPA3 SAE support Thread-Topic: [PATCH 3/4] wilc1000: add WPA3 SAE support Thread-Index: AQHYZu1h0NW5KIWnr0OKB0zhecXd5Q== Date: Fri, 13 May 2022 17:17:53 +0000 Message-ID: <20220513171741.26701-3-ajay.kathat@microchip.com> References: <20220513171741.26701-1-ajay.kathat@microchip.com> In-Reply-To: <20220513171741.26701-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: e80b7827-8f73-41d5-baf1-08da350483a9 x-ms-traffictypediagnostic: BL0PR11MB3441: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: +j4izPdkDyI8s4MvXHhQ6RFKtCDMqPXKCL/ZGDHHeh9Fptwrg52O5hMyZ8c/mXnspTzZCZqp8IkwWIuNmi9955gO6i2RaC4QYI8YYUwyabnPSzC5syv9JaT43NPzbS4YIhhuXV2dX7WS1sNaQmed2xxPjBau3gGAZJURmAh2yYWhzNVdlWIh2bqwhoy1oQ+fL5WVUmUAAyr7tyPSgpyZzSZ+2OXbxOMpm9x2spg/vdtWDyUcnKz2hc0UycwhRpAHXH+u5+/tCB74YwgtjYNZP8mzmiadDdik8IGMuMDravlNu1wm1GWcMMJTxr1YiuUK6vecsZk0v6cf+uJut2E9SBQjFvD0UXuruyOje/UixTO1+/QRYg9hAzf8UzIJISE1rQYzRsZB0uu6bpLV8j8fAwnjX1hfvCdoAQ4zBnHKZBIhneladITl61NFQxc0uhpV+M/vjZ7OqV6+Q/oE6d7q+laZAeWU6KxLeFqQgxkDTSJPRG/HJvmOQTxpMftXAQCaNpFcJiLOVeBKNMMi5JKiJ0d0edMSjo1U6E3kuGKSm0TAdI6AGKUBH7dWh92F03Cj5FBis2MfcSHpBNzYaTKsnHb6zd1YOkZXk0xFs2nj85YlypqSZboyWThlLif9GVFvnKrg+WzGaROHzyPZeQZ5ZiosOofBkdxZyoGJxiSchK6ILEHMmdmYPwq+80HSikBvW7q2Ftkn8aQ66uZYTkudXA== 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)(316002)(54906003)(38070700005)(38100700002)(1076003)(36756003)(186003)(83380400001)(107886003)(6486002)(30864003)(508600001)(8936002)(2906002)(5660300002)(86362001)(6506007)(91956017)(6916009)(122000001)(4326008)(8676002)(6512007)(71200400001)(26005)(2616005)(66476007)(66946007)(66556008)(76116006)(66446008)(64756008); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?qHRd08xOubOoPeAoOO97SXT?= =?iso-8859-1?q?sYeagVeY0e2+234fluG9M8QlU+l9SryUaK6LEoEPpX5v2kpVmJnREB0UsDac?= =?iso-8859-1?q?XOyuu/25rg7fzGy6xoKzLDDM7LhrOKT8HbtwIGlg+dYyP7a03k9lsrDHzj6C?= =?iso-8859-1?q?p4AFqxFqT/a0ePANAIRxYK53ztNC2D921U3xU/7VHdG0HnzljWkPkTSfkGK6?= =?iso-8859-1?q?PWSU4tI1ScqZP+Hm8VQOEUDcYc7+CAdKx2YwSuryNdBhQFjEkbahWI8NL0vt?= =?iso-8859-1?q?lCMeBL30camzHdmrfkGC2i02jCh+PyWhGGA1UzymYmuwsqLb2p2rrcz+j8u7?= =?iso-8859-1?q?nO3a+DlJtgw/nbMgG9yoGtqdckEBtLANL6dXUJAlbyqUHcBvwSLI9z9Kgapf?= =?iso-8859-1?q?lZlVyw5nJEjfv6kxjhYgRV1Q8nZbQnSBIs6ML07hCHKwttJ+TQnKR2po4KMs?= =?iso-8859-1?q?Mfxc57//yl2aioR3fOCGAcOtQnHhoWhWYpsHvB8QpdZ5pDO6VSHynZzyorb8?= =?iso-8859-1?q?V2DYU1Yh2hA9viV5l8lRvHsdUT482y8224D3X9s8x6peI59XlpWSD5CYJ6RT?= =?iso-8859-1?q?yJRg/nCyELb48SOnekdUi1IBd9+VSPdRJjdQHe0qMsXaZfEMYI4Qf7hVCPYZ?= =?iso-8859-1?q?3UjatVr32gZ1PO+646QUKLdYuX6Czopo1V/M++ZKBYO5OQibrpA7RstNfOiK?= =?iso-8859-1?q?p4AVKBBtGRmKzldtQIwcw86TeWkMxI/MikEOlzLm7pH9jijmpPNqlb0d2Z9U?= =?iso-8859-1?q?QJufdqFK+uHiBaWO/wMbyB+oK8WR9gbxSKNVHxeR+p0pM8jADBD1t17zGBrA?= =?iso-8859-1?q?7nomA7rv25dvK45g6+FhYbtNcvwMXhxx1/quqJRZzRtKeschJz+gO4pdw9kw?= =?iso-8859-1?q?HgP/UmTBuicOjXUuuLtsoll6jHQ462yJJiMH+MyloS4dUu5djW5Cg2rT2rI+?= =?iso-8859-1?q?in8PPfymCw4DJhoVfXRZnAnXxDNMQMzgX2xph2W2F/QjA8X4g0ry8OtuAjFH?= =?iso-8859-1?q?mSbaBvqIP5eMfY/v/sbc5EQTKDu/5rqLvnmlLVK0CEE/KcT2TNkcU26c+CHb?= =?iso-8859-1?q?xVCmEiiND1ADI/RrIZI/FPR6W+YLt0A2XlIkS8lCwzVfrw0GmKyvZIjOnTq6?= =?iso-8859-1?q?oq1QbIFaaqP4xglU85BTYcDq8iVA/8LX2+gIjA7dQdoeqaGWGu6oZdxJdfFj?= =?iso-8859-1?q?AQKYyDA3TL5U//ieZrp89gLb7Xqy5eSKkP8nl7BOap7c0VS6P5OVXNfoXIxW?= =?iso-8859-1?q?+r9Zxc+SfBPBlNcrOd6ZHO+w1XBji/kPNT9c8oAujQ3EuJ3IUpUPD5QHpVnI?= =?iso-8859-1?q?O1NfKRQ4qmrG28QOLudUtaAGvvSSKZ14jX7Sf8iouhl1/Ato0xbIiL18LUdT?= =?iso-8859-1?q?FlITkSTDHLZYD4pwbKBNapWr6GV58u2QKwH7tP6i3ol5dTvof3TaVQBTTJun?= =?iso-8859-1?q?ORx43o4/mlkOZbdCDW1U6MtX+Q6mM4F77pQ/1Wnnms1994PviIWIKOr7stbP?= =?iso-8859-1?q?dBQ0ToXaSjbZUHLrURcSmm0vzEX9+dib9S8IvJAvL1WTzzCtkRZ483UYmkvf?= =?iso-8859-1?q?Q7gSsc526s0bnLRqNKk+17xb5KRXBk1/Km/iINL5KL7DCqBT0xnX52CGfZXZ?= =?iso-8859-1?q?QvyXSA7W0upPZezes8LwanlqXQnC6oiosHMSaRai8fRJfO0kAW/mq3GXtfVQ?= =?iso-8859-1?q?Q5vlnvQh3HqeH1uVma0SdgYAnGutu8+nf7XLDOirta4k7GbWp64i0IOOKLVU?= =?iso-8859-1?q?O8PAjY5vSMJQOE9F0beU2vBgnPImYV8+JvW8gIH5FIbk6jfq7H0D4wzqmpD1?= =?iso-8859-1?q?R3Mp7CA995e713fqz+JRTl0d3Tu+l?= 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: e80b7827-8f73-41d5-baf1-08da350483a9 X-MS-Exchange-CrossTenant-originalarrivaltime: 13 May 2022 17:17:53.1270 (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: 2oORap9RMHJObgVPnSLhRD6IzF4Tvvm4FZUxzn34IA5VEUNgaJjJdy5zFmz2njHInyjPr4Be1cv4QcjHvSX67u0s+pcQWPufopH7a1/z2hQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR11MB3441 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 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 | 13 +++- .../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, 135 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..6fdd16e9bf6a 100644 --- a/drivers/net/wireless/microchip/wilc1000/netdev.c +++ b/drivers/net/wireless/microchip/wilc1000/netdev.c @@ -835,15 +835,26 @@ 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 wilc_priv *priv; + 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); + + priv = &vif->priv; + 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 Fri May 13 17:17:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Singh X-Patchwork-Id: 572778 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 161AAC433F5 for ; Fri, 13 May 2022 17:18:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1358545AbiEMRSH (ORCPT ); Fri, 13 May 2022 13:18:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376785AbiEMRSB (ORCPT ); Fri, 13 May 2022 13:18:01 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 21885326C0 for ; Fri, 13 May 2022 10:17:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1652462278; x=1683998278; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=+atr0/0MXTn7B0bydlEGXJeZuoDpzYPQdLS76n4uN5k=; b=mfo9pIHQEpE0wcWISdyxviqsM/0s+XAtuX2EJzUnV3y2+ECoQ9uW9372 0MDrtYw5IryYAPbohMOqlZ6ZCraGVPZjSTLS7hcdWo7IVtfgksfYMF9CR x2jCfgELMd+vPC2tfcEKOJs/E3WtqZ1svohLoX4GQIkSX7oGCK+TBE2V6 ZHbwSKNW1RPQ3yUxMdsl+MzVEwjPP7p58pAK3EpIwMjHIsSLXFQj2jSv7 nItHxuMpcgXptNMLV1FhtcyrohY+tTp+XH5JdeYj/cYO7j9wopVKHQ1WX uFfum61qfcSMS4FdMiEEbo0xrVUtR6IWZJOCQp9UUxqw6PUtpIaf+8qqH g==; X-IronPort-AV: E=Sophos;i="5.91,223,1647327600"; d="scan'208";a="159001882" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa2.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 13 May 2022 10:17:57 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.17; Fri, 13 May 2022 10:17:57 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.87.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.17 via Frontend Transport; Fri, 13 May 2022 10:17:57 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WbGqXfW+/ZQEDzC9kt0SKCZzZO5L2C6NY4ttVgjTacgm/8TAuzwkcTApm9fHQ5TzJz1ufYXtN1/ON3svKLFnqwG/Lj0nzdj8f73qua40HMzV/i77mVHv3LTp2Goi1cayVs1XZu2gV3+0G1SZfQZznM+mBr9DMj5h4CxVgk9VOY9NtyZHWfFSEywM1Lk2n5rhPKXc7WYlcYcOuufjUVoNKD491cyC9YeC2llUDG0GBxYxrDW2rbYvK4jr56CtMn/GaVyEE/jVMCxuqibD41JExik6nRiO9/2u3jvRCfkKjv8qX8Q8Cd9KlfcUfqRhB/g5q3rKqrDFsxZUY60VEwATCA== 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=cQbPzQpIPlBTOTeKlGnBS3jrCIhEVvPxar03Cr5G9WZ1FwinnBoFsWgpvTT+b69YY4rObjSQVUiLLVaVK8GGH2TO7VpKJPKlkH9p/uZb5FexRwF8+tla6NCVF66Q6/vlmJCi2Gb120Sewlmoud9h7PqHi4rdvyn/bkzqeVtvvnavhzzA8bWo3+0UOOG07Kw5nqJh9+Und2OZNSWaysjkU4v4gZUU4DscO24Vk0VXi8AE8L7Ajm1zoiMlGdQaqO731vrLo36V8vgcYZEp3VVJBkz1+xPal56uSQrSBUiPvNqWAJyZvlHgKLQN7aYO6tEQEKjLLiPjNJYAdidViBdDvw== 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=lpDbmuHGp+iD3iObPvZEB2mRO1FXFYCCt6dj3D5uGdPKGr8Tb8Fd6IkTHeiZerg5481i5S85oKAUU8PTF8UYapJrVJLBJQkn95m8/HJ37oTpnBr9fM/SbsGWAsLh4bNv2t7fYnbq4a61PnUrlam8/Qo1QlTLdhDyX8a0DMXkCyk= Received: from PH0PR11MB5176.namprd11.prod.outlook.com (2603:10b6:510:3f::5) by BL0PR11MB3441.namprd11.prod.outlook.com (2603:10b6:208:6a::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5250.15; Fri, 13 May 2022 17:17:54 +0000 Received: from PH0PR11MB5176.namprd11.prod.outlook.com ([fe80::d0fc:845b:ce0b:11fa]) by PH0PR11MB5176.namprd11.prod.outlook.com ([fe80::d0fc:845b:ce0b:11fa%9]) with mapi id 15.20.5250.015; Fri, 13 May 2022 17:17:54 +0000 From: To: CC: , , Subject: [PATCH 4/4] wilc1000: add IGTK support Thread-Topic: [PATCH 4/4] wilc1000: add IGTK support Thread-Index: AQHYZu1hJJjmsiHpeEmcVGKRcWaKSA== Date: Fri, 13 May 2022 17:17:53 +0000 Message-ID: <20220513171741.26701-4-ajay.kathat@microchip.com> References: <20220513171741.26701-1-ajay.kathat@microchip.com> In-Reply-To: <20220513171741.26701-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: ce9f3116-4485-42ca-a61a-08da35048468 x-ms-traffictypediagnostic: BL0PR11MB3441: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: kBOycjdQmokVeDsBhADexS1pS8H6NH1v8RgEm+4rqxMPQTrs2ANBwPPKWjhfml65kFdyr417FutRBAa7cf6pW8xc21bPwiqMxt/cBheUIwQ0bFdiml6bq4EMfYTcxWBZm4wrw4Mnc+Y2DuQdvFKpECy267C3uuy2rlZ0hNZQ59XOxpuuwiqJ3YBRFOSxEN73rsn76jBdSFrpXpfUX2W6pGLEZN3YW8FbzxflhYKfAXnTSoE/gvRhQKOQ0eDTm6173Zm7BGmABHbPd8eDSNuzn+LLlOQhT0eu9+Ih6f1TDkOh4b2ps0RKhjYY0xGpdjGs/YTYqJ8XR9J1Qaeja9in7fzttLJT8KaNPmCpfiIZ50m0xbJ8xHqJtDDURy5/lLj3a/Kt611ewO32O5Jewm4/jqlyn/rjz74kIKB7YuK2WaUqJI9KL9n7R1mRKB8Kvq7H8/tquMTZPXS6BLCraFcHPJHudrsPjHtEz/WrlpO7VWjidCIt6usUK6U3MtNd0DDkNCmeXTCiiD6b7xPdgUKQ/ja6IOnHympbFJ789Nh/SGWJAjiFpiHiHLnm3+06T+b5u08whB3JX8DwsSisYnyEfn1MNT9mAn6Ez2fioHUaRbWsJA5u/lSVHXwLKn//a6v5zoS0jJhU8Sd2QP/BAvcu+LUXDO7bgw9aux5j7gbwQHHOkTJNV6oLJnBiNihvgUO2F+stHcGC1jtNn6lHUCqdgw== 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)(316002)(54906003)(38070700005)(38100700002)(1076003)(36756003)(186003)(83380400001)(107886003)(6486002)(30864003)(508600001)(8936002)(2906002)(5660300002)(86362001)(6506007)(91956017)(6916009)(122000001)(4326008)(8676002)(6512007)(71200400001)(26005)(2616005)(66476007)(66946007)(66556008)(76116006)(66446008)(64756008); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?eHdPZ06A2NsjIWVIdRidFQ7?= =?iso-8859-1?q?/jSfU591YAX6rH3aK0NXyFaUtCBVE4hUQa5MBROmtzN4WqUo2t7EO9S3DyeI?= =?iso-8859-1?q?mMpQjaNl20YKiy2pppMrkYw0sKFcVrgJ4sYpl514ClknBq8Rg1UgwoZy+LzH?= =?iso-8859-1?q?ramnWoCpc2q3eKbJO9JPIr6vlc/8YFebwkwto9LTnv8TBCVGyH6r/BkglTP/?= =?iso-8859-1?q?/F2UA9IokmiKFQF6m6KzvPBIoj5dQgDNziUxHYA0XGqYxozHvXOjYX1/2nbl?= =?iso-8859-1?q?vkB6j4I7JIeZHhfIlKBoqBQdbtPfYsC2Likr3dNzyG9AX/wZsu/BsIlXskm3?= =?iso-8859-1?q?gVbv4XEqX0LRGvz3CUzXpfLojxvp8F3RwCGz/l40HpwaF1TeFUc6KIsrvDyz?= =?iso-8859-1?q?rq74bLoqmuUIl1O3/dwQ9FW6QjD8Akdxl/2dZWERjmnHMuNiYBvDZ6ycEode?= =?iso-8859-1?q?21/dVFPoJe2hX7+KPojy0mwvrojO2Fzk6FeWG072DFpxaPU8/LAYiOnuDWlb?= =?iso-8859-1?q?UPPRCEmU7XvpKRrTsqyDpVvdBxVUFwxWN5uSYJNVq7Mgd3HZ8bDOekBp3ZE5?= =?iso-8859-1?q?D5WMTxxZWiNAAXOV0LpFN0Aa6zUVnxiWron2EqvkHvXaKpuqJubS1Hmi6yIq?= =?iso-8859-1?q?TKzLPeVEDMbfa+sBEOi2lqvznuEQPgPS2oZBWwRswpRiEkscskTKklEwPS3J?= =?iso-8859-1?q?RQ9FXKNYdVlRXxq88ZKBU2e4rdnQd92LRPXDTFXichOG5XzGyooI0M/oTplB?= =?iso-8859-1?q?8UCso3EhKNeDNOTuH3BuMpw/bPkj/07knG/18yq2QOjpiz+707NOv6iITK1M?= =?iso-8859-1?q?BX8dNpkIoR3lKXEaYnc8v5ySDWe8rdJCg9tRsVOKYKHtaRoqGbrXg6bryWKx?= =?iso-8859-1?q?cNf4Pb29qf3FBLkaPNXxMuz+4b8XguYy1jLFHwcsoKDtcA+PpQ9FzDu2gv+H?= =?iso-8859-1?q?6h/knQQB2QKugds1Tv3gFSYl7e4ZVS56VX982fJh7tMR9S1xr1uKLIrxz53c?= =?iso-8859-1?q?T4WYVaFenR9Y2jodxXiioc96qI0OQGgrFx850ttYgEloXXQnA2bRSUK33MUy?= =?iso-8859-1?q?iqDshwrz/Jl+CMGSKalt460tNi+GI97AfUlc6Ik4+FeM5YA+UPHKq6Jd2nz5?= =?iso-8859-1?q?n1L7GB1Gn3zMiByEBz+AMn0vmxv9zEnrdU8VC8a4sSfHemuN6dUd8d29epCI?= =?iso-8859-1?q?B1lIu2GMHOfHTV+8CsijbIsxX+DbMaoSnoNktpDgYvY/qoXI5kezcVO90boO?= =?iso-8859-1?q?H2XIljR+LKgMdNKp/8ycM9CLtMC6c8H6T9ylUAesD7j8Qcf+5MMauNPQ/Xhd?= =?iso-8859-1?q?1JTNj5rHZEjmdNIo0EVPxETAesRcjG1ARdx8l7pKqU+beqi4Oa/xfrXD8BlH?= =?iso-8859-1?q?YFR1c1DN+cSXXds0wp/DjODbLG+RAcW4adwjqL0KrZfIH4/aA0p/XD5zH6SB?= =?iso-8859-1?q?0iON0Z3p8a+pdjrYlqfdw6VW2rjjX23FIeqF72aMLDGqzJwFgsQ3XuxKd0+g?= =?iso-8859-1?q?CcpDp5gCRIBxIrgruUaCrh37z6Bag+2Q6PA1VKGqk52YKzuRSktDk2rm/sjI?= =?iso-8859-1?q?lc9fMJdqC9bNNVHSUpdBB9N0ei8/gHJi3gsEx2AarFjQXJwLLB1NtBcj8aAV?= =?iso-8859-1?q?Mc/kaFpREpbRCvUL6KUzrLxhko0D6gIi4w1qqWlPE55AnxZXTdFL4zyblrid?= =?iso-8859-1?q?cZuxJ4U0n3uy5TnbxqWxVlNh5ZcAuK28vZ/sHptIj4ddNdFoIkal2+9sXqxc?= =?iso-8859-1?q?AxMIZhy8PcuLwzVmXyaM2cqkSQSdjlD/d/vTRVlnQtdTRbGOWsRQ9TBANaKL?= =?iso-8859-1?q?b4GKFyHzi0D7rAWH4ECtZBM468Zvs?= 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: ce9f3116-4485-42ca-a61a-08da35048468 X-MS-Exchange-CrossTenant-originalarrivaltime: 13 May 2022 17:17:53.8144 (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: FMQ8K1n7AEFHmTDhfxjKT7o7wjlCCqTCZkNqeXjzCESiHl8sBMg/LceW/TNuoU0iNAoIprkOPGzd6V3Ch+bzq10MDnRgmzr3QEe6ScqS34I= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR11MB3441 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 */