diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h index 361019ed0888..c0b33c94f2a1 100644 --- a/core/mac/inc/sir_api.h +++ b/core/mac/inc/sir_api.h @@ -4030,6 +4030,34 @@ typedef struct sSirTxPowerLimit { uint32_t txPower5g; } tSirTxPowerLimit; +enum bad_peer_thresh_levels { + WLAN_WMA_IEEE80211_B_LEVEL = 0, + WLAN_WMA_IEEE80211_AG_LEVEL, + WLAN_WMA_IEEE80211_N_LEVEL, + WLAN_WMA_IEEE80211_AC_LEVEL, + WLAN_WMA_IEEE80211_AX_LEVEL, + WLAN_WMA_IEEE80211_MAX_LEVEL, +}; + +#define NUM_OF_RATE_THRESH_MAX (4) +struct t_bad_peer_info { + uint32_t cond; + uint32_t delta; + uint32_t percentage; + uint32_t thresh[NUM_OF_RATE_THRESH_MAX]; + uint32_t txlimit; +}; + +struct t_bad_peer_txtcl_config { + /* Array of thermal levels */ + struct t_bad_peer_info threshold[WLAN_WMA_IEEE80211_MAX_LEVEL]; + uint32_t enable; + uint32_t period; + uint32_t txq_limit; + uint32_t tgt_backoff; + uint32_t tgt_report_prd; +}; + /* notify MODEM power state to FW */ typedef struct { uint32_t param; diff --git a/core/wma/inc/wma_internal.h b/core/wma/inc/wma_internal.h index 7c47342fc4f7..3ea0fe060e0c 100644 --- a/core/wma/inc/wma_internal.h +++ b/core/wma/inc/wma_internal.h @@ -775,11 +775,20 @@ QDF_STATUS wma_tx_attach(tp_wma_handle wma_handle); QDF_STATUS wma_tx_detach(tp_wma_handle wma_handle); -#if defined(QCA_LL_LEGACY_TX_FLOW_CONTROL) || defined(QCA_LL_TX_FLOW_CONTROL_V2) +#if defined(QCA_LL_LEGACY_TX_FLOW_CONTROL) || \ + defined(QCA_LL_TX_FLOW_CONTROL_V2) || defined(CONFIG_HL_SUPPORT) + int wma_mcc_vdev_tx_pause_evt_handler(void *handle, uint8_t *event, uint32_t len); #endif +#if defined(CONFIG_HL_SUPPORT) && defined(QCA_BAD_PEER_TX_FLOW_CL) +QDF_STATUS wma_process_init_bad_peer_tx_ctl_info(tp_wma_handle wma, + struct t_bad_peer_txtcl_config *config); + +#endif + + QDF_STATUS wma_process_init_thermal_info(tp_wma_handle wma, t_thermal_mgmt *pThermalParams); diff --git a/core/wma/inc/wma_types.h b/core/wma/inc/wma_types.h index 51f940c360dd..53af2d267a25 100644 --- a/core/wma/inc/wma_types.h +++ b/core/wma/inc/wma_types.h @@ -369,6 +369,8 @@ #define WMA_IBSS_CESIUM_ENABLE_IND SIR_HAL_IBSS_CESIUM_ENABLE_IND +#define WMA_INIT_BAD_PEER_TX_CTL_INFO_CMD SIR_HAL_BAD_PEER_TX_CTL_INI_CMD + #ifdef FEATURE_WLAN_TDLS #define WMA_UPDATE_FW_TDLS_STATE SIR_HAL_UPDATE_FW_TDLS_STATE #define WMA_UPDATE_TDLS_PEER_STATE SIR_HAL_UPDATE_TDLS_PEER_STATE diff --git a/core/wma/src/wma_data.c b/core/wma/src/wma_data.c index d10526f1de18..3f7aa65f05ca 100644 --- a/core/wma/src/wma_data.c +++ b/core/wma/src/wma_data.c @@ -44,8 +44,12 @@ #include "cfg_api.h" #include "ol_txrx_ctrl_api.h" #include +#if defined(CONFIG_HL_SUPPORT) +#include "wlan_tgt_def_config_hl.h" +#else #include "wlan_tgt_def_config.h" - +#endif +#include "ol_txrx.h" #include "qdf_nbuf.h" #include "qdf_types.h" #include "qdf_mem.h" @@ -72,6 +76,8 @@ #include "cdp_txrx_misc.h" #include #include +#include "cdp_txrx_stats.h" + typedef struct { int32_t rate; @@ -1565,7 +1571,9 @@ QDF_STATUS wma_tx_detach(tp_wma_handle wma_handle) return QDF_STATUS_SUCCESS; } -#if defined(QCA_LL_LEGACY_TX_FLOW_CONTROL) || defined(QCA_LL_TX_FLOW_CONTROL_V2) +#if defined(QCA_LL_LEGACY_TX_FLOW_CONTROL) || \ + defined(QCA_LL_TX_FLOW_CONTROL_V2) || defined(CONFIG_HL_SUPPORT) + /** * wma_mcc_vdev_tx_pause_evt_handler() - pause event handler * @handle: wma handle @@ -1664,6 +1672,118 @@ int wma_mcc_vdev_tx_pause_evt_handler(void *handle, uint8_t *event, #endif /* QCA_LL_LEGACY_TX_FLOW_CONTROL */ +#if defined(CONFIG_HL_SUPPORT) && defined(QCA_BAD_PEER_TX_FLOW_CL) + +/** + * wma_set_peer_rate_report_condition - + * this function set peer rate report + * condition info to firmware. + * @handle: Handle of WMA + * @config: Bad peer configuration from SIR module + * + * It is a wrapper function to sent WMI_PEER_SET_RATE_REPORT_CONDITION_CMDID + * to the firmare\target.If the command sent to firmware failed, free the + * buffer that allocated. + * + * Return: QDF_STATUS based on values sent to firmware + */ +static +QDF_STATUS wma_set_peer_rate_report_condition(WMA_HANDLE handle, + struct t_bad_peer_txtcl_config *config) +{ + tp_wma_handle wma_handle = (tp_wma_handle)handle; + struct wmi_peer_rate_report_params rate_report_params = {0}; + u_int32_t i, j; + + rate_report_params.rate_report_enable = config->enable; + rate_report_params.backoff_time = config->tgt_backoff; + rate_report_params.timer_period = config->tgt_report_prd; + for (i = 0; i < WMI_PEER_RATE_REPORT_COND_MAX_NUM; i++) { + rate_report_params.report_per_phy[i].cond_flags = + config->threshold[i].cond; + rate_report_params.report_per_phy[i].delta.delta_min = + config->threshold[i].delta; + rate_report_params.report_per_phy[i].delta.percent = + config->threshold[i].percentage; + for (j = 0; j < WMI_MAX_NUM_OF_RATE_THRESH; j++) { + rate_report_params.report_per_phy[i]. + report_rate_threshold[j] = + config->threshold[i].thresh[j]; + } + } + + return wmi_unified_peer_rate_report_cmd(wma_handle->wmi_handle, + &rate_report_params); +} + +/** + * wma_process_init_bad_peer_tx_ctl_info - + * this function to initialize peer rate report config info. + * @handle: Handle of WMA + * @config: Bad peer configuration from SIR module + * + * This function initializes the bad peer tx control data structure in WMA, + * sends down the initial configuration to the firmware and configures + * the peer status update seeting in the tx_rx module. + * + * Return: QDF_STATUS based on procedure status + */ + +QDF_STATUS wma_process_init_bad_peer_tx_ctl_info(tp_wma_handle wma, + struct t_bad_peer_txtcl_config *config) +{ + /* Parameter sanity check */ + ol_txrx_pdev_handle curr_pdev; + + if (NULL == wma || NULL == config) { + WMA_LOGE("%s Invalid input\n", __func__); + return QDF_STATUS_E_FAILURE; + } + + curr_pdev = cds_get_context(QDF_MODULE_ID_TXRX); + if (NULL == curr_pdev) { + WMA_LOGE("%s: Failed to get pdev\n", __func__); + return QDF_STATUS_E_FAILURE; + } + + WMA_LOGE("%s enable %d period %d txq limit %d\n", __func__, + config->enable, + config->period, + config->txq_limit); + + /* Only need to initialize the setting + when the feature is enabled */ + if (config->enable) { + int i = 0; + + ol_txrx_bad_peer_txctl_set_setting(curr_pdev, + config->enable, + config->period, + config->txq_limit); + + for (i = 0; i < WLAN_WMA_IEEE80211_MAX_LEVEL; i++) { + u_int32_t threshold, limit; + threshold = + config->threshold[i].thresh[0]; + limit = config->threshold[i].txlimit; + ol_txrx_bad_peer_txctl_update_threshold(curr_pdev, i, + threshold, + limit); + } + } + + return wma_set_peer_rate_report_condition(wma, config); +} +#else + +QDF_STATUS wma_process_init_bad_peer_tx_ctl_info(tp_wma_handle wma, + struct t_bad_peer_txtcl_config *config) +{ + return QDF_STATUS_E_FAILURE; +} +#endif /* defined(CONFIG_HL_SUPPORT) && defined(QCA_BAD_PEER_TX_FLOW_CL) */ + + /** * wma_process_init_thermal_info() - initialize thermal info * @wma: Pointer to WMA handle @@ -2398,6 +2518,8 @@ QDF_STATUS wma_tx_packet(void *wma_context, void *tx_frame, uint16_t frmLen, return QDF_STATUS_E_FAILURE; } + ol_txrx_hl_tdls_flag_reset(txrx_vdev, false); + if (frmType >= TXRX_FRM_MAX) { WMA_LOGE("Invalid Frame Type Fail to send Frame"); return QDF_STATUS_E_FAILURE; @@ -2586,8 +2708,12 @@ QDF_STATUS wma_tx_packet(void *wma_context, void *tx_frame, uint16_t frmLen, wma_handle->last_umac_data_nbuf = skb; /* Send the Data frame to TxRx in Non Standard Path */ + ol_txrx_hl_tdls_flag_reset(txrx_vdev, tdlsFlag); + ret = ol_tx_non_std(txrx_vdev, OL_TX_SPEC_NO_FREE, skb); + ol_txrx_hl_tdls_flag_reset(txrx_vdev, false); + if (ret) { WMA_LOGE("TxRx Rejected. Fail to do Tx"); /* Call Download Cb so that umac can free the buffer */ @@ -2762,6 +2888,9 @@ QDF_STATUS wma_tx_packet(void *wma_context, void *tx_frame, uint16_t frmLen, * we didn't get Download Complete for almost * WMA_TX_FRAME_COMPLETE_TIMEOUT (1 sec) */ + + /* display scheduler stats */ + ol_txrx_display_stats(WLAN_SCHEDULER_STATS); } } else { /* diff --git a/core/wma/src/wma_dev_if.c b/core/wma/src/wma_dev_if.c index 6e69b56070ed..d7040f577fca 100644 --- a/core/wma/src/wma_dev_if.c +++ b/core/wma/src/wma_dev_if.c @@ -42,7 +42,6 @@ #include "wmi_unified.h" #include "wni_cfg.h" #include "cfg_api.h" -#include "wlan_tgt_def_config.h" #include "qdf_nbuf.h" #include "qdf_types.h" @@ -73,6 +72,8 @@ #include #include #include +#include "ol_txrx.h" + #include "cds_concurrency.h" @@ -3488,6 +3489,7 @@ send_rsp: } #ifdef FEATURE_WLAN_TDLS + /** * wma_add_tdls_sta() - process add sta request in TDLS mode * @wma: wma handle @@ -3529,6 +3531,9 @@ static void wma_add_tdls_sta(tp_wma_handle wma, tpAddStaParams add_sta) if (0 == add_sta->updateSta) { /* its a add sta request * */ + + ol_txrx_copy_mac_addr_raw(vdev, add_sta->bssId); + WMA_LOGD("%s: addSta, calling wma_create_peer for %pM, vdev_id %hu", __func__, add_sta->staMac, add_sta->smesessionId); @@ -3549,6 +3554,9 @@ static void wma_add_tdls_sta(tp_wma_handle wma, tpAddStaParams add_sta) add_sta->status = QDF_STATUS_E_FAILURE; wma_remove_peer(wma, add_sta->staMac, add_sta->smesessionId, peer, false); + + ol_txrx_add_last_real_peer(pdev, vdev, &peer_id); + goto send_rsp; } @@ -3582,6 +3590,9 @@ static void wma_add_tdls_sta(tp_wma_handle wma, tpAddStaParams add_sta) add_sta->status = QDF_STATUS_E_FAILURE; wma_remove_peer(wma, add_sta->staMac, add_sta->smesessionId, peer, false); + + ol_txrx_add_last_real_peer(pdev, vdev, &peer_id); + goto send_rsp; } @@ -3616,6 +3627,8 @@ static void wma_add_tdls_sta(tp_wma_handle wma, tpAddStaParams add_sta) add_sta->status = QDF_STATUS_E_FAILURE; wma_remove_peer(wma, add_sta->staMac, add_sta->smesessionId, peer, false); + ol_txrx_add_last_real_peer(pdev, vdev, &peer_id); + goto send_rsp; } } diff --git a/core/wma/src/wma_features.c b/core/wma/src/wma_features.c index b01360e0712a..d73b338bdb2b 100644 --- a/core/wma/src/wma_features.c +++ b/core/wma/src/wma_features.c @@ -45,7 +45,6 @@ #include "cfg_api.h" #include "ol_txrx_ctrl_api.h" #include -#include "wlan_tgt_def_config.h" #include #include "qdf_nbuf.h" @@ -70,6 +69,7 @@ #include "dfs.h" #include "radar_filters.h" #include "wma_internal.h" +#include "ol_txrx.h" #ifndef ARRAY_LENGTH #define ARRAY_LENGTH(a) (sizeof(a) / sizeof((a)[0])) @@ -6449,6 +6449,7 @@ int wma_update_tdls_peer_state(WMA_HANDLE handle, uint8_t *peer_mac_addr; int ret = 0; uint32_t *ch_mhz; + bool restore_last_peer = false; if (!wma_handle || !wma_handle->wmi_handle) { WMA_LOGE("%s: WMA is closed, can not issue cmd", __func__); @@ -6500,6 +6501,7 @@ int wma_update_tdls_peer_state(WMA_HANDLE handle, goto end_tdls_peer_state; } peer_mac_addr = ol_txrx_peer_get_peer_mac_addr(peer); + restore_last_peer = is_vdev_restore_last_peer(peer); WMA_LOGD("%s: calling wma_remove_peer for peer " MAC_ADDRESS_STR " vdevId: %d", __func__, @@ -6507,6 +6509,8 @@ int wma_update_tdls_peer_state(WMA_HANDLE handle, peerStateParams->vdevId); wma_remove_peer(wma_handle, peer_mac_addr, peerStateParams->vdevId, peer, false); + ol_txrx_update_last_real_peer(pdev, peer, &peer_id, + restore_last_peer); } end_tdls_peer_state: diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c index dabaf5bc8ea0..da68b5df928c 100644 --- a/core/wma/src/wma_main.c +++ b/core/wma/src/wma_main.c @@ -44,8 +44,11 @@ #include "wmi_unified.h" #include "wni_cfg.h" #include "cfg_api.h" +#if defined(CONFIG_HL_SUPPORT) +#include "wlan_tgt_def_config_hl.h" +#else #include "wlan_tgt_def_config.h" - +#endif #include "qdf_nbuf.h" #include "qdf_types.h" #include "qdf_mem.h" @@ -2677,7 +2680,8 @@ QDF_STATUS wma_start(void *cds_ctx) } #endif /* FEATURE_WLAN_SCAN_PNO */ -#if defined(QCA_LL_LEGACY_TX_FLOW_CONTROL) || defined(QCA_LL_TX_FLOW_CONTROL_V2) +#if defined(QCA_LL_LEGACY_TX_FLOW_CONTROL) || \ + defined(QCA_LL_TX_FLOW_CONTROL_V2) || defined(CONFIG_HL_SUPPORT) WMA_LOGE("MCC TX Pause Event Handler register"); status = wmi_unified_register_event_handler(wma_handle->wmi_handle, WMI_TX_PAUSE_EVENTID, @@ -4987,7 +4991,14 @@ QDF_STATUS wma_mc_process_msg(void *cds_context, cds_msg_t *msg) case WMA_SET_THERMAL_LEVEL: wma_process_set_thermal_level(wma_handle, msg->bodyval); break; - +#ifdef CONFIG_HL_SUPPORT + case WMA_INIT_BAD_PEER_TX_CTL_INFO_CMD: + wma_process_init_bad_peer_tx_ctl_info( + wma_handle, + (struct t_bad_peer_txtcl_config *)msg->bodyptr); + qdf_mem_free(msg->bodyptr); + break; +#endif case WMA_SET_P2P_GO_NOA_REQ: wma_process_set_p2pgo_noa_req(wma_handle, (tP2pPsParams *) msg->bodyptr); diff --git a/core/wma/src/wma_mgmt.c b/core/wma/src/wma_mgmt.c index 48ae5e971169..240fa73e1f81 100644 --- a/core/wma/src/wma_mgmt.c +++ b/core/wma/src/wma_mgmt.c @@ -43,7 +43,6 @@ #include "wmi_unified.h" #include "wni_cfg.h" #include "cfg_api.h" -#include "wlan_tgt_def_config.h" #include "qdf_nbuf.h" #include "qdf_types.h" @@ -743,6 +742,45 @@ static inline uint8_t wma_parse_mpdudensity(uint8_t mpdudensity) return 0; } +#if defined(CONFIG_HL_SUPPORT) && defined(FEATURE_WLAN_TDLS) + +/** + * wma_unified_peer_state_update() - update peer state + * @pdev: pdev handle + * @sta_mac: pointer to sta mac addr + * @bss_addr: bss address + * @sta_type: sta entry type + * + * + * Return: None + */ +static void +wma_unified_peer_state_update( + struct ol_txrx_pdev_t *pdev, + uint8_t *sta_mac, + uint8_t *bss_addr, + uint8_t sta_type) +{ + if (STA_ENTRY_TDLS_PEER == sta_type) + ol_txrx_peer_state_update(pdev, sta_mac, + OL_TXRX_PEER_STATE_AUTH); + else + ol_txrx_peer_state_update(pdev, bss_addr, + OL_TXRX_PEER_STATE_AUTH); +} +#else + +static inline void +wma_unified_peer_state_update( + struct ol_txrx_pdev_t *pdev, + uint8_t *sta_mac, + uint8_t *bss_addr, + uint8_t sta_type) +{ + ol_txrx_peer_state_update(pdev, bss_addr, OL_TXRX_PEER_STATE_AUTH); +} +#endif + /** * wmi_unified_send_peer_assoc() - send peer assoc command to fw * @wma: wma handle @@ -963,7 +1001,8 @@ QDF_STATUS wma_send_peer_assoc(tp_wma_handle wma, if (params->wpa_rsn >> 1) cmd->peer_flags |= WMI_PEER_NEED_GTK_2_WAY; - ol_txrx_peer_state_update(pdev, params->bssId, OL_TXRX_PEER_STATE_AUTH); + wma_unified_peer_state_update(pdev, params->staMac, + params->bssId, params->staType); #ifdef FEATURE_WLAN_WAPI if (params->encryptType == eSIR_ED_WPI) { diff --git a/core/wma/src/wma_power.c b/core/wma/src/wma_power.c index bba2a4ed30cf..390d66acda2f 100644 --- a/core/wma/src/wma_power.c +++ b/core/wma/src/wma_power.c @@ -42,7 +42,6 @@ #include "wmi_unified.h" #include "wni_cfg.h" #include "cfg_api.h" -#include "wlan_tgt_def_config.h" #include "qdf_nbuf.h" #include "qdf_types.h" diff --git a/core/wma/src/wma_scan_roam.c b/core/wma/src/wma_scan_roam.c index 9e31378766e2..6bab3975213e 100644 --- a/core/wma/src/wma_scan_roam.c +++ b/core/wma/src/wma_scan_roam.c @@ -43,7 +43,6 @@ #include "wmi_unified.h" #include "wni_cfg.h" #include "cfg_api.h" -#include "wlan_tgt_def_config.h" #include #include diff --git a/core/wma/src/wma_utils.c b/core/wma/src/wma_utils.c index 15e8690b4e80..61100356a6b2 100644 --- a/core/wma/src/wma_utils.c +++ b/core/wma/src/wma_utils.c @@ -42,7 +42,6 @@ #include "wmi_unified.h" #include "wni_cfg.h" #include "cfg_api.h" -#include "wlan_tgt_def_config.h" #include "qdf_nbuf.h" #include "qdf_types.h"