diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 94591acf3da2..1048d98cee30 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -8162,34 +8162,34 @@ static int hdd_config_non_agg_retry(struct hdd_adapter *adapter, const struct nlattr *attr) { uint8_t retry; - int param_id; retry = nla_get_u8(attr); - retry = retry > CFG_NON_AGG_RETRY_MAX ? - CFG_NON_AGG_RETRY_MAX : retry; - param_id = WMI_PDEV_PARAM_NON_AGG_SW_RETRY_TH; - return wma_cli_set_command(adapter->vdev_id, param_id, - retry, PDEV_CMD); + /* Value less than CFG_AGG_RETRY_MIN has side effect to t-put */ + retry = (retry > CFG_NON_AGG_RETRY_MAX) ? CFG_NON_AGG_RETRY_MAX : + ((retry < CFG_NON_AGG_RETRY_MIN) ? CFG_NON_AGG_RETRY_MIN : + retry); + hdd_debug("sending Non-Agg Retry Th: %d", retry); + + return sme_set_vdev_sw_retry(adapter->vdev_id, retry, + WMI_VDEV_CUSTOM_SW_RETRY_TYPE_NONAGGR); } static int hdd_config_agg_retry(struct hdd_adapter *adapter, const struct nlattr *attr) { uint8_t retry; - int param_id; retry = nla_get_u8(attr); - retry = retry > CFG_AGG_RETRY_MAX ? - CFG_AGG_RETRY_MAX : retry; /* Value less than CFG_AGG_RETRY_MIN has side effect to t-put */ - retry = ((retry > 0) && (retry < CFG_AGG_RETRY_MIN)) ? - CFG_AGG_RETRY_MIN : retry; - param_id = WMI_PDEV_PARAM_AGG_SW_RETRY_TH; + retry = (retry > CFG_AGG_RETRY_MAX) ? CFG_AGG_RETRY_MAX : + ((retry < CFG_AGG_RETRY_MIN) ? CFG_AGG_RETRY_MIN : + retry); + hdd_debug("sending Agg Retry Th: %d", retry); - return wma_cli_set_command(adapter->vdev_id, param_id, - retry, PDEV_CMD); + return sme_set_vdev_sw_retry(adapter->vdev_id, retry, + WMI_VDEV_CUSTOM_SW_RETRY_TYPE_AGGR); } static int hdd_config_mgmt_retry(struct hdd_adapter *adapter, diff --git a/core/hdd/src/wlan_hdd_cfg80211.h b/core/hdd/src/wlan_hdd_cfg80211.h index 0b785ead3750..4cfe094e539f 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.h +++ b/core/hdd/src/wlan_hdd_cfg80211.h @@ -270,12 +270,13 @@ typedef enum { #define WIFI_TDLS_EXTERNAL_CONTROL_SUPPORT BIT(1) #define WIIF_TDLS_OFFCHANNEL_SUPPORT BIT(2) -#define CFG_NON_AGG_RETRY_MAX (31) -#define CFG_AGG_RETRY_MAX (31) +#define CFG_NON_AGG_RETRY_MAX (64) +#define CFG_AGG_RETRY_MAX (64) #define CFG_CTRL_RETRY_MAX (31) #define CFG_PROPAGATION_DELAY_MAX (63) #define CFG_PROPAGATION_DELAY_BASE (64) #define CFG_AGG_RETRY_MIN (5) +#define CFG_NON_AGG_RETRY_MIN (5) #define PCL_CHANNEL_SUPPORT_GO BIT(0) #define PCL_CHANNEL_SUPPORT_CLI BIT(1) diff --git a/core/sme/inc/sme_api.h b/core/sme/inc/sme_api.h index e4be3dc5d35b..97c7ecee9285 100644 --- a/core/sme/inc/sme_api.h +++ b/core/sme/inc/sme_api.h @@ -4160,6 +4160,19 @@ void sme_chan_to_freq_list( const uint8_t *chan_list, uint32_t chan_list_len); +/** + * sme_set_vdev_sw_retry() - set sw retry threshold per vdev + * @vdev_id: vdev id + * @sw_retry_count: sw retry number + * @retry_type: SW vdev retry type + * + * This function calls WMA api to send the sw retry threshold per vdev. + * + * Return: QDF_STATUS. + */ +QDF_STATUS sme_set_vdev_sw_retry(uint8_t vdev_id, uint8_t sw_retry_count, + wmi_vdev_custom_sw_retry_type_t sw_retry_type); + /** * sme_set_roam_config_enable() - Cache roam config status in SME * @mac_handle: Opaque handle to the MAC context diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index be7546ad39ed..f757ae730d2c 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -16847,6 +16847,21 @@ QDF_STATUS sme_register_bcn_recv_pause_ind_cb(mac_handle_t mac_handle, } #endif +QDF_STATUS sme_set_vdev_sw_retry(uint8_t vdev_id, uint8_t sw_retry_count, + wmi_vdev_custom_sw_retry_type_t sw_retry_type) +{ + QDF_STATUS status; + + status = wma_set_vdev_sw_retry_th(vdev_id, sw_retry_count, + sw_retry_type); + if (QDF_IS_STATUS_ERROR(status)) { + sme_err("Failed to set retry count for vdev: %d", vdev_id); + return status; + } + + return QDF_STATUS_SUCCESS; +} + QDF_STATUS sme_set_disconnect_ies(mac_handle_t mac_handle, uint8_t vdev_id, uint8_t *ie_data, uint16_t ie_len) { diff --git a/core/wma/inc/wma_api.h b/core/wma/inc/wma_api.h index e0f58addfb22..e9eb4eb644a4 100644 --- a/core/wma/inc/wma_api.h +++ b/core/wma/inc/wma_api.h @@ -358,6 +358,19 @@ wma_set_tx_rx_aggr_size_per_ac(WMA_HANDLE wma_handle, struct wlan_mlme_qos *qos_aggr, wmi_vdev_custom_aggr_type_t aggr_type); +/** + * wma_set_sw_retry_threshold() - set sw retry threshold per vdev + * @vdev_id: vdev id + * @sw_retry_count: sw retry number + * @retry_type: SW vdev retry type + * + * This function sends WMI command to set the sw retry threshold per vdev. + * + * Return: QDF_STATUS. + */ +QDF_STATUS wma_set_vdev_sw_retry_th(uint8_t vdev_id, uint8_t sw_retry_count, + wmi_vdev_custom_sw_retry_type_t retry_type); + /** * wma_set_sw_retry_threshold_per_ac() - set sw retry threshold per AC for tx * @handle: wma handle diff --git a/core/wma/src/wma_features.c b/core/wma/src/wma_features.c index d8d9032c987a..95baf9746db0 100644 --- a/core/wma/src/wma_features.c +++ b/core/wma/src/wma_features.c @@ -4168,6 +4168,35 @@ static QDF_STATUS wma_set_sw_retry_by_qos( return QDF_STATUS_SUCCESS; } +QDF_STATUS wma_set_vdev_sw_retry_th(uint8_t vdev_id, uint8_t sw_retry_count, + wmi_vdev_custom_sw_retry_type_t retry_type) +{ + QDF_STATUS status = QDF_STATUS_SUCCESS; + tp_wma_handle wma_handle; + uint32_t queue_num; + + wma_handle = cds_get_context(QDF_MODULE_ID_WMA); + if (!wma_handle) + return QDF_STATUS_E_FAILURE; + + + for (queue_num = 0; queue_num < WMI_AC_MAX; queue_num++) { + if (sw_retry_count == 0) + continue; + + status = wma_set_sw_retry_by_qos(wma_handle, + vdev_id, + retry_type, + queue_num, + sw_retry_count); + + if (QDF_IS_STATUS_ERROR(status)) + return status; + } + + return QDF_STATUS_SUCCESS; +} + QDF_STATUS wma_set_sw_retry_threshold_per_ac(WMA_HANDLE handle, uint8_t vdev_id, struct wlan_mlme_qos *qos_aggr)