* [PATCH v2] wifi: brcmfmac: cyw: set a unique cookie for mgmt tx
@ 2026-07-25 1:44 Bogdan Nicolae
2026-07-26 19:20 ` Arend van Spriel
2026-08-02 8:39 ` Arend van Spriel
0 siblings, 2 replies; 4+ messages in thread
From: Bogdan Nicolae @ 2026-07-25 1:44 UTC (permalink / raw)
To: Arend van Spriel
Cc: linux-wireless, brcm80211, brcm80211-dev-list.pdl, linux-kernel,
Bogdan Nicolae
Set cookie using an increasing atomic counter. Avoids mismatches of completion
events later in brcmf_notify_mgmt_tx_status, where packet_id != vif->mgmt_tx_id
is checked.
Signed-off-by: Bogdan Nicolae <bogdan.nicolae@gmail.com>
---
v2: split into separate patch and set cookie to atomic counter instead
of packet_id directly.
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cyw/core.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cyw/core.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cyw/core.c
index 2c59b5e57..ab4ff0cd6 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cyw/core.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cyw/core.c
@@ -23,6 +23,8 @@
#define MGMT_AUTH_FRAME_DWELL_TIME 4000
#define MGMT_AUTH_FRAME_WAIT_TIME (MGMT_AUTH_FRAME_DWELL_TIME + 100)
+static atomic_t brcmf_cyw_mgmt_tx_id = ATOMIC_INIT(0);
+
static int brcmf_cyw_set_sae_pwd(struct brcmf_if *ifp,
struct cfg80211_crypto_settings *crypto)
{
@@ -123,7 +125,7 @@ int brcmf_cyw_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
if (!ieee80211_is_auth(mgmt->frame_control))
return brcmf_cfg80211_mgmt_tx(wiphy, wdev, params, cookie);
- *cookie = 0;
+ *cookie = atomic_inc_return(&brcmf_cyw_mgmt_tx_id);
vif = container_of(wdev, struct brcmf_cfg80211_vif, wdev);
reinit_completion(&vif->mgmt_tx);
--
2.55.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] wifi: brcmfmac: cyw: set a unique cookie for mgmt tx
2026-07-25 1:44 [PATCH v2] wifi: brcmfmac: cyw: set a unique cookie for mgmt tx Bogdan Nicolae
@ 2026-07-26 19:20 ` Arend van Spriel
2026-07-26 19:21 ` Bogdan Nicolae
2026-08-02 8:39 ` Arend van Spriel
1 sibling, 1 reply; 4+ messages in thread
From: Arend van Spriel @ 2026-07-26 19:20 UTC (permalink / raw)
To: Bogdan Nicolae
Cc: linux-wireless, brcm80211, brcm80211-dev-list.pdl, linux-kernel
On 25/07/2026 03:44, Bogdan Nicolae wrote:
> Set cookie using an increasing atomic counter. Avoids mismatches of completion
> events later in brcmf_notify_mgmt_tx_status, where packet_id != vif->mgmt_tx_id
> is checked.
Thanks for the split. I increased the scope and been looking in the
cookie usage in the wireless subsystem. So I have a series lined up to
change the cookie to an input parameter and have cfg80211 hand out the
cookie value (it already has cfg80211_assign_cookie() function). This
will also cover zero cookie fix here. So I would suggest to drop this
patch and only let the PMKID patch go in.
Regards,
Arend
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] wifi: brcmfmac: cyw: set a unique cookie for mgmt tx
2026-07-26 19:20 ` Arend van Spriel
@ 2026-07-26 19:21 ` Bogdan Nicolae
0 siblings, 0 replies; 4+ messages in thread
From: Bogdan Nicolae @ 2026-07-26 19:21 UTC (permalink / raw)
To: Arend van Spriel
Cc: linux-wireless, brcm80211, brcm80211-dev-list.pdl, linux-kernel
Sure, it sounds good. Thanks Arend.
Bogdan
On Sun, Jul 26, 2026 at 2:21 PM Arend van Spriel
<arend.vanspriel@broadcom.com> wrote:
>
> On 25/07/2026 03:44, Bogdan Nicolae wrote:
> > Set cookie using an increasing atomic counter. Avoids mismatches of completion
> > events later in brcmf_notify_mgmt_tx_status, where packet_id != vif->mgmt_tx_id
> > is checked.
>
> Thanks for the split. I increased the scope and been looking in the
> cookie usage in the wireless subsystem. So I have a series lined up to
> change the cookie to an input parameter and have cfg80211 hand out the
> cookie value (it already has cfg80211_assign_cookie() function). This
> will also cover zero cookie fix here. So I would suggest to drop this
> patch and only let the PMKID patch go in.
>
> Regards,
> Arend
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] wifi: brcmfmac: cyw: set a unique cookie for mgmt tx
2026-07-25 1:44 [PATCH v2] wifi: brcmfmac: cyw: set a unique cookie for mgmt tx Bogdan Nicolae
2026-07-26 19:20 ` Arend van Spriel
@ 2026-08-02 8:39 ` Arend van Spriel
1 sibling, 0 replies; 4+ messages in thread
From: Arend van Spriel @ 2026-08-02 8:39 UTC (permalink / raw)
To: Bogdan Nicolae
Cc: linux-wireless, brcm80211, brcm80211-dev-list.pdl, linux-kernel
On Fri, 24 Jul 2026 20:44:11 -0500, Bogdan Nicolae wrote:
> Set cookie using an increasing atomic counter. Avoids mismatches of completion
> events later in brcmf_notify_mgmt_tx_status, where packet_id != vif->mgmt_tx_id
> is checked.
>
> Signed-off-by: Bogdan Nicolae <bogdan.nicolae@gmail.com>
> ---
> drivers/net/wireless/broadcom/brcm80211/brcmfmac/cyw/core.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
As agreed I will mark this as superseded.
Regards,
Arend
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-08-02 8:39 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-25 1:44 [PATCH v2] wifi: brcmfmac: cyw: set a unique cookie for mgmt tx Bogdan Nicolae
2026-07-26 19:20 ` Arend van Spriel
2026-07-26 19:21 ` Bogdan Nicolae
2026-08-02 8:39 ` Arend van Spriel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®