Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp615248lqs; Thu, 13 Jun 2024 23:31:45 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCURvPWB2J9+tgKIvhG9yVYbTFNPWnmqd5DqyQrRvUfmVxmOhfnx+tPiaqVC2XnE0fchFZWcM2UkdyDkDYDnDCh7RPrwa4NkOH5vZBKw+A== X-Google-Smtp-Source: AGHT+IGuXKfAqbPTSr6D2ZEX3sgoj/Lhv9EVwIFFbupjComDwbIhfBMzDla2TbiVFVPmZkVU5hd+ X-Received: by 2002:a05:6a21:998d:b0:1b8:7723:7a76 with SMTP id adf61e73a8af0-1bae7e28e7amr2335838637.12.1718346704904; Thu, 13 Jun 2024 23:31:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718346704; cv=pass; d=google.com; s=arc-20160816; b=yOA5pWAHXtKvSlon2cguEJXEqFeXCm9iROFe5IVl883dkxRsUogNeqGbnxWwEQTCeJ KCigdjKpSI1jUn8RXKotcEar/+syfhd+HnKy9rxylwCvFXqY+CKEZ0T8hFp6xYhGqmld IAG56504f7vvvesh8M9y+HYpDwBqkO4vdVN8RgJQpWqeiQ4DEuS98r5Sdm4IanbIPaJx RYuQSsFPdO1gZ2UauaePV2yajtsgkcQ/pvE5srbGXOZi3//t9lPqDSy10ASRAv9tYtRr 2fsv9QsLZj5TGrIbGHjmCLVe9J0IfuXn/rOxYy6FccS3IaEdnpY+bHGNbPvqc0y5saK2 4TLw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=XfXcNaz7MuTkoL8dUakVntGu8syOFZ2hrf9nkmDgIQw=; fh=wql/kY3NNUGWE3OmO4b952ZSvuCBE0EqhoPnyFrHS/U=; b=t7X/z4kUIaRWXAzt/FdagoQPcX6DXUT62lJVUEzbyDwk20K95OG5n1lq2VWVI3HMoe +Jl5V/R22beF+7q/G96VZzPhVpcbTMpOM6m7oSXgqsh8vD0DIWj/5ONBrmUKOIVmtUme IWsfrkC+EOfLykYHgFDj7wKtYx49hnt/DPlQkn7YcUGAY7V3ZOWYanuMuf12SIrQ1+9K 8KIXN97YgtbrRZqAdb/PHB0P2zr5+9j5JDzicRfjBYmtvAH+tU0X/ONjzIKzgBRzu7ph uqcbfvE4QdXz2QT+kbQYXCUOJdnDgEPbDQ7nYc/pjliqqDlL6yq/uM5jcfWbYfkAKh3u cN/Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-214399-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-214399-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d2e1a72fcca58-705cc961caesi2942074b3a.90.2024.06.13.23.31.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 23:31:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-214399-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-214399-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-214399-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 85D89285CED for ; Fri, 14 Jun 2024 06:31:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 902071482E7; Fri, 14 Jun 2024 06:31:38 +0000 (UTC) Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D1B082AF0F for ; Fri, 14 Jun 2024 06:31:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718346698; cv=none; b=byLnxkUu3/Mi4lt0CU3E7th+jiiANxWeJ6J83XI/Gylw9oEe73ZAaKLV/XcOW4TvgtORgTnbi9QtN2L40bp3MaZGWPhmLOmPbMIps7pQkrxzSEotRGM8+HfFDc4XMS/DCxtN4m3lFDIgjpo8Tau72HgzbbbhR5XELA7O0iH8sjs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718346698; c=relaxed/simple; bh=3fhzZCVnsTXZswTdw/fAHddow893rrKkDXJvC1Nqm2Y=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=KRJ56jPUkJjULR7qIGaL066QFK5rVnOoEgrt/N2r5S/NQJoHn3XJT9xDp1qAc6e5e6l4ogMYGOQq6tQEQYZiO10kyZR4z2pw4vh+yAx0Wsc/nvoq/0LfDoUQL0A2pDPSlnlLXCo5HZT+4bQlURp9FwXBXFQC0v64I2H6eGi8a9Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sI0TE-0002FF-OT; Fri, 14 Jun 2024 08:31:32 +0200 Received: from [2a0a:edc0:2:b01:1d::c5] (helo=pty.whiteo.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sI0TD-002Ci9-SA; Fri, 14 Jun 2024 08:31:31 +0200 Received: from sha by pty.whiteo.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1sI0TD-00ALUF-2V; Fri, 14 Jun 2024 08:31:31 +0200 Date: Fri, 14 Jun 2024 08:31:31 +0200 From: Sascha Hauer To: David Lin Cc: "linux-wireless@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "briannorris@chromium.org" , "kvalo@kernel.org" , "francesco@dolcini.it" , Pete Hsieh , Francesco Dolcini Subject: Re: [EXT] Re: [PATCH v10 2/2] wifi: mwifiex: add host mlme for AP mode Message-ID: References: <20240418060626.431202-1-yu-hao.lin@nxp.com> <20240418060626.431202-3-yu-hao.lin@nxp.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: sha@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org On Fri, Jun 14, 2024 at 02:06:45AM +0000, David Lin wrote: > > From: Sascha Hauer > > Sent: Wednesday, June 12, 2024 9:12 PM > > To: David Lin > > Cc: linux-wireless@vger.kernel.org; linux-kernel@vger.kernel.org; > > briannorris@chromium.org; kvalo@kernel.org; francesco@dolcini.it; Pete > > Hsieh ; Francesco Dolcini > > > > Subject: [EXT] Re: [PATCH v10 2/2] wifi: mwifiex: add host mlme for AP mode > > > > Caution: This is an external email. Please take care when clicking links or > > opening attachments. When in doubt, report the message using the 'Report > > this email' button > > > > > > Hi David, > > > > On Thu, Apr 18, 2024 at 02:06:26PM +0800, David Lin wrote: > > > Add host based MLME to enable WPA3 functionalities in AP mode. > > > This feature required a firmware with the corresponding V2 Key API > > > support. The feature (WPA3) is currently enabled and verified only on > > > IW416. Also, verified no regression with change when host MLME is > > > disabled. > > > > > > Signed-off-by: David Lin > > > Reviewed-by: Francesco Dolcini > > > --- > > > > > > > > diff --git a/drivers/net/wireless/marvell/mwifiex/uap_cmd.c > > > b/drivers/net/wireless/marvell/mwifiex/uap_cmd.c > > > index 491e36611909..073c665183b3 100644 > > > --- a/drivers/net/wireless/marvell/mwifiex/uap_cmd.c > > > +++ b/drivers/net/wireless/marvell/mwifiex/uap_cmd.c > > > @@ -72,6 +72,10 @@ int mwifiex_set_secure_params(struct > > mwifiex_private *priv, > > > bss_config->key_mgmt = > > KEY_MGMT_PSK; > > > } > > > break; > > > + case WLAN_AKM_SUITE_SAE: > > > + bss_config->protocol = PROTOCOL_WPA2; > > > + bss_config->key_mgmt = KEY_MGMT_SAE; > > > + break; > > > > Shouldn't this be |= PROTOCOL_WPA2 and |= KEY_MGMT_SAE? > > Clearing the other flags when SAE is enabled looks wrong to me. > > > > Sascha > > > > These fields are used for the configuration of FW, this is the correct setting. This is done in a loop iterating over the different AKM suites, with your patch this looks like this: for (i = 0; i < params->crypto.n_akm_suites; i++) { switch (params->crypto.akm_suites[i]) { case WLAN_AKM_SUITE_8021X: if (params->crypto.wpa_versions & NL80211_WPA_VERSION_1) { bss_config->protocol = PROTOCOL_WPA; bss_config->key_mgmt = KEY_MGMT_EAP; } if (params->crypto.wpa_versions & NL80211_WPA_VERSION_2) { bss_config->protocol |= PROTOCOL_WPA2; bss_config->key_mgmt = KEY_MGMT_EAP; } break; case WLAN_AKM_SUITE_PSK: if (params->crypto.wpa_versions & NL80211_WPA_VERSION_1) { bss_config->protocol = PROTOCOL_WPA; bss_config->key_mgmt = KEY_MGMT_PSK; } if (params->crypto.wpa_versions & NL80211_WPA_VERSION_2) { bss_config->protocol |= PROTOCOL_WPA2; bss_config->key_mgmt = KEY_MGMT_PSK; } break; case WLAN_AKM_SUITE_SAE: bss_config->protocol = PROTOCOL_WPA2; bss_config->key_mgmt = KEY_MGMT_SAE; break; default: break; } } It looks wrong to overwrite bss_config->protocol and bss_config->key_mgmt in each iteration of this loop. If that would be correct, you wouldn't need a loop at all, but could instead configure based on the last AKM suite entry. In my understanding the bits in bss_config->key_mgmt should be ored together depending on the possible AKM suites which is also what the downstream driver does. Sascha -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |