From cb0521722bf03fc8ebabbb36b037ea3a6d0b76ef Mon Sep 17 00:00:00 2001 From: Manishekar Chandrasekaran Date: Fri, 22 Apr 2016 12:19:04 +0530 Subject: qcacld-3.0: Modify set hw mode sequence on channel switch scenarios Modify the set hardware mode command sequence during channel switch in the case of SAP/P2P-GO and STA/P2P-CLI as per the latest FW requirements. This is primarily to accommodate the time take for calibration during hardware mode change which could lead to momentary data stalls. The new sequence is as follows: 1. Send (E)CSA 2. Do vdev restart/vdev up 3. For DBS downgrade: a. PM will initiate HW mode change to DBS right away 4. For single MAC upgrade: a. Opportunistic timer is started, PM will check if MCC upgrade can be done on timer expiry The old sequence is as follows: For MCC upgrade: 1. Send (E)CSA 2. Opportunistic timer is started 3. vdev restart is initiated on the new channel 4. PM will check if MCC upgrade can be done on timer expiry For single mac upgrade: 1. Send (E)CSA 2. PM will initiate HW mode change to DBS right away 3. vdev restart is initiated on the new channel Change-Id: I4bce2ee176cae43b6a46c47216ed7ab47a82a54c CRs-Fixed: 1006992 --- core/mac/src/include/sir_params.h | 2 +- core/mac/src/pe/include/lim_session.h | 1 - core/mac/src/pe/lim/lim_process_message_queue.c | 159 +-------------------- core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c | 1 + 4 files changed, 3 insertions(+), 160 deletions(-) (limited to 'core/mac/src') diff --git a/core/mac/src/include/sir_params.h b/core/mac/src/include/sir_params.h index 34d26ca32412..af4faed28d75 100644 --- a/core/mac/src/include/sir_params.h +++ b/core/mac/src/include/sir_params.h @@ -637,7 +637,7 @@ typedef struct sSirMbMsgP2p { #define SIR_LIM_SCH_CLEAN_MSG (SIR_LIM_ITC_MSG_TYPES_BEGIN + 0xB) /* Message from ISR upon Radar Detection */ #define SIR_LIM_RADAR_DETECT_IND (SIR_LIM_ITC_MSG_TYPES_BEGIN + 0xC) -#define SIR_LIM_CSA_POST_HW_MODE_CHANGE (SIR_LIM_ITC_MSG_TYPES_BEGIN + 0xD) +/* Message id 0xD available */ /* Message from Hal to send out a DEL-TS indication */ #define SIR_LIM_DEL_TS_IND (SIR_LIM_ITC_MSG_TYPES_BEGIN + 0xE) diff --git a/core/mac/src/pe/include/lim_session.h b/core/mac/src/pe/include/lim_session.h index 8ff3010ee5a7..c44aecc887aa 100644 --- a/core/mac/src/pe/include/lim_session.h +++ b/core/mac/src/pe/include/lim_session.h @@ -472,7 +472,6 @@ typedef struct sPESession /* Added to Support BT-AMP */ uint8_t country_info_present; uint8_t nss; bool add_bss_failed; - struct csa_offload_params saved_csa_params; /* To hold OBSS Scan IE Parameters */ struct obss_scanparam obss_ht40_scanparam; /* Supported NSS is intersection of self and peer NSS */ diff --git a/core/mac/src/pe/lim/lim_process_message_queue.c b/core/mac/src/pe/lim/lim_process_message_queue.c index e2d0e786725d..499cee125e68 100644 --- a/core/mac/src/pe/lim/lim_process_message_queue.c +++ b/core/mac/src/pe/lim/lim_process_message_queue.c @@ -1240,160 +1240,6 @@ static void lim_process_sme_obss_scan_ind(tpAniSirGlobal mac_ctx, return; } -/** - * lim_handle_hw_mode_change_on_csa() - Do HW mode change on CSA for STA mode - * @mac_ctx: Global MAC context - * @msg: Received message - * - * Checks if hw mode change is required for the new channel. - * If MCC upgrade is required, this function will start the opportunistic - * timer and the caller will invoke the other APIs to perform vdev restart on - * the new channel. - * - * If DBS downgrade is required, this function will initiate the hw mode - * change and vdev restart will happen on the new channel after getting hw - * mode response - * - * Return: QDF_STATUS_SUCCESS if processing of csa params (and hence vdev - * restart) needs to happen or if no hw mode change is required, - * QDF_STATUS_E_FAILURE otherwise. - */ -static QDF_STATUS lim_handle_hw_mode_change_on_csa(tpAniSirGlobal mac_ctx, - tpSirMsgQ msg) -{ - tpPESession session_entry; - struct csa_offload_params *csa_params = - (struct csa_offload_params *) (msg->bodyptr); - tpDphHashNode sta_ds = NULL; - uint8_t session_id; - uint16_t aid = 0; - QDF_STATUS status = QDF_STATUS_E_FAILURE; - - lim_log(mac_ctx, LOG1, FL("handle hw mode change for csa")); - - if (!csa_params) { - lim_log(mac_ctx, LOGE, FL("limMsgQ body ptr is NULL")); - /* qdf_mem_free() can handle NULL values */ - goto err; - } - - session_entry = pe_find_session_by_bssid(mac_ctx, - csa_params->bssId, &session_id); - if (!session_entry) { - lim_log(mac_ctx, LOGE, FL("Session does not exist")); - goto err; - } - - sta_ds = dph_lookup_hash_entry(mac_ctx, session_entry->bssId, &aid, - &session_entry->dph.dphHashTable); - - if (!sta_ds) { - lim_log(mac_ctx, LOGE, FL("sta_ds does not exist")); - goto err; - } - - status = cds_handle_hw_mode_change_on_csa(session_entry->smeSessionId, - csa_params->channel, csa_params->bssId, - &session_entry->saved_csa_params, csa_params, - sizeof(session_entry->saved_csa_params)); - - if (QDF_IS_STATUS_SUCCESS(status)) - return status; - -err: - qdf_mem_free(csa_params); - return status; -} - -/** - * lim_handle_hw_mode_change_on_csa_event() - Handle hw mode change on csa - * @mac_ctx: Pointer to the Global Mac Context - * @msg: Received message - * - * Checks if a hw mode change is required for the received csa event. Processes - * csa params and do vdev restart immediately if the there is no need for a hw - * mode change or if MCC upgrade is required - * - * Return: None - */ -static void lim_handle_hw_mode_change_on_csa_event(tpAniSirGlobal mac_ctx, - tpSirMsgQ msg) -{ - QDF_STATUS qdf_status; - - lim_log(mac_ctx, LOG1, FL("lim received csa offload event")); - if (mac_ctx->policy_manager_enabled && - wma_is_hw_dbs_capable() == true) { - /* Check if a hw mode change is required */ - qdf_status = lim_handle_hw_mode_change_on_csa(mac_ctx, - msg); - /* Process csa params and do vdev restart immediately if - * there is no need for a hw mode change or if MCC upgrade is - * required. - */ - if (QDF_IS_STATUS_SUCCESS(qdf_status)) - lim_handle_csa_offload_msg(mac_ctx, msg); - } else { - lim_handle_csa_offload_msg(mac_ctx, msg); - } -} - -/** - * lim_handle_csa_event_post_dbs_downgrade() - Process csa event post dbs - * downgrade - * @mac_ctx: Pointer to the Global Mac Context - * @msg: Received message - * - * Process the csa event to do vdev restart on the new channel after the dbs - * downgrade. If there was a DBS downgrade as part of the event - * WMA_CSA_OFFLOAD_EVENT, SIR_LIM_CSA_POST_HW_MODE_CHANGE will be received after - * receiving the set hw mode response, where this processing will happen. - * - * Return: None - */ -static void lim_handle_csa_event_post_dbs_downgrade(tpAniSirGlobal mac_ctx, - tpSirMsgQ msg) -{ - tSirMsgQ csa_msg; - tpPESession session_entry; - - struct sir_saved_csa_params *buf = - (struct sir_saved_csa_params *)msg->bodyptr; - - /* Null check for 'msg' already done before coming here in the caller */ - - session_entry = pe_find_session_by_sme_session_id(mac_ctx, - buf->session_id); - if (!session_entry) { - lim_log(mac_ctx, LOGE, FL("Invalid session id:%d"), - buf->session_id); - return; - } - - lim_log(mac_ctx, LOG1, - FL("received csa offload event post hw change for %pM"), - session_entry->saved_csa_params.bssId); - - csa_msg.bodyptr = qdf_mem_malloc( - sizeof(struct csa_offload_params)); - if (!csa_msg.bodyptr) { - lim_log(mac_ctx, LOGE, FL("malloc failed for csa msg")); - goto clean_msg_body; - } - - qdf_mem_copy((void *)csa_msg.bodyptr, - (void *)&session_entry->saved_csa_params, - sizeof(struct csa_offload_params)); - /* If there was a DBS downgrade as part of the event - * WMA_CSA_OFFLOAD_EVENT, SIR_LIM_CSA_POST_HW_MODE_CHANGE will - * be received after receiving the set hw mode response. - */ - lim_handle_csa_offload_msg(mac_ctx, &csa_msg); -clean_msg_body: - if (msg->bodyptr) - qdf_mem_free(msg->bodyptr); -} - /** * lim_process_messages() - Process messages from upper layers. * @@ -1853,10 +1699,7 @@ void lim_process_messages(tpAniSirGlobal mac_ctx, tpSirMsgQ msg) lim_handle_delete_bss_rsp(mac_ctx, msg); break; case WMA_CSA_OFFLOAD_EVENT: - lim_handle_hw_mode_change_on_csa_event(mac_ctx, msg); - break; - case SIR_LIM_CSA_POST_HW_MODE_CHANGE: - lim_handle_csa_event_post_dbs_downgrade(mac_ctx, msg); + lim_handle_csa_offload_msg(mac_ctx, msg); break; case WMA_SET_BSSKEY_RSP: case WMA_SET_STA_BCASTKEY_RSP: diff --git a/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c b/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c index 4659053ecb90..c25da0223394 100644 --- a/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c +++ b/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c @@ -3207,6 +3207,7 @@ void lim_process_switch_channel_rsp(tpAniSirGlobal pMac, void *body) * the policy manager connection table needs to be updated. */ cds_update_connection_info(psessionEntry->smeSessionId); + cds_set_do_hw_mode_change_flag(true); } break; default: -- cgit v1.2.3