diff --git a/iot_sim/core/iot_sim_cmn_api_i.h b/iot_sim/core/iot_sim_cmn_api_i.h index 52545e9a3c..1d3b16a433 100644 --- a/iot_sim/core/iot_sim_cmn_api_i.h +++ b/iot_sim/core/iot_sim_cmn_api_i.h @@ -76,6 +76,7 @@ QDF_STATUS wlan_iot_sim_pdev_obj_destroy_handler(struct wlan_objmgr_pdev *pdev, * @frm: action frame * @cat: action frame category * @act: action frame details + * @rx: TRUE if its getting called in the rx path * * Provides the simulation database index for the action frame. * @@ -83,7 +84,7 @@ QDF_STATUS wlan_iot_sim_pdev_obj_destroy_handler(struct wlan_objmgr_pdev *pdev, * QDF_STATUS_E_FAILURE on failure */ QDF_STATUS iot_sim_get_index_for_action_frm(uint8_t *frm, uint8_t *cat, - uint8_t *act); + uint8_t *act, bool rx); /** * iot_sim_frame_update() - Management frame update diff --git a/iot_sim/core/iot_sim_common.c b/iot_sim/core/iot_sim_common.c index 102cde3792..f453c3c6ed 100644 --- a/iot_sim/core/iot_sim_common.c +++ b/iot_sim/core/iot_sim_common.c @@ -97,7 +97,7 @@ iot_sim_parse_action_frame(uint16_t length, uint16_t offset, uint8_t *content, /* Offset represet category type and action type */ status = iot_sim_get_index_for_action_frm(hex, category, - action); + action, false); if (status == QDF_STATUS_E_FAULT) { iot_sim_err("Get indices for action failed"); return status; @@ -113,7 +113,7 @@ iot_sim_parse_action_frame(uint16_t length, uint16_t offset, uint8_t *content, return QDF_STATUS_E_FAILURE; } status = iot_sim_get_index_for_action_frm(ptr, category, - action); + action, false); } return status; } @@ -370,12 +370,13 @@ err: * @frm: buf containing 802.11 action/category codes * @cat_type: buf to hold converted category code * @act_type: buf to hold converted action code + * @rx: TRUE if its getting called in the rx path * * Return: QDF_STATUS_SUCCESS on success, failure otherwise */ QDF_STATUS iot_sim_get_index_for_action_frm(uint8_t *frm, uint8_t *cat_type, - uint8_t *act_type) + uint8_t *act_type, bool rx) { uint8_t category, action; @@ -388,8 +389,14 @@ iot_sim_get_index_for_action_frm(uint8_t *frm, uint8_t *cat_type, case IEEE80211_ACTION_CAT_BA: switch (action) { case IEEE80211_ACTION_BA_ADDBA_REQUEST: - *cat_type = category; - *act_type = action; + if (rx) { + *cat_type = CAT_BA; + *act_type = action; + + } else { + *cat_type = category; + *act_type = action; + } break; case IEEE80211_ACTION_BA_ADDBA_RESPONSE: case IEEE80211_ACTION_BA_DELBA: @@ -1145,7 +1152,7 @@ iot_sim_debug_drop_write(struct file *file, * convert 802.11 category and action code to iot sim codes */ status = iot_sim_get_index_for_action_frm(tmp, &category, - &action); + &action, false); if (QDF_IS_STATUS_ERROR(status)) goto free; diff --git a/iot_sim/core/iot_sim_utils.c b/iot_sim/core/iot_sim_utils.c index 636fd1f84b..8c6e7951d1 100644 --- a/iot_sim/core/iot_sim_utils.c +++ b/iot_sim/core/iot_sim_utils.c @@ -281,7 +281,8 @@ QDF_STATUS iot_sim_frame_update(struct wlan_objmgr_pdev *pdev, qdf_nbuf_t nbuf, frm = buf + IEEE80211_FRAME_BODY_OFFSET; is_action_frm = true; - if (iot_sim_get_index_for_action_frm(frm, &cat, &cat_index)) { + if (iot_sim_get_index_for_action_frm(frm, &cat, + &cat_index, !tx)) { iot_sim_err("get_index_for_action_frm failed"); return QDF_STATUS_SUCCESS; }