From patchwork Tue Sep 27 03:41:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Lin X-Patchwork-Id: 12989844 X-Patchwork-Delegate: kvalo@adurom.com 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 EFAC5C54EE9 for ; Tue, 27 Sep 2022 03:41:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230164AbiI0Dlw (ORCPT ); Mon, 26 Sep 2022 23:41:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230148AbiI0Dlu (ORCPT ); Mon, 26 Sep 2022 23:41:50 -0400 Received: from smtp15.infineon.com (smtp15.infineon.com [217.10.52.161]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43AD7ACA3F for ; Mon, 26 Sep 2022 20:41:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=infineon.com; i=@infineon.com; q=dns/txt; s=IFXMAIL; t=1664250110; x=1695786110; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=yiLzuxY1XeKOnKqZU8sImt9fGqgl3ZVI/9TS9FzmXjA=; b=aK5JcrKkYZ6TtA/IhYBo3DLGp1FUbN1TyNCHUt5fwV/JmZS0BN+Wxkq0 taghb/Qw61Z9zww0BaS7cuWv38oTCbzxXBoSfdf/hBKBUlej7gEepXXEJ HSpo0VUWj2Cbxx5/Q8/IPiIHx7aC8UYcnjruHy3tnw7TxLRYbSnMT0cyn E=; X-SBRS: None X-IronPort-AV: E=McAfee;i="6500,9779,10482"; a="142910458" X-IronPort-AV: E=Sophos;i="5.93,348,1654552800"; d="scan'208";a="142910458" Received: from unknown (HELO mucxv002.muc.infineon.com) ([172.23.11.17]) by smtp14.infineon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Sep 2022 05:41:48 +0200 Received: from MUCSE805.infineon.com (MUCSE805.infineon.com [172.23.29.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mucxv002.muc.infineon.com (Postfix) with ESMTPS for ; Tue, 27 Sep 2022 05:41:47 +0200 (CEST) Received: from MUCSE804.infineon.com (172.23.29.30) by MUCSE805.infineon.com (172.23.29.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Tue, 27 Sep 2022 05:41:47 +0200 Received: from mailrelay-cypress4.infineon.com (172.23.18.56) by SMTP-MailRelay1.infineon.com (172.23.29.5) with Microsoft SMTP Server id 15.2.986.29; Tue, 27 Sep 2022 05:41:46 +0200 mailrelay-external-outbound: True X-IronPort-AV: E=McAfee;i="6500,9779,10482"; a="260700530" X-IronPort-AV: E=Sophos;i="5.93,348,1654552800"; d="scan'208";a="260700530" Received: from unknown (HELO mail.spansion.com) ([10.248.30.8]) by mailrelay-cypress4.infineon.com with ESMTP; 27 Sep 2022 05:41:46 +0200 Received: from inf2.aus.cypress.com (10.248.80.6) by BIZ-EXHT102.spansion.com (10.248.30.8) with Microsoft SMTP Server id 14.3.498.0; Mon, 26 Sep 2022 22:41:45 -0500 Received: from iot-wlan-dev-u03.aus.cypress.com (iot-wlan-dev-u03 [10.248.81.193]) by inf2.aus.cypress.com (Postfix) with ESMTP id A2E5B1004DF; Mon, 26 Sep 2022 22:41:45 -0500 (CDT) Received: by iot-wlan-dev-u03.aus.cypress.com (Postfix, from userid 27991) id 9E5D89807FB; Mon, 26 Sep 2022 22:41:45 -0500 (CDT) From: Ian Lin To: CC: , , , , , , Subject: [PATCH v3 1/5] brcmfmac: correctly remove all p2p vif Date: Mon, 26 Sep 2022 22:41:34 -0500 Message-ID: <20220927034138.20463-2-ian.lin@infineon.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20220927034138.20463-1-ian.lin@infineon.com> References: <20220927034138.20463-1-ian.lin@infineon.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Brian Henriquez When deleting a P2P AGO interface we should make sure that relevant entry in bss_idx[] array is removed. We were always removing only 'vif' at P2PAPI_BSSCFG_CONNECTION before, regardless of the number of created P2P AGO interfaces. brcmfmac: correctly remove all p2p vif Signed-off-by: Brian Henriquez Signed-off-by: Chi-hsien Lin Signed-off-by: Ian Lin --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c index 479041f070f9..b3d706a2e68c 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c @@ -2424,8 +2424,12 @@ int brcmf_p2p_del_vif(struct wiphy *wiphy, struct wireless_dev *wdev) brcmf_remove_interface(vif->ifp, true); brcmf_cfg80211_arm_vif_event(cfg, NULL); - if (iftype != NL80211_IFTYPE_P2P_DEVICE) - p2p->bss_idx[P2PAPI_BSSCFG_CONNECTION].vif = NULL; + if (iftype != NL80211_IFTYPE_P2P_DEVICE) { + if (vif == p2p->bss_idx[P2PAPI_BSSCFG_CONNECTION].vif) + p2p->bss_idx[P2PAPI_BSSCFG_CONNECTION].vif = NULL; + if (vif == p2p->bss_idx[P2PAPI_BSSCFG_CONNECTION2].vif) + p2p->bss_idx[P2PAPI_BSSCFG_CONNECTION2].vif = NULL; + } return err; } From patchwork Tue Sep 27 03:41:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Lin X-Patchwork-Id: 12989845 X-Patchwork-Delegate: kvalo@adurom.com 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 BA433C54EE9 for ; Tue, 27 Sep 2022 03:41:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230201AbiI0Dlz (ORCPT ); Mon, 26 Sep 2022 23:41:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230152AbiI0Dlw (ORCPT ); Mon, 26 Sep 2022 23:41:52 -0400 Received: from smtp15.infineon.com (smtp15.infineon.com [217.10.52.161]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED88BAD991 for ; Mon, 26 Sep 2022 20:41:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=infineon.com; i=@infineon.com; q=dns/txt; s=IFXMAIL; t=1664250111; x=1695786111; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ICTkR5aVbeNuh2Ko3/fd6CdT+hzIUKkNvNKqYDcOn60=; b=FkWXb0Jv4tt140OxOimsmb8mvwRSoi3MFwsJzfCyR0cqmKFdrw7uY4ZV Hbh94X+SB4hdzL9vKmaKKQ5VjMiit1FCnIup27fKyn3xIbiJTyS/B/+m/ kzA39QzC1lx3kHnaHrvJXvmIYofO78uNfC6PO5WgbBEgoVe5EoISmSBFx 4=; X-SBRS: None X-IronPort-AV: E=McAfee;i="6500,9779,10482"; a="142910462" X-IronPort-AV: E=Sophos;i="5.93,348,1654552800"; d="scan'208";a="142910462" Received: from unknown (HELO mucxv001.muc.infineon.com) ([172.23.11.16]) by smtp14.infineon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Sep 2022 05:41:49 +0200 Received: from MUCSE822.infineon.com (MUCSE822.infineon.com [172.23.29.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mucxv001.muc.infineon.com (Postfix) with ESMTPS for ; Tue, 27 Sep 2022 05:41:48 +0200 (CEST) Received: from MUCSE824.infineon.com (172.23.29.55) by MUCSE822.infineon.com (172.23.29.53) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Tue, 27 Sep 2022 05:41:48 +0200 Received: from mailrelay-cypress3.infineon.com (172.23.18.46) by SMTP-MailRelay3.infineon.com (172.23.29.16) with Microsoft SMTP Server id 15.2.986.29; Tue, 27 Sep 2022 05:41:48 +0200 mailrelay-external-outbound: True X-IronPort-AV: E=McAfee;i="6500,9779,10482"; a="263480686" X-IronPort-AV: E=Sophos;i="5.93,348,1654552800"; d="scan'208";a="263480686" Received: from unknown (HELO mail.spansion.com) ([10.248.30.8]) by mailrelay-cypress3.infineon.com with ESMTP; 27 Sep 2022 05:41:47 +0200 Received: from inf2.aus.cypress.com (10.248.80.6) by BIZ-EXHT102.spansion.com (10.248.30.8) with Microsoft SMTP Server id 14.3.498.0; Mon, 26 Sep 2022 22:41:46 -0500 Received: from iot-wlan-dev-u03.aus.cypress.com (iot-wlan-dev-u03 [10.248.81.193]) by inf2.aus.cypress.com (Postfix) with ESMTP id 9B7EA1004E0; Mon, 26 Sep 2022 22:41:46 -0500 (CDT) Received: by iot-wlan-dev-u03.aus.cypress.com (Postfix, from userid 27991) id 973E89807FB; Mon, 26 Sep 2022 22:41:46 -0500 (CDT) From: Ian Lin To: CC: , , , , , , Subject: [PATCH v3 2/5] brcmfmac: Fix for when connect request is not success Date: Mon, 26 Sep 2022 22:41:35 -0500 Message-ID: <20220927034138.20463-3-ian.lin@infineon.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20220927034138.20463-1-ian.lin@infineon.com> References: <20220927034138.20463-1-ian.lin@infineon.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Wataru Gohda Currently brcmfmac is expecting to be set for both BRCMF_VIF_STATUS_EAP_SUCCESS and BRCMF_VIF_STATUS_EAP status bit based on dongle event and those bits are cleared to complete connect request successfully. But when connect request is finished unsuccessfully, either BRCMF_VIF_STATUS_EAP_SUCCESS / BRCMF_VIF_STATUS_EAP bits are not cleared depending on how the connect fail event happens. These status bits are carried over to following new connect request and this will lead to generate below kernel warning for some case. Worst case status mismatch happens between dongle and wpa_supplicant. WARNING: ../net/wireless/sme.c:756 __cfg80211_connect_result+0x42c/0x4a0 [cfg80211] The fix is to clear the BRCMF_VIF_STATUS_EAP_SUCCESS / BRCMF_VIF_STATUS_EAP bits during the link down process and add to call link down process when link down event received during BRCMF_VIF_STATUS_CONNECTING as well as BRCMF_VIF_STATUS_CONNECTED state. Signed-off-by: Wataru Gohda Signed-off-by: Chi-hsien Lin Signed-off-by: Ian Lin --- .../broadcom/brcm80211/brcmfmac/cfg80211.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c index 42068145a447..182b61aa346e 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c @@ -1417,6 +1417,8 @@ static void brcmf_link_down(struct brcmf_cfg80211_vif *vif, u16 reason, locally_generated, GFP_KERNEL); } clear_bit(BRCMF_VIF_STATUS_CONNECTING, &vif->sme_state); + clear_bit(BRCMF_VIF_STATUS_EAP_SUCCESS, &vif->sme_state); + clear_bit(BRCMF_VIF_STATUS_ASSOC_SUCCESS, &vif->sme_state); clear_bit(BRCMF_SCAN_STATUS_SUPPRESS, &cfg->scan_status); brcmf_btcoex_set_mode(vif, BRCMF_BTCOEX_ENABLED, 0); if (vif->profile.use_fwsup != BRCMF_PROFILE_FWSUP_NONE) { @@ -2269,6 +2271,8 @@ brcmf_cfg80211_disconnect(struct wiphy *wiphy, struct net_device *ndev, clear_bit(BRCMF_VIF_STATUS_CONNECTED, &ifp->vif->sme_state); clear_bit(BRCMF_VIF_STATUS_CONNECTING, &ifp->vif->sme_state); + clear_bit(BRCMF_VIF_STATUS_EAP_SUCCESS, &ifp->vif->sme_state); + clear_bit(BRCMF_VIF_STATUS_ASSOC_SUCCESS, &ifp->vif->sme_state); cfg80211_disconnected(ndev, reason_code, NULL, 0, true, GFP_KERNEL); memcpy(&scbval.ea, &profile->bssid, ETH_ALEN); @@ -6057,6 +6061,10 @@ brcmf_bss_connect_done(struct brcmf_cfg80211_info *cfg, &ifp->vif->sme_state); conn_params.status = WLAN_STATUS_SUCCESS; } else { + clear_bit(BRCMF_VIF_STATUS_EAP_SUCCESS, + &ifp->vif->sme_state); + clear_bit(BRCMF_VIF_STATUS_ASSOC_SUCCESS, + &ifp->vif->sme_state); conn_params.status = WLAN_STATUS_AUTH_TIMEOUT; } conn_params.links[0].bssid = profile->bssid; @@ -6154,9 +6162,13 @@ brcmf_notify_connect_status(struct brcmf_if *ifp, } else if (brcmf_is_linkdown(ifp->vif, e)) { brcmf_dbg(CONN, "Linkdown\n"); if (!brcmf_is_ibssmode(ifp->vif) && - test_bit(BRCMF_VIF_STATUS_CONNECTED, - &ifp->vif->sme_state)) { - if (memcmp(profile->bssid, e->addr, ETH_ALEN)) + (test_bit(BRCMF_VIF_STATUS_CONNECTED, + &ifp->vif->sme_state) || + test_bit(BRCMF_VIF_STATUS_CONNECTING, + &ifp->vif->sme_state))) { + if (test_bit(BRCMF_VIF_STATUS_CONNECTED, + &ifp->vif->sme_state) && + memcmp(profile->bssid, e->addr, ETH_ALEN)) return err; brcmf_bss_connect_done(cfg, ndev, e, false); From patchwork Tue Sep 27 03:41:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Lin X-Patchwork-Id: 12989847 X-Patchwork-Delegate: kvalo@adurom.com 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 67AB0C07E9D for ; Tue, 27 Sep 2022 03:42:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230186AbiI0Dl6 (ORCPT ); Mon, 26 Sep 2022 23:41:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230148AbiI0Dl4 (ORCPT ); Mon, 26 Sep 2022 23:41:56 -0400 Received: from smtp3.infineon.com (smtp3.infineon.com [217.10.52.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44BA0AE202 for ; Mon, 26 Sep 2022 20:41:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=infineon.com; i=@infineon.com; q=dns/txt; s=IFXMAIL; t=1664250113; x=1695786113; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=jy+/KODxjhVI+UhWKDzhcPfPBaz/uj89gZ0uiEjsmVg=; b=iYoZojRXvfPgc9Zm4LVnMH0qHhNvW38q3w8xzaPgrt+k51OAJsaSdF0o NyDyxpspb3j3sPucFs4jnDee3qyr8kPuR0bDqo8v71H6M5Tl9uhXMRGEl BAhvKvCXC8ewoj6ghqjUDzfCKOo2KNv0Xp+HCKhf42ufRaoKKhy1aUwTT 8=; X-SBRS: None X-IronPort-AV: E=McAfee;i="6500,9779,10482"; a="2005934" X-IronPort-AV: E=Sophos;i="5.93,348,1654552800"; d="scan'208";a="2005934" Received: from unknown (HELO mucxv003.muc.infineon.com) ([172.23.11.20]) by smtp2.infineon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Sep 2022 05:41:51 +0200 Received: from MUCSE819.infineon.com (MUCSE819.infineon.com [172.23.29.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mucxv003.muc.infineon.com (Postfix) with ESMTPS for ; Tue, 27 Sep 2022 05:41:49 +0200 (CEST) Received: from MUCSE824.infineon.com (172.23.29.55) by MUCSE819.infineon.com (172.23.29.45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Tue, 27 Sep 2022 05:41:49 +0200 Received: from mailrelay-cypress3.infineon.com (172.23.18.46) by SMTP-MailRelay3.infineon.com (172.23.29.16) with Microsoft SMTP Server id 15.2.986.29; Tue, 27 Sep 2022 05:41:49 +0200 mailrelay-external-outbound: True X-IronPort-AV: E=McAfee;i="6500,9779,10482"; a="263480689" X-IronPort-AV: E=Sophos;i="5.93,348,1654552800"; d="scan'208";a="263480689" Received: from unknown (HELO mail.spansion.com) ([10.248.30.8]) by mailrelay-cypress3.infineon.com with ESMTP; 27 Sep 2022 05:41:48 +0200 Received: from inf2.aus.cypress.com (10.248.80.6) by BIZ-EXHT102.spansion.com (10.248.30.8) with Microsoft SMTP Server id 14.3.498.0; Mon, 26 Sep 2022 22:41:47 -0500 Received: from iot-wlan-dev-u03.aus.cypress.com (iot-wlan-dev-u03 [10.248.81.193]) by inf2.aus.cypress.com (Postfix) with ESMTP id AE93B10038C; Mon, 26 Sep 2022 22:41:47 -0500 (CDT) Received: by iot-wlan-dev-u03.aus.cypress.com (Postfix, from userid 27991) id A9A7D9807FB; Mon, 26 Sep 2022 22:41:47 -0500 (CDT) From: Ian Lin To: CC: , , , , , , Subject: [PATCH v3 3/5] brcmfmac: Avoiding Connection delay Date: Mon, 26 Sep 2022 22:41:36 -0500 Message-ID: <20220927034138.20463-4-ian.lin@infineon.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20220927034138.20463-1-ian.lin@infineon.com> References: <20220927034138.20463-1-ian.lin@infineon.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Prasanna Kerekoppa Channel info passed by supplicant is not given to firmware. This causes delay (about 3seconds) due to full scan. Supplicant already provides the channel info for the specific SSID. channel_hint carries this channel info for the connect call back. Patch has been verified on 43012 and 43455. Signed-off-by: Prasanna Kerekoppa Signed-off-by: Chung-Hsien Hsu Signed-off-by: Chi-hsien Lin Signed-off-by: Ian Lin --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c index 182b61aa346e..6c37da42e61b 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c @@ -2049,6 +2049,12 @@ brcmf_cfg80211_connect(struct wiphy *wiphy, struct net_device *ndev, return -EOPNOTSUPP; } + if (sme->channel_hint) + chan = sme->channel_hint; + + if (sme->bssid_hint) + sme->bssid = sme->bssid_hint; + if (ifp->vif == cfg->p2p.bss_idx[P2PAPI_BSSCFG_PRIMARY].vif) { /* A normal (non P2P) connection request setup. */ ie = NULL; From patchwork Tue Sep 27 03:41:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Lin X-Patchwork-Id: 12989846 X-Patchwork-Delegate: kvalo@adurom.com 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 4FFF1C54EE9 for ; Tue, 27 Sep 2022 03:42:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230152AbiI0Dl5 (ORCPT ); Mon, 26 Sep 2022 23:41:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230240AbiI0Dlz (ORCPT ); Mon, 26 Sep 2022 23:41:55 -0400 Received: from smtp15.infineon.com (smtp15.infineon.com [217.10.52.161]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44AEDAD9A5 for ; Mon, 26 Sep 2022 20:41:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=infineon.com; i=@infineon.com; q=dns/txt; s=IFXMAIL; t=1664250113; x=1695786113; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=VV0Rrh4cn4/2qBioJqMSXObJwlgp7EAifYshsGdRMZU=; b=PyqQDZ0o1qSFFFA41im89T6zbxKrNawMvIOQrGn/V6oqQOVY5I0ng+mm r0nd+rCxQN9sosz1Y1m8qInmirCUqSEYdCaq5LAwJNlK9cPtyBkTV5vuZ swe8TK8rhN4YQJcy9Ym8qkc9baI/S43jsHPFvNWuKSv96aLLGUKqRFEzd c=; X-SBRS: None X-IronPort-AV: E=McAfee;i="6500,9779,10482"; a="142910467" X-IronPort-AV: E=Sophos;i="5.93,348,1654552800"; d="scan'208";a="142910467" Received: from unknown (HELO mucxv001.muc.infineon.com) ([172.23.11.16]) by smtp14.infineon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Sep 2022 05:41:51 +0200 Received: from MUCSE814.infineon.com (MUCSE814.infineon.com [172.23.29.40]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mucxv001.muc.infineon.com (Postfix) with ESMTPS for ; Tue, 27 Sep 2022 05:41:50 +0200 (CEST) Received: from MUCSE824.infineon.com (172.23.29.55) by MUCSE814.infineon.com (172.23.29.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Tue, 27 Sep 2022 05:41:50 +0200 Received: from mailrelay-cypress3.infineon.com (172.23.18.46) by SMTP-MailRelay3.infineon.com (172.23.29.16) with Microsoft SMTP Server id 15.2.986.29; Tue, 27 Sep 2022 05:41:50 +0200 mailrelay-external-outbound: True X-IronPort-AV: E=McAfee;i="6500,9779,10482"; a="263480692" X-IronPort-AV: E=Sophos;i="5.93,348,1654552800"; d="scan'208";a="263480692" Received: from unknown (HELO mail.spansion.com) ([10.248.30.8]) by mailrelay-cypress3.infineon.com with ESMTP; 27 Sep 2022 05:41:49 +0200 Received: from inf2.aus.cypress.com (10.248.80.6) by BIZ-EXHT102.spansion.com (10.248.30.8) with Microsoft SMTP Server id 14.3.498.0; Mon, 26 Sep 2022 22:41:48 -0500 Received: from iot-wlan-dev-u03.aus.cypress.com (iot-wlan-dev-u03 [10.248.81.193]) by inf2.aus.cypress.com (Postfix) with ESMTP id EF8B21004DF; Mon, 26 Sep 2022 22:41:48 -0500 (CDT) Received: by iot-wlan-dev-u03.aus.cypress.com (Postfix, from userid 27991) id EB0E89807FB; Mon, 26 Sep 2022 22:41:48 -0500 (CDT) From: Ian Lin To: CC: , , , , , , Subject: [PATCH v3 4/5] brcmfmac: Update SSID of hidden AP while informing its bss to cfg80211 layer Date: Mon, 26 Sep 2022 22:41:37 -0500 Message-ID: <20220927034138.20463-5-ian.lin@infineon.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20220927034138.20463-1-ian.lin@infineon.com> References: <20220927034138.20463-1-ian.lin@infineon.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Syed Rafiuddeen cfg80211 layer on DUT STA is disconnecting ongoing connection attempt after receiving association response, because cfg80211 layer does not have valid AP bss information. On association response event, brcmfmac communicates the AP bss information to cfg80211 layer, but SSID seem to be empty in AP bss information, and cfg80211 layer prints kernel warning and then disconnects the ongoing connection attempt. SSID is empty in SSID IE, but 'bi->SSID' contains a valid SSID, so updating the SSID for hidden AP while informing its bss information to cfg80211 layer. Signed-off-by: Syed Rafiuddeen Signed-off-by: Chung-Hsien Hsu Signed-off-by: Chi-hsien Lin Signed-off-by: Ian Lin --- .../net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c index 6c37da42e61b..3560afe0ccfe 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c @@ -3003,6 +3003,7 @@ static s32 brcmf_inform_single_bss(struct brcmf_cfg80211_info *cfg, u8 *notify_ie; size_t notify_ielen; struct cfg80211_inform_bss bss_data = {}; + struct brcmf_tlv *ssid; if (le32_to_cpu(bi->length) > WL_BSS_INFO_MAX) { bphy_err(drvr, "Bss info is larger than buffer. Discarding\n"); @@ -3032,6 +3033,13 @@ static s32 brcmf_inform_single_bss(struct brcmf_cfg80211_info *cfg, notify_ielen = le32_to_cpu(bi->ie_length); bss_data.signal = (s16)le16_to_cpu(bi->RSSI) * 100; + ssid = (struct brcmf_tlv *) + brcmf_parse_tlvs(notify_ie, notify_ielen, WLAN_EID_SSID); + if (ssid && ssid->data[0] == '\0' && ssid->len == bi->SSID_len) { + /* Update SSID for hidden AP */ + memcpy(ssid->data, bi->SSID, bi->SSID_len); + } + brcmf_dbg(CONN, "bssid: %pM\n", bi->BSSID); brcmf_dbg(CONN, "Channel: %d(%d)\n", channel, freq); brcmf_dbg(CONN, "Capability: %X\n", notify_capability); From patchwork Tue Sep 27 03:41:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Lin X-Patchwork-Id: 12989848 X-Patchwork-Delegate: kvalo@adurom.com 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 43727C6FA82 for ; Tue, 27 Sep 2022 03:42:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230240AbiI0DmB (ORCPT ); Mon, 26 Sep 2022 23:42:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230257AbiI0Dl5 (ORCPT ); Mon, 26 Sep 2022 23:41:57 -0400 Received: from smtp12.infineon.com (smtp12.infineon.com [217.10.52.106]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1B08ACA0F for ; Mon, 26 Sep 2022 20:41:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=infineon.com; i=@infineon.com; q=dns/txt; s=IFXMAIL; t=1664250114; x=1695786114; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=oFM2uhYPRUF0wpUQfUjmHmeBa7D8iHYyJsyi+cvFRTg=; b=GBF1aaKgp4BE85gKgaOqMMxKyH/ORzjNjCiHGU3jY2qOv1LPzCx0Ljoc c5GumFiv9TBBtlskIuTcXG/O7+OG7TRcf9Rabth5DYRsK6qqCweo4D1VF 27oRTEsY6L2zAaAJMI6kp9DV3Y+/47C0WFOhZgb+7pft9g4Z6jPNzQqqI U=; X-SBRS: None X-IronPort-AV: E=McAfee;i="6500,9779,10482"; a="319072544" X-IronPort-AV: E=Sophos;i="5.93,348,1654552800"; d="scan'208";a="319072544" Received: from unknown (HELO mucxv002.muc.infineon.com) ([172.23.11.17]) by smtp11.infineon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Sep 2022 05:41:53 +0200 Received: from MUCSE812.infineon.com (MUCSE812.infineon.com [172.23.29.38]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mucxv002.muc.infineon.com (Postfix) with ESMTPS for ; Tue, 27 Sep 2022 05:41:52 +0200 (CEST) Received: from MUCSE804.infineon.com (172.23.29.30) by MUCSE812.infineon.com (172.23.29.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Tue, 27 Sep 2022 05:41:52 +0200 Received: from mailrelay-cypress4.infineon.com (172.23.18.56) by SMTP-MailRelay1.infineon.com (172.23.29.5) with Microsoft SMTP Server id 15.2.986.29; Tue, 27 Sep 2022 05:41:51 +0200 mailrelay-external-outbound: True X-IronPort-AV: E=McAfee;i="6500,9779,10482"; a="260700533" X-IronPort-AV: E=Sophos;i="5.93,348,1654552800"; d="scan'208";a="260700533" Received: from unknown (HELO mail.spansion.com) ([10.248.30.8]) by mailrelay-cypress4.infineon.com with ESMTP; 27 Sep 2022 05:41:51 +0200 Received: from inf2.aus.cypress.com (10.248.80.6) by BIZ-EXHT102.spansion.com (10.248.30.8) with Microsoft SMTP Server id 14.3.498.0; Mon, 26 Sep 2022 22:41:49 -0500 Received: from iot-wlan-dev-u03.aus.cypress.com (iot-wlan-dev-u03 [10.248.81.193]) by inf2.aus.cypress.com (Postfix) with ESMTP id 3EB1C1004E1; Mon, 26 Sep 2022 22:41:50 -0500 (CDT) Received: by iot-wlan-dev-u03.aus.cypress.com (Postfix, from userid 27991) id 39B719807FB; Mon, 26 Sep 2022 22:41:50 -0500 (CDT) From: Ian Lin To: CC: , , , , , , Subject: [PATCH v3 5/5] brcmfmac: fix P2P device discovery failure Date: Mon, 26 Sep 2022 22:41:38 -0500 Message-ID: <20220927034138.20463-6-ian.lin@infineon.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20220927034138.20463-1-ian.lin@infineon.com> References: <20220927034138.20463-1-ian.lin@infineon.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Chung-Hsien Hsu Commit 2de64ca7c9fa ("brcmfmac: p2p: Deal with set but unused variables") removed the setting of vif for p2p device discovery in brcmf_p2p_scan_prep(), causing the discovery failure. Add back the setting to brcmf_p2p_scan_prep() to fix this. Fixes: 2de64ca7c9fa ("brcmfmac: p2p: Deal with set but unused variables") Signed-off-by: Chung-Hsien Hsu Signed-off-by: Ian Lin --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c index b3d706a2e68c..068f8fe0e0c4 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c @@ -912,6 +912,8 @@ int brcmf_p2p_scan_prep(struct wiphy *wiphy, if (err) return err; + vif = p2p->bss_idx[P2PAPI_BSSCFG_DEVICE].vif; + /* override .run_escan() callback. */ cfg->escan_info.run = brcmf_p2p_run_escan; }