wlan: Send ECSA action frame every beacon interval till switch count is 0

STA might not recieve ECSA action frame if its in sleep mode and
might miss the channel change.

So send ECSA action frame every beacon interval till switch count
is 0.

Change-Id: Ic9577f54ed1e781d0ed704dd6d3e3fa6f1382673
CRs-fixed: 2162432
diff --git a/CORE/MAC/src/pe/lim/limProcessMlmReqMessages.c b/CORE/MAC/src/pe/lim/limProcessMlmReqMessages.c
index 63952b6..6af7036 100644
--- a/CORE/MAC/src/pe/lim/limProcessMlmReqMessages.c
+++ b/CORE/MAC/src/pe/lim/limProcessMlmReqMessages.c
@@ -3543,6 +3543,8 @@
      */
     if (session->gLimChannelSwitch.switchCount > 0) {
         session->gLimChannelSwitch.switchCount--;
+        lim_send_chan_switch_action_frame(mac_ctx,
+                 session->gLimChannelSwitch.primaryChannel, session);
         mac_ctx->lim.limTimers.g_lim_ap_ecsa_timer.sessionId =
                                              session->peSessionId;
         limDeactivateAndChangeTimer(mac_ctx, eLIM_AP_ECSA_TIMER);
diff --git a/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c b/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c
index 42e2c25..e28e048 100644
--- a/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c
+++ b/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c
@@ -5629,16 +5629,7 @@
       limLog(pMac, LOGE, FL("sme_req->callback is null"));
 }
 
-/**
- * lim_send_chan_switch_action_frame() - send channel switch action frame to all
- * connected peers
- * @mac_ctx: Pointer to Global MAC structure
- * @new_channel: new channel
- * @session_entry: ap session
- *
- * Return: None
- */
-static void lim_send_chan_switch_action_frame(tpAniSirGlobal mac_ctx,
+void lim_send_chan_switch_action_frame(tpAniSirGlobal mac_ctx,
      uint16_t new_channel, tpPESession session_entry)
 {
    uint16_t op_class;
diff --git a/CORE/MAC/src/pe/lim/limTypes.h b/CORE/MAC/src/pe/lim/limTypes.h
index 485fd7b..adbc842 100644
--- a/CORE/MAC/src/pe/lim/limTypes.h
+++ b/CORE/MAC/src/pe/lim/limTypes.h
@@ -1133,6 +1133,18 @@
 
 tSirRetStatus lim_process_sme_del_ba_ses_req(tpAniSirGlobal pMac,
                                              tANI_U32 *pMsgBuf);
+/**
+ * lim_send_chan_switch_action_frame() - send channel switch action frame to all
+ * connected peers
+ * @mac_ctx: Pointer to Global MAC structure
+ * @new_channel: new channel
+ * @session_entry: ap session
+ *
+ * Return: None
+ */
+void lim_send_chan_switch_action_frame(tpAniSirGlobal mac_ctx,
+     uint16_t new_channel, tpPESession session_entry);
+
 
 #endif /* __LIM_TYPES_H */