wlan: Add support to send ECSA IE in beacons in SAP/GO

Adds support for ECSA and CSA IE in beacons in SAP/GO.
Channel change will be initiated by IOCTL.

Change-Id: I8d4b9161015c03ed58648ca203be7d29e6c0975e
CRs-Fixed: 2143138
diff --git a/CORE/MAC/src/pe/sch/schBeaconGen.c b/CORE/MAC/src/pe/sch/schBeaconGen.c
index 15438a7..19553ad 100644
--- a/CORE/MAC/src/pe/sch/schBeaconGen.c
+++ b/CORE/MAC/src/pe/sch/schBeaconGen.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012-2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved.
  *
  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  *
@@ -377,6 +377,18 @@
     }
 #endif
 
+    if (LIM_IS_AP_ROLE(psessionEntry) && psessionEntry->include_ecsa_ie) {
+       populate_dot11f_ext_chann_switch_ann(pMac, &pBcn2->ext_chan_switch_ann,
+                                              psessionEntry);
+       if (psessionEntry->lim11hEnable) {
+           PopulateDot11fChanSwitchAnn(pMac,
+                                       &pBcn2->ChanSwitchAnn, psessionEntry);
+           if (psessionEntry->include_wide_ch_bw_ie)
+               PopulateDot11fWiderBWChanSwitchAnn(pMac,
+                                &pBcn2->WiderBWChanSwitchAnn, psessionEntry);
+       }
+    }
+
     PopulateDot11fExtSuppRates( pMac, POPULATE_DOT11F_RATES_OPERATIONAL,
                                 &pBcn2->ExtSuppRates, psessionEntry );
  
@@ -463,7 +475,6 @@
         }
 
     }
-
     nStatus = dot11fPackBeacon2( pMac, pBcn2,
                                  pMac->sch.schObject.gSchBeaconFrameEnd,
                                  SCH_MAX_BEACON_SIZE, &nBytes );
@@ -591,13 +602,28 @@
                      sizeof(beacon2->PowerConstraints));
 
     }
+
+    if (beacon2->ext_chan_switch_ann.present) {
+        SetProbeRspIeBitmap(DefProbeRspIeBitmap,
+                            SIR_MAC_EXT_CHNL_SWITCH_ANN_EID);
+        vos_mem_copy((void *)&prb_rsp->ext_chan_switch_ann,
+                     (void *)&beacon2->ext_chan_switch_ann,
+                     sizeof(beacon2->ext_chan_switch_ann));
+    }
     /* Channel Switch Annoouncement SIR_MAC_CHNL_SWITCH_ANN_EID */
     if(beacon2->ChanSwitchAnn.present)
     {
         SetProbeRspIeBitmap(DefProbeRspIeBitmap,SIR_MAC_CHNL_SWITCH_ANN_EID);
         vos_mem_copy((void *)&prb_rsp->ChanSwitchAnn, (void *)&beacon2->ChanSwitchAnn,
                      sizeof(beacon2->ChanSwitchAnn));
-
+       if (beacon2->WiderBWChanSwitchAnn.present)
+       {
+          SetProbeRspIeBitmap(DefProbeRspIeBitmap,
+                              SIR_MAC_WIDER_BW_CHANNEL_SWITCH_ANN);
+          vos_mem_copy((void *)&prb_rsp->WiderBWChanSwitchAnn,
+                     (void *)&beacon2->WiderBWChanSwitchAnn,
+                     sizeof(beacon2->WiderBWChanSwitchAnn));
+       }
     }
     /* ERP information */
     if(beacon2->ERPInfo.present)