Skip to content

Commit b09fc05

Browse files
rado17krish2718
authored andcommitted
[nrf fromlist] drivers: wifi: nrf_wifi: Add cookie handling support
Add cookie event callbacks to track RoC and cancel-RoC requests and its responses from firmware. Upstream PR #: 97183 Signed-off-by: Ravi Dondaputi <[email protected]>
1 parent c942476 commit b09fc05

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

drivers/wifi/nrf_wifi/inc/wpa_supp_if.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,9 @@ void nrf_wifi_supp_event_roc_cancel_complete(void *os_vif_ctx,
131131
unsigned int event_len);
132132
int nrf_wifi_supp_set_country(void *if_priv, const char *alpha2);
133133
int nrf_wifi_supp_get_country(void *if_priv, char *alpha2);
134-
int nrf_wifi_supp_remain_on_channel(void *if_priv, unsigned int freq, unsigned int duration);
135-
int nrf_wifi_supp_cancel_remain_on_channel(void *if_priv);
134+
int nrf_wifi_supp_remain_on_channel(void *if_priv, unsigned int freq,
135+
unsigned int duration, u64 host_cookie);
136+
int nrf_wifi_supp_cancel_remain_on_channel(void *if_priv, u64 rpu_cookie);
136137
int nrf_wifi_supp_set_p2p_powersave(void *if_priv, int legacy_ps, int opp_ps, int ctwindow);
137138

138139
#endif /* CONFIG_NRF70_STA_MODE */

drivers/wifi/nrf_wifi/src/fmac_main.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,11 @@ void nrf_wifi_event_proc_cookie_rsp(void *vif_ctx,
452452
/* TODO: When supp_callbk_fns.mgmt_tx_status is implemented, add logic
453453
* here to use the cookie and host_cookie to map requests to responses.
454454
*/
455+
if (vif_ctx_zep->supp_drv_if_ctx &&
456+
vif_ctx_zep->supp_callbk_fns.cookie_event) {
457+
vif_ctx_zep->supp_callbk_fns.cookie_event(vif_ctx_zep->supp_drv_if_ctx,
458+
cookie_rsp_event->host_cookie, cookie_rsp_event->cookie);
459+
}
455460
}
456461
#endif /* CONFIG_NRF70_STA_MODE */
457462

drivers/wifi/nrf_wifi/src/wpa_supp_if.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2035,7 +2035,7 @@ void nrf_wifi_supp_event_remain_on_channel(void *if_priv,
20352035
if (vif_ctx_zep->supp_drv_if_ctx && vif_ctx_zep->supp_callbk_fns.roc_complete) {
20362036
vif_ctx_zep->supp_callbk_fns.roc_complete(vif_ctx_zep->supp_drv_if_ctx,
20372037
roc_complete->frequency,
2038-
roc_complete->dur);
2038+
roc_complete->dur, roc_complete->cookie);
20392039
}
20402040
}
20412041

@@ -2064,12 +2064,12 @@ void nrf_wifi_supp_event_roc_cancel_complete(void *if_priv,
20642064

20652065
if (vif_ctx_zep->supp_drv_if_ctx && vif_ctx_zep->supp_callbk_fns.roc_cancel_complete) {
20662066
vif_ctx_zep->supp_callbk_fns.roc_cancel_complete(vif_ctx_zep->supp_drv_if_ctx,
2067-
roc_cancel_complete->frequency);
2067+
roc_cancel_complete->frequency, roc_cancel_complete->cookie);
20682068
}
20692069
}
20702070

20712071
int nrf_wifi_supp_remain_on_channel(void *if_priv, unsigned int freq,
2072-
unsigned int duration)
2072+
unsigned int duration, u64 host_cookie)
20732073
{
20742074
enum nrf_wifi_status status = NRF_WIFI_STATUS_FAIL;
20752075
#ifdef NRF70_P2P_MODE
@@ -2102,6 +2102,7 @@ int nrf_wifi_supp_remain_on_channel(void *if_priv, unsigned int freq,
21022102
roc_info.nrf_wifi_freq_params.center_frequency2 = 0;
21032103
roc_info.nrf_wifi_freq_params.channel_type = NRF_WIFI_CHAN_HT20;
21042104
roc_info.dur = duration;
2105+
roc_info.host_cookie = host_cookie;
21052106

21062107
status = nrf_wifi_sys_fmac_p2p_roc_start(rpu_ctx_zep->rpu_ctx, vif_ctx_zep->vif_idx,
21072108
&roc_info);
@@ -2115,7 +2116,7 @@ int nrf_wifi_supp_remain_on_channel(void *if_priv, unsigned int freq,
21152116
return status;
21162117
}
21172118

2118-
int nrf_wifi_supp_cancel_remain_on_channel(void *if_priv)
2119+
int nrf_wifi_supp_cancel_remain_on_channel(void *if_priv, u64 cookie)
21192120
{
21202121
enum nrf_wifi_status status = NRF_WIFI_STATUS_FAIL;
21212122
#ifdef NRF70_P2P_MODE
@@ -2140,7 +2141,7 @@ int nrf_wifi_supp_cancel_remain_on_channel(void *if_priv)
21402141
goto out;
21412142
}
21422143

2143-
status = nrf_wifi_sys_fmac_p2p_roc_stop(rpu_ctx_zep->rpu_ctx, vif_ctx_zep->vif_idx, 0);
2144+
status = nrf_wifi_sys_fmac_p2p_roc_stop(rpu_ctx_zep->rpu_ctx, vif_ctx_zep->vif_idx, cookie);
21442145
if (status != NRF_WIFI_STATUS_SUCCESS) {
21452146
LOG_ERR("%s: nrf_wifi_fmac_cancel_remain_on_channel failed", __func__);
21462147
goto out;

0 commit comments

Comments
 (0)