Skip to content

Commit 5fffeab

Browse files
kapbhkrish2718
authored andcommitted
fw_if: src: Free up TX buffers for raw tx
The freeing up of TX buffer is moved from TX done to tx cmd init. It was missing in raw tx cmd init. This was resulting in out of order sequence numbers behaviour which was being observed with packet capture. Signed-off-by: Kapil Bhatt <[email protected]>
1 parent 5c97489 commit 5fffeab

File tree

1 file changed

+12
-3
lines changed
  • fw_if/umac_if/src/system

1 file changed

+12
-3
lines changed

fw_if/umac_if/src/system/tx.c

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -978,6 +978,7 @@ enum nrf_wifi_status rawtx_cmd_init(struct nrf_wifi_fmac_dev_ctx *fmac_dev_ctx,
978978
struct host_rpu_msg *umac_cmd = NULL;
979979
unsigned int len = 0;
980980
struct nrf_wifi_sys_fmac_dev_ctx *sys_dev_ctx = NULL;
981+
void *nwb = NULL;
981982

982983
sys_dev_ctx = wifi_dev_priv(fmac_dev_ctx);
983984

@@ -1003,6 +1004,16 @@ enum nrf_wifi_status rawtx_cmd_init(struct nrf_wifi_fmac_dev_ctx *fmac_dev_ctx,
10031004
status = nrf_wifi_hal_ctrl_cmd_send(fmac_dev_ctx->hal_dev_ctx,
10041005
umac_cmd,
10051006
(sizeof(*umac_cmd) + len));
1007+
1008+
while (nrf_wifi_utils_q_len(txq)) {
1009+
nwb = nrf_wifi_utils_q_dequeue(txq);
1010+
1011+
if (!nwb) {
1012+
continue;
1013+
}
1014+
1015+
nrf_wifi_osal_nbuf_free(nwb);
1016+
}
10061017
out:
10071018
return status;
10081019
}
@@ -1381,7 +1392,6 @@ static enum nrf_wifi_status tx_done_process(struct nrf_wifi_fmac_dev_ctx *fmac_d
13811392

13821393
if (pkts_pending) {
13831394
#ifdef NRF70_RAW_DATA_TX
1384-
unsigned char *data = NULL;
13851395
struct nrf_wifi_fmac_vif_ctx *vif_ctx;
13861396
unsigned char if_idx;
13871397
void *nwb = NULL;
@@ -1394,9 +1404,8 @@ static enum nrf_wifi_status tx_done_process(struct nrf_wifi_fmac_dev_ctx *fmac_d
13941404
* packet is a raw packet or not
13951405
*/
13961406
nwb = nrf_wifi_utils_list_peek(txq);
1397-
data = nrf_wifi_osal_nbuf_data_get(nwb);
13981407

1399-
if (*(unsigned int *)data != NRF_WIFI_MAGIC_NUM_RAWTX) {
1408+
if (!nrf_wifi_osal_nbuf_is_raw_tx(nwb)) {
14001409
#endif /* NRF70_RAW_DATA_TX */
14011410
if (sys_dev_ctx->twt_sleep_status ==
14021411
NRF_WIFI_FMAC_TWT_STATE_AWAKE) {

0 commit comments

Comments
 (0)