summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKrunal Soni <ksoni@codeaurora.org>2016-07-28 22:11:29 -0700
committerqcabuildsw <qcabuildsw@localhost>2017-03-02 13:39:56 -0800
commitf819e9b09847d51006fc5e95db070bb2cb95703a (patch)
tree8bf220a6ddd10c430be495d2b1c64889e820f890
parent6b71908a37f140e66d1092397470687fcd24978a (diff)
qcacld-3.0: Trigger SIR_HAL_ROAM_INVOKE when STA receives CSA/ECSA
If STA receives channel switch announcement or extended channel switch announcement to move channel from 2G to 5G or 5G to 2G then trigger SIR_HAL_ROAM_INVOKE to tell firmware to do self reassociation in order for firmware to take care of switching the hardware mode. Change-Id: Iad3c39c000b6ccfad5752dfbc3db392e517cc5eb CRs-Fixed: 2014103
-rw-r--r--core/mac/src/pe/lim/lim_utils.c148
1 files changed, 115 insertions, 33 deletions
diff --git a/core/mac/src/pe/lim/lim_utils.c b/core/mac/src/pe/lim/lim_utils.c
index af4a045361cb..fe16565f0f5e 100644
--- a/core/mac/src/pe/lim/lim_utils.c
+++ b/core/mac/src/pe/lim/lim_utils.c
@@ -1986,6 +1986,120 @@ lim_decide_sta_protection(tpAniSirGlobal mac_ctx,
}
}
+#ifdef WLAN_FEATURE_ROAM_OFFLOAD
+static void lim_trigger_channel_switch_through_roaming(uint32_t sme_sessionid,
+ tSirMacAddr bssid, uint8_t channel)
+{
+ struct wma_roam_invoke_cmd *fastreassoc;
+ cds_msg_t msg = {0};
+
+ fastreassoc = qdf_mem_malloc(sizeof(struct wma_roam_invoke_cmd));
+ if (NULL == fastreassoc) {
+ hdd_err("qdf_mem_malloc failed for fastreassoc");
+ return;
+ }
+ fastreassoc->vdev_id = sme_sessionid;
+ fastreassoc->channel = channel;
+ fastreassoc->bssid[0] = bssid[0];
+ fastreassoc->bssid[1] = bssid[1];
+ fastreassoc->bssid[2] = bssid[2];
+ fastreassoc->bssid[3] = bssid[3];
+ fastreassoc->bssid[4] = bssid[4];
+ fastreassoc->bssid[5] = bssid[5];
+
+ msg.type = SIR_HAL_ROAM_INVOKE;
+ msg.reserved = 0;
+ msg.bodyptr = fastreassoc;
+ if (QDF_STATUS_SUCCESS != cds_mq_post_message(QDF_MODULE_ID_WMA,
+ &msg)) {
+ qdf_mem_free(fastreassoc);
+ hdd_err("Not able to post ROAM_INVOKE_CMD message to WMA");
+ }
+}
+
+static void lim_csa_ecsa_handler(tpAniSirGlobal mac_ctx, tpPESession session)
+{
+ uint8_t old_channel, new_channel;
+
+ old_channel = session->currentOperChannel;
+ new_channel = session->gLimChannelSwitch.primaryChannel;
+ switch (session->gLimChannelSwitch.state) {
+ case eLIM_CHANNEL_SWITCH_PRIMARY_ONLY:
+ lim_log(mac_ctx, LOG1, FL("CHANNEL_SWITCH_PRIMARY_ONLY "));
+ if (!CDS_IS_SAME_BAND_CHANNELS(old_channel, new_channel)) {
+ lim_trigger_channel_switch_through_roaming(
+ session->smeSessionId, session->bssId,
+ session->gLimChannelSwitch.primaryChannel);
+ } else {
+ lim_switch_primary_channel(mac_ctx,
+ session->gLimChannelSwitch.primaryChannel,
+ session);
+ }
+ session->gLimChannelSwitch.state = eLIM_CHANNEL_SWITCH_IDLE;
+ break;
+ case eLIM_CHANNEL_SWITCH_PRIMARY_AND_SECONDARY:
+ lim_log(mac_ctx, LOG1,
+ FL("CHANNEL_SWITCH_PRIMARY_AND_SECONDARY"));
+ if (!CDS_IS_SAME_BAND_CHANNELS(old_channel, new_channel)) {
+ lim_trigger_channel_switch_through_roaming(
+ session->smeSessionId, session->bssId,
+ session->gLimChannelSwitch.primaryChannel);
+ } else {
+ lim_switch_primary_secondary_channel(mac_ctx, session,
+ session->gLimChannelSwitch.primaryChannel,
+ session->gLimChannelSwitch.ch_center_freq_seg0,
+ session->gLimChannelSwitch.ch_center_freq_seg1,
+ session->gLimChannelSwitch.ch_width);
+ }
+ session->gLimChannelSwitch.state = eLIM_CHANNEL_SWITCH_IDLE;
+ break;
+ case eLIM_CHANNEL_SWITCH_IDLE:
+ default:
+ lim_log(mac_ctx, LOGE, FL("incorrect state "));
+ if (lim_restore_pre_channel_switch_state(mac_ctx, session) !=
+ eSIR_SUCCESS)
+ lim_log(mac_ctx, LOGP,
+ FL("Can't restore state, reset the system"));
+ return;
+ }
+}
+#else
+static void lim_csa_ecsa_handler(tpAniSirGlobal mac_ctx, tpPESession session)
+{
+ uint8_t old_channel, new_channel;
+
+ old_channel = session->currentOperChannel;
+ new_channel = session->gLimChannelSwitch.primaryChannel;
+ switch (session->gLimChannelSwitch.state) {
+ case eLIM_CHANNEL_SWITCH_PRIMARY_ONLY:
+ lim_log(mac_ctx, LOG1, FL("CHANNEL_SWITCH_PRIMARY_ONLY "));
+ lim_switch_primary_channel(mac_ctx,
+ session->gLimChannelSwitch.primaryChannel,
+ session);
+ session->gLimChannelSwitch.state = eLIM_CHANNEL_SWITCH_IDLE;
+ break;
+ case eLIM_CHANNEL_SWITCH_PRIMARY_AND_SECONDARY:
+ lim_log(mac_ctx, LOG1,
+ FL("CHANNEL_SWITCH_PRIMARY_AND_SECONDARY"));
+ lim_switch_primary_secondary_channel(mac_ctx, session,
+ session->gLimChannelSwitch.primaryChannel,
+ session->gLimChannelSwitch.ch_center_freq_seg0,
+ session->gLimChannelSwitch.ch_center_freq_seg1,
+ session->gLimChannelSwitch.ch_width);
+ session->gLimChannelSwitch.state = eLIM_CHANNEL_SWITCH_IDLE;
+ break;
+ case eLIM_CHANNEL_SWITCH_IDLE:
+ default:
+ lim_log(mac_ctx, LOGE, FL("incorrect state "));
+ if (lim_restore_pre_channel_switch_state(mac_ctx, session) !=
+ eSIR_SUCCESS)
+ lim_log(mac_ctx, LOGP,
+ FL("Can't restore state, reset the system"));
+ return;
+ }
+}
+#endif
+
/**
* lim_process_channel_switch_timeout()
*
@@ -2069,39 +2183,7 @@ void lim_process_channel_switch_timeout(tpAniSirGlobal pMac)
false);
pMac->lim.dfschannelList.timeStamp[psessionEntry->currentOperChannel] =
0;
- switch (psessionEntry->gLimChannelSwitch.state) {
- case eLIM_CHANNEL_SWITCH_PRIMARY_ONLY:
- PELOGW(lim_log(pMac, LOGW, FL("CHANNEL_SWITCH_PRIMARY_ONLY "));)
- lim_switch_primary_channel(pMac,
- psessionEntry->gLimChannelSwitch.
- primaryChannel, psessionEntry);
- psessionEntry->gLimChannelSwitch.state =
- eLIM_CHANNEL_SWITCH_IDLE;
- break;
- case eLIM_CHANNEL_SWITCH_PRIMARY_AND_SECONDARY:
- PELOGW(lim_log
- (pMac, LOGW, FL("CHANNEL_SWITCH_PRIMARY_AND_SECONDARY"));
- )
- lim_switch_primary_secondary_channel(pMac, psessionEntry,
- psessionEntry->gLimChannelSwitch.primaryChannel,
- psessionEntry->gLimChannelSwitch.ch_center_freq_seg0,
- psessionEntry->gLimChannelSwitch.ch_center_freq_seg1,
- psessionEntry->gLimChannelSwitch.ch_width);
- psessionEntry->gLimChannelSwitch.state =
- eLIM_CHANNEL_SWITCH_IDLE;
- break;
-
- case eLIM_CHANNEL_SWITCH_IDLE:
- default:
- PELOGE(lim_log(pMac, LOGE, FL("incorrect state "));)
- if (lim_restore_pre_channel_switch_state(pMac, psessionEntry) !=
- eSIR_SUCCESS) {
- lim_log(pMac, LOGP,
- FL
- ("Could not restore pre-channelSwitch (11h) state, resetting the system"));
- }
- return; /* Please note, this is 'return' and not 'break' */
- }
+ lim_csa_ecsa_handler(pMac, psessionEntry);
}
/**