diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 69b8109f66..d8862ca1c2 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -12334,6 +12334,7 @@ __wlan_hdd_cfg80211_set_wifi_test_config(struct wiphy *wiphy, struct set_wfatest_params wfa_param = {0}; struct hdd_station_ctx *hdd_sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter->deflink); + uint8_t op_mode; hdd_enter_dev(dev); @@ -12425,13 +12426,14 @@ __wlan_hdd_cfg80211_set_wifi_test_config(struct wiphy *wiphy, hdd_debug("BA operating mode is set to Manual"); } - ret_val = wma_cli_set_command(adapter->deflink->vdev_id, - wmi_vdev_param_set_ba_mode, - set_val, VDEV_CMD); - if (ret_val) { - hdd_err("Set BA operating mode failed"); - goto send_err; - } + op_mode = wlan_get_opmode_from_vdev_id( + hdd_ctx->pdev, + adapter->deflink->vdev_id); + if (op_mode == QDF_STA_MODE) + sme_set_ba_opmode(mac_handle, + adapter->deflink->vdev_id, + set_val); + if (!cfg_val) { ret_val = wma_cli_set_command( adapter->deflink->vdev_id, diff --git a/core/mac/inc/ani_global.h b/core/mac/inc/ani_global.h index 6b20fad0fb..602d328c81 100644 --- a/core/mac/inc/ani_global.h +++ b/core/mac/inc/ani_global.h @@ -777,6 +777,7 @@ struct mac_context { #ifdef WLAN_FEATURE_CAL_FAILURE_TRIGGER void (*cal_failure_event_cb)(uint8_t cal_type, uint8_t reason); #endif + bool ba_mode; }; #ifdef FEATURE_WLAN_TDLS diff --git a/core/sme/inc/sme_api.h b/core/sme/inc/sme_api.h index 603ba4bd3f..87fc351153 100644 --- a/core/sme/inc/sme_api.h +++ b/core/sme/inc/sme_api.h @@ -3034,6 +3034,17 @@ int sme_set_auto_rate_ldpc(mac_handle_t mac_handle, uint8_t session_id, int sme_set_auto_rate_he_ltf(mac_handle_t mac_handle, uint8_t session_id, uint8_t cfg_val); +/** + * sme_set_ba_opmode() - sets the BA op mode + * @mac_handle: Opaque handle to the global MAC context + * @session_id: SME session id + * @cfg_val: BA mode + * + * Return: None + */ +void sme_set_ba_opmode(mac_handle_t mac_handle, uint8_t session_id, + bool cfg_val); + #ifdef WLAN_FEATURE_11BE /** * sme_update_tgt_eht_cap() - sets the EHT caps to pmac diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index 18b46a66f8..a82c41ba3c 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -10488,6 +10488,15 @@ int sme_update_tx_bfee_nsts(mac_handle_t mac_handle, uint8_t session_id, return sme_update_he_tx_bfee_nsts(mac_handle, session_id, nsts_set_val); } +void sme_set_ba_opmode(mac_handle_t mac_handle, uint8_t session_id, + bool ba_opmode) +{ + struct mac_context *mac_ctx = MAC_CONTEXT(mac_handle); + + mac_ctx->ba_mode = ba_opmode; + sme_debug("BA mode %d", mac_ctx->ba_mode); +} + #ifdef WLAN_FEATURE_11BE void sme_update_tgt_eht_cap(mac_handle_t mac_handle, struct wma_tgt_cfg *cfg, diff --git a/core/wma/src/wma_dev_if.c b/core/wma/src/wma_dev_if.c index 199f4adcee..8aa3965f65 100644 --- a/core/wma/src/wma_dev_if.c +++ b/core/wma/src/wma_dev_if.c @@ -1347,6 +1347,16 @@ QDF_STATUS wma_vdev_start_resp_handler(struct vdev_mlme_obj *vdev_mlme, iface->mac_id, rsp); } + if (iface->type == WMI_VDEV_TYPE_STA && + rsp->resp_type == WMI_VDEV_START_RESP_EVENT) { + wma_debug("BA mode: %d", mac_ctx->ba_mode); + if (wma_cli_set_command(rsp->vdev_id, + wmi_vdev_param_set_ba_mode, + mac_ctx->ba_mode, VDEV_CMD)) + wma_err("Set BA opmode failed for vdev: %d", + rsp->vdev_id); + } + #ifdef FEATURE_AP_MCC_CH_AVOIDANCE if (rsp->status == QDF_STATUS_SUCCESS && mac_ctx->sap.sap_channel_avoidance)