qcacld-3.0: Take a wakelock till CSA complete

Currently the driver sends the CSA IEs in the
beacon every beacon interval, and updates the
CSA IE count in every beacon.

If the wlan gets suspended in between the
updation of CSA IEs, the CSA is delayed
till the next resume, which could lead to
STA kickout event, if there is delay between
the CSA period, and the channel switch time.

Fix is to take a wakelock till CSA is completed
in order to avoid the STA kickout.

Change-Id: Iff03476433c755cbddc7568ffbd24ddb81fd1c90
CRs-Fixed: 2504039
This commit is contained in:
gaurank kathpalia 2019-08-05 17:22:27 +05:30 • committed by nshrivas
commit 2fcec840ce
5 changed files with 20 additions and 0 deletions

View file

@ -132,6 +132,8 @@ struct obss_detection_cfg {
* @vdev: the actual vdev for which this entry is applicable
* @connected_akm: AKM of current connection
* @is_adaptive_11R_connection: flag to check if we are connecting
* @ap_ecsa_wakelock: wakelock to complete CSA operation.
* @ap_ecsa_runtime_lock: runtime lock to complete SAP CSA operation.
* to Adaptive 11R network
*/
struct pe_session {
@ -492,6 +494,8 @@ struct pe_session {
qdf_mc_timer_t protection_fields_reset_timer;
/* timer to decrement CSA/ECSA count */
qdf_mc_timer_t ap_ecsa_timer;
qdf_wake_lock_t ap_ecsa_wakelock;
qdf_runtime_lock_t ap_ecsa_runtime_lock;
struct mac_context *mac_ctx;
/*
* variable to store state of various protection struct like

View file

@ -5719,6 +5719,13 @@ static void lim_process_sme_dfs_csa_ie_request(struct mac_context *mac_ctx,
wider_bw_ch_switch->newCenterChanFreq0 =
dfs_csa_ie_req->ch_params.center_freq_seg0;
skip_vht:
/* Take a wakelock for CSA for 5 seconds and release in vdev start */
qdf_wake_lock_timeout_acquire(&session_entry->ap_ecsa_wakelock,
MAX_WAKELOCK_FOR_CSA);
qdf_runtime_pm_prevent_suspend(&session_entry->ap_ecsa_runtime_lock);
/* Send CSA IE request from here */
lim_send_dfs_chan_sw_ie_update(mac_ctx, session_entry);

View file

@ -1937,6 +1937,9 @@ lim_send_sme_ap_channel_switch_resp(struct mac_context *mac,
enum phy_ch_width ch_width;
uint8_t ch_center_freq_seg1;
qdf_runtime_pm_allow_suspend(&pe_session->ap_ecsa_runtime_lock);
qdf_wake_lock_release(&pe_session->ap_ecsa_wakelock, 0);
pSmeSwithChnlParams = qdf_mem_malloc(sizeof(tSwitchChannelParams));
if (!pSmeSwithChnlParams)
return;

View file

@ -664,6 +664,9 @@ struct pe_session *pe_create_session(struct mac_context *mac,
else
session_ptr->is_obss_reset_timer_initialized = true;
qdf_wake_lock_create(&session_ptr->ap_ecsa_wakelock,
"ap_ecsa_wakelock");
qdf_runtime_lock_init(&session_ptr->ap_ecsa_runtime_lock);
status = qdf_mc_timer_init(&session_ptr->ap_ecsa_timer,
QDF_TIMER_TYPE_WAKE_APPS,
lim_process_ap_ecsa_timeout,
@ -873,6 +876,8 @@ void pe_delete_session(struct mac_context *mac_ctx, struct pe_session *session)
}
if (LIM_IS_AP_ROLE(session)) {
qdf_runtime_lock_deinit(&session->ap_ecsa_runtime_lock);
qdf_wake_lock_destroy(&session->ap_ecsa_wakelock);
qdf_mc_timer_stop(&session->protection_fields_reset_timer);
qdf_mc_timer_destroy(&session->protection_fields_reset_timer);
session->dfsIncludeChanSwIe = 0;

View file

@ -102,6 +102,7 @@ typedef enum {
#define OBSS_DETECTION_IS_HT_20MHZ(_m) ((_m) & OBSS_DETECTION_HT_20MHZ_BIT_MASK)
#define MAX_WAIT_FOR_BCN_TX_COMPLETE 4000
#define MAX_WAKELOCK_FOR_CSA 5000
#ifdef WLAN_FEATURE_11W
typedef union uPmfSaQueryTimerId {