wifi: brcmfmac: fix P2P action frame handling without device vif
PATCH 1/1 wifi: brcmfmac: fix P2P action frame handling without device vif
From: Jason Huang <[email protected]>
Some P2P action frame paths assume the P2P device vif is always available. That is not true when userspace sends non-P2P public action frames through the primary interface, or when action-frame abort runs after the P2P device vif has not been created.
Fall back to the primary vif when aborting an action frame without a P2P device vif, and guard P2P device saved IE access before using it for peer channel search.
--- drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c +4 -0
@@ -1283,6 +1283,9 @@ static s32 brcmf_p2p_abort_action_frame(struct brcmf_cfg80211_info *cfg)brcmf_dbg (TRACE ,"Enter\n" ); vif = p2p->bss_idx[P2PAPI_BSSCFG_DEVICE ].vif; +if (!vif) + vif = p2p->bss_idx[P2PAPI_BSSCFG_PRIMARY ].vif; + err =brcmf_fil_bsscfg_data_set (vif->ifp,"actframe_abort" , &int_val,sizeof (s32));if (err)
@@ -1819,6 +1822,7 @@ bool brcmf_p2p_send_action_frame(struct brcmf_if *ifp,/* validate channel and p2p ies */ if (config_af_params.search_channel &&IS_P2P_SOCIAL_CHANNEL (le32_to_cpu (af_params->channel)) && + p2p->bss_idx[P2PAPI_BSSCFG_DEVICE ].vif && p2p->bss_idx[P2PAPI_BSSCFG_DEVICE ].vif->saved_ie.probe_req_ie_len) { afx_hdl = &p2p->afx_hdl; afx_hdl->peer_listen_chan =le32_to_cpu (af_params->channel);
Signature · 1 line
2.25.1
Quoted 5 lines · Jason Huang
Fixes 30fb1b272909 ("brcmfmac: use actframe_abort to cancel ongoing action frame")Fixes 6eda4e2c5425 ("brcmfmac: Add tx p2p off-channel support.")Signed-off-by Jason Huang <[email protected]>
I feel like I might have fixed that for you last time, but there shouldn't be a blank line here, please change it in the future.
johannes
Quoted 9 lines · Jason Huang
Some P2P action frame paths assume the P2P device vif is always available. That is not true when userspace sends non-P2P public action frames through the primary interface, or when action-frame abort runs after the P2P device vif has not been created.
Fall back to the primary vif when aborting an action frame without a P2P device vif, and guard P2P device saved IE access before using it for peer channel search.
Quoted 7 lines
Fixes 30fb1b272909 ("brcmfmac: use actframe_abort to cancel ongoing action frame")Fixes 6eda4e2c5425 ("brcmfmac: Add tx p2p off-channel support.")Signed-off-by Jason Huang <[email protected]>--- drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c | 4 ++++ 1 file changed, 4 insertions(+)
Provided Johannes is willing to fix the blank line once again. Fingers crossed ;-)
Regards,
Arend