Re: [PATCH wireless-next RESEND] wifi: brcmfmac: fix P2P discovery failure in P2P peer due to missing P2P IE

Arend Van Spriel <[email protected]> Sat, 19 Jul 2025 15:10:09 +0200
Newsgroups dev.linux.lists.brcm80211,org.kernel.vger.linux-wireless
Message-ID <[email protected]>
On June 26, 2025 7:07:23 AM Gokul Sivakumar 
<[email protected]> wrote:

> After commit bd99a3013bdc ("brcmfmac: move configuration of probe request
> IEs"), the probe request MGMT IE addition operation brcmf_vif_set_mgmt_ie()
> got moved from the brcmf_p2p_scan_prep() to the brcmf_cfg80211_scan().
>
> Because of this, as part of the scan request handler for the P2P Discovery,
> vif struct used for adding the Probe Request P2P IE in firmware got changed
> from the P2PAPI_BSSCFG_DEVICE vif to P2PAPI_BSSCFG_PRIMARY vif incorrectly.
> So the firmware stopped adding P2P IE to the outgoing P2P Discovery probe
> requests frames and the other P2P peers were unable to discover this device
> causing a regression on the P2P feature.
>
> To fix this, while setting the P2P IE in firmware, properly use the vif of
> the P2P discovery wdev on which the driver received the P2P scan request.
> This is done by not changing the vif pointer, until brcmf_vif_set_mgmt_ie()
> is completed.
>
> Fixes: bd99a3013bdc ("brcmfmac: move configuration of probe request IEs")

Acked-by: Arend van Spriel <[email protected]>
> Signed-off-by: Gokul Sivakumar <[email protected]>
> ---
> .../net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c   | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c 
> b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
> index 4b70845e1a26..075b99478e65 100644
> --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
> +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
> @@ -1545,10 +1545,6 @@ brcmf_cfg80211_scan(struct wiphy *wiphy, struct 
> cfg80211_scan_request *request)
>  return -EAGAIN;
>  }
>
> - /* If scan req comes for p2p0, send it over primary I/F */
> - if (vif == cfg->p2p.bss_idx[P2PAPI_BSSCFG_DEVICE].vif)
> - vif = cfg->p2p.bss_idx[P2PAPI_BSSCFG_PRIMARY].vif;
> -
>  brcmf_dbg(SCAN, "START ESCAN\n");
>
>  cfg->scan_request = request;
> @@ -1564,6 +1560,10 @@ brcmf_cfg80211_scan(struct wiphy *wiphy, struct 
> cfg80211_scan_request *request)
>  if (err)
>  goto scan_out;
>
> + /* If scan req comes for p2p0, send it over primary I/F */
> + if (vif == cfg->p2p.bss_idx[P2PAPI_BSSCFG_DEVICE].vif)
> + vif = cfg->p2p.bss_idx[P2PAPI_BSSCFG_PRIMARY].vif;
> +
>  err = brcmf_do_escan(vif->ifp, request);
>  if (err)
>  goto scan_out;
> --
> 2.43.0