diff --git a/core/mac/inc/ani_global.h b/core/mac/inc/ani_global.h index 02b0fdad56ae..15b7d129adda 100644 --- a/core/mac/inc/ani_global.h +++ b/core/mac/inc/ani_global.h @@ -896,6 +896,7 @@ typedef struct sAniSirGlobal { uint8_t hw_dbs_capable; uint32_t sta_sap_scc_on_dfs_chan; sir_mgmt_frame_ind_callback mgmt_frame_ind_cb; + qdf_atomic_t global_cmd_id; struct wlan_objmgr_psoc *psoc; struct wlan_objmgr_pdev *pdev; void (*chan_info_cb)(struct scan_chan_info *chan_info); diff --git a/core/sme/inc/sme_inside.h b/core/sme/inc/sme_inside.h index 6eee65ecdc45..8107c90deab4 100644 --- a/core/sme/inc/sme_inside.h +++ b/core/sme/inc/sme_inside.h @@ -149,6 +149,7 @@ struct s_nss_update_cmd { typedef struct tagSmeCmd { tListElem Link; eSmeCommandType command; + uint32_t cmd_id; uint32_t sessionId; union { struct roam_cmd roamCmd; diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index a7a6cb775cc3..98d333048c92 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -20055,8 +20055,8 @@ void csr_release_command(tpAniSirGlobal mac_ctx, tSmeCmd *sme_cmd) qdf_mem_zero(&cmd_info, sizeof(struct wlan_serialization_queued_cmd_info)); - sme_debug("filled cmd_id = 0"); - cmd_info.cmd_id = 0; + sme_debug("filled cmd_id = %d", sme_cmd->cmd_id); + cmd_info.cmd_id = sme_cmd->cmd_id; cmd_info.req_type = WLAN_SER_CANCEL_NON_SCAN_CMD; cmd_info.cmd_type = csr_get_cmd_type(sme_cmd); cmd_info.vdev = vdev; @@ -20215,6 +20215,18 @@ enum wlan_serialization_cmd_type csr_get_cmd_type(tSmeCmd *sme_cmd) return cmd_type; } +static uint32_t csr_get_monotonous_number(tpAniSirGlobal mac_ctx) +{ + uint32_t cmd_id; + uint32_t mask = 0x00FFFFFF, prefix = 0x0D000000; + + cmd_id = qdf_atomic_inc_return(&mac_ctx->global_cmd_id); + cmd_id = (cmd_id & mask); + cmd_id = (cmd_id | prefix); + + return cmd_id; +} + QDF_STATUS csr_set_serialization_params_to_cmd(tpAniSirGlobal mac_ctx, tSmeCmd *sme_cmd, struct wlan_serialization_command *cmd, uint8_t high_priority) @@ -20234,8 +20246,9 @@ QDF_STATUS csr_set_serialization_params_to_cmd(tpAniSirGlobal mac_ctx, * no need to fill command id for non-scan as they will be * zero always */ - sme_debug("cmd_id = 0"); - cmd->cmd_id = 0; + sme_cmd->cmd_id = csr_get_monotonous_number(mac_ctx); + cmd->cmd_id = sme_cmd->cmd_id; + sme_debug("cmd_id = %d", cmd->cmd_id); cmd->cmd_type = csr_get_cmd_type(sme_cmd); sme_debug("filled cmd_type[%d] cmd_id[%d]", diff --git a/core/sme/src/csr/csr_util.c b/core/sme/src/csr/csr_util.c index e4d246d86cae..44857c2526e7 100644 --- a/core/sme/src/csr/csr_util.c +++ b/core/sme/src/csr/csr_util.c @@ -575,7 +575,7 @@ tListElem *csr_nonscan_pending_ll_next(struct sAniSirGlobal *mac_ctx, if (!entry) return NULL; sme_cmd = GET_BASE_ADDR(entry, tSmeCmd, Link); - cmd.cmd_id = 0; + cmd.cmd_id = sme_cmd->cmd_id; cmd.cmd_type = csr_get_cmd_type(sme_cmd); cmd.vdev = wlan_objmgr_get_vdev_by_id_from_psoc(mac_ctx->psoc, sme_cmd->sessionId, WLAN_LEGACY_SME_ID);