wlan: mac: remove obsolete Product Type featurization

The current code supports having Station Mode, P2P Mode, and AP Mode
available in one driver.  But this code has evolved over time from a
code base which initially only supported having separate Station Mode
and AP Mode drivers, with conditional compilation used to create the
two versions.  Since this conditional compilation is no longer
necessary, remove it.

CRs-fixed: 452041
Change-Id: Ie4e8d094318dd9301b21f555eee7f4909a700451
diff --git a/CORE/MAC/inc/aniGlobal.h b/CORE/MAC/inc/aniGlobal.h
index 12e710b..f2e5dcb 100644
--- a/CORE/MAC/inc/aniGlobal.h
+++ b/CORE/MAC/inc/aniGlobal.h
@@ -79,9 +79,7 @@
 
 #include "wlan_qct_hal.h"
 
-#ifdef ANI_PRODUCT_TYPE_CLIENT
 #include "pmc.h"
-#endif
 
 #include "csrApi.h"
 #ifdef WLAN_FEATURE_VOWIFI_11R
@@ -189,10 +187,8 @@
     //DURING limInitialize DONOT ZERO THEM OUT.
 
 //STA SPECIFIC TIMERS
-#if defined(ANI_PRODUCT_TYPE_CLIENT) || defined(ANI_AP_CLIENT_SDK)
     // Periodic background scan timer
     TX_TIMER   gLimBackgroundScanTimer;
-#endif
 
     TX_TIMER    gLimPreAuthClnupTimer;
     //TX_TIMER    gLimAuthResponseTimer[HAL_NUM_STA];
@@ -342,7 +338,6 @@
     tLimScanResultNode
            *gLimCachedScanHashTable[LIM_MAX_NUM_OF_SCAN_RESULTS];
 
-#if defined(ANI_PRODUCT_TYPE_CLIENT) || defined(ANI_AP_CLIENT_SDK)
     /// Place holder for current channel ID
     /// being scanned during background scanning
     tANI_U32   gLimBackgroundScanChannelId;
@@ -353,7 +348,6 @@
     tANI_U16    gLimRestoreCBNumScanInterval;
     tANI_U16    gLimRestoreCBCount;
     tSirMacAddr gLimLegacyBssidList[MAX_NUM_LEGACY_BSSID_PER_CHANNEL];
-#endif
 
     //
     // If this flag is 1,
@@ -368,9 +362,6 @@
     //
     tANI_U32 gLimTriggerBackgroundScanDuringQuietBss;
 
-#ifdef ANI_AP_SDK
-    tLimScanDurationConvert gLimScanDurationConvert; /* Used to store converted scan duration values in TU and TICKS */
-#endif /* ANI_AP_SDK */
 
 #ifdef WLAN_FEATURE_P2P
     // This variable store the total duration to do scan
@@ -389,43 +380,10 @@
     // Place holder for StartBssReq message
     // received by SME state machine
 
-#if defined(ANI_PRODUCT_TYPE_AP)
-    // Place holder for Neighbor BSS list received in
-    // SME_JOIN/REASSOC_REQ messages
-    tSirMultipleNeighborBssInfo gLimNeighborBssList;
-#endif
-  tANI_U8             gLimCurrentBssUapsd;
+    tANI_U8             gLimCurrentBssUapsd;
 
-
-/* These global varibales are now moved to session Table in order to support BT-AMP oct 9th review  */
-#if 0
-    // Place holder for BSS description that we're
-    // currently joined with
-    tSirMacAddr         gLimCurrentBssId;
-    tSirMacChanNum      gLimCurrentChannelId;
-    tSirMacSSid         gLimCurrentSSID;
-    tANI_U16            gLimCurrentBssCaps;
-    
-    // QosCaps is a bit map of various qos capabilities - see defn above
-    tANI_U8             gLimCurrentBssQosCaps;
-    tANI_U16            gLimCurrentBssPropCap;
-    tANI_U8             gLimSentCapsChangeNtf;
-    tANI_U32            gLimCurrentTitanHtCaps;
-
-    // Place holder for BSS description that
-    // we're currently Reassociating
-    tSirMacAddr           gLimReassocBssId;
-    tSirMacChanNum        gLimReassocChannelId;
-    tSirMacSSid           gLimReassocSSID;
-    tANI_U16              gLimReassocBssCaps;
-    tANI_U8               gLimReassocBssQosCaps;
-    tANI_U16              gLimReassocBssPropCap;
-    tANI_U32              gLimReassocTitanHtCaps;
-
-    tANI_U8                 gLimBssIdx;  // BSSIdx is made session speicific 
-#endif
-
-    tANI_U8     gLimForceNoPropIE; /* This is used for testing sta legacy bss detect feature */
+    /* This is used for testing sta legacy bss detect feature */
+    tANI_U8     gLimForceNoPropIE;
 
     //
     // Store the BSS Index returned by HAL during
@@ -627,17 +585,6 @@
     //////////////////////////////////////////     STATES RELATED END ///////////////////////////////////////////
 
     //////////////////////////////////////////     MISC RELATED START ///////////////////////////////////////////
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED)
-    // Place holder for alternate radio list
-    tSirMultipleAlternateRadioInfo gLimAlternateRadioList;
-#endif
-
-    // Place holder for Measurement Req/Rsp/Ind related info
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED) && defined(ANI_PRODUCT_TYPE_AP)
-    tpSirSmeMeasurementReq    gpLimMeasReq;
-    tLimMeasParams            gLimMeasParams;
-    tpLimMeasData             gpLimMeasData;
-#endif
 
     // WDS info
     tANI_U32            gLimNumWdsInfoInd;
@@ -1083,10 +1030,8 @@
 #ifdef FEATURE_WLAN_TDLS_INTERNAL
     tCsrTdlsCtxStruct tdlsCtx ;
 #endif
-#ifdef ANI_PRODUCT_TYPE_CLIENT
     tPmcInfo     pmc;
     tSmeBtcInfo  btc;
-#endif
 
     tCcm ccm;
 
diff --git a/CORE/MAC/inc/sirApi.h b/CORE/MAC/inc/sirApi.h
index 8c05ce6..a9b1600 100644
--- a/CORE/MAC/inc/sirApi.h
+++ b/CORE/MAC/inc/sirApi.h
@@ -502,9 +502,7 @@
     tANI_U16     transcationId;  //Added for BT-AMP Support
     tSirMacAddr  bssId;          //Added For BT-AMP Support   
     tANI_U32   roamingAtPolaris;
-#if (WNI_POLARIS_FW_PRODUCT == WLAN_STA) || defined(ANI_AP_CLIENT_SDK)
     tANI_U32   sendNewBssInd;
-#endif
 } tSirSmeStartReq, *tpSirSmeStartReq;
 
 /// Definition for indicating all modules ready on STA
@@ -524,18 +522,6 @@
     tANI_U16             transactionId;     
 } tSirSmeStartRsp, *tpSirSmeStartRsp;
 
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED) && (WNI_POLARIS_FW_PRODUCT == AP)
-/**
- * Trigger Type
- */
-typedef enum {
-    // During Initialization and NM triggers only
-    eSIR_TRIGGER_INIT_NM,
-
-    // During Initialization, NM triggers and Periodic evaluation
-    eSIR_TRIGGER_INIT_NM_PERIODIC
-}tSirDfsTrigType;
-#endif
 
 /// Definition for Load structure
 typedef struct sSirLoad
@@ -640,11 +626,6 @@
     tSirMacSSid             ssId;
     tANI_U8                 channelId;
     ePhyChanBondState       cbMode;
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED) && (WNI_POLARIS_FW_PRODUCT == AP)
-    tSirAlternateRadioList  alternateRadioList;
-    tANI_S8                 powerLevel;
-    tSirWdsInfo             wdsInfo;
-#endif
     
     tANI_U8                 privacy;
     tANI_U8                 apUapsdEnable;
@@ -667,10 +648,6 @@
     tSirMacRateSet          operationalRateSet;// Has 11a or 11b rates
     tSirMacRateSet          extendedRateSet;    // Has 11g rates
 
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED) && (WNI_POLARIS_FW_PRODUCT == AP)
-    tANI_U8                 numSSID;
-    tSirMacSSid             ssIdList[ANI_MAX_NUM_OF_SSIDS];
-#endif
 } tSirSmeStartBssReq, *tpSirSmeStartBssReq;
 
 #define GET_IE_LEN_IN_BSS(lenInBss) ( lenInBss + sizeof(lenInBss) - \
@@ -739,45 +716,6 @@
     tSirBssDescription  bssDescription;//Peer BSS description
 } tSirSmeStartBssRsp, *tpSirSmeStartBssRsp;
 
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED) && (WNI_POLARIS_FW_PRODUCT == AP)
-typedef struct sSirMeasControl
-{
-    // Periodic Measurements enabled flag
-    tAniBool             periodicMeasEnabled;
-    // Indicates whether to involve STAs in measurements or not
-    tAniBool             involveSTAs;
-    // Basic or enhanced measurement metrics
-    // 0 - for basic, 1 - for enhanced
-    tANI_U8                   metricsType;
-    // Indicates active or passive scanning
-    tSirScanType         scanType;
-    // Following indicates how often measurements
-    // on each channel are made for long-scan-duration
-    tANI_U8                   longChannelScanPeriodicity;
-    //
-    // Channel Bonding plus 11H related scan control
-    // 0 - CB and/or 11H is disabled
-    // 1 - CB and 11H is enabled
-    //
-    tANI_BOOLEAN    cb11hEnabled;
-} tSirMeasControl, *tpSirMeasControl;
-
-typedef struct sSirMeasDuration
-{
-    // Following indicates time duration over which
-    // all channels in the channelList to be measured once
-    tANI_U32                  shortTermPeriod;
-    // Following indicates time duration over which
-    // cached DFS measurements are averaged
-    tANI_U32                  averagingPeriod;
-    // Following indicates time duration for making
-    // DFS measurements on each channel
-    tANI_U32                  shortChannelScanDuration;
-    // Following indicates time duration for making
-    // DFS measurements on each channel for long term measurements
-    tANI_U32                  longChannelScanDuration;
-} tSirMeasDuration, *tpSirMeasDuration;
-#endif
 
 typedef struct sSirChannelList
 {
@@ -798,152 +736,6 @@
 } tCCXTspecInfo;
 #endif
 
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED)
-/// Definition for Neighbor BSS info
-typedef struct sSirNeighborBssInfo
-{
-    tSirMacAddr             bssId;
-    tANI_U8                 channelId;
-    tAniBool                wniIndicator;
-    tSirBssType             bssType;
-    tANI_U8                 sinr;
-    tANI_S8                 rssi;
-    tSirLoad                load;
-    tAniSSID                ssId;
-    tAniApName              apName;
-    tSirRSNie               rsnIE;
-#if 0    
-    tDot11fIEHTCaps         HTCaps;
-    tDot11fIEHTInfo         HTInfo;
-#endif
-    tSirNwType              nwType;             // Indicates 11a/b/g
-    tANI_U16                capabilityInfo;
-    tSirMacRateSet          operationalRateSet; // Has 11a or 11b rates
-    tSirMacRateSet          extendedRateSet;    // Has 11g rates
-    tANI_U16                beaconInterval;
-    tANI_U8                 dtimPeriod;
-    tANI_U8                 HTCapsPresent;
-    tANI_U8                 HTInfoPresent;
-    tANI_U8                 wmeInfoPresent;
-    tANI_U8                 wmeEdcaPresent;
-    tANI_U8                 wsmCapablePresent;
-    tANI_U8                 hcfEnabled;
-    tANI_U16                propIECapability;
-    tANI_U32                localPowerConstraints;
-    tANI_S32                aggrRssi;
-    tANI_U32                dataCount;
-    tANI_U32                totalPackets;
-} tSirNeighborBssInfo, *tpSirNeighborBssInfo;
-
-
-/// Definition for Neighbor BSS with WDS info
-typedef struct sSirNeighborBssWdsInfo
-{
-    tSirNeighborBssInfo    neighborBssInfo;
-    tSirWdsInfo            wdsInfo;
-} tSirNeighborBssWdsInfo, *tpSirNeighborBssWdsInfo;
-
-/// Definition for Neighbor BSS list
-typedef struct sSirNeighborBssList
-{
-    tANI_U32                  numBss;
-    tSirNeighborBssInfo  bssList[1];
-} tSirNeighborBssList, *tpSirNeighborBssList;
-
-/// Definition for Neighbor BSS list with WDS info
-typedef struct sSirNeighborBssWdsList
-{
-    tANI_U32                     numBssWds;
-    tSirNeighborBssWdsInfo  bssWdsList[1];
-} tSirNeighborBssWdsList, *tpSirNeighborBssWdsList;
-
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-/// Definition for kick starting measurements
-/// ---> MAC
-typedef struct sSirSmeMeasurementReq
-{
-    tANI_U16                  messageType; // eWNI_SME_MEASUREMENT_REQ
-    tANI_U16                  length;
-    tSirMeasControl      measControl;
-    tSirMeasDuration     measDuration;
-    // This indicates how often SME_MEASUREMENT_IND message
-    // is sent to host
-    tANI_U32                  measIndPeriod;
-    // This channel list will have current channel also
-    tSirChannelList      channelList;
-} tSirSmeMeasurementReq, *tpSirSmeMeasurementReq;
-
-/// Definition for response message to previously
-/// issued Measurement request
-/// MAC --->
-typedef struct sSirSmeMeasurementRsp
-{
-    tANI_U16                    messageType; // eWNI_SME_MEASUREMENT_RSP
-    tANI_U16                    length;
-    tSirResultCodes        statusCode;
-    tANI_U16            transactionId;     // Transaction ID for cmd
-} tSirSmeMeasurementRsp, *tpSirSmeMeasurementRsp;
-
-/// Definition for Measurement Matrix info
-// NOTE: This should include current channel measurements
-typedef struct sSirMeasMatrixInfo
-{
-    tANI_U8          channelNumber;
-    tANI_S8          compositeRssi;
-    tANI_S32         aggrRssi;     // Due to all packets in this channel
-    tANI_U32         totalPackets;
-} tSirMeasMatrixInfo, *tpSirMeasMatrixInfo;
-
-/// Definition for Measurement Matrix List
-typedef struct sSirMeasMatrixList
-{
-    tANI_U8                  numChannels;
-    tSirMeasMatrixInfo  measMatrixList[1];
-} tSirMeasMatrixList, *tpSirMeasMatrixList;
-/// Definition for Measurement indication
-/// MAC --->
-/// Note : This is only sent when there was prior
-///        SME_MEASUREMENT_REQ received by MAC
-typedef struct sSirSmeMeasurementInd
-{
-    tANI_U16                    messageType; // eWNI_SME_MEASUREMENT_IND
-    tANI_U16                    length;
-    tANI_U32               duration;
-    tSirLoad               currentLoad; // on this AP radio
-    tSirMeasMatrixList     measMatrixList;
-    tSirNeighborBssWdsList neighborBssWdsList;
-} tSirSmeMeasurementInd, *tpSirSmeMeasurementInd;
-
-/// Definition for Backhaul Link status change Indication
-/// MAC --->
-typedef struct sSirSmeWdsInfoInd
-{
-    tANI_U16                messageType; // eWNI_SME_WDS_INFO_IND
-    tANI_U16                length;
-    tSirWdsInfo        wdsInfo;
-} tSirSmeWdsInfoInd, *tpSirSmeWdsInfoInd;
-
-/// Definition for Backhaul Link Info Set Request
-/// ---> MAC
-typedef struct sSirSmeSetWdsInfoReq
-{
-    tANI_U16                messageType; // eWNI_SME_SET_WDS_INFO_REQ
-    tANI_U16                length;
-    tANI_U16                transactionId;     
-    tSirWdsInfo        wdsInfo;
-} tSirSmeSetWdsInfoReq, *tpSirSmeSetWdsInfoReq;
-
-/// Definition for Backhaul Link Lnfo Set Response
-/// MAC --->
-typedef struct sSirSmeSetWdsInfoRsp
-{
-    tANI_U16                messageType; // eWNI_SME_SET_WDS_INFO_RSP
-    tANI_U16                length;
-    tSirResultCodes    statusCode;
-    tANI_U16                transactionId;     
-} tSirSmeSetWdsInfoRsp, *tpSirSmeSetWdsInfoRsp;
-#endif
-#endif
 
 /// Definition for Radar Info
 typedef struct sSirRadarInfo
@@ -1163,24 +955,7 @@
                                        //Otherwise it holds status code.
 } tSirSmeAuthRsp, *tpSirSmeAuthRsp;
 
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED)
-/// Association type
-typedef enum eSirAssocType
-{
-    eSIR_NORMAL,
-    eSIR_TRANSFERRED,
-    eSIR_DONOT_USE_ASSOC_TYPE = SIR_MAX_ENUM_SIZE
-} tSirAssocType;
-#endif
 
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED) 
-typedef enum eSirBpIndicatorType
-{
-    eSIR_WIRELESS_BP,
-    eSIR_WIRED_BP
-} tSirBpIndicatorType;
-
-#endif
 
 /// Definition for Join/Reassoc info - Reshmi: need to check if this is a def which moved from elsehwere.
 typedef struct sJoinReassocInfo
@@ -1219,11 +994,6 @@
      */
     tANI_U8                 uapsdPerAcBitmask;
 
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED)
-    tSirAssocType       assocType;              // Indicates whether STA is
-                                                // sending (Re) Association
-                                                // due to load balance or not
-#endif
     tSirMacRateSet      operationalRateSet;// Has 11a or 11b rates
     tSirMacRateSet      extendedRateSet;    // Has 11g rates
     tSirRSNie           rsnIE;                  // RSN IE to be sent in
@@ -1264,19 +1034,11 @@
     tANI_U8             txBFCsnValue;
 #endif
 
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED) && (WNI_POLARIS_FW_PRODUCT == AP)
-    tAniBool            bpIndicator;
-    tSirBpIndicatorType bpType;
-    tSirNeighborBssList neighborBssList;        // TBD Move this outside 'AP'
-                                                // flag
-#endif
     tAniTitanCBNeighborInfo cbNeighbors;
     tAniBool            spectrumMgtIndicator;
     tSirMacPowerCapInfo powerCap;
     tSirSupChnl         supportedChannels;
-//#if (WNI_POLARIS_FW_PRODUCT == WLAN_STA )
     tSirBssDescription  bssDescription;
-//#endif
 
 } tSirSmeJoinReq, *tpSirSmeJoinReq;
 
@@ -1289,16 +1051,7 @@
     tANI_U8                 sessionId;         // Session ID
     tANI_U16                transactionId;     // Transaction ID for cmd
     tSirResultCodes    statusCode;
-#if (WNI_POLARIS_FW_PRODUCT == WLAN_STA)
     tAniAuthType       authType;
-//    tANI_U16           staId;             // Station ID for peer
-#endif
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED)
-    // Following are needed for Roaming algorithm
-    // to 'associate' with an alternate BSS.
-    tSirMacAddr        alternateBssId;
-    tANI_U8                 alternateChannelId;
-#endif
     tANI_U16        protStatusCode; //It holds reasonCode when join fails due to deauth/disassoc frame.
                                     //Otherwise it holds status code.
     tANI_U16        aid;
@@ -1363,17 +1116,6 @@
     tSirRSNie            rsnIE;// RSN IE received from peer
     tSirAddie            addIE;// Additional IE received from peer, which possibly include WSC IE and/or P2P IE
 
-#if defined (ANI_PRODUCT_TYPE_AP)
-    tANI_U16                  seqNum;
-    tAniBool             wniIndicator;
-    tAniBool             bpIndicator;
-    tSirBpIndicatorType  bpType;
-    tSirAssocType        assocType; // Indicates whether STA is LB'ed or not
-    tSirLoad             load; // Current load on the radio for LB
-    tSirNeighborBssList  neighborList; // List received from STA
-    tANI_U16                  capabilityInfo; // STA capability
-    tSirNwType           nwType;            // Indicates 11a/b/g
-#endif
     // powerCap & supportedChannels are present only when
     // spectrumMgtIndicator flag is set
     tAniBool                spectrumMgtIndicator;
@@ -1420,17 +1162,6 @@
 
     tSirAddie           addIE;  // Additional IE received from peer
     
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED)
-    tANI_U16             seqNum;
-    tAniBool             wniIndicator;
-    tAniBool             bpIndicator;
-    tSirBpIndicatorType  bpType;
-    tSirAssocType        reassocType; // Indicates whether STA is LB'ed or not
-    tSirLoad             load; // Current load on the radio for LB
-    tSirNeighborBssList  neighborList; // List received from STA
-    tANI_U16             capabilityInfo; // STA capability
-    tSirNwType           nwType;            // Indicates 11a/b/g
-#endif
     // powerCap & supportedChannels are present only when
     // spectrumMgtIndicator flag is set
     tAniBool                spectrumMgtIndicator;
@@ -1458,22 +1189,6 @@
     tANI_U8                   alternateChannelId;
 } tSirSmeReassocCnf, *tpSirSmeReassocCnf;
 
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED) && (WNI_POLARIS_FW_PRODUCT == AP)
-typedef enum {
-    // Based on Periodic evaluation
-    eSIR_PERIODIC_EVALATION,
-
-    // Dectection of primary users such as RADARs
-    eSIR_DETECTION_OF_RADAR,
-
-    // Degradation in system performance (eg. Triggered by
-    //  increase in PER beyond a certain threshold)
-    eSIR_PERFORMANCE_DEGRADATION,
-
-    // Frequency changed due to previously issued SWITCH_CHANNEL_REQ
-    eSIR_UPPER_LAYER_TRIGGERED
-}tSirFreqChangeReason;
-#endif
 
 /// Enum definition for  Wireless medium status change codes
 typedef enum eSirSmeStatusChangeCode
@@ -1555,16 +1270,10 @@
         // none for eSIR_SME_LEAVING_BSS
         // none for eSIR_SME_IBSS_ACTIVE
         // none for eSIR_SME_IBSS_INACTIVE
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED) && (WNI_POLARIS_FW_PRODUCT == AP)
-        tSirRadarInfo          radarInfo;         // eSIR_SME_RADAR_DETECTED
-#endif
         tSirNewIbssPeerInfo     newIbssPeerInfo;  // eSIR_SME_IBSS_NEW_PEER
         tSirSmeApNewCaps        apNewCaps;        // eSIR_SME_AP_CAPS_CHANGED
         tSirBackgroundScanInfo  bkgndScanInfo;    // eSIR_SME_BACKGROUND_SCAN_FAIL
         tAniTitanCBNeighborInfo cbNeighbors;      // eSIR_SME_CB_LEGACY_BSS_FOUND_BY_STA
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED)
-        tSirNeighborBssWdsInfo  neighborWdsInfo;  // eSIR_SME_CB_LEGACY_BSS_FOUND_BY_AP
-#endif
     } statusChangeInfo;
 } tSirSmeWmStatusChangeNtf, *tpSirSmeWmStatusChangeNtf;
 
@@ -1582,12 +1291,6 @@
     tANI_U16         reasonCode;
     tANI_U8          doNotSendOverTheAir;  //This flag tells LIM whether to send the disassoc OTA or not
                                            //This will be set in while handing off from one AP to other
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-    tANI_U16         aid;
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED)
-    tANI_U16         seqNum;
-#endif
-#endif
 }
 __ani_attr_packed
 tSirSmeDisassocReq, *tpSirSmeDisassocReq;
@@ -1782,7 +1485,6 @@
     tSirMacAddr macAddr; //Mac Address of the station from which above RSSI and rate is from.
 }tAniStatSummaryStruct,*tpAniStatSummaryStruct;
 
-#if (WNI_POLARIS_FW_PRODUCT == WLAN_STA)
 //structure for stats that may be reset, like the ones in sta descriptor
 //The stats are saved into here before reset. It should be tANI_U32 aligned.
 typedef struct _sPermStaStats
@@ -1812,7 +1514,6 @@
     tANI_U32 expanPktRxCntLo;
 }tPermanentStaStats;
 
-#endif//#if (WNI_POLARIS_FW_PRODUCT == WLAN_STA)
 
 
 
@@ -1825,9 +1526,6 @@
     tANI_U16           transactionId;     // Transaction ID for cmd
     tSirResultCodes    statusCode;
     tSirMacAddr        peerMacAddr;
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-    tANI_U16           aid;
-#endif
     tAniStaStatStruct  perStaStats; // STA stats
     tANI_U16           staId;
 }
@@ -1844,9 +1542,6 @@
     tSirResultCodes     statusCode;
     tSirMacAddr         bssId;            
     tSirMacAddr         peerMacAddr;
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-    tANI_U16            aid;
-#endif
     tAniStaStatStruct  perStaStats; // STA stats
     tANI_U16            staId;
     tANI_U32            reasonCode;
@@ -1861,9 +1556,6 @@
     tSirResultCodes     statusCode;
     tSirMacAddr         bssId;            
     tSirMacAddr         peerMacAddr;
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-    tANI_U16            aid;
-#endif
 } tSirSmeDisassocCnf, *tpSirSmeDisassocCnf;
 
 /// Definition for Deauthetication request
@@ -1876,9 +1568,6 @@
     tSirMacAddr         bssId;         // AP BSSID
     tSirMacAddr         peerMacAddr;
     tANI_U16            reasonCode;
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-    tANI_U16         aid;
-#endif
 } tSirSmeDeauthReq, *tpSirSmeDeauthReq;
 
 /// Definition for Deauthetication response
@@ -1890,9 +1579,6 @@
     tANI_U16            transactionId;     // Transaction ID for cmd
     tSirResultCodes     statusCode;
     tSirMacAddr        peerMacAddr;
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-    tANI_U16                aid;
-#endif
 } tSirSmeDeauthRsp, *tpSirSmeDeauthRsp;
 
 /// Definition for Deauthetication indication from peer
@@ -1905,9 +1591,6 @@
     tSirResultCodes     statusCode;
     tSirMacAddr         bssId;// AP BSSID
     tSirMacAddr         peerMacAddr;
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-    tANI_U16            aid;
-#endif
 
     tANI_U16            staId;
     tANI_U32            reasonCode;
@@ -1922,9 +1605,6 @@
     tSirResultCodes     statusCode;
     tSirMacAddr         bssId;             // AP BSSID
     tSirMacAddr        peerMacAddr;
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-    tANI_U16                aid;
-#endif
 } tSirSmeDeauthCnf, *tpSirSmeDeauthCnf;
 
 /// Definition for stop BSS request message
@@ -1948,65 +1628,6 @@
     tANI_U16            transactionId;     // Transaction ID for cmd
 } tSirSmeStopBssRsp, *tpSirSmeStopBssRsp;
 
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED) && (WNI_POLARIS_FW_PRODUCT == AP)
-/// Definition for Channel Select request
-/// ---> MAC
-typedef struct sSirSmeSelectChannelReq
-{
-    tANI_U16                messageType; // eWNI_SME_SELECT_CHL_REQ
-    tANI_U16                length;
-    tANI_U16            transactionId;     // Transaction ID for cmd
-    tANI_U8                 channelId;
-} tSirSmeSelectChannelReq, *tpSirSmeSelectChannelReq;
-
-/// Definition for Channel Select response
-/// MAC --->
-typedef struct sSirSmeSelectChannelRsp
-{
-    tANI_U16                messageType; // eWNI_SME_SELECT_CHL_RSP
-    tANI_U16                length;
-    tSirResultCodes    statusCode;
-    tANI_U16            transactionId;     // Transaction ID for cmd
-} tSirSmeSelectChannelRsp, *tpSirSmeSelectChannelRsp;
-
-/// Definition for Channel Switch request
-/// ---> MAC
-typedef struct sSirSmeSwitchChannelReq
-{
-    // eWNI_SME_SWITCH_CHL_REQ,
-    // eWNI_SME_SWITCH_CHL_CB_PRIMARY_REQ,
-    // eWNI_SME_SWITCH_CHL_CB_SECONDARY_REQ
-    tANI_U16                messageType;
-
-    tANI_U16                length;
-    tANI_U16            transactionId;     // Transaction ID for cmd
-    tANI_U8                 channelId;
-    //
-    // The cbMode field is applicable to TITAN only.
-    // This indicates as to how the CB secondary
-    // channel will be used (if at all).
-    //
-    // In a non-CB environment, with 11H enabled,
-    // this field will be ignored
-    //
-    ePhyChanBondState    cbMode;
-
-    // dtimFactor indicates the number of DTIM
-    // Beacon before LIM switches channel
-    tANI_U32                dtimFactor;
-} tSirSmeSwitchChannelReq, *tpSirSmeSwitchChannelReq;
-
-/// Definition for Channel Switch response
-/// MAC --->
-typedef struct sSirSmeSwitchChannelRsp
-{
-    tANI_U16                messageType; // eWNI_SME_SWITCH_CHL_RSP
-    tANI_U16                length;
-    tSirResultCodes    statusCode;
-    tANI_U16            transactionId;     // Transaction ID for cmd
-} tSirSmeSwitchChannelRsp, *tpSirSmeSwitchChannelRsp;
-
-#endif
 
 
 /// Definition for Channel Switch indication for station
@@ -2027,9 +1648,6 @@
     tANI_U16                length;
     tSirResultCodes    statusCode;
     tSirMacAddr        peerMacAddr;
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-    tANI_U16                aid;
-#endif
 } tSirUlaCompleteInd, *tpSirUlaCompleteInd;
 
 /// Definition for ULA complete confirmation message
@@ -2039,9 +1657,6 @@
     tANI_U16                length;
     tSirResultCodes    statusCode;
     tSirMacAddr        peerMacAddr;
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-    tANI_U16                aid;
-#endif
 } tSirUlaCompleteCnf, *tpSirUlaCompleteCnf;
 
 /// Definition for Neighbor BSS indication
@@ -2052,12 +1667,7 @@
     tANI_U16                    messageType; // eWNI_SME_NEIGHBOR_BSS_IND
     tANI_U16                    length;
     tANI_U8                     sessionId;
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED) && (WNI_POLARIS_FW_PRODUCT == AP)
-    tSirNeighborBssInfo    neighborInfo;
-    tSirWdsInfo            wdsInfo;
-#else
     tSirBssDescription     bssDescription[1];
-#endif
 } tSirSmeNeighborBssInd, *tpSirSmeNeighborBssInd;
 
 /// Definition for MIC failure indication
@@ -2083,9 +1693,6 @@
     tANI_U16           transactionId; //Transaction ID for cmd
     tSirMacAddr        peerMacAddr;
     tSirMacAddr        bssId;      // BSSID
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-    tANI_U16                aid;
-#endif
     // TBD Following QOS fields to be uncommented
     //tAniBool           qosInfoPresent;
     //tSirQos            qos;
@@ -2102,9 +1709,6 @@
     tANI_U16            transactionId;     // Transaction ID for cmd
     tSirResultCodes     statusCode;
     tSirMacAddr             peerMacAddr;
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-    tANI_U16                aid;
-#endif
 } tSirSmeSetContextRsp, *tpSirSmeSetContextRsp;
 
 /// Definition for Remove Key Context request
@@ -2117,9 +1721,6 @@
     tANI_U16            transactionId;     // Transaction ID for cmd
     tSirMacAddr         bssId;             // BSSID
     tSirMacAddr             peerMacAddr;
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-    tANI_U16                aid;
-#endif
     tANI_U8    edType;
     tANI_U8    wepType;
     tANI_U8    keyId;
@@ -2136,9 +1737,6 @@
     tANI_U16            transactionId;     // Transaction ID for cmd
     tSirResultCodes     statusCode;
     tSirMacAddr             peerMacAddr;
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-    tANI_U16                aid;
-#endif
 } tSirSmeRemoveKeyRsp, *tpSirSmeRemoveKeyRsp;
 
 /// Definition for Set Power request
@@ -2161,29 +1759,6 @@
     tANI_U16            transactionId;     // Transaction ID for cmd
 } tSirSmeSetPowerRsp, *tpSirSmeSetPowerRsp;
 
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED) && (WNI_POLARIS_FW_PRODUCT == AP)
-/// Definition for Client Side Load Balancing request
-/// ---> MAC
-typedef struct sSirSmeSetClientLoadBalanceReq
-{
-    tANI_U16                messageType; // eWNI_SME_CLIENT_LOAD_BALANCE_REQ
-    tANI_U16                length;
-    tANI_U16            transactionId;     // Transaction ID for cmd
-    tSirMacAddr             alternateBssId;
-    tANI_U8                 alternateChannelId;
-    tANI_U8                 numberStas;
-} tSirSmeClientLoadBalanceReq, *tpSirSmeClientLoadBalanceReq;
-
-/// Definition for Client Side Load Balancing response
-/// MAC --->
-typedef struct sSirSmeSetClientLoadBalanceRsp
-{
-    tANI_U16                messageType; // eWNI_SME_CLIENT_LOAD_BALANCE_RSP
-    tANI_U16                length;
-    tANI_U16            transactionId;     // Transaction ID for cmd
-    tSirResultCodes         statusCode;
-} tSirSmeClientLoadBalanceRsp, *tpSirSmeClientLoadBalanceRsp;
-#endif
 
 /// Definition for Link Test Start response
 /// MAC --->
@@ -2193,9 +1768,6 @@
     tANI_U16                length;
     tSirMacAddr        peerMacAddr;
     tSirResultCodes    statusCode;
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-    tANI_U16                aid;
-#endif
 } tSirSmeLinkTestStartRsp, *tpSirSmeLinkTestStartRsp;
 
 /// Definition for Link Test Stop response
@@ -2206,9 +1778,6 @@
     tANI_U16                length;
     tSirMacAddr        peerMacAddr;
     tSirResultCodes    statusCode;
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-    tANI_U16                aid;
-#endif
 } tSirSmeLinkTestStopRsp, *tpSirSmeLinkTestStopRsp;
 
 /// Definition for kick starting DFS measurements
diff --git a/CORE/MAC/inc/sirMacPropExts.h b/CORE/MAC/inc/sirMacPropExts.h
index 009fe92..cc19cf6 100644
--- a/CORE/MAC/inc/sirMacPropExts.h
+++ b/CORE/MAC/inc/sirMacPropExts.h
@@ -65,12 +65,6 @@
 // Types definitions used within proprietary IE
 #define SIR_MAC_PROP_EXT_RATES_TYPE     0
 #define SIR_MAC_PROP_AP_NAME_TYPE       1
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED)
-#define SIR_MAC_PROP_HCF_TYPE           2
-#define SIR_MAC_PROP_WDS_TYPE           3
-#define SIR_MAC_PROP_BP_IND_TYPE        4
-#define SIR_MAC_PROP_NEIGHBOR_BSS_TYPE  5
-#endif
 #define SIR_MAC_PROP_LOAD_INFO_TYPE     6
 #define SIR_MAC_PROP_ASSOC_TYPE         7
 #define SIR_MAC_PROP_LOAD_BALANCE_TYPE  8
@@ -325,16 +319,6 @@
     tANI_U8                    triggerStaScanPresent:1;                
     tANI_U8                    rsvd:5;
 
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED)
-    tANI_U8                    hcfPresent:1;
-    tANI_U8                    wdsPresent:1;
-    tANI_U8                    neighborListPresent:1;
-    tANI_U8                    loadInfoPresent:1;
-    tANI_U8                    llsetPresent:1;
-    tANI_U8                    bpindPresent:1;
-    tANI_U8                    assocTypePresent:1;
-    tANI_U8                    rsvd1:1;
-#endif
 
     tSirMacPropRateSet    propRates;
     tAniApName            apName;           // used in beacon/probe only
@@ -346,20 +330,6 @@
     tQuietBssIEStruct     quietBss;
     tANI_U8               triggerStaScanEnable;
 
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED)
-    tANI_U8                    hcfEnabled;
-    // used in beacon/probe response only
-    tANI_U8                    wdsLength;
-    tANI_U8                    wdsData[ANI_WDS_INFO_MAX_LENGTH];
-    tSirLoad              load;
-    tSirMacPropLLSet      llSet; 
-    // used in assoc request only
-    tANI_U8                    bpIndicator;
-    tANI_U8                    bpType;
-    tANI_U8                    numBss;
-    tANI_U8                    assocType;
-    tpSirNeighborBssInfo  pBssList;
-#endif
 
 } tSirPropIEStruct, *tpSirPropIEStruct;
 
diff --git a/CORE/MAC/inc/sirMacProtDef.h b/CORE/MAC/inc/sirMacProtDef.h
index dfcb0f9..c875ab0 100644
--- a/CORE/MAC/inc/sirMacProtDef.h
+++ b/CORE/MAC/inc/sirMacProtDef.h
@@ -54,7 +54,7 @@
 
 #include "palTypes.h"
 #include "sirTypes.h"
-#include "wniCfgAp.h"
+#include "wniCfgSta.h"
 #include "aniCompiler.h"
 
 
diff --git a/CORE/MAC/src/cfg/cfgApi.c b/CORE/MAC/src/cfg/cfgApi.c
index 6f3c182..717cc36 100644
--- a/CORE/MAC/src/cfg/cfgApi.c
+++ b/CORE/MAC/src/cfg/cfgApi.c
@@ -119,7 +119,6 @@
 
 
 //---------------------------------------------------------------------
-#if (WNI_POLARIS_FW_PRODUCT != AP)
 tSirRetStatus cfgInit(tpAniSirGlobal pMac)
 {
    pMac->cfg.gCfgIBufMin  = __gCfgIBufMin;
@@ -144,7 +143,6 @@
    pMac->cfg.gCfgEntry    = NULL;
    pMac->cfg.gParamList   = NULL;
 }
-#endif
 
 // ---------------------------------------------------------------------
 /**
@@ -190,11 +188,7 @@
     index    = control & CFG_BUF_INDX_MASK;
     retVal   = eSIR_SUCCESS;
 
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-    if (index >= CFG_AP_IBUF_MAX_SIZE)
-#else
     if (index >= CFG_STA_IBUF_MAX_SIZE)
-#endif
     {
         PELOGE(cfgLog(pMac, LOGE, FL("cfg index out of bounds %d\n"), index);)
         retVal = eSIR_CFG_INVALID_ID;
@@ -316,11 +310,7 @@
     index   = control & CFG_BUF_INDX_MASK;
     retVal  = eSIR_SUCCESS;
 
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-    if (index >= CFG_AP_IBUF_MAX_SIZE)
-#else
     if (index >= CFG_STA_IBUF_MAX_SIZE)
-#endif
     {
         PELOGE(cfgLog(pMac, LOGE, FL("cfg index out of bounds %d\n"), index);)
         retVal = eSIR_CFG_INVALID_ID;
@@ -335,7 +325,7 @@
     }
     else {
         // Get integer value
-        if(index < CFG_AP_IBUF_MAX_SIZE)
+        if (index < CFG_STA_IBUF_MAX_SIZE)
             *pValue = pMac->cfg.gCfgIBuf[index];
     }
 
@@ -580,11 +570,7 @@
     index    = control & CFG_BUF_INDX_MASK;
     retVal   = eSIR_SUCCESS;
 
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-    if (index >= CFG_AP_SBUF_MAX_SIZE)
-#else
     if (index >= CFG_STA_SBUF_MAX_SIZE)
-#endif
     {
         PELOGE(cfgLog(pMac, LOGE, FL("cfg index out of bounds %d\n"), index);)
         retVal = eSIR_CFG_INVALID_ID;
@@ -660,11 +646,7 @@
     index    = control & CFG_BUF_INDX_MASK;
     retVal   = eSIR_SUCCESS;
 
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-    if (index >= CFG_AP_SBUF_MAX_SIZE)
-#else
     if (index >= CFG_STA_SBUF_MAX_SIZE)
-#endif
     {
         PELOGE(cfgLog(pMac, LOGE, FL("cfg index out of bounds %d\n"), index);)
         retVal = eSIR_CFG_INVALID_ID;
@@ -725,11 +707,7 @@
     index    = control & CFG_BUF_INDX_MASK;
     retVal   = eSIR_SUCCESS;
 
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-    if (index >= CFG_AP_SBUF_MAX_SIZE-1)
-#else
     if (index >= CFG_STA_SBUF_MAX_SIZE-1)
-#endif
     {
         PELOGE(cfgLog(pMac, LOGE, FL("cfg index out of bounds %d\n"), index);)
         retVal = eSIR_CFG_INVALID_ID;
@@ -906,28 +884,6 @@
     else
         cfgLog(pMac, LOGP, FL("can't get capability, role is UNKNOWN!!\n"));
 
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-    if( (systemRole == eLIM_AP_ROLE) )
-    {
-        // CF-pollable bit
-        if (wlan_cfgGetInt(pMac, WNI_CFG_CF_POLLABLE, &val) != eSIR_SUCCESS)
-        {
-            cfgLog(pMac, LOGP, FL("cfg get WNI_CFG_CF_POLLABLE failed\n"));
-            return eSIR_FAILURE;
-        }
-        if (val)
-            pCapInfo->cfPollable = 1;
-
-        // CF-poll request bit
-        if (wlan_cfgGetInt(pMac, WNI_CFG_CF_POLL_REQUEST, &val) != eSIR_SUCCESS)
-        {
-            cfgLog(pMac, LOGP, FL("cfg get WNI_CFG_CF_POLL_REQUEST failed\n"));
-            return eSIR_FAILURE;
-        }
-        if (val)
-            pCapInfo->cfPollReq = 1;
-    }
-#endif
 
     if(systemRole == eLIM_AP_ROLE)
     {
@@ -1075,32 +1031,6 @@
 void
 cfgSetCapabilityInfo(tpAniSirGlobal pMac, tANI_U16 caps)
 {
-#if (defined(ANI_PRODUCT_TYPE_AP))
-
-    if (cfgSetInt(pMac, WNI_CFG_PRIVACY_ENABLED,
-                  SIR_MAC_GET_PRIVACY(caps)) != eSIR_SUCCESS)
-        cfgLog(pMac, LOGP, FL("could not set privacy at CFG\n"));
-
-    if (cfgSetInt(pMac, WNI_CFG_SHORT_PREAMBLE,
-                  SIR_MAC_GET_SHORT_PREAMBLE(caps)) != eSIR_SUCCESS)
-        cfgLog(pMac, LOGP, FL("could not set short preamble at CFG\n"));
-
-    if (cfgSetInt(pMac, WNI_CFG_QOS_ENABLED,
-                  SIR_MAC_GET_QOS(caps)) != eSIR_SUCCESS)
-        cfgLog(pMac, LOGP, FL("could not set qos at CFG\n"));
-
-    if (cfgSetInt(pMac, WNI_CFG_11G_SHORT_SLOT_TIME_ENABLED,
-                  SIR_MAC_GET_SHORT_SLOT_TIME(caps)) != eSIR_SUCCESS)
-        cfgLog(pMac, LOGP, FL("could not set short slot time at CFG\n"));
-
-    if (cfgSetInt(pMac, WNI_CFG_APSD_ENABLED,
-                  SIR_MAC_GET_APSD(caps)) != eSIR_SUCCESS)
-        cfgLog(pMac, LOGP, FL("could not set apsd at CFG\n"));
-
-    if (cfgSetInt(pMac, WNI_CFG_BLOCK_ACK_ENABLED,
-                  SIR_MAC_GET_BLOCK_ACK(caps)) != eSIR_SUCCESS)
-        cfgLog(pMac, LOGP, FL("could not set BlockAck at CFG\n"));
-#endif
 }
 
 
diff --git a/CORE/MAC/src/cfg/cfgPriv.h b/CORE/MAC/src/cfg/cfgPriv.h
index 86a5d2f..2814a1b 100644
--- a/CORE/MAC/src/cfg/cfgPriv.h
+++ b/CORE/MAC/src/cfg/cfgPriv.h
@@ -65,11 +65,7 @@
 #include <cfgApi.h>
 #include "cfgDef.h"
 
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-    #include <wniCfgAp.h>
-#else
     #include <wniCfgSta.h>
-#endif
 
 /*--------------------------------------------------------------------*/
 /* CFG miscellaneous definition                                       */
diff --git a/CORE/MAC/src/cfg/cfgProcMsg.c b/CORE/MAC/src/cfg/cfgProcMsg.c
index a6b6980..05b61b4 100644
--- a/CORE/MAC/src/cfg/cfgProcMsg.c
+++ b/CORE/MAC/src/cfg/cfgProcMsg.c
@@ -152,9 +152,6 @@
 ProcDnldRsp(tpAniSirGlobal pMac, tANI_U16 length, tANI_U32 *pParam)
 {
     tANI_S32    i;
-  #if defined(ANI_PRODUCT_TYPE_AP)
-    tANI_U32 ap;
-  #endif
 
     tANI_U32    expLen, retVal, bufStart, bufEnd;
     tANI_U32    *pSrc, *pDst, *pDstEnd;
@@ -169,27 +166,8 @@
            length, sirReadU32N((tANI_U8*)pParam) );)
 
     // if the string is not correct, return failure
-#if defined(ANI_PRODUCT_TYPE_AP)
-#if defined(ANI_OS_TYPE_LINUX) || defined(ANI_OS_TYPE_OSX)
-    if (sirReadU32N((tANI_U8*)pParam) == CFG_AP_MAGIC_DWORD)
-#else
-    if (*pParam == CFG_AP_MAGIC_DWORD)
-#endif
-        ap = 1;
-    else
-
-
-#if defined(ANI_OS_TYPE_LINUX) || defined(ANI_OS_TYPE_OSX)
-        if (sirReadU32N((tANI_U8*)pParam) == CFG_STA_MAGIC_DWORD)
-#else
-        if (*pParam == CFG_STA_MAGIC_DWORD)
-#endif
-
-        ap = 0;
-#else /* ANI_PRODUCT_TYPE_AP*/
         if (*pParam == CFG_STA_MAGIC_DWORD) {}
 
-#endif/* ANI_PRODUCT_TYPE_AP*/
 
 
 
@@ -204,14 +182,6 @@
     length -= 4;
 
     // Verify message length
-#ifdef ANI_PRODUCT_TYPE_AP
-    if (ap)
-    {
-        pMac->cfg.gCfgMaxIBufSize = CFG_AP_IBUF_MAX_SIZE;
-        pMac->cfg.gCfgMaxSBufSize = CFG_AP_SBUF_MAX_SIZE;
-    }
-    else
-#endif /* (WNI_POLARIS_FW_PRODUCT == AP) */
     {
         pMac->cfg.gCfgMaxIBufSize = CFG_STA_IBUF_MAX_SIZE;
         pMac->cfg.gCfgMaxSBufSize = CFG_STA_SBUF_MAX_SIZE;
diff --git a/CORE/MAC/src/include/dphGlobal.h b/CORE/MAC/src/include/dphGlobal.h
index d57b1ef..91bb281 100644
--- a/CORE/MAC/src/include/dphGlobal.h
+++ b/CORE/MAC/src/include/dphGlobal.h
@@ -387,15 +387,9 @@
 
     tANI_U8  fAniCount:1;
 
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-
-    tANI_U8   hcfEnabled : 1;
-
-#else
 
     tANI_U8   rsvd:1;
 
-#endif
 
 
     /// Fragmentation size
diff --git a/CORE/MAC/src/include/parserApi.h b/CORE/MAC/src/include/parserApi.h
index 6502496..3015d0b 100644
--- a/CORE/MAC/src/include/parserApi.h
+++ b/CORE/MAC/src/include/parserApi.h
@@ -771,42 +771,6 @@
                        tSirTclasInfo     *pOld,
                        tDot11fIEWMMTCLAS *pDot11f);
 
-#if ( WNI_POLARIS_FW_PRODUCT == AP )
-
-tSirRetStatus
-PopulateDot11fCFParams(tpAniSirGlobal         pMac,
-                       tDot11fFfCapabilities *pCaps,
-                       tDot11fIECFParams     *pDot11f);
-
-void
-PopulateDot11fQuiet(tpAniSirGlobal  pMac,
-                    tDot11fIEQuiet *pDot11f);
-
-tSirRetStatus
-PopulateDot11fAPName(tpAniSirGlobal   pMac,
-                     tANI_U32              capEnable,
-                     tDot11fIEAPName *pDot11f);
-
-void
-PopulateDot11fPropQuietBSS(tpAniSirGlobal         pMac,
-                           tANI_U32                    capsEnable,
-                           tDot11fIEPropQuietBSS *pDot11f);
-
-void
-PopulateDot11fTrigStaBkScan(tpAniSirGlobal             pMac,
-                            tANI_U32                        capsEnable,
-                            tDot11fIETriggerStaBgScan *pDot11f);
-
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED)
-
-tSirRetStatus
-PopulateDot11fWDS(tpAniSirGlobal  pMac,
-                  tANI_U32             capEnable,
-                  tDot11fIEWDS   *pDot11f );
-
-#endif // WNI_POLARIS_FW_PACKAGE == ADVANCED
-
-#endif // WNI_POLARIS_FW_PRODUCT == AP
 
 tSirRetStatus PopulateDot11fWsc(tpAniSirGlobal pMac,
                                 tDot11fIEWscBeacon *pDot11f);
diff --git a/CORE/MAC/src/include/sirParams.h b/CORE/MAC/src/include/sirParams.h
index 600c38c..98aadd3 100644
--- a/CORE/MAC/src/include/sirParams.h
+++ b/CORE/MAC/src/include/sirParams.h
@@ -57,8 +57,6 @@
 
 # include "sirTypes.h"
 
-#define SIR_SDK_OPT_MAX_NUM_PRE_AUTH    32
-
 // Firmware wide constants
 
 #define SIR_MAX_PACKET_SIZE     2048
@@ -71,7 +69,7 @@
     PHY_SINGLE_CHANNEL_CENTERED     = 0,        // 20MHz IF bandwidth centered on IF carrier
     PHY_DOUBLE_CHANNEL_LOW_PRIMARY  = 1,        // 40MHz IF bandwidth with lower 20MHz supporting the primary channel
     PHY_DOUBLE_CHANNEL_HIGH_PRIMARY = 3,        // 40MHz IF bandwidth with higher 20MHz supporting the primary channel
-#ifdef WLAN_FEATURE_11AC    
+#ifdef WLAN_FEATURE_11AC
     PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_CENTERED = 4, //20/40MHZ offset LOW 40/80MHZ offset CENTERED
     PHY_QUADRUPLE_CHANNEL_20MHZ_CENTERED_40MHZ_CENTERED = 5, //20/40MHZ offset CENTERED 40/80MHZ offset CENTERED
     PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_CENTERED = 6, //20/40MHZ offset HIGH 40/80MHZ offset CENTERED
@@ -166,7 +164,7 @@
 } tSirMbMsg, *tpSirMbMsg;
 
 #ifdef WLAN_FEATURE_P2P
-/// Mailbox Message Structure for P2P 
+/// Mailbox Message Structure for P2P
 typedef struct sSirMbMsgP2p
 {
     tANI_U16 type;
@@ -626,18 +624,10 @@
 #define SIR_LIM_REASSOC_FAIL_TIMEOUT   (SIR_LIM_TIMEOUT_MSG_START + 6)
 #define SIR_LIM_HEART_BEAT_TIMEOUT     (SIR_LIM_TIMEOUT_MSG_START + 7)
 // currently unused                    SIR_LIM_TIMEOUT_MSG_START + 0x8
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-#define SIR_LIM_PREAUTH_CLNUP_TIMEOUT  (SIR_LIM_TIMEOUT_MSG_START + 0x9)
-#endif
 // Link Monitoring Messages
 #define SIR_LIM_CHANNEL_SCAN_TIMEOUT     (SIR_LIM_TIMEOUT_MSG_START + 0xA)
 #define SIR_LIM_PROBE_HB_FAILURE_TIMEOUT (SIR_LIM_TIMEOUT_MSG_START + 0xB)
 #define SIR_LIM_ADDTS_RSP_TIMEOUT        (SIR_LIM_TIMEOUT_MSG_START + 0xC)
-#if (WNI_POLARIS_FW_PRODUCT == AP) && (WNI_POLARIS_FW_PACKAGE == ADVANCED)
-#define SIR_LIM_MEASUREMENT_IND_TIMEOUT  (SIR_LIM_TIMEOUT_MSG_START + 0x10)
-#define SIR_LIM_LEARN_INTERVAL_TIMEOUT   (SIR_LIM_TIMEOUT_MSG_START + 0x11)
-#define SIR_LIM_LEARN_DURATION_TIMEOUT   (SIR_LIM_TIMEOUT_MSG_START + 0x12)
-#endif
 #define SIR_LIM_LINK_TEST_DURATION_TIMEOUT (SIR_LIM_TIMEOUT_MSG_START + 0x13)
 #define SIR_LIM_HASH_MISS_THRES_TIMEOUT  (SIR_LIM_TIMEOUT_MSG_START + 0x16)
 #define SIR_LIM_CNF_WAIT_TIMEOUT         (SIR_LIM_TIMEOUT_MSG_START + 0x17)
diff --git a/CORE/MAC/src/pe/include/limApi.h b/CORE/MAC/src/pe/include/limApi.h
index dcdf065..3848992 100644
--- a/CORE/MAC/src/pe/include/limApi.h
+++ b/CORE/MAC/src/pe/include/limApi.h
@@ -57,9 +57,6 @@
 #include "sirApi.h"
 #include "aniGlobal.h"
 #include "sirMacProtDef.h"
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED)
-#include "sirMacPropExts.h"
-#endif
 #include "sirCommon.h"
 #include "sirDebug.h"
 #include "schGlobal.h"
@@ -155,18 +152,6 @@
  * Function to check the LIM state if system is in Scan/Learn state.
  */
 extern tANI_U8 limIsSystemInScanState(tpAniSirGlobal);
-#if (defined(ANI_PRODUCT_TYPE_AP) || defined(ANI_PRODUCT_TYPE_AP_SDK))
-/**
- * Function to setup Polaris into Learn mode.
- * This is also called by SCH upon receiving SCH_START_LEARN_MODE
- * message from LIM.
- */
-extern void limSetLearnMode(tpAniSirGlobal);
-/**
- * Function to re-enable Learn mode measurements
- */
-extern void limReEnableLearnMode(tpAniSirGlobal);
-#endif //#if (defined(ANI_PRODUCT_TYPE_AP) || defined(ANI_PRODUCT_TYPE_AP_SDK))
 /**
  * Function to handle IBSS coalescing.
  * Beacon Processing module to call this.
@@ -217,16 +202,6 @@
 tSirRetStatus limUpdateGlobalChannelBonding(tpAniSirGlobal pMac, tHalBitVal cbBit);
 #endif /* 0 */
 
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED) && (WNI_POLARIS_FW_PRODUCT == AP)
-extern void setupQuietBss( tpAniSirGlobal pMac, tANI_U32 learnInterval );
-extern tANI_BOOLEAN limUpdateQuietIEInBeacons( tpAniSirGlobal pMac );
-#endif
-#ifdef ANI_AP_SDK
-extern void limConvertScanDuration(tpAniSirGlobal pMac);
-#endif /* ANI_AP_SDK */
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-tSirRetStatus limProcessCcaMonitorModeChangeNotification(tpAniSirGlobal pMac, tANI_U32 ccaCbMode);
-#endif /* WNI_POLARIS_FW_PRODUCT == AP */
 void limHandleLowRssiInd(tpAniSirGlobal pMac);
 void limHandleBmpsStatusInd(tpAniSirGlobal pMac);
 void limHandleMissedBeaconInd(tpAniSirGlobal pMac);
diff --git a/CORE/MAC/src/pe/include/limGlobal.h b/CORE/MAC/src/pe/include/limGlobal.h
index 03a8257..b51017b 100644
--- a/CORE/MAC/src/pe/include/limGlobal.h
+++ b/CORE/MAC/src/pe/include/limGlobal.h
@@ -59,7 +59,7 @@
 #include "sirMacPropExts.h"
 #include "sirCommon.h"
 #include "sirDebug.h"
-#include "wniCfgAp.h"
+#include "wniCfgSta.h"
 #include "csrApi.h"
 #include "sapApi.h"
 #ifdef FEATURE_WLAN_TDLS
@@ -275,81 +275,9 @@
   eLIM_BA_STATE_WT_DEL_RSP //  We are waiting for Del response from HAL.
 } tLimBAState;
 
-#if (WNI_POLARIS_FW_PRODUCT == AP) && (WNI_POLARIS_FW_PACKAGE == ADVANCED)
-typedef struct sLimMeasParams
-{
-    TX_TIMER    measurementIndTimer;
-    TX_TIMER    learnIntervalTimer;
-    TX_TIMER    learnDurationTimer;
-    tANI_U32    rssiAlpha;
-    tANI_U32    chanUtilAlpha;
-    tANI_U8     shortDurationCount;
-    tANI_U8     isMeasIndTimerActive:1;
-    tANI_U8     disableMeasurements:1;
-    tANI_U8     rsvd:6;
-    tANI_U8     nextLearnChannelId;
-} tLimMeasParams, *tpLimMeasParams;
-
-typedef struct tLimMeasMatrixNode tLimMeasMatrixNode,
-                                  *tpLimMeasMatrixNode;
-struct tLimMeasMatrixNode
-{
-    tSirMeasMatrixInfo     matrix;
-    tANI_U32                    avgRssi;
-    tpLimMeasMatrixNode    next;
-};
-
-typedef struct tLimNeighborBssWdsNode tLimNeighborBssWdsNode,
-                                      *tpLimNeighborBssWdsNode;
-struct tLimNeighborBssWdsNode
-{
-    tSirNeighborBssWdsInfo     info;
-    tpLimNeighborBssWdsNode    next;
-};
-
-typedef struct sLimMeasData
-{
-    tANI_U32                duration;  
-    tANI_U32                prevTsfLo;
-    tANI_U32                prevChannelUtilization;
-    tANI_U16                avgChannelUtilization;
-    tANI_U8                 numMatrixNodes;
-    tpLimMeasMatrixNode     pMeasMatrixInfo;
-    tANI_U32                numBssWds;
-    tANI_U16                totalBssSize;
-    tpLimNeighborBssWdsNode pNeighborWdsInfo;
-} tLimMeasData, *tpLimMeasData;
-#endif
-
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED)
-/// Definition for Alternate BSS list
-typedef struct sSirMultipleAlternateRadioInfo
-{
-    tANI_U8                       numBss;
-    tSirAlternateRadioInfo   alternateRadio[SIR_MAX_NUM_ALTERNATE_RADIOS];
-} tSirMultipleAlternateRadioInfo, *tpSirMultipleAlternateRadioInfo;
-
-/// Definition for Neighbor BSS list
-typedef struct sSirMultipleNeighborBssInfo
-{
-    tANI_U32                  numBss;
-    tSirNeighborBssInfo  bssList[SIR_MAX_NUM_NEIGHBOR_BSS];
-} tSirMultipleNeighborBssInfo, *tpSirMultipleNeighborBssInfo;
-#endif
 
 
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-/**
- * Following is definition of to-be-released AID list.
- * When 'seen' AID is moved from to-be-released list
- * to free pool.
- */
-typedef struct sLimAIDtbr
-{
-    tANI_U8 tbr:1;
-    tANI_U8 seen:1;
-} tLimAIDtbr;
-#endif
+
 
 // MLM Req/Cnf structure definitions
 typedef struct sLimMlmAuthReq
@@ -547,13 +475,8 @@
     
 } tCacheParams, *tpCacheParams;
 
-#ifdef ANI_PRODUCT_TYPE_AP
-#define LIM_PROT_STA_OVERLAP_CACHE_SIZE     10
-#define LIM_PROT_STA_CACHE_SIZE 256
-#else
 #define LIM_PROT_STA_OVERLAP_CACHE_SIZE    HAL_NUM_ASSOC_STA
 #define LIM_PROT_STA_CACHE_SIZE            HAL_NUM_ASSOC_STA
-#endif
 
 typedef struct sLimProtStaParams
 {
@@ -697,15 +620,6 @@
     eLIM_STOP_TX
 } tLimControlTx;
 
-#ifdef ANI_AP_SDK
-typedef struct sLimScanDurationConvert
-{
-    tANI_U32 shortChannelScanDuration_tick; /* Used to update timers, for optimization purposes.  Value converted to TICKS once */
-    tANI_U32 shortChannelScanDuration_TU; /* Used by quietBSS duration.  Converted to TU once */
-    tANI_U32 longChannelScanDuration_tick; /* Used to update timers, for optimization purposes.  Value converted to TICKS once */
-    tANI_U32 longChannelScanDuration_TU; /* Used by quietBSS duration.  Converted to TU once */
-} tLimScanDurationConvert, *tpLimScanDurationConvert;
-#endif /* ANI_AP_SDK */
 
 // --------------------------------------------------------------------
 
diff --git a/CORE/MAC/src/pe/include/pmmGlobal.h b/CORE/MAC/src/pe/include/pmmGlobal.h
index b209de0..7b382da 100644
--- a/CORE/MAC/src/pe/include/pmmGlobal.h
+++ b/CORE/MAC/src/pe/include/pmmGlobal.h
@@ -200,10 +200,6 @@
     /// Flag to track if we are in a missed beacon scenario
     tANI_U8 inMissedBeaconScenario;
 
-#ifdef ANI_PRODUCT_TYPE_AP
-    tPmmStaState *gpPmmStaState; // Used for HCF - PS Poll
-    tANI_U8 *gpPmmPSState;          // To Store the PS States in AP
-#endif
     tPmmTim gPmmTim;
 
 
diff --git a/CORE/MAC/src/pe/include/schApi.h b/CORE/MAC/src/pe/include/schApi.h
index 59373f9..77cb265 100644
--- a/CORE/MAC/src/pe/include/schApi.h
+++ b/CORE/MAC/src/pe/include/schApi.h
@@ -64,9 +64,6 @@
 /// Set init time params
 extern void schSetInitParams(tpAniSirGlobal pMac);
 
-/// Set qos default params
-extern void schUpdateQosInfo(tpAniSirGlobal pMac);
-
 // update only the broadcast qos params
 extern void schQosUpdateBroadcast(tpAniSirGlobal pMac, tpPESession psessionEntry);
 
@@ -121,20 +118,6 @@
 /// Post a message to the scheduler message queue
 extern tSirRetStatus schPostMessage(tpAniSirGlobal pMac, tpSirMsgQ pMsg);
 
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-/// The scheduling interrupt handler
-extern void schSchedulingInterruptHandler(tpAniSirGlobal pMac);
-
-/// The scheduling end interrupt function
-extern void schSchedulingEndInterruptHandler(tpAniSirGlobal pMac);
-
-/// Function used by other Sirius modules to read CFPcount
-extern tANI_U8 schGetCFPCount(tpAniSirGlobal pMac);
-
-/// Function used by other Sirius modules to read CFPDuration remaining
-extern tANI_U16 schGetCFPDurRemaining(tpAniSirGlobal pMac);
-
-#endif
 
 extern void schBeaconProcess(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession psessionEntry);
 extern tSirRetStatus schBeaconEdcaProcess(tpAniSirGlobal pMac, tSirMacEdcaParamSetIE *edca, tpPESession psessionEntry);
diff --git a/CORE/MAC/src/pe/include/schGlobal.h b/CORE/MAC/src/pe/include/schGlobal.h
index 188d3fe..8adc850 100644
--- a/CORE/MAC/src/pe/include/schGlobal.h
+++ b/CORE/MAC/src/pe/include/schGlobal.h
@@ -92,11 +92,7 @@
 //****************** MISC defs *********************************
 
 /// Maximum allowable size of a beacon frame
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-#define SCH_MAX_BEACON_SIZE    2048
-#else
 #define SCH_MAX_BEACON_SIZE    512
-#endif
 
 #define SCH_MAX_PROBE_RESP_SIZE 512
 
@@ -188,9 +184,6 @@
     /// Whether scan request is received by SCH or not
     tANI_U8 gSchScanReqRcvd;
 
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-    tANI_U8 gSchRRRecd;
-#endif
 
     /// Debug flag to disable beacon generation
     tANI_U32 gSchGenBeacon;
diff --git a/CORE/MAC/src/pe/lim/limApi.c b/CORE/MAC/src/pe/lim/limApi.c
index 94a2064..5fc6bc2 100644
--- a/CORE/MAC/src/pe/lim/limApi.c
+++ b/CORE/MAC/src/pe/lim/limApi.c
@@ -52,15 +52,10 @@
  *
  */
 #include "palTypes.h"
-#ifdef ANI_PRODUCT_TYPE_AP
-#include "wniCfgAp.h"
-#else
 #include "wniCfgSta.h"
 #include "wniApi.h"
-#endif
 #include "sirCommon.h"
 #include "sirDebug.h"
-#include "aniParam.h"
 #include "cfgApi.h"
 
 #include "schApi.h"
@@ -128,20 +123,15 @@
     palZeroMemory(pMac->hHdd, pMac->lim.gLimCachedScanHashTable,
                     sizeof(pMac->lim.gLimCachedScanHashTable));
 
-#if defined(ANI_PRODUCT_TYPE_CLIENT) || defined(ANI_AP_CLIENT_SDK)
     pMac->lim.gLimBackgroundScanChannelId = 0;
     pMac->lim.gLimBackgroundScanStarted = 0;
     pMac->lim.gLimRestoreCBNumScanInterval = LIM_RESTORE_CB_NUM_SCAN_INTERVAL_DEFAULT;
     pMac->lim.gLimRestoreCBCount = 0;
     palZeroMemory(pMac->hHdd, pMac->lim.gLimLegacyBssidList, sizeof(pMac->lim.gLimLegacyBssidList));
-#endif
 
     /* Fill in default values */
     pMac->lim.gLimTriggerBackgroundScanDuringQuietBss = 0;
 
-#ifdef ANI_AP_SDK
-    palZeroMemory(pMac->hHdd, &pMac->lim.gLimScanDurationConvert, sizeof(tLimScanDurationConvert)); /* Used to store converted scan duration values in TU and TICKS */
-#endif /* ANI_AP_SDK */
 
     // abort scan is used to abort an on-going scan
     pMac->lim.abortScan = 0;
@@ -162,9 +152,6 @@
 
     //pMac->lim.gpLimStartBssReq = NULL;
 
-#if defined(ANI_PRODUCT_TYPE_AP)
-    palZeroMemory(pMac->hHdd, &pMac->lim.gLimNeighborBssList, sizeof(tSirMultipleNeighborBssInfo));
-#endif
 
 
 
@@ -306,16 +293,8 @@
 static void __limInitVars(tpAniSirGlobal pMac)
 {
 
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED)
-    palZeroMemory(pMac->hHdd, &pMac->lim.gLimAlternateRadioList, sizeof(tSirMultipleAlternateRadioInfo));
-#endif
 
     // Place holder for Measurement Req/Rsp/Ind related info
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED) && defined(ANI_PRODUCT_TYPE_AP)
-    pMac->lim.gpLimMeasReq = NULL;
-    palZeroMemory(pMac->hHdd, &pMac->lim.gLimMeasParams, sizeof(tLimMeasParams));
-    pMac->lim.gpLimMeasData = NULL;
-#endif
 
     // WDS info
     pMac->lim.gLimNumWdsInfoInd = 0;
@@ -623,11 +602,9 @@
 
    /* WNI_CFG_BG_SCAN_CHANNEL_LIST_CHANNEL_LIST */
 
-#if (WNI_POLARIS_FW_PRODUCT == WLAN_STA) || defined(ANI_AP_CLIENT_SDK)
    PELOG1(limLog(pMac, LOG1,
       FL("VALID_CHANNEL_LIST has changed, reset next bg scan channel\n"));)
    pMac->lim.gLimBackgroundScanChannelId = 0;
-#endif
 
    /* WNI_CFG_PROBE_RSP_BCN_ADDNIE_DATA - not needed */
 
@@ -1042,29 +1019,6 @@
     }
     palZeroMemory(pMac->hHdd, pMac->pmm.gPmmTim.pTim, sizeof(tANI_U8)*pMac->lim.maxStation);
 
-#ifdef ANI_PRODUCT_TYPE_AP
-
-    if (eHAL_STATUS_SUCCESS != palAllocateMemory(pMac->hHdd,
-                  (void **) &pMac->pmm.gPmmTim.pStaInfo, sizeof(*pMac->pmm.gPmmTim.pStaInfo) * pMac->lim.maxStation))
-    {
-        PELOGE(limLog(pMac, LOGE, FL("memory allocate failed for pStaInfo!\n"));)
-        return eSIR_FAILURE;
-    }
-
-    if (eHAL_STATUS_SUCCESS != palAllocateMemory(pMac->hHdd,
-              (void **) &pMac->pmm.gpPmmStaState, sizeof(tPmmStaState)*pMac->lim.maxStation))
-    {
-        PELOGE(limLog(pMac, LOGE, FL("memory allocate failed!\n"));)
-        return eSIR_FAILURE;
-    }
-
-    if (eHAL_STATUS_SUCCESS != palAllocateMemory(pMac->hHdd,
-              (void **) &pMac->pmm.gpPmmPSState, sizeof(tANI_U8)*pMac->lim.maxStation))
-    {
-        PELOGE(limLog(pMac, LOGE, FL("memory allocate failed!\n"));)
-        return eSIR_FAILURE;
-    }
-#endif
     pMac->lim.mgmtFrameSessionId = 0xff;
 
     if( !VOS_IS_STATUS_SUCCESS( vos_lock_init( &pMac->lim.lkPeGlobalLock ) ) )
@@ -1113,14 +1067,6 @@
     */
     palFreeMemory(pMac->hHdd, pMac->pmm.gPmmTim.pTim);
     pMac->pmm.gPmmTim.pTim = NULL;
-#ifdef ANI_PRODUCT_TYPE_AP
-    palFreeMemory(pMac->hHdd, pMac->pmm.gPmmTim.pStaInfo);
-    pMac->pmm.gPmmTim.pStaInfo = NULL;
-    palFreeMemory(pMac->hHdd, pMac->pmm.gpPmmStaState);
-    pMac->pmm.gpPmmStaState = NULL;
-    palFreeMemory(pMac->hHdd, pMac->pmm.gpPmmPSState);
-    pMac->pmm.gpPmmPSState = NULL;
-#endif
     if( !VOS_IS_STATUS_SUCCESS( vos_lock_destroy( &pMac->lim.lkPeGlobalLock ) ) )
     {
         return eSIR_FAILURE;
@@ -1570,221 +1516,7 @@
 }
 
 
-#if defined(ANI_PRODUCT_TYPE_AP) && (WNI_POLARIS_FW_PACKAGE == ADVANCED)
-/**
- * limCheckAndQuietBSS()
- *
- *FUNCTION:
- * This function is called by limSetLearnMode() to check
- * if BSS needs to be quieted and call limQuietBSS() to
- * send data frame to self for that purpose.
- *
- *LOGIC:
- * NA
- *
- *ASSUMPTIONS:
- * NA
- *
- *NOTE:
- *
- * @param  pMac - Pointer to Global MAC structure
- * @return None
- */
 
-void
-limCheckAndQuietBSS(tpAniSirGlobal pMac)
-{
-    tANI_U32 dur;
-
-    if (pMac->lim.gLimSystemRole == eLIM_AP_ROLE)
-    {
-        // LIM is in AP role. Quiet the BSS before
-        // switching to channel to be learned
-        if (pMac->lim.gpLimMeasReq->measDuration.shortChannelScanDuration >
-            LIM_MAX_QUIET_DURATION)
-        {
-            // May need to quiet BSS multiple times.
-            // Quiet for a limit of 32 msecs on Learn
-            // duration for now.
-            dur = LIM_MAX_QUIET_DURATION;
-        }
-        else
-        {
-            dur =
-            pMac->lim.gpLimMeasReq->measDuration.shortChannelScanDuration;
-        }
-       PELOG3(limLog(pMac, LOG3,
-               FL("*** Going to quiet BSS for duration=%d msec\n"),
-               dur);)
-
-        limQuietBss(pMac, dur);
-    }
-} /*** end limCheckAndQuietBSS() ***/
-#endif
-
-#if (defined(ANI_PRODUCT_TYPE_AP) || defined(ANI_PRODUCT_TYPE_AP_SDK))
-/**
- * limSetLearnMode()
- *
- *FUNCTION:
- * This function is called to setup system into Learn mode
- * to collect DFS measurements.
- *
- *LOGIC:
- * NA
- *
- *ASSUMPTIONS:
- * NA
- *
- *NOTE:
- *
- * @param  pMac - Pointer to Global MAC structure
- * @return None
- */
-
-void
-limSetLearnMode(tpAniSirGlobal pMac)
-{
-    limSendHalInitScanReq(pMac, eLIM_HAL_INIT_LEARN_WAIT_STATE, eSIR_DONT_CHECK_LINK_TRAFFIC_BEFORE_SCAN);
-    return;
-} /*** end limSetLearnMode() ***/
-
-/**
- * limContinueChannelLearn()
- *
- *FUNCTION:
- * This function is called to do measurement (learn) on current channel.
- *
- *LOGIC:
- *
- *ASSUMPTIONS:
- * NA
- *
- *NOTE:
- * NA
- *
- * @param  pMac    - Pointer to Global MAC structure
- *
- * @return None
- */
-
-void
-limContinueChannelLearn(tpAniSirGlobal pMac)
-{
-    tANI_U8        chanNum;
-    tSirMacSSid    ssId;
-    tSirMacAddr    bssId = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
-
-    // Time to collect measurements
-    chanNum = limGetCurrentLearnChannel(pMac);
-
-    // Switch channel
-    pMac->lim.gLimSystemInScanLearnMode = 1;
-
-    if (pMac->lim.gpLimMeasReq->measControl.scanType == eSIR_ACTIVE_SCAN)
-    {
-        /// Prepare and send Probe Request frame
-        ssId.length = 0;
-        /* for learning channel, we don't include any additional IE */
-        limSendProbeReqMgmtFrame(pMac, &ssId, bssId, chanNum,pMac->lim.gSelfMacAddr, 0 , NULL);
-    }
-
-    // Activate Learn duration timer during which
-    // DFS measurements are made.
-    pMac->lim.gLimMeasParams.shortDurationCount++;
-    limDeactivateAndChangeTimer(pMac, eLIM_LEARN_DURATION_TIMER);
-
-    MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, NO_SESSION, eLIM_LEARN_DURATION_TIMER));
-    if (tx_timer_activate(&pMac->lim.gLimMeasParams.learnDurationTimer)
-                                           != TX_SUCCESS)
-    {
-        /// Could not activate learn duration timer.
-        // Log error
-        limLog(pMac, LOGP, FL("could not activate learn duration timer\n"));
-
-        return;
-    }
-} /*** end limContinueChannelLearn() ***/
-
-
-/**
- * limReEnableLearnMode()
- *
- *FUNCTION:
- * This function is called by various MAC software modules to
- * re-enable Learn mode measurements.
- *
- *LOGIC:
- * NA
- *
- *ASSUMPTIONS:
- * NA
- *
- *NOTE:
- *
- * @param  pMac - Pointer to Global MAC structure
- * @return None
- */
-
-void
-limReEnableLearnMode(tpAniSirGlobal pMac)
-{
-   PELOG4(limLog(pMac, LOG4, FL("quietEnabled = %d\n"),
-                 pMac->lim.gLimSpecMgmt.fQuietEnabled);)
-
-    /** Stop measurement temperorily when radar is detected or channel
-     * switch is running as part of periodic DFS */
-    if (!pMac->lim.gpLimMeasReq || LIM_IS_RADAR_DETECTED(pMac) ||
-            (pMac->lim.gLimSpecMgmt.dot11hChanSwState  == eLIM_11H_CHANSW_RUNNING))
-    {
-        return;
-    }
-
-    if (pMac->lim.gLimSpecMgmt.fQuietEnabled)
-    {
-        MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, NO_SESSION, eLIM_QUIET_BSS_TIMER));
-#ifdef GEN6_TODO
-        /* revisit this piece of code to assign the appropriate sessionId below
-         * priority - HIGH
-         */
-        pMac->lim.limTimers.gLimQuietBssTimer.sessionId = sessionId;
-#endif
-        if (tx_timer_activate(
-                 &pMac->lim.limTimers.gLimQuietBssTimer)
-                 != TX_SUCCESS)
-        {
-            limLog(pMac, LOGP, FL("could not start Quiet Bss timer\n"));
-            return;
-        }
-        pMac->lim.gLimSpecMgmt.quietState = eLIM_QUIET_INIT;
-    }
-    else
-    {
-        limDeactivateAndChangeTimer(pMac, eLIM_LEARN_INTERVAL_TIMER);
-        MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, NO_SESSION, eLIM_LEARN_INTERVAL_TIMER));
-#ifdef GEN6_TODO
-        /* revisit this piece of code to assign the appropriate sessionId below
-        */
-        pMac->lim.gLimMeasParams.learnIntervalTimer.sessionId = sessionId;
-#endif
-        if (tx_timer_activate(
-                     &pMac->lim.gLimMeasParams.learnIntervalTimer)
-                     != TX_SUCCESS)
-        {
-            /// Could not activate Learn Interval timer.
-            // Log error
-            limLog(pMac, LOGP, FL("could not start Learn Interval timer\n"));
-            return;
-        }
-    }
-
-    PELOG3(limLog(pMac, LOG3, FL("Re-enabled Learn mode Measurements\n"));)
-    pMac->lim.gLimMeasParams.disableMeasurements = 0;
-
-    return;
-} /*** end limReEnableLearnMode() ***/
-
-#endif //#if (defined(ANI_PRODUCT_TYPE_AP) || defined(ANI_PRODUCT_TYPE_AP_SDK))
 
 
 /** 
@@ -1845,105 +1577,6 @@
 void limProcessWdsInfo(tpAniSirGlobal pMac,
                        tSirPropIEStruct propIEInfo)
 {
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED) && defined(ANI_PRODUCT_TYPE_AP)
-    tpSirSmeWdsInfoInd  pSirSmeWdsInfoInd;
-    tANI_U8                  *pTemp;
-    tSirMsgQ            mmhMsg;
-
-    if (propIEInfo.wdsLength &&
-        propIEInfo.wdsLength <= ANI_WDS_INFO_MAX_LENGTH)
-    {
-        if (pMac->lim.gLimWdsInfo.wdsLength)
-        {
-            if ((propIEInfo.wdsLength ==
-                 pMac->lim.gLimWdsInfo.wdsLength) &&
-                (palEqualMemory( pMac->hHdd,propIEInfo.wdsData,
-                    pMac->lim.gLimWdsInfo.wdsBytes,
-                    pMac->lim.gLimWdsInfo.wdsLength) ))
-
-                return; // no difference in WDS info
-            else
-            {
-               PELOG2(limLog(pMac, LOG2,
-                       FL("Cached WDS Info: length %d bytes is: "),
-                       pMac->lim.gLimWdsInfo.wdsLength);
-                sirDumpBuf(pMac, SIR_LIM_MODULE_ID, LOG2,
-                            pMac->lim.gLimWdsInfo.wdsBytes,
-                            pMac->lim.gLimWdsInfo.wdsLength);)
-
-               PELOG2(limLog(pMac, LOG2, FL("New WDS Info: length %d bytes is: "),
-                       propIEInfo.wdsLength);
-                sirDumpBuf(pMac, SIR_LIM_MODULE_ID, LOG2,
-                            propIEInfo.wdsData,
-                            propIEInfo.wdsLength);)
-
-                pMac->lim.gLimWdsInfo.wdsLength = propIEInfo.wdsLength;
-                palCopyMemory( pMac->hHdd, pMac->lim.gLimWdsInfo.wdsBytes,
-                                propIEInfo.wdsData,
-                                propIEInfo.wdsLength);
-
-                // send IND to WSM
-                if (eHAL_STATUS_SUCCESS !=
-                    palAllocateMemory(pMac->hHdd,
-                                      (void **) &pSirSmeWdsInfoInd,
-                                      sizeof(tSirSmeWdsInfoInd)))
-                {
-                    // Log error
-                    limLog(pMac, LOGP,
-                           FL("memory allocate failed for WDS_INFO_IND\n"));
-
-                    return;
-                }
-
-                pSirSmeWdsInfoInd->messageType = eWNI_SME_WDS_INFO_IND;
-                pSirSmeWdsInfoInd->length = sizeof(tSirSmeWdsInfoInd);
-
-                pSirSmeWdsInfoInd->wdsInfo.wdsLength =
-                    pMac->lim.gLimWdsInfo.wdsLength;
-
-                palCopyMemory( pMac->hHdd, pSirSmeWdsInfoInd->wdsInfo.wdsBytes,
-                                pMac->lim.gLimWdsInfo.wdsBytes,
-                                pMac->lim.gLimWdsInfo.wdsLength);
-
-                pTemp = (tANI_U8 *) pSirSmeWdsInfoInd;
-
-               PELOG2(limLog(pMac, LOG2,
-                       FL("eWNI_SME_WDS_INFO_IND length %d bytes is: "),
-                       pSirSmeWdsInfoInd->length);
-                sirDumpBuf(pMac, SIR_LIM_MODULE_ID, LOG2, pTemp,
-                            pSirSmeWdsInfoInd->length);)
-
-                mmhMsg.type = eWNI_SME_WDS_INFO_IND;
-                mmhMsg.bodyptr = pSirSmeWdsInfoInd;
-                mmhMsg.bodyval = 0;
-                MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type));
-                limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
-                pMac->lim.gLimNumWdsInfoInd++;
-            }
-        }
-        else
-        {
-            // first WDS info
-            pMac->lim.gLimWdsInfo.wdsLength = propIEInfo.wdsLength;
-            palCopyMemory( pMac->hHdd, pMac->lim.gLimWdsInfo.wdsBytes,
-                            propIEInfo.wdsData,
-                            propIEInfo.wdsLength);
-
-            PELOG1(limLog(pMac, LOG1, FL("First WDS Info: length %d bytes is:\n"),
-                            pMac->lim.gLimWdsInfo.wdsLength);
-            sirDumpBuf(pMac, SIR_LIM_MODULE_ID, LOG1,
-                            pMac->lim.gLimWdsInfo.wdsBytes,
-                            pMac->lim.gLimWdsInfo.wdsLength);)
-
-        }
-    }
-    else
-    {
-       PELOG2(limLog(pMac, LOG2,
-               FL("Illegal WDS length = %d\n"),
-               propIEInfo.wdsLength);)
-    }
-#endif
 }
 
 
@@ -2105,7 +1738,6 @@
                                 tpSirProbeRespBeacon pBeacon,
                                 tpPESession psessionEntry)
 {
-#if defined(ANI_PRODUCT_TYPE_CLIENT) || defined(ANI_AP_CLIENT_SDK)
     tANI_U8                 len;
     tSirSmeApNewCaps   apNewCaps;
     tANI_U8            newChannel;
@@ -2119,10 +1751,6 @@
          (SIR_MAC_GET_SHORT_PREAMBLE(apNewCaps.capabilityInfo) !=  SIR_MAC_GET_SHORT_PREAMBLE(psessionEntry->limCurrentBssCaps)) ||
          (SIR_MAC_GET_QOS(apNewCaps.capabilityInfo) !=   SIR_MAC_GET_QOS(psessionEntry->limCurrentBssCaps)) ||
          (newChannel !=  psessionEntry->currentOperChannel) 
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED)
-         || (LIM_BSS_CAPS_GET(HCF, psessionEntry->limCurrentBssQosCaps) !=
-          pBeacon->propIEinfo.hcfEnabled)
-#endif
          )))
     {
 
@@ -2174,7 +1802,6 @@
                                     (tANI_U32 *) &apNewCaps,
                                     len, psessionEntry->smeSessionId);
     }
-#endif
 } /*** limDetectChangeInApCapabilities() ***/
 
 
@@ -2257,195 +1884,9 @@
 }
 
 
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED) && defined(ANI_PRODUCT_TYPE_AP)
-
-/**
- * limUpdateQuietIEInBeacons()
- *
- *FUNCTION:
- * This function is called by specialBeaconProcessing(),
- * when it is time to generate the next beacon.
- * If gLimQuietState is not in the INIT state, then it
- * means that the next beacon may need to include some
- * information about the Quiet BSS IE.
- * This function makes that decision based on the current
- * state of gLimQuietState
- *
- *LOGIC:
- * This routine invokes schSetFixedBeaconFields() only
- * if necessary, as it is expensive to update the fixed
- * beacon fields during each beacon interval.
- *
- *ASSUMPTIONS:
- * This Quiet BSS IE will be sent out as part of
- * Proprietary IE's. If 802.11H is enabled, this IE
- * will be sent out as defined in the 11H spec
- *
- *NOTE:
- *
- * @param  pMac Pointer to Global MAC structure
- * @return true, if the beacon fields need updating
- *         false, if not
- */
-tANI_BOOLEAN limUpdateQuietIEInBeacons( tpAniSirGlobal pMac )
-{
-  tANI_BOOLEAN fUpdateBeaconFields = eANI_BOOLEAN_TRUE;
-
-  limLog( pMac, LOG2, FL("Quiet BSS State = %d\n"),
-          pMac->lim.gLimSpecMgmt.quietState );
-  switch( pMac->lim.gLimSpecMgmt.quietState )
-  {
-    case eLIM_QUIET_BEGIN:
-      // We need to start broadcasting the Quiet BSS IE
-      // Transition to eLIM_QUIET_RUNNING
-      pMac->lim.gLimSpecMgmt.quietState = eLIM_QUIET_RUNNING;
-      break;
-
-    case eLIM_QUIET_RUNNING:
-      // Start down-counting...
-      pMac->lim.gLimSpecMgmt.quietCount--;
-      if( pMac->lim.gLimSpecMgmt.quietCount == 0 )
-      {
-        //
-        // We no longer need to broadcast the Quiet BSS IE
-        //
-        // NOTE - We still need to call schSetFixedBeaconFields()
-        // one last time, just to remove the Quiet BSS IE from
-        // the list of fixed beacon fields
-        //
-        // Transition to eLIM_QUIET_END
-        pMac->lim.gLimSpecMgmt.quietState = eLIM_QUIET_END;
-        limProcessLearnIntervalTimeout(pMac);
-      }
-      break;
-
-    case eLIM_QUIET_CHANGED:
-      //
-      // State possibly changed via setupQuietBss().
-      // This means, gLimQuietCount has been changed!!
-      //
-      // NOTE - We still need to call schSetFixedBeaconFields()
-      // one last time, just to remove the Quiet BSS IE from
-      // the list of fixed beacon fields
-      //
-
-      // Transition to eLIM_QUIET_END
-      pMac->lim.gLimSpecMgmt.quietState = eLIM_QUIET_END;
-      break;
-
-    case eLIM_QUIET_INIT:
-    case eLIM_QUIET_END:
-      // Transition to eLIM_QUIET_INIT
-      pMac->lim.gLimSpecMgmt.quietState = eLIM_QUIET_INIT;
-      // Fall thru'...
-    default:
-      fUpdateBeaconFields = eANI_BOOLEAN_FALSE;
-      break;
-  }
-
-  return fUpdateBeaconFields;
-}
-
-#endif
-
-#if ((defined ANI_PRODUCT_TYPE_AP) && (defined ANI_AP_SDK))
-void limConvertScanDuration(tpAniSirGlobal pMac)
-{
-    tpSirSmeMeasurementReq pMeasReq = pMac->lim.gpLimMeasReq;
-    tpLimScanDurationConvert scanDurConv = &pMac->lim.gLimScanDurationConvert;
-
-    /* This is not a good idea to convert {long}shortChannelScanDuration from mS to TICKS *
-         * The reason is that {long}shortChannelScanDuration is used all over and a lot of code *
-         * that assumes the old mS definition was never changed to accommodate this new change to TICKS. *
-         * If optimization is needed, create another set of shadow variables to store the converted *
-         * values in Ticks, and TU.  */
-    scanDurConv->shortChannelScanDuration_tick =
-                     SYS_MS_TO_TICKS(pMeasReq->measDuration.shortChannelScanDuration +SYS_TICK_DUR_MS-1);
-
-    /* convert shortChannelScanDuration to TU also for CB scan, used to set gLimQuietDuration */
-    /* (shortChanneScanDuration * 1000) / 2^10 */
-    scanDurConv->shortChannelScanDuration_TU = (pMeasReq->measDuration.shortChannelScanDuration * 1000) >> 10;
-
-    scanDurConv->longChannelScanDuration_tick =
-                     SYS_MS_TO_TICKS(pMeasReq->measDuration.longChannelScanDuration +SYS_TICK_DUR_MS-1);
-
-    /* convert shortChannelScanDuration to TU also for CB scan, used to set gLimQuietDuration */
-    /* (longChanneScanDuration * 1000) / 2^10 */
-    scanDurConv->longChannelScanDuration_TU = (pMeasReq->measDuration.longChannelScanDuration * 1000) >> 10;
-}
-#endif /* ((defined ANI_PRODUCT_TYPE_AP) && (defined ANI_AP_SDK)) */
 
 
-#ifdef ANI_PRODUCT_TYPE_AP
-/**-------------------------------------------------
-\fn     limIsRadarEnabled
 
-\brief  Checks if radar is enabled
-\param  pMac
-\return true - if Both 11h and radar enabled
-        false - if either is not enabled.
- --------------------------------------------------*/
-tANI_BOOLEAN limIsRadarEnabled(tpAniSirGlobal pMac)
-{
-    tANI_U32 fEnabled;
-
-    if(wlan_cfgGetInt(pMac, WNI_CFG_11H_ENABLED, &fEnabled) != eSIR_SUCCESS)
-    {
-        limLog(pMac, LOGP, FL("HAL: could not retrieve radar config from CFG"));
-        return eANI_BOOLEAN_FALSE;
-    }
-
-    if (!fEnabled)
-        return eANI_BOOLEAN_FALSE;
-
-    if(wlan_cfgGetInt(pMac, WNI_CFG_RDET_FLAG, &fEnabled) != eSIR_SUCCESS)
-    {
-        limLog(pMac, LOGP, FL("HAL: could not retrieve radar config from CFG"));
-        return eANI_BOOLEAN_FALSE;
-    }
-
-    if (fEnabled)
-        return eANI_BOOLEAN_TRUE;
-
-    return eANI_BOOLEAN_FALSE;
-}
-
-/**---------------------------------------
-\fn     limRadarInit
-\brief  Initialize Radar Interrupt.
-
-\param  pMac
-\return None
- ----------------------------------------*/
-void limRadarInit(tpAniSirGlobal pMac)
-{
-    tANI_U32    status;
-    tSirMsgQ    msg;
-
-   PELOG3(limLog(pMac, LOG3, FL("Radar Interrupt Already configured? %s\n"),
-                 pMac->lim.gLimSpecMgmt.fRadarIntrConfigured?"Yes":"No");)
-    /** To avoid configuring the radar multiple times */
-    if (pMac->lim.gLimSpecMgmt.fRadarIntrConfigured)
-        return;
-
-    if (!limIsRadarEnabled(pMac))
-        return;
-    // Prepare and post message to HAL Message Queue
-    msg.type = WDA_INIT_RADAR_IND;
-    msg.bodyptr = NULL;
-    msg.bodyval = 0;
-    MTRACE(macTraceMsgTx(pMac, NO_SESSION, msg.type));
-    status = wdaPostCtrlMsg(pMac, &msg);
-    if (status != eHAL_STATUS_SUCCESS)
-    {
-        limLog(pMac, LOGP,
-               FL("posting to HAL failed, reason=%d\n"), status);
-        return;
-    }
-    pMac->lim.gLimSpecMgmt.fRadarIntrConfigured = eANI_BOOLEAN_TRUE;
-} /****** end limRadarInit() ******/
-
-#endif
 
 
 /** -----------------------------------------------------------------
diff --git a/CORE/MAC/src/pe/lim/limAssocUtils.c b/CORE/MAC/src/pe/lim/limAssocUtils.c
index da2eab8..641302c 100644
--- a/CORE/MAC/src/pe/lim/limAssocUtils.c
+++ b/CORE/MAC/src/pe/lim/limAssocUtils.c
@@ -57,11 +57,7 @@
 #include "wniApi.h"
 #include "sirCommon.h"
 
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-#include "wniCfgAp.h"
-#else
 #include "wniCfgSta.h"
-#endif
 #include "pmmApi.h"
 #include "cfgApi.h"
 
@@ -656,11 +652,6 @@
     //delete all tspecs associated with this sta.
     limAdmitControlDeleteSta(pMac, pStaDs->assocId);
 
-#if (WNI_POLARIS_FW_PRODUCT==AP)
-    // Reset PMM state for this STA if it exists
-    if (psessionEntry->limSystemRole == eLIM_AP_ROLE)||(psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE)
-        pmmUpdatePMMode(pMac, pStaDs->assocId, 0);
-#endif
 
     /**
      * Make STA hash entry invalid at eCPU so that DPH
@@ -789,9 +780,6 @@
                    (tANI_U8 *) staDsAddr,
                    sizeof(tSirMacAddr));
         mlmDisassocCnf.resultCode = statusCode;
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-        mlmDisassocCnf.aid        = staDsAssocId;
-#endif
         mlmDisassocCnf.disassocTrigger =
                                    mlmStaContext.cleanupTrigger;
         /* Update PE session Id*/
@@ -815,9 +803,6 @@
                       (tANI_U8 *) staDsAddr,
                       sizeof(tSirMacAddr));
         mlmDeauthCnf.resultCode    = statusCode;
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-        mlmDeauthCnf.aid           = staDsAssocId;
-#endif
         mlmDeauthCnf.deauthTrigger =
                                    mlmStaContext.cleanupTrigger;
         /* PE session Id */
@@ -2949,16 +2934,6 @@
         psessionEntry->limMlmState = eLIM_MLM_JOINED_STATE;
         MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, psessionEntry->peSessionId, eLIM_MLM_JOINED_STATE));
 
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-        // In case of BP, we need to adopt to all rates
-        // advertised by AP. Update the operational rates at CFG
-    if (cfgSetStr(pMac, WNI_CFG_OPERATIONAL_RATE_SET,
-                      (tANI_U8 *) &pBPR->supportedRates.rate,
-                      pBPR->supportedRates.numRates)
-            != eSIR_SUCCESS)
-            limLog(pMac, LOGP, FL("could not update Oper.rates at CFG\n"));
-       
-#endif
 
         /**
          * Announce join success by sending
@@ -3098,7 +3073,6 @@
 }
 
 
-#ifdef ANI_PRODUCT_TYPE_CLIENT
 
 /**
  * limSendAddBss()
@@ -3713,213 +3687,6 @@
 
 
 
-#elif defined(ANI_AP_CLIENT_SDK)
-tSirRetStatus limStaSendAddBss( tpAniSirGlobal pMac, tpSirAssocRsp pAssocRsp,
-                                     tpSirNeighborBssInfo neighborBssInfo, tANI_U8 updateEntry, 
-                                     tpPESession psessionEntry)
-{
-    tSirMsgQ msgQ;
-    tpAddBssParams pAddBssParams = NULL;
-    tANI_U32 retCode;
-    tANI_U8 i;
-    tpDphHashNode pStaDs = NULL;
-    
-    // Package SIR_HAL_ADD_BSS_REQ message parameters
-    if( eHAL_STATUS_SUCCESS != palAllocateMemory( pMac->hHdd,
-                                                  (void **) &pAddBssParams,
-                                                  sizeof( tAddBssParams )))
-    {
-        limLog( pMac, LOGP,
-                FL( "Unable to PAL allocate memory during ADD_BSS\n" ));
-        retCode = eSIR_MEM_ALLOC_FAILED;
-        goto returnFailure;
-    }
-    else
-        palZeroMemory( pMac->hHdd, (tANI_U8 *) pAddBssParams, sizeof( tAddBssParams ));
-
-    palCopyMemory( pMac->hHdd,  pAddBssParams->bssId,neighborBssInfo->bssId,
-                   sizeof( tSirMacAddr ));
-
-    // Fill in tAddBssParams selfMacAddr
-    palCopyMemory( pMac->hHdd, pAddBssParams->selfMacAddr, psessionEntry->selfMacAddr,
-                  sizeof( tSirMacAddr ));
-
-    pAddBssParams->bssType = eSIR_INFRASTRUCTURE_MODE;
-    pAddBssParams->operMode = BSS_OPERATIONAL_MODE_STA;
-    pAddBssParams->beaconInterval = (tANI_U16) neighborBssInfo->beaconInterval;
-    pAddBssParams->dtimPeriod = neighborBssInfo->dtimPeriod;
-    pAddBssParams->updateBss = updateEntry;
-
-   
-    /* The following parameters are commented since the information is not available from the 
-     * neighborBssInfo. This needs to be fixed later */
-#if 0    
-
-    pAddBssParams->cfParamSet.cfpCount = beaconStruct.cfParamSet.cfpCount;
-    pAddBssParams->cfParamSet.cfpPeriod = beaconStruct.cfParamSet.cfpPeriod;
-    pAddBssParams->cfParamSet.cfpMaxDuration = beaconStruct.cfParamSet.cfpMaxDuration;
-    pAddBssParams->cfParamSet.cfpDurRemaining = beaconStruct.cfParamSet.cfpDurRemaining;
-#endif
-    pAddBssParams->rateSet.numRates = pAssocRsp->supportedRates.numRates;
-    palCopyMemory( pMac->hHdd,  pAddBssParams->rateSet.rate,
-                   pAssocRsp->supportedRates.rate, pAssocRsp->supportedRates.numRates );
-
-     /* Update PE session ID */
-    pAddBssParams->sessionId = psessionEntry->peSessionId;
-
-    pAddBssParams->nwType = neighborBssInfo->nwType;
-    
-    pAddBssParams->shortSlotTimeSupported = (tANI_U8)pAssocRsp->capabilityInfo.shortSlotTime;    
-    pAddBssParams->llaCoexist = (tANI_U8) psessionEntry->beaconParams.llaCoexist;    
-    pAddBssParams->llbCoexist = (tANI_U8) psessionEntry->beaconParams.llbCoexist;
-    pAddBssParams->llgCoexist = (tANI_U8) psessionEntry->beaconParams.llgCoexist;
-    pAddBssParams->ht20Coexist = (tANI_U8) psessionEntry->beaconParams.ht20Coexist;    
-
-    // Use the advertised capabilities from the received beacon/PR
-    if (IS_DOT11_MODE_HT(psessionEntry->dot11mode) && ( neighborBssInfo->HTCapsPresent ))
-    {
-        pAddBssParams->htCapable = pAssocRsp->HTCaps.present;
-
-        if ( neighborBssInfo->HTInfoPresent )
-        {
-            pAddBssParams->htOperMode = pAssocRsp->HTInfo.opMode;
-            pAddBssParams->dualCTSProtection = ( tANI_U8 )pAssocRsp->HTInfo.dualCTSProtection;
- 
-            if(pAssocRsp->HTCaps.supportedChannelWidthSet)
-            {
-                pAddBssParams->txChannelWidthSet = ( tANI_U8 )pAssocRsp->HTInfo.recommendedTxWidthSet;
-                pAddBssParams->currentExtChannel = pAssocRsp->HTInfo.secondaryChannelOffset;
-            }
-            else
-            {
-                pAddBssParams->txChannelWidthSet = (tANI_U8)pAssocRsp->HTCaps.supportedChannelWidthSet;
-                pAddBssParams->currentExtChannel = PHY_SINGLE_CHANNEL_CENTERED;
-            }
-            pAddBssParams->llnNonGFCoexist = (tANI_U8)pAssocRsp->HTInfo.nonGFDevicesPresent;
-            pAddBssParams->fLsigTXOPProtectionFullSupport = (tANI_U8)pAssocRsp->HTInfo.lsigTXOPProtectionFullSupport;
-            pAddBssParams->fRIFSMode = pAssocRsp->HTInfo.rifsMode;
-        }
-    }
-
-    pAddBssParams->currentOperChannel = neighborBssInfo->channelId;
-
-    // Populate the STA-related parameters here
-    // Note that the STA here refers to the AP
-    {
-        pAddBssParams->staContext.staType = STA_ENTRY_OTHER; // Identifying AP as an STA
-
-        palCopyMemory( pMac->hHdd,  pAddBssParams->staContext.bssId,
-                       neighborBssInfo->bssId,
-                       sizeof( tSirMacAddr ));
-        pAddBssParams->staContext.listenInterval = (tANI_U8) neighborBssInfo->beaconInterval;
-
-        pAddBssParams->staContext.assocId = 0; // Is SMAC OK with this?
-        pAddBssParams->staContext.uAPSD = 0;
-        pAddBssParams->staContext.maxSPLen = 0;
-        pAddBssParams->staContext.shortPreambleSupported = (tANI_U8)pAssocRsp->capabilityInfo.shortPreamble;
-        pAddBssParams->staContext.updateSta = updateEntry;
-
-
-        if (IS_DOT11_MODE_HT(psessionEntry->dot11mode) && ( pAssocRsp->HTCaps.present ))
-        {
-            pAddBssParams->staContext.us32MaxAmpduDuration = 0;
-            pAddBssParams->staContext.htCapable = 1;
-            pAddBssParams->staContext.greenFieldCapable  = ( tANI_U8 )pAssocRsp->HTCaps.greenField;
-            pAddBssParams->staContext.lsigTxopProtection = ( tANI_U8 )pAssocRsp->HTCaps.lsigTXOPProtection;
-            pAddBssParams->staContext.txChannelWidthSet  = ( tANI_U8 )(pAssocRsp->HTCaps.supportedChannelWidthSet ?
-                                                                                         pAssocRsp->HTInfo.recommendedTxWidthSet : 
-                                                                                         pAssocRsp->HTCaps.supportedChannelWidthSet );
-            pAddBssParams->staContext.mimoPS             =             pAssocRsp->HTCaps.mimoPowerSave;
-            pAddBssParams->staContext.delBASupport       = ( tANI_U8 )pAssocRsp->HTCaps.delayedBA;
-            pAddBssParams->staContext.maxAmsduSize       = ( tANI_U8 )pAssocRsp->HTCaps.maximalAMSDUsize;
-            pAddBssParams->staContext.maxAmpduDensity    =             pAssocRsp->HTCaps.mpduDensity;
-            pAddBssParams->staContext.fDsssCckMode40Mhz = (tANI_U8)pAssocRsp->HTCaps.dsssCckMode40MHz;
-            pAddBssParams->staContext.fShortGI20Mhz = (tANI_U8)pAssocRsp->HTCaps.shortGI20MHz;
-            pAddBssParams->staContext.fShortGI40Mhz = (tANI_U8)pAssocRsp->HTCaps.shortGI40MHz;
-            pAddBssParams->staContext.maxAmpduSize= pAssocRsp->HTCaps.maxRxAMPDUFactor;
-            
-            if( pAssocRsp->HTInfo.present )
-                pAddBssParams->staContext.rifsMode = pAssocRsp->HTInfo.rifsMode;
-        }
-
-        if ((psessionEntry->limWmeEnabled && pAssocRsp->wmeEdcaPresent) ||
-                (psessionEntry->limQosEnabled && pAssocRsp->edcaPresent))
-            pAddBssParams->staContext.wmmEnabled = 1;
-        else 
-            pAddBssParams->staContext.wmmEnabled = 0;
-
-        //Update the rates
-
-        pStaDs = dphGetHashEntry(pMac, DPH_STA_HASH_INDEX_PEER, &psessionEntry->dph.dphHashTable);
-        if (pStaDs != NULL)
-        {
-            limFillSupportedRatesInfo(pMac, pStaDs, &pStaDs->supportedRates,psessionEntry);
-            palCopyMemory(pMac->hHdd, (tANI_U8*)&pAddBssParams->staContext.supportedRates,
-                                                (tANI_U8*)&pStaDs->supportedRates,
-                                                sizeof(tSirSupportedRates));
-        }
-        else
-            PELOGE(limLog(pMac, LOGE, FL("could not Update the supported rates.\n"));)
-
-    }
-
-    //Disable BA. It will be set as part of ADDBA negotiation.
-    for( i = 0; i < SMAC_STACFG_MAX_TC; i++ )
-    {
-        pAddBssParams->staContext.staTCParams[i].txUseBA    = eBA_DISABLE;
-        pAddBssParams->staContext.staTCParams[i].rxUseBA    = eBA_DISABLE;
-        pAddBssParams->staContext.staTCParams[i].txBApolicy = eBA_POLICY_IMMEDIATE;
-        pAddBssParams->staContext.staTCParams[i].rxBApolicy = eBA_POLICY_IMMEDIATE;
-    }
-
-#if defined WLAN_FEATURE_VOWIFI  
-    pAddBssParams->maxTxPower = psessionEntry->maxTxPower;
-#endif
-    // FIXME_GEN4 - Any other value that can be used for initialization?
-    pAddBssParams->status = eHAL_STATUS_SUCCESS;
-    pAddBssParams->respReqd = true;
-
-    pAddBssParams->halPersona = (tANI_U8)psessionEntry->pePersona; //update persona
-
-#if defined WLAN_FEATURE_VOWIFI_11R
-    pAddBssParams->extSetStaKeyParamValid = 0;
-#endif
-
-    // Set a new state for MLME
-    if( eLIM_MLM_WT_ASSOC_RSP_STATE == psessionEntry->limMlmState )
-        psessionEntry->limMlmState = eLIM_MLM_WT_ADD_BSS_RSP_ASSOC_STATE;
-    else
-        psessionEntry->limMlmState = eLIM_MLM_WT_ADD_BSS_RSP_REASSOC_STATE;
-    MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, psessionEntry->peSessionId, psessionEntry->limMlmState));
-
-    //we need to defer the message until we get the response back from HAL.
-    SET_LIM_PROCESS_DEFD_MESGS(pMac, false);
-
-    msgQ.type = SIR_HAL_ADD_BSS_REQ;
-    /** @ToDo : Update the Global counter to keeptrack of the PE <--> HAL messages*/
-    msgQ.reserved = 0;
-    msgQ.bodyptr = pAddBssParams;
-    msgQ.bodyval = 0;
-
-    limLog( pMac, LOG1, FL( "Sending SIR_HAL_ADD_BSS_REQ..." ));
-    MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, msgQ.type));
-
-    retCode = halPostMsgApi( pMac, &msgQ );
-    if( eSIR_SUCCESS != retCode) 
-    {
-        palFreeMemory(pMac->hHdd, pAddBssParams);
-        limLog( pMac, LOGE, FL("Posting ADD_BSS_REQ to HAL failed, reason=%X\n"),
-                retCode );
-    }
-    else
-        return retCode;
-
- returnFailure:
-    // Clean-up will be done by the caller...
-    return retCode;
-}
-
-#endif // ANI_PRODUCT_TYPE_CLIENT
 
 /** -------------------------------------------------------------
 \fn limPrepareAndSendDelStaCnf
diff --git a/CORE/MAC/src/pe/lim/limAssocUtils.h b/CORE/MAC/src/pe/lim/limAssocUtils.h
index ab7d0d1..3e21a26 100644
--- a/CORE/MAC/src/pe/lim/limAssocUtils.h
+++ b/CORE/MAC/src/pe/lim/limAssocUtils.h
@@ -153,20 +153,10 @@
     tpSirSupportedRates   pRates,
     tpPESession           psessionEntry);
 
-#ifdef ANI_PRODUCT_TYPE_CLIENT
-//make non-conditional until the caller is #ifdefed
-tSirRetStatus limStaSendAddBss(tpAniSirGlobal pMac, tpSirAssocRsp pAssocRsp, 
+tSirRetStatus limStaSendAddBss(tpAniSirGlobal pMac, tpSirAssocRsp pAssocRsp,
                                     tpSchBeaconStruct pBeaconStruct, tpSirBssDescription bssDescription, tANI_U8 updateEntry, tpPESession psessionEntry);
 tSirRetStatus limStaSendAddBssPreAssoc( tpAniSirGlobal pMac, tANI_U8 updateEntry, tpPESession psessionEntry);
 
-
-
-#elif defined(ANI_AP_CLIENT_SDK)
-tSirRetStatus limStaSendAddBss(tpAniSirGlobal pMac, tpSirAssocRsp pAssocRsp, 
-                                    tpSirNeighborBssInfo neighborBssInfo,tANI_U8 updateEntry, 
-                                    tpPESession psessionEntry);
-#endif
-
 void limPrepareAndSendDelStaCnf(tpAniSirGlobal pMac, tpDphHashNode pStaDs, tSirResultCodes statusCode,tpPESession);
 tSirRetStatus limExtractApCapabilities(tpAniSirGlobal pMac, tANI_U8 * pIE, tANI_U16 ieLen, tpSirProbeRespBeacon beaconStruct);
 void limInitPreAuthTimerTable(tpAniSirGlobal pMac, tpLimPreAuthTable pPreAuthTimerTable);
diff --git a/CORE/MAC/src/pe/lim/limIbssPeerMgmt.c b/CORE/MAC/src/pe/lim/limIbssPeerMgmt.c
index 2b75412..cce194d 100644
--- a/CORE/MAC/src/pe/lim/limIbssPeerMgmt.c
+++ b/CORE/MAC/src/pe/lim/limIbssPeerMgmt.c
@@ -52,11 +52,7 @@
 #include "palTypes.h"
 #include "aniGlobal.h"
 #include "sirCommon.h"
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-#include "wniCfgAp.h"
-#else
 #include "wniCfgSta.h"
-#endif
 #include "limUtils.h"
 #include "limAssocUtils.h"
 #include "limStaHashApi.h"
diff --git a/CORE/MAC/src/pe/lim/limLinkMonitoringAlgo.c b/CORE/MAC/src/pe/lim/limLinkMonitoringAlgo.c
index b8de1aa..a51696a 100644
--- a/CORE/MAC/src/pe/lim/limLinkMonitoringAlgo.c
+++ b/CORE/MAC/src/pe/lim/limLinkMonitoringAlgo.c
@@ -53,7 +53,7 @@
  */
 
 #include "aniGlobal.h"
-#include "wniCfgAp.h"
+#include "wniCfgSta.h"
 #include "cfgApi.h"
 
 
@@ -93,65 +93,6 @@
 limSendKeepAliveToPeer(tpAniSirGlobal pMac)
 {
 
-#ifdef ANI_PRODUCT_TYPE_AP   //oct 3rd review
-
-    tpDphHashNode   pStaDs;
-    //fetch the sessionEntry based on the sessionId
-    tpPESession psessionEntry;
-
-    if((psessionEntry = peFindSessionBySessionId(pMac, pMac->lim.limTimers.gLimKeepaliveTimer.sessionId))== NULL)
-    {
-        limLog(pMac, LOGP,FL("Session Does not exist for given sessionID\n"));
-        return;
-    }
-
-    // If keep live has been disabled, exit
-    if (pMac->sch.keepAlive == 0)
-        return;
-
-    if ( (limIsSystemInScanState(pMac) == false) &&
-          (psessionEntry->limSystemRole == eLIM_AP_ROLE))
-    {
-        tANI_U16 i;
-        tANI_U32        len = SIR_MAC_MAX_SSID_LENGTH;
-        tAniSSID   ssId;
-
-        /*
-        ** send keepalive NULL data frame for each
-        ** associated STA;
-        */
-
-        for (i=2; i<pMac->lim.maxStation; i++)
-        {
-            pStaDs = dphGetHashEntry(pMac, i, &psessionEntry->dph.dphHashTable);
-
-            if (pStaDs && pStaDs->added &&
-                (pStaDs->mlmStaContext.mlmState == eLIM_MLM_LINK_ESTABLISHED_STATE))
-            {
-                // SP-Tx hangs at times when a zero-lenght packet is transmitted
-                // To avoid any interoperability issue with third party clinet
-                // instead of sending a non-zero data-null packet, AP sends a
-                // probe response as a keep alive packet.
-                if (wlan_cfgGetStr(pMac, WNI_CFG_SSID,
-                                (tANI_U8 *) &ssId.ssId,
-                                (tANI_U32 *) &len) != eSIR_SUCCESS)
-                {
-                        /// Could not get SSID from CFG. Log error.
-                    limLog(pMac, LOGP, FL("could not retrieve SSID\n"));
-                }
-                ssId.length = (tANI_U8) len;
-
-                PELOG2(limLog(pMac, LOG2,  FL("Sending keepalive Probe Rsp Msg to "));
-                limPrintMacAddr(pMac, pStaDs->staAddr, LOG2);)
-                limSendProbeRspMgmtFrame(pMac,
-                                         pStaDs->staAddr,
-                                         &ssId,
-                                         i,
-                                         DPH_KEEPALIVE_FRAME, 0);
-            }
-        }
-    }
-    #endif
 } /*** limSendKeepAliveToPeer() ***/
 
 
@@ -357,12 +298,6 @@
     msgLength += sizeof(tANI_U8);
 
 
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-    //aid
-    limCopyU16((tANI_U8*)pBuf, pStaDs->assocId);
-    pBuf += sizeof(tANI_U16);
-    msgLength += sizeof(tANI_U16);
-#endif
   
     //Fill in length
     limCopyU16((tANI_U8*)pLen, msgLength);
diff --git a/CORE/MAC/src/pe/lim/limLogDump.c b/CORE/MAC/src/pe/lim/limLogDump.c
index fc57623..b38234d 100644
--- a/CORE/MAC/src/pe/lim/limLogDump.c
+++ b/CORE/MAC/src/pe/lim/limLogDump.c
@@ -99,15 +99,6 @@
   }
 }
 
-#if (defined(ANI_PRODUCT_TYPE_AP) || defined(ANI_PRODUCT_TYPE_AP_SDK))
-static char *
-dumpMacAddr(tpAniSirGlobal pMac, char *p, tANI_U8 *addr)
-{
-    p += log_sprintf( pMac,p, "%2x:%2x:%2x:%2x:%2x:%2x",
-                    addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]);
-    return p;
-}
-#endif
 
 
 char *dumpLim( tpAniSirGlobal pMac, char *p, tANI_U32 sessionId)
@@ -235,7 +226,6 @@
   p += log_sprintf( pMac,p, "\nProbe response disable          = %d\n",
                   pMac->lim.gLimProbeRespDisableFlag);
 
-#if (WNI_POLARIS_FW_PRODUCT == WLAN_STA)
   p += log_sprintf( pMac,p, "Scan mode enable                = %d\n",
                   pMac->sys.gSysEnableScanMode);
   p += log_sprintf( pMac,p, "BackgroundScanDisable           = %d\n",
@@ -280,12 +270,6 @@
           }
       }
   }
-#else
-  p += log_sprintf( pMac,p, "Measurements enabled            = %d\n",
-                  pMac->sys.gSysEnableLearnMode);
-  p += log_sprintf( pMac,p, "Scan Mode for Learn Mode enable = %d\n",
-                  pMac->lim.gLimUseScanModeForLearnMode);
-#endif
   p += log_sprintf( pMac,p, "System Scan/Learn Mode bit      = %d\n",
                   pMac->lim.gLimSystemInScanLearnMode);
   p += log_sprintf( pMac,p, "Scan override                   = %d\n",
@@ -308,70 +292,6 @@
   p += log_sprintf( pMac,p, "Protection %s\n", pMac->lim.gLimProtectionControl ? "Enabled" : "Disabled");
 
   p += log_sprintf( pMac,p, "OBSS MODE = %d\n", pMac->lim.gHTObssMode);
-#if (defined(ANI_PRODUCT_TYPE_AP) || defined(ANI_PRODUCT_TYPE_AP_SDK))
-
-    p += log_sprintf( pMac,p, "\nNumber of active OLBC detected = %d\n",
-                    pMac->lim.gLimOlbcParams.numSta);
-    if (pMac->lim.gLimOlbcParams.protectionEnabled)
-        p += log_sprintf( pMac,p, "Protection due to OLBC is ON\n");
-    else
-        p += log_sprintf( pMac,p, "Protection due to OLBC is OFF\n");
-
-    p += log_sprintf( pMac,p, "Content of OLBC cache: \n");
-    for (i=0; i<LIM_PROT_STA_OVERLAP_CACHE_SIZE; i++)
-    {
-        if (pMac->lim.protStaOverlapCache[i].active)
-        {
-            p = dumpMacAddr(pMac, p, pMac->lim.protStaOverlapCache[i].addr);
-            p += log_sprintf( pMac,p, "\n");
-        }
-    }
-
-    p += log_sprintf( pMac,p, "Content of Protection cache: \n");
-    for (i=0; i<LIM_PROT_STA_CACHE_SIZE; i++)
-    {
-        if (pMac->lim.protStaCache[i].active)
-        {
-            p = dumpMacAddr(pMac, p, pMac->lim.protStaCache[i].addr);
-            if(pMac->lim.protStaCache[i].protStaCacheType == eLIM_PROT_STA_CACHE_TYPE_HT20)
-                p += log_sprintf( pMac,p, " Type: HT20\n");
-            else if(pMac->lim.protStaCache[i].protStaCacheType == eLIM_PROT_STA_CACHE_TYPE_llB)
-                p += log_sprintf( pMac,p, " Type: 11B\n");
-             else if(pMac->lim.protStaCache[i].protStaCacheType == eLIM_PROT_STA_CACHE_TYPE_llG)
-                p += log_sprintf( pMac,p, " Type: 11G\n");
-
-            p += log_sprintf( pMac,p, "\n");
-        }
-    }
-    p += log_sprintf( pMac,p, "Count of different type sta associated\n");
-    p += log_sprintf( pMac,p, "11B         = %d, Protection: %d\n", pMac->lim.gLim11bParams.numSta, pMac->lim.gLim11bParams.protectionEnabled);
-    p += log_sprintf( pMac,p, "11G         = %d, Protection: %d\n", pMac->lim.gLim11gParams.numSta, pMac->lim.gLim11gParams.protectionEnabled);
-    p += log_sprintf( pMac,p, "nonGF      = %d, Protection: %d\n", pMac->lim.gLimNonGfParams.numSta, pMac->lim.gLimNonGfParams.protectionEnabled);
-    p += log_sprintf( pMac,p, "!LsigTxop = %d, Protection: %d\n", pMac->lim.gLimLsigTxopParams.numSta, pMac->lim.gLimLsigTxopParams.protectionEnabled);
-    p += log_sprintf( pMac,p, "ht20         = %d Protection:  %d\n", pMac->lim.gLimHt20Params.numSta, pMac->lim.gLimHt20Params.protectionEnabled);
-
-    p += log_sprintf( pMac,p, "\nNumber of STA do not support short preamble = %d\n",
-                  pMac->lim.gLimNoShortParams.numNonShortPreambleSta);
-    for (i=0; i<LIM_PROT_STA_CACHE_SIZE; i++)
-    {
-        if (pMac->lim.gLimNoShortParams.staNoShortCache[i].active)
-        {
-            p = dumpMacAddr(pMac, p, pMac->lim.gLimNoShortParams.staNoShortCache[i].addr);
-            p += log_sprintf( pMac,p, "\n");
-        }
-    }
-
-    p += log_sprintf( pMac,p, "\nNumber of STA do not support short slot time = %d\n",
-                    pMac->lim.gLimNoShortSlotParams.numNonShortSlotSta);
-    for (i=0; i<LIM_PROT_STA_CACHE_SIZE; i++)
-    {
-        if (pMac->lim.gLimNoShortSlotParams.staNoShortSlotCache[i].active)
-        {
-            p = dumpMacAddr(pMac, p, pMac->lim.gLimNoShortSlotParams.staNoShortSlotCache[i].addr);
-            p += log_sprintf( pMac,p, "\n");
-        }
-    }
-#endif
     p += log_sprintf( pMac, p, "HT operating Mode = %d, llbCoexist = %d, llgCoexist = %d, ht20Coexist = %d, nonGfPresent = %d, RifsMode = %d, lsigTxop = %d\n",
                       pMac->lim.gHTOperMode, pMac->lim.llbCoexist, pMac->lim.llgCoexist,
                       pMac->lim.ht20MhzCoexist, pMac->lim.gHTNonGFDevicesPresent,
@@ -1208,9 +1128,6 @@
     palCopyMemory( pMac->hHdd, (tANI_U8 *) &mlmDisassocInd.peerMacAddr,
                                 (tANI_U8 *) pStaDs->staAddr, sizeof(tSirMacAddr));
     mlmDisassocInd.reasonCode = reasonCode;
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-    mlmDisassocInd.aid        = pStaDs->assocId;
-#endif
     mlmDisassocInd.disassocTrigger = eLIM_PEER_ENTITY_DISASSOC;
 
     mlmDisassocInd.sessionId = psessionEntry->peSessionId;
@@ -1732,37 +1649,6 @@
 
     p += log_sprintf(pMac, p, "11h Enabled = %s\n", pMac->lim.gLim11hEnable? "TRUE": "FALSE");
 
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED) && defined(ANI_PRODUCT_TYPE_AP)
-    p += log_sprintf(pMac, p, "Measurement request issued by WSM = %s\n",
-                              (pMac->lim.gpLimMeasReq != NULL)? "ISSUED": "NOT ISSUED");
-    p += log_sprintf(pMac, p, "Measurement request details...\n");
-    if (pMac->lim.gpLimMeasReq != NULL)
-    {
-        p += log_sprintf(pMac, p, "numChannels = %d, periodicMeasEnabled = %d, measIndPeriod = %d,"
-            "shortTermPeriod = %d, averagingPeriod = %d, shortChannelScanDuration = %d,"
-            "longChannelScanDuration = %d, SYS_TICK_DUR_MS = %d\n",
-            pMac->lim.gpLimMeasReq->channelList.numChannels, pMac->lim.gpLimMeasReq->measControl.periodicMeasEnabled,
-            pMac->lim.gpLimMeasReq->measIndPeriod, pMac->lim.gpLimMeasReq->measDuration.shortTermPeriod,
-            pMac->lim.gpLimMeasReq->measDuration.averagingPeriod,
-            pMac->lim.gpLimMeasReq->measDuration.shortChannelScanDuration,
-            pMac->lim.gpLimMeasReq->measDuration.longChannelScanDuration, SYS_TICK_DUR_MS );
-
-        p += log_sprintf(pMac, p, "Measurement channels...\n");
-        for (i = 0; i < pMac->lim.gpLimMeasReq->channelList.numChannels; i++)
-        {
-            p += log_sprintf(pMac, p, "%d ", pMac->lim.gpLimMeasReq->channelList.channelNumber[i]);
-        }
-        p += log_sprintf(pMac, p, "\n");
-        p += log_sprintf(pMac, p, "Total Number of BSS learned = %d\n", pMac->lim.gpLimMeasData->numBssWds);
-        p += log_sprintf(pMac, p, "Total Number of Channels learned = %d\n", pMac->lim.gpLimMeasData->numMatrixNodes);
-        p += log_sprintf(pMac, p, "Duration of learning = %d\n", pMac->lim.gpLimMeasData->duration);
-        p += log_sprintf(pMac, p, "Is measurement Indication timer active = %s\n",
-                                  (pMac->lim.gLimMeasParams.isMeasIndTimerActive)?"YES": "NO");
-        p += log_sprintf(pMac, p, "Next learn channel Id = %d\n", pMac->lim.gLimMeasParams.nextLearnChannelId);
-    }
-    p += log_sprintf(pMac, p, "Measurement running = %s\n",
-                              pMac->sys.gSysEnableLearnMode?"TRUE": "FALSE");
-#endif
     p += log_sprintf(pMac, p, "Is system in learn mode = %s\n",
                               pMac->lim.gLimSystemInScanLearnMode?"YES": "NO");
     
diff --git a/CORE/MAC/src/pe/lim/limProcessActionFrame.c b/CORE/MAC/src/pe/lim/limProcessActionFrame.c
index b2d6e91..b22c6a0 100644
--- a/CORE/MAC/src/pe/lim/limProcessActionFrame.c
+++ b/CORE/MAC/src/pe/lim/limProcessActionFrame.c
@@ -53,11 +53,7 @@
 #include "wniApi.h"
 #include "sirApi.h"
 #include "aniGlobal.h"
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-#include "wniCfgAp.h"
-#else
 #include "wniCfgSta.h"
-#endif
 #include "schApi.h"
 #include "utilsApi.h"
 #include "limTypes.h"
@@ -483,145 +479,6 @@
 static void
 __limProcessAddTsReq(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry)
 {
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-
-    tSirAddtsReqInfo addts;
-    tSirRetStatus    retval;
-    tpSirMacMgmtHdr  pHdr;
-    tSirMacScheduleIE schedule;
-    tpDphHashNode    pSta;
-    tANI_U16              status;
-    tANI_U16              aid;
-    tANI_U32              frameLen;
-    tANI_U8              *pBody;
-    tANI_U8 tspecIdx = 0; //index in the sch tspec table.
-
-    pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
-    pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo);
-    frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo);
-
-
-    if ((psessionEntry->limSystemRole != eLIM_AP_ROLE)||(psessionEntry->limSystemRole != eLIM_BT_AMP_AP_ROLE))
-    {
-        PELOGW(limLog(pMac, LOGW, FL("AddTs request at non-AP: ignoring\n"));)
-        return;
-    }
-
-    pSta = dphLookupHashEntry(pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable);
-    if (pSta == NULL)
-    {
-        PELOGE(limLog(pMac, LOGE, FL("Station context not found - ignoring AddTs\n"));)
-        return;
-    }
-
-    PELOGW(limLog(pMac, LOGW, "AddTs Request from STA %d\n", aid);)
-    retval = sirConvertAddtsReq2Struct(pMac, pBody, frameLen, &addts);
-    if (retval != eSIR_SUCCESS)
-    {
-        PELOGW(limLog(pMac, LOGW, FL("AddTs parsing failed (error %d)\n"), retval);)
-        return;
-    }
-
-    status = eSIR_MAC_SUCCESS_STATUS;
-
-
-    if (addts.wmeTspecPresent)
-    {
-        if ((! psessionEntry->limWmeEnabled) || (! pSta->wmeEnabled))
-        {
-            PELOGW(limLog(pMac, LOGW, FL("Ignoring addts request: wme not enabled/capable\n"));)
-            status = eSIR_MAC_WME_REFUSED_STATUS;
-        }
-        else
-        {
-            PELOG2(limLog(pMac, LOG2, FL("WME Addts received\n"));)
-        }
-    }
-    else if (addts.wsmTspecPresent)
-    {
-        if ((! psessionEntry->limWsmEnabled) || (! pSta->wsmEnabled))
-        {
-            PELOGW(limLog(pMac, LOGW, FL("Ignoring addts request: wsm not enabled/capable\n"));)
-            status = eSIR_MAC_REQ_DECLINED_STATUS;
-        }
-        else
-        {
-            PELOG2(limLog(pMac, LOG2, FL("WSM Addts received\n"));)
-        }
-    }
-    else if ((! psessionEntry->limQosEnabled) || (! pSta->lleEnabled))
-    {
-        PELOGW(limLog(pMac, LOGW, FL("Ignoring addts request: qos not enabled/capable\n"));)
-        status = eSIR_MAC_REQ_DECLINED_STATUS;
-    }
-    else
-    {
-        PELOG2(limLog(pMac, LOG2, FL("11e QoS Addts received\n"));)
-    }
-
-    // for edca, if no Admit Control, ignore the request
-    if ((status == eSIR_MAC_SUCCESS_STATUS) &&
-        (addts.tspec.tsinfo.traffic.accessPolicy == SIR_MAC_ACCESSPOLICY_EDCA) &&
-        (! psessionEntry->gLimEdcaParamsBC[upToAc(addts.tspec.tsinfo.traffic.userPrio)].aci.acm))
-    {
-        limLog(pMac, LOGW, FL("AddTs with UP %d has no ACM - ignoring request\n"),
-               addts.tspec.tsinfo.traffic.userPrio);
-        status = (addts.wmeTspecPresent) ?
-                 eSIR_MAC_WME_REFUSED_STATUS : eSIR_MAC_UNSPEC_FAILURE_STATUS;
-    }
-
-    if (status != eSIR_MAC_SUCCESS_STATUS)
-    {
-        limSendAddtsRspActionFrame(pMac, pHdr->sa, status, &addts, NULL,psessionEntry);
-        return;
-    }
-
-    // try to admit the STA and send the appropriate response
-    retval = limAdmitControlAddTS(pMac, &pSta->staAddr[0], &addts, NULL, pSta->assocId, true, &schedule, &tspecIdx, psessionEntry);
-    if (retval != eSIR_SUCCESS)
-    {
-        PELOGW(limLog(pMac, LOGW, FL("Unable to admit TS\n"));)
-        status = (addts.wmeTspecPresent) ?
-                 eSIR_MAC_WME_REFUSED_STATUS : eSIR_MAC_UNSPEC_FAILURE_STATUS;
-    }
-    else if (addts.tspec.tsinfo.traffic.accessPolicy == SIR_MAC_ACCESSPOLICY_EDCA)
-    {
-        if(eSIR_SUCCESS != limSendHalMsgAddTs(pMac, pSta->staIndex, tspecIdx, addts.tspec, psessionEntry->peSessionId))
-        {
-          limLog(pMac, LOGW, FL("AddTs with UP %d failed in limSendHalMsgAddTs - ignoring request\n"),
-                 addts.tspec.tsinfo.traffic.userPrio);
-          status = (addts.wmeTspecPresent) ?
-                   eSIR_MAC_WME_REFUSED_STATUS : eSIR_MAC_UNSPEC_FAILURE_STATUS;
-
-           limAdmitControlDeleteTS(pMac, pSta->assocId, &addts.tspec.tsinfo, NULL, &tspecIdx);
-        }
-        if (status != eSIR_MAC_SUCCESS_STATUS)
-        {
-            limSendAddtsRspActionFrame(pMac, pHdr->sa, status, &addts, NULL,psessionEntry);
-            return;
-        }
-    }
-#if 0 //only EDCA is supported now.
-    else if (addts.numTclas > 1)
-    {
-        limLog(pMac, LOGE, FL("Sta %d: Too many Tclas (%d), only 1 supported\n"),
-               aid, addts.numTclas);
-        status = (addts.wmeTspecPresent) ?
-                 eSIR_MAC_WME_REFUSED_STATUS : eSIR_MAC_UNSPEC_FAILURE_STATUS;
-    }
-    else if (addts.numTclas == 1)
-    {
-        limLog(pMac, LOGW, "AddTs Request from STA %d: tsid %d, UP %d, OK!\n", aid,
-               addts.tspec.tsinfo.traffic.tsid, addts.tspec.tsinfo.traffic.userPrio);
-        status = eSIR_MAC_SUCCESS_STATUS;
-    }
-#endif
-
-    limLog(pMac, LOGW, "AddTs Request from STA %d: Sending AddTs Response with status %d\n",
-           aid, status);
-
-    limSendAddtsRspActionFrame(pMac, pHdr->sa, status, &addts, &schedule,psessionEntry);
-#endif
 }
 
 
@@ -903,14 +760,7 @@
     if ((tsinfo->traffic.accessPolicy == SIR_MAC_ACCESSPOLICY_EDCA))
     {
     
-#if(defined(ANI_PRODUCT_TYPE_AP) || defined(ANI_PRODUCT_TYPE_AP_SDK))
-        if ((psessionEntry->limSystemRole == eLIM_AP_ROLE &&
-        (! psessionEntry->gLimEdcaParamsBC[upToAc(tsinfo->traffic.userPrio)].aci.acm)) ||
-        (psessionEntry->limSystemRole != eLIM_AP_ROLE &&
-        (! psessionEntry->gLimEdcaParams[upToAc(tsinfo->traffic.userPrio)].aci.acm)))
-#else
         if ((upToAc(tsinfo->traffic.userPrio) >= MAX_NUM_AC) || (! psessionEntry->gLimEdcaParams[upToAc(tsinfo->traffic.userPrio)].aci.acm))
-#endif
         {
             limLog(pMac, LOGW, FL("DelTs with UP %d has no AC - ignoring request\n"),
                    tsinfo->traffic.userPrio);
diff --git a/CORE/MAC/src/pe/lim/limProcessAssocReqFrame.c b/CORE/MAC/src/pe/lim/limProcessAssocReqFrame.c
index 52b2ec0..c75efcb 100644
--- a/CORE/MAC/src/pe/lim/limProcessAssocReqFrame.c
+++ b/CORE/MAC/src/pe/lim/limProcessAssocReqFrame.c
@@ -53,7 +53,7 @@
  */
 #include "palTypes.h"
 #include "aniGlobal.h"
-#include "wniCfgAp.h"
+#include "wniCfgSta.h"
 #include "sirApi.h"
 #include "cfgApi.h"
 
@@ -301,11 +301,7 @@
         limLog(pMac, LOGP, FL("could not retrieve Capabilities\n"));
         goto error;
     }
-#if defined(ANI_PRODUCT_TYPE_AP) && defined(ANI_LITTLE_BYTE_ENDIAN)
-    *(tANI_U16*)&localCapabilities=(tANI_U16)(temp);
-#else
     limCopyU16((tANI_U8 *) &localCapabilities, temp);
-#endif
 
     if (limCompareCapabilities(pMac,
                                pAssocReq,
@@ -339,45 +335,6 @@
 
     updateContext = false;
 
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED)
-    // Check if multiple SSID feature is not enabled
-    if (psessionEntry->pLimStartBssReq->ssId.length)
-    {
-        if (limCmpSSid(pMac, &pAssocReq->ssId, psessionEntry) == false)
-        {
-            /*Temp hack for UPF35 - skip SSID check in order to be able to interop 
-             with Marvel - they send their own SSID instead of ours*/
-            if ( 0 != vos_get_skip_ssid_check())
-            {
-                limLog(pMac, LOG1, FL("Received unmatched SSID but cfg to suppress - continuing\n"));
-            }
-            else
-            {
-              /**
-              * Received Re/Association Request with either
-              * Broadcast SSID OR with SSID that does not
-              * match with local one.
-              * Respond with unspecified status code.
-              */
-              limSendAssocRspMgmtFrame(pMac,
-                               eSIR_MAC_UNSPEC_FAILURE_STATUS,
-                               1,
-                               pHdr->sa,
-                               subType, 0,psessionEntry);
-  
-              // Log error
-              if (subType == LIM_ASSOC)
-                  limLog(pMac, LOGW, FL("received Assoc req with unmatched SSID from \n"));
-              else
-                  limLog(pMac, LOGW, FL("received ReAssoc req with unmatched SSID from \n"));
-              limPrintMacAddr(pMac, pHdr->sa, LOGW);
-              goto error;
-          }
-      }
-    }
-    else
-        limLog(pMac, LOG1, FL("Suppressed SSID, App is going to check SSID\n"));
-#else
     if (limCmpSSid(pMac, &pAssocReq->ssId, psessionEntry) == false)
     {
         /**
@@ -402,7 +359,6 @@
         limPrintMacAddr(pMac, pHdr->sa, LOGW);
         goto error;
     }
-#endif
 
     /***************************************************************
       ** Verify if the requested rates are available in supported rate
@@ -1393,9 +1349,6 @@
     if (subType == LIM_ASSOC || subType == LIM_REASSOC)
     {
         temp  = sizeof(tLimMlmAssocInd);
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED) && defined(ANI_PRODUCT_TYPE_AP)        
-        temp += pAssocReq->propIEinfo.numBss * sizeof(tSirNeighborBssInfo);
-#endif        
 
         if( eHAL_STATUS_SUCCESS != palAllocateMemory( pMac->hHdd, (void **)&pMlmAssocInd, temp))
         {
@@ -1412,36 +1365,6 @@
         pMlmAssocInd->sessionId = psessionEntry->peSessionId;
         pMlmAssocInd->authType =  pStaDs->mlmStaContext.authType;
  
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED) && defined(ANI_PRODUCT_TYPE_AP)
-        // Note for BTAMP: no need to fill in pMlmAssocInd->seqNum
-        pMlmAssocInd->wniIndicator = (tAniBool) pAssocReq->propIEinfo.aniIndicator;
-        pMlmAssocInd->bpIndicator  = (tAniBool) pAssocReq->propIEinfo.bpIndicator;
-        pMlmAssocInd->bpType       = (tSirBpIndicatorType) pAssocReq->propIEinfo.bpType;
-        if (pAssocReq->extendedRatesPresent)
-        {
-            pMlmAssocInd->nwType = eSIR_11G_NW_TYPE;
-            limSetStaHashErpMode(pMac, pStaDs->assocId, eHAL_SET);
-        }
-        else
-        {
-            if (phyMode == WNI_CFG_PHY_MODE_11A)
-                pMlmAssocInd->nwType = eSIR_11A_NW_TYPE;
-            else
-            {
-                pMlmAssocInd->nwType = eSIR_11B_NW_TYPE;
-                limSetStaHashErpMode(pMac, pStaDs->assocId, eHAL_CLEAR);
-            }
-        }
-        pMlmAssocInd->assocType = (tSirAssocType)pAssocReq->propIEinfo.assocType;
-        pMlmAssocInd->load.numStas = psessionEntry->gLimNumOfCurrentSTAs;
-        pMlmAssocInd->load.channelUtilization =(pMac->lim.gpLimMeasData) ? pMac->lim.gpLimMeasData->avgChannelUtilization : 0;
-        pMlmAssocInd->numBss = (tANI_U32) pAssocReq->propIEinfo.numBss;
-        if (pAssocReq->propIEinfo.numBss)
-        {
-            palCopyMemory( pMac->hHdd,(tANI_U8 *) pMlmAssocInd->neighborList,(tANI_U8 *)pAssocReq->propIEinfo.pBssList,
-                           (sizeof(tSirNeighborBssInfo) * pAssocReq->propIEinfo.numBss));
-        } 
-#endif
         pMlmAssocInd->capabilityInfo = pAssocReq->capabilityInfo;
 
         // Fill in RSN IE information
@@ -1537,9 +1460,6 @@
         // If its of Reassociation Request, then post LIM_MLM_REASSOC_IND 
         temp  = sizeof(tLimMlmReassocInd);
 
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED)
-        temp += pAssocReq->propIEinfo.numBss * sizeof(tSirNeighborBssInfo);
-#endif
         if( eHAL_STATUS_SUCCESS != palAllocateMemory( pMac->hHdd, (void **)&pMlmReassocInd, temp))
         {
             limLog(pMac, LOGP, FL("call to palAllocateMemory failed for pMlmReassocInd\n"));
@@ -1554,40 +1474,6 @@
         pMlmReassocInd->authType = pStaDs->mlmStaContext.authType;
         palCopyMemory( pMac->hHdd,(tANI_U8 *)&pMlmReassocInd->ssId, (tANI_U8 *)&(pAssocReq->ssId), pAssocReq->ssId.length + 1);
 
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED) && defined(ANI_PRODUCT_TYPE_AP)
-        // Note for BTAMP: no need to fill in pMlmAssocInd->seqNum
-        pMlmReassocInd->wniIndicator = (tAniBool) pAssocReq->propIEinfo.aniIndicator;
-        pMlmReassocInd->bpIndicator  = (tAniBool) pAssocReq->propIEinfo.bpIndicator;
-        pMlmReassocInd->bpType       = (tSirBpIndicatorType) pAssocReq->propIEinfo.bpType;
-        if (pAssocReq->extendedRatesPresent)
-        {
-            pMlmReassocInd->nwType = eSIR_11G_NW_TYPE;
-            limSetStaHashErpMode(pMac, pStaDs->assocId, eHAL_SET);
-        }
-        else
-        {
-            if (phyMode == WNI_CFG_PHY_MODE_11A)
-                pMlmReassocInd->nwType = eSIR_11A_NW_TYPE;
-            else
-            {
-                pMlmReassocInd->nwType = eSIR_11B_NW_TYPE;
-                limSetStaHashErpMode(pMac, pStaDs->assocId, eHAL_CLEAR);
-            }
-        }
-
-        pMlmReassocInd->reassocType  = (tSirAssocType)pAssocReq->propIEinfo.assocType;
-        pMlmReassocInd->load.numStas = psessionEntry->gLimNumOfCurrentSTAs;
-        pMlmReassocInd->load.channelUtilization = (pMac->lim.gpLimMeasData) ?
-                                                  pMac->lim.gpLimMeasData->avgChannelUtilization : 0;
-        pMlmReassocInd->numBss = (tANI_U32) pAssocReq->propIEinfo.numBss;
-        if (pAssocReq->propIEinfo.numBss)
-        {
-            palCopyMemory( pMac->hHdd, 
-                           (tANI_U8 *) pMlmReassocInd->neighborList,
-                           (tANI_U8 *) pAssocReq->propIEinfo.pBssList,
-                           (sizeof(tSirNeighborBssInfo) * pAssocReq->propIEinfo.numBss));
-        }
-#endif
         if (pAssocReq->propIEinfo.aniIndicator)
             pStaDs->aniPeer = 1;
 
diff --git a/CORE/MAC/src/pe/lim/limProcessAssocRspFrame.c b/CORE/MAC/src/pe/lim/limProcessAssocRspFrame.c
index e8c8850..1e7e7dc 100644
--- a/CORE/MAC/src/pe/lim/limProcessAssocRspFrame.c
+++ b/CORE/MAC/src/pe/lim/limProcessAssocRspFrame.c
@@ -53,11 +53,7 @@
  */
 
 #include "wniApi.h"
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-#include "wniCfgAp.h"
-#else
 #include "wniCfgSta.h"
-#endif
 #include "aniGlobal.h"
 #include "cfgApi.h"
 
@@ -242,7 +238,6 @@
 
 }
 
-#if defined(ANI_PRODUCT_TYPE_CLIENT) || defined(ANI_AP_CLIENT_SDK)
 /**
  * @function : limUpdateReAssocGlobals
  *
@@ -290,7 +285,6 @@
 
     
 }
-#endif
 
 /**
  * @function : limProcessAssocRspFrame
@@ -325,9 +319,7 @@
     tpSirAssocRsp         pAssocRsp;
     tLimMlmAssocCnf       mlmAssocCnf;
     
-#ifdef ANI_PRODUCT_TYPE_CLIENT
     tSchBeaconStruct *pBeaconStruct;
-#endif
 
     //Initialize status code to success.
 
@@ -802,7 +794,6 @@
         limDeletePreAuthNode(pMac, pHdr->sa);
 
     limUpdateAssocStaDatas(pMac, pStaDs, pAssocRsp,psessionEntry);
-#ifdef ANI_PRODUCT_TYPE_CLIENT
     // Extract the AP capabilities from the beacon that was received earlier
     // TODO - Watch out for an error response!
     limExtractApCapabilities( pMac,
@@ -835,22 +826,6 @@
         mlmAssocCnf.protStatusCode = eSIR_MAC_UNSPEC_FAILURE_STATUS;
     }
 
-#elif defined(ANI_AP_CLIENT_SDK)
-    if( eSIR_SUCCESS == limStaSendAddBss( pMac, *pAssocRsp, 
-                            &psessionEntry->pLimJoinReq->neighborBssList.bssList[0], true))
-    {
-        palFreeMemory(pMac->hHdd, pAssocRsp);   
-        return;
-    }
-    else
-    {
-        mlmAssocCnf.resultCode = eSIR_SME_RESOURCES_UNAVAILABLE;
-        mlmAssocCnf.protStatusCode = eSIR_MAC_UNSPEC_FAILURE_STATUS;
-    }
-#else
-    palFreeMemory(pMac->hHdd, pAssocRsp);   
-    return;
-#endif
   
 
 assocReject:
diff --git a/CORE/MAC/src/pe/lim/limProcessAuthFrame.c b/CORE/MAC/src/pe/lim/limProcessAuthFrame.c
index 31168c0..a77bdba 100644
--- a/CORE/MAC/src/pe/lim/limProcessAuthFrame.c
+++ b/CORE/MAC/src/pe/lim/limProcessAuthFrame.c
@@ -54,11 +54,7 @@
  */
 
 #include "wniApi.h"
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-#include "wniCfgAp.h"
-#else
 #include "wniCfgSta.h"
-#endif
 #include "aniGlobal.h"
 #include "cfgApi.h"
 
@@ -683,10 +679,6 @@
                 limLog(pMac, LOGP,
                        FL("could not retrieve MaxNumPreAuth\n"));
             }
-#ifdef ANI_AP_SDK_OPT
-            if(maxNumPreAuth > SIR_SDK_OPT_MAX_NUM_PRE_AUTH)
-                maxNumPreAuth = SIR_SDK_OPT_MAX_NUM_PRE_AUTH;
-#endif // ANI_AP_SDK_OPT
             if (pMac->lim.gLimNumPreAuthContexts == maxNumPreAuth)
             {
                 /**
diff --git a/CORE/MAC/src/pe/lim/limProcessBeaconFrame.c b/CORE/MAC/src/pe/lim/limProcessBeaconFrame.c
index d1f4e90..c5cbef9 100644
--- a/CORE/MAC/src/pe/lim/limProcessBeaconFrame.c
+++ b/CORE/MAC/src/pe/lim/limProcessBeaconFrame.c
@@ -52,15 +52,10 @@
  *
  */
 
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-#include "wniCfgAp.h"
-#else
 #include "wniCfgSta.h"
-#endif
 #include "aniGlobal.h"
 #include "cfgApi.h"
 #include "schApi.h"
-#include "wniCfgAp.h"
 #include "utilsApi.h"
 #include "limTypes.h"
 #include "limUtils.h"
@@ -165,17 +160,6 @@
         }
         else if (pMac->lim.gLimMlmState == eLIM_MLM_LEARN_STATE)
         {
-#if (WNI_POLARIS_FW_PRODUCT == AP) && (WNI_POLARIS_FW_PACKAGE == ADVANCED)
-            // STA/AP is in learn mode
-            /* Not sure whether the below 2 lines are needed for the station. TODO If yes, this should be 
-             * uncommented. Also when we tested enabling this, there is a crash as soon as the station
-             * comes up which needs to be fixed*/
-            //if (pMac->lim.gLimSystemRole == eLIM_STA_ROLE)
-              //  limCheckAndAddBssDescription(pMac, pBeacon, pRxPacketInfo, eANI_BOOLEAN_TRUE);
-            limCollectMeasurementData(pMac, pRxPacketInfo, pBeacon);
-           PELOG3(limLog(pMac, LOG3, FL("Parsed WDS info in Beacon frames: wdsLength=%d\n"),
-               pBeacon->propIEinfo.wdsLength);)
-#endif
         }
         else
         {
@@ -300,17 +284,6 @@
         }
         else if (pMac->lim.gLimMlmState == eLIM_MLM_LEARN_STATE)
         {
-#if (WNI_POLARIS_FW_PRODUCT == AP) && (WNI_POLARIS_FW_PACKAGE == ADVANCED)
-            // STA/AP is in learn mode
-            /* Not sure whether the below 2 lines are needed for the station. TODO If yes, this should be 
-             * uncommented. Also when we tested enabling this, there is a crash as soon as the station
-             * comes up which needs to be fixed*/
-            //if (pMac->lim.gLimSystemRole == eLIM_STA_ROLE)
-              //  limCheckAndAddBssDescription(pMac, pBeacon, pRxPacketInfo, eANI_BOOLEAN_TRUE);
-            limCollectMeasurementData(pMac, pRxPacketInfo, pBeacon);
-            limLog(pMac, LOG3, FL("Parsed WDS info in Beacon frames: wdsLength=%d\n"),
-               pBeacon->propIEinfo.wdsLength);
-#endif
         }  // end of eLIM_MLM_LEARN_STATE)       
         palFreeMemory(pMac->hHdd, pBeacon);
     } // end of (eLIM_MLM_WT_PROBE_RESP_STATE) || (eLIM_MLM_PASSIVE_SCAN_STATE)
diff --git a/CORE/MAC/src/pe/lim/limProcessCfgUpdates.c b/CORE/MAC/src/pe/lim/limProcessCfgUpdates.c
index 76822a4..3be5f67 100644
--- a/CORE/MAC/src/pe/lim/limProcessCfgUpdates.c
+++ b/CORE/MAC/src/pe/lim/limProcessCfgUpdates.c
@@ -52,11 +52,7 @@
 
 #include "aniGlobal.h"
 
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-#include "wniCfgAp.h"
-#else
 #include "wniCfgSta.h"
-#endif
 #include "sirMacProtDef.h"
 #include "cfgApi.h"
 #include "limTypes.h"
@@ -192,19 +188,6 @@
         palZeroMemory( pMac->hHdd, (void *)&pMac->lim.cfgProtection , sizeof(tCfgProtection));
     else
         {
-#if (defined(ANI_PRODUCT_TYPE_AP) || defined(ANI_PRODUCT_TYPE_AP_SDK))
-            {
-                pMac->lim.cfgProtection.overlapFromlla = (val >> WNI_CFG_PROTECTION_ENABLED_OLBC_FROM_llA) & 1;
-                pMac->lim.cfgProtection.overlapFromllb = (val >> WNI_CFG_PROTECTION_ENABLED_OLBC_FROM_llB) & 1;
-                pMac->lim.cfgProtection.overlapFromllg = (val >> WNI_CFG_PROTECTION_ENABLED_OLBC_FROM_llG) & 1;
-                pMac->lim.cfgProtection.overlapHt20 = (val >> WNI_CFG_PROTECTION_ENABLED_OLBC_HT20) & 1;
-                pMac->lim.cfgProtection.overlapNonGf = (val >> WNI_CFG_PROTECTION_ENABLED_OLBC_NON_GF) & 1;
-                pMac->lim.cfgProtection.overlapLsigTxop = (val >> WNI_CFG_PROTECTION_ENABLED_OLBC_LSIG_TXOP) & 1;
-                pMac->lim.cfgProtection.overlapRifs = (val >> WNI_CFG_PROTECTION_ENABLED_OLBC_RIFS) & 1;
-                pMac->lim.cfgProtection.overlapOBSS = (val>> WNI_CFG_PROTECTION_ENABLED_OLBC_OBSS )&1;
-
-            }
-            #endif
             pMac->lim.cfgProtection.fromlla = (val >> WNI_CFG_PROTECTION_ENABLED_FROM_llA) & 1;
             pMac->lim.cfgProtection.fromllb = (val >> WNI_CFG_PROTECTION_ENABLED_FROM_llB) & 1;
             pMac->lim.cfgProtection.fromllg = (val >> WNI_CFG_PROTECTION_ENABLED_FROM_llG) & 1;
@@ -327,7 +310,6 @@
 
             break;
 
-#if (WNI_POLARIS_FW_PRODUCT == WLAN_STA) || defined(ANI_AP_CLIENT_SDK)
         case WNI_CFG_BACKGROUND_SCAN_PERIOD:
 
 
@@ -370,44 +352,11 @@
             }
             
             break;
-#endif
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-        case WNI_CFG_PREAUTH_CLNUP_TIMEOUT:
-            if (pMac->lim.gLimSystemRole == eLIM_AP_ROLE)
-            {
-                limDeactivateAndChangeTimer(pMac,
-                                           eLIM_PRE_AUTH_CLEANUP_TIMER);
-
-#ifdef GEN6_TODO
-                /* revisit this piece of code to assign the appropriate sessionId below
-                 * priority - MEDIUM
-                 */
-                pMac->lim.limTimers.gLimPreAuthClnupTimer.sessionId = sessionId;
-#endif
-                // Reactivate pre-auth cleanup timer
-                MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, NO_SESSION, eLIM_PRE_AUTH_CLEANUP_TIMER));
-                if (tx_timer_activate(&pMac->lim.limTimers.gLimPreAuthClnupTimer)
-                                                       != TX_SUCCESS)
-                {
-                    /// Could not activate pre-auth cleanup timer.
-                    // Log error
-                    limLog(pMac, LOGP,
-                      FL("could not activate preauth cleanup timer\n"));
-                }
-               PELOG3(limLog(pMac, LOG3,
-                       FL("Updated pre-auth cleanup timeout\n"));)
-            }
-
-            break;
-
-#endif
 
         case WNI_CFG_BG_SCAN_CHANNEL_LIST:
-#if (WNI_POLARIS_FW_PRODUCT == WLAN_STA) || defined(ANI_AP_CLIENT_SDK)
             PELOG1(limLog(pMac, LOG1,
                FL("VALID_CHANNEL_LIST has changed, reset next bg scan channel\n"));)
             pMac->lim.gLimBackgroundScanChannelId = 0;
-#endif
 
             break;
 
@@ -693,9 +642,6 @@
 
     PELOG2(limLog(pMac, LOG2, FL("Applying config\n"));)
 
-#if (defined(ANI_PRODUCT_TYPE_AP) || defined(ANI_PRODUCT_TYPE_AP_SDK))
-    limCleanupMeasResources(pMac);
-#endif
     limInitWdsInfoParams(pMac);
 
     psessionEntry->limSentCapsChangeNtf = false;
diff --git a/CORE/MAC/src/pe/lim/limProcessDeauthFrame.c b/CORE/MAC/src/pe/lim/limProcessDeauthFrame.c
index 52ecafb..5048523 100644
--- a/CORE/MAC/src/pe/lim/limProcessDeauthFrame.c
+++ b/CORE/MAC/src/pe/lim/limProcessDeauthFrame.c
@@ -397,37 +397,6 @@
 
             default: // eLIM_AP_ROLE or eLIM_BT_AMP_AP_ROLE
 
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-                /// Check if there exists pre-auth context for this STA
-                if (limSearchPreAuthList(pMac, pHdr->sa) == NULL)
-                {
-                    /**
-                     * Received Deauthentication from a STA that is neither
-                     * Associated nor Pre-authenticated. Log error,
-                     * and ignore Deauthentication frame.
-                     */
-                    PELOG1(limLog(pMac, LOG1,
-                       FL("received Deauth frame from peer that does not have context, addr "));
-                    limPrintMacAddr(pMac, pHdr->sa, LOG1);)
-                }
-                else
-                {
-                    /// Delete STA from pre-auth STA list
-                    limDeletePreAuthNode(pMac,
-                                         pHdr->sa);
-
-                    palCopyMemory( pMac->hHdd,
-                           (tANI_U8 *) &mlmDeauthInd.peerMacAddr,
-                           pHdr->sa,
-                           sizeof(tSirMacAddr));
-                    mlmDeauthInd.reasonCode = reasonCode;
-                    mlmDeauthInd.aid        = 0;
-
-                    limPostSmeMessage(pMac,
-                                      LIM_MLM_DEAUTH_IND,
-                                      (tANI_U32 *) &mlmDeauthInd);
-                }
-#endif
 
                 return;
         } // end switch (pMac->lim.gLimSystemRole)
@@ -462,9 +431,6 @@
     palCopyMemory( pMac->hHdd, (tANI_U8 *) &mlmDeauthInd.peerMacAddr,
                   pStaDs->staAddr,
                   sizeof(tSirMacAddr));
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-    mlmDeauthInd.aid           = pStaDs->assocId;
-#endif
     mlmDeauthInd.reasonCode    = (tANI_U8) pStaDs->mlmStaContext.disassocReason;
     mlmDeauthInd.deauthTrigger = eLIM_PEER_ENTITY_DEAUTH;
 
diff --git a/CORE/MAC/src/pe/lim/limProcessDisassocFrame.c b/CORE/MAC/src/pe/lim/limProcessDisassocFrame.c
index 933061e..bda3de1 100644
--- a/CORE/MAC/src/pe/lim/limProcessDisassocFrame.c
+++ b/CORE/MAC/src/pe/lim/limProcessDisassocFrame.c
@@ -55,11 +55,7 @@
 #include "wniApi.h"
 #include "sirApi.h"
 #include "aniGlobal.h"
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-#include "wniCfgAp.h"
-#else
 #include "wniCfgSta.h"
-#endif
 
 #include "utilsApi.h"
 #include "limTypes.h"
@@ -305,9 +301,6 @@
                   sizeof(tSirMacAddr));
     mlmDisassocInd.reasonCode =
         (tANI_U8) pStaDs->mlmStaContext.disassocReason;
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-    mlmDisassocInd.aid        = pStaDs->assocId;
-#endif
     mlmDisassocInd.disassocTrigger = eLIM_PEER_ENTITY_DISASSOC;
 
     /* Update PE session Id  */
diff --git a/CORE/MAC/src/pe/lim/limProcessLmmMessages.c b/CORE/MAC/src/pe/lim/limProcessLmmMessages.c
index 7552b6a..a6dd9aa 100644
--- a/CORE/MAC/src/pe/lim/limProcessLmmMessages.c
+++ b/CORE/MAC/src/pe/lim/limProcessLmmMessages.c
@@ -53,11 +53,7 @@
 
 #include "aniGlobal.h"
 #include "wniApi.h"
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-#include "wniCfgAp.h"
-#else
 #include "wniCfgSta.h"
-#endif
 #include "cfgApi.h"
 #include "sirApi.h"
 #include "schApi.h"
@@ -70,717 +66,3 @@
 #include "limSession.h"
 
 
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED) && (WNI_POLARIS_FW_PRODUCT == AP)
-/**
- * limIsSmeMeasurementReqValid()
- *
- *FUNCTION:
- * This function is called by limProcessLmmMessages() upon
- * receiving SME_MEASUREMENT_REQ.
- *
- *LOGIC:
- * Message validity checks are performed in this function
- *
- *ASSUMPTIONS:
- *
- *NOTE:
- *
- * @param  pMeasReq  Pointer to Received MEASUREMENT_REQ message
- * @return true      When received SME_MEASUREMENT_REQ is formatted
- *                   correctly
- *         false     otherwise
- */
-
-inline static tANI_BOOLEAN
-limIsSmeMeasurementReqValid(tpAniSirGlobal pMac, tpSirSmeMeasurementReq pMeasReq)
-{
-#ifdef ANI_AP_SDK
-    if (!pMeasReq->channelList.numChannels ||
-        ((pMeasReq->measControl.periodicMeasEnabled) &&
-         (!pMeasReq->measIndPeriod)) ||
-        (pMeasReq->measIndPeriod &&
-         ((pMeasReq->measIndPeriod < 1))) ||
-        !pMeasReq->measDuration.shortTermPeriod ||
-        ((pMeasReq->measDuration.shortTermPeriod < 1)) ||
-        !pMeasReq->measDuration.averagingPeriod ||
-        (pMeasReq->measDuration.averagingPeriod <
-         pMeasReq->measDuration.shortTermPeriod) ||
-        !pMeasReq->measDuration.shortChannelScanDuration ||
-        ((pMeasReq->measDuration.shortChannelScanDuration <
-          1)) ||
-        !pMeasReq->measDuration.longChannelScanDuration ||
-        (pMeasReq->measDuration.longChannelScanDuration <
-         pMeasReq->measDuration.shortChannelScanDuration) ||
-        ((pMeasReq->measDuration.longChannelScanDuration <
-          1)))
-#else
-    if (!pMeasReq->channelList.numChannels ||
-        ((pMeasReq->measControl.periodicMeasEnabled) &&
-         (!pMeasReq->measIndPeriod)) ||
-        (pMeasReq->measIndPeriod &&
-         ((pMeasReq->measIndPeriod < SYS_TICK_DUR_MS))) ||
-        !pMeasReq->measDuration.shortTermPeriod ||
-        ((pMeasReq->measDuration.shortTermPeriod < SYS_TICK_DUR_MS)) ||
-        !pMeasReq->measDuration.averagingPeriod ||
-        (pMeasReq->measDuration.averagingPeriod <
-         pMeasReq->measDuration.shortTermPeriod) ||
-        !pMeasReq->measDuration.shortChannelScanDuration ||
-        ((pMeasReq->measDuration.shortChannelScanDuration <
-          SYS_TICK_DUR_MS)) ||
-        !pMeasReq->measDuration.longChannelScanDuration ||
-        (pMeasReq->measDuration.longChannelScanDuration <
-         pMeasReq->measDuration.shortChannelScanDuration) ||
-        ((pMeasReq->measDuration.longChannelScanDuration <
-          SYS_TICK_DUR_MS)))
-
-
-#endif
-    {
-        limLog(pMac, LOGW,
-               FL("Received MEASUREMENT_REQ with invalid data\n"));
-
-        return eANI_BOOLEAN_FALSE;
-    }
-    else
-        return eANI_BOOLEAN_TRUE;
-
-} /*** end limIsSmeMeasurementReqValid() ***/
-
-
-/**
- * limInitMeasResources()
- *
- *FUNCTION:
- * This function is called by limProcessLmmMessages() upon
- * receiving SME_MEASUREMENT_REQ. This function initializes
- * resources required for making measurements like creating
- * timers related to Measurement Request etc.
- *
- *LOGIC:
- *
- *ASSUMPTIONS:
- *
- *NOTE:
- *
- * @param  pMac  - Pointer to Global MAC structure
- * @param  None
- * @return None
- */
-
-inline static tSirRetStatus
-limInitMeasResources(tpAniSirGlobal pMac)
-{
-    tANI_U32    val;
-    tANI_U32    beaconInterval;
-
-    
-    // Create Meas related timers only when
-    // periodic measurements are enabled
-    if (pMac->lim.gpLimMeasReq->measControl.periodicMeasEnabled)
-    {
-        val = SYS_MS_TO_TICKS(pMac->lim.gpLimMeasReq->measIndPeriod);
-        if (tx_timer_create(
-                        &pMac->lim.gLimMeasParams.measurementIndTimer,
-                        "Meas Ind TIMEOUT",
-                        limTimerHandler,
-                        SIR_LIM_MEASUREMENT_IND_TIMEOUT,
-                        val,
-                        val,
-                        TX_NO_ACTIVATE) != TX_SUCCESS)
-        {
-            /// Could not create MeasInd timer.
-            // Log error
-            limLog(pMac, LOGP, FL("call to create MeasInd timer failed\n"));
-
-            return eSIR_SYS_TX_TIMER_CREATE_FAILED;
-        }
-        pMac->lim.gLimMeasParams.isMeasIndTimerActive = 0;
-       PELOG3(limLog(pMac, LOG3, FL("MeasurementIndication timer initialized, period = %d\n"), 
-                                                    pMac->lim.gpLimMeasReq->measIndPeriod);)
-    }
-
-    tANI_U32 learnInterval =
-            pMac->lim.gpLimMeasReq->measDuration.shortTermPeriod /
-            pMac->lim.gpLimMeasReq->channelList.numChannels;
-    if (tx_timer_create(&pMac->lim.gLimMeasParams.learnIntervalTimer,
-                        "Learn interval TIMEOUT",
-                        limTimerHandler,
-                        SIR_LIM_LEARN_INTERVAL_TIMEOUT,
-                        SYS_MS_TO_TICKS(learnInterval),
-                        0,
-                        TX_NO_ACTIVATE) != TX_SUCCESS)
-    {
-        /// Could not create learnInterval timer.
-        // Log error
-        limLog(pMac, LOGP, FL("call to create learnInterval timer failed\n"));
-
-        return eSIR_SYS_TX_TIMER_CREATE_FAILED;
-    }
-
-    val = SYS_MS_TO_TICKS(pMac->lim.gpLimMeasReq->measDuration.shortChannelScanDuration);
-    if (tx_timer_create(
-          &pMac->lim.gLimMeasParams.learnDurationTimer,
-          "Learn duration TIMEOUT",
-          limTimerHandler,
-          SIR_LIM_LEARN_DURATION_TIMEOUT,
-          val,
-          0,
-          TX_NO_ACTIVATE) != TX_SUCCESS)
-    {
-        /// Could not create LearnDuration timer.
-        // Log error
-        limLog(pMac, LOGP,
-               FL("call to create LearnDuration timer failed\n"));
-
-        return eSIR_SYS_TX_TIMER_CREATE_FAILED;
-    }
-
-    /* Copy the beacon interval from the session Id */
-    beaconInterval = psessionEntry->beaconParams.beaconInterval;
-   
-    if ((learnInterval > ( 2 * beaconInterval)) &&
-            (pMac->lim.gLimSystemRole == eLIM_AP_ROLE))
-    { 
-        //learinterval should be  > 2 * beaconinterval
-        val = SYS_MS_TO_TICKS(learnInterval - (2 * beaconInterval));
-        // Create Quiet BSS Timer
-        if ( TX_SUCCESS !=
-            tx_timer_create( &pMac->lim.limTimers.gLimQuietBssTimer,
-                             "QUIET BSS TIMER",
-                             limQuietBssTimerHandler,
-                             SIR_LIM_QUIET_BSS_TIMEOUT,
-                             val, // initial_ticks
-                             0, // reschedule_ticks
-                             TX_NO_ACTIVATE ))
-        {
-            limLog( pMac, LOGP,
-                    FL( "Failed to create gLimQuietBssTimer!" ));
-            return eSIR_SYS_TX_TIMER_CREATE_FAILED;
-        }
-
-        pMac->lim.gLimSpecMgmt.fQuietEnabled = eANI_BOOLEAN_TRUE;
-    }
-
-    pMac->lim.gLimMeasParams.shortDurationCount = 0;
-    pMac->lim.gLimMeasParams.nextLearnChannelId = 0;
-
-    pMac->lim.gLimMeasParams.rssiAlpha =
-           (100 * pMac->lim.gpLimMeasReq->measDuration.shortTermPeriod) /
-            pMac->lim.gpLimMeasReq->measDuration.averagingPeriod;
-
-    if (!pMac->lim.gLimMeasParams.rssiAlpha)
-        pMac->lim.gLimMeasParams.rssiAlpha = 1;
-
-    pMac->lim.gLimMeasParams.chanUtilAlpha =
-           (100 * learnInterval) / pMac->lim.gpLimMeasReq->measIndPeriod;
-
-    if (!pMac->lim.gLimMeasParams.chanUtilAlpha)
-        pMac->lim.gLimMeasParams.chanUtilAlpha = 1;
-
-    return eSIR_SUCCESS;
-} /*** end limInitMeasResources() ***/
-
-
-/**-----------------------------------------------
-\fn     __limFreeMeasAndSendRsp
-\brief  Free the meas related resources and send
-        response to SME.
-\param  pMac
-\param  resultCode
-\return None
- ------------------------------------------------*/
-static void
-__limFreeMeasAndSendRsp(tpAniSirGlobal pMac, tSirResultCodes resultCode)
-{
-    if (pMac->lim.gpLimMeasReq != NULL)
-    {
-        palFreeMemory( pMac->hHdd, pMac->lim.gpLimMeasReq);
-        pMac->lim.gpLimMeasReq  = NULL;
-    }
-
-    if (pMac->lim.gpLimMeasData != NULL)
-    {
-        palFreeMemory( pMac->hHdd, pMac->lim.gpLimMeasData);
-        pMac->lim.gpLimMeasData = NULL;
-    }
-
-    /// Send failure response to WSM
-    limSendSmeRsp(pMac, eWNI_SME_MEASUREMENT_RSP, resultCode);
-}
-
-/**
- * limProcessSmeMeasurementReq()
- *
- *FUNCTION:
- * This function is called by limProcessLmmMessages() upon
- * receiving SME_MEASUREMENT_REQ from WSM.
- *
- *LOGIC:
- *
- *ASSUMPTIONS:
- *
- *NOTE:
- *
- * @param  pMac      Pointer to Global MAC structure
- * @param  *pMsgBuf  A pointer to the SME message buffer
- *
- * @return None
- */
-
-static void
-limProcessSmeMeasurementReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf)
-{
-    PELOG1(limLog(pMac, LOG1, FL("SME State = %d\n"), pMac->lim.gLimSmeState);)
-    switch (pMac->lim.gLimSmeState)
-    {
-        case eLIM_SME_OFFLINE_STATE:
-        case eLIM_SME_IDLE_STATE:
-        case eLIM_SME_JOIN_FAILURE_STATE:
-        case eLIM_SME_NORMAL_STATE:
-        case eLIM_SME_LINK_EST_STATE:
-        case eLIM_SME_CHANNEL_SCAN_STATE:
-        case eLIM_SME_NORMAL_CHANNEL_SCAN_STATE:
-            break;
-
-        default:
-            limLog(pMac, LOGE,
-               FL("Received unexpected MeasReq message in state %X\n"),
-               pMac->lim.gLimSmeState);
-
-            /// Send failure response to host
-            limSendSmeRsp(
-                       pMac,
-                       eWNI_SME_MEASUREMENT_RSP,
-                       eSIR_SME_UNEXPECTED_REQ_RESULT_CODE);
-            return;
-    } // end switch (pMac->lim.gLimSmeState)
-
-    if (pMac->lim.gpLimMeasReq)
-    {
-        // There was a previous measurement req issued.
-        // Cleanup resources allocated for that request.
-        limDeleteMeasTimers(pMac);
-        limCleanupMeasData(pMac);
-    }
-    else
-    {
-        // There was no previous measurement req issued.
-        // Allocate memory required to hold measurements.
-        if (eHAL_STATUS_SUCCESS !=
-            palAllocateMemory(pMac->hHdd,
-                              (void **)&pMac->lim.gpLimMeasData,
-                              sizeof(tLimMeasData)))
-        {
-            // Log error
-            limLog(pMac, LOGE,
-                   FL("memory allocate failed for MeasData\n"));
-
-            /// Send failure response to host
-            limSendSmeRsp(pMac, eWNI_SME_MEASUREMENT_RSP,
-                          eSIR_SME_RESOURCES_UNAVAILABLE);
-            return;
-        }
-
-        palZeroMemory(pMac->hHdd, (void *)pMac->lim.gpLimMeasData,
-                      sizeof(tLimMeasData));
-        pMac->lim.gpLimMeasData->duration = 120;
-    }
-
-    if (eHAL_STATUS_SUCCESS !=
-        palAllocateMemory(pMac->hHdd,
-                          (void **)&pMac->lim.gpLimMeasReq,
-                          (sizeof(tSirSmeMeasurementReq) +
-                           SIR_MAX_NUM_CHANNELS)))
-    {
-        // Log error
-        PELOGE(limLog(pMac, LOGE, FL("memory allocate failed for MeasReq\n"));)
-
-        __limFreeMeasAndSendRsp(pMac, eSIR_SME_RESOURCES_UNAVAILABLE);
-        return;
-    }
-
-    if ((limMeasurementReqSerDes(
-                          pMac,
-                          pMac->lim.gpLimMeasReq,
-                          (tANI_U8 *) pMsgBuf) == eSIR_FAILURE) ||
-        !limIsSmeMeasurementReqValid(pMac,pMac->lim.gpLimMeasReq))
-    {
-        limLog(pMac, LOGE,
-               FL("Rx'ed MeasReq message with invalid parameters\n"));
-
-        __limFreeMeasAndSendRsp(pMac, eSIR_SME_INVALID_PARAMETERS);
-        return;
-    }
-#ifdef ANI_AP_SDK
-    /* convert from mS to TU and TICKS */
-    limConvertScanDuration(pMac);
-#endif /* ANI_AP_SDK */
-
-    // Initialize Measurement related resources
-    if (limInitMeasResources(pMac) != eSIR_SUCCESS)
-    {
-        __limFreeMeasAndSendRsp(pMac, eSIR_SME_RESOURCES_UNAVAILABLE);
-        return;
-    }
-
-   PELOG3(limLog(pMac, LOG3,
-       FL("NumChannels=%d, shortDuration=%d, shortInterval=%d, longInterval=%d\n"),
-       pMac->lim.gpLimMeasReq->channelList.numChannels,
-       pMac->lim.gpLimMeasReq->measDuration.shortTermPeriod,
-       pMac->lim.gpLimMeasReq->measDuration.shortChannelScanDuration,
-       pMac->lim.gpLimMeasReq->measDuration.longChannelScanDuration);)
-
-    limRadarInit(pMac);
-
-    /**
-     * Start Learn interval timer so that
-     * measurements are made from that
-     * timeout onwards.
-     */
-    limReEnableLearnMode(pMac);
-
-    /// All is well with MeasReq. Send response to WSM
-    limSendSmeRsp(pMac, eWNI_SME_MEASUREMENT_RSP,
-                  eSIR_SME_SUCCESS);
-    PELOG2(limLog(pMac, LOG2, FL("Sending succes response to SME\n"));)
-    
-    if (pMac->lim.gpLimMeasReq->channelList.numChannels == 1)
-        limLog(pMac, LOGE, FL("Starting Channel Availability Check on Channel %d... Wait\n"),
-                *pMac->lim.gpLimMeasReq->channelList.channelNumber);
-} /*** end limProcessSmeMeasurementReq() ***/
-
-
-/**
- * limProcessSmeSetWdsInfoReq()
- *
- *FUNCTION:
- * This function is called by limProcessLmmMessages() upon
- * receiving SME_SET_WDS_INFO_REQ from WSM.
- *
- *LOGIC:
- *
- *ASSUMPTIONS:
- *
- *NOTE:
- *
- * @param  pMac      Pointer to Global MAC structure
- * @param  *pMsgBuf  A pointer to the SME message buffer
- *
- * @return None
- */
-
-static void
-limProcessSmeSetWdsInfoReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf)
-{
-    tANI_U16                     i;
-    tSirSmeSetWdsInfoReq    wdsInfoReq;
-
-    pMac->lim.gLimNumWdsInfoSet++;
-
-    switch (pMac->lim.gLimSmeState)
-    {
-        case eLIM_SME_NORMAL_STATE:
-            break;
-
-        default:
-            limLog(pMac, LOGE,
-               FL("Rx'ed unexp SetWdsInfoReq message in state %X\n"),
-               pMac->lim.gLimSmeState);
-
-            /// Send failure response to host
-            limSendSmeRsp(
-                       pMac,
-                       eWNI_SME_SET_WDS_INFO_RSP,
-                       eSIR_SME_UNEXPECTED_REQ_RESULT_CODE);
-            return;
-    } // end switch (pMac->lim.gLimSmeState)
-
-    if ((limWdsReqSerDes( pMac,
-                                                  &wdsInfoReq,
-                          (tANI_U8 *) pMsgBuf) == eSIR_FAILURE))
-    {
-        limLog(pMac, LOGW,
-           FL("Rx'ed SetWdsInfoReq message with invalid parameters\n"));
-
-        /// Send failure response to WSM
-        limSendSmeRsp(pMac, eWNI_SME_SET_WDS_INFO_RSP,
-                      eSIR_SME_INVALID_PARAMETERS);
-
-        return;
-    }
-
-    // check whether the WDS info is the same as current
-    if ((wdsInfoReq.wdsInfo.wdsLength ==
-        psessionEntry->pLimStartBssReq->wdsInfo.wdsLength) &&
-        (palEqualMemory( pMac->hHdd,wdsInfoReq.wdsInfo.wdsBytes,
-                   psessionEntry->pLimStartBssReq->wdsInfo.wdsBytes,
-                   psessionEntry->pLimStartBssReq->wdsInfo.wdsLength) ) )
-    {
-        /// Send success response to WSM
-        limSendSmeRsp(pMac,
-                      eWNI_SME_SET_WDS_INFO_RSP,
-                      eSIR_SME_SUCCESS);
-
-        return;
-    }
-
-    // copy WDS info
-    psessionEntry->pLimStartBssReq->wdsInfo.wdsLength =
-            wdsInfoReq.wdsInfo.wdsLength;
-    for (i=0; i<wdsInfoReq.wdsInfo.wdsLength; i++)
-        psessionEntry->pLimStartBssReq->wdsInfo.wdsBytes[i] =
-            wdsInfoReq.wdsInfo.wdsBytes[i];
-
-    schSetFixedBeaconFields(pMac,psessionEntry);
-
-    /// Send success response to WSM
-    limSendSmeRsp(pMac, eWNI_SME_SET_WDS_INFO_RSP,
-                  eSIR_SME_SUCCESS);
-
-} /*** end limProcessSmeMeasurementReq() ***/
-
-
-/**
- * limProcessLearnDurationTimeout()
- *
- *FUNCTION:
- * This function is called by limProcessLmmMessages() upon
- * receiving LEARN_DURATION_TIMEOUT.
- *
- *LOGIC:
- *
- *ASSUMPTIONS:
- *
- *NOTE:
- *
- * @param  pMac      Pointer to Global MAC structure
- * @param  *pMsgBuf  A pointer to the SME message buffer
- *
- * @return None
- */
-
-static void
-limProcessLearnDurationTimeout(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf)
-{
-    if ( pMac->lim.gLimHalScanState == eLIM_HAL_IDLE_SCAN_STATE)
-    {
-        limSendHalInitScanReq(pMac, eLIM_HAL_INIT_LEARN_WAIT_STATE, eSIR_DONT_CHECK_LINK_TRAFFIC_BEFORE_SCAN );
-        return;
-    }
-
-    // Current learn duration expired.
-    if (pMac->lim.gLimMeasParams.nextLearnChannelId ==
-        pMac->lim.gpLimMeasReq->channelList.numChannels - 1)
-    {
-        //Set the resume channel to Any valid channel (invalid). 
-        //This will instruct HAL to set it to any previous valid channel.
-        peSetResumeChannel(pMac, 0, 0);
-        // Send WDA_END_SCAN_REQ to HAL first
-        limSendHalFinishScanReq(pMac, eLIM_HAL_FINISH_LEARN_WAIT_STATE);
-    }
-    else
-    {
-        pMac->lim.gLimMeasParams.nextLearnChannelId++;
-
-        if (pMac->lim.gLimSystemRole == eLIM_UNKNOWN_ROLE)
-        {
-            // LIM did not take AP/BP role yet.
-            // So continue Learn process on remaining channels
-            // Send WDA_END_SCAN_REQ to HAL first
-            limSendHalEndScanReq(pMac, (tANI_U8)pMac->lim.gLimMeasParams.nextLearnChannelId, 
-                                 eLIM_HAL_END_LEARN_WAIT_STATE);
-        }
-        else
-        {
-            //Set the resume channel to Any valid channel (invalid). 
-            //This will instruct HAL to set it to any previous valid channel.
-            peSetResumeChannel(pMac, 0, 0);
-            // Send WDA_FINISH_SCAN_REQ to HAL first
-            limSendHalFinishScanReq(pMac, eLIM_HAL_FINISH_LEARN_WAIT_STATE);
-        }
-    }
-} /*** end limProcessLearnDurationTimeout() ***/
-
-/**
- * limProcessLearnIntervalTimeout()
- *
- *FUNCTION:
- * This function is called whenever 
- * SIR_LIM_LEARN_INTERVAL_TIMEOUT message is receive.
- *
- *LOGIC:
- *
- *ASSUMPTIONS:
- *
- *NOTE:
- *
- * @param  pMac      Pointer to Global MAC structure
- *
- * @return None
- */
-
-void
-limProcessLearnIntervalTimeout(tpAniSirGlobal pMac)
-{
-    
-#ifdef GEN6_TODO
-    //fetch the sessionEntry based on the sessionId
-    //priority - MEDIUM
-    tpPESession sessionEntry;
-
-    if((sessionEntry = peFindSessionBySessionId(pMac, pMac->lim.gLimMeasParams.learnIntervalTimer.sessionId))== NULL) 
-    {
-        limLog(pMac, LOGP,FL("Session Does not exist for given sessionID\n"));
-        return;
-    }
-#endif
-
-    PELOG2(limLog(pMac, LOG2, FL("SME state = %d\n"), pMac->lim.gLimSmeState);)
-    if (!pMac->sys.gSysEnableLearnMode)
-    {
-        PELOG3(limLog(pMac, LOG3,
-                      FL("Ignoring LEARN_INTERVAL_TIMEOUT because gSysEnableLearnMode is disabled...\n"));)
-        limReEnableLearnMode(pMac);
-        return;
-    }
-
-    if (pMac->lim.gLimSystemInScanLearnMode)
-    {
-      limLog(pMac, LOGE,
-          FL("Sending START_SCAN from LIM while one req is pending\n"));
-      return;
-    }
-
-    pMac->lim.gLimPrevSmeState = pMac->lim.gLimSmeState;
-    if ((pMac->lim.gLimSmeState == eLIM_SME_OFFLINE_STATE) ||
-        (pMac->lim.gLimSmeState == eLIM_SME_IDLE_STATE) ||
-        (pMac->lim.gLimSmeState == eLIM_SME_JOIN_FAILURE_STATE))
-        pMac->lim.gLimSmeState = eLIM_SME_CHANNEL_SCAN_STATE;
-    else if (pMac->lim.gLimSmeState == eLIM_SME_NORMAL_STATE)
-        pMac->lim.gLimSmeState = eLIM_SME_NORMAL_CHANNEL_SCAN_STATE;
-    else if (pMac->lim.gLimSmeState == eLIM_SME_LINK_EST_STATE)
-        pMac->lim.gLimSmeState = eLIM_SME_LINK_EST_WT_SCAN_STATE;
-    else
-        return;
-    MTRACE(macTrace(pMac, TRACE_CODE_SME_STATE, NO_SESSION, pMac->lim.gLimSmeState));
-
-    /* The commented piece of code here is to handle the Measurement Request from WSM as Scan
-     * request in the LIM in Linux Station. Currently, the station uses Measurement request to 
-     * get the scan list. If measurement request itself is used for station also while scanning, this
-     * code can be removed. If we need to handle the measurement request as scan request, we need to 
-     * implement the below commented code in a more cleaner way(handling the SCAN_CNF, memory freeing, etc)
-     */
-//    if (pMac->lim.gLimSystemRole != eLIM_STA_ROLE)
-    {
-        pMac->lim.gLimPrevMlmState = pMac->lim.gLimMlmState;
-        pMac->lim.gLimMlmState     = eLIM_MLM_LEARN_STATE;
-        MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, NO_SESSION, pMac->lim.gLimMlmState));
-        pMac->lim.gLimSystemInScanLearnMode = eANI_BOOLEAN_TRUE;
-    }
-#if 0
-    /**
-     * start the timer to enter into Learn mode
-     */
-    if (pMac->lim.gLimSystemRole == eLIM_STA_ROLE)
-    {
-        tLimMlmScanReq     *pMlmScanReq;
-        tANI_U32            len;
-        
-        if( eHAL_STATUS_SUCCESS != palAllocateMemory( pMac->hHdd, (void **)&pMlmScanReq,
-                                        (sizeof(tLimMlmScanReq) + WNI_CFG_VALID_CHANNEL_LIST_LEN)))
-        {
-            limLog(pMac, LOGP,
-                FL("call to palAllocateMemory failed for mlmScanReq\n"));
-            return;
-        }
-        palZeroMemory( pMac->hHdd, (tANI_U8 *) pMlmScanReq,
-                              (tANI_U32)(sizeof(tLimMlmScanReq) + WNI_CFG_VALID_CHANNEL_LIST_LEN ));
-
-        len = WNI_CFG_VALID_CHANNEL_LIST_LEN;
-        if (wlan_cfgGetStr(pMac, WNI_CFG_VALID_CHANNEL_LIST,
-                        pMlmScanReq->channelList.channelNumber,
-                        &len) != eSIR_SUCCESS)
-        {
-            limLog(pMac, LOGP,
-                  FL("could not retrieve Valid channel list\n"));
-        }
-        pMlmScanReq->channelList.numChannels = (tANI_U8) len;
-        
-        palFillMemory(pMac->hHdd, &pMlmScanReq->bssId, sizeof(tSirMacAddr), 0xff);
-        pMlmScanReq->bssType = eSIR_AUTO_MODE;
-        pMlmScanReq->scanType = eSIR_ACTIVE_SCAN;
-        pMlmScanReq->backgroundScanMode = 0;
-        pMlmScanReq->maxChannelTime = 40;
-        pMlmScanReq->minChannelTime = 20;
-        limPostMlmMessage(pMac, LIM_MLM_SCAN_REQ, (tANI_U32 *) pMlmScanReq);
-    }
-    else
-#endif        
-        limSetLearnMode(pMac);
-} 
-
-
-/**
- * limProcessLmmMessages()
- *
- *FUNCTION:
- * This function is called by limProcessMessageQueue(). This
- * function processes SME messages from WSM and MLM cnf/ind
- * messages from MLM module.
- *
- *LOGIC:
- * Depending on the message type, corresponding function will be
- * called.
- *
- *ASSUMPTIONS:
- *
- *NOTE:
- *
- * @param  pMac      Pointer to Global MAC structure
- * @param  msgType   Indicates the SME message type
- * @param  *pMsgBuf  A pointer to the SME message buffer
- *
- * @return None
- */
-
-void
-limProcessLmmMessages(tpAniSirGlobal pMac, tANI_U32 msgType, tANI_U32 *pMsgBuf)
-{
-    switch (msgType)
-    {
-        case eWNI_SME_MEASUREMENT_REQ:
-            PELOG1(limLog(pMac, LOG1, FL("Received MEASUREMENT_REQ message\n"));)
-            limProcessSmeMeasurementReq(pMac, pMsgBuf);
-
-            break;
-
-        case eWNI_SME_SET_WDS_INFO_REQ:
-
-            limProcessSmeSetWdsInfoReq(pMac, pMsgBuf);
-
-            break;
-
-        case SIR_LIM_MEASUREMENT_IND_TIMEOUT:
-            // Time to send Measurement Indication to WSM
-            limSendSmeMeasurementInd(pMac);
-
-            break;
-
-        case SIR_LIM_LEARN_INTERVAL_TIMEOUT:
-            limProcessLearnIntervalTimeout(pMac);
-            break;
-
-        case SIR_LIM_LEARN_DURATION_TIMEOUT:
-            limProcessLearnDurationTimeout(pMac, pMsgBuf);
-
-            break;
-
-        default:
-
-            break;
-    } // switch (msgType)
-
-    return;
-} /*** end limProcessLmmMessages() ***/
-
-#endif
diff --git a/CORE/MAC/src/pe/lim/limProcessMessageQueue.c b/CORE/MAC/src/pe/lim/limProcessMessageQueue.c
index 762f068..44aa2e4 100644
--- a/CORE/MAC/src/pe/lim/limProcessMessageQueue.c
+++ b/CORE/MAC/src/pe/lim/limProcessMessageQueue.c
@@ -55,11 +55,7 @@
 #include "wlan_qct_pal_packet.h"
 #include "wlan_qct_wda.h"
 
-#ifdef ANI_PRODUCT_TYPE_AP
-#include "wniCfgAp.h"
-#else
 #include "wniCfgSta.h"
-#endif
 #include "cfgApi.h"
 #include "sirCommon.h"
 #include "utilsApi.h"
@@ -352,10 +348,6 @@
 {
     tSirMacFrameCtl  fc;
     tpSirMacMgmtHdr  pHdr;
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED) && defined(ANI_PRODUCT_TYPE_AP)
-    tANI_U32         ignore = 0;
-    tSirMacAddr      bssIdRcv;
-#endif
 
     *deferMsg = false;
     pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
@@ -363,66 +355,6 @@
     limLog( pMac, LOG2, FL("ProtVersion %d, Type %d, Subtype %d\n"),
             fc.protVer, fc.type, fc.subType );
 
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED) && defined(ANI_PRODUCT_TYPE_AP)
-    // System is in DFS (Learn) mode
-    pMac->lim.numLearn++;
-
-    // Process all BDs and extract PHY stats
-    limGetBssidFromBD(pMac, (tpHalBufDesc) pRxPacketInfo, bssIdRcv, &ignore);
-
-    if ((psessionEntry->limSystemRole == eLIM_AP_ROLE) &&
-        palEqualMemory( pMac->hHdd,bssIdRcv, psessionEntry->bssId, sizeof(tSirMacAddr)))
-    {
-        /**
-                   * Frame from current BSS. Defer processing of
-                   * Disassociation/Deauthentication from
-                   * STAs that are currently associated.
-                   * Collect stats for other received frames.
-                   */
-        if ((fc.subType == SIR_MAC_MGMT_DISASSOC) ||
-            (fc.subType == SIR_MAC_MGMT_DEAUTH))
-        {
-            if (limDeferMsg(pMac, limMsg) != TX_SUCCESS)
-            {
-                PELOGE(limLog(pMac, LOGE, FL("Unable to Defer message(0x%X) limSmeState %d (prev sme state %d) sysRole %d mlm state %d (prev mlm state %d)\n"),
-                   limMsg->type, pMac->lim.gLimSmeState,  pMac->lim.gLimPrevSmeState,
-                   pMac->lim.gLimSystemRole,  pMac->lim.gLimMlmState,  pMac->lim.gLimPrevMlmState);)
-                limLogSessionStates(pMac);
-                limPrintMsgName(pMac, LOGE, limMsg->type);
-                limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, NULL, limMsg->bodyptr);
-            }
-            return;
-        }
-        pMac->lim.numLearnIgnore++;
-    }
-    else
-    {
-        // Frame received from other BSS
-        if (fc.type == SIR_MAC_DATA_FRAME && psessionEntry->limSystemRole == eLIM_AP_ROLE)
-        {
-            /**
-              * Data Frame from neighbor BSS.
-              * Extract neighbor BSS info as much as possible.
-              */
-            limCollectMeasurementData(pMac, pRxPacketInfo, NULL);
-        }
-        else if ((fc.type == SIR_MAC_MGMT_FRAME) && (fc.subType == SIR_MAC_MGMT_BEACON))
-        {
-            if (psessionEntry == NULL)
-                limProcessBeaconFrameNoSession(pMac, pRxPacketInfo);
-            else 
-                limProcessBeaconFrame(pMac, pRxPacketInfo,psessionEntry);
-        }
-        else if ((fc.type == SIR_MAC_MGMT_FRAME) && (fc.subType == SIR_MAC_MGMT_PROBE_RSP))
-        {
-            if (psessionEntry == NULL)
-                limProcessProbeRspFrameNoSession(pMac, pRxPacketInfo);
-            else
-                limProcessProbeRspFrame(pMac, pRxPacketInfo,psessionEntry);
-        }
-    }
-
-#else
     // defer all message in scan state except for Beacons and Probe Response
     if ((fc.type == SIR_MAC_MGMT_FRAME) && (fc.subType == SIR_MAC_MGMT_BEACON))
     {
@@ -454,7 +386,6 @@
         return; 
     }
  
-#endif
     limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pRxPacketInfo, (void *) limMsg->bodyptr);
     return;
 
@@ -854,14 +785,6 @@
 #endif 
 
 
-#ifdef ANI_PRODUCT_TYPE_AP
-    if ((psessionEntry->limSystemRole == eLIM_AP_ROLE) && (LIM_IS_RADAR_DETECTED(pMac)))
-    {
-        PELOGW(limLog(pMac, LOGW, FL("Dropping the received packets as radar is detected\n"));)
-        limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pRxPacketInfo, (void *) limMsg->bodyptr);
-        return;
-    }
-#endif
 
     if (fc.protVer != SIR_MAC_PROTOCOL_VERSION)
     {   // Received Frame with non-zero Protocol Version
@@ -1126,7 +1049,6 @@
     if (!defMsgDecision(pMac, limMsg))
     {
         limProcessMessages(pMac, limMsg);
-#ifdef ANI_PRODUCT_TYPE_CLIENT
         // process deferred message queue if allowed
         {
             if ( (! (pMac->lim.gLimAddtsSent))
@@ -1138,21 +1060,6 @@
                   limProcessDeferredMessageQueue(pMac);
             }
         }
-#else
-        {
-        // process deferred message queue if allowed
-            if (! (pMac->lim.gLimSystemInScanLearnMode))
-            {
-#if defined(ANI_AP_CLIENT_SDK)
-                if (pMac->lim.gLimSystemRole != eLIM_AP_ROLE && (pMac->lim.gLimAddtsSent))
-                    return;
-#endif
-
-                if (true == GET_LIM_PROCESS_DEFD_MESGS(pMac))
-                        limProcessDeferredMessageQueue(pMac);
-            }
-        }
-#endif
     }
 }
 
@@ -1655,84 +1562,6 @@
            break;
     
 
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED) && defined(ANI_PRODUCT_TYPE_AP)
-        case eWNI_SME_MEASUREMENT_REQ:
-        case eWNI_SME_SET_WDS_INFO_REQ:
-            // Message to support ANI feature set
-            // These are handled by LMM sub module
-            if (limIsSystemInScanState(pMac))
-            {
-                // System is in DFS (Learn) mode
-                // Defer processsing this message
-                if (limDeferMsg(pMac, limMsg) != TX_SUCCESS)
-                {
-                    pMac->lim.numSme++;
-                    PELOGE(limLog(pMac, LOGE, FL("Unable to Defer message(0x%X) limSmeState %d (prev sme state %d) sysRole %d mlm state %d (prev mlm state %d)\n"),
-                        limMsg->type, pMac->lim.gLimSmeState,  pMac->lim.gLimPrevSmeState,
-                        pMac->lim.gLimSystemRole,  pMac->lim.gLimMlmState,  pMac->lim.gLimPrevMlmState);)
-                    limLogSessionStates(pMac);
-                    limPrintMsgName(pMac, LOGE, limMsg->type);
-                    // Release body
-                    palFreeMemory( pMac->hHdd, (tANI_U8 *) limMsg->bodyptr);
-                    break;
-                }
-
-                if (limMsg->type == eWNI_SME_MEASUREMENT_REQ)
-                {
-                    if (GET_LIM_PROCESS_DEFD_MESGS(pMac))
-                    {
-                        //Set the resume channel to Any valid channel (invalid). 
-                        //This will instruct HAL to set it to any previous valid channel.
-                        peSetResumeChannel(pMac, 0, 0);
-                        limSendHalFinishScanReq(pMac, eLIM_HAL_FINISH_LEARN_WAIT_STATE);
-                    }
-                }
-            }
-            else
-            {
-                pMac->lim.numSme++;
-                limProcessLmmMessages(pMac,
-                                      limMsg->type,
-                                      (tANI_U32 *) limMsg->bodyptr);
-
-                // Release body
-                palFreeMemory( pMac->hHdd, (tANI_U8 *) limMsg->bodyptr);
-            }
-            break;
-
-        case SIR_LIM_LEARN_INTERVAL_TIMEOUT:
-            if ((pMac->lim.gLimSystemRole == eLIM_STA_ROLE) &&
-                ((pMac->lim.gLimMlmState == eLIM_MLM_WT_DEL_STA_RSP_STATE) ||
-                 (pMac->lim.gLimMlmState == eLIM_MLM_WT_DEL_BSS_RSP_STATE)))
-            {
-                // BP is in the process of cleaning up
-                // its state with previously assocaited AP.
-                // Discard processsing this message.
-                PELOG1(limLog(pMac, LOG1,
-                       FL("Discarding LEARN_INTERVAL_TO message\n"));)
-            }
-            else
-                limProcessLmmMessages(pMac,
-                                      limMsg->type,
-                                      (tANI_U32 *) limMsg->bodyptr);
-            break;
-
-        case SIR_LIM_MEASUREMENT_IND_TIMEOUT:
-        case SIR_LIM_LEARN_DURATION_TIMEOUT:
-            // These measurement related timeouts are
-            // handled by LMM sub module.
-            limProcessLmmMessages(pMac,
-                                  limMsg->type,
-                                  (tANI_U32 *) limMsg->bodyptr);
-
-            break;
-
-        case SIR_LIM_RADAR_DETECT_IND:
-            limDetectRadar(pMac, (tANI_U32*)limMsg->bodyptr);
-            palFreeMemory( pMac->hHdd, (tANI_U32*)limMsg->bodyptr);
-            break;
-
-#endif
 
         case SIR_LIM_ADDTS_RSP_TIMEOUT:
             limProcessSmeReqMessages(pMac,limMsg);
@@ -1763,10 +1592,6 @@
             break;
 
          case SIR_LIM_BEACON_GEN_IND: {
-#ifdef ANI_PRODUCT_TYPE_AP
-                    if (pMac->lim.gLimSystemRole == eLIM_AP_ROLE)
-                        pmmUpdateTIM(pMac, (tpBeaconGenParams)limMsg->bodyptr);
-#endif
 
                 if( pMac->lim.gLimSystemRole != eLIM_AP_ROLE )
                     schProcessPreBeaconInd(pMac, limMsg);    
@@ -1848,7 +1673,6 @@
             break;
 
         case SIR_LIM_CHANNEL_SCAN_TIMEOUT:
-#if defined(ANI_PRODUCT_TYPE_CLIENT) || defined(ANI_AP_CLIENT_SDK)
             /**
              * Background scan timeout occurred on STA.
              * This is handled by LMM sub module.
@@ -1859,31 +1683,8 @@
             //if (pMac->sys.gSysEnableScanMode)
             pMac->lim.gLimReportBackgroundScanResults = FALSE;
             limTriggerBackgroundScan(pMac);
-#endif
             break;
 
-#ifdef ANI_PRODUCT_TYPE_AP
-        case SIR_LIM_PREAUTH_CLNUP_TIMEOUT:
-            if (limIsSystemInScanState(pMac))
-            {
-                // System is in DFS (Learn) mode
-                // Defer processsing this message
-                if (limDeferMsg(pMac, limMsg) != TX_SUCCESS)
-                {
-                    PELOGE(limLog(pMac, LOGE, FL("Unable to Defer message(0x%X) limSmeState %d (prev sme state %d) sysRole %d mlm state %d (prev mlm state %d)\n"),
-                        limMsg->type, pMac->lim.gLimSmeState,  pMac->lim.gLimPrevSmeState,
-                        pMac->lim.gLimSystemRole,  pMac->lim.gLimMlmState,  pMac->lim.gLimPrevMlmState);)
-                    limLogSessionStates(pMac);
-                }
-            }
-            else
-            {
-                // Pre-authentication context cleanup timeout message
-                limPreAuthClnupHandler(pMac);
-            }
-
-            break;
-#endif
 
         case SIR_LIM_HASH_MISS_THRES_TIMEOUT:
 
diff --git a/CORE/MAC/src/pe/lim/limProcessMlmReqMessages.c b/CORE/MAC/src/pe/lim/limProcessMlmReqMessages.c
index 2f1d5c1..42a55f7 100644
--- a/CORE/MAC/src/pe/lim/limProcessMlmReqMessages.c
+++ b/CORE/MAC/src/pe/lim/limProcessMlmReqMessages.c
@@ -51,11 +51,7 @@
  *
  */
 #include "palTypes.h"
-#ifdef ANI_PRODUCT_TYPE_AP
-#include "wniCfgAp.h"
-#else
 #include "wniCfgSta.h"
-#endif
 #include "aniGlobal.h"
 #include "sirApi.h"
 #include "sirParams.h"
@@ -213,31 +209,16 @@
     /// Set current scan channel id to the first in the channel list
     pMac->lim.gLimCurrentScanChannelId = 0;
 
-#ifdef ANI_PRODUCT_TYPE_CLIENT         
-       if ( IS_MLM_SCAN_REQ_BACKGROUND_SCAN_AGGRESSIVE(pMac) )
-       {
-           checkTraffic = eSIR_DONT_CHECK_LINK_TRAFFIC_BEFORE_SCAN;
-       }
-       else if (IS_MLM_SCAN_REQ_BACKGROUND_SCAN_NORMAL(pMac))
-       {
-           checkTraffic = eSIR_CHECK_LINK_TRAFFIC_BEFORE_SCAN;
-       }
-       else 
-           checkTraffic = eSIR_CHECK_ROAMING_SCAN;
-#else
-            /* Currently checking the traffic before scan for Linux station. This is because MLM
-             * scan request is not filled as scan is received via Measurement req in Linux. This
-             * should be made as common code for Windows/Linux station once the scan requests are
-             * enabled in Linux
-             * TODO */
-       if ( IS_MLM_SCAN_REQ_BACKGROUND_SCAN_AGGRESSIVE(pMac) ||
-            IS_MLM_SCAN_REQ_BACKGROUND_SCAN_NORMAL(pMac))
-       {
-            checkTraffic = eSIR_CHECK_LINK_TRAFFIC_BEFORE_SCAN;
-       }
-       else
-            checkTraffic = eSIR_CHECK_ROAMING_SCAN;
-#endif
+    if ( IS_MLM_SCAN_REQ_BACKGROUND_SCAN_AGGRESSIVE(pMac) )
+    {
+        checkTraffic = eSIR_DONT_CHECK_LINK_TRAFFIC_BEFORE_SCAN;
+    }
+    else if (IS_MLM_SCAN_REQ_BACKGROUND_SCAN_NORMAL(pMac))
+    {
+        checkTraffic = eSIR_CHECK_LINK_TRAFFIC_BEFORE_SCAN;
+    }
+    else
+        checkTraffic = eSIR_CHECK_ROAMING_SCAN;
 
     PELOG1(limLog(pMac, LOG1, FL("Calling limSendHalInitScanReq\n"));)
     limSendHalInitScanReq(pMac, eLIM_HAL_INIT_SCAN_WAIT_STATE, checkTraffic);
@@ -253,8 +234,8 @@
  * This function returns is link is suspended or not.
  *
  *LOGIC:
- * Since Suspen link uses init scan, it just returns 
- *                    gLimSystemInScanLearnMode flag. 
+ * Since Suspend link uses init scan, it just returns
+ *                    gLimSystemInScanLearnMode flag.
  *
  *ASSUMPTIONS:
  * NA
@@ -284,7 +265,7 @@
  *NOTE:
  *
  * @param  pMac - Pointer to Global MAC structure
- * @param trafficCheck - Takes value from enum tSirLinkTrafficCheck. 
+ * @param trafficCheck - Takes value from enum tSirLinkTrafficCheck.
  * @param callback - Callback function to be called after suspending the link.
  * @param data - Pointer to any buffer that will be passed to callback.
  * @return None
@@ -367,7 +348,7 @@
  * FUNCTION:
  * This function is called to change channel and perform off channel operation
  * if required. The caller registers a callback to be called at the end of the
- * channel change. 
+ * channel change.
  *
  */
 void
@@ -562,7 +543,6 @@
                 val = SYS_MS_TO_TICKS(val);
                 //TODO: consider sessions.
 #if 0
-#ifdef ANI_PRODUCT_TYPE_CLIENT
                 // If a background was triggered via Quiet BSS,
                 // then we need to adjust the MIN and MAX channel
                 // timer's accordingly to the Quiet duration that
@@ -579,7 +559,6 @@
                     val1 = SYS_MS_TO_TICKS(pMac->lim.gpLimMlmScanReq->maxChannelTime);
                 }
 #endif
-#endif
                 //Pick the longer stay time
                 val = (val > val1) ? val : val1;
                 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, NO_SESSION, eLIM_MAX_CHANNEL_TIMER));
@@ -825,16 +804,6 @@
             limCompleteMlmScan(pMac, eSIR_SME_HAL_SCAN_INIT_FAILED);
             break;
 
-#if defined(ANI_PRODUCT_TYPE_AP) && (WNI_POLARIS_FW_PACKAGE == ADVANCED)
-        case eLIM_HAL_START_LEARN_WAIT_STATE:
-            //            if (pMac->lim.gLimSystemRole == eLIM_AP_ROLE)
-            {
-                limRestorePreLearnState(pMac);
-                limReEnableLearnMode(pMac);
-            }
-            break;
-
-#endif
 
             //WLAN_SUSPEND_LINK Related
         case eLIM_HAL_SUSPEND_LINK_WAIT_STATE:
@@ -905,16 +874,6 @@
                 limCompleteMlmScan(pMac, eSIR_SME_HAL_SCAN_INIT_FAILED);
                 break;
 
-#if defined(ANI_PRODUCT_TYPE_AP) && (WNI_POLARIS_FW_PACKAGE == ADVANCED)
-            case eLIM_HAL_START_LEARN_WAIT_STATE:
-                //if (pMac->lim.gLimSystemRole == eLIM_AP_ROLE)
-                {
-                    limRestorePreLearnState(pMac);
-                    limReEnableLearnMode(pMac);
-                }
-                break;
-
-#endif
 
             default:
                 break;
@@ -977,15 +936,6 @@
                     limCompleteMlmScan(pMac, eSIR_SME_HAL_SCAN_END_FAILED);
                     break;
 
-#if defined(ANI_PRODUCT_TYPE_AP) && (WNI_POLARIS_FW_PACKAGE == ADVANCED)
-                case eLIM_HAL_END_LEARN_WAIT_STATE:
-                    //            if (pMac->lim.gLimSystemRole == eLIM_AP_ROLE)
-                    {
-                        limRestorePreLearnState(pMac);
-                        limReEnableLearnMode(pMac);
-                    }
-                    break;
-#endif
 
                 default:
                     PELOGW(limLog(pMac, LOGW, FL("wdaPostCtrlMsg Rcvd invalid nextState %d\n"), nextState);)
@@ -1160,7 +1110,6 @@
         (tANI_U32) (pMac->lim.gpLimMlmScanReq->channelList.numChannels - 1) 
         || pMac->lim.abortScan)
     {
-#ifndef ANI_SNIFFER
         pMac->lim.abortScan = 0;
         limDeactivateAndChangeTimer(pMac, eLIM_MIN_CHANNEL_TIMER);
         limDeactivateAndChangeTimer(pMac, eLIM_MAX_CHANNEL_TIMER);
@@ -1171,7 +1120,6 @@
 
         /// Done scanning all required channels
         limSendHalFinishScanReq(pMac, eLIM_HAL_FINISH_SCAN_WAIT_STATE);
-#endif
         return;
     }
 
@@ -1743,11 +1691,6 @@
         #endif //TO SUPPORT BT-AMP
         
 
-#if defined(ANI_PRODUCT_TYPE_AP) && (WNI_POLARIS_FW_PACKAGE == ADVANCED)
-    if (cfgSetInt(pMac, WNI_CFG_CURRENT_TX_POWER_LEVEL, pMac->lim.gpLimStartBssReq->powerLevel)
-        != eSIR_SUCCESS)
-        limLog(pMac, LOGP, FL("could not set WNI_CFG_CURRENT_TX_POWER_LEVEL at CFG\n"));
-#endif
 
 #if 0 // Periodic timer for remove WPS PBC proble response entry in PE is disbaled now.
     if (psessionEntry->limSystemRole == eLIM_AP_ROLE)
@@ -2334,10 +2277,6 @@
                 limLog(pMac, LOGP,
                    FL("Could not retrieve NumPreAuthLimit from CFG\n"));
             }
-#ifdef ANI_AP_SDK_OPT
-            if(numPreAuthContexts > SIR_SDK_OPT_MAX_NUM_PRE_AUTH)
-                numPreAuthContexts = SIR_SDK_OPT_MAX_NUM_PRE_AUTH;
-#endif // ANI_AP_SDK_OPT
 
             if (pMac->lim.gLimNumPreAuthContexts == numPreAuthContexts)
             {
@@ -4217,7 +4156,6 @@
                 psessionEntry->pLimMlmJoinReq = NULL;
             }
 
-#if defined(ANI_PRODUCT_TYPE_CLIENT)
             //To remove the preauth node in case of fail to associate
             if (limSearchPreAuthList(pMac, psessionEntry->bssId))
             {
@@ -4226,7 +4164,6 @@
                     psessionEntry->bssId[3], psessionEntry->bssId[4], psessionEntry->bssId[5]);)
                 limDeletePreAuthNode(pMac, psessionEntry->bssId);
             }
-#endif
 
             mlmAssocCnf.resultCode =
                             eSIR_SME_ASSOC_TIMEOUT_RESULT_CODE;
diff --git a/CORE/MAC/src/pe/lim/limProcessMlmRspMessages.c b/CORE/MAC/src/pe/lim/limProcessMlmRspMessages.c
index 5efea22..e307ab7 100644
--- a/CORE/MAC/src/pe/lim/limProcessMlmRspMessages.c
+++ b/CORE/MAC/src/pe/lim/limProcessMlmRspMessages.c
@@ -51,11 +51,7 @@
  *
  */
 #include "wniApi.h"
-#ifdef ANI_PRODUCT_TYPE_AP
-#include "wniCfgAp.h"
-#else
 #include "wniCfgSta.h"
-#endif
 #include "cfgApi.h"
 #include "sirApi.h"
 #include "schApi.h"
@@ -629,18 +625,6 @@
                 psessionEntry->limMlmState = eLIM_MLM_IDLE_STATE;
                 MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, psessionEntry->peSessionId, psessionEntry->limMlmState));
 
-#if defined(ANI_AP_CLIENT_SDK)
-                if (psessionEntry->limSystemRole == eLIM_STA_ROLE)
-                {
-                    tSirMacAddr nullMacAddr = {0, 0, 0, 0, 0, 0};
-                    PELOGE(limLog(pMac, LOGE, FL("Setting current BSSID as NULL in cfg\n"));)
-                    palCopyMemory(pMac->hHdd, pMac->lim.gLimBssid, nullMacAddr, sizeof(tSirMacAddr));
-                    if (cfgSetStr(pMac, WNI_CFG_BSSID, nullMacAddr, sizeof(tSirMacAddr)) != eSIR_SUCCESS)
-                    {
-                        limLog(pMac, LOGP, FL("Could not update BSSID on CFG"));
-                    }
-                }
-#endif
                 /**
                  * Need to send Join response with
                  * auth failure to Host.
@@ -841,17 +825,6 @@
         PELOG1(limLog(pMac, LOG1, FL("*** Association failure ***\n"));)
         psessionEntry->limSmeState = eLIM_SME_JOIN_FAILURE_STATE;
         MTRACE(macTrace(pMac, TRACE_CODE_SME_STATE, psessionEntry->peSessionId, pMac->lim.gLimSmeState));
-#if defined(ANI_AP_CLIENT_SDK)
-        if (psessionEntry->limSystemRole == eLIM_STA_ROLE)
-        {
-            tSirMacAddr nullMacAddr = {0, 0, 0, 0, 0, 0};
-            palCopyMemory(pMac->hHdd, pMac->lim.gLimBssid, nullMacAddr, sizeof(tSirMacAddr));
-            if (cfgSetStr(pMac, WNI_CFG_BSSID, nullMacAddr, sizeof(tSirMacAddr)) != eSIR_SUCCESS)
-            {
-                limLog(pMac, LOGP, FL("Could not update BSSID on CFG"));
-            }
-        }
-#endif
         /**
          * Need to send Join response with
          * Association failure to Host.
@@ -1009,16 +982,7 @@
         return;
     }
     /// Inform Host of STA reassociation
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED)
-    len = sizeof(tSirSmeReassocInd) -
-          sizeof(tSirNeighborBssInfo) +
-          (((tpLimMlmReassocInd) pMsgBuf)->numBss *
-           sizeof(tSirNeighborBssInfo)) -
-           SIR_MAC_MAX_SSID_LENGTH +
-           ((tpLimMlmReassocInd) pMsgBuf)->ssId.length;
-#else
     len = sizeof(tSirSmeReassocInd);
-#endif
     if( eHAL_STATUS_SUCCESS != palAllocateMemory( pMac->hHdd, (void **)&pSirSmeReassocInd, len))
     {
         // Log error
@@ -1207,16 +1171,7 @@
         return;
     }
     /// Inform Host of STA association
-#if defined (ANI_PRODUCT_TYPE_AP)
-    len = sizeof(tSirSmeAssocInd) -
-              sizeof(tSirNeighborBssInfo) +
-              (((tpLimMlmAssocInd) pMsgBuf)->numBss *
-               sizeof(tSirNeighborBssInfo)) -
-              SIR_MAC_MAX_SSID_LENGTH +
-              ((tpLimMlmAssocInd) pMsgBuf)->ssId.length;
-#else
     len = sizeof(tSirSmeAssocInd);
-#endif
     if( eHAL_STATUS_SUCCESS != palAllocateMemory( pMac->hHdd, (void **)&pSirSmeAssocInd, len))
     {
         // Log error
@@ -1225,15 +1180,8 @@
         return;
     }
 
-#if defined (ANI_PRODUCT_TYPE_AP)
-    sirStoreU16N((tANI_U8 *) &pSirSmeAssocInd->messageType,
-                 eWNI_SME_ASSOC_IND);
-    limAssocIndSerDes(pMac, (tpLimMlmAssocInd) pMsgBuf,
-                      (tANI_U8 *) &(pSirSmeAssocInd->length), psessionEntry);
-#else
     pSirSmeAssocInd->messageType = eWNI_SME_ASSOC_IND;
     limFillAssocIndParams(pMac, (tpLimMlmAssocInd) pMsgBuf, pSirSmeAssocInd, psessionEntry);
-#endif
     msgQ.type = eWNI_SME_ASSOC_IND;
     msgQ.bodyptr = pSirSmeAssocInd;
     msgQ.bodyval = 0;
@@ -1374,9 +1322,6 @@
                  pMlmDisassocCnf->resultCode;
     if ((psessionEntry->limSystemRole == eLIM_STA_ROLE)|| (psessionEntry->limSystemRole == eLIM_BT_AMP_STA_ROLE))
     {
-#if defined(ANI_AP_CLIENT_SDK)
-        tSirMacAddr         nullMacAddr = {0, 0, 0, 0, 0, 0};
-#endif
         // Disassociate Confirm from MLM
         if ( (psessionEntry->limSmeState != eLIM_SME_WT_DISASSOC_STATE) &&
              (psessionEntry->limSmeState != eLIM_SME_WT_DEAUTH_STATE) )
@@ -1391,17 +1336,6 @@
                FL("received unexpected MLM_DISASSOC_CNF in state %X\n"),psessionEntry->limSmeState);)
             return;
         }
-#if defined(ANI_AP_CLIENT_SDK)
-        // Whenever there is a disassoc notification, make sure the bssId is cleared so that
-        // if the station finds the same AP to which it was associated, it can try to associate
-        // with it again. If this is not done, the beacons/probe rsp from this AP will not be given
-        // up to WSM and it never see this is AP unless a cga/reboot is done.
-        palCopyMemory(pMac->hHdd, pMac->lim.gLimBssid, nullMacAddr, sizeof(tSirMacAddr));
-        if (cfgSetStr(pMac, WNI_CFG_BSSID, nullMacAddr, sizeof(tSirMacAddr)) != eSIR_SUCCESS)
-        {
-            limLog(pMac, LOGP, FL("Could not update BSSID on CFG"));
-        }
-#endif
         if (pMac->lim.gLimRspReqd)
             pMac->lim.gLimRspReqd = false;
         if (pMlmDisassocCnf->disassocTrigger ==
@@ -1535,9 +1469,6 @@
           pMlmDeauthCnf->aid : 1;
     if ((psessionEntry->limSystemRole == eLIM_STA_ROLE)|| (psessionEntry->limSystemRole == eLIM_BT_AMP_STA_ROLE))
     {
-        #if defined(ANI_AP_CLIENT_SDK)
-        tSirMacAddr         nullMacAddr = {0, 0, 0, 0, 0, 0};
-        #endif
         // Deauth Confirm from MLM
         if (psessionEntry->limSmeState != eLIM_SME_WT_DEAUTH_STATE)
         {
@@ -1551,17 +1482,6 @@
                psessionEntry->limSmeState);)
             return;
         }
-#if defined(ANI_AP_CLIENT_SDK)
-        // Whenever there is a disassoc notification, make sure the bssId is cleared so that
-        // if the station finds the same AP to which it was associated, it can try to associate
-        // with it again. If this is not done, the beacons/probe rsp from this AP will not be given
-        // up to WSM and it never see this is AP unless a cga/reboot is done.
-        palCopyMemory(pMac->hHdd, pMac->lim.gLimBssid, nullMacAddr, sizeof(tSirMacAddr));
-        if (cfgSetStr(pMac, WNI_CFG_BSSID, nullMacAddr, sizeof(tSirMacAddr)) != eSIR_SUCCESS)
-        {
-            limLog(pMac, LOGP, FL("Could not update BSSID on CFG"));
-        }
-#endif
         if (pMlmDeauthCnf->resultCode == eSIR_SME_SUCCESS)
         {
             psessionEntry->limSmeState = eLIM_SME_IDLE_STATE;
@@ -1575,20 +1495,11 @@
         if (pMac->lim.gLimRspReqd)
             pMac->lim.gLimRspReqd = false;
     }
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED) && defined(ANI_PRODUCT_TYPE_AP)
-    // BP deauthenticated by AP or vice versa
-    // Send SME_DISASSOC_RSP to host.
-    limSendSmeDisassocNtf(pMac, pMlmDeauthCnf->peerMacAddr,
-                          resultCode,
-                          pMlmDeauthCnf->deauthTrigger,
-                          aid);
-#else
     // On STA or on BASIC AP, send SME_DEAUTH_RSP to host
     limSendSmeDeauthNtf(pMac, pMlmDeauthCnf->peerMacAddr,
                         resultCode,
                         pMlmDeauthCnf->deauthTrigger,
                         aid,psessionEntry->smeSessionId,psessionEntry->transactionId);
-#endif
 } /*** end limProcessMlmDeauthCnf() ***/
 
 /**
@@ -1615,9 +1526,6 @@
     tSirResultCodes      resultCode;
     tpLimMlmPurgeStaInd  pMlmPurgeStaInd;
     tpPESession          psessionEntry;
-#if defined(ANI_AP_CLIENT_SDK)
-    tSirMacAddr         nullMacAddr = {0, 0, 0, 0, 0, 0};
-#endif
     if(pMsgBuf == NULL)
     {
         PELOGE(limLog(pMac, LOGE,FL("Buffer is Pointing to NULL\n"));)
@@ -1662,35 +1570,14 @@
                 psessionEntry->limSmeState = eLIM_SME_IDLE_STATE;
                 MTRACE(macTrace(pMac, TRACE_CODE_SME_STATE, psessionEntry->peSessionId, psessionEntry->limSmeState));
 
-#if defined(ANI_AP_CLIENT_SDK)
-                // Whenever there is a disassoc notification, make sure the bssId is cleared so that
-                // if the station finds the same AP to which it was associated, it can try to associate
-                // with it again. If this is not done, the beacons/probe rsp from this AP will not be given
-                // up to WSM and it never see this is AP unless a cga/reboot is done.
-                palCopyMemory(pMac->hHdd, pMac->lim.gLimBssid, nullMacAddr, sizeof(tSirMacAddr));
-                if (cfgSetStr(pMac, WNI_CFG_BSSID, nullMacAddr, sizeof(tSirMacAddr)) != eSIR_SUCCESS)
-                {
-                    limLog(pMac, LOGP, FL("Could not update BSSID on CFG"));
-                }
-#endif
             }
             if (pMlmPurgeStaInd->purgeTrigger == eLIM_PEER_ENTITY_DEAUTH)
             {
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED) && defined(ANI_PRODUCT_TYPE_AP)
-                // BP deauthenticated by AP or vice versa
-                // Send SME_DISASSOC_IND to host.
-                limSendSmeDisassocNtf(pMac,
-                                    pMlmPurgeStaInd->peerMacAddr,
-                                    resultCode,
-                                    pMlmPurgeStaInd->purgeTrigger,
-                                    pMlmPurgeStaInd->aid,psessionEntry);
-#else
                 limSendSmeDeauthNtf(pMac,
                             pMlmPurgeStaInd->peerMacAddr,
                             resultCode,
                             pMlmPurgeStaInd->purgeTrigger,
                             pMlmPurgeStaInd->aid,psessionEntry->smeSessionId,psessionEntry->transactionId);
-#endif
             }
             else
                 limSendSmeDisassocNtf(pMac,
@@ -1742,11 +1629,7 @@
         pMlmSetKeysCnf->resultCode );
     limSendSmeSetContextRsp(pMac,
                             pMlmSetKeysCnf->peerMacAddr,
-#ifdef ANI_PRODUCT_TYPE_AP
-                            pMlmSetKeysCnf->aid,
-#else
                             1,
-#endif
                             (tSirResultCodes) pMlmSetKeysCnf->resultCode,psessionEntry,psessionEntry->smeSessionId,
                             psessionEntry->transactionId);
 } /*** end limProcessMlmSetKeysCnf() ***/
@@ -1961,9 +1844,7 @@
         limProcessBtAmpApMlmAddStaRsp(pMac, limMsgQ,psessionEntry);
         return;
     }
-#if defined(ANI_PRODUCT_TYPE_CLIENT) || defined(ANI_AP_CLIENT_SDK)
     limProcessStaMlmAddStaRsp(pMac, limMsgQ,psessionEntry);
-#endif
 }
 void limProcessStaMlmAddStaRsp( tpAniSirGlobal pMac, tpSirMsgQ limMsgQ ,tpPESession psessionEntry)
 {
@@ -2070,9 +1951,7 @@
         limProcessBtAmpApMlmDelBssRsp(pMac, limMsgQ,psessionEntry);
         return;
     }
-#if defined(ANI_PRODUCT_TYPE_CLIENT) || defined(ANI_AP_CLIENT_SDK)
     limProcessStaMlmDelBssRsp(pMac, limMsgQ,psessionEntry);
-#endif
 
    if(!limIsInMCC(pMac))
    {
@@ -2244,9 +2123,7 @@
         limProcessBtAmpApMlmDelStaRsp(pMac,limMsgQ,psessionEntry);
         return;
     }
-#if defined(ANI_PRODUCT_TYPE_CLIENT) || defined(ANI_AP_CLIENT_SDK)
     limProcessStaMlmDelStaRsp(pMac, limMsgQ,psessionEntry);
-#endif
 }
 
 void limProcessBtAmpApMlmDelStaRsp( tpAniSirGlobal pMac, tpSirMsgQ limMsgQ,tpPESession psessionEntry)
@@ -2536,11 +2413,7 @@
         }
         psessionEntry->bssIdx     = (tANI_U8) pAddBssParams->bssIdx;
 
-#ifdef ANI_PRODUCT_TYPE_AP
-        psessionEntry->limSystemRole = eLIM_AP_ROLE;
-#else
         psessionEntry->limSystemRole = eLIM_STA_IN_IBSS_ROLE;
-#endif
 
         if ( eSIR_INFRA_AP_MODE == pAddBssParams->bssType )
             psessionEntry->limSystemRole = eLIM_AP_ROLE;
@@ -3388,9 +3261,6 @@
         if( NULL != lpLimMlmSetKeysReq )
         {
             palCopyMemory( pMac->hHdd, (tANI_U8 *) &mlmSetKeysCnf.peerMacAddr, (tANI_U8 *) lpLimMlmSetKeysReq->peerMacAddr, sizeof(tSirMacAddr) );
-#ifdef ANI_PRODUCT_TYPE_AP
-            mlmSetKeysCnf.aid = lpLimMlmSetKeysReq->aid;
-#endif
             // Free the buffer cached for the global pMac->lim.gpLimMlmSetKeysReq
             palFreeMemory(pMac->hHdd, (tANI_U8 *) pMac->lim.gpLimMlmSetKeysReq);
             pMac->lim.gpLimMlmSetKeysReq = NULL;
@@ -3459,9 +3329,6 @@
         if( NULL != lpLimMlmSetKeysReq )
         {
             palCopyMemory( pMac->hHdd, (tANI_U8 *) &mlmSetKeysCnf.peerMacAddr, (tANI_U8 *) lpLimMlmSetKeysReq->peerMacAddr, sizeof(tSirMacAddr) );
-#ifdef ANI_PRODUCT_TYPE_AP
-            mlmSetKeysCnf.aid = lpLimMlmSetKeysReq->aid;
-#endif
             // Free the buffer cached for the global pMac->lim.gpLimMlmSetKeysReq
             palFreeMemory(pMac->hHdd, (tANI_U8 *) pMac->lim.gpLimMlmSetKeysReq);
             pMac->lim.gpLimMlmSetKeysReq = NULL;
@@ -3560,77 +3427,6 @@
     }
 }
 
-#if (defined(ANI_PRODUCT_TYPE_AP) || defined(ANI_PRODUCT_TYPE_AP_SDK))
-/**----------------------------------------------------
-\fn     __limProcessFinishLearnRsp
-\brief  Handle finish learn rsp state, only for AP.
-\param  pMac
-\return NONE
------------------------------------------------------*/
-static void __limProcessFinishLearnRsp(tpAniSirGlobal pMac)
-{
-    PELOG2(limLog(pMac, LOG2, FL("System Role: %d\n"), pMac->lim.gLimSystemRole);)
-    if (pMac->lim.gpLimMeasReq == NULL)
-    {
-        limRestorePreLearnState(pMac);
-        return;
-    }
-    /**
-      * Initial measurement -> periodic measurement should keep enabled, so that
-      * if system Role is UNKNOWN LIM can send indication to WSM. Overloading
-      * periodic measurement to distinguish initial measurement and radar
-      * detect park basically to avoid sending measurement indication after
-      * radar detect park.
-      * Radar detect park -> periodic measurement should be disabled, so that
-      * LIM wont send indication even when role is UNKNOWN.
-      * Final measurement -> periodic measurement should be enabled, so that
-      * LIM could start measurement indication timer.
-      */
-    if (pMac->lim.gpLimMeasReq->measControl.periodicMeasEnabled &&
-                !pMac->lim.gLimMeasParams.isMeasIndTimerActive)
-    {
-#if 0 /* Will we be ever in UNKNOWN ROLE: Veerendra */
-        if (pMac->lim.gLimSystemRole == eLIM_UNKNOWN_ROLE)
-        {
-            limSendSmeMeasurementInd(pMac);
-            limCleanupMeasResources(pMac);
-            limRestorePreLearnState(pMac);
-            return;
-        }
-        else
-#endif
-        {
-#ifdef GEN6_TODO
-            /* revisit this piece of code to assign the appropriate sessionId below
-             * priority - MEDIUM
-             */
-            pMac->lim.gLimMeasParams.measurementIndTimer.sessionId = sessionId;
-#endif
-            // Activate periodic measurement indication timer
-            if (tx_timer_activate(
-               &pMac->lim.gLimMeasParams.measurementIndTimer)
-               != TX_SUCCESS)
-            {
-                limLog(pMac, LOGP, FL("could not start Meas IND timer\n"));
-                return;
-            }
-            pMac->lim.gLimMeasParams.isMeasIndTimerActive = 1;
-        }
-    }
-    if (pMac->lim.gLimMeasParams.nextLearnChannelId >=
-            pMac->lim.gpLimMeasReq->channelList.numChannels - 1)
-    {
-        // All channels in the channel set are learned.
-        pMac->lim.gLimMeasParams.nextLearnChannelId = 0;
-    }
-    // Go back to previous state.
-    limRestorePreLearnState(pMac);
-    // Restart the learn interval timer.
-    if (pMac->lim.gpLimMeasReq->measControl.periodicMeasEnabled)
-        limReEnableLearnMode(pMac);
-    return;
-}
-#endif
 
 /** ---------------------------------------------------------------------
 \fn      limProcessInitScanRsp
@@ -3645,9 +3441,6 @@
 {
     tpInitScanParams    pInitScanParam;
     eHalStatus          status;
-#if defined(ANI_PRODUCT_TYPE_AP) && (WNI_POLARIS_FW_PACKAGE == ADVANCED)
-    tANI_U8             channelNum;
-#endif
     SET_LIM_PROCESS_DEFD_MESGS(pMac, true);
     pInitScanParam = (tpInitScanParams) body;
     status = pInitScanParam->status;
@@ -3682,17 +3475,6 @@
                 * changed before this response message is sent.
                 */
                limCompleteMlmScan(pMac, eSIR_SME_HAL_SCAN_INIT_FAILED);
-#if defined(ANI_PRODUCT_TYPE_AP) && (WNI_POLARIS_FW_PACKAGE == ADVANCED)
-                /* For handling the measurement request from WSM as scan request in LIM*/
-#if 0
-               if (pMac->lim.gLimSystemRole == eLIM_STA_ROLE && pMac->lim.gpLimMeasReq != NULL)
-                {
-                    limRestorePreLearnState(pMac);
-                    pMac->lim.gLimHalScanState = eLIM_HAL_IDLE_SCAN_STATE;
-                    limReEnableLearnMode(pMac);
-                }
-#endif
-#endif
                 return;
             }
             else if (status == eHAL_STATUS_SUCCESS)
@@ -3705,22 +3487,6 @@
             }
             limContinueChannelScan(pMac);
             break;
-#if defined(ANI_PRODUCT_TYPE_AP) && (WNI_POLARIS_FW_PACKAGE == ADVANCED)
-        case eLIM_HAL_INIT_LEARN_WAIT_STATE:
-//            if (pMac->lim.gLimSystemRole == eLIM_AP_ROLE)
-            {
-                if (status != (tANI_U32) eHAL_STATUS_SUCCESS)
-                {
-                    limRestorePreLearnState(pMac);
-                    pMac->lim.gLimHalScanState = eLIM_HAL_IDLE_SCAN_STATE;
-                    limReEnableLearnMode(pMac);
-                    return;
-                }
-                channelNum = limGetCurrentLearnChannel(pMac);
-                limSendHalStartScanReq(pMac, channelNum, eLIM_HAL_START_LEARN_WAIT_STATE);
-            }
-            break;
-#endif
 //WLAN_SUSPEND_LINK Related
         case eLIM_HAL_SUSPEND_LINK_WAIT_STATE:
             if( pMac->lim.gpLimSuspendCallback )
@@ -4077,24 +3843,6 @@
                limContinuePostChannelScan(pMac);
             }
             break;
-#if defined(ANI_PRODUCT_TYPE_AP) && (WNI_POLARIS_FW_PACKAGE == ADVANCED)
-        case eLIM_HAL_START_LEARN_WAIT_STATE:
- //           if (pMac->lim.gLimSystemRole == eLIM_AP_ROLE)
-            {
-                if (status != (tANI_U32) eHAL_STATUS_SUCCESS)
-                {
-                    //Set the resume channel to Any valid channel (invalid). 
-                    //This will instruct HAL to set it to any previous valid channel.
-                    peSetResumeChannel(pMac, 0, 0);
-                    limSendHalFinishScanReq(pMac, eLIM_HAL_FINISH_LEARN_WAIT_STATE);
-                }
-                else
-                {
-                    limContinueChannelLearn(pMac);
-                }
-            }
-            break;
-#endif
         default:
             limLog(pMac, LOGW, FL("Rcvd StartScanRsp not in WAIT State, state %d\n"),
                      pMac->lim.gLimHalScanState);
@@ -4106,9 +3854,6 @@
 {
     tpEndScanParams     pEndScanParam;
     eHalStatus          status;
-#if defined(ANI_PRODUCT_TYPE_AP) && (WNI_POLARIS_FW_PACKAGE == ADVANCED)
-    tANI_U8             channelNum;
-#endif
     SET_LIM_PROCESS_DEFD_MESGS(pMac, true);
     pEndScanParam = (tpEndScanParams) body;
     status = pEndScanParam->status;
@@ -4128,33 +3873,6 @@
                limContinueChannelScan(pMac);
             }
             break;
-#if defined(ANI_PRODUCT_TYPE_AP) && (WNI_POLARIS_FW_PACKAGE == ADVANCED)
-        case eLIM_HAL_END_LEARN_WAIT_STATE:
-            if (status != (tANI_U32) eHAL_STATUS_SUCCESS)
-            {
-                //Set the resume channel to Any valid channel (invalid). 
-                //This will instruct HAL to set it to any previous valid channel.
-                peSetResumeChannel(pMac, 0, 0);
-                limSendHalFinishScanReq(pMac, eLIM_HAL_FINISH_LEARN_WAIT_STATE);
-            }
-#if 0 /* Will we be in UNKNOWN ROLE ever in this context: Veerendra */
-            else if (pMac->lim.gLimSystemRole == eLIM_UNKNOWN_ROLE)
-            {
-               /** Before starting BSS, we do complete set of measurement before putting
-                *   softmac back into normal mode.
-                */
-               channelNum = limGetCurrentLearnChannel(pMac);
-               limSendHalStartScanReq(pMac, channelNum, eLIM_HAL_START_LEARN_WAIT_STATE);
-            }
-            else
-#endif
-            {
-               limLog(pMac, LOGW, FL("ERROR! This state is set only when AP in UNKNOWN_ROLE\n"),
-                        pMac->lim.gLimHalScanState);
-                limSendHalFinishScanReq(pMac, eLIM_HAL_FINISH_LEARN_WAIT_STATE);
-            }
-            break;
-#endif
         default:
             limLog(pMac, LOGW, FL("Rcvd endScanRsp not in WAIT State, state %d\n"),
                         pMac->lim.gLimHalScanState);
@@ -4251,28 +3969,11 @@
                 */
                 limStartQuietOnSession(pMac);
             }
-#ifdef ANI_PRODUCT_TYPE_AP
-            /* For handling the measurement request from WSM as scan request in LIM*/
-#if 0
-            if (pMac->lim.gLimSystemRole == eLIM_STA_ROLE && pMac->lim.gpLimMeasReq != NULL)
-            {
-                limSendSmeMeasurementInd(pMac);
-                limCleanupMeasResources(pMac);
-                limRestorePreLearnState(pMac);
-            }
-#endif
-#endif
             if (status != (tANI_U32) eHAL_STATUS_SUCCESS)
             {
                PELOGW(limLog(pMac, LOGW, FL("EndScanRsp with failed status= %d\n"), status);)
             }
             break;
-#if (defined(ANI_PRODUCT_TYPE_AP) || defined(ANI_PRODUCT_TYPE_AP_SDK))
-        case eLIM_HAL_FINISH_LEARN_WAIT_STATE:
-            pMac->lim.gLimHalScanState = eLIM_HAL_IDLE_SCAN_STATE;
-            __limProcessFinishLearnRsp(pMac);
-            break;
-#endif //#if (defined(ANI_PRODUCT_TYPE_AP) || defined(ANI_PRODUCT_TYPE_AP_SDK))
 //WLAN_SUSPEND_LINK Related
         case eLIM_HAL_RESUME_LINK_WAIT_STATE:
             if( pMac->lim.gpLimResumeCallback )
@@ -4711,15 +4412,12 @@
    /* Update PE session Id*/
     mlmReassocCnf.sessionId = psessionEntry->peSessionId;
     switch (psessionEntry->limMlmState) {
-#if defined(ANI_PRODUCT_TYPE_CLIENT) || defined(ANI_AP_CLIENT_SDK)
         case eLIM_SME_WT_REASSOC_STATE :
         {
             tpSirAssocRsp assocRsp;
             tpDphHashNode   pStaDs;
             tSirRetStatus       retStatus = eSIR_SUCCESS;
-#ifdef ANI_PRODUCT_TYPE_CLIENT
             tSchBeaconStruct beaconStruct;
-#endif
             /** Delete the older STA Table entry */
             limDeleteDphHashEntry(pMac, psessionEntry->bssId, DPH_STA_HASH_INDEX_PEER, psessionEntry);
        /**
@@ -4741,7 +4439,6 @@
             assocRsp = (tpSirAssocRsp)psessionEntry->limAssocResponseData;
             limUpdateAssocStaDatas(pMac, pStaDs, assocRsp,psessionEntry);
             limUpdateReAssocGlobals(pMac, assocRsp,psessionEntry);
-#ifdef ANI_PRODUCT_TYPE_CLIENT
             limExtractApCapabilities( pMac,
                   (tANI_U8 *) psessionEntry->pLimReAssocReq->bssDescription.ieFields,
                   limGetIElenFromBssDescription( &psessionEntry->pLimReAssocReq->bssDescription ),
@@ -4760,13 +4457,6 @@
                 limLog( pMac, LOGE, FL( "Posting ADDBSS in the ReAssocContext has Failed \n"));
                 retStatus = eSIR_FAILURE;
             }
-#elif defined(ANI_AP_CLIENT_SDK)
-            if (eSIR_SUCCESS != limStaSendAddBss( pMac, (*assocRsp), &psessionEntry->pLimReAssocReq->neighborBssList.bssList[0],
-                                                  false, psessionEntry))  {
-                limLog( pMac, LOGE, FL( "Posting ADDBSS in the ReAssocContext has Failed \n"));
-                retStatus = eSIR_FAILURE;
-            }
-#endif
             if (retStatus != eSIR_SUCCESS)
             {
                 mlmReassocCnf.resultCode = eSIR_SME_RESOURCES_UNAVAILABLE;
@@ -4797,7 +4487,6 @@
             limPostSmeMessage(pMac, LIM_MLM_REASSOC_CNF, (tANI_U32 *) &mlmReassocCnf);
         }
         break;
-#endif
         default:
             PELOGE(limLog(pMac, LOGE, FL("DelBss is being invoked in the wrong system Role /unhandled  SME State\n"));)
             mlmReassocCnf.resultCode = eSIR_SME_REFUSED;
@@ -4891,12 +4580,10 @@
     psessionEntry->limMlmState = eLIM_MLM_IDLE_STATE;
     MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, psessionEntry->peSessionId, psessionEntry->limMlmState));
     switch (psessionEntry->limSmeState) {
-#if defined(ANI_PRODUCT_TYPE_CLIENT) || defined(ANI_AP_CLIENT_SDK)
         case eLIM_SME_WT_REASSOC_STATE : {
             tpSirAssocRsp assocRsp;
             tpDphHashNode   pStaDs;
             tSirRetStatus       retStatus = eSIR_SUCCESS;
-#ifdef ANI_PRODUCT_TYPE_CLIENT
             tSchBeaconStruct *pBeaconStruct;
             if(eHAL_STATUS_SUCCESS != palAllocateMemory(pMac->hHdd, 
                                                         (void **)&pBeaconStruct, sizeof(tSchBeaconStruct)))
@@ -4907,7 +4594,6 @@
                 goto Error;
             }
 
-#endif
             // Get the AP entry from DPH hash table
             pStaDs = dphGetHashEntry(pMac, DPH_STA_HASH_INDEX_PEER, &psessionEntry->dph.dphHashTable);
             if (pStaDs == NULL )
@@ -4924,7 +4610,6 @@
             assocRsp = (tpSirAssocRsp)psessionEntry->limAssocResponseData;
             limUpdateAssocStaDatas(pMac, pStaDs, assocRsp, psessionEntry);
             limUpdateReAssocGlobals(pMac, assocRsp, psessionEntry);
-#ifdef ANI_PRODUCT_TYPE_CLIENT
             limExtractApCapabilities( pMac,
                   (tANI_U8 *) psessionEntry->pLimReAssocReq->bssDescription.ieFields,
                   limGetIElenFromBssDescription( &psessionEntry->pLimReAssocReq->bssDescription ),
@@ -4945,12 +4630,6 @@
                 limLog( pMac, LOGE, FL( "Posting ADDBSS in the ReAssocContext has Failed \n"));
                 retStatus = eSIR_FAILURE;
             }
-#elif defined(ANI_AP_CLIENT_SDK)
-            if (eSIR_SUCCESS != limStaSendAddBss( pMac, (*assocRsp), &pMac->lim.gpLimReassocReq->neighborBssList.bssList[0], true))  {
-                limLog( pMac, LOGE, FL( "Posting ADDBSS in the ReAssocContext has Failed \n"));
-                retStatus = eSIR_FAILURE;
-            }
-#endif
             if (retStatus != eSIR_SUCCESS)
             {
                 mlmReassocCnf.resultCode = eSIR_SME_RESOURCES_UNAVAILABLE;
@@ -4982,7 +4661,6 @@
             limPostSmeMessage(pMac, LIM_MLM_REASSOC_CNF, (tANI_U32 *) &mlmReassocCnf);
         }
         break;
-#endif
         default:
             PELOGE(limLog(pMac, LOGE, FL("DelBss is being invoked in the wrong system Role /unhandled  SME State\n"));)
             mlmReassocCnf.resultCode = eSIR_SME_REFUSED;
diff --git a/CORE/MAC/src/pe/lim/limProcessProbeReqFrame.c b/CORE/MAC/src/pe/lim/limProcessProbeReqFrame.c
index 890f0c4..010b1d0 100644
--- a/CORE/MAC/src/pe/lim/limProcessProbeReqFrame.c
+++ b/CORE/MAC/src/pe/lim/limProcessProbeReqFrame.c
@@ -51,11 +51,7 @@
  *
  */
 
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-#include "wniCfgAp.h"
-#else
 #include "wniCfgSta.h"
-#endif
 #include "aniGlobal.h"
 #include "cfgApi.h"
 
@@ -565,14 +561,9 @@
                         msgQ.type = eWNI_SME_PROBE_REQ;
                         msgQ.bodyval = 0;
                         msgQ.bodyptr = pSirSmeProbeReq;
-#if defined(ANI_PRODUCT_TYPE_AP) && defined(ANI_LITTLE_BYTE_ENDIAN)
-                        sirStoreU16N((tANI_U8*)&pSirSmeProbeReq->messageType, eWNI_SME_PROBE_REQ);
-                        sirStoreU16N((tANI_U8*)&pSirSmeProbeReq->length, sizeof(tSirSmeProbeReq));
-#else
 
                         pSirSmeProbeReq->messageType = eWNI_SME_PROBE_REQ;
                         pSirSmeProbeReq->length = sizeof(tSirSmeProbeReq);
-#endif
                         pSirSmeProbeReq->sessionId = psessionEntry->smeSessionId;
                         palCopyMemory( pMac->hHdd, pSirSmeProbeReq->peerMacAddr, pHdr->sa, sizeof(tSirMacAddr));
                         pSirSmeProbeReq->devicePasswdId = probeReq.probeReqWscIeInfo.DevicePasswordID.id;
@@ -630,27 +621,6 @@
             }
             else
             {
-#if (WNI_POLARIS_FW_PRODUCT == AP) && (WNI_POLARIS_FW_PACKAGE == ADVANCED)
-                tANI_U32    cfg;
-                
-                if (wlan_cfgGetInt(pMac, WNI_CFG_SEND_SINGLE_SSID_ALWAYS, &cfg)
-                    != eSIR_SUCCESS)
-                    limLog(pMac, LOGP, FL("could not retrieve SEND_SSID_IN_PR\n"));
-
-                if (!ssId.length &&
-                    (psessionEntry->pLimStartBssReq->numSSID == 1) &&
-                    cfg)
-                {
-                    PELOG2(limLog(pMac, LOG2, FL("Sending ProbeRsp with suppressed SSID to"));
-                    limPrintMacAddr(pMac, pHdr->sa, LOG2);)
-
-                    limSendProbeRspMgmtFrame( pMac, pHdr->sa,
-                       (tAniSSID *) psessionEntry->pLimStartBssReq->ssIdList,
-                       DPH_USE_MGMT_STAID, DPH_NON_KEEPALIVE_FRAME, psessionEntry,
-                       probeReq.p2pIePresent);
-                }
-                else
-#endif
                 {
                     // Broadcast SSID in the Probe Request.
                     // Reply with SSID we're configured with.
@@ -667,39 +637,6 @@
                 break;
             }
 multipleSSIDcheck:
-#if (WNI_POLARIS_FW_PRODUCT == AP) && (WNI_POLARIS_FW_PACKAGE == ADVANCED)
-            if (!psessionEntry->pLimStartBssReq->ssId.length)
-            {
-                tANI_U8     i;
-
-                // Multiple SSIDs/Suppressed SSID is enabled.
-                for (i = 0; i < psessionEntry->pLimStartBssReq->numSSID; i++)
-                {
-                    if (palEqualMemory( pMac->hHdd,
-                           (tANI_U8 *) &psessionEntry->pLimStartBssReq->ssIdList[i],
-                           (tANI_U8 *) &probeReq.ssId,
-                           (tANI_U8) psessionEntry->pLimStartBssReq->ssIdList[i].length + 1))
-                    {
-                        limSendProbeRspMgmtFrame( pMac, pHdr->sa,
-                               (tAniSSID *) &psessionEntry->pLimStartBssReq->ssIdList[i],
-                               DPH_USE_MGMT_STAID, DPH_NON_KEEPALIVE_FRAME, psessionEntry,
-                               probeReq.p2pIePresent);
-                        break;
-                    }
-                }
-
-                if (i == psessionEntry->pLimStartBssReq->numSSID)
-                {
-                    // Local SSID does not match with received one
-                    // Ignore received Probe Request frame
-                   PELOG3(limLog(pMac, LOG3,
-                       FL("Ignoring ProbeReq frame with unmatched SSID received from "));
-                    limPrintMacAddr(pMac, pHdr->sa, LOG3);)
-                    pMac->sys.probeBadSsid++;
-                }
-            }
-            else
-#endif
             {
                PELOG3(limLog(pMac, LOG3,
                    FL("Ignoring ProbeReq frame with unmatched SSID received from "));
diff --git a/CORE/MAC/src/pe/lim/limProcessProbeRspFrame.c b/CORE/MAC/src/pe/lim/limProcessProbeRspFrame.c
index cced128..2a69db0 100644
--- a/CORE/MAC/src/pe/lim/limProcessProbeRspFrame.c
+++ b/CORE/MAC/src/pe/lim/limProcessProbeRspFrame.c
@@ -53,11 +53,7 @@
  */
 
 #include "wniApi.h"
-#ifdef ANI_PRODUCT_TYPE_AP
-#include "wniCfgAp.h"
-#else
 #include "wniCfgSta.h"
-#endif
 #include "aniGlobal.h"
 #include "schApi.h"
 #include "utilsApi.h"
@@ -129,10 +125,6 @@
     pProbeRsp->ssId.length              = 0;
     pProbeRsp->wpa.length               = 0;
     pProbeRsp->propIEinfo.apName.length = 0;
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED)
-    pProbeRsp->propIEinfo.aniIndicator  = 0;
-    pProbeRsp->propIEinfo.wdsLength     = 0;
-#endif
 
 
     pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
@@ -203,18 +195,6 @@
                ((pMac->lim.gLimHalScanState == eLIM_HAL_SCANNING_STATE) ? eANI_BOOLEAN_TRUE : eANI_BOOLEAN_FALSE), eANI_BOOLEAN_TRUE);
         else if (pMac->lim.gLimMlmState == eLIM_MLM_LEARN_STATE)           //mlm state check should be global - 18th oct
         {
-#if defined(ANI_PRODUCT_TYPE_AP) && (WNI_POLARIS_FW_PACKAGE == ADVANCED)
-            // STA/AP is in learn mode
-            /* Not sure whether the below 2 lines are needed for the station. TODO If yes, this should be 
-             * uncommented. Also when we tested enabling this, there is a crash as soon as the station
-             * comes up which needs to be fixed*/
-            //if (pMac->lim.gLimSystemRole == eLIM_STA_ROLE)
-              //  limCheckAndAddBssDescription(pMac, pProbeRsp, pRxPacketInfo, eANI_BOOLEAN_TRUE);
-            limCollectMeasurementData(pMac, pRxPacketInfo, pProbeRsp);
-           PELOG3(limLog(pMac, LOG3,
-               FL("Parsed WDS info in ProbeRsp frames: wdsLength=%d\n"),
-               pProbeRsp->propIEinfo.wdsLength);)
-#endif
         }
         else if (psessionEntry->limMlmState ==
                                      eLIM_MLM_WT_JOIN_BEACON_STATE)
@@ -280,7 +260,6 @@
                     limReceivedHBHandler(pMac, (tANI_U8)pProbeRsp->channelNumber, psessionEntry);
             }
 
-#if defined ANI_PRODUCT_TYPE_CLIENT || defined (ANI_AP_CLIENT_SDK)
             
             if (psessionEntry->limSystemRole == eLIM_STA_ROLE)
             {
@@ -295,7 +274,6 @@
                 }
             }
         
-#endif
             
             /**
             * Now Process EDCA Parameters, if EDCAParamSet count is different.
@@ -363,10 +341,6 @@
     pProbeRsp->ssId.length              = 0;
     pProbeRsp->wpa.length               = 0;
     pProbeRsp->propIEinfo.apName.length = 0;
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED)
-    pProbeRsp->propIEinfo.aniIndicator  = 0;
-    pProbeRsp->propIEinfo.wdsLength     = 0;
-#endif
 
 
     pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
@@ -420,18 +394,6 @@
             limCheckAndAddBssDescription(pMac, pProbeRsp, pRxPacketInfo, eANI_BOOLEAN_TRUE, eANI_BOOLEAN_TRUE);
         else if (pMac->lim.gLimMlmState == eLIM_MLM_LEARN_STATE)
         {
-#if defined(ANI_PRODUCT_TYPE_AP) && (WNI_POLARIS_FW_PACKAGE == ADVANCED)
-            // STA/AP is in learn mode
-            /* Not sure whether the below 2 lines are needed for the station. TODO If yes, this should be 
-             * uncommented. Also when we tested enabling this, there is a crash as soon as the station
-             * comes up which needs to be fixed*/
-            //if (pMac->lim.gLimSystemRole == eLIM_STA_ROLE)
-              //  limCheckAndAddBssDescription(pMac, pProbeRsp, pRxPacketInfo, eANI_BOOLEAN_TRUE);
-            limCollectMeasurementData(pMac, pRxPacketInfo, pProbeRsp);
-            limLog(pMac, LOG3,
-               FL("Parsed WDS info in ProbeRsp frames: wdsLength=%d\n"),
-               pProbeRsp->propIEinfo.wdsLength);
-#endif
         }
     } 
     palFreeMemory(pMac->hHdd, pProbeRsp);
diff --git a/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c b/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c
index 6aee9a3..946428e 100644
--- a/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c
+++ b/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c
@@ -53,11 +53,7 @@
 
 #include "palTypes.h"
 #include "wniApi.h"
-#ifdef ANI_PRODUCT_TYPE_AP
-#include "wniCfgAp.h"
-#else
 #include "wniCfgSta.h"
-#endif
 #include "cfgApi.h"
 #include "sirApi.h"
 #include "schApi.h"
@@ -118,14 +114,6 @@
 static void __limProcessSmeSetContextReq(tpAniSirGlobal, tANI_U32 *);
 static tANI_BOOLEAN __limProcessSmeStopBssReq(tpAniSirGlobal, tpSirMsgQ pMsg);
 
-#if 0
-  static void __limProcessSmeAuthReq(tpAniSirGlobal, tANI_U32 *);
-  static void __limProcessSmePromiscuousReq(tpAniSirGlobal, tANI_U32 *);
-#endif
-
-#ifdef ANI_PRODUCT_TYPE_AP
-static void __limProcessSmeAssocCnf(tpAniSirGlobal, tANI_U32, tANI_U32 *);
-#endif
 void __limProcessSmeAssocCnfNew(tpAniSirGlobal, tANI_U32, tANI_U32 *);
 
 #ifdef VOSS_ENABLED
@@ -136,7 +124,6 @@
 extern int limProcessRemainOnChnlReq(tpAniSirGlobal pMac, tANI_U32 *pMsg);
 #endif
 
-#ifdef ANI_PRODUCT_TYPE_CLIENT
 #ifdef BACKGROUND_SCAN_ENABLED
 
 // start the background scan timers if it hasn't already started
@@ -159,7 +146,6 @@
 }
 
 #endif // BACKGROUND_SCAN_ENABLED
-#endif
 
 // determine if a fresh scan request must be issued or not
 /*
@@ -214,9 +200,6 @@
     return FALSE;
 }
 
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED) && defined(ANI_PRODUCT_TYPE_AP)
-static tANI_BOOLEAN __limProcessSmeSwitchChlReq(tpAniSirGlobal, tpSirMsgQ pMsg);
-#endif
 
 
 /**
@@ -405,7 +388,6 @@
         pMac->lim.gLimReturnUniqueResults = true;
         pMac->lim.gLimSmeScanResultLength = 0;
 
-#if defined(ANI_PRODUCT_TYPE_CLIENT) || defined(ANI_AP_CLIENT_SDK)
         if (((tSirSmeStartReq *) pMsgBuf)->sendNewBssInd)
         {
             /*
@@ -419,7 +401,6 @@
                 retCode = eSIR_SME_UNEXPECTED_REQ_RESULT_CODE;
             }
         }
-#endif
     }
     else
     {
@@ -574,9 +555,6 @@
     {
         size = sizeof(tSirSmeStartBssReq) + SIR_MAC_MAX_IE_LENGTH;
 
-#ifdef ANI_PRODUCT_TYPE_AP
-        size + = ANI_WDS_INFO_MAX_LENGTH;
-#endif
 
         if( eHAL_STATUS_SUCCESS != palAllocateMemory( pMac->hHdd, (void **)&pSmeStartBssReq, size))
         {
@@ -1372,13 +1350,11 @@
         } // if (pMac->lim.gLimRspReqd)
     } // else ((pMac->lim.gLimSmeState == eLIM_SME_IDLE_STATE) || ...
 
-#if defined(ANI_PRODUCT_TYPE_CLIENT) || defined(ANI_AP_CLIENT_SDK)
 #ifdef BACKGROUND_SCAN_ENABLED
     // start background scans if needed
     // There is a bug opened against softmac. Need to enable when the bug is fixed.
     __limBackgroundScanInitiate(pMac);
 #endif
-#endif
 
 } /*** end __limProcessSmeScanReq() ***/
 
@@ -1675,13 +1651,7 @@
                           &pSmeJoinReq->addIEAssoc, sizeof(tSirAddie));
         }
                  
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED) && defined(ANI_PRODUCT_TYPE_AP)
-
-        val = sizeof(tLimMlmJoinReq) + sizeof(tSirMacSSidIE) +
-              sizeof(tSirMacRateSetIE) + sizeof(tSirMacDsParamSetIE);
-#else
         val = sizeof(tLimMlmJoinReq) + psessionEntry->pLimJoinReq->bssDescription.length + 2;
-#endif
         if( eHAL_STATUS_SUCCESS != palAllocateMemory( pMac->hHdd, (void **)&pMlmJoinReq, val))
         {
             limLog(pMac, LOGP, FL("call to palAllocateMemory failed for mlmJoinReq\n"));
@@ -1707,39 +1677,6 @@
 
         psessionEntry->encryptType = pSmeJoinReq->UCEncryptionType;
 
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED) && defined(ANI_PRODUCT_TYPE_AP)
-        palCopyMemory( pMac->hHdd, pMlmJoinReq->bssDescription.bssId,
-                       pMac->lim.gpLimJoinReq->neighborBssList.bssList[0].bssId,
-                       sizeof(tSirMacAddr));
-        
-        pMlmJoinReq->bssDescription.capabilityInfo = 1;
-           
-        pMlmJoinReq->bssDescription.aniIndicator =
-              (tANI_U8) pMac->lim.gpLimJoinReq->neighborBssList.bssList[0].wniIndicator;
-              
-        pMlmJoinReq->bssDescription.nwType =
-            pMac->lim.gpLimJoinReq->neighborBssList.bssList[0].nwType;
-
-        pMlmJoinReq->bssDescription.channelId =
-            pMac->lim.gpLimJoinReq->neighborBssList.bssList[0].channelId;
-
-            limCopyNeighborInfoToCfg(pMac,
-                pMac->lim.gpLimJoinReq->neighborBssList.bssList[0], psessionEntry);
-
-        palCopyMemory( pMac->hHdd, pMac->lim.gLimCurrentBssId,
-            pMac->lim.gpLimJoinReq->neighborBssList.bssList[0].bssId,
-            sizeof(tSirMacAddr));
-
-        pMac->lim.gLimCurrentChannelId =
-            pMac->lim.gpLimJoinReq->neighborBssList.bssList[0].channelId;
-
-        pMac->lim.gLimCurrentBssCaps =
-            pMac->lim.gpLimJoinReq->neighborBssList.bssList[0].capabilityInfo;
-        palCopyMemory( pMac->hHdd,
-         (tANI_U8 *) &pMac->lim.gLimCurrentSSID,
-         (tANI_U8 *) &pMac->lim.gpLimJoinReq->neighborBssList.bssList[0].ssId,
-        pMac->lim.gpLimJoinReq->neighborBssList.bssList[0].ssId.length+1);
-#else
         pMlmJoinReq->bssDescription.length = psessionEntry->pLimJoinReq->bssDescription.length;
 
         palCopyMemory( pMac->hHdd,
@@ -1779,7 +1716,6 @@
             pMac->lim.gUapsdPerAcDeliveryEnableMask = 0;
             pMac->lim.gUapsdPerAcTriggerEnableMask = 0;
         }
-#endif
 
         psessionEntry->limRFBand = limGetRFBand(psessionEntry->currentOperChannel);
 
@@ -2387,9 +2323,6 @@
     
     /* Update PE session ID*/
     pMlmDisassocReq->sessionId = sessionId;
-#ifdef ANI_PRODUCT_TYPE_AP
-    pMlmDisassocReq->aid             = smeDisassocReq.aid;
-#endif
 
     limPostMlmMessage(pMac,
                       LIM_MLM_DISASSOC_REQ,
@@ -2401,20 +2334,12 @@
         limSendSmeDisassocNtf(pMac, smeDisassocReq.peerMacAddr,
                           retCode,
                           disassocTrigger,
-#ifdef ANI_PRODUCT_TYPE_AP
-                          smeDisassocReq.aid);
-#else
                           1,smesessionId,smetransactionId,psessionEntry);
-#endif
     else 
         limSendSmeDisassocNtf(pMac, smeDisassocReq.peerMacAddr, 
                 retCode, 
                 disassocTrigger,
-#ifdef ANI_PRODUCT_TYPE_AP
-                smeDisassocReq.aid);
-#else
                 1, 0, 0, NULL);
-#endif
 
 
 } /*** end __limProcessSmeDisassocReq() ***/
@@ -2683,9 +2608,6 @@
 
     pMlmDeauthReq->reasonCode = reasonCode;
     pMlmDeauthReq->deauthTrigger = deauthTrigger;
-#ifdef ANI_PRODUCT_TYPE_AP
-    pMlmDeauthReq->aid = smeDeauthReq.aid;
-#endif
 
     /* Update PE session Id*/
     pMlmDeauthReq->sessionId = sessionId;
@@ -2699,11 +2621,7 @@
     limSendSmeDeauthNtf(pMac, smeDeauthReq.peerMacAddr,
                         retCode,
                         deauthTrigger,
-#ifdef ANI_PRODUCT_TYPE_AP
-                        smeDeauthReq.aid,
-#else
                         1, 
-#endif
                         smesessionId, smetransactionId);
 } /*** end __limProcessSmeDeauthReq() ***/
 
@@ -2769,11 +2687,7 @@
         PELOGE(limLog(pMac, LOGE, FL("numKeys:%d is more than SIR_MAC_MAX_NUM_OF_DEFAULT_KEYS\n"), pSetContextReq->keyMaterial.numKeys);)        
         limSendSmeSetContextRsp(pMac,
                                 pSetContextReq->peerMacAddr,
-#ifdef ANI_PRODUCT_TYPE_AP
-                                pSetContextReq->aid,
-#else
                                 1,
-#endif
                                 eSIR_SME_INVALID_PARAMETERS,NULL,
                                 smesessionId,smetransactionId);
 
@@ -2786,11 +2700,7 @@
         limLog(pMac, LOGW, FL("Session does not exist for given BSSID\n"));
         limSendSmeSetContextRsp(pMac,
                                 pSetContextReq->peerMacAddr,
-#ifdef ANI_PRODUCT_TYPE_AP
-                                pSetContextReq->aid,
-#else
                                 1,
-#endif
                                 eSIR_SME_INVALID_PARAMETERS,NULL,
                                 smesessionId,smetransactionId);
 
@@ -2827,9 +2737,6 @@
                       (tANI_U8 *) &pSetContextReq->peerMacAddr,
                       sizeof(tSirMacAddr));
 
-#ifdef ANI_PRODUCT_TYPE_AP
-        pMlmSetKeysReq->aid = pSetContextReq->aid;
-#endif
 
         palCopyMemory( pMac->hHdd, (tANI_U8 *) &pMlmSetKeysReq->key,
                       (tANI_U8 *) &pSetContextReq->keyMaterial.key,
@@ -2872,11 +2779,7 @@
         limPrintSmeState(pMac, LOGE, psessionEntry->limSmeState);
 
         limSendSmeSetContextRsp(pMac, pSetContextReq->peerMacAddr,
-#ifdef ANI_PRODUCT_TYPE_AP
-                                pSetContextReq->aid,
-#else
                                 1,
-#endif
                                 eSIR_SME_UNEXPECTED_REQ_RESULT_CODE,psessionEntry,
                                 smesessionId,
                                 smetransactionId);
@@ -3051,13 +2954,8 @@
     }
     palZeroMemory(pMac->hHdd, pSirSmeRsp, len);
 
-#if defined(ANI_PRODUCT_TYPE_AP) && defined(ANI_LITTLE_BYTE_ENDIAN)
-    sirStoreU16N((tANI_U8*)&pSirSmeRsp->mesgType, eWNI_SME_GET_SCANNED_CHANNEL_RSP);
-    sirStoreU16N((tANI_U8*)&pSirSmeRsp->mesgLen, len);
-#else
     pSirSmeRsp->mesgType = eWNI_SME_GET_SCANNED_CHANNEL_RSP;
     pSirSmeRsp->mesgLen = len;
-#endif
     pSirSmeRsp->sessionId = 0;
 
     if(pMac->lim.scanChnInfo.numChnInfo)
@@ -3466,103 +3364,6 @@
 }
 
 
-#if 0
-/**
- * __limProcessSmePromiscuousReq()
- *
- *FUNCTION:
- * This function is called to process SME_PROMISCUOUS_REQ message
- * from HDD or upper layer application.
- *
- *LOGIC:
- *
- *ASSUMPTIONS:
- *
- *NOTE:
- *
- * @param  pMac      Pointer to Global MAC structure
- * @param  *pMsgBuf  A pointer to the SME message buffer
- * @return None
- */
-
-static void
-__limProcessSmePromiscuousReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf)
-{
-
-    tANI_U32                cfg = sizeof(tSirMacAddr);
-    tSirMacAddr        currentBssId;
-    tLimMlmDisassocReq *pMlmDisassocReq;
-    tSirMacAddr        bcAddr = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
-    
-    
-    if(pMsgBuf == NULL)
-    {
-        limLog(pMac, LOGE,FL("Buffer is Pointing to NULL\n"));
-           return;
-    }
-
-    PELOG1(limLog(pMac, LOG1,
-           FL("received PROMISCUOUS_REQ message\n"));)
-
-    if (wlan_cfgGetStr(pMac, WNI_CFG_BSSID, currentBssId, &cfg) !=
-                                eSIR_SUCCESS)
-    {
-        /// Could not get BSSID from CFG. Log error.
-        limLog(pMac, LOGP, FL("could not retrieve BSSID\n"));
-    }
-
-    if ((((pMac->lim.gLimSystemRole == eLIM_STA_ROLE) ||
-         (pMac->lim.gLimSystemRole == eLIM_STA_IN_IBSS_ROLE)) &&
-         ((pMac->lim.gLimSmeState == eLIM_SME_ASSOCIATED_STATE) ||
-          (pMac->lim.gLimSmeState == eLIM_SME_LINK_EST_STATE))) ||
-        ((pMac->lim.gLimSystemRole == eLIM_AP_ROLE) &&
-         (pMac->lim.gLimSmeState == eLIM_SME_NORMAL_STATE)))
-    {
-        // Trigger Disassociation frame to peer MAC entity
-        if( eHAL_STATUS_SUCCESS != palAllocateMemory( pMac->hHdd, (void **)&pMlmDisassocReq, sizeof(tLimMlmDisassocReq)))
-        {
-            // Log error
-            limLog(pMac, LOGP,
-                   FL("call to palAllocateMemory failed for mlmDisassocReq\n"));
-
-            return;
-        }
-
-        if (pMac->lim.gLimSystemRole == eLIM_AP_ROLE)
-            palCopyMemory( pMac->hHdd, (tANI_U8 *) &pMlmDisassocReq->peerMacAddr,
-                          (tANI_U8 *) &bcAddr,
-                          sizeof(tSirMacAddr));
-        else
-            palCopyMemory( pMac->hHdd, pMlmDisassocReq->peerMacAddr,
-                          currentBssId,
-                          sizeof(tSirMacAddr));
-
-        pMlmDisassocReq->reasonCode      =
-                                eSIR_MAC_DISASSOC_LEAVING_BSS_REASON;
-        pMlmDisassocReq->disassocTrigger =
-                                      eLIM_PROMISCUOUS_MODE_DISASSOC;
-
-        pMac->lim.gLimPrevSmeState = pMac->lim.gLimSmeState;
-        pMac->lim.gLimSmeState     = eLIM_SME_WT_DISASSOC_STATE;
-     MTRACE(macTrace(pMac, TRACE_CODE_SME_STATE, 0, pMac->lim.gLimSmeState));
-
-        limPostMlmMessage(pMac,
-                          LIM_MLM_DISASSOC_REQ,
-                          (tANI_U32 *) pMlmDisassocReq);
-    }
-    else
-    {
-        // Send Promiscuous mode response to host
-        limSendSmePromiscuousModeRsp(pMac);
-
-        pMac->lim.gLimSmeState = eLIM_SME_OFFLINE_STATE;
-     MTRACE(macTrace(pMac, TRACE_CODE_SME_STATE, 0, pMac->lim.gLimSmeState));
-    }
-
-} /*** end __limProcessSmePromiscuousReq() ***/
-#endif
-
-
 /**---------------------------------------------------------------
 \fn     __limProcessSmeAssocCnfNew
 \brief  This function handles SME_ASSOC_CNF/SME_REASSOC_CNF 
@@ -3696,202 +3497,6 @@
 } /*** end __limProcessSmeAssocCnfNew() ***/
 
 
-#ifdef ANI_PRODUCT_TYPE_AP
-/**
- * __limProcessSmeAssocCnf()
- *
- *FUNCTION:
- * This function is called by limProcessSmeMessages() upon
- * receiving SME_ASSOC_CNF/SME_REASSOC_CNF from WSM.
- *
- *LOGIC:
- *
- *ASSUMPTIONS:
- *
- *NOTE:
- *
- * @param  pMac      Pointer to Global MAC structure
- * @param  *pMsgBuf  A pointer to the SME message buffer
- *
- * @return None
- */
-
-static void
-__limProcessSmeAssocCnf(tpAniSirGlobal pMac, tANI_U32 msgType, tANI_U32 *pMsgBuf)
-{
-    tSirSmeAssocCnf    assocCnf;
-    tpDphHashNode      pStaDs;
-    tpPESession        psessionEntry;
-    tANI_U8            sessionId; 
-    tHalBitVal cbBitVal;
-    tANI_U8 tspecIdx = 0; //index in the lim tspec table.
-
-    if(pMsgBuf == NULL)
-    {
-        limLog(pMac, LOGE,FL("Buffer is Pointing to NULL\n"));
-           return;
-    }
-
-   if ((limAssocCnfSerDes(pMac, &assocCnf, (tANI_U8 *) pMsgBuf) ==
-                            eSIR_FAILURE) ||
-        !__limIsSmeAssocCnfValid(&assocCnf))
-    {
-        limLog(pMac, LOGW,
-           FL("Received re/assocCnf message with invalid parameters\n"));
-
-        return;
-    }
-
-    if((psessionEntry = peFindSessionByBssid(pMac,assocCnf->bssId,&sessionId))== NULL)
-    {
-        
-        limLog(pMac, LOGE,
-                      FL("session does not exist for given bssId\n"));
-        return;
-    }
-
-#ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT 
-    limDiagEventReport(pMac, WLAN_PE_DIAG_ASSOC_CNF_EVENT, psessionEntry, 0, 0);
-#endif //FEATURE_WLAN_DIAG_SUPPORT
-    
-    if ( ((psessionEntry->limSystemRole != eLIM_AP_ROLE) && (psessionEntry->limSystemRole != eLIM_BT_AMP_AP_ROLE)) ||
-         ((psessionEntry->limSmeState != eLIM_SME_NORMAL_STATE) && (psessionEntry->limSmeState != eLIM_SME_NORMAL_CHANNEL_SCAN_STATE)))
-    {
-        limLog(pMac, LOGE,
-         FL("Received unexpected message %X in state %X, in role %X\n"),
-         msgType, psessionEntry->limSmeState , psessionEntry->limSystemRole);
-
-        return;
-    }
-
-    pStaDs = dphGetHashEntry(pMac, assocCnf.aid, &psessionEntry->dph.dphHashTable);
-
-
-    if (pStaDs == NULL)
-    {
-        
-        PELOG1(limLog(pMac, LOG1,
-           FL("Received invalid message %X due to no STA context, for aid %d, peer "),
-           msgType, assocCnf.aid);
-        limPrintMacAddr(pMac, assocCnf.peerMacAddr, LOG1);)
-       
-        /*
-        ** send a DISASSOC_IND message to WSM to make sure
-        ** the state in WSM and LIM is the same
-        **/
-
-        limSendSmeDisassocNtf(pMac,
-            assocCnf.peerMacAddr,
-            eSIR_SME_STA_NOT_ASSOCIATED,
-            eLIM_PEER_ENTITY_DISASSOC,
-            assocCnf.aid,psessionEntry);
-
-        return;
-    }
-    if ((pStaDs &&
-         (( !palEqualMemory( pMac->hHdd,(tANI_U8 *) pStaDs->staAddr,
-                     (tANI_U8 *) assocCnf.peerMacAddr,
-                     sizeof(tSirMacAddr)) ) ||
-          (pStaDs->mlmStaContext.mlmState !=
-                          eLIM_MLM_WT_ASSOC_CNF_STATE) ||
-          ((pStaDs->mlmStaContext.subType == LIM_ASSOC) &&
-           (msgType != eWNI_SME_ASSOC_CNF)) ||
-          ((pStaDs->mlmStaContext.subType == LIM_REASSOC) &&
-           (msgType != eWNI_SME_REASSOC_CNF)))))
-    {
-        PELOG1(limLog(pMac, LOG1,
-           FL("Received invalid message %X due to peerMacAddr mismatched or not in eLIM_MLM_WT_ASSOC_CNF_STATE state, for aid %d, peer "),
-           msgType, assocCnf.aid);
-        limPrintMacAddr(pMac, assocCnf.peerMacAddr, LOG1);)
-
-        return;
-    }
-
-    /*
-    ** Deactivate/delet CNF_WAIT timer since ASSOC_CNF
-    ** has been received
-    **/
-
-    PELOG1(limLog(pMac, LOG1, FL("Received Cnf. Delete Timer\n"));)
-    limDeactivateAndChangePerStaIdTimer(pMac, eLIM_CNF_WAIT_TIMER,
-                                        pStaDs->assocId);
-
-    if (assocCnf.statusCode == eSIR_SME_SUCCESS)
-    {
-        tSirMacScheduleIE schedule;
-
-        // If STA is a TITAN-compatible device, then setup
-        // the TITAN proprietary capabilities appropriately
-        // in the per STA DS, as per the local TITAN Prop
-        // capabilities of this AP
-
-        // STA is allowed to be associated
-        if (pStaDs->mlmStaContext.updateContext)
-        {
-
-              tLimMlmStates mlmPrevState = pStaDs->mlmStaContext.mlmState;
-              //we need to set the mlmState here in order differentiate in limDelSta.
-              pStaDs->mlmStaContext.mlmState = eLIM_MLM_WT_ASSOC_DEL_STA_RSP_STATE;
-              if(limDelSta(pMac, pStaDs, true,psessionEntry) != eSIR_SUCCESS)
-              {
-                  limLog(pMac, LOGE,
-                         FL("could not DEL STA with assocId=%d staId %d\n"),
-                         pStaDs->assocId, pStaDs->staIndex);
-
-                  limRejectAssociation(pMac,
-                           pStaDs->staAddr,
-                           pStaDs->mlmStaContext.subType,
-                           true, pStaDs->mlmStaContext.authType,
-                           pStaDs->assocId, true,
-                           (tSirResultCodes) eSIR_MAC_UNSPEC_FAILURE_STATUS,
-                           psessionEntry);
-
-                  //Restoring the state back.
-                  pStaDs->mlmStaContext.mlmState = mlmPrevState;
-                  return;
-              }
-              return;
-        }
-        else
-        {
-            // Add STA context at HW
-            if (limAddSta(pMac, pStaDs,psessionEntry) != eSIR_SUCCESS)
-            {
-                limLog(pMac, LOGE,
-                       FL("could not Add STA with assocId=%d\n"),
-                       pStaDs->assocId);
-
-              // delete the TS if it has already been added.
-               // send the response with error status.
-                if(pStaDs->qos.addtsPresent)
-                {
-                  limAdmitControlDeleteTS(pMac, pStaDs->assocId, &pStaDs->qos.addts.tspec.tsinfo, NULL, &tspecIdx);
-                }
-
-                limRejectAssociation(pMac,
-                         pStaDs->staAddr,
-                         pStaDs->mlmStaContext.subType,
-                         true, pStaDs->mlmStaContext.authType,
-                         pStaDs->assocId, true,
-                         (tSirResultCodes) eSIR_MAC_UNSPEC_FAILURE_STATUS,
-                         psessionEntry);
-
-            }
-            return;
-        }
-
-   } // if (assocCnf.statusCode == eSIR_SME_SUCCESS)
-    else
-    {
-        // STA is not allowed to be associated
-        limRejectAssociation(pMac, pStaDs->staAddr,
-                             pStaDs->mlmStaContext.subType,
-                             true, pStaDs->mlmStaContext.authType,
-                             pStaDs->assocId, true,
-                             assocCnf.statusCode, psessionEntry);
-    }
-} /*** end __limProcessSmeAssocCnf() ***/
-#endif
 
 
 static void
@@ -5410,13 +5015,6 @@
 
             break;
 
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED) && defined(ANI_PRODUCT_TYPE_AP)
-        case eWNI_SME_SWITCH_CHL_REQ:
-        case eWNI_SME_SWITCH_CHL_CB_PRIMARY_REQ:
-        case eWNI_SME_SWITCH_CHL_CB_SECONDARY_REQ:
-            bufConsumed = __limProcessSmeSwitchChlReq(pMac, pMsg);
-            break;
-#endif
 
 
         case eWNI_SME_SETCONTEXT_REQ:
@@ -5439,9 +5037,6 @@
                 PELOG1(limLog(pMac, LOG1, FL("Received ASSOC_CNF message\n"));)
             else
                 PELOG1(limLog(pMac, LOG1, FL("Received REASSOC_CNF message\n"));)
-#ifdef ANI_PRODUCT_TYPE_AP
-            __limProcessSmeAssocCnf(pMac, pMsg->type, pMsgBuf);
-#endif
             __limProcessSmeAssocCnfNew(pMac, pMsg->type, pMsgBuf);
             break;
 
diff --git a/CORE/MAC/src/pe/lim/limPropExtsUtils.c b/CORE/MAC/src/pe/lim/limPropExtsUtils.c
index 31764cc..4ab03e0 100644
--- a/CORE/MAC/src/pe/lim/limPropExtsUtils.c
+++ b/CORE/MAC/src/pe/lim/limPropExtsUtils.c
@@ -54,11 +54,7 @@
  *
  */
 #include "aniGlobal.h"
-#ifdef ANI_PRODUCT_TYPE_AP
-#include "wniCfgAp.h"
-#else
 #include "wniCfgSta.h"
-#endif
 #include "sirCommon.h"
 #include "sirDebug.h"
 #include "utilsApi.h"
@@ -72,34 +68,6 @@
 #include "limTrace.h"
 #include "limSession.h"
 #define LIM_GET_NOISE_MAX_TRY 5
-#if (defined(ANI_PRODUCT_TYPE_AP) || defined(ANI_PRODUCT_TYPE_AP_SDK))
-/**
- * limGetCurrentLearnChannel()
- *
- *FUNCTION:
- * This function is called in various places to get current channel
- * number being 'learned'.
- *
- *PARAMS:
- *
- *LOGIC:
- *
- *ASSUMPTIONS:
- * NA
- *
- *NOTE:
- * NA
- *
- * @param  pMac      Pointer to Global MAC structure
- * @return Channel number
- */
-tANI_U8
-limGetCurrentLearnChannel(tpAniSirGlobal pMac)
-{
-    tANI_U8 *pChanNum = pMac->lim.gpLimMeasReq->channelList.channelNumber;
-    return (*(pChanNum + pMac->lim.gLimMeasParams.nextLearnChannelId));
-} /*** end limGetCurrentLearnChannel() ***/
-#endif //#if (defined(ANI_PRODUCT_TYPE_AP) || defined(ANI_PRODUCT_TYPE_AP_SDK))
 /**
  * limExtractApCapability()
  *
@@ -147,10 +115,6 @@
     sirDumpBuf( pMac, SIR_LIM_MODULE_ID, LOG3, pIE, ieLen );)
     if (sirParseBeaconIE(pMac, pBeaconStruct, pIE, (tANI_U32)ieLen) == eSIR_SUCCESS)
     {
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED)
-        if (pBeaconStruct->propIEinfo.hcfEnabled)
-            LIM_BSS_CAPS_SET(HCF, *qosCap);
-#endif
         if (pBeaconStruct->wmeInfoPresent || pBeaconStruct->wmeEdcaPresent)
             LIM_BSS_CAPS_SET(WME, *qosCap);
         if (LIM_BSS_CAPS_GET(WME, *qosCap) && pBeaconStruct->wsmCapablePresent)
@@ -220,919 +184,6 @@
     return;
 } /****** end limExtractApCapability() ******/
 
-#if (defined(ANI_PRODUCT_TYPE_AP) || defined(ANI_PRODUCT_TYPE_AP_SDK))
-/**
- * limQuietBss()
- *
- *FUNCTION:
- * This function is called to quiet the BSS
- * while entering into Learn mode
- *
- *LOGIC:
- * Data frame to self with duration value passed is
- * transmitted
- *
- *ASSUMPTIONS:
- * NA
- *
- *NOTE:
- * If all associated STAs are 11h compliant, Quiet IE
- * need to be sent in Beacon/Probe Response frames.
- *
- * @param   pMac      Pointer to Global MAC structure
- * @param   duration  Specifies quiet duration in millisec
- * @return  None
- */
-void
-limQuietBss(tpAniSirGlobal pMac, tANI_U32 duration)
-{
-    // Temporarily not quieting BSS
-    (void) pMac; (void) duration;
-    return;
-} /****** end limQuietBss() ******/
-
-/**
- * limIsMatrixNodePresent()
- *
- *FUNCTION:
- * This function is called to determine if measurements are
- * already made on the current learn channel
- *
- *LOGIC:
- *
- *ASSUMPTIONS:
- * NA
- *
- *NOTE:
- * NA
- *
- * @param   pMac  - Pointer to Global MAC structure
- * @return  pNode - Pointer to Matrix node if found. Else NULL
- */
-static tpLimMeasMatrixNode
-limIsMatrixNodePresent(tpAniSirGlobal pMac)
-{
-    tANI_U8   i, chanNum = limGetCurrentLearnChannel(pMac);
-    tpLimMeasMatrixNode pNode = pMac->lim.gpLimMeasData->pMeasMatrixInfo;
-    if (!pNode)
-        return NULL;
-    for (i = 0; i < pMac->lim.gpLimMeasReq->channelList.numChannels; i++)
-    {
-        if (pNode->matrix.channelNumber == chanNum)
-        {
-            return pNode;
-        }
-        else
-        {
-            if (pNode->next)
-                pNode = pNode->next;
-            else
-                break;
-        }
-    }
-    return NULL;
-} /****** end limIsMatrixNodePresent() ******/
-
-/**
- * limGetMatrixNode()
- *
- *FUNCTION:
- * This function is called to get a metrics node associated
- * with the current measurement channel. If no node is found
- * for this channel, one is added at the beginning of the list.
- *
- *LOGIC:
- *
- *ASSUMPTIONS:
- * NA
- *
- *NOTE:
- * NA
- *
- * @param   pMac      Pointer to Global MAC structure
- * @return  None
- */
-static tpLimMeasMatrixNode
-limGetMatrixNode(tpAniSirGlobal pMac)
-{
-    tpLimMeasMatrixNode       pNewMatrix;
-    eHalStatus          status;
-    pNewMatrix = limIsMatrixNodePresent(pMac);
-    if (!pNewMatrix)
-    {
-        // Making first time measurements on this channel.
-        // Add matrix node for this at the front.
-        status = palAllocateMemory( pMac->hHdd, (void **)&pNewMatrix, sizeof(*pNewMatrix));        
-        if (status != eHAL_STATUS_SUCCESS)
-        {
-            /// Could not allocate buffer for new measMatrix Node
-            // Log error
-            limLog(pMac, LOGP,
-               FL("palAllocateMemory failed for new measMatrix Node\n"));
-            return NULL;
-        }
-        status = palZeroMemory( pMac->hHdd, (void *)pNewMatrix, sizeof(*pNewMatrix));
-        if (status != eHAL_STATUS_SUCCESS)
-        {
-            /// Could not allocate buffer for new measMatrix Node
-            // Log error
-            limLog(pMac, LOGP,
-               FL("palZeroMemory failed for new measMatrix Node\n"));
-            return NULL;
-        }
-        
-        pNewMatrix->matrix.channelNumber =
-                                   limGetCurrentLearnChannel(pMac);
-        pNewMatrix->avgRssi              = 0;
-       PELOG3(limLog(pMac, LOG3, FL("Adding new Matrix info:channel#=%d\n"),
-               pNewMatrix->matrix.channelNumber);)
-        pNewMatrix->next = pMac->lim.gpLimMeasData->pMeasMatrixInfo;
-        pMac->lim.gpLimMeasData->pMeasMatrixInfo = pNewMatrix;
-        pMac->lim.gpLimMeasData->numMatrixNodes++;
-    }
-    return pNewMatrix;
-} /****** end limGetMatrixNode() ******/
-
-/**
- * limComputeAvg()
- *
- *FUNCTION:
- * This function is called to compute exponential average
- * of RSSI, channel utilization etc.
- *
- *LOGIC:
- *
- *ASSUMPTIONS:
- * NA
- *
- *NOTE:
- * NA
- *
- * @param   pMac      Pointer to Global MAC structure
- * @param   oldVal    Previous averaged value
- * @param   newVal    New averaged value
- * @return  None
- */
-tANI_U32
-limComputeAvg(tpAniSirGlobal pMac, tANI_U32 oldVal, tANI_U32 newVal)
-{
-    return (halExpAvg(newVal,
-                      oldVal,
-                      pMac->lim.gLimMeasParams.rssiAlpha));
-} /****** end limComputeAvg() ******/
-
-/**
- * limCollectRSSI()
- *
- *FUNCTION:
- * This function is called to collect RSSI measurements on
- * the current learn channel
- *
- *LOGIC:
- *
- *ASSUMPTIONS:
- * NA
- *
- *NOTE:
- * NA
- *
- * @param   pMac      Pointer to Global MAC structure
- * @return  None
- */
-void
-limCollectRSSI(tpAniSirGlobal pMac)
-{
-    tpLimMeasMatrixNode  pNewMatrix = limGetMatrixNode(pMac);
-    tANI_U32 i, noise;
-    for (i = 0; i < LIM_GET_NOISE_MAX_TRY; i++)
-        if ((noise = halGetNoise(pMac)) != HAL_NOISE_INVALID)
-        {
-            pNewMatrix->avgRssi = limComputeAvg(pMac,
-                                                pNewMatrix->avgRssi,
-                                                noise);
-            break;
-        }
-} /****** end limCollectRSSI() ******/
-
-/**----------------------------------------------------------------------------
-\fn        limGetNeighbourBssNode
-\brief    returns neighbour bss node if it is already present in the list.
-\param pMac
-\param bssid - Bssid of new beacon or data packet.
-\param pSsId - Pointer to SSID of new packet.
-\param nwType - 11b/g/a
-\param chanId - Channel in which we received the packet.
-\return tpLimNeighborBssWdsNode or NULL
--------------------------------------------------------------------------------*/
-static tpLimNeighborBssWdsNode
-limGetNeighbourBssNode(tpAniSirGlobal pMac, tANI_U8 *bssId, tANI_U8 chanId,
-                                            tSirNwType nwType, tpAniSSID pSsId, tANI_U8 type)
-{
-    tpLimNeighborBssWdsNode pNode = pMac->lim.gpLimMeasData->pNeighborWdsInfo;
-    while (pNode)
-    {
-        //Do we need to check for ssId also ?
-        if (palEqualMemory(pMac->hHdd, pNode->info.neighborBssInfo.bssId,
-                    bssId, sizeof(tSirMacAddr)) &&
-                (pNode->info.neighborBssInfo.channelId == chanId))
-        {
-#if 0
-/** Commented out assuming that comparing bssId and ChanId would be enough to
-uniquely identify a particular BSS, Uncomment if strict checking is needed,
-eventhough not possible if packet type is DATA. */
-            if (type == eSIR_MAC_MGMT_FRAME)
-            {
-                /** Beacon Frame */
-                if (palEqualMemory(pMac->hHdd, &pNode->info.neighborBssInfo.ssId,
-                            pSsId, pSsId->length+1) &&
-                            (pNode->info.neighborBssInfo.nwType == nwType)) 
-                {
-                    return pNode;
-                }
-            }
-            else
-#endif
-                return pNode;
-        }
-        if (!pNode->next)
-            break;
-        else
-            pNode = pNode->next;
-    }
-    return NULL;
-}
-
-/**
- * limCollectMeasurementData()
- *
- *FUNCTION:
- * This function is called upon receiving Beacon/Probe Response
- * or Data frames to collect measurement related data.
- *
- *LOGIC:
- *
- *ASSUMPTIONS:
- * NA
- *
- *NOTE:
- * NA
- *
- * @param  pMac     - Pointer to Global MAC structure
- * @param  pRxPacketInfo      - Pointer to received BD+payload
- * @param  pBeacon  - Pointer to parsed BSS info
- * @return None
- */
-void
-limCollectMeasurementData(tpAniSirGlobal pMac,
-                          tANI_U32 *pRxPacketInfo, tpSchBeaconStruct pBeacon)
-{
-    tANI_U16                allocLen=0, len=0, realLen=0, ieLen=0;
-    tANI_U32                     i;
-    tANI_U8                 found = eANI_BOOLEAN_TRUE;
-    tSirMacFrameCtl         fc ;
-    tSirMacAddr             bssIdRcv;
-    tSirNwType              nwType;
-    tAniSSID                ssId;
-    tANI_U8                 chanId = 0;
-    tpLimNeighborBssWdsNode pNode = NULL;
-    tpLimMeasMatrixNode     pNewMatrix;
-    eHalStatus status;
-    tpSirMacMgmtHdr       pHdr;
-   PELOG3(limLog(pMac, LOG3, FL("Collecting measurement data for RadioId %d\n"),
-           pMac->sys.gSirRadioId);)
-    tANI_U32 ignore = 0;
-    limGetBssidFromBD(pMac, (tpHalBufDesc) pRxPacketInfo, bssIdRcv, &ignore);
-    if (palEqualMemory( pMac->hHdd, bssIdRcv, pMac->lim.gLimBssid, sizeof(tSirMacAddr)))
-    {
-        // Packet received from our own BSS, dont take measurement.
-        return;
-    }
-    pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
-    fc = pHdr->fc;
-    if (fc.type == SIR_MAC_DATA_FRAME)
-    {
-        PELOG2(limLog(pMac, LOG2, FL("Received DATA packet\n"));)
-        ssId.length = 0;
-        ieLen = 0;
-    }
-    else
-    {
-        /** Probe response or beaccon packet */
-        palCopyMemory(pMac->hHdd, (void *)&ssId, (void *) &pBeacon->ssId,
-                                             sizeof(ssId));
-        chanId = limGetChannelFromBeacon(pMac, pBeacon);
-        ieLen = pBeacon->wpa.length + pBeacon->propIEinfo.wdsLength;
-    }
-    if (chanId == 0)
-    {
-      /* If the channel Id is not retrieved from Beacon, extract the channel from BD */
-      /* Unmapped the channel.This We have to do since we have done mapping in the hal to
-         overcome  the limitation of RXBD of not able to accomodate the bigger channel number.*/
-      chanId = WDA_GET_RX_CH(pRxPacketInfo);
-      if(!( chanId = limUnmapChannel(chanId))) 
-      {
-           chanId = pMac->lim.gLimCurrentScanChannelId;
-      }
-    }
-    /*
-     * Now always returns nwType as 11G for data packets - FIXIT
-     */
-    nwType = limGetNwType(pMac, chanId, fc.type, pBeacon);
-    pNewMatrix = limGetMatrixNode(pMac);
-    /** LOGP would result in freeing all dynamicall allocated memories. So
-      *  return from here if limGetMatrixNode returns NULL
-      */
-    if (!pNewMatrix)
-        return;
-    pNewMatrix->matrix.aggrRssi += WDA_GET_RX_RSSI_DB(pRxPacketInfo);
-    pNewMatrix->matrix.totalPackets++;
-    // Find if this neighbor is already 'learned'
-    // If found, update its information.
-    pNode = limGetNeighbourBssNode(pMac, bssIdRcv, chanId, nwType, &ssId, fc.type);
-    if (!pNode)
-    {
-        realLen = sizeof(tSirNeighborBssWdsInfo);
-        /** Newly discovered neighbor. Inform WSM of this
-          * and add this BSS info at the beginning
-          * Need to limit the number newly discovered BSS added
-          * to the list.
-          */
-        len = LIM_MAX_BUF_SIZE - (sizeof(tSirSmeMeasurementInd) +
-                (pMac->lim.gpLimMeasReq->channelList.numChannels *
-                 sizeof(tSirMeasMatrixInfo)));
-       PELOG2(limLog(pMac, LOG2, FL("Current BSS length %d, Real length %d\n"),
-                pMac->lim.gpLimMeasData->totalBssSize, realLen);)
-        /** Check if we have enough room for adding a new node.
-          */
-        if (pMac->lim.gpLimMeasData->totalBssSize + realLen < len)
-        {
-            pMac->lim.gpLimMeasData->numBssWds++;
-            pMac->lim.gpLimMeasData->totalBssSize += realLen;
-            PELOG2(limPrintMacAddr(pMac, bssIdRcv, LOG2);)
-        }
-        else
-        {
-            PELOG2(limLog(pMac, LOG2, FL("Dropping the measurement packets: No memory!\n"));)
-            return;
-    }
-        /** Allocate max memory required even if the packet is of type DATA,
-          * So that next time we receive a beacon, won't run out of memory to
-          * update the information.
-          */
-        allocLen = sizeof(tLimNeighborBssWdsNode) + 4 + ieLen;
-        status = palAllocateMemory( pMac->hHdd, (void **)&pNode, allocLen);
-    if (status != eHAL_STATUS_SUCCESS)
-    {
-            limLog(pMac, LOGP, FL("palAllocateMemory failed for new NeighborBssWds Node\n"));
-        return;
-    }
-        status = palZeroMemory(pMac->hHdd, pNode, allocLen);
-        if (status != eHAL_STATUS_SUCCESS)
-        {
-            limLog(pMac, LOGP, FL("palAllocateMemory failed for new NeighborBssWds Node\n"));
-            return;
-        }
-        pNode->next = pMac->lim.gpLimMeasData->pNeighborWdsInfo;
-        pMac->lim.gpLimMeasData->pNeighborWdsInfo = pNode;
-        found = eANI_BOOLEAN_FALSE;
-    }
-    pNode->info.neighborBssInfo.rssi = WDA_GET_RX_RSSI_DB(pRxPacketInfo);
-    pNode->info.neighborBssInfo.aggrRssi += pNode->info.neighborBssInfo.rssi;
-    if (fc.type == SIR_MAC_DATA_FRAME)
-        pNode->info.neighborBssInfo.dataCount++;
-    pNode->info.neighborBssInfo.totalPackets++;
-    /** If node not found or previous learn was not from a beacon/probe rsp
-      * then learn again.
-      */
-    if (!found || ((pNode->info.neighborBssInfo.ssId.length == 0) &&
-                   (fc.type == SIR_MAC_MGMT_FRAME)))
-    {
-        palCopyMemory(pMac->hHdd, pNode->info.neighborBssInfo.bssId, bssIdRcv,
-                  sizeof(tSirMacAddr));
-        pNode->info.neighborBssInfo.channelId = chanId;
-    if (fc.type == SIR_MAC_DATA_FRAME)
-    {
-        // Data frame received from other BSS.
-        // Collect as much information as possible
-            pNode->info.neighborBssInfo.wniIndicator = (tAniBool) 0;
-        if (fc.toDS || fc.fromDS)
-                pNode->info.neighborBssInfo.bssType = eSIR_INFRASTRUCTURE_MODE;
-        else
-                pNode->info.neighborBssInfo.bssType = eSIR_IBSS_MODE;
-            pNode->info.neighborBssInfo.load.numStas = 0;
-            pNode->info.neighborBssInfo.load.channelUtilization = 0;
-            pNode->info.neighborBssInfo.ssId.length = 0;
-            pNode->info.neighborBssInfo.apName.length = 0;
-            pNode->info.neighborBssInfo.rsnIE.length = 0;
-            pNode->info.wdsInfo.wdsLength = 0;
-    }
-    else
-    {
-        // This must be either Beacon frame or
-        // Probe Response. Copy all relevant information.
-            pNode->info.neighborBssInfo.wniIndicator = (tAniBool) pBeacon->propIEinfo.aniIndicator;
-            pNode->info.neighborBssInfo.bssType = (tSirBssType) pBeacon->capabilityInfo.ibss;
-            pNode->info.neighborBssInfo.load.numStas = pBeacon->propIEinfo.load.numStas;
-            pNode->info.neighborBssInfo.load.channelUtilization = pBeacon->propIEinfo.load.channelUtilization;
-            
-            palCopyMemory( pMac->hHdd, (tANI_U8 *) &pNode->info.neighborBssInfo.ssId,
-                                                    &pBeacon->ssId, pBeacon->ssId.length+1);
-            pNode->info.neighborBssInfo.apName.length = pBeacon->propIEinfo.apName.length;
-            palCopyMemory( pMac->hHdd, (tANI_U8 *) pNode->info.neighborBssInfo.apName.name,
-                    pBeacon->propIEinfo.apName.name, pBeacon->propIEinfo.apName.length);
-            pNode->info.neighborBssInfo.rsnIE.length = 0;
-            // Add WPA2 information. Before that make sure that memory is available
-            if (pBeacon->rsnPresent && (pBeacon->rsn.length < SIR_MAC_MAX_IE_LENGTH))
-            {
-                pNode->info.neighborBssInfo.rsnIE.length = 2 + pBeacon->rsn.length;
-                pNode->info.neighborBssInfo.rsnIE.rsnIEdata[0] = SIR_MAC_RSN_EID;
-                pNode->info.neighborBssInfo.rsnIE.rsnIEdata[1] = pBeacon->rsn.length;
-                palCopyMemory( pMac->hHdd, (tANI_U8 *) &pNode->info.neighborBssInfo.rsnIE.rsnIEdata[2],
-                        pBeacon->rsn.info, pBeacon->rsn.length);
-               PELOG2(limLog(pMac, LOG2, FL("NeighborBss RSN IE, type=%x, length=%x\n"), 
-                        pNode->info.neighborBssInfo.rsnIE.rsnIEdata[0],
-                        pNode->info.neighborBssInfo.rsnIE.rsnIEdata[1]);)
-            }
-            // Add WPA information. Before that make sure that memory is available
-            if (pBeacon->wpaPresent && ((pBeacon->rsn.length + pBeacon->wpa.length) < (SIR_MAC_MAX_IE_LENGTH-2)))
-            {
-                pNode->info.neighborBssInfo.rsnIE.rsnIEdata[pNode->info.neighborBssInfo.rsnIE.length] =
-                    SIR_MAC_WPA_EID;
-                pNode->info.neighborBssInfo.rsnIE.rsnIEdata[pNode->info.neighborBssInfo.rsnIE.length + 1] =
-                    pBeacon->wpa.length;
-                palCopyMemory( pMac->hHdd,
-                        (tANI_U8 *) &pNode->info.neighborBssInfo.rsnIE.rsnIEdata[pNode->info.neighborBssInfo.rsnIE.length + 2],
-                        pBeacon->wpa.info, pBeacon->wpa.length);
-               PELOG2(limLog(pMac, LOG2, FL("NeighborBss WPA IE, type=%x, length=%x\n"),
-                        pNode->info.neighborBssInfo.rsnIE.rsnIEdata[pNode->info.neighborBssInfo.rsnIE.length],
-                        pNode->info.neighborBssInfo.rsnIE.rsnIEdata[pNode->info.neighborBssInfo.rsnIE.length + 1]);)
-                pNode->info.neighborBssInfo.rsnIE.length += 2 + pBeacon->wpa.length;
-            }
-            pNode->info.wdsInfo.wdsLength = (tANI_U16) pBeacon->propIEinfo.wdsLength;
-            palCopyMemory( pMac->hHdd, (tANI_U8 *) pNode->info.wdsInfo.wdsBytes,
-                      pBeacon->propIEinfo.wdsData,
-                      pBeacon->propIEinfo.wdsLength);
-            pNode->info.neighborBssInfo.capabilityInfo = *((tANI_U16*)&pBeacon->capabilityInfo);
-#if 0
-            if (pBeacon->HTCaps.present)
-                palCopyMemory( pMac->hHdd, (tANI_U8 *)&pNode->info.neighborBssInfo.HTCaps,
-                        (tANI_U8 *)&pBeacon->HTCaps, HT_CAPABILITY_IE_SIZE);
-        else
-                pNode->info.neighborBssInfo.HTCaps.present = 0;
-            if (pBeacon->HTInfo.present)
-                palCopyMemory( pMac->hHdd, (tANI_U8 *)&pNode->info.neighborBssInfo.HTInfo,
-                        (tANI_U8 *)&pBeacon->HTInfo, HT_INFO_IE_SIZE);
-        else
-                pNode->info.neighborBssInfo.HTInfo.present = 0;
-#endif
-            if (pBeacon->suppRatesPresent && (pBeacon->supportedRates.numRates <= 
-                                              SIR_MAC_RATESET_EID_MAX))
-            {
-                pNode->info.neighborBssInfo.operationalRateSet.numRates = pBeacon->supportedRates.numRates;
-               PELOG4(limLog(pMac, LOG4, FL("Supported Rates (%d) : "),
-                        pNode->info.neighborBssInfo.operationalRateSet.numRates);)
-                for (i=0; i<pBeacon->supportedRates.numRates; i++)
-                {
-                    pNode->info.neighborBssInfo.operationalRateSet.rate[i] = pBeacon->supportedRates.rate[i];
-                    PELOG4(limLog(pMac, LOG4, FL("%d "), pBeacon->supportedRates.rate[i]);)
-                }
-                PELOG4(limLog(pMac, LOG4, FL("\n"));)
-            }
-            if (pBeacon->extendedRatesPresent && (pBeacon->extendedRates.numRates <= 
-                                                  SIR_MAC_RATESET_EID_MAX))
-            {
-                pNode->info.neighborBssInfo.extendedRateSet.numRates = pBeacon->extendedRates.numRates;
-               PELOG4(limLog(pMac, LOG4, FL("Extended Rates (%d) : "),
-                        pNode->info.neighborBssInfo.extendedRateSet.numRates);)
-                for (i=0; i<pBeacon->extendedRates.numRates; i++)
-                {
-                    pNode->info.neighborBssInfo.extendedRateSet.rate[i] = pBeacon->extendedRates.rate[i];
-                    PELOG4(limLog(pMac, LOG4, FL("%d "), pBeacon->extendedRates.rate[i]);)
-                }
-            }
-            else
-            {
-                pNode->info.neighborBssInfo.extendedRateSet.numRates = 0;
-            }
-            pNode->info.neighborBssInfo.nwType = nwType;
-            pNode->info.neighborBssInfo.hcfEnabled = pBeacon->propIEinfo.hcfEnabled;
-            pNode->info.neighborBssInfo.beaconInterval = pBeacon->beaconInterval;
-            pNode->info.neighborBssInfo.wmeInfoPresent = pBeacon->wmeInfoPresent;
-            pNode->info.neighborBssInfo.wmeEdcaPresent = pBeacon->wmeEdcaPresent;
-            pNode->info.neighborBssInfo.wsmCapablePresent = pBeacon->wsmCapablePresent;
-            pNode->info.neighborBssInfo.propIECapability = pBeacon->propIEinfo.capability;
-            pNode->info.neighborBssInfo.localPowerConstraints = pBeacon->localPowerConstraint.localPowerConstraints;
-            pNode->info.neighborBssInfo.dtimPeriod = pBeacon->tim.dtimPeriod;
-            pNode->info.neighborBssInfo.HTCapsPresent = pBeacon->HTCaps.present;
-            pNode->info.neighborBssInfo.HTInfoPresent = pBeacon->HTInfo.present;
-        }
-    }
-} /****** end limCollectMeasurementData() ******/
-/**
- * limCleanupMatrixNodes()
- *
- *FUNCTION:
- * This function is called from various places within LIM code
- * to cleanup channel info matrix collected by learn mode measurements.
- *
- *LOGIC:
- *
- *ASSUMPTIONS:
- * NA
- *
- *NOTE:
- * NA
- *
- * @param  pMac      Pointer to Global MAC structure
- * @return None
- */
-static void
-limCleanupMatrixNodes(tpAniSirGlobal pMac)
-{
-    if (pMac->lim.gpLimMeasData->pMeasMatrixInfo)
-    {
-        tpLimMeasMatrixNode pNode = pMac->lim.gpLimMeasData->pMeasMatrixInfo;
-        tpLimMeasMatrixNode pNext;
-      while (pNode)
-      {
-            pNext = pNode->next;
-            palFreeMemory( pMac->hHdd, pNode);
-            if (pNext)
-                pNode = pNext;
-            else
-              break;
-          }
-      }
-    pMac->lim.gpLimMeasData->numMatrixNodes = 0;
-         PELOG2(limLog(pMac, LOG2,
-           FL("Cleaned up channel matrix nodes\n"));)
-    pMac->lim.gpLimMeasData->pMeasMatrixInfo = NULL;
-} /****** end limCleanupMatrixNodes() ******/
-/**
- * limCleanupNeighborBssNodes()
- *
- *FUNCTION:
- * This function is called from various places within LIM code
- * to cleanup neighbor info collected by learn mode measurements.
- *
- *LOGIC:
- *
- *ASSUMPTIONS:
- * NA
- *
- *NOTE:
- * NA
- *
- * @param  pMac      Pointer to Global MAC structure
- * @return None
- */
-static void
-limCleanupNeighborBssNodes(tpAniSirGlobal pMac)
-{
-    if (pMac->lim.gpLimMeasData->pNeighborWdsInfo)
-    {
-        tpLimNeighborBssWdsNode pNode =
-                             pMac->lim.gpLimMeasData->pNeighborWdsInfo;
-        tpLimNeighborBssWdsNode pNext;
-        while (pNode)
-        {
-            pNext = pNode->next;
-            pMac->lim.gpLimMeasData->numBssWds--;
-            palFreeMemory( pMac->hHdd, pNode);
-            if (pNext)
-                pNode = pNext;
-            else
-                break;
-        }
-    }
-   PELOG2(limLog(pMac, LOG2,
-           FL("Cleaned up neighbor nodes\n"));)
-    pMac->lim.gpLimMeasData->numBssWds        = 0;
-    pMac->lim.gpLimMeasData->totalBssSize     = 0;
-    pMac->lim.gpLimMeasData->pNeighborWdsInfo = NULL;
-} /****** end limCleanupNeighborBssNodes() ******/
-
-/**
- * limSendSmeMeasurementInd()
- *
- *FUNCTION:
- * This function is called by limProcessLmmMessages() to
- * send SME_MEASUREMENT_IND message to WSM.
- *
- *LOGIC:
- *
- *ASSUMPTIONS:
- *
- *NOTE:
- *
- * @param  pMac - Pointer to Global MAC structure
- * @return None
- */
-void
-limSendSmeMeasurementInd(tpAniSirGlobal pMac)
-{
-    tANI_U8          *pMeasInd;
-    tANI_U16         len = 0;
-    tSirMsgQ    mmhMsg;
-#ifdef GEN6_TODO
-    //fetch the sessionEntry based on the sessionId
-    //priority - MEDIUM
-    tpPESession sessionEntry;
-    if((sessionEntry = peFindSessionBySessionId(pMac, pMac->lim.gLimMeasParams.measurementIndTimer.sessionId))== NULL) 
-    {
-        limLog(pMac, LOGP,FL("Session Does not exist for given sessionID\n"));
-        return;
-    }
-#endif
-    if (!pMac->sys.gSysEnableLearnMode ||
-        (pMac->lim.gpLimMeasReq == NULL))
-    {
-        return;
-    }
-    len = sizeof(tSirSmeMeasurementInd) +
-          (pMac->lim.gpLimMeasReq->channelList.numChannels *
-           sizeof(tSirMeasMatrixInfo)) +
-           pMac->lim.gpLimMeasData->totalBssSize;
-    if (len > LIM_MAX_BUF_SIZE)
-    {
-        limLog(pMac, LOGP,
-               FL("len %d numChannels %d numBssWds %d totalBssSize %d\n"),
-               len,
-               pMac->lim.gpLimMeasReq->channelList.numChannels,
-               pMac->lim.gpLimMeasData->numBssWds,
-               pMac->lim.gpLimMeasData->totalBssSize);
-    }
-    PELOG2(limLog(pMac, LOG2, FL("*****  Measurement IND size %d\n"), len);)
-    if( eHAL_STATUS_SUCCESS != palAllocateMemory( pMac->hHdd, (void **)&pMeasInd, len))
-    {
-        /// Buffer not available. Log error
-        limLog(pMac, LOGP,
-               FL("call to palAllocateMemory failed for eWNI_SME_MEAS_IND\n"));
-        return;
-    }
-   PELOG3(limLog(pMac, LOG3,
-       FL("Sending eWNI_SME_MEAS_IND on Radio %d, requested len=%d\n"),
-       pMac->sys.gSirRadioId, len);)
-    limMeasurementIndSerDes(pMac, pMeasInd);
-    mmhMsg.type = eWNI_SME_MEASUREMENT_IND;
-    mmhMsg.bodyptr = pMeasInd;
-    mmhMsg.bodyval = 0;
-    MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type));
-    limSysProcessMmhMsgApi(pMac, &mmhMsg,  ePROT);
-    // Cleanup neighbor information
-    limCleanupNeighborBssNodes(pMac);
-    limCleanupMatrixNodes(pMac);
-} /*** end limSendSmeMeasurementInd() ***/
-
-/**
- * limCleanupMeasData()
- *
- *FUNCTION:
- * This function is called from various places within LIM code
- * to cleanup measurement related data.
- *
- *LOGIC:
- * Buffers and associated timer resources will be deleted when
- * this function is called
- *
- *ASSUMPTIONS:
- * NA
- *
- *NOTE:
- * NA
- *
- * @param  pMac      Pointer to Global MAC structure
- * @return None
- */
-void
-limCleanupMeasData(tpAniSirGlobal pMac)
-{
-    if (pMac->lim.gpLimMeasReq)
-        palFreeMemory( pMac->hHdd, pMac->lim.gpLimMeasReq);
-    pMac->lim.gpLimMeasReq = NULL;
-    if (!pMac->lim.gpLimMeasData)
-        return;
-    if (pMac->lim.gpLimMeasData->pMeasMatrixInfo)
-    {
-        // Retain current channel's data and flush remaining
-        tpLimMeasMatrixNode pMatrix =
-                        (pMac->lim.gpLimMeasData->pMeasMatrixInfo)->next;
-        tpLimMeasMatrixNode pNext;
-        while (pMatrix)
-        {
-            pNext = pMatrix->next;
-            palFreeMemory( pMac->hHdd, pMatrix);
-            if (pNext)
-                pMatrix = pNext;
-            else
-                break;
-        }
-        pMac->lim.gpLimMeasData->pMeasMatrixInfo->next = NULL;
-    }
-    pMac->lim.gpLimMeasData->numMatrixNodes = 0;
-   PELOG2(limLog(pMac, LOG2,
-           FL("Cleaned up measurement metrics nodes\n"));)
-    // Cleanup neighbor information
-    limCleanupNeighborBssNodes(pMac);
-} /****** end limCleanupMeasData() ******/
-/**---------------------------------------------------------
-\fn     limStopMeasTimers
-\brief  Stops all measurement related timers.
-\param  pMac
-\return None
- ----------------------------------------------------------*/
-void
-limStopMeasTimers(tpAniSirGlobal pMac)
-{
-    if (pMac->lim.gpLimMeasReq == NULL)
-        return;
-    if (pMac->lim.gpLimMeasReq->measControl.periodicMeasEnabled)
-    {
-        if (tx_timer_deactivate(&pMac->lim.gLimMeasParams.measurementIndTimer) != TX_SUCCESS)
-        {
-            PELOGE(limLog(pMac, LOGE, FL("Cannot stop measurement Ind timer\n"));)
-        }
-    }
-    pMac->lim.gLimMeasParams.isMeasIndTimerActive = 0;
-    MTRACE(macTrace(pMac, TRACE_CODE_TIMER_DEACTIVATE, NO_SESSION, eLIM_LEARN_INTERVAL_TIMER));
-    if (tx_timer_deactivate(&pMac->lim.gLimMeasParams.learnIntervalTimer) != TX_SUCCESS)
-    {
-        PELOGE(limLog(pMac, LOGE, FL("Cannot stop learn interval timer\n"));)
-    }
-    if (pMac->lim.gLimSpecMgmt.fQuietEnabled)
-    {
-        MTRACE(macTrace(pMac, TRACE_CODE_TIMER_DEACTIVATE, NO_SESSION, eLIM_LEARN_DURATION_TIMER));
-        if (tx_timer_deactivate(&pMac->lim.gLimMeasParams.learnDurationTimer) != TX_SUCCESS)
-        {
-            PELOGE(limLog(pMac, LOGE, FL("Cannot stop learn duration timer\n"));)
-        }
-    }
-    MTRACE(macTrace(pMac, TRACE_CODE_TIMER_DEACTIVATE, NO_SESSION, eLIM_LEARN_DURATION_TIMER));
-    if (tx_timer_deactivate(&pMac->lim.gLimMeasParams.learnDurationTimer) != TX_SUCCESS)
-    {
-        PELOGE(limLog(pMac, LOGE, FL("Cannot stop learn duration timer\n"));)
-    }
-}
-/**
- * limDeleteMeasTimers()
- *
- *FUNCTION:
- * This function is called by limProcessLmmMessages() upon
- * receiving SME_MEASUREMENT_REQ. This function deletes
- * timers associated with Measurements.
- *
- *LOGIC:
- *
- *ASSUMPTIONS:
- *
- *NOTE:
- *
- * @param  pMac      Pointer to Global MAC structure
- * @return None
- */
-void
-limDeleteMeasTimers(tpAniSirGlobal pMac)
-{
-    if (pMac->lim.gpLimMeasReq->measControl.periodicMeasEnabled)
-    tx_timer_delete(&pMac->lim.gLimMeasParams.measurementIndTimer);
-    tx_timer_delete(&pMac->lim.gLimMeasParams.learnIntervalTimer);
-    tx_timer_delete(&pMac->lim.gLimMeasParams.learnDurationTimer);
-} /*** end limDeleteMeasTimers() ***/
-
-/**
- * limCleanupMeasResources()
- *
- *FUNCTION:
- * This function is called from various places within LIM code
- * to cleanup measurement related data and resources.
- *
- *LOGIC:
- * Buffers and associated timer resources will be deleted when
- * this function is called
- *
- *ASSUMPTIONS:
- * NA
- *
- *NOTE:
- * NA
- *
- * @param  pMac      Pointer to Global MAC structure
- * @return None
- */
-void
-limCleanupMeasResources(tpAniSirGlobal pMac)
-{
-   PELOG1( limLog(pMac, LOG1,
-           FL("Cleaning up Learn mode Measurement resources\n"));)
-    if (pMac->lim.gpLimMeasReq == NULL)
-        return;
-    limDeleteMeasTimers(pMac);
-    if (pMac->lim.gpLimMeasData)
-    {
-        limCleanupMeasData(pMac);
-        if (pMac->lim.gpLimMeasData->pMeasMatrixInfo)
-            palFreeMemory( pMac->hHdd, pMac->lim.gpLimMeasData->pMeasMatrixInfo);
-        palFreeMemory( pMac->hHdd, pMac->lim.gpLimMeasData);
-        pMac->lim.gpLimMeasData = NULL;
-    }
-} /****** end limCleanupMeasResources() ******/
-
-/**
- * limDeleteCurrentBssWdsNode()
- *
- *FUNCTION:
- * This function is called when Loss of link
- * is detected with AP and its BssWds info node
- * to be deleted
- *
- *LOGIC:
- *
- *ASSUMPTIONS:
- * NA
- *
- *NOTE:
- * NA
- *
- * @param  None
- * @return None
- */
-void limDeleteCurrentBssWdsNode(tpAniSirGlobal pMac)
-{
-    tANI_U32                 cfg = sizeof(tSirMacAddr);
-    tSirMacAddr         currentBssId;
-#if 0
-    if (wlan_cfgGetStr(pMac, WNI_CFG_BSSID, currentBssId, &cfg) !=
-                                eSIR_SUCCESS)
-    {
-        /// Could not get BSSID from CFG. Log error.
-        limLog(pMac, LOGP, FL("could not retrieve BSSID\n"));
-    }
-#endif //TO SUPPORT BT-AMP
-    sirCopyMacAddr(currentBssId,sessionEntry->bssId);
-    if (!pMac->lim.gpLimMeasData)
-        return;
-    if (pMac->lim.gpLimMeasData->pNeighborWdsInfo)
-    {
-        tpLimNeighborBssWdsNode pNode =
-                             pMac->lim.gpLimMeasData->pNeighborWdsInfo;
-        tpLimNeighborBssWdsNode pPrev = pNode;
-        while (pNode)
-        {
-            if (palEqualMemory( pMac->hHdd,pNode->info.neighborBssInfo.bssId,
-                          currentBssId,
-                          sizeof(tSirMacAddr)))
-            {
-                pMac->lim.gpLimMeasData->numBssWds--;
-                pPrev->next = pNode->next;
-                palFreeMemory( pMac->hHdd, pNode);
-                break;
-            }
-            pPrev = pNode;
-            if (pNode->next)
-                pNode = pNode->next;
-            else
-                break;
-        }
-        if (!pMac->lim.gpLimMeasData->numBssWds)
-            pMac->lim.gpLimMeasData->pNeighborWdsInfo = NULL;
-    }
-} /****** end limDeleteCurrentBssWdsNode() ******/
-
-/**
- * limRestorePreLearnState()
- *
- *FUNCTION:
- * This function is called when Learn duration timer expires
- * to restore pre-Learn mode state
- *
- *LOGIC:
- *
- *ASSUMPTIONS:
- * NA
- *
- *NOTE:
- * NA
- *
- * @param  pMac      Pointer to Global MAC structure
- * @return None
- */
-void
-limRestorePreLearnState(tpAniSirGlobal pMac)
-{
-   PELOG4(limLog(pMac, LOG4,
-           FL("Restoring from Learn mode on RadioId %d\n"),
-           pMac->sys.gSirRadioId);)
-    pMac->lim.gLimSystemInScanLearnMode = 0;
-    // Go back to previous state.
-    pMac->lim.gLimSmeState = pMac->lim.gLimPrevSmeState;
-    pMac->lim.gLimMlmState = pMac->lim.gLimPrevMlmState;
-    MTRACE(macTrace(pMac, TRACE_CODE_SME_STATE, NO_SESSION, pMac->lim.gLimSmeState));
-    MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, NO_SESSION, pMac->lim.gLimMlmState));
-   PELOG4(limLog(pMac, LOG4,
-           FL("Restored from Learn mode on RadioId %d\n"),
-           pMac->sys.gSirRadioId);)
-} /****** end limRestorePreLearnState() ******/
-#endif //#if (defined(ANI_PRODUCT_TYPE_AP) || (ANI_PRODUCT_TYPE_AP_SDK))
 /**
  * limGetHTCBState
  *
diff --git a/CORE/MAC/src/pe/lim/limPropExtsUtils.h b/CORE/MAC/src/pe/lim/limPropExtsUtils.h
index 0ce8207..f028cb0 100644
--- a/CORE/MAC/src/pe/lim/limPropExtsUtils.h
+++ b/CORE/MAC/src/pe/lim/limPropExtsUtils.h
@@ -49,7 +49,7 @@
  * History:-
  * Date           Modified by    Modification Information
  * --------------------------------------------------------------------
- * 
+ *
  */
 
 #ifndef __LIM_PROP_EXTS_UTILS_H
@@ -69,20 +69,10 @@
 void limDeleteCurrentBssWdsNode(tpAniSirGlobal);
 tANI_U32  limComputeAvg(tpAniSirGlobal, tANI_U32, tANI_U32);
 
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED) && defined(ANI_PRODUCT_TYPE_AP)
-// Timer Handlers
-void limMeasurementTimerHandler(VOID*, tANI_U32);
-#endif
 
 /// Function to extract AP's HCF capability from IE fields
 void limExtractApCapability(tpAniSirGlobal, tANI_U8 *, tANI_U16, tANI_U8 *, tANI_U16 *, tANI_U8 *, tPowerdBm*, tpPESession);
 
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED) && defined(ANI_PRODUCT_TYPE_AP)
-/// Function to extract current Learn channel
-tANI_U8 limGetCurrentLearnChannel(tpAniSirGlobal);
-// Determine if a newly discovered BSS is TITAN-compatible
-void handleNonTitanBss( tpAniSirGlobal, tSirNeighborBssWdsInfo );
-#endif
 tStaRateMode limGetStaPeerType( tpAniSirGlobal, tpDphHashNode ,tpPESession);
 #ifdef WLAN_FEATURE_11AC
 ePhyChanBondState  limGetHTCBState(ePhyChanBondState aniCBMode) ;
diff --git a/CORE/MAC/src/pe/lim/limRoamingAlgo.c b/CORE/MAC/src/pe/lim/limRoamingAlgo.c
index 94a0f58..09c78cd 100644
--- a/CORE/MAC/src/pe/lim/limRoamingAlgo.c
+++ b/CORE/MAC/src/pe/lim/limRoamingAlgo.c
@@ -52,11 +52,7 @@
  *
  */
 
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-#include "wniCfgAp.h"
-#else
 #include "wniCfgSta.h"
-#endif
 #include "cfgApi.h"
 #include "limTypes.h"
 #include "limTimerUtils.h"
@@ -64,7 +60,6 @@
 
 
 
-#if (WNI_POLARIS_FW_PRODUCT == WLAN_STA) || defined(ANI_AP_CLIENT_SDK)
 /** ----------------------------------------------------------------------
 \fn      limSelectsBackgroundScanMode() 
 \brief   This function is called by limIsBackgroundScanAllowed(). 
@@ -337,4 +332,3 @@
     return;
 }
 
-#endif
diff --git a/CORE/MAC/src/pe/lim/limSecurityUtils.c b/CORE/MAC/src/pe/lim/limSecurityUtils.c
index 0c792f3..409364a 100644
--- a/CORE/MAC/src/pe/lim/limSecurityUtils.c
+++ b/CORE/MAC/src/pe/lim/limSecurityUtils.c
@@ -54,11 +54,7 @@
 #include "wniApi.h"
 
 #include "sirCommon.h"
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-#include "wniCfgAp.h"
-#else
 #include "wniCfgSta.h"
-#endif
 #include "cfgApi.h"
 
 
@@ -199,45 +195,6 @@
 {
     pMac->lim.pLimPreAuthList = NULL;
 
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-    if (pMac->lim.gLimSystemRole == eLIM_AP_ROLE )
-    {
-        tANI_U32 authClnupTimeout;
-        //tANI_U32 cfgValue;
-
-        if (wlan_cfgGetInt(pMac, WNI_CFG_PREAUTH_CLNUP_TIMEOUT,
-                      &authClnupTimeout) != eSIR_SUCCESS)
-        {
-            /**
-             * Could not get PreAuthClnupTimeout value
-             * from CFG. Log error.
-             */
-            limLog(pMac, LOGE,
-               FL("could not retrieve PreAuthClnupTimeout value\n"));
-
-            return;
-        }
-        authClnupTimeout = SYS_MS_TO_TICKS(authClnupTimeout);
-
-        /// Create and start periodic pre-auth context cleanup timeout
-        if (tx_timer_create(&pMac->lim.limTimers.gLimPreAuthClnupTimer,
-                            "preAuthCleanup",
-                            limTimerHandler,
-                            SIR_LIM_PREAUTH_CLNUP_TIMEOUT,
-                            authClnupTimeout, authClnupTimeout,
-                            TX_AUTO_ACTIVATE) != TX_SUCCESS)
-        {
-            /// Could not create PreAuthCleanup timer.
-            // Log error
-            limLog(pMac, LOGP, FL("could not create PreAuthCleanup timer\n"));
-
-            return;
-        }
-        PELOG1(limLog(pMac, LOG1,
-               FL("Created pre-auth cleanup timer\n"));)
-
-    }
-#endif
 } /*** end limInitPreAuthList() ***/
 
 
@@ -422,14 +379,6 @@
 
         pMac->lim.pLimPreAuthList = pTempNode->next;
 
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-        // Delete the auth response timer if running
-        if (pTempNode->fTimerStarted)
-            limDeactivateAndChangePerStaIdTimer(pMac,
-                                                eLIM_AUTH_RSP_TIMER,
-                                                pTempNode->authNodeIdx);
-
-#endif
 
         PELOG1(limLog(pMac, LOG1, FL("=====> limDeletePreAuthNode : first node to delete\n"));)
         PELOG1(limLog(pMac, LOG1, FL("Release data entry: %x id %d peer \n"),
@@ -452,13 +401,6 @@
 
             pPrevNode->next = pTempNode->next;
 
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-            // Delete the auth response timer if running
-            if (pTempNode->fTimerStarted)
-                limDeactivateAndChangePerStaIdTimer(pMac,
-                                                    eLIM_AUTH_RSP_TIMER,
-                                                    pTempNode->authNodeIdx);
-#endif
             PELOG1(limLog(pMac, LOG1, FL("=====> limDeletePreAuthNode : subsequent node to delete\n"));
             limLog(pMac, LOG1, FL("Release data entry: %x id %d peer \n"),
                          pTempNode, pTempNode->authNodeIdx);
@@ -480,119 +422,6 @@
 } /*** end limDeletePreAuthNode() ***/
 
 
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-/**
- * limPreAuthClnupHandler
- *
- *FUNCTION:
- * This function is called on AP upon peridic Pre-authentication
- * context cleanup.
- *
- *LOGIC:
- * A Pre-auth node is marked as seen first time it comes across
- * the list traversal. It'll be deleted if already 'seen' (during
- * next Pre-auth cleanup).
- *
- *ASSUMPTIONS:
- *
- *NOTE:
- *
- * @param  pMac - Pointer to Global MAC structure
- * @return None
- */
-
-void
-limPreAuthClnupHandler(tpAniSirGlobal pMac)
-{
-    tANI_U16              aid;
-    tANI_U8             firstNode=false;
-    tpDphHashNode    pStaDs;
-    struct tLimPreAuthNode  *pPrevNode, *pCurrNode;
-
-#ifdef GEN6_TODO
-    //fetch the sessionEntry based on the sessionId
-    //priority - MEDIUM
-    tpPESession sessionEntry;
-
-    if((sessionEntry = peFindSessionBySessionId(pMac, pMac->lim.limTimers.gLimPreAuthClnupTimer.sessionId))== NULL) 
-    {
-        limLog(pMac, LOGP,FL("Session Does not exist for given sessionID\n"));
-        return;
-    }
-#endif
-
-    pCurrNode = pPrevNode = pMac->lim.pLimPreAuthList;
-
-    while (pCurrNode != NULL)
-    {
-        if (pCurrNode->fSeen)
-        {
-            // Found node to be deleted
-
-            if (pCurrNode == pMac->lim.pLimPreAuthList)
-            {
-                // First node being deleted
-                pMac->lim.pLimPreAuthList = pPrevNode = pCurrNode->next;
-                firstNode = true;
-            }
-            else
-            {
-                pPrevNode->next = pCurrNode->next;
-            }
-
-            // Delete the auth response timer if running
-            if (pCurrNode->fTimerStarted)
-                limDeactivateAndChangePerStaIdTimer(pMac,
-                                                    eLIM_AUTH_RSP_TIMER,
-                                                    pCurrNode->authNodeIdx);
-
-            pStaDs = dphLookupHashEntry(pMac,
-                                        pCurrNode->peerMacAddr,
-                                        &aid);
-
-            if (!pStaDs)
-            {
-                /**
-                 * STA does not have associated context.
-                 * Send advisory Deauthentication frame
-                 * to STA being deleted
-                 */
-                limSendDeauthMgmtFrame(pMac,
-                                       eSIR_MAC_PREV_AUTH_NOT_VALID_REASON, //=2
-                                       pCurrNode->peerMacAddr, sessionEntry,
-                                       FALSE);
-            }
-
-            limLog(pMac,
-                   LOG3,
-                   FL("Release preAuth node during periodic cleanup\n"));
-            limReleasePreAuthNode(pMac, pCurrNode);
-
-            if (firstNode)
-            {
-                // First node was deleted
-                if (pMac->lim.pLimPreAuthList == NULL)
-                    break;
-
-                pCurrNode = pMac->lim.pLimPreAuthList;
-                firstNode = false;
-            }
-            else
-            {
-                pCurrNode = pPrevNode->next;
-            }
-        }
-        else
-        {
-            // Mark this node as 'seen'. To be deleted next time.
-            pCurrNode->fSeen = 1;
-
-            pPrevNode = pCurrNode;
-            pCurrNode = pCurrNode->next;
-        }
-    }
-} /*** end limPreAuthClnupHandler() ***/
-#endif
 
 
 
@@ -981,9 +810,6 @@
                 (tANI_U8 *) pMlmSetKeysReq->peerMacAddr,
                 sizeof(tSirMacAddr));
 
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-  mlmSetKeysCnf->aid = pMlmSetKeysReq->aid;
-#endif
 
   /// Free up buffer allocated for mlmSetKeysReq
   palFreeMemory( pMac->hHdd, (tANI_U8 *) pMlmSetKeysReq );
diff --git a/CORE/MAC/src/pe/lim/limSendManagementFrames.c b/CORE/MAC/src/pe/lim/limSendManagementFrames.c
index ea58603..addf566 100644
--- a/CORE/MAC/src/pe/lim/limSendManagementFrames.c
+++ b/CORE/MAC/src/pe/lim/limSendManagementFrames.c
@@ -561,9 +561,6 @@
     PopulateDot11fDSParams( pMac, &pFrm->DSParams, psessionEntry->currentOperChannel,psessionEntry);
     PopulateDot11fIBSSParams( pMac, &pFrm->IBSSParams, psessionEntry );
 
-#ifdef ANI_PRODUCT_TYPE_AP
-    PopulateDot11fCFParams( pMac, &pFrm->Capabilities, &pFrm->CFParams );
-#endif // AP Image
 
     if(psessionEntry->limSystemRole == eLIM_AP_ROLE)
     {
@@ -600,26 +597,6 @@
     PopulateDot11fCountry( pMac, &pFrm->Country, psessionEntry);
     PopulateDot11fEDCAParamSet( pMac, &pFrm->EDCAParamSet, psessionEntry);
 
-#ifdef ANI_PRODUCT_TYPE_AP
-    if( pSessionEntry->lim11hEnable )
-    {
-        PopulateDot11fPowerConstraints( pMac, &pFrm->PowerConstraints );
-        PopulateDot11fTPCReport( pMac, &pFrm->TPCReport, psessionEntry);
-
-        // If .11h isenabled & channel switching is not already started and
-        // we're in either PRIMARY_ONLY or PRIMARY_AND_SECONDARY state, then
-        // populate 802.11h channel switch IE
-        if (( pMac->lim.gLimChannelSwitch.switchCount != 0 ) &&
-             ( pMac->lim.gLimChannelSwitch.state ==
-               eLIM_CHANNEL_SWITCH_PRIMARY_ONLY ||
-               pMac->lim.gLimChannelSwitch.state ==
-               eLIM_CHANNEL_SWITCH_PRIMARY_AND_SECONDARY ) )
-        {
-            PopulateDot11fChanSwitchAnn( pMac, &pFrm->ChanSwitchAnn, psessionEntry );
-            PopulateDot11fExtChanSwitchAnn(pMac, &pFrm->ExtChanSwitchAnn, psessionEntry );
-        }
-    }
-#endif
 
     if (psessionEntry->dot11mode != WNI_CFG_DOT11_MODE_11B)
         PopulateDot11fERPInfo( pMac, &pFrm->ERPInfo, psessionEntry);
@@ -1208,254 +1185,6 @@
 
 } // End limSendAddtsReqActionFrame.
 
-/* Added ANI_PRODUCT_TYPE_CLIENT for BT-AMP Support */
-#ifdef ANI_PRODUCT_TYPE_AP
-
-void
-limSendAssocRspMgmtFrame(tpAniSirGlobal pMac,
-                         tANI_U16       statusCode,
-                         tANI_U16       aid,
-                         tSirMacAddr    peerMacAddr,
-                         tANI_U8        subType,
-                         tpDphHashNode  pSta,
-                         tpPESession psessionEntry)
-{
-    tDot11fAssocResponse frm;
-    tANI_U8             *pFrame, *macAddr;
-    tpSirMacMgmtHdr      pMacHdr;
-    tSirRetStatus        nSirStatus;
-    tANI_U8              lleMode = 0, fAddTS, edcaInclude = 0;
-    tHalBitVal           qosMode, wmeMode;
-    tANI_U32             nPayload, nBytes, nStatus, cfgLen;
-    void                *pPacket;
-    eHalStatus           halstatus;
-    tUpdateBeaconParams beaconParams;
-    tANI_U32             wpsApEnable=0, tmp;
-    tANI_U8              txFlag = 0;
-
-    palZeroMemory( pMac->hHdd, ( tANI_U8* )&frm, sizeof( frm ) );
-
-    limGetQosMode(pMac, &qosMode);
-    limGetWmeMode(pMac, &wmeMode);
-
-    // An Add TS IE is added only if the AP supports it and the requesting
-    // STA sent a traffic spec.
-    fAddTS = ( qosMode && pSta && pSta->qos.addtsPresent ) ? 1 : 0;
-
-    PopulateDot11fCapabilities( pMac, &frm.Capabilities, psessionEntry);
-
-    frm.Status.status = statusCode;
-
-    frm.AID.associd = aid | LIM_AID_MASK;
-
-    PopulateDot11fSuppRates( pMac, POPULATE_DOT11F_RATES_OPERATIONAL, &frm.SuppRates );
-
-    if (wlan_cfgGetInt(pMac, (tANI_U16) WNI_CFG_WPS_ENABLE, &tmp) != eSIR_SUCCESS)
-        limLog(pMac, LOGP,"Failed to cfg get id %d\n", WNI_CFG_WPS_ENABLE );
-    
-    wpsApEnable = tmp & WNI_CFG_WPS_ENABLE_AP;
-
-    if (wpsApEnable)
-    {
-        PopulateDot11fWscInAssocRes(pMac, &frm.WscAssocRes);
-    }
-
-    PopulateDot11fExtSuppRates( pMac, POPULATE_DOT11F_RATES_OPERATIONAL,
-                                &frm.ExtSuppRates, psessionEntry );
-
-    if ( NULL != pSta )
-    {
-        if ( eHAL_SET == qosMode )
-        {
-            if ( pSta->lleEnabled )
-            {
-                lleMode = 1;
-                if ( ( ! pSta->aniPeer ) || ( ! PROP_CAPABILITY_GET( 11EQOS, pSta->propCapability ) ) )
-                {
-                    PopulateDot11fEDCAParamSet( pMac, &frm.EDCAParamSet, psessionEntry);
-
-//                     FramesToDo:...
-//                     if ( fAddTS )
-//                     {
-//                         tANI_U8 *pAf = pBody;
-//                         *pAf++ = SIR_MAC_QOS_ACTION_EID;
-//                         tANI_U32 tlen;
-//                         status = sirAddtsRspFill(pMac, pAf, statusCode, &pSta->qos.addts, NULL,
-//                                                  &tlen, bufLen - frameLen);
-//                     } // End if on Add TS.
-                }
-            } // End if on .11e enabled in 'pSta'.
-        } // End if on QOS Mode on.
-
-        if ( ( ! lleMode ) && ( eHAL_SET == wmeMode ) && pSta->wmeEnabled )
-        {
-            if ( ( ! pSta->aniPeer ) || ( ! PROP_CAPABILITY_GET( WME, pSta->propCapability ) ) )
-            {
-                PopulateDot11fWMMParams( pMac, &frm.WMMParams );
-
-                if ( pSta->wsmEnabled )
-                {
-                    PopulateDot11fWMMCaps(&frm.WMMCaps );
-                }
-            }
-        }
-
-        if ( pSta->aniPeer )
-        {
-            if ( ( lleMode && PROP_CAPABILITY_GET( 11EQOS, pSta->propCapability ) ) ||
-                 ( pSta->wmeEnabled && PROP_CAPABILITY_GET( WME, pSta->propCapability ) ) )
-            {
-                edcaInclude = 1;
-            }
-
-        } // End if on Airgo peer.
-
-        if ( pSta->mlmStaContext.htCapability  && 
-             psessionEntry->htCapability )
-        {
-            PopulateDot11fHTCaps( pMac, psessionEntry, &frm.HTCaps );
-            PopulateDot11fHTInfo( pMac, &frm.HTInfo, psessionEntry);
-        }
-    } // End if on non-NULL 'pSta'.
-
-
-    if(pMac->lim.gLimProtectionControl != WNI_CFG_FORCE_POLICY_PROTECTION_DISABLE)
-        limDecideApProtection(pMac, peerMacAddr, &beaconParams);
-    limUpdateShortPreamble(pMac, peerMacAddr, &beaconParams);
-    limUpdateShortSlotTime(pMac, peerMacAddr, &beaconParams);
-
-    //Send message to HAL about beacon parameter change.
-    if(beaconParams.paramChangeBitmap)
-    {
-        schSetFixedBeaconFields(pMac,psessionEntry);
-        limSendBeaconParams(pMac, &beaconParams, psessionEntry );
-    }
-
-    // Allocate a buffer for this frame:
-    nStatus = dot11fGetPackedAssocResponseSize( pMac, &frm, &nPayload );
-    if ( DOT11F_FAILED( nStatus ) )
-    {
-        limLog( pMac, LOGE, FL("Failed to calculate the packed size f"
-                               "or an Association Response (0x%08x).\n"),
-                nStatus );
-        return;
-    }
-    else if ( DOT11F_WARNED( nStatus ) )
-    {
-        limLog( pMac, LOGW, FL("There were warnings while calculating"
-                               "the packed size for an Association Re"
-                               "sponse (0x%08x).\n"), nStatus );
-    }
-
-    nBytes = sizeof( tSirMacMgmtHdr ) + nPayload;
-
-    halstatus = palPktAlloc( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT,
-                             ( tANI_U16 )nBytes, ( void** ) &pFrame,
-                             ( void** ) &pPacket );
-    if ( ! HAL_STATUS_SUCCESS ( halstatus ) )
-    {
-        limLog(pMac, LOGP, FL("Call to bufAlloc failed for RE/ASSOC RSP.\n"));
-        return;
-    }
-
-    // Paranoia:
-    palZeroMemory( pMac->hHdd, pFrame, nBytes );
-
-    // Next, we fill out the buffer descriptor:
-    nSirStatus = limPopulateMacHeader( pMac,
-                                pFrame,
-                                SIR_MAC_MGMT_FRAME,
-                                ( LIM_ASSOC == subType ) ?
-                                    SIR_MAC_MGMT_ASSOC_RSP :
-                                    SIR_MAC_MGMT_REASSOC_RSP,
-                                    peerMacAddr);
-    if ( eSIR_SUCCESS != nSirStatus )
-    {
-        limLog( pMac, LOGE, FL("Failed to populate the buffer descrip"
-                               "tor for an Association Response (%d).\n"),
-                nSirStatus );
-        palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT,
-                    ( void* ) pFrame, ( void* ) pPacket );
-        return;
-    }
-
-    pMacHdr = ( tpSirMacMgmtHdr ) pFrame;
-
-   
-    cfgLen = SIR_MAC_ADDR_LENGTH;
-    if ( eSIR_SUCCESS != wlan_cfgGetStr( pMac, WNI_CFG_BSSID,
-                                    ( tANI_U8* )pMacHdr->bssId, &cfgLen ) )
-    {
-        limLog( pMac, LOGP, FL("Failed to retrieve WNI_CFG_BSSID whil"
-                               "e sending an Association Response.\n") );
-        palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket );
-        return;                 // allocated!
-    }
-  
-    nStatus = dot11fPackAssocResponse( pMac, &frm,
-                                       pFrame + sizeof( tSirMacMgmtHdr ),
-                                       nPayload, &nPayload );
-    if ( DOT11F_FAILED( nStatus ) )
-    {
-        limLog( pMac, LOGE, FL("Failed to pack an Association Response (0x%08x).\n"),
-                nStatus );
-        palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT,
-                    ( void* ) pFrame, ( void* ) pPacket );
-        return;                 // allocated!
-    }
-    else if ( DOT11F_WARNED( nStatus ) )
-    {
-        limLog( pMac, LOGW, FL("There were warnings while packing an "
-                               "Association Response (0x%08x).\n") );
-    }
-
-    macAddr = pMacHdr->da;
-
-    if (subType == LIM_ASSOC)
-        limLog(pMac, LOG1,
-               FL("*** Sending Assoc Resp status %d aid %d to "),
-               statusCode, aid);
-    else
-        limLog(pMac, LOG1,
-               FL("*** Sending ReAssoc Resp status %d aid %d to "),
-               statusCode, aid);
-    limPrintMacAddr(pMac, pMacHdr->da, LOG1);
-
-    if( ( SIR_BAND_5_GHZ == limGetRFBand(psessionEntry->currentOperChannel))
-#ifdef WLAN_FEATURE_P2P
-       || ( psessionEntry->pePersona == VOS_P2P_CLIENT_MODE ) ||
-         ( psessionEntry->pePersona == VOS_P2P_GO_MODE)
-#endif
-         )
-    {
-        txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME;
-    }
-
-    /// Queue Association Response frame in high priority WQ
-    halstatus = halTxFrame( pMac, pPacket, ( tANI_U16 ) nBytes,
-                            HAL_TXRX_FRM_802_11_MGMT,
-                            ANI_TXDIR_TODS,
-                            7,//SMAC_SWBD_TX_TID_MGMT_HIGH,
-                            limTxComplete, pFrame, txFlag );
-    if ( ! HAL_STATUS_SUCCESS ( halstatus ) )
-    {
-        limLog(pMac, LOGE,
-               FL("*** Could not Send Re/AssocRsp, retCode=%X ***\n"),
-               nSirStatus);
-
-        palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT,
-                  (void *) pFrame, (void *) pPacket );
-    }
-
-    // update the ANI peer station count
-    //FIXME_PROTECTION : take care of different type of station
-    // counter inside this function.
-    limUtilCountStaAdd(pMac, pSta, psessionEntry);
-
-} // End limSendAssocRspMgmtFrame.
-
-
-#endif  // ANI_PRODUCT_TYPE_AP
 
 
 void
@@ -4674,7 +4403,6 @@
 #endif  //ANI_SUPPORT_11H
 
 
-#if 1//def ANI_PRODUCT_TYPE_AP
 /**
  * \brief Send a Channel Switch Announcement
  *
@@ -4823,7 +4551,6 @@
 
 } // End limSendChannelSwitchMgmtFrame.
 
-#endif // (ANI_PRODUCT_TYPE_AP)
 
 
 #ifdef WLAN_FEATURE_11AC    
diff --git a/CORE/MAC/src/pe/lim/limSendSmeRspMessages.c b/CORE/MAC/src/pe/lim/limSendSmeRspMessages.c
index 844d658..a64e684 100644
--- a/CORE/MAC/src/pe/lim/limSendSmeRspMessages.c
+++ b/CORE/MAC/src/pe/lim/limSendSmeRspMessages.c
@@ -56,11 +56,7 @@
 #include "sirCommon.h"
 #include "aniGlobal.h"
 
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-#include "wniCfgAp.h"
-#else
 #include "wniCfgSta.h"
-#endif
 #include "sysDef.h"
 #include "cfgApi.h"
 
@@ -122,13 +118,8 @@
         return;
     }
   
-#if defined (ANI_PRODUCT_TYPE_AP) && defined (ANI_LITTLE_BYTE_ENDIAN)
-    sirStoreU16N((tANI_U8*)&pSirSmeRsp->messageType, msgType);
-    sirStoreU16N((tANI_U8*)&pSirSmeRsp->length, sizeof(tSirSmeRsp));
-#else
     pSirSmeRsp->messageType = msgType;
     pSirSmeRsp->length      = sizeof(tSirSmeRsp);
-#endif
     pSirSmeRsp->statusCode  = resultCode;
 
     /* Update SME session Id and Transaction Id */
@@ -311,12 +302,6 @@
 
         palZeroMemory(pMac, (tANI_U8*)pSirSmeJoinRsp, rspLen);
 
-#if defined (ANI_PRODUCT_TYPE_AP) && defined (ANI_LITTLE_BYTE_ENDIAN)
-        sirStoreU16N((tANI_U8*)&pSirSmeJoinRsp->messageType, msgType);
-        sirStoreU16N((tANI_U8*)&pSirSmeJoinRsp->length, rspLen);
-#endif    
-        
-#if (WNI_POLARIS_FW_PRODUCT == WLAN_STA)
         if (resultCode == eSIR_SME_SUCCESS)
         {
             pStaDs = dphGetHashEntry(pMac, DPH_STA_HASH_INDEX_PEER, &psessionEntry->dph.dphHashTable);
@@ -326,24 +311,12 @@
             }
             else
             {
-                    //Pass the peer's staId
+                //Pass the peer's staId
                 pSirSmeJoinRsp->staId = pStaDs->staIndex;
-            pSirSmeJoinRsp->ucastSig   = pStaDs->ucUcastSig;
-            pSirSmeJoinRsp->bcastSig   = pStaDs->ucBcastSig;
+                pSirSmeJoinRsp->ucastSig   = pStaDs->ucUcastSig;
+                pSirSmeJoinRsp->bcastSig   = pStaDs->ucBcastSig;
             }
         }
-#endif
-
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED)
-        if (resultCode == eSIR_SME_TRANSFER_STA)
-        {
-            palCopyMemory( pMac->hHdd, pSirSmeJoinRsp->alternateBssId,
-                      pMac->lim.gLimAlternateRadio.bssId,
-                      sizeof(tSirMacAddr));
-            pSirSmeJoinRsp->alternateChannelId =
-                               pMac->lim.gLimAlternateRadio.channelId;
-        }
-#endif
 
         pSirSmeJoinRsp->beaconLength = 0;
         pSirSmeJoinRsp->assocReqLength = 0;
@@ -600,11 +573,6 @@
 
             
 
-#if defined (ANI_PRODUCT_TYPE_AP) && defined (ANI_LITTLE_BYTE_ENDIAN)
-        sirStoreU16N((tANI_U8*)&pSirSmeRsp->messageType, msgType);
-        sirStoreU16N((tANI_U8*)&pSirSmeRsp->length, size);
-       
-#endif
         
     }
 
@@ -732,14 +700,8 @@
             {
                 pSirSmeScanRsp->statusCode  =
                     eSIR_SME_MORE_SCAN_RESULTS_FOLLOW;
-#if defined (ANI_PRODUCT_TYPE_AP) && defined (ANI_LITTLE_BYTE_ENDIAN)
-                sirStoreU16N((tANI_U8*)&pSirSmeScanRsp->messageType,
-                             eWNI_SME_SCAN_RSP);
-                sirStoreU16N((tANI_U8*)&pSirSmeScanRsp->length, curMsgLen);
-#else
                 pSirSmeScanRsp->messageType = eWNI_SME_SCAN_RSP;
                 pSirSmeScanRsp->length      = curMsgLen;
-#endif
                 mmhMsg.bodyptr = pSirSmeScanRsp;
                 mmhMsg.bodyval = 0;
                 MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type));
@@ -762,13 +724,8 @@
 
             PELOG2(limLog(pMac, LOG2, FL("ScanRsp : msgLen %d, bssDescr Len=%d\n"),
                           msgLen, ptemp->bssDescription.length);)
-#if defined (ANI_PRODUCT_TYPE_AP) && defined (ANI_LITTLE_BYTE_ENDIAN)
-            sirStoreU16N((tANI_U8*)&pDesc->length,
-                         ptemp->bssDescription.length);
-#else
             pDesc->length
                     = ptemp->bssDescription.length;
-#endif
             palCopyMemory( pMac->hHdd, (tANI_U8 *) &pDesc->bssId,
                               (tANI_U8 *) &ptemp->bssDescription.bssId,
                               ptemp->bssDescription.length);
@@ -796,14 +753,8 @@
     {
         // send last message
         pSirSmeScanRsp->statusCode  = eSIR_SME_SUCCESS;
-#if defined (ANI_PRODUCT_TYPE_AP) && defined (ANI_LITTLE_BYTE_ENDIAN)
-        sirStoreU16N((tANI_U8*)&pSirSmeScanRsp->messageType,
-                             eWNI_SME_SCAN_RSP);
-        sirStoreU16N((tANI_U8*)&pSirSmeScanRsp->length, curMsgLen);
-#else
         pSirSmeScanRsp->messageType = eWNI_SME_SCAN_RSP;
         pSirSmeScanRsp->length = curMsgLen;
-#endif
 
         /* Update SME session Id and SME transcation Id */
         pSirSmeScanRsp->sessionId   = smesessionId;
@@ -858,13 +809,8 @@
     }
     palZeroMemory(pMac->hHdd, (void*)pSirSmeScanRsp, length);
 
-#if defined (ANI_PRODUCT_TYPE_AP) && defined (ANI_LITTLE_BYTE_ENDIAN)
-    sirStoreU16N((tANI_U8*)&pSirSmeScanRsp->messageType, eWNI_SME_SCAN_RSP);
-    sirStoreU16N((tANI_U8*)&pSirSmeScanRsp->length, length);
-#else
     pSirSmeScanRsp->messageType = eWNI_SME_SCAN_RSP;
     pSirSmeScanRsp->length      = length;
-#endif
 
     if(sizeof(tSirSmeScanRsp) <= length)
     {
@@ -1010,11 +956,6 @@
         return;
     }
 
-#if defined (ANI_PRODUCT_TYPE_AP) && defined (ANI_LITTLE_BYTE_ENDIAN)
-    sirStoreU16N((tANI_U8*)&pSirSmeAuthRsp->messageType, eWNI_SME_AUTH_RSP);
-    sirStoreU16N((tANI_U8*)&pSirSmeAuthRsp->length, sizeof(tSirSmeAuthRsp));
- 
-#endif
    
 
     if(psessionEntry != NULL)
@@ -1121,15 +1062,8 @@
                 return;
             }
 
-#if defined (ANI_PRODUCT_TYPE_AP) && defined (ANI_LITTLE_BYTE_ENDIAN)
-            sirStoreU16N((tANI_U8*)&pSirSmeDisassocRsp->messageType,
-                         eWNI_SME_DISASSOC_RSP);
-            sirStoreU16N((tANI_U8*)&pSirSmeDisassocRsp->length,
-                         sizeof(tSirSmeDisassocRsp));
-#else
             pSirSmeDisassocRsp->messageType = eWNI_SME_DISASSOC_RSP;
             pSirSmeDisassocRsp->length      = sizeof(tSirSmeDisassocRsp);
-#endif
             //sessionId
             pBuf = (tANI_U8 *) &pSirSmeDisassocRsp->sessionId;
             *pBuf = smesessionId;
@@ -1147,17 +1081,9 @@
             palCopyMemory( pMac->hHdd, pBuf, peerMacAddr, sizeof(tSirMacAddr));
             pBuf += sizeof(tSirMacAddr);
 
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-            limCopyU16(pBuf, aid);
-            pBuf += sizeof(tANI_U16);
-
-            // perStaStats
-            limStatSerDes(pMac, &pMac->hal.halMac.macStats.pPerStaStats[aid].staStat, pBuf);
-#else
             // Clear Station Stats
             //for sta, it is always 1, IBSS is handled at halInitSta
 
-#endif//#if (WNI_POLARIS_FW_PRODUCT == AP)
 
           
 #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT 
@@ -1182,12 +1108,6 @@
                 return;
             }
 
-#if defined (ANI_PRODUCT_TYPE_AP) && defined (ANI_LITTLE_BYTE_ENDIAN)
-            sirStoreU16N((tANI_U8*)&pSirSmeDisassocInd->messageType,
-                         eWNI_SME_DISASSOC_IND);
-            sirStoreU16N((tANI_U8*)&pSirSmeDisassocInd->length,
-                         sizeof(tSirSmeDisassocInd));
-#else
             pSirSmeDisassocInd->messageType = eWNI_SME_DISASSOC_IND;
             pSirSmeDisassocInd->length      = sizeof(tSirSmeDisassocInd);
             
@@ -1195,7 +1115,6 @@
             pSirSmeDisassocInd->sessionId = smesessionId;
             pSirSmeDisassocInd->transactionId = smetransactionId;
             pSirSmeDisassocInd->reasonCode = reasonCode;
-#endif
             pBuf = (tANI_U8 *) &pSirSmeDisassocInd->statusCode;
 
             limCopyU32(pBuf, reasonCode);
@@ -1205,14 +1124,6 @@
             pBuf += sizeof(tSirMacAddr);
 
             palCopyMemory( pMac->hHdd, pBuf, peerMacAddr, sizeof(tSirMacAddr));
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-            pBuf += sizeof(tSirMacAddr);
-            limCopyU16(pBuf, aid);
-            pBuf += sizeof(tANI_U16);
-
-            limStatSerDes(pMac, &pMac->hal.halMac.macStats.pPerStaStats[aid].staStat, pBuf);
-
-#endif//#if (WNI_POLARIS_FW_PRODUCT == AP)
 
 
 #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT 
@@ -1220,11 +1131,6 @@
                                               psessionEntry, (tANI_U16)reasonCode, 0);
 #endif
             pMsg = (tANI_U32*) pSirSmeDisassocInd;
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-            PELOG1(limLog(pMac, LOG1,
-               FL("*** Sending DisAssocInd staId=%d, reasonCode=%d ***\n"),
-               aid, reasonCode);)
-#endif
 
             break;
     }
@@ -1265,34 +1171,9 @@
         return;
     }
 
-    //psessionEntry = peFindSessionByBssid(pMac,pStaDs->staAddr,&sessionId); 
-#if defined (ANI_PRODUCT_TYPE_AP) && defined (ANI_LITTLE_BYTE_ENDIAN)
-    sirStoreU16N((tANI_U8*)&pSirSmeDisassocInd->messageType, eWNI_SME_DISASSOC_IND);
-    sirStoreU16N((tANI_U8*)&pSirSmeDisassocInd->length, sizeof(tSirSmeDisassocInd));
-#else
     pSirSmeDisassocInd->messageType = eWNI_SME_DISASSOC_IND;
     pSirSmeDisassocInd->length = sizeof(tSirSmeDisassocInd);
-#endif
 
-#if 0 //Commenting out all the serialization     
-    //statusCode
-    pBuf = (tANI_U8 *) &pSirSmeDisassocInd->statusCode;
-    limCopyU32(pBuf, pStaDs->mlmStaContext.disassocReason);
-    pBuf += sizeof(tSirResultCodes);
-
-    //peerMacAddr
-    palCopyMemory( pMac->hHdd, pBuf, pStaDs->staAddr, sizeof(tSirMacAddr));
-
-#ifdef ANI_PRODUCT_TYPE_AP
-    pBuf += sizeof(tSirMacAddr);
-    //aid
-    limCopyU16(pBuf, pStaDs->assocId);
-    pBuf += sizeof(tANI_U16);
-
-    //perStaStats
-    limStatSerDes(pMac, &pMac->hal.halMac.macStats.pPerStaStats[pStaDs->assocId].staStat, pBuf);
-#endif
-#endif
     pSirSmeDisassocInd->sessionId     =  psessionEntry->smeSessionId;
     pSirSmeDisassocInd->transactionId =  psessionEntry->transactionId;
     pSirSmeDisassocInd->statusCode    =  pStaDs->mlmStaContext.disassocReason;
@@ -1302,10 +1183,6 @@
  
     palCopyMemory( pMac->hHdd, pSirSmeDisassocInd->peerMacAddr , pStaDs->staAddr, sizeof(tSirMacAddr));
 
-#ifdef ANI_PRODUCT_TYPE_AP
-    pSirSmeDisassocInd->aid =  pStaDs->assocId;
-    limStatSerDes(pMac, &pMac->hal.halMac.macStats.pPerStaStats[pStaDs->assocId].staStat,(tANI_U8*)&pSirSmeDisassocInd-> perStaStats ); 
-#endif   
     pSirSmeDisassocInd->staId = pStaDs->staIndex;
  
     mmhMsg.type = eWNI_SME_DISASSOC_IND;
@@ -1346,13 +1223,8 @@
         return;
     }
 
-#if defined (ANI_PRODUCT_TYPE_AP) && defined (ANI_LITTLE_BYTE_ENDIAN)
-    sirStoreU16N((tANI_U8*)&pSirSmeDeauthInd->messageType, eWNI_SME_DEAUTH_IND);
-    sirStoreU16N((tANI_U8*)&pSirSmeDeauthInd->length, sizeof(tSirSmeDeauthInd));
-#else
     pSirSmeDeauthInd->messageType = eWNI_SME_DEAUTH_IND;
     pSirSmeDeauthInd->length = sizeof(tSirSmeDeauthInd);
-#endif
 
     pSirSmeDeauthInd->sessionId = psessionEntry->smeSessionId;
     pSirSmeDeauthInd->transactionId = psessionEntry->transactionId;
@@ -1371,10 +1243,6 @@
     palCopyMemory( pMac->hHdd, pSirSmeDeauthInd->peerMacAddr, pStaDs->staAddr, sizeof(tSirMacAddr));
     pSirSmeDeauthInd->reasonCode = pStaDs->mlmStaContext.disassocReason;
 
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-    pBuf += sizeof(tSirMacAddr);
-    limCopyU16(pBuf, pStaDs->staAddr);
-#endif
 
     pSirSmeDeauthInd->staId = pStaDs->staIndex;
 
@@ -1605,15 +1473,8 @@
                 return;
             }
 
-#if defined (ANI_PRODUCT_TYPE_AP) && defined (ANI_LITTLE_BYTE_ENDIAN)
-            sirStoreU16N((tANI_U8*) &(pSirSmeDeauthRsp->messageType),
-                         eWNI_SME_DEAUTH_RSP);
-                sirStoreU16N((tANI_U8*) &(pSirSmeDeauthRsp->length),
-                             sizeof(tSirSmeDeauthRsp));
-#else
             pSirSmeDeauthRsp->messageType = eWNI_SME_DEAUTH_RSP;
             pSirSmeDeauthRsp->length      = sizeof(tSirSmeDeauthRsp);
-#endif
             pSirSmeDeauthRsp->statusCode = reasonCode;
             pSirSmeDeauthRsp->sessionId = smesessionId;
             pSirSmeDeauthRsp->transactionId = smetransactionId;  
@@ -1621,10 +1482,6 @@
             pBuf  = (tANI_U8 *) pSirSmeDeauthRsp->peerMacAddr;
             palCopyMemory( pMac->hHdd, pBuf, peerMacAddr, sizeof(tSirMacAddr));
 
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-            pBuf += sizeof(tSirMacAddr);
-            limCopyU16(pBuf, aid);
-#endif
 #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT 
             limDiagEventReport(pMac, WLAN_PE_DIAG_DEAUTH_RSP_EVENT,
                                       psessionEntry, 0, (tANI_U16)reasonCode);
@@ -1648,16 +1505,9 @@
                 return;
             }
 
-#if defined (ANI_PRODUCT_TYPE_AP) && defined (ANI_LITTLE_BYTE_ENDIAN)
-            sirStoreU16N((tANI_U8*)&pSirSmeDeauthInd->messageType,
-                         eWNI_SME_DEAUTH_IND);
-            sirStoreU16N((tANI_U8*)&pSirSmeDeauthInd->length,
-                         sizeof(tSirSmeDeauthInd));
-#else
             pSirSmeDeauthInd->messageType = eWNI_SME_DEAUTH_IND;
             pSirSmeDeauthInd->length      = sizeof(tSirSmeDeauthInd);
             pSirSmeDeauthInd->reasonCode = eSIR_MAC_UNSPEC_FAILURE_REASON;
-#endif
 
             // sessionId
             pBuf = (tANI_U8*) &pSirSmeDeauthInd->sessionId;
@@ -1678,10 +1528,6 @@
             //peerMacAddr
             palCopyMemory( pMac->hHdd, pSirSmeDeauthInd->peerMacAddr, peerMacAddr, sizeof(tSirMacAddr));
 
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-            pBuf += sizeof(tSirMacAddr);
-            limCopyU16(pBuf, aid);
-#endif
 #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT 
             limDiagEventReport(pMac, WLAN_PE_DIAG_DEAUTH_IND_EVENT,
                                         psessionEntry, 0, (tANI_U16)reasonCode);
@@ -1734,11 +1580,6 @@
     tSirMsgQ                  mmhMsg;
     tSirSmeWmStatusChangeNtf  *pSirSmeWmStatusChangeNtf;
     eHalStatus                status;
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED) && (WNI_POLARIS_FW_PRODUCT == AP)
-    tANI_U32                  bufLen;
-    tANI_U16                  length=0;
-    tANI_U8                   *pBuf;
-#endif
 
 
 
@@ -1752,9 +1593,6 @@
           return;
     }
 
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED) && (WNI_POLARIS_FW_PRODUCT == AP)
-    pBuf = (tANI_U8 *)pSirSmeWmStatusChangeNtf;
-#endif
 
     mmhMsg.type = eWNI_SME_WM_STATUS_CHANGE_NTF;
     mmhMsg.bodyval = 0;
@@ -1764,53 +1602,9 @@
     {
         case eSIR_SME_RADAR_DETECTED:
 
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED) && (WNI_POLARIS_FW_PRODUCT == AP)
-            bufLen = sizeof(tSirSmeWmStatusChangeNtf);
-            if ((limSmeWmStatusChangeHeaderSerDes(pMac,
-                                                  statusChangeCode,
-                                          pBuf,
-                                          &length,
-                                          bufLen,
-                                          sessionId) != eSIR_SUCCESS))
-            {
-                palFreeMemory(pMac->hHdd, (void *) pSirSmeWmStatusChangeNtf);
-                limLog(pMac, LOGP, FL("Header SerDes failed \n"));
-                return;
-            }
-            pBuf += length;
-            bufLen -= length;
-            if ((limRadioInfoSerDes(pMac,
-                                  (tpSirRadarInfo)pStatusChangeInfo,
-                                  pBuf,
-                                  &length,
-                                  bufLen) != eSIR_SUCCESS))
-            {
-                palFreeMemory(pMac->hHdd, (void *) pSirSmeWmStatusChangeNtf);
-                limLog(pMac, LOGP, FL("Radio Info SerDes failed \n"));
-                return;
-            }
-
-            pBuf = (tANI_U8 *) pSirSmeWmStatusChangeNtf;
-            pBuf += sizeof(tANI_U16);
-            limCopyU16(pBuf, length);
-#endif
             break;
 
         case eSIR_SME_CB_LEGACY_BSS_FOUND_BY_AP:
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED) && (WNI_POLARIS_FW_PRODUCT == AP)
-
-            if( eSIR_SUCCESS != nonTitanBssFoundSerDes( pMac,
-                                (tpSirNeighborBssWdsInfo) pStatusChangeInfo,
-                                pBuf,
-                                &length,
-                                sessionId))
-            {
-                palFreeMemory(pMac->hHdd, (void *) pSirSmeWmStatusChangeNtf);
-                limLog( pMac, LOGP,
-                    FL("Unable to serialize nonTitanBssFoundSerDes!\n"));
-                return;
-            }
-#endif
             break;
 
         case eSIR_SME_BACKGROUND_SCAN_FAIL:
@@ -1821,20 +1615,10 @@
             break;
 
         default:
-#if defined (ANI_PRODUCT_TYPE_AP) && defined (ANI_LITTLE_BYTE_ENDIAN)
-        sirStoreU16N((tANI_U8*)&pSirSmeWmStatusChangeNtf->messageType,
-                    eWNI_SME_WM_STATUS_CHANGE_NTF );
-        sirStoreU16N((tANI_U8*)&pSirSmeWmStatusChangeNtf->length,
-                    (sizeof(tSirSmeWmStatusChangeNtf)));
-        pSirSmeWmStatusChangeNtf->sessionId = sessionId;
-        sirStoreU32N((tANI_U8*)&pSirSmeWmStatusChangeNtf->statusChangeCode,
-                    statusChangeCode);
-#else
         pSirSmeWmStatusChangeNtf->messageType = eWNI_SME_WM_STATUS_CHANGE_NTF;
         pSirSmeWmStatusChangeNtf->statusChangeCode = statusChangeCode;
         pSirSmeWmStatusChangeNtf->length = sizeof(tSirSmeWmStatusChangeNtf);
         pSirSmeWmStatusChangeNtf->sessionId = sessionId;
-#endif
         if(sizeof(pSirSmeWmStatusChangeNtf->statusChangeInfo) >= infoLen)
         {
             palCopyMemory( pMac->hHdd, (tANI_U8 *)&pSirSmeWmStatusChangeNtf->statusChangeInfo, (tANI_U8 *)pStatusChangeInfo, infoLen);
@@ -1901,15 +1685,8 @@
         return;
     }
 
-#if defined (ANI_PRODUCT_TYPE_AP) && defined (ANI_LITTLE_BYTE_ENDIAN)
-    sirStoreU16N((tANI_U8*)&pSirSmeSetContextRsp->messageType,
-                 eWNI_SME_SETCONTEXT_RSP);
-    sirStoreU16N((tANI_U8*)&pSirSmeSetContextRsp->length,
-                 sizeof(tSirSmeSetContextRsp));
-#else
     pSirSmeSetContextRsp->messageType = eWNI_SME_SETCONTEXT_RSP;
     pSirSmeSetContextRsp->length      = sizeof(tSirSmeSetContextRsp);
-#endif
     pSirSmeSetContextRsp->statusCode  = resultCode;
 
     pBuf = pSirSmeSetContextRsp->peerMacAddr;
@@ -1917,10 +1694,6 @@
     palCopyMemory( pMac->hHdd, pBuf, (tANI_U8 *) peerMacAddr, sizeof(tSirMacAddr));
     pBuf += sizeof(tSirMacAddr);
 
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-    limCopyU16(pBuf, aid);
-    pBuf += sizeof(tANI_U16);
-#endif
 
     /* Update SME session and transaction Id*/
     pSirSmeSetContextRsp->sessionId = smesessionId;
@@ -1991,13 +1764,6 @@
         return;
     }
 
-#if defined (ANI_PRODUCT_TYPE_AP) && defined(ANI_LITTLE_BYTE_ENDIAN)
-    sirStoreU16N((tANI_U8*)&pSirSmeRemoveKeyRsp->messageType,
-                 eWNI_SME_REMOVEKEY_RSP);
-    sirStoreU16N((tANI_U8*)&pSirSmeRemoveKeyRsp->length,
-                 sizeof(tSirSmeRemoveKeyRsp));
-  
-#endif
     
 
     if(psessionEntry != NULL)
@@ -2148,21 +1914,13 @@
         return;
     }
 
-#if defined (ANI_PRODUCT_TYPE_AP) && defined (ANI_LITTLE_BYTE_ENDIAN)
-    sirStoreU16N((tANI_U8*) &pNewBssInd->messageType,
-                 eWNI_SME_NEIGHBOR_BSS_IND);
-    sirStoreU16N((tANI_U8*)&pNewBssInd->length, (tANI_U16)val );
-#else
     pNewBssInd->messageType = eWNI_SME_NEIGHBOR_BSS_IND;
     pNewBssInd->length      = (tANI_U16) val;
-#endif
     pNewBssInd->sessionId = 0;
 
-#if (WNI_POLARIS_FW_PRODUCT == WLAN_STA)
     palCopyMemory( pMac->hHdd, (tANI_U8 *) pNewBssInd->bssDescription,
                   (tANI_U8 *) &pBssDescr->bssDescription,
                   pBssDescr->bssDescription.length + sizeof(tANI_U16));
-#endif
 
     msgQ.type = eWNI_SME_NEIGHBOR_BSS_IND;
     msgQ.bodyptr = pNewBssInd;
@@ -2547,13 +2305,8 @@
     }
     palZeroMemory(pMac->hHdd, pExitBmpsInd, msgLen);
 
-#if defined (ANI_PRODUCT_TYPE_AP) && defined (ANI_LITTLE_BYTE_ENDIAN)
-    sirStoreU16N((tANI_U8*)&pExitBmpsInd->mesgType, eWNI_PMC_EXIT_BMPS_IND);
-    sirStoreU16N((tANI_U8*)&pExitBmpsInd->mesgLen, msgLen);
-#else
     pExitBmpsInd->mesgType = eWNI_PMC_EXIT_BMPS_IND;
     pExitBmpsInd->mesgLen = msgLen;
-#endif
     pExitBmpsInd->exitBmpsReason = reasonCode;
     pExitBmpsInd->statusCode = eSIR_SME_SUCCESS;
 
diff --git a/CORE/MAC/src/pe/lim/limSendSmeRspMessages.h b/CORE/MAC/src/pe/lim/limSendSmeRspMessages.h
index 682936a..3eef752 100644
--- a/CORE/MAC/src/pe/lim/limSendSmeRspMessages.h
+++ b/CORE/MAC/src/pe/lim/limSendSmeRspMessages.h
@@ -49,7 +49,7 @@
  * History:-
  * Date           Modified by    Modification Information
  * --------------------------------------------------------------------
- * 
+ *
  */
 #ifndef __LIM_SEND_SME_RSP_H
 #define __LIM_SEND_SME_RSP_H
@@ -81,9 +81,6 @@
 void limSendSmePromiscuousModeRsp(tpAniSirGlobal pMac);
 void limSendSmeNeighborBssInd(tpAniSirGlobal,
                               tLimScanResultNode *);
-#if (WNI_POLARIS_FW_PRODUCT == AP) && (WNI_POLARIS_FW_PACKAGE == ADVANCED)
-void limSendSmeMeasurementInd(tpAniSirGlobal);
-#endif
 void limHandleDeleteBssRsp(tpAniSirGlobal pMac,tpSirMsgQ MsgQ);
 
 #ifdef WLAN_FEATURE_VOWIFI_11R
diff --git a/CORE/MAC/src/pe/lim/limSerDesUtils.c b/CORE/MAC/src/pe/lim/limSerDesUtils.c
index b6e7580..ff161a5 100644
--- a/CORE/MAC/src/pe/lim/limSerDesUtils.c
+++ b/CORE/MAC/src/pe/lim/limSerDesUtils.c
@@ -94,8 +94,6 @@
     }
 } /*** end limCheckRemainingLength(pMac, ) ***/
 
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED) && defined(ANI_PRODUCT_TYPE_AP)
-#else
 /**
  * limGetBssDescription()
  *
@@ -314,7 +312,6 @@
 
     return eSIR_SUCCESS;
 } /*** end limGetBssDescription() ***/
-#endif
 
 
 
@@ -404,809 +401,6 @@
 
 
 
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED)
-/**
- * limCopyLoad()
- *
- *fUNCTION:
- * This function is called by various LIM functions to copy
- * load information into a tANI_U8* buffer pointer
- *
- *LOGIC:
- *
- *ASSUMPTIONS:
- * NA
- *
- *NOTE:
- * NA
- *
- * @param *pBuf     Pointer to the destination buffer
- * @param load      load to be copied to destination buffer
- *
- * @return None
- */
-
-static void
-limCopyLoad(tANI_U8 *pBuf, tSirLoad load)
-{
-    limCopyU16(pBuf, load.numStas);
-    pBuf += sizeof(tANI_U16);
-
-    limCopyU16(pBuf, load.channelUtilization);
-    pBuf += sizeof(tANI_U16);
-} /*** end limCopyLoad() ***/
-
-
-
-/**
- * limGetLoad()
- *
- *FUNCTION:
- * This function is called by various LIM functions to copy
- * load information into a tANI_U8* buffer pointer
- *
- *LOGIC:
- *
- *ASSUMPTIONS:
- * NA
- *
- *NOTE:
- * NA
- *
- * @param *pLoad    Pointer to load being copied to
- * @param *pBuf     Pointer to the source buffer
- *
- * @return None
- */
-
-static void
-limGetLoad(tSirLoad *pLoad, tANI_U8 *pBuf)
-{
-    pLoad->numStas = limGetU16(pBuf);
-    pBuf += sizeof(tANI_U16);
-
-    pLoad->channelUtilization = limGetU16(pBuf);
-    pBuf += sizeof(tANI_U16);
-} /*** end limGetLoad() ***/
-
-
-
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED) && defined(ANI_PRODUCT_TYPE_AP)
-/**
- * limCopyWdsInfo()
- *
- *FUNCTION:
- * This function is called by various LIM functions to copy
- * WdsInfo information into a tANI_U8* buffer pointer
- *
- *LOGIC:
- *
- *ASSUMPTIONS:
- * NA
- *
- *NOTE:
- * NA
- *
- * @param  *pBuf     Pointer to the destination buffer
- * @param  wdsInfo   WdsInfo to be copied to destination buffer
- *
- * @return Length of WDS info copied
- */
-
-static tANI_U16
-limCopyWdsInfo(tpAniSirGlobal pMac, tANI_U8 *pBuf, tpSirWdsInfo pWdsInfo)
-{
-    limCopyU16(pBuf, pWdsInfo->wdsLength);
-    pBuf += sizeof(tANI_U16);
-
-    palCopyMemory( pMac->hHdd, pBuf, (tANI_U8 *) pWdsInfo->wdsBytes, pWdsInfo->wdsLength);
-    pBuf += pWdsInfo->wdsLength;
-
-    return ((tANI_U16) (sizeof(tANI_U16) + pWdsInfo->wdsLength));
-} /*** end limCopyWdsInfo() ***/
-
-
-
-/**
- * limGetWdsInfo()
- *
- *FUNCTION:
- * This function is called by various LIM functions to copy
- * WdsInfo information from a tANI_U8* buffer pointer to tSirWdsInfo
- *
- *LOGIC:
- *
- *ASSUMPTIONS:
- * NA
- *
- *NOTE:
- * NA
- *
- * @param wdsInfo   Pointer to the WdsInfo to be copied
- * @param *pBuf     Pointer to the source buffer
- *
- * @return true when WDS info extracted successfully else false
- */
-
-static tANI_U8
-limGetWdsInfo(tpAniSirGlobal pMac, tpSirWdsInfo pWdsInfo, tANI_U8 *pBuf)
-{
-    pWdsInfo->wdsLength = limGetU16(pBuf);
-    pBuf += sizeof(tANI_U16);
-
-    if (pWdsInfo->wdsLength > ANI_WDS_INFO_MAX_LENGTH)
-        return false;
-
-    palCopyMemory( pMac->hHdd, pWdsInfo->wdsBytes, pBuf, pWdsInfo->wdsLength);
-
-    return true;
-} /*** end limGetWdsInfo() ***/
-
-
-
-/**
- * limGetAlternateRadioList()
- *
- *FUNCTION:
- * This function is called by various LIM functions to copy
- * alternateRadio information from a tANI_U8* buffer pointer to
- * tSirAlternateRadioList
- *
- *LOGIC:
- *
- *ASSUMPTIONS:
- * NA
- *
- *NOTE:
- * NA
- *
- * @param  pRadioList   Pointer to the radioList to be copied
- * @param  *pBuf        Pointer to the source buffer
- *
- * @return len          Length of copied alternateRadioList
- */
-
-static tANI_U16
-limGetAlternateRadioList(tpAniSirGlobal pMac, tpSirMultipleAlternateRadioInfo pRadioList,
-                         tANI_U8 *pBuf)
-{
-    tANI_U8 i;
-    tANI_U16                        len = sizeof(tANI_U8);
-    tpSirAlternateRadioInfo    pRadioInfo;
-
-    pRadioList->numBss = *pBuf++;
-
-    if (pRadioList->numBss > SIR_MAX_NUM_ALTERNATE_RADIOS)
-        pRadioList->numBss = SIR_MAX_NUM_ALTERNATE_RADIOS;
-
-    pRadioInfo = pRadioList->alternateRadio;
-    for (i = 0; i < pRadioList->numBss; i++)
-    {
-        palCopyMemory( pMac->hHdd, pRadioInfo->bssId, pBuf, sizeof(tSirMacAddr));
-        pBuf += sizeof(tSirMacAddr);
-        pRadioInfo->channelId = *pBuf++;
-       PELOG3(limLog(pMac, LOG3, FL("Alternate radio[%d] channelId=%d, BssId is \n"),
-               i, pRadioInfo->channelId);
-        limPrintMacAddr(pMac, pRadioInfo->bssId, LOG3);)
-
-        pRadioInfo++;
-        len += sizeof(tSirMacAddr) + sizeof(tANI_U8);
-    }
-
-    return len;
-} /*** end limGetAlternateRadioList() ***/
-#endif
-
-
-
-/**
- * limCopyNeighborBssInfo()
- *
- *FUNCTION:
- * This function is called by various LIM functions to copy
- * Neighbor BSS info into a tANI_U8* buffer pointer
- *
- *LOGIC:
- *
- *ASSUMPTIONS:
- * NA
- *
- *NOTE:
- * NA
- *
- * @param  *pBuf       Pointer to the destination buffer
- * @param  pBssInfo    Pointer to neighbor BSS info be copied
- *                     to destination buffer
- *
- * @return bssInfoLen  Length of bssInfo copied
- */
-
-tANI_U32
-limCopyNeighborBssInfo(tpAniSirGlobal pMac, tANI_U8 *pBuf, tpSirNeighborBssInfo pBssInfo)
-{
-    tANI_U32 bssInfoLen = 0;
-
-    palCopyMemory( pMac->hHdd, pBuf,
-                  (tANI_U8 *) pBssInfo->bssId,
-                  sizeof(tSirMacAddr));
-    pBuf       += sizeof(tSirMacAddr);
-    bssInfoLen += sizeof(tSirMacAddr);
-   PELOG3(limLog(pMac, LOG3,
-       FL("Copying new NeighborWds node:channel is %d, wniIndicator is %d, bssType is %d, bssId is "),
-       pBssInfo->channelId, pBssInfo->wniIndicator, pBssInfo->bssType);
-    limPrintMacAddr(pMac, pBssInfo->bssId, LOG3);)
-
-    *pBuf++ = pBssInfo->channelId;
-    bssInfoLen++;
-
-    limCopyU32(pBuf, pBssInfo->wniIndicator);
-    pBuf       += sizeof(tANI_U32);
-    bssInfoLen += sizeof(tANI_U32);
-
-    limCopyU32(pBuf, pBssInfo->bssType);
-    pBuf       += sizeof(tANI_U32);
-    bssInfoLen += sizeof(tANI_U32);
-
-    *pBuf++ = pBssInfo->sinr;
-    bssInfoLen++;
-    *pBuf++ = pBssInfo->rssi;
-    bssInfoLen++;
-
-    limCopyLoad(pBuf, pBssInfo->load);
-    pBuf       += sizeof(tSirLoad);
-    bssInfoLen += sizeof(tSirLoad);
-
-    palCopyMemory( pMac->hHdd, pBuf, (tANI_U8 *) &(pBssInfo->ssId),
-                  pBssInfo->ssId.length + 1);
-
-    bssInfoLen += pBssInfo->ssId.length + 1;
-    pBuf       += pBssInfo->ssId.length + 1;
-
-    palCopyMemory( pMac->hHdd, pBuf, (tANI_U8 *) &(pBssInfo->apName),
-                  pBssInfo->apName.length + 1);
-
-    bssInfoLen += pBssInfo->apName.length + 1;
-    pBuf       += pBssInfo->apName.length + 1;
-
-    limCopyU16(pBuf, pBssInfo->rsnIE.length);
-    pBuf       += sizeof(tANI_U16);
-    bssInfoLen += sizeof(tANI_U16);
-    palCopyMemory( pMac->hHdd, pBuf, (tANI_U8 *) &(pBssInfo->rsnIE.rsnIEdata),
-                  pBssInfo->rsnIE.length);
-
-    bssInfoLen += pBssInfo->rsnIE.length;
-    pBuf       += pBssInfo->rsnIE.length;
-
-    limCopyU32(pBuf, pBssInfo->nwType);
-    pBuf       += sizeof(tANI_U32);
-    bssInfoLen += sizeof(tANI_U32);
-
-    // not sure we need to do a sirSwapU16ifNeeded ???
-    limCopyU16(pBuf, pBssInfo->capabilityInfo);
-    pBuf       += sizeof(tANI_U16);
-    bssInfoLen += sizeof(tANI_U16);
-
-    palCopyMemory( pMac->hHdd, pBuf, (tANI_U8 *) &(pBssInfo->operationalRateSet),
-                  pBssInfo->operationalRateSet.numRates + 1);
-    bssInfoLen += pBssInfo->operationalRateSet.numRates + 1;
-    pBuf       += pBssInfo->operationalRateSet.numRates + 1;
-
-    palCopyMemory( pMac->hHdd, pBuf, (tANI_U8 *) &(pBssInfo->extendedRateSet),
-                  pBssInfo->extendedRateSet.numRates + 1);
-    bssInfoLen += pBssInfo->extendedRateSet.numRates + 1;
-    pBuf       += pBssInfo->extendedRateSet.numRates + 1;
-
-    limCopyU16(pBuf, pBssInfo->beaconInterval);
-    pBuf += sizeof(tANI_U16);
-    bssInfoLen += sizeof(tANI_U16);
-   
-    *pBuf++ = pBssInfo->dtimPeriod;
-    bssInfoLen++;
-    *pBuf++ = pBssInfo->HTCapsPresent;
-    bssInfoLen++;
-    *pBuf++ = pBssInfo->HTInfoPresent;
-    bssInfoLen++;
-    *pBuf++ = pBssInfo->wmeInfoPresent;
-    bssInfoLen++;
-    *pBuf++ = pBssInfo->wmeEdcaPresent;
-    bssInfoLen++;
-    *pBuf++ = pBssInfo->wsmCapablePresent;
-    bssInfoLen++;
-    *pBuf++ = pBssInfo->hcfEnabled;
-    bssInfoLen++;
-    
-    limCopyU16(pBuf, pBssInfo->propIECapability);
-    pBuf += sizeof(tANI_U16);
-    bssInfoLen += sizeof(tANI_U16);
-    
-    limCopyU32(pBuf, pBssInfo->localPowerConstraints);
-    pBuf += sizeof(tANI_S32);
-    bssInfoLen += sizeof(tANI_S32);
-    
-    limCopyU32(pBuf, pBssInfo->aggrRssi);
-    pBuf += sizeof(tANI_S32);
-    bssInfoLen += sizeof(tANI_S32);
-    
-    limCopyU32(pBuf, pBssInfo->dataCount);
-    pBuf += sizeof(tANI_U32);
-    bssInfoLen += sizeof(tANI_U32);
-    
-    limCopyU32(pBuf, pBssInfo->totalPackets);
-    pBuf += sizeof(tANI_U32);
-    bssInfoLen += sizeof(tANI_U32);
-    
-    return bssInfoLen;
-} /*** end limCopyNeighborBssInfo() ***/
-
-
-/**
- * limCopyNeighborList()
- *
- *FUNCTION:
- * This function is called by various LIM functions to copy
- * Neighbor BSS list into a tANI_U8* buffer pointer
- *
- *LOGIC:
- *
- *ASSUMPTIONS:
- * NA
- *
- *NOTE:
- * NA
- *
- * @param *pBuf           Pointer to the destination buffer
- * @param neighborList    Neighbor BSS list be copied to
- *                        destination buffer
- * @param numBss          Number of Neighbor BSS list be copied
- *
- * @return listLen        Length of Neighbor BSS list
- */
-
-static tANI_U32
-limCopyNeighborList(tpAniSirGlobal pMac, tANI_U8 *pBuf, tpSirNeighborBssInfo pBssInfo, tANI_U32 numBss)
-{
-    tANI_U32  bssInfoLen = 0, listLen = 0;
-    tANI_U8  i;
-    tANI_U8  *pTemp = (tANI_U8 *) pBssInfo;
-
-    PELOG3(limLog(pMac, LOG3, FL("Going to copy BssInfoList:\n"));)
-    PELOG3(sirDumpBuf(pMac, SIR_LIM_MODULE_ID, LOG3,
-               pTemp, numBss*sizeof(tSirNeighborBssInfo));)
-
-    for (i = 0; i < numBss; i++, bssInfoLen = 0)
-    {
-        bssInfoLen = limCopyNeighborBssInfo(pMac,
-                                   pBuf,
-                                   (tpSirNeighborBssInfo) &pBssInfo[i]);
-
-        pBuf     += bssInfoLen;
-        listLen  += bssInfoLen;
-    }
-
-    return listLen;
-} /*** end limCopyNeighborList(pMac, ) ***/
-
-
-/**
- * limGetNeighborBssInfo()
- *
- *FUNCTION:
- * This function is called by various LIM functions to get
- * Neighbor BSS info from a tANI_U8* buffer pointer
- *
- *LOGIC:
- *
- *ASSUMPTIONS:
- * NA
- *
- *NOTE:
- * NA
- *
- * @param  pBssInfo    Pointer to neighbor BSS info being copied
- * @param  *pBuf       Pointer to the source buffer
- *
- * @return Size of NeighborBssInfo that is extracted
- */
-
-tANI_U32
-limGetNeighborBssInfo(tpAniSirGlobal pMac, tpSirNeighborBssInfo pBssInfo, tANI_U8 *pBuf)
-{
-    tANI_U32 len = 0;
-
-    palCopyMemory( pMac->hHdd, (tANI_U8 *) pBssInfo->bssId,
-                  pBuf, sizeof(tSirMacAddr));
-    pBuf += sizeof(tSirMacAddr);
-    len  += sizeof(tSirMacAddr);
-
-    pBssInfo->channelId = *pBuf++;
-    len++;
-
-    pBssInfo->wniIndicator = (tAniBool) limGetU32(pBuf);
-    pBuf += sizeof(tAniBool);
-    len  += sizeof(tAniBool);
-
-    pBssInfo->bssType = (tSirBssType) limGetU32(pBuf);
-    pBuf += sizeof(tSirBssType);
-    len  += sizeof(tSirBssType);
-
-    pBssInfo->sinr = *pBuf++;
-    len++;
-    pBssInfo->rssi = *pBuf++;
-    len++;
-
-    limGetLoad(&pBssInfo->load, pBuf);
-    pBuf += sizeof(tSirLoad);
-    len  += sizeof(tSirLoad);
-
-    pBssInfo->ssId.length = *pBuf++;
-    palCopyMemory( pMac->hHdd, pBssInfo->ssId.ssId, pBuf, pBssInfo->ssId.length);
-    pBuf += pBssInfo->ssId.length;
-    len  += pBssInfo->ssId.length + 1;
-    
-    pBssInfo->apName.length = *pBuf++;
-    palCopyMemory( pMac->hHdd, pBssInfo->apName.name, pBuf, pBssInfo->apName.length);
-    pBuf += pBssInfo->apName.length;
-    len  += pBssInfo->apName.length + 1;
-    
-    pBssInfo->rsnIE.length = limGetU16(pBuf);
-    pBuf += sizeof(tANI_U16);
-    palCopyMemory( pMac->hHdd, pBssInfo->rsnIE.rsnIEdata, pBuf,
-                  pBssInfo->rsnIE.length);
-    pBuf += pBssInfo->rsnIE.length;
-    len  += pBssInfo->rsnIE.length + 2;
-
-   PELOG2(limLog(pMac, LOG2, FL("BSS type %d channel %d wniInd %d RSN len %d\n"),
-           pBssInfo->bssType, pBssInfo->channelId, pBssInfo->wniIndicator,
-           pBssInfo->rsnIE.length);
-    limPrintMacAddr(pMac, pBssInfo->bssId, LOG2);)
-
-
-    pBssInfo->nwType = (tSirNwType) limGetU32(pBuf);
-    pBuf += sizeof(tSirNwType);
-    len  += sizeof(tSirNwType);
-    
-    pBssInfo->capabilityInfo = limGetU16(pBuf);
-    pBuf += sizeof(tANI_U16);
-    len  += sizeof(tANI_U16);
-
-    pBssInfo->operationalRateSet.numRates = *pBuf++;
-    palCopyMemory( pMac->hHdd, pBssInfo->operationalRateSet.rate, pBuf,
-                  pBssInfo->operationalRateSet.numRates);
-    pBuf += pBssInfo->operationalRateSet.numRates;
-    len  += pBssInfo->operationalRateSet.numRates + 1;
-
-    pBssInfo->extendedRateSet.numRates = *pBuf++;
-    palCopyMemory( pMac->hHdd, pBssInfo->extendedRateSet.rate, pBuf,
-                  pBssInfo->extendedRateSet.numRates);
-    pBuf += pBssInfo->extendedRateSet.numRates;
-    len  += pBssInfo->extendedRateSet.numRates + 1;
-
-    pBssInfo->beaconInterval = limGetU16(pBuf);
-    pBuf += sizeof(tANI_U16);
-    len  += sizeof(tANI_U16);
-
-    pBssInfo->dtimPeriod = *pBuf++;
-    pBssInfo->HTCapsPresent = *pBuf++;
-    pBssInfo->HTInfoPresent = *pBuf++;
-    pBssInfo->wmeInfoPresent = *pBuf++;
-    pBssInfo->wmeEdcaPresent = *pBuf++;
-    pBssInfo->wsmCapablePresent = *pBuf++;
-    pBssInfo->hcfEnabled = *pBuf++;
-    pBssInfo->propIECapability = limGetU16(pBuf);
-    pBuf += sizeof(tANI_U16);
-    pBssInfo->localPowerConstraints = limGetU32(pBuf);
-    pBuf += sizeof(tANI_U32);
-    len += 13;
-    
-   PELOG2(limLog(pMac, LOG2, FL("rsnIELen %d operRateLen %d extendRateLen %d total %d\n"),
-        pBssInfo->rsnIE.length, pBssInfo->operationalRateSet.numRates,
-        pBssInfo->extendedRateSet.numRates, len);)
-    
-    
-    return len;
-} /*** end limGetNeighborBssInfo() ***/
-
-
-
-#if defined(ANI_PRODUCT_TYPE_AP)
-/**
- * limGetNeighborBssList()
- *
- *FUNCTION:
- * This function is called by various LIM functions to get
- * Neighbor BSS list from a tANI_U8* buffer pointer
- *
- *LOGIC:
- *
- *ASSUMPTIONS:
- * NA
- *
- *NOTE:
- * NA
- *
- * @param  *pNeighborList   Pointer to neighbor BSS list being copied to
- * @param  *pBuf            Pointer to the source buffer
- * @param  rLen             Remaining message length being extracted
- * @return retCode          Indicates whether message is successfully
- *                          de-serialized (eSIR_SUCCESS) or
- *                          failure (eSIR_FAILURE).
- */
-
-static tSirRetStatus
-limGetNeighborBssList(tpAniSirGlobal pMac,
-                      tSirNeighborBssList *pNeighborList,
-                      tANI_S16 rLen, tANI_S16 *lenUsed, tANI_U8 *pBuf)
-{
-    tANI_U8     *pBssInfo = (tANI_U8 *) pNeighborList->bssList;
-    tANI_U32    i, bssInfoLen = 0, len = 0, numBss, numBssList;
-
-    numBssList = numBss = limGetU32(pBuf);
-
-    if (!numBss)
-    {
-        PELOG1(limLog(pMac, LOG1, FL("No Neighbor BSS present in Neighbor list\n"));)
-
-        return eSIR_FAILURE;
-    }
-   PELOG2(limLog(pMac, LOG2,
-           FL("Num of Neighbor BSS present in Neighbor list is %d\n"),
-           numBss);)
-
-    pBuf += sizeof(tANI_U32);
-    len  += sizeof(tANI_U32);
-    rLen -= sizeof(tANI_U32);
-    if (limCheckRemainingLength(pMac, rLen) == eSIR_FAILURE)
-        return eSIR_FAILURE;
-
-    // First neighborInfo is the one we're attempting to join/reassoc
-    bssInfoLen = limGetNeighborBssInfo(pMac, (tSirNeighborBssInfo *) pBssInfo,
-                                       pBuf);
-    PELOG1(limLog(pMac, LOG1,
-           FL("BSSinfo len to be joined is %d rem %d, numBss = %d\n"),
-           bssInfoLen, rLen, numBss - 1);)
-    pBuf  += bssInfoLen;
-    len   += bssInfoLen;
-    rLen  -= (tANI_S16) bssInfoLen;
-    numBss--;
-    numBssList--;
-
-    if (numBss > 0)
-    {
-        // Store remaining neighbor BSS info
-        if (numBss > SIR_MAX_NUM_NEIGHBOR_BSS)
-        {
-            // Store only MAX number of Neighbor BSS
-          PELOG2(limLog(pMac, LOG2,
-                  FL("Pruning number of neighbors to %d from %d\n"),
-                  SIR_MAX_NUM_NEIGHBOR_BSS, numBss);)
-            numBss = SIR_MAX_NUM_NEIGHBOR_BSS;
-        }
-
-        pBssInfo = (tANI_U8 *) pMac->lim.gLimNeighborBssList.bssList;
-        for (i = numBss; i > 0; i--)
-        {
-            PELOG3(limLog(pMac, LOG3, FL("pMac = %p, pBssInfo = %p, pBuf = %p\n"), pMac, pBssInfo, pBuf);)
-            bssInfoLen = limGetNeighborBssInfo(pMac,
-                                   (tSirNeighborBssInfo *) pBssInfo,
-                                   pBuf);
-
-            pBssInfo += sizeof(tSirNeighborBssInfo);
-            pBuf     += bssInfoLen;
-            len      += bssInfoLen;
-            rLen     -= (tANI_S16) bssInfoLen;
-            numBssList--;
-
-            PELOG1(limLog(pMac, LOG1, FL("BSS info[%d] len %d rem %d\n"),
-                   i, bssInfoLen, rLen);)
-        }
-
-        while (numBssList > 0)
-        {
-            tSirNeighborBssInfo pTemp;
-            bssInfoLen = limGetNeighborBssInfo(pMac, &pTemp, pBuf);
-            pBuf     += bssInfoLen;
-            len      += bssInfoLen;
-            rLen     -= (tANI_S16) bssInfoLen;
-            numBssList--;
-            PELOG1(limLog(pMac, LOG1, FL("BSS info[%d] len %d rem %d\n"),
-                   numBssList, bssInfoLen, rLen);)
-        }
-    }
-    *lenUsed = len;
-
-    pMac->lim.gLimNeighborBssList.numBss = pNeighborList->numBss
-                                         = numBss;
-
-    return eSIR_SUCCESS;
-} /*** end limGetNeighborBssList(pMac, ) ***/
-
-
-
-/**
- * limCopyNeighborWdsInfo()
- *
- *FUNCTION:
- * This function is called by various LIM functions to copy
- * detected neighborBssWds info to a tANI_U8 buffer
- *
- *LOGIC:
- *
- *ASSUMPTIONS:
- * NA
- *
- *NOTE:
- * NA
- *
- * @param *pBuf           Pointer to the destination buffer
- * @param *pInfo          Pointer to the NeighborWdsInfo being copied
- * @return Length of Matrix information copied
- */
-
-static tANI_U16
-limCopyNeighborWdsInfo(tpAniSirGlobal pMac, tANI_U8 *pBuf, tpSirNeighborBssWdsInfo pInfo)
-{
-    tANI_U16    len = 0;
-
-    len   = (tANI_U16) limCopyNeighborBssInfo(pMac, pBuf, &pInfo->neighborBssInfo);
-    pBuf += len;
-    len  += limCopyWdsInfo(pMac, pBuf, &pInfo->wdsInfo);
-
-    return len;
-} /*** end limCopyNeighborWdsInfo() ***/
-
-
-
-/**
- * limCopyMeasMatrixInfo()
- *
- *FUNCTION:
- * This function is called by various LIM functions to copy
- * collected Measurement matrix info to a tANI_U8 buffer
- *
- *LOGIC:
- *
- *ASSUMPTIONS:
- * NA
- *
- *NOTE:
- * NA
- *
- * @param *pBuf           Pointer to the destination buffer
- * @param *pInfo          Pointer to the matrix info being copied
- * @return Length of Matrix information copied
- */
-
-static tANI_U16
-limCopyMeasMatrixInfo(tANI_U8 *pBuf, tpLimMeasMatrixNode pInfo)
-{
-    tANI_U16 len = 0;
-    
-    *pBuf++ = pInfo->matrix.channelNumber;
-    len++;
-    *pBuf++ = pInfo->matrix.compositeRssi;
-    len++;
-    limCopyU32(pBuf, pInfo->matrix.aggrRssi);
-    pBuf += sizeof(tANI_S32);
-    len += sizeof(tANI_S32);
-    limCopyU32(pBuf, pInfo->matrix.totalPackets);
-    len += sizeof(tANI_U32);
-
-    return len;
-} /*** end limCopyMeasMatrixInfo() ***/
-
-
-
-/**
- * limCopyMeasMatrixList()
- *
- *FUNCTION:
- * This function is called by various LIM functions to copy
- * collected Measurement matrix List to a tANI_U8 buffer
- *
- *LOGIC:
- *
- *ASSUMPTIONS:
- * NA
- *
- *NOTE:
- * NA
- *
- * @param  pMac  - Pointer to Global MAC structure
- * @param  *pBuf - Pointer to the destination buffer
- * @return Length of matrix list copied
- */
-
-static tANI_U16
-limCopyMeasMatrixList(tpAniSirGlobal pMac, tANI_U8 *pBuf)
-{
-    tANI_U16    len = 0, nodeLen = 0;
-    tANI_U8     numNodes = pMac->lim.gpLimMeasData->numMatrixNodes;
-
-    *pBuf++ = numNodes;
-    len++;
-
-    if (numNodes)
-    {
-        tpLimMeasMatrixNode pInfo =
-                         pMac->lim.gpLimMeasData->pMeasMatrixInfo;
-        while (numNodes-- && pInfo) //Safety measure, checking both
-        {
-            nodeLen = limCopyMeasMatrixInfo(pBuf, pInfo);
-            pBuf   += nodeLen;
-            len    += nodeLen;
-
-            if (pInfo->next)
-                pInfo = pInfo->next;
-            else
-                break;
-        }
-
-        return len;
-    }
-    else
-    {
-        *pBuf = 0;
-        return 1;
-    }
-} /*** end limCopyMeasMatrixList() ***/
-
-
-
-/**
- * limCopyNeighborWdsList()
- *
- *FUNCTION:
- * This function is called by various LIM functions to copy
- * detected neighborBssWds List to a tANI_U8 buffer
- *
- *LOGIC:
- *
- *ASSUMPTIONS:
- * NA
- *
- *NOTE:
- * NA
- *
- * @param  pMac  Pointer to Global MAC structure
- * @param  *pBuf Pointer to the destination buffer
- * @return Length of matrix list copied
- */
-
-static tANI_U16
-limCopyNeighborWdsList(tpAniSirGlobal pMac, tANI_U8 *pBuf)
-{
-    tANI_U16    len = 0, nodeLen = 0;
-
-    if (pMac->lim.gpLimMeasData->numBssWds)
-    {
-        limCopyU32(pBuf, pMac->lim.gpLimMeasData->numBssWds);
-        pBuf += sizeof(tANI_U32);
-        len  += sizeof(tANI_U32);
-
-        tpLimNeighborBssWdsNode pInfo =
-                        pMac->lim.gpLimMeasData->pNeighborWdsInfo;
-        while (pInfo)
-        {
-            nodeLen = limCopyNeighborWdsInfo(pMac, pBuf, &pInfo->info);
-            pBuf   += nodeLen;
-            len    += nodeLen;
-
-            if (pInfo->next)
-                pInfo = pInfo->next;
-            else
-                break;
-        }
-
-        return len;
-    }
-    else
-    {
-        limCopyU32(pBuf, 0);
-        return (sizeof(tANI_U32));
-    }
-} /*** end limCopyNeighborWdsList() ***/
-#endif
-#endif
 
 
 /**
@@ -1296,9 +490,6 @@
 limStartBssReqSerDes(tpAniSirGlobal pMac, tpSirSmeStartBssReq pStartBssReq, tANI_U8 *pBuf)
 {
     tANI_S16 len = 0;
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED) && defined(ANI_PRODUCT_TYPE_AP)
-    tANI_U8 i;
-#endif
 
 #ifdef PE_DEBUG_LOG1
     tANI_U8  *pTemp = pBuf;
@@ -1408,38 +599,6 @@
     if (limCheckRemainingLength(pMac, len) == eSIR_FAILURE)
         return eSIR_FAILURE;
 
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED) && defined(ANI_PRODUCT_TYPE_AP)
-    tANI_U16 paramLen = 0;
-
-    // Extract alternateRadioList
-    pStartBssReq->alternateRadioList.numBss = *pBuf;
-    paramLen = limGetAlternateRadioList(pMac,
-                              &pMac->lim.gLimAlternateRadioList,
-                              pBuf);
-    pBuf += paramLen;
-    len  -= paramLen;
-    if (limCheckRemainingLength(pMac, len) == eSIR_FAILURE)
-        return eSIR_FAILURE;
-
-    // Extract powerLevel
-    pStartBssReq->powerLevel = *pBuf++;
-    len--;
-    if (limCheckRemainingLength(pMac, len) == eSIR_FAILURE)
-        return eSIR_FAILURE;
-
-    // Extract wdsInfo
-    if (limGetWdsInfo(pMac, &pStartBssReq->wdsInfo, pBuf) == false)
-    {
-        limLog(pMac, LOGW, FL("Invalid WDS length %d in SME_START_BSS_REQ\n"),
-               pStartBssReq->wdsInfo.wdsLength);
-        return eSIR_FAILURE;
-    }
-
-    pBuf += sizeof(tANI_U16) + pStartBssReq->wdsInfo.wdsLength;
-    len  -= (sizeof(tANI_U16) + pStartBssReq->wdsInfo.wdsLength);
-    if (limCheckRemainingLength(pMac, len) == eSIR_FAILURE)
-        return eSIR_FAILURE;
-#endif
 
     // Extract privacy setting
     pStartBssReq->privacy = *pBuf++;
@@ -1578,56 +737,6 @@
         len  -= pStartBssReq->extendedRateSet.numRates;
     }
 
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED) && defined(ANI_PRODUCT_TYPE_AP)
-    if (limCheckRemainingLength(pMac, len) == eSIR_FAILURE)
-        return eSIR_FAILURE;
-
-        limLog(pMac,
-               LOGW,
-               FL("Going to parse numSSID  in the START_BSS_REQ, len=%d\n"), len);
-    if (len < 2)
-    {
-        // No numSSID parameter in the START_BSS_REQ
-        limLog(pMac,
-               LOGW,
-               FL("No numSSID  in the START_BSS_REQ, len=%d\n"), len);
-        return eSIR_FAILURE;
-    }
-
-    // Extract numSSID
-    pStartBssReq->numSSID = *pBuf++;
-    len--;
-
-    // Extract ssIdList[]
-    for (i = 0; (i < pStartBssReq->numSSID) && len; i++)
-    {
-        pStartBssReq->ssIdList[i].length = *pBuf++;
-        len--;
-        if (len < pStartBssReq->ssIdList[i].length)
-        {
-            limLog(pMac, LOGW,
-               FL("SSID length[%d] is more than the rem length[%d]\n"),
-               pStartBssReq->ssIdList[i].length, len);
-            return eSIR_FAILURE;
-        }
-
-        if (pStartBssReq->ssIdList[i].length > SIR_MAC_MAX_SSID_LENGTH)
-        {
-            // SSID length is more than max allowed 32 bytes
-            limLog(pMac,
-                   LOGW,
-                   FL("Invalid SSID length in the list, len=%d\n"),
-                   pStartBssReq->ssIdList[i].length);
-            return eSIR_FAILURE;
-        }
-
-        palCopyMemory( pMac->hHdd, (tANI_U8 *) pStartBssReq->ssIdList[i].ssId,
-                      pBuf,
-                      pStartBssReq->ssIdList[i].length);
-        pBuf += pStartBssReq->ssIdList[i].length;
-        len  -= pStartBssReq->ssIdList[i].length;
-    }
-#endif
 
     if (len)
     {
@@ -1842,14 +951,6 @@
     if (limCheckRemainingLength(pMac, len) == eSIR_FAILURE)
         return eSIR_FAILURE;
 
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED)
-    // Extract assocType
-    pJoinReq->assocType = (tSirAssocType) limGetU32(pBuf);
-    pBuf += sizeof(tSirAssocType);
-    len  -= sizeof(tSirAssocType); 
-    if (limCheckRemainingLength(pMac, len) == eSIR_FAILURE)
-        return eSIR_FAILURE;
-#endif
 
     // Extract operationalRateSet
     pJoinReq->operationalRateSet.numRates= *pBuf++;
@@ -2047,34 +1148,6 @@
     if (limCheckRemainingLength(pMac, len) == eSIR_FAILURE)
         return eSIR_FAILURE;
 
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED) && defined(ANI_PRODUCT_TYPE_AP)
-    // Extract BP Indicator
-    pJoinReq->bpIndicator = (tAniBool) limGetU32(pBuf);
-    pBuf += sizeof(tAniBool);
-    len  -= sizeof(tAniBool); 
-    if (limCheckRemainingLength(pMac, len) == eSIR_FAILURE)
-        return eSIR_FAILURE;
-
-    // Extract BP Type
-    pJoinReq->bpType = (tSirBpIndicatorType) limGetU32(pBuf);
-    pBuf += sizeof(tSirBpIndicatorType);
-    len  -= sizeof(tSirBpIndicatorType); 
-    if (limCheckRemainingLength(pMac, len) == eSIR_FAILURE)
-        return eSIR_FAILURE;
-
-    // Extract Neighbor BSS List
-    if (limGetNeighborBssList(pMac, &pJoinReq->neighborBssList,
-                              len, &lenUsed, pBuf) == eSIR_FAILURE)
-    {
-        PELOGE(limLog(pMac, LOGE, FL("get neighbor bss list failed\n"));)
-        return eSIR_FAILURE;
-    }
-    pBuf += lenUsed;
-    len -= lenUsed;
-    PELOG1(limLog(pMac, LOG1, FL("Assoc Type %d RSN len %d bp %d type %d bss RSN len %d\n"),
-           pJoinReq->assocType, pJoinReq->rsnIE.length, pJoinReq->bpIndicator,
-           pJoinReq->bpType, pJoinReq->neighborBssList.bssList->rsnIE.length);)
-#endif
 
     // Extract Titan CB Neighbor BSS info
     pJoinReq->cbNeighbors.cbBssFoundPri = *pBuf;
@@ -2114,7 +1187,6 @@
     if (limCheckRemainingLength(pMac, len) == eSIR_FAILURE)
         return eSIR_FAILURE;
 
-#if (WNI_POLARIS_FW_PRODUCT == WLAN_STA)
     //
     // NOTE - tSirBssDescription is now moved to the end
     // of tSirSmeJoinReq structure. This is to accomodate
@@ -2129,7 +1201,6 @@
     PELOG3(sirDumpBuf(pMac, SIR_LIM_MODULE_ID, LOG3, (tANI_U8 *) &(pJoinReq->bssDescription), pJoinReq->bssDescription.length + 2);)
     pBuf += lenUsed;
     len -= lenUsed;
-#endif
 
     return eSIR_SUCCESS;
 } /*** end limJoinReqSerDes() ***/
@@ -2158,9 +1229,6 @@
     tANI_U8  *pTemp = pBuf;
 #endif
 
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED)
-    tANI_U32 len = 0;
-#endif
 
     mLen   = sizeof(tANI_U32);
     mLen   += sizeof(tANI_U8);
@@ -2207,56 +1275,6 @@
     pBuf += pAssocInd->rsnIE.length;
     mLen += pAssocInd->rsnIE.length;
 
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED)
-
-    limCopyU16(pBuf, pAssocInd->seqNum);
-    pBuf += sizeof(tANI_U16);
-    mLen += sizeof(tANI_U16);
-
-    limCopyU32(pBuf, pAssocInd->wniIndicator);
-    pBuf += sizeof(tAniBool);
-    mLen += sizeof(tAniBool);
-
-    limCopyU32(pBuf, pAssocInd->bpIndicator);
-    pBuf += sizeof(tAniBool);
-    mLen += sizeof(tAniBool);
-
-    limCopyU32(pBuf, pAssocInd->bpType);
-    pBuf += sizeof(tSirBpIndicatorType);
-    mLen += sizeof(tSirBpIndicatorType);
-
-    limCopyU32(pBuf, pAssocInd->assocType);
-    pBuf += sizeof(tANI_U32);
-    mLen += sizeof(tANI_U32);
-
-    limCopyLoad(pBuf, pAssocInd->load);
-    pBuf += sizeof(tSirLoad);
-    mLen += sizeof(tSirLoad);
-
-    limCopyU32(pBuf, pAssocInd->numBss);
-    pBuf += sizeof(tANI_U32);
-    mLen += sizeof(tANI_U32);
-
-    if (pAssocInd->numBss)
-    {
-        len   = limCopyNeighborList(pMac,
-                           pBuf,
-                           pAssocInd->neighborList, pAssocInd->numBss);
-        pBuf += len;
-        mLen += (tANI_U16) len;
-    }
-
-    // place holder to capability and nwType
-
-    limCopyU16(pBuf, *(tANI_U16 *)&pAssocInd->capabilityInfo);
-    pBuf += sizeof(tANI_U16); // capabilityInfo
-    mLen += sizeof(tANI_U16);
-
-    limCopyU32(pBuf, *(tANI_U32 *)&pAssocInd->nwType);
-    pBuf += sizeof(tANI_U32); // nwType
-    mLen += sizeof(tANI_U32);
-
-#endif
 
     limCopyU32(pBuf, pAssocInd->spectrumMgtIndicator);
     pBuf += sizeof(tAniBool);
@@ -2422,271 +1440,15 @@
 
     palCopyMemory( pMac->hHdd, pDisassocCnf->bssId, pBuf, sizeof(tSirMacAddr));
     pBuf += sizeof(tSirMacAddr);
- 
+
     palCopyMemory( pMac->hHdd, pDisassocCnf->peerMacAddr, pBuf, sizeof(tSirMacAddr));
 
-#if defined(ANI_PRODUCT_TYPE_AP)
-    pBuf += sizeof(tSirMacAddr);
-    pDisassocCnf->aid = limGetU16(pBuf);
-#endif
-    
+
     return eSIR_SUCCESS;
 } /*** end limDisassocCnfSerDes() ***/
 
 
 
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED) && defined(ANI_PRODUCT_TYPE_AP)
-/**
- * limMeasurementReqSerDes()
- *
- *FUNCTION:
- * This function is called by limProcessLmmMessages() when
- * SME_MEASUREMENT_REQ message is received from upper layer software.
- *
- *PARAMS:
- *
- *LOGIC:
- *
- *ASSUMPTIONS:
- * NA
- *
- *NOTE:
- * NA
- *
- * @param  pMeasReq  Pointer to tSirSmeMeasurement being
- *                   extracted into
- * @param  pBuf      Pointer to serialized buffer
- * @return retCode   Indicates whether message is successfully
- *                   de-serialized (eSIR_SUCCESS) or
- *                   not (eSIR_FAILURE)
- */
-
-tSirRetStatus
-limMeasurementReqSerDes(tpAniSirGlobal pMac, tpSirSmeMeasurementReq pMeasReq, tANI_U8 *pBuf)
-{
-    tANI_S16 len = 0;
-    PELOG3(tANI_U8  *pTemp = pBuf;)
-
-    if (!pMeasReq || !pBuf)
-        return eSIR_FAILURE;
-
-    pMeasReq->messageType = limGetU16(pBuf);
-    pBuf += sizeof(tANI_U16);
-
-    len = pMeasReq->length = limGetU16(pBuf);
-    pBuf += sizeof(tANI_U16);
-
-    PELOG3(limLog(pMac, LOG3, FL("SME_MEASUREMENT_REQ length %d bytes is:\n"), len);
-    sirDumpBuf(pMac, SIR_LIM_MODULE_ID, LOG3, pTemp, len);)
-
-    if (len < (tANI_S16) sizeof(tANI_U32))
-        return eSIR_FAILURE;
-
-    len -= sizeof(tANI_U32); // skip message header
-    if (limCheckRemainingLength(pMac, len) == eSIR_FAILURE)
-        return eSIR_FAILURE;
-
-    pMeasReq->measControl.periodicMeasEnabled = (tAniBool)
-                                                limGetU32(pBuf);
-
-    pBuf += sizeof(tAniBool);
-    len  -= sizeof(tAniBool);
-    if (limCheckRemainingLength(pMac, len) == eSIR_FAILURE)
-        return eSIR_FAILURE;
-
-    pMeasReq->measControl.involveSTAs = (tAniBool)
-                                        limGetU32(pBuf);
-    pBuf += sizeof(tAniBool);
-    len  -= sizeof(tAniBool);
-    if (limCheckRemainingLength(pMac, len) == eSIR_FAILURE)
-        return eSIR_FAILURE;
-
-    pMeasReq->measControl.metricsType = *pBuf++;
-    len--;
-    if (limCheckRemainingLength(pMac, len) == eSIR_FAILURE)
-        return eSIR_FAILURE;
-
-    pMeasReq->measControl.scanType = (tSirScanType)
-                                     limGetU32(pBuf);
-    pBuf += sizeof(tSirScanType);
-    len  -= sizeof(tSirScanType);
-    if (limCheckRemainingLength(pMac, len) == eSIR_FAILURE)
-        return eSIR_FAILURE;
-
-    pMeasReq->measControl.longChannelScanPeriodicity = *pBuf++;
-    len--;
-    if (limCheckRemainingLength(pMac, len) == eSIR_FAILURE)
-        return eSIR_FAILURE;
-
-    pMeasReq->measControl.cb11hEnabled = (tAniBool)limGetU32(pBuf);
-    pBuf += sizeof(tAniBool);
-    len  -= sizeof(tAniBool);
-
-    if (limCheckRemainingLength(pMac, len) == eSIR_FAILURE)
-        return eSIR_FAILURE;
-
-    pMeasReq->measDuration.shortTermPeriod = limGetU32(pBuf);
-    pBuf += sizeof(tANI_U32);
-
-    pMeasReq->measDuration.averagingPeriod = limGetU32(pBuf);
-    pBuf += sizeof(tANI_U32);
-
-    pMeasReq->measDuration.shortChannelScanDuration = limGetU32(pBuf);
-    pBuf += sizeof(tANI_U32);
-
-    pMeasReq->measDuration.longChannelScanDuration = limGetU32(pBuf);
-    pBuf += sizeof(tANI_U32);
-
-    len  -= sizeof(tSirMeasDuration);
-    if (limCheckRemainingLength(pMac, len) == eSIR_FAILURE)
-        return eSIR_FAILURE;
-
-    pMeasReq->measIndPeriod = limGetU32(pBuf);
-
-    pBuf += sizeof(tANI_U32);
-    len  -= sizeof(tANI_U32);
-    if (limCheckRemainingLength(pMac, len) == eSIR_FAILURE)
-        return eSIR_FAILURE;
-
-    pMeasReq->channelList.numChannels = *pBuf++;
-    palCopyMemory( pMac->hHdd, (tANI_U8 *) pMeasReq->channelList.channelNumber,
-                  pBuf, pMeasReq->channelList.numChannels);
-
-    return eSIR_SUCCESS;
-} /*** end limMeasurementReqSerDes() ***/
-
-
-/**
- * limWdsReqSerDes()
- *
- *FUNCTION:
- * This function is called by limProcessLmmMessages() when
- * SME_SET_WDS_INFO_REQ message is received from upper layer software.
- *
- *PARAMS:
- *
- *LOGIC:
- *
- *ASSUMPTIONS:
- * NA
- *
- *NOTE:
- * NA
- *
- * @param  pWdsInfo  Pointer to tSirWdsInfo being extracted into
- * @param  pBuf      Pointer to serialized buffer
- * @return retCode   Indicates whether message is successfully
- *                   de-serialized (eSIR_SUCCESS) or
- *                   not (eSIR_FAILURE)
- */
-
-tSirRetStatus
-limWdsReqSerDes(tpAniSirGlobal pMac, tpSirSmeSetWdsInfoReq pWdsInfoReq, tANI_U8 *pBuf)
-{
-    tANI_S16 len = 0;
-    PELOG1(tANI_U8  *pTemp = pBuf;)
-
-    if (!pWdsInfoReq || !pBuf)
-        return eSIR_FAILURE;
-
-    // Extract messageType
-    pWdsInfoReq->messageType = limGetU16(pBuf);
-    pBuf += sizeof(tANI_U16);
-
-    // Extract length
-    len = pWdsInfoReq->length = limGetU16(pBuf);
-    pBuf += sizeof(tANI_U16);
-
-    PELOG1(limLog(pMac, LOG1, FL("SME_SET_WDS_INFO_REQ length %d bytes is:\n"), len);)
-    PELOG1(sirDumpBuf(pMac, SIR_LIM_MODULE_ID, LOG1, pTemp, len);)
-
-    if (len < (tANI_S16) sizeof(tANI_U32))
-        return eSIR_FAILURE;
-
-    len -= sizeof(tANI_U32); // skip message header
-
-    // Extract transactionId
-    pWdsInfoReq->transactionId = limGetU16(pBuf);
-    pBuf += sizeof(tANI_U16);
-    len -= sizeof(tANI_U16);
-
-    // Extract wdsInfo
-    pWdsInfoReq->wdsInfo.wdsLength = limGetU16(pBuf);
-    len -= sizeof(tANI_U16);
-    pBuf += sizeof(tANI_U16);
-
-    if (pWdsInfoReq->wdsInfo.wdsLength > ANI_WDS_INFO_MAX_LENGTH)
-        return eSIR_FAILURE;
-
-    if (limCheckRemainingLength(pMac, len) == eSIR_FAILURE)
-        return eSIR_FAILURE;
-
-    palCopyMemory( pMac->hHdd, (tANI_U8 *) pWdsInfoReq->wdsInfo.wdsBytes,
-        pBuf,
-        pWdsInfoReq->wdsInfo.wdsLength);
-
-    return eSIR_SUCCESS;
-
-} /*** end limWdsReqSerDes() ***/
-
-
-/**
- * limMeasurementIndSerDes()
- *
- *FUNCTION:
- * This function is called by limSendMeasurementInd() while
- * sending SME_MEASUREMENT_IND message to WSM.
- *
- *LOGIC:
- *
- *ASSUMPTIONS:
- *
- *NOTE:
- *
- * @param  pMac     - Pointer to Global MAC structure
- * @param  pMeasInd - Pointer to prepared MEASUREMENT_IND message
- * @return None
- */
-
-void
-limMeasurementIndSerDes(tpAniSirGlobal pMac, tANI_U8 *pBuf)
-{
-    tANI_U8          *pLen;
-    tANI_U16         len = 0, infoLen = 0;
-    tSirLoad    load;
-    PELOG3(tANI_U8  *pTemp = pBuf;)
-
-    limCopyU16(pBuf, eWNI_SME_MEASUREMENT_IND);
-    pBuf += sizeof(tANI_U16);
-
-    pLen  = pBuf;
-    pBuf += sizeof(tANI_U16);
-
-    limCopyU32(pBuf, pMac->lim.gpLimMeasData->duration);
-    pBuf += sizeof(tANI_U32);
-    len += sizeof(tANI_U32);
-
-    load.numStas            = peGetCurrentSTAsCount(pMac);
-    load.channelUtilization =
-                        pMac->lim.gpLimMeasData->avgChannelUtilization;
-    limCopyLoad(pBuf, load);
-    pBuf += sizeof(tSirLoad);
-    len  += sizeof(tSirLoad);
-
-    infoLen = limCopyMeasMatrixList(pMac, pBuf);
-    pBuf   += infoLen;
-    len    += infoLen;
-
-    infoLen = limCopyNeighborWdsList(pMac, pBuf);
-    pBuf   += infoLen;
-    len    += infoLen;
-
-    limCopyU16(pLen, len+4);
-
-    PELOG3(limLog(pMac, LOG3, FL("Sending MEAS_IND length %d bytes:\n"), len);
-    sirDumpBuf(pMac, SIR_LIM_MODULE_ID, LOG3, pTemp, len);)
-} /*** end limMeasurementIndSerDes() ***/
-#endif
 
 
 /**---------------------------------------------------------------
@@ -2712,9 +1474,6 @@
     tANI_U8  *pTemp = pBuf;
 #endif
 
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED)
-    tANI_U32 len = 0;
-#endif
 
     mLen   = sizeof(tANI_U32);
     pBuf  += sizeof(tANI_U16);
@@ -2775,54 +1534,6 @@
     pBuf += pReassocInd->addIE.length;
     mLen += pReassocInd->addIE.length;
 
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED)
-
-    limCopyU16(pBuf, pReassocInd->seqNum);
-    pBuf += sizeof(tANI_U16);
-    mLen += sizeof(tANI_U16);
-
-    limCopyU32(pBuf, pReassocInd->wniIndicator);
-    pBuf += sizeof(tAniBool);
-    mLen += sizeof(tAniBool);
-
-    limCopyU32(pBuf, pReassocInd->bpIndicator);
-    pBuf += sizeof(tAniBool);
-    mLen += sizeof(tAniBool);
-
-    limCopyU32(pBuf, pReassocInd->bpType);
-    pBuf += sizeof(tSirBpIndicatorType);
-    mLen += sizeof(tSirBpIndicatorType);
-
-    limCopyU32(pBuf, pReassocInd->reassocType);
-    pBuf += sizeof(tSirAssocType);
-    mLen += sizeof(tSirAssocType);
-
-    limCopyLoad(pBuf, pReassocInd->load);
-    pBuf += sizeof(tSirLoad);
-    mLen += sizeof(tSirLoad);
-
-    limCopyU32(pBuf, pReassocInd->numBss);
-    pBuf += sizeof(tANI_U32);
-    mLen += sizeof(tANI_U32);
-
-    if (pReassocInd->numBss)
-    {
-        len   = limCopyNeighborList(pMac,
-                       pBuf,
-                       pReassocInd->neighborList, pReassocInd->numBss);
-        pBuf += len;
-        mLen += (tANI_U16) len;
-    }
-
-    // place holder to capability and nwType
-    limCopyU16(pBuf, *(tANI_U16 *)&pReassocInd->capabilityInfo);
-    pBuf += sizeof(tANI_U16); // capabilityInfo
-    mLen += sizeof(tANI_U16);
-
-    limCopyU32(pBuf, *(tANI_U32 *)&pReassocInd->nwType);
-    pBuf += sizeof(tANI_U32); // nwType
-    mLen += sizeof(tANI_U32);
-#endif
 
     limCopyU32(pBuf, pReassocInd->spectrumMgtIndicator);
     pBuf += sizeof(tAniBool);
@@ -2998,13 +1709,6 @@
     if (limCheckRemainingLength(pMac, len) == eSIR_FAILURE)
         return eSIR_FAILURE;
 
-#if defined(ANI_PRODUCT_TYPE_AP)
-    pSetContextReq->aid = limGetU16(pBuf);
-    pBuf += sizeof(tANI_U16);
-    len  -= sizeof(tANI_U16);
-    if (limCheckRemainingLength(pMac, len) == eSIR_FAILURE)
-        return eSIR_FAILURE;
-#endif
 
 //    pSetContextReq->qosInfoPresent = limGetU32(pBuf);
 //    pBuf += sizeof(tAniBool);
@@ -3121,13 +1825,6 @@
     if (limCheckRemainingLength(pMac, len) == eSIR_FAILURE)
         return eSIR_FAILURE;
 
-#if defined(ANI_PRODUCT_TYPE_AP)
-    pRemoveKeyReq->aid = limGetU16(pBuf);
-    pBuf += sizeof(tANI_U16);
-    len  -= sizeof(tANI_U16);
-    if (limCheckRemainingLength(pMac, len) == eSIR_FAILURE)
-        return eSIR_FAILURE;
-#endif
 
     pRemoveKeyReq->edType = *pBuf;
     pBuf += sizeof(tANI_U8);
@@ -3270,17 +1967,6 @@
     pBuf += sizeof(tANI_U8);
     len -= sizeof(tANI_U8);
 
-#if defined(ANI_PRODUCT_TYPE_AP)
-    pDisassocReq->aid = limGetU16(pBuf);
-    pBuf += sizeof(tANI_U16);
-    len  -= sizeof(tANI_U16);
-    if (limCheckRemainingLength(pMac, len) == eSIR_FAILURE)
-        return eSIR_FAILURE;
-
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED)
-    pDisassocReq->seqNum = limGetU16(pBuf);
-#endif
-#endif
 
     return eSIR_SUCCESS;
 } /*** end limDisassocReqSerDes() ***/
@@ -3371,11 +2057,6 @@
     pBuf += sizeof(tANI_U16);
     len  -= sizeof(tANI_U16);
 
-#if defined(ANI_PRODUCT_TYPE_AP)
-    if (limCheckRemainingLength(pMac, len) == eSIR_FAILURE)
-        return eSIR_FAILURE;
-    pDeauthReq->aid = limGetU16(pBuf);
-#endif
     
     return eSIR_SUCCESS;
 } /*** end limDisassocReqSerDes() ***/
@@ -3383,109 +2064,6 @@
 
 
 
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED) && defined(ANI_PRODUCT_TYPE_AP)
-/**
- * limCopyNeighborInfoToCfg()
- *
- *FUNCTION:
- * This function is called by limProcessSmeMessages() upon receiving
- * SME_JOIN_REQ/SME_REASSOC_REQ from WSM to convert neighborBssInfo
- * that is being joined to bssDescription used by MLM
- *
- *PARAMS:
- *
- *LOGIC:
- *
- *ASSUMPTIONS:
- * NA
- *
- *NOTE:
- * NA
- *
- * @param  neighborBssInfo  Neighbor BSS info to be converted
- *
- * @return None
- */
-
-void
-limCopyNeighborInfoToCfg(tpAniSirGlobal pMac, tSirNeighborBssInfo neighborBssInfo, tpPESession psessionEntry)
-{
-    tANI_U32    localPowerConstraints = 0;
-    tANI_U16    caps;
-    tANI_U8     qosCap = 0;
-
-    if(psessionEntry)
-    {
-        psessionEntry->gLimPhyMode = neighborBssInfo.nwType;
-    }
-    else
-    {
-        pMac->lim.gLimPhyMode = neighborBssInfo.nwType;
-    }
-
-    cfgSetCapabilityInfo(pMac, neighborBssInfo.capabilityInfo);
-
-    if (cfgSetStr(pMac, WNI_CFG_SSID, (tANI_U8 *) &neighborBssInfo.ssId.ssId,
-                  neighborBssInfo.ssId.length) != eSIR_SUCCESS)
-    {
-        /// Could not update SSID at CFG. Log error.
-        limLog(pMac, LOGP, FL("could not update SSID at CFG\n"));
-    }
-
-    #if 0
-    if (cfgSetStr(
-           pMac, WNI_CFG_OPERATIONAL_RATE_SET,
-           (tANI_U8 *) &neighborBssInfo.operationalRateSet.rate,
-           neighborBssInfo.operationalRateSet.numRates) != eSIR_SUCCESS)
-    {
-        /// Could not update Operational Rateset at CFG. Log error.
-        limLog(pMac, LOGP,
-               FL("could not update Operational Rateset at CFG\n"));
-    }
-    #endif // TO SUPPORT BT-AMP
-
-    if (neighborBssInfo.nwType == WNI_CFG_PHY_MODE_11G)
-    {
-        if (cfgSetStr(
-            pMac, WNI_CFG_EXTENDED_OPERATIONAL_RATE_SET,
-            (tANI_U8 *) &neighborBssInfo.extendedRateSet.rate,
-            neighborBssInfo.extendedRateSet.numRates) != eSIR_SUCCESS)
-        {
-            /// Could not update Extended Rateset at CFG. Log error.
-            limLog(pMac, LOGP,
-                   FL("could not update Extended Rateset at CFG\n"));
-        }
-    }
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED)
-    if (neighborBssInfo.hcfEnabled)
-        LIM_BSS_CAPS_SET(HCF, qosCap);
-#endif
-    if (neighborBssInfo.wmeInfoPresent || neighborBssInfo.wmeEdcaPresent)
-        LIM_BSS_CAPS_SET(WME, qosCap);
-    if (LIM_BSS_CAPS_GET(WME, qosCap) && neighborBssInfo.wsmCapablePresent)
-        LIM_BSS_CAPS_SET(WSM, qosCap);
-    
-    pMac->lim.gLimCurrentBssQosCaps = qosCap;
-    
-    if (neighborBssInfo.wniIndicator)
-        pMac->lim.gLimCurrentBssPropCap = neighborBssInfo.propIECapability;
-    else
-        pMac->lim.gLimCurrentBssPropCap = 0;
-
-    if (neighborBssInfo.HTCapsPresent)
-        pMac->lim.htCapabilityPresentInBeacon = 1;
-    else
-        pMac->lim.htCapabilityPresentInBeacon = 0;
-    if (neighborBssInfo.localPowerConstraints && pSessionEntry->lim11hEnable)
-    {
-        localPowerConstraints = neighborBssInfo.localPowerConstraints;
-    }
-    if (cfgSetInt(pMac, WNI_CFG_LOCAL_POWER_CONSTRAINT, localPowerConstraints) != eSIR_SUCCESS)
-    {
-        limLog(pMac, LOGP, FL("Could not update local power constraint to cfg.\n"));
-    }
-} /*** end limCopyNeighborInfoToCfg() ***/
-#endif
 
 
 /**
@@ -3599,119 +2177,6 @@
 } /*** end limStatSerDes() ***/
 
 
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED) && defined(ANI_PRODUCT_TYPE_AP)
-/**
- * limSmeWmStatusChangeNtfSerDes()
- *
- *FUNCTION:
- * This function is called by limSendSmeWmStatusChangeNtf()
- * to serialize the header fields of SME WM Status Change
- * Notification
- *
- *LOGIC:
- *
- *ASSUMPTIONS:
- * NA
- *
- *NOTE:
- * NA
- *
- * @param  statusChangeCode     Status Change code
- * @param  pBuf                 Pointer to serialized buffer
- * @param  len                  Pointer to length actually used
- * @param  buflen               Buffer length remaining
- * @return retCode              Indicates whether message is successfully
- *                              serialized (eSIR_SUCCESS) or not (eSIR_FAILURE)
- */
-
-tSirRetStatus
-limSmeWmStatusChangeHeaderSerDes(tpAniSirGlobal pMac,
-                                 tSirSmeStatusChangeCode statusChangeCode,
-                                 tANI_U8 *pBuf,
-                                 tANI_U16 *len,
-                                 tANI_U32 buflen,
-                                 tANI_U8 sessionId)
-{
-    if (buflen < ((sizeof(tANI_U16) * 2) + sizeof(tANI_U32)))
-    {
-        limLog(pMac, LOGE,
-               FL("limSmeWmStatusChangeHeaderSerDes: no enough space (buf %d) \n"), buflen);
-        return eSIR_FAILURE;
-    }
-
-    *len = 0;
-
-    limCopyU16(pBuf, eWNI_SME_WM_STATUS_CHANGE_NTF);
-    pBuf += sizeof(tANI_U16);
-    *len += sizeof(tANI_U16);
-
-    // Actual length value shall be filled later
-    pBuf += sizeof(tANI_U16);
-    *len += sizeof(tANI_U16);
-    
-    *pBuf++ = sessionId;
-    *len += sizeof(tANI_U8);
-
-    limCopyU32(pBuf, statusChangeCode);
-    pBuf += sizeof(tANI_U32);
-    *len += sizeof(tANI_U32);
-
-    return eSIR_SUCCESS;
-} /*** end limSmeWmStatusChangeHeaderSerDes() ***/
-
-
-
-/**
- * limRadioInfoSerDes()
- *
- *FUNCTION:
- * This function is called by limSendSmeWmStatusChangeNtf()
- * to serialize the radarInfo message
- *
- *LOGIC:
- *
- *ASSUMPTIONS:
- * NA
- *
- *NOTE:
- * NA
- *
- * @param  pRadarInfo    Pointer to tSirRadarInfo
- * @param  pBuf          Pointer to serialized buffer
- * @param  len           Pointer to length actually used by tSirRadarInfo
- * @param  buflen        Length remaining
- *
- * @return retCode       Indicates whether message is successfully
- *                       serialized (eSIR_SUCCESS) or not (eSIR_FAILURE)
- */
-
-tSirRetStatus
-limRadioInfoSerDes(tpAniSirGlobal pMac, tpSirRadarInfo pRadarInfo,
-                              tANI_U8 *pBuf, tANI_U16 *len, tANI_U32 buflen)
-{
-
-    if (buflen < sizeof(tSirRadarInfo))
-    {
-        limLog(pMac, LOGE,
-               FL("no enough space (buf %d) \n"), buflen);
-        return eSIR_FAILURE;
-    }
-
-    *pBuf = pRadarInfo->channelNumber;
-    pBuf += sizeof(tANI_U8);
-    *len += sizeof(tANI_U8);
-
-    limCopyU16(pBuf, pRadarInfo->radarPulseWidth);
-    pBuf += sizeof(tANI_U16);
-    *len += sizeof(tANI_U16);
-
-    limCopyU16(pBuf, pRadarInfo->numRadarPulse);
-    pBuf += sizeof(tANI_U16);
-    *len += sizeof(tANI_U16);
-
-    return eSIR_SUCCESS;
-} /*** end limRadioInfoSerDes() ***/
-#endif
 
 
 /**
@@ -3734,19 +2199,6 @@
                     sizeof(tSirSmeStatusChangeCode) +
                     sizeof(tSirBackgroundScanInfo);
 
-#if defined (ANI_PRODUCT_TYPE_AP) && defined(ANI_LITTLE_BYTE_ENDIAN)
-        sirStoreU16N((tANI_U8*)&pSmeNtf->messageType, eWNI_SME_WM_STATUS_CHANGE_NTF );
-        sirStoreU16N((tANI_U8*)&pSmeNtf->length, length);
-        pSmeNtf->sessionId = sessionId;
-        sirStoreU32N((tANI_U8*)&pSmeNtf->statusChangeCode, statusChangeCode);
-
-        sirStoreU32N((tANI_U8*)&pSmeNtf->statusChangeInfo.bkgndScanInfo.numOfScanSuccess,
-                     pScanInfo->numOfScanSuccess);
-        sirStoreU32N((tANI_U8*)&pSmeNtf->statusChangeInfo.bkgndScanInfo.numOfScanFailure,
-                     pScanInfo->numOfScanFailure);
-        sirStoreU32N((tANI_U8*)&pSmeNtf->statusChangeInfo.bkgndScanInfo.reserved,
-                     pScanInfo->reserved);
-#else
         pSmeNtf->messageType = eWNI_SME_WM_STATUS_CHANGE_NTF;
         pSmeNtf->statusChangeCode = statusChangeCode;
         pSmeNtf->length = length;
@@ -3754,142 +2206,8 @@
         pSmeNtf->statusChangeInfo.bkgndScanInfo.numOfScanSuccess = pScanInfo->numOfScanSuccess;
         pSmeNtf->statusChangeInfo.bkgndScanInfo.numOfScanFailure = pScanInfo->numOfScanFailure;
         pSmeNtf->statusChangeInfo.bkgndScanInfo.reserved = pScanInfo->reserved;
-#endif
 }
 
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED) && defined(ANI_PRODUCT_TYPE_AP)
-
-/**
- * nonTitanBssFoundSerDes()
- *
- *FUNCTION:
- * This function is called by limSendSmeWmStatusChangeNtf()
- * to serialize the following message
- * Mesg = eWNI_SME_WM_STATUS_CHANGE_NTF
- * Change code = eSIR_SME_CB_LEGACY_BSS_FOUND_BY_AP
- *
- *LOGIC:
- *
- *ASSUMPTIONS:
- * NA
- *
- *NOTE:
- * NA
- *
- * @param  pMac         Pointer to the global pMAC structure
- * @param  pNewBssInfo  Pointer to tpSirNeighborBssWdsInfo
- * @param  pBuf         Send data buffer
- * @param  len          Length of message
- * @param  buflen       Length remaining
- *
- * @return retCode      Indicates whether message is successfully
- *                      serialized (eSIR_SUCCESS) or not (eSIR_FAILURE)
- */
-
-tSirRetStatus nonTitanBssFoundSerDes( tpAniSirGlobal pMac,
-    tpSirNeighborBssWdsInfo pNewBssInfo,
-    tANI_U8 *pBuf,
-    tANI_U16 *len,
-    tANI_U8 sessionId )
-{
-tANI_U8 *pTemp = pBuf;
-tANI_U16 length = 0;
-tANI_U32 bufLen = sizeof( tSirSmeWmStatusChangeNtf );
-
-  // Serialize the header (length to be filled later)
-  if( eSIR_SUCCESS != limSmeWmStatusChangeHeaderSerDes(
-        pMac,
-        eSIR_SME_CB_LEGACY_BSS_FOUND_BY_AP,
-        pBuf,
-        &length,
-        bufLen,
-        sessionId))
-  {
-    limLog( pMac, LOGE,
-        FL("Header SerDes failed \n"));
-    return eSIR_FAILURE;
-  }
-  pBuf += length;
-  bufLen -= length;
-
-  // Serialize tSirNeighborBssWdsInfo
-  length = limCopyNeighborWdsInfo( pMac,
-      pBuf,
-      pNewBssInfo );
-  pBuf += length;
-  bufLen -= length;
-
-  // Update tSirSmeWmStatusChangeNtf.length
-  pBuf = pTemp;
-  pBuf += sizeof(tANI_U16);
-  limCopyU16(pBuf, length);
-
-  // Update the total length to be returned
-  *len = length;
-
-  return eSIR_SUCCESS;
-} /*** end nonTitanBssFoundSerDes() ***/
-
-/**
- * limIsSmeSwitchChannelReqValid()
- *
- *FUNCTION:
- * This function is called by limProcessSmeReqMessages() upon
- * receiving SME_SWITCH_CHL_REQ message from application.
- *
- *LOGIC:
- * Message validity checks are performed in this function
- *
- *ASSUMPTIONS:
- *
- *NOTE:
- *
- * @param  pBuf    - Pointer to a serialized SME_SWITCH_CHL_REQ message
- * @param  pSmeMsg - Pointer to a tSirsmeSwitchChannelReq structure
- * @return true if SME_SWITCH_CHL_REQ message is formatted correctly
- *                false otherwise
- */
-
-tANI_BOOLEAN
-limIsSmeSwitchChannelReqValid(tpAniSirGlobal pMac, 
-                              tANI_U8 *pBuf, 
-                              tpSirSmeSwitchChannelReq pSmeMsg)
-{
-    pSmeMsg->messageType = limGetU16(pBuf);
-    pBuf += sizeof(tANI_U16);  
-
-    pSmeMsg->length = limGetU16(pBuf); 
-    pBuf += sizeof(tANI_U16);
-
-    pSmeMsg->transactionId = limGetU16(pBuf); 
-    pBuf += sizeof(tANI_U16);
-
-    pSmeMsg->channelId = *pBuf;
-    pBuf++;
-  
-    pSmeMsg->cbMode = limGetU32(pBuf);
-    pBuf += sizeof(tANI_U32);
-
-    pSmeMsg->dtimFactor = limGetU32(pBuf);
-    pBuf += sizeof(tANI_U32);
-
-    if (pSmeMsg->length != SIR_SME_CHANNEL_SWITCH_SIZE)
-    {
-        PELOGE(limLog(pMac, LOGE, FL("Invalid length %d \n"), pSmeMsg->length);)
-        return eANI_BOOLEAN_FALSE;
-    }
-
-    // dtimFactor should not be too large
-    if (pSmeMsg->dtimFactor > SIR_MAX_DTIM_FACTOR)
-    {
-        PELOGE(limLog(pMac, LOGE, FL("Invalid dtimFactor %d \n"), pSmeMsg->dtimFactor);)
-        return eANI_BOOLEAN_FALSE;
-    }
-
-    return eANI_BOOLEAN_TRUE;
-}
-
-#endif
 
 /**
  * limIsSmeGetAssocSTAsReqValid()
diff --git a/CORE/MAC/src/pe/lim/limSerDesUtils.h b/CORE/MAC/src/pe/lim/limSerDesUtils.h
index e29bba9..0d19a74 100644
--- a/CORE/MAC/src/pe/lim/limSerDesUtils.h
+++ b/CORE/MAC/src/pe/lim/limSerDesUtils.h
@@ -75,23 +75,10 @@
 void            limStatSerDes(tpAniSirGlobal, tpAniStaStatStruct, tANI_U8 *);
 void            limGetSessionInfo(tpAniSirGlobal pMac, tANI_U8 *, tANI_U8 *, tANI_U16 *);
 
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED) && (WNI_POLARIS_FW_PRODUCT == AP)
-tSirRetStatus   limMeasurementReqSerDes(tpAniSirGlobal, tpSirSmeMeasurementReq, tANI_U8 *);
-void            limMeasurementIndSerDes(tpAniSirGlobal, tANI_U8 *);
-void            limCopyNeighborInfoToCfg(tpAniSirGlobal, tSirNeighborBssInfo);
-tSirRetStatus   limWdsReqSerDes(tpAniSirGlobal, tpSirSmeSetWdsInfoReq, tANI_U8 *); 
-tSirRetStatus   limRadioInfoSerDes(tpAniSirGlobal, tpSirRadarInfo, tANI_U8 *, tANI_U16 *, tANI_U32);
-tSirRetStatus   limSmeWmStatusChangeHeaderSerDes(tpAniSirGlobal, tSirSmeStatusChangeCode, tANI_U8 *, tANI_U16 *, tANI_U32, tANI_U8);
-tSirRetStatus   nonTitanBssFoundSerDes( tpAniSirGlobal, tpSirNeighborBssWdsInfo, tANI_U8 *, tANI_U16 *, tANI_U8 );
-#endif
 
 void            limPackBkgndScanFailNotify(tpAniSirGlobal, tSirSmeStatusChangeCode, 
                                            tpSirBackgroundScanInfo, tSirSmeWmStatusChangeNtf *, tANI_U8);
 
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED)
-tANI_U32 limCopyNeighborBssInfo(tpAniSirGlobal, tANI_U8 *, tpSirNeighborBssInfo);
-tANI_U32 limGetNeighborBssInfo(tpAniSirGlobal, tpSirNeighborBssInfo, tANI_U8 *);
-#endif
 
 tSirRetStatus limRemoveKeyReqSerDes(tpAniSirGlobal pMac, tpSirSmeRemoveKeyReq pRemoveKeyReq, tANI_U8 * pBuf);
 
@@ -101,17 +88,11 @@
 tSirRetStatus limUpdateAPWPSIEsReqSerDes(tpAniSirGlobal pMac, tpSirUpdateAPWPSIEsReq pUpdateAPWPSIEsReq, tANI_U8 *pBuf);
 tSirRetStatus limUpdateAPWPARSNIEsReqSerDes(tpAniSirGlobal pMac, tpSirUpdateAPWPARSNIEsReq pUpdateAPWPARSNIEsReq, tANI_U8 *pBuf);
 
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED) && (WNI_POLARIS_FW_PRODUCT == AP)
-tANI_BOOLEAN limIsSmeSwitchChannelReqValid(tpAniSirGlobal, tANI_U8 *, tpSirSmeSwitchChannelReq);
-#endif
 
 // Byte String <--> tANI_U16/tANI_U32 copy functions
 static inline void limCopyU16(tANI_U8 *ptr, tANI_U16 u16Val)
 {
-#if defined(ANI_PRODUCT_TYPE_AP)
-    *ptr++ = (tANI_U8) ((u16Val >> 8) & 0xff);    
-    *ptr   = (tANI_U8) (u16Val & 0xff);
-#elif ((defined(ANI_OS_TYPE_OSX) && defined(ANI_LITTLE_BYTE_ENDIAN)) || \
+#if   ((defined(ANI_OS_TYPE_OSX) && defined(ANI_LITTLE_BYTE_ENDIAN)) || \
        (defined(ANI_OS_TYPE_WINDOWS) && defined(ANI_LITTLE_BYTE_ENDIAN)) || \
        (defined(ANI_OS_TYPE_AMSS) && defined(ANI_LITTLE_BYTE_ENDIAN)) || \
        (defined(ANI_OS_TYPE_QNX) && defined(ANI_LITTLE_BYTE_ENDIAN)) || \
@@ -125,10 +106,7 @@
         
 static inline tANI_U16 limGetU16(tANI_U8 *ptr)
 {
-#if defined(ANI_PRODUCT_TYPE_AP)
-    return (((tANI_U16) (*ptr << 8)) |
-            ((tANI_U16) (*(ptr+1))));
-#elif ((defined(ANI_OS_TYPE_OSX) && defined(ANI_LITTLE_BYTE_ENDIAN)) || \
+#if   ((defined(ANI_OS_TYPE_OSX) && defined(ANI_LITTLE_BYTE_ENDIAN)) || \
        (defined(ANI_OS_TYPE_WINDOWS) && defined(ANI_LITTLE_BYTE_ENDIAN)) || \
        (defined(ANI_OS_TYPE_AMSS) && defined(ANI_LITTLE_BYTE_ENDIAN)) || \
        (defined(ANI_OS_TYPE_QNX) && defined(ANI_LITTLE_BYTE_ENDIAN)) || \
@@ -142,12 +120,7 @@
 
 static inline void limCopyU32(tANI_U8 *ptr, tANI_U32 u32Val)
 {
-#if defined(ANI_PRODUCT_TYPE_AP)
-    *ptr++ = (tANI_U8) ((u32Val >> 24) & 0xff);
-    *ptr++ = (tANI_U8) ((u32Val >> 16) & 0xff);
-    *ptr++ = (tANI_U8) ((u32Val >> 8) & 0xff);
-    *ptr   = (tANI_U8) (u32Val & 0xff);
-#elif ((defined(ANI_OS_TYPE_OSX) && defined(ANI_LITTLE_BYTE_ENDIAN)) || \
+#if   ((defined(ANI_OS_TYPE_OSX) && defined(ANI_LITTLE_BYTE_ENDIAN)) || \
        (defined(ANI_OS_TYPE_WINDOWS) && defined(ANI_LITTLE_BYTE_ENDIAN)) || \
        (defined(ANI_OS_TYPE_AMSS) && defined(ANI_LITTLE_BYTE_ENDIAN)) || \
        (defined(ANI_OS_TYPE_QNX) && defined(ANI_LITTLE_BYTE_ENDIAN)) || \
@@ -163,12 +136,7 @@
 
 static inline tANI_U32 limGetU32(tANI_U8 *ptr)
 {
-#if defined(ANI_PRODUCT_TYPE_AP)
-    return ((*(ptr) << 24) |
-            (*(ptr+1) << 16) |
-            (*(ptr+2) << 8) |
-            (*(ptr+3)));
-#elif ((defined(ANI_OS_TYPE_OSX) && defined(ANI_LITTLE_BYTE_ENDIAN)) || \
+#if   ((defined(ANI_OS_TYPE_OSX) && defined(ANI_LITTLE_BYTE_ENDIAN)) || \
        (defined(ANI_OS_TYPE_WINDOWS) && defined(ANI_LITTLE_BYTE_ENDIAN)) || \
        (defined(ANI_OS_TYPE_AMSS) && defined(ANI_LITTLE_BYTE_ENDIAN)) || \
        (defined(ANI_OS_TYPE_QNX) && defined(ANI_LITTLE_BYTE_ENDIAN)) || \
diff --git a/CORE/MAC/src/pe/lim/limSmeReqUtils.c b/CORE/MAC/src/pe/lim/limSmeReqUtils.c
index b5182fa..c649df1 100644
--- a/CORE/MAC/src/pe/lim/limSmeReqUtils.c
+++ b/CORE/MAC/src/pe/lim/limSmeReqUtils.c
@@ -54,11 +54,7 @@
  */
 
 #include "wniApi.h"
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-#include "wniCfgAp.h"
-#else
 #include "wniCfgSta.h"
-#endif
 #include "cfgApi.h"
 #include "sirApi.h"
 #include "schApi.h"
@@ -396,47 +392,6 @@
     return true;
 } /*** end limSetRSNieWPAiefromSmeStartBSSReqMessage() ***/
 
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED) && (WNI_POLARIS_FW_PRODUCT == AP)
-/**
- * limIsBssInfoValidInSmeReqMessage()
- *
- *FUNCTION:
- * This function is called to verify if the BSS info
- * received in various SME_REQ messages is valid or not
- *
- *LOGIC:
- * BSS info validity checks are performed in this function
- *
- *ASSUMPTIONS:
- *
- *NOTE:
- *
- * @param  pMac     Pointer to Global MAC structure
- * @param  pBssInfo Pointer to received Bss Information
- * @return true when BSS info is valid, false otherwise
- */
-
-static tANI_U8
-limIsBssInfoValidInSmeReqMessage(tpAniSirGlobal pMac,
-                                 tpSirNeighborBssInfo pBssInfo)
-{
-    tANI_U8 valid = true;
-
-    if ((pBssInfo->bssType != eSIR_INFRASTRUCTURE_MODE) ||
-        limIsGroupAddr(pBssInfo->bssId) ||
-        !pBssInfo->channelId ||
-        !pBssInfo->ssId.length ||
-        (pBssInfo->ssId.length > SIR_MAC_MAX_SSID_LENGTH) ||
-        !limIsRSNieValidInSmeReqMessage(pMac, &pBssInfo->rsnIE))
-    {
-        valid = false;
-        goto end;
-    }
-
-end:
-    return valid;
-} /*** end limIsBssInfoValidInSmeReqMessage() ***/
-#else
 
 
 
@@ -475,7 +430,6 @@
 end:
     return valid;
 } /*** end limIsBssDescrValidInSmeReqMessage() ***/
-#endif
 
 
 
@@ -562,20 +516,17 @@
     switch (pStartBssReq->bssType)
     {
         case eSIR_INFRASTRUCTURE_MODE:
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-            /* Check for the AP Role/Station role here and act accordingly. 
-             * Currently assuming this as AP and breaks TODO */
-                break;
-#endif
-                /**
+            /**
              * Should not have received start BSS req with bssType
              * Infrastructure on STA.
              * Log error.
              */
-        limLog(pMac, LOGE, FL("Invalid bssType %d in eWNI_SME_START_BSS_REQ\n"),pStartBssReq->bssType);
-        valid = false;
-        goto end;
-        break;
+            limLog(pMac, LOGE,
+                   FL("Invalid bssType %d in eWNI_SME_START_BSS_REQ"),
+                   pStartBssReq->bssType);
+            valid = false;
+            goto end;
+            break;
 
         case eSIR_IBSS_MODE:
             break;
@@ -606,47 +557,6 @@
             goto end;
     }
 
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED) && (WNI_POLARIS_FW_PRODUCT == AP)
-
-    /* Assumed as AP again, need to check the role and change accordingly */
-    if (pStartBssReq->bssType == eSIR_INFRASTRUCTURE_MODE)
-    {
-        if ((pStartBssReq->numSSID == 1) && pStartBssReq->ssId.length &&
-            ((pStartBssReq->ssId.length != pStartBssReq->ssIdList[0].length) ||
-            ( !palEqualMemory( pMac->hHdd,pStartBssReq->ssId.ssId,
-                    pStartBssReq->ssIdList[0].ssId,
-                    pStartBssReq->ssId.length) )))
-        {
-        /**
-         * Invalid combination of ssID length
-         * and number of SSIDs present.
-         * Reject START_BSS_REQ.
-         */
-            limLog(pMac, LOGW,
-           FL("Mismatch in SSID length & numSSID in SME_START_BSS_REQ\n"));
-
-            valid = false;
-            goto end;
-        }
-
-        if (!pStartBssReq->numSSID ||
-            (pStartBssReq->ssId.length && (pStartBssReq->numSSID != 1)))
-        {
-        /**
-         * Invalid combination of ssID length
-         * and number of SSIDs present.
-         * Reject START_BSS_REQ.
-         */
-            limLog(pMac, LOGW,
-                FL("Mismatch in SSID length[%d] & numSSID[%d] in SME_START_BSS_REQ\n"),
-                pStartBssReq->ssId.length, pStartBssReq->numSSID);
-
-            valid = false;
-            goto end;
-        }
-    }
-#endif
-#if defined(ANI_PRODUCT_TYPE_CLIENT) || defined(ANI_AP_CLIENT_SDK)
     /* This below code is client specific code. TODO */
     if (pStartBssReq->bssType == eSIR_IBSS_MODE)
     {
@@ -662,41 +572,7 @@
             goto end;
         }
     }
-#endif
 
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED) && (WNI_POLARIS_FW_PRODUCT == AP)
-    /* Assumed as AP TODO */
-    if (pStartBssReq->bssType == eSIR_INFRASTRUCTURE_MODE)
-    {
-        tpSirAlternateRadioInfo pRadioInfo;
-
-        pRadioInfo = pStartBssReq->alternateRadioList.alternateRadio;
-        for (i = 0; i < pStartBssReq->alternateRadioList.numBss; i++)
-        {
-            if (limIsGroupAddr(pRadioInfo->bssId))
-            {
-                // Invalid mate BSSID.
-                // Reject START_BSS_REQ
-                limLog(pMac, LOGW,
-                       FL("Invalid mate BSSID in eWNI_SME_START_BSS_REQ\n"));
-
-                valid = false;
-                goto end;
-            }
-            pRadioInfo += sizeof(tSirAlternateRadioInfo);
-        }
-
-        /*
-            ** check WDS info length
-        **/
-        if (pStartBssReq->wdsInfo.wdsLength > ANI_WDS_INFO_MAX_LENGTH)
-        {
-            PELOGW(limLog(pMac, LOGW, FL("Illegal WDS info length\n"));)
-            valid = false;
-            goto end;
-        }
-    }
-#endif
 
     if (!limIsRSNieValidInSmeReqMessage(pMac, &pStartBssReq->rsnIE))
     {
@@ -747,7 +623,7 @@
             goto end;
         }
     }
-    else 
+    else
     {
         for (i = 0; i < pStartBssReq->operationalRateSet.numRates; i++)
             if (!sirIsBrate(pStartBssReq->operationalRateSet.rate[i] & 0x7F))
@@ -796,18 +672,6 @@
 {
     tANI_U8 valid = true;
 
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED)
-    if (pJoinReq->assocType > eSIR_TRANSFERRED)
-    {
-        /// Received eWNI_SME_JOIN_REQ with invalid assocType
-        // Log the event
-        limLog(pMac, LOGW,
-               FL("received SME_JOIN_REQ with invalid assocType\n"));
-
-        valid = false;
-        goto end;
-    }
-#endif
 
     if (!limIsRSNieValidInSmeReqMessage(pMac, &pJoinReq->rsnIE))
     {
@@ -834,14 +698,8 @@
     }
 
 
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED) && (WNI_POLARIS_FW_PRODUCT == AP)
-    if (!limIsBssInfoValidInSmeReqMessage(
-                     pMac,
-                     pJoinReq->neighborBssList.bssList))
-#else
     if (!limIsBssDescrValidInSmeReqMessage(pMac,
                                            &pJoinReq->bssDescription))
-#endif
     {
         /// Received eWNI_SME_JOIN_REQ with invalid BSS Info
         // Log the event
@@ -903,13 +761,6 @@
          !limIsAddrBC(pDisassocReq->peerMacAddr))
         return false;
 
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-    if (((psessionEntry->limSystemRole == eLIM_AP_ROLE) &&
-         ((pDisassocReq->aid < 2) || (pDisassocReq->aid > 2007))) ||
-        ((psessionEntry->limSystemRole == eLIM_STA_ROLE) &&
-         (pDisassocReq->aid != 1)))
-        return false;
-#endif
 
     return true;
 } /*** end limIsSmeDisassocReqValid() ***/
@@ -944,13 +795,6 @@
     if (limIsGroupAddr(pDisassocCnf->peerMacAddr))
         return false;
 
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-    if (((psessionEntry->limSystemRole == eLIM_AP_ROLE) &&
-         ((pDisassocCnf->aid < 2) || (pDisassocCnf->aid > 2007))) ||
-        ((psessionEntry->limSystemRole == eLIM_STA_ROLE) &&
-         (pDisassocCnf->aid != 1)))
-        return false;
-#endif
     return true;
 } /*** end limIsSmeDisassocCnfValid() ***/
 
@@ -983,13 +827,6 @@
          !limIsAddrBC(pDeauthReq->peerMacAddr))
         return false;
 
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-    if (((psessionEntryp->limSystemRole == eLIM_AP_ROLE) &&
-         ((pDeauthReq->aid < 2) || (pDeauthReq->aid > 2007))) ||
-        ((psessionEntryp->limSystemRole == eLIM_STA_ROLE) &&
-         (pDeauthReq->aid != 1)))
-        return false;
-#endif
     return true;
 } /*** end limIsSmeDeauthReqValid() ***/
 
@@ -1286,19 +1123,10 @@
 
     pBuf += sizeof(tANI_U32); // skip message header
 
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED)
-    pBuf += sizeof(tSirAssocType); // skip assocType
-#endif
 
     pBuf += limGetU16(pBuf) + sizeof(tANI_U16); // skip RSN IE
 
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED) && (WNI_POLARIS_FW_PRODUCT == AP)
-    pBuf  += sizeof(tAniBool);            // skip BP indicator
-    pBuf  += sizeof(tSirBpIndicatorType); // skip BP indicator type
-    pBuf  += sizeof(tANI_U32);                 // skip number of neighbor BSS
-#else
     pBuf  += sizeof(tANI_U16);                 // skip length of BSS description
-#endif
 
     return (pBuf);
 } /*** end limGetBssIdFromSmeJoinReqMsg() ***/
diff --git a/CORE/MAC/src/pe/lim/limTimerUtils.c b/CORE/MAC/src/pe/lim/limTimerUtils.c
index 7abdb89..c64fdab 100644
--- a/CORE/MAC/src/pe/lim/limTimerUtils.c
+++ b/CORE/MAC/src/pe/lim/limTimerUtils.c
@@ -250,7 +250,7 @@
             goto err_timer;
         }
 
-        //Send unicast probe req frame every 200 ms 
+        //Send unicast probe req frame every 200 ms
         if ((tx_timer_create(&pMac->lim.limTimers.gLimPeriodicJoinProbeReqTimer,
                         "Periodic Join Probe Request Timer",
                         limTimerHandler, SIR_LIM_PERIODIC_JOIN_PROBE_REQ_TIMEOUT,
@@ -419,7 +419,6 @@
             goto err_timer;
         }
 
-#if defined(ANI_PRODUCT_TYPE_CLIENT) || defined(ANI_AP_CLIENT_SDK)
         if (wlan_cfgGetInt(pMac, WNI_CFG_BACKGROUND_SCAN_PERIOD,
                       &cfgValue) != eSIR_SUCCESS)
         {
@@ -461,12 +460,11 @@
                FL("call to create background scan timer failed\n"));
             goto err_timer;
         }
-#endif
 #ifdef FEATURE_WLAN_TDLS_INTERNAL
-        /* 
+        /*
          * create TDLS timers..
          * a) TDLS discovery response timer.
-         */        
+         */
 
         if (wlan_cfgGetInt(pMac, WNI_CFG_ASSOCIATION_FAILURE_TIMEOUT,
                                             &cfgValue) != eSIR_SUCCESS)
@@ -480,7 +478,7 @@
         }
         cfgValue = SYS_MS_TO_TICKS(cfgValue);
 
-        /* 
+        /*
          * create TDLS discovery response wait timer and activate it later
          */
         if (tx_timer_create(&pMac->lim.limTimers.gLimTdlsDisRspWaitTimer,
@@ -607,10 +605,6 @@
         limLog(pMac, LOGP,
                FL("could not retrieve mac preauth value\n"));
     }
-#ifdef ANI_AP_SDK_OPT
-    if(cfgValue > SIR_SDK_OPT_MAX_NUM_PRE_AUTH)
-        cfgValue = SIR_SDK_OPT_MAX_NUM_PRE_AUTH;
-#endif // ANI_AP_SDK_OPT
     pMac->lim.gLimPreAuthTimerTable.numEntry = cfgValue;
     if (palAllocateMemory(pMac->hHdd, (void **) &pMac->lim.gLimPreAuthTimerTable.pTable,
           cfgValue*sizeof(tLimPreAuthNode)) != eHAL_STATUS_SUCCESS)
@@ -774,7 +768,7 @@
         tx_timer_delete(&pMac->lim.limTimers.gLimAddtsRspTimer);
         tx_timer_delete(&pMac->lim.limTimers.gLimReassocFailureTimer);
         tx_timer_delete(&pMac->lim.limTimers.gLimAssocFailureTimer);
-        tx_timer_delete(&pMac->lim.limTimers.gLimJoinFailureTimer); 
+        tx_timer_delete(&pMac->lim.limTimers.gLimJoinFailureTimer);
         tx_timer_delete(&pMac->lim.limTimers.gLimPeriodicJoinProbeReqTimer);
         tx_timer_delete(&pMac->lim.limTimers.gLimQuietBssTimer);
         tx_timer_delete(&pMac->lim.limTimers.gLimQuietTimer);
@@ -1158,7 +1152,6 @@
                        FL("Unable to deactivate max channel timer\n"));
             }
 
-#if defined(ANI_PRODUCT_TYPE_CLIENT) || defined(ANI_AP_CLIENT_SDK)
             // If a background was triggered via Quiet BSS,
             // then we need to adjust the MIN and MAX channel
             // timer's accordingly to the Quiet duration that
@@ -1203,23 +1196,6 @@
                 }
 #endif
             }
-#endif
-#if defined(ANI_PRODUCT_TYPE_AP)
-            if (pMac->lim.gLimSystemRole == eLIM_AP_ROLE)
-            {
-                if (wlan_cfgGetInt(pMac, WNI_CFG_ACTIVE_MAXIMUM_CHANNEL_TIME,
-                          &val) != eSIR_SUCCESS)
-                {
-                    /**
-                    * Could not get max channel value
-                    * from CFG. Log error.
-                    */
-                    limLog(pMac, LOGP,
-                   FL("could not retrieve max channel value\n"));
-                }
-                val = SYS_MS_TO_TICKS(val);
-            }
-#endif
 
             if (tx_timer_change(&pMac->lim.limTimers.gLimMaxChannelTimer,
                                 val, 0) != TX_SUCCESS)
@@ -1286,7 +1262,7 @@
                 // Log error
                 limLog(pMac, LOGP, FL("Unable to change periodic join request timer\n"));
             }
- 
+
             break;
 
         case eLIM_AUTH_FAIL_TIMER:
@@ -1510,7 +1486,6 @@
 
             break;
 
-#if defined(ANI_PRODUCT_TYPE_CLIENT) || defined(ANI_AP_CLIENT_SDK)
         case eLIM_BACKGROUND_SCAN_TIMER:
             if (tx_timer_deactivate(&pMac->lim.limTimers.gLimBackgroundScanTimer)
                             != TX_SUCCESS)
@@ -1552,77 +1527,7 @@
             }
 
             break;
-#endif
 
-#ifdef ANI_PRODUCT_TYPE_AP
-        case eLIM_PRE_AUTH_CLEANUP_TIMER:
-            if (tx_timer_deactivate(&pMac->lim.limTimers.gLimPreAuthClnupTimer) !=
-                                    TX_SUCCESS)
-            {
-                // Could not deactivate Pre-auth cleanup timer.
-                // Log error
-                limLog(pMac, LOGP,
-                   FL("unable to deactivate Pre-auth cleanup timer\n"));
-            }
-
-            // Change timer to reactivate it in future
-            if (wlan_cfgGetInt(pMac, WNI_CFG_PREAUTH_CLNUP_TIMEOUT,
-                          &val) != eSIR_SUCCESS)
-            {
-                /**
-                 * Could not get pre-auth cleanup value
-                 * from CFG. Log error.
-                 */
-                limLog(pMac, LOGP,
-                   FL("could not retrieve pre-auth cleanup value\n"));
-            }
-            val = SYS_MS_TO_TICKS(val);
-
-            if (tx_timer_change(&pMac->lim.limTimers.gLimPreAuthClnupTimer,
-                                val, val) != TX_SUCCESS)
-            {
-                // Could not change pre-auth cleanup timer.
-                // Log error
-                limLog(pMac, LOGP,
-                   FL("unable to change pre-auth cleanup timer\n"));
-            }
-
-            break;
-
-        case eLIM_LEARN_INTERVAL_TIMER:
-            {
-            // Restart Learn Interval timer
-            tANI_U32 learnInterval =
-              pMac->lim.gpLimMeasReq->measDuration.shortTermPeriod /
-              pMac->lim.gpLimMeasReq->channelList.numChannels;
-
-              if (tx_timer_deactivate(
-                     &pMac->lim.gLimMeasParams.learnIntervalTimer) != TX_SUCCESS)
-              {
-                  // Could not deactivate Learn Interval timer.
-                  // Log error
-                  limLog(pMac, LOGP,
-                         FL("Unable to deactivate Learn Interval timer\n"));
-              }
-
-              if (tx_timer_change(
-                         &pMac->lim.gLimMeasParams.learnIntervalTimer,
-                         SYS_MS_TO_TICKS(learnInterval), 0) != TX_SUCCESS)
-              {
-                  // Could not change Learn Interval timer.
-                  // Log error
-                  limLog(pMac, LOGP, FL("Unable to change Learn Interval timer\n"));
-
-                  return;
-              }
-
-              limLog( pMac, LOG3,
-                  FL("Setting the Learn Interval TIMER to %d ticks\n"),
-                  SYS_MS_TO_TICKS(learnInterval));
-            }
-            break;
-
-#endif
 #if 0
         case eLIM_CHANNEL_SWITCH_TIMER:
             if (tx_timer_deactivate(&pMac->lim.limTimers.gLimChannelSwitchTimer) != eSIR_SUCCESS)
@@ -1642,56 +1547,6 @@
 #endif
 
         case eLIM_LEARN_DURATION_TIMER:
-#ifdef ANI_PRODUCT_TYPE_AP
-            if (tx_timer_deactivate(&pMac->lim.gLimMeasParams.learnDurationTimer) != TX_SUCCESS)
-            {
-                limLog(pMac, LOGP, FL("Could not deactivate learn duration timer\n"));
-                return;
-            }
-
-            if (pMac->lim.gpLimMeasReq->measControl.longChannelScanPeriodicity &&
-                                 (pMac->lim.gLimMeasParams.shortDurationCount ==
-                                  pMac->lim.gpLimMeasReq->measControl.longChannelScanPeriodicity))
-            {
-#ifdef ANI_AP_SDK
-                val = pMac->lim.gLimScanDurationConvert.longChannelScanDuration_tick;
-#else
-                val = SYS_MS_TO_TICKS(pMac->lim.gpLimMeasReq->measDuration.longChannelScanDuration
-                                                                    + SYS_TICK_DUR_MS - 1);
-                if(val > 1)
-                    val--;
-#endif /* ANI_AP_SDK */
-                // Time to perform measurements for longer term
-                if (tx_timer_change(&pMac->lim.gLimMeasParams.learnDurationTimer,
-                                                   val, 0) != TX_SUCCESS)
-                {
-                    // Could not change Learn duration timer.
-                    // Log error
-                    limLog(pMac, LOGP, FL("Unable to change Learn duration timer\n"));
-                    return;
-                }
-                pMac->lim.gLimMeasParams.shortDurationCount = 0;
-            }
-            else
-            {
-#ifdef ANI_AP_SDK
-                val = pMac->lim.gLimScanDurationConvert.shortChannelScanDuration_tick;
-#else
-                val = SYS_MS_TO_TICKS(pMac->lim.gpLimMeasReq->measDuration.shortChannelScanDuration
-                                                               + SYS_TICK_DUR_MS - 1);
-                if(val > 1)
-                    val--;
-#endif /* ANI_AP_SDK */
-                if (tx_timer_change(&pMac->lim.gLimMeasParams.learnDurationTimer,
-                                                       val, 0) != TX_SUCCESS)
-                {
-                    // Could not change Learn duration timer.
-                    // Log error
-                    limLog(pMac, LOGP, FL("Unable to change Learn duration timer\n"));
-                }
-            }
-            pMac->lim.gpLimMeasData->duration = val * SYS_TICK_DUR_MS;
-#endif
             break;
 
 #if 0
@@ -1898,7 +1753,7 @@
         }
         break;
 #endif
-            
+
         default:
             // Invalid timerId. Log error
             break;
@@ -2230,40 +2085,6 @@
         }
             break;
 
-#if (defined(ANI_PRODUCT_TYPE_AP) ||defined(ANI_PRODUCT_TYPE_AP_SDK))
-        case eLIM_LEARN_INTERVAL_TIMER:
-            {
-            // Restart Learn Interval timer
-            tANI_U32 learnInterval =
-                    pMac->lim.gpLimMeasReq->measDuration.shortTermPeriod /
-                    pMac->lim.gpLimMeasReq->channelList.numChannels;
-
-            if (tx_timer_deactivate(
-                   &pMac->lim.gLimMeasParams.learnIntervalTimer) != TX_SUCCESS)
-            {
-                // Could not deactivate Learn Interval timer.
-                // Log error
-                limLog(pMac, LOGP,
-                       FL("Unable to deactivate Learn Interval timer\n"));
-            }
-
-            if (tx_timer_change(
-                       &pMac->lim.gLimMeasParams.learnIntervalTimer,
-                       SYS_MS_TO_TICKS(learnInterval), 0) != TX_SUCCESS)
-            {
-                // Could not change Learn Interval timer.
-                // Log error
-                limLog(pMac, LOGP, FL("Unable to change Learn Interval timer\n"));
-
-                return;
-            }
-
-            limLog( pMac, LOG3,
-                FL("Setting the Learn Interval TIMER to %d ticks\n"),
-                SYS_MS_TO_TICKS(learnInterval) );
-            }
-            break;
-#endif //#if (defined(ANI_PRODUCT_TYPE_AP) ||defined(ANI_PRODUCT_TYPE_AP_SDK))
 
         default:
             // Invalid timerId. Log error
@@ -2533,7 +2354,7 @@
 
     // Prepare and post message to LIM Message Queue
     if(IS_ACTIVEMODE_OFFLOAD_FEATURE_ENABLE)
-    { 
+    {
        msg.type = (tANI_U16) SIR_LIM_HEART_BEAT_TIMEOUT;
        msg.bodyptr = NULL;
        msg.bodyval = 0;
diff --git a/CORE/MAC/src/pe/lim/limTimerUtils.h b/CORE/MAC/src/pe/lim/limTimerUtils.h
index ddbea4f..264c375 100644
--- a/CORE/MAC/src/pe/lim/limTimerUtils.h
+++ b/CORE/MAC/src/pe/lim/limTimerUtils.h
@@ -69,9 +69,6 @@
     eLIM_PRE_AUTH_CLEANUP_TIMER,
     eLIM_HEART_BEAT_TIMER,
     eLIM_BACKGROUND_SCAN_TIMER,
-#ifdef ANI_PRODUCT_TYPE_AP
-    eLIM_LEARN_INTERVAL_TIMER,
-#endif
     eLIM_KEEPALIVE_TIMER,
     eLIM_CNF_WAIT_TIMER,
     eLIM_AUTH_RSP_TIMER,
diff --git a/CORE/MAC/src/pe/lim/limTrace.c b/CORE/MAC/src/pe/lim/limTrace.c
index 35157cd..f0f31fd 100644
--- a/CORE/MAC/src/pe/lim/limTrace.c
+++ b/CORE/MAC/src/pe/lim/limTrace.c
@@ -85,9 +85,6 @@
         CASE_RETURN_STRING(eLIM_PRE_AUTH_CLEANUP_TIMER);
         CASE_RETURN_STRING(eLIM_HEART_BEAT_TIMER);
         CASE_RETURN_STRING(eLIM_BACKGROUND_SCAN_TIMER);
-#ifdef ANI_PRODUCT_TYPE_AP
-        CASE_RETURN_STRING(eLIM_LEARN_INTERVAL_TIMER);
-#endif
         CASE_RETURN_STRING(eLIM_KEEPALIVE_TIMER);
         CASE_RETURN_STRING(eLIM_CNF_WAIT_TIMER);
         CASE_RETURN_STRING(eLIM_AUTH_RSP_TIMER);
diff --git a/CORE/MAC/src/pe/lim/limTypes.h b/CORE/MAC/src/pe/lim/limTypes.h
index 65d3b49..034b11d 100644
--- a/CORE/MAC/src/pe/lim/limTypes.h
+++ b/CORE/MAC/src/pe/lim/limTypes.h
@@ -268,17 +268,6 @@
 
     tAniBool               WmmStaInfoPresent;
 
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED) 
-    tANI_U16                  seqNum;
-    tAniBool             wniIndicator;
-    tAniBool             bpIndicator;
-    tSirBpIndicatorType  bpType;
-    tSirNwType           nwType;
-    tSirAssocType        assocType; // Indicates whether STA is LB'ed or not
-    tSirLoad             load; // Current load on the radio for LB
-    tANI_U32                  numBss; // List received from STA
-    tSirNeighborBssInfo  neighborList[1]; // List received from STA
-#endif
     // Required for indicating the frames to upper layer
     tANI_U32             beaconLength;
     tANI_U8*             beaconPtr;
@@ -318,17 +307,6 @@
 
     tAniBool               WmmStaInfoPresent;
 
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED) 
-    tANI_U16                  seqNum;
-    tAniBool             wniIndicator;
-    tAniBool             bpIndicator;
-    tSirBpIndicatorType  bpType;
-    tSirNwType           nwType;
-    tSirAssocType        reassocType; // Indicates whether STA is LB'ed or not
-    tSirLoad             load; // Current load on the radio for LB
-    tANI_U32                  numBss; // List received from STA
-    tSirNeighborBssInfo  neighborList[1]; // List received from STA
-#endif
     // Required for indicating the frames to upper layer
     tANI_U32             beaconLength;
     tANI_U8*             beaconPtr;
@@ -477,9 +455,6 @@
 {
     tSirMacAddr    peerMacAddr;
     tANI_U8       sessionId;
-#ifdef ANI_PRODUCT_TYPE_AP
-    tANI_U16             aid;
-#endif
 } tLimMlmLinkTestStopReq, *tpLimMlmLinkTestStopReq;
 
 
@@ -722,9 +697,6 @@
 void limSendAddtsRspActionFrame(tpAniSirGlobal pMac, tSirMacAddr peerMacAddr,
                            tANI_U16 statusCode, tSirAddtsReqInfo *addts, tSirMacScheduleIE *pSchedule,tpPESession);
 
-#ifdef ANI_PRODUCT_TYPE_AP
-void limSendAssocRspMgmtFrame(tpAniSirGlobal, tANI_U16, tANI_U16, tSirMacAddr, tANI_U8, tpDphHashNode pSta,tpPESession);
-#endif
 void limSendAssocRspMgmtFrame(tpAniSirGlobal, tANI_U16, tANI_U16, tSirMacAddr, tANI_U8, tpDphHashNode pSta,tpPESession);
 
 void limSendNullDataFrame(tpAniSirGlobal, tpDphHashNode);
@@ -734,9 +706,7 @@
 void limContinueChannelScan(tpAniSirGlobal);
 tSirResultCodes limMlmAddBss(tpAniSirGlobal, tLimMlmStartReq *,tpPESession psessionEntry);
 
-#if 1 //(WNI_POLARIS_FW_PACKAGE == ADVANCED) && defined(ANI_PRODUCT_TYPE_AP)
 tSirRetStatus limSendChannelSwitchMgmtFrame(tpAniSirGlobal, tSirMacAddr, tANI_U8, tANI_U8, tANI_U8, tpPESession);
-#endif
 
 #ifdef WLAN_FEATURE_11AC
 tSirRetStatus limSendVHTOpmodeNotificationFrame(tpAniSirGlobal pMac,tSirMacAddr peer,tANI_U8 nMode, tpPESession  psessionEntry );
@@ -795,19 +765,6 @@
 /// Function that triggers link tear down with AP upon HB failure
 void limTearDownLinkWithAp(tpAniSirGlobal,tANI_U8, tSirMacReasonCodes);
 
-#ifdef ANI_PRODUCT_TYPE_AP
-/// Function that performs periodic release of AIDs
-void limReleaseAIDHandler(tpAniSirGlobal);
-
-/// Function that performs periodic cleanup of Pre-auth contexts
-void limPreAuthClnupHandler(tpAniSirGlobal);
-
-/// Function that processes CF-poll response message from SCH
-void limHandleCFpollRsp(tANI_U32);
-
-/// Function that processes PS-poll message from PMM
-void limHandlePSpoll(tANI_U32);
-#endif
 
 /// Function that sends keep alive message to peer(s)
 void limSendKeepAliveToPeer(tpAniSirGlobal);
diff --git a/CORE/MAC/src/pe/lim/limUtils.c b/CORE/MAC/src/pe/lim/limUtils.c
index 23971c6..5e4d8cb 100644
--- a/CORE/MAC/src/pe/lim/limUtils.c
+++ b/CORE/MAC/src/pe/lim/limUtils.c
@@ -1019,11 +1019,9 @@
         tx_timer_deactivate(&pMac->lim.limTimers.gLimQuietBssTimer);
         tx_timer_delete(&pMac->lim.limTimers.gLimQuietBssTimer);
 
-#if defined(ANI_PRODUCT_TYPE_CLIENT) || defined(ANI_AP_CLIENT_SDK)
         // Deactivate and delete LIM background scan timer.
         tx_timer_deactivate(&pMac->lim.limTimers.gLimBackgroundScanTimer);
         tx_timer_delete(&pMac->lim.limTimers.gLimBackgroundScanTimer);
-#endif
 
 
         // Deactivate and delete cnf wait timer
@@ -1049,22 +1047,6 @@
             tx_timer_delete(&pAuthNode->timer);
         }
 
-#ifdef ANI_PRODUCT_TYPE_AP
-
-        if (pMac->lim.gLimSystemRole == eLIM_AP_ROLE)
-        {
-            // Deactivate and cleanup the periodic pre-auth
-            // cleanup timer
-
-            tx_timer_deactivate(&pMac->lim.limTimers.gLimPreAuthClnupTimer);
-            tx_timer_delete(&pMac->lim.limTimers.gLimPreAuthClnupTimer);
-
-            /// Deactivate and delete OLBC cache update timeout
-            tx_timer_deactivate(&pMac->lim.limTimers.gLimUpdateOlbcCacheTimer);
-            tx_timer_delete(&pMac->lim.limTimers.gLimUpdateOlbcCacheTimer);
-
-        }
-#endif
 
 
         // Deactivate and delete Hash Miss throttle timer
@@ -1150,10 +1132,6 @@
 void
 limCleanupLmm(tpAniSirGlobal pMac)
 {
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED) && defined (ANI_PRODUCT_TYPE_AP)
-    limCleanupMeasResources(pMac);
-    pMac->sys.gSysEnableLearnMode = eANI_BOOLEAN_FALSE;
-#endif
 } /*** end limCleanupLmm() ***/
 
 
@@ -2267,98 +2245,6 @@
     }
 }
 
-#if (WNI_POLARIS_FW_PACKAGE == ADVANCED) && defined (ANI_PRODUCT_TYPE_AP)
-/**
- * limDetectRadar()
- *
- *FUNCTION:
- * This function is invoked when LIM receives
- * SIR_LIM_RADAR_DETECT_IND in lim mesage queue.
- * LIM will notify WSM of this event by sending
- * WSM the wireless medium status change
- * notification message.
- *
- *
- *LOGIC:
- *
- *ASSUMPTIONS:
- * NA
- *
- *NOTE:
- * NA
- *
- * @param  pMac           - Pointer to Global MAC structure
- * @param  message        - a tSirRadarInfo struct type message send by HAL.
- *                          This message is not serialized.
- *
- * @return None
- */
-
-void
-limDetectRadar(tpAniSirGlobal pMac, tANI_U32 *pMsg)
-{
-    tpSirRadarInfo      pRadarInfo;
-
-    if (!pMsg)
-    {
-        limLog(pMac, LOGP, FL("Message is NULL\n"));
-        return;
-    }
-
-    pRadarInfo = (tpSirRadarInfo)pMsg;
-
-    if ((pMac->lim.gLimCurrentChannelId == pRadarInfo->channelNumber) &&
-                          (pMac->lim.gLimSystemRole != eLIM_UNKNOWN_ROLE))
-    {
-        LIM_SET_RADAR_DETECTED(pMac, eANI_BOOLEAN_TRUE);
-        limStopMeasTimers(pMac);
-        /* Stop the transmission of all packets except beacons.
-         * This is done here, assuming that we will definitely get a channel switch 
-         * request from WSM.
-         */
-        PELOG1(limLog(pMac, LOG1, "Stopping the transmission on AP\n");)
-        limFrameTransmissionControl(pMac, eLIM_TX_BSS_BUT_BEACON, eLIM_STOP_TX);
-    }
-
-   PELOG1(limLog(pMac, LOG1,
-        FL("limDetectRadar():: pulsewidth = %d, numPulse=%d, channelId=%d\n"),
-        pRadarInfo->radarPulseWidth, pRadarInfo->numRadarPulse,
-        pRadarInfo->channelNumber);)
-
-    limSendSmeWmStatusChangeNtf(pMac,
-                                eSIR_SME_RADAR_DETECTED,
-                                pMsg,
-                                (tANI_U16)sizeof(*pRadarInfo),0);
-    
-}
-#endif
-
-# if 0
-//TBD_RAJESH :: TO SOLVE LINKING ISSUE
-void
-limUpdateShortSlotTime(tpAniSirGlobal pMac, tSirMacAddr peerMacAddr, //dummy to avoid linking problem
-    tpUpdateBeaconParams pBeaconParams)
-{
-
-}
-
-//TBD_RAJESH :: TO SOLVE LINKING ISSUE
-void
-limUpdateShortPreamble(tpAniSirGlobal pMac, tSirMacAddr peerMacAddr,    //dummy to avoid linking problem
-    tpUpdateBeaconParams pBeaconParams)
-    
-{
-}
-
-//TBD_RAJESH :: TO SOLVE LINKING ISSUE
-
-void   //dummy to avoid linking problem
-limDecideApProtection(tpAniSirGlobal pMac, tSirMacAddr peerMacAddr, tpUpdateBeaconParams pBeaconParams,tpPESession psessionEntry)
-{
-}
-
-#endif
-
 
 /** -------------------------------------------------------------
 \fn limDecideStaProtectionOnAssoc
@@ -2653,7 +2539,6 @@
 void limProcessChannelSwitchTimeout(tpAniSirGlobal pMac)
 {
     tpPESession psessionEntry = NULL;
-#if defined(ANI_PRODUCT_TYPE_CLIENT) || defined(ANI_AP_CLIENT_SDK)
     tANI_U8    channel; // This is received and stored from channelSwitch Action frame
    
     if((psessionEntry = peFindSessionBySessionId(pMac, pMac->lim.limTimers.gLimChannelSwitchTimer.sessionId))== NULL) 
@@ -2740,7 +2625,6 @@
             }
             return;  /* Please note, this is 'return' and not 'break' */
     }
-#endif
 }
 
 /**
@@ -2880,7 +2764,6 @@
  */
 void limCancelDot11hChannelSwitch(tpAniSirGlobal pMac, tpPESession psessionEntry)
 {
-#if defined(ANI_PRODUCT_TYPE_CLIENT) || defined(ANI_AP_CLIENT_SDK)
     if (psessionEntry->limSystemRole != eLIM_STA_ROLE)
         return;
         
@@ -2898,7 +2781,6 @@
         PELOGE(limLog(pMac, LOGE, FL("LIM: Could not restore pre-channelSwitch (11h) state, resetting the system\n"));)
                 
     }
-#endif
 }
 
 /**----------------------------------------------
@@ -2911,7 +2793,6 @@
 -----------------------------------------------*/
 void limCancelDot11hQuiet(tpAniSirGlobal pMac, tpPESession psessionEntry)
 {
-#if defined(ANI_PRODUCT_TYPE_CLIENT) || defined(ANI_AP_CLIENT_SDK)
     if (psessionEntry->limSystemRole != eLIM_STA_ROLE)
         return;
 
@@ -2942,7 +2823,6 @@
         }
     }
     psessionEntry->gLimSpecMgmt.quietState = eLIM_QUIET_INIT;
-#endif
 }
 
 /**
@@ -3110,28 +2990,6 @@
   PELOG1(limLog(pMac, LOG1, FL("quietState = %d\n"), psessionEntry->gLimSpecMgmt.quietState);)
   if (eLIM_AP_ROLE == psessionEntry->limSystemRole)
   {
-#ifdef ANI_PRODUCT_TYPE_AP
-    if (!pMac->sys.gSysEnableLearnMode)
-    {
-        psessionEntry->gLimSpecMgmt.quietState = eLIM_QUIET_END;
-        return;
-    }
-
-    if( eLIM_QUIET_INIT == psessionEntry->gLimSpecMgmt.quietState )
-    {
-        //QuietCount = 0 is reserved
-        psessionEntry->gLimSpecMgmt.quietCount  = 2;
-        // In ms.
-        psessionEntry->gLimSpecMgmt.quietDuration = 
-        pMac->lim.gpLimMeasReq->measDuration.shortChannelScanDuration;
-        // TU is in multiples of 1024 (2^10) us.
-        psessionEntry->gLimSpecMgmt.quietDuration_TU = 
-            SYS_MS_TO_TU(psessionEntry->gLimSpecMgmt.quietDuration); 
-        // Transition to eLIM_QUIET_BEGIN
-        limLog( pMac, LOG2, FL("Quiet BSS state = eLIM_QUIET_BEGIN\n"));
-        psessionEntry->gLimSpecMgmt.quietState = eLIM_QUIET_BEGIN;
-    }
-#endif
   }
   else
   {
@@ -3247,7 +3105,6 @@
         return;
     }
 
-#if defined(ANI_PRODUCT_TYPE_CLIENT) || defined(ANI_AP_CLIENT_SDK)
 
     if (psessionEntry->limSystemRole != eLIM_STA_ROLE)
         return;
@@ -3279,50 +3136,8 @@
         psessionEntry->gLimSpecMgmt.quietState = eLIM_QUIET_INIT;
         return;
     }
-#endif
 }
 
-#ifdef ANI_PRODUCT_TYPE_AP
-
-/**
- * computeChannelSwitchCount
- *
- * FUNCTION:
- *     Function used by limProcessSmeSwitchChlReq()
- *     to compute channel switch count.
- *
- * LOGIC:
- *    Channel Switch Count is the number of TBTT until AP switches
- *    to a new channel.  The value of Channel Switch Count is computed
- *    in a way, such that channel switch will always take place after
- *    a DTIM.  By doing so, it is guaranteed that station in power save
- *    mode can receive the message and switch to new channel accordingly.
- *    AP can also announce the channel switch several dtims ahead of time.
- *    by setting the dtimFactor value greater than 1.
- *
- * ASSUMPTIONS:
- *
- * NOTE:
- *
- * @param   dtimFactor
- * @return  channel switch count
- */
-tANI_U32 computeChannelSwitchCount(tpAniSirGlobal pMac, tANI_U32 dtimFactor)
-{
-    tANI_U32 dtimPeriod;
-    tANI_U32 dtimCount;
-
-    if (wlan_cfgGetInt(pMac, WNI_CFG_DTIM_PERIOD, &dtimPeriod) != eSIR_SUCCESS)
-        PELOGE(limLog(pMac, LOGE, FL("wlan_cfgGetInt failed for WNI_CFG_DTIM_PERIOD \n"));)
-
-    dtimCount = pMac->pmm.gPmmTim.dtimCount;
-
-    if (dtimFactor <= 1)
-        return (dtimCount + 1);
-    else
-        return (((dtimFactor -1)*dtimPeriod) + 1 + dtimCount);
-}
-#endif
 
 /** ------------------------------------------------------------------------ **/
 /**
@@ -3631,7 +3446,6 @@
 tAniBool limTriggerBackgroundScanDuringQuietBss( tpAniSirGlobal pMac )
 {
     tAniBool bScanTriggered = eSIR_FALSE;
-#if defined(ANI_PRODUCT_TYPE_CLIENT) || defined(ANI_AP_CLIENT_SDK)
 
     
 
@@ -3678,7 +3492,6 @@
           FL("Unable to retrieve WNI_CFG_VALID_CHANNEL_LIST from CFG! A background scan will not be triggered during this Quiet BSS period...\n"));
     }
   }
-#endif
   return bScanTriggered;
 }
 
@@ -3942,14 +3755,6 @@
         //overlapping protection configuration check.
         if(overlap)
         {
-#if (defined(ANI_PRODUCT_TYPE_AP) || defined(ANI_PRODUCT_TYPE_AP_SDK))
-        if(psessionEntry->limSystemRole == eLIM_AP_ROLE && !pMac->lim.cfgProtection.overlapFromlla)
-            {
-                // protection disabled.
-            PELOG3(limLog(pMac, LOG3, FL("overlap protection from 11a is disabled\n"));)
-                return eSIR_SUCCESS;
-            }
-#endif
         }
         else
         {
@@ -4109,14 +3914,6 @@
     //overlapping protection configuration check.
     if(overlap)
     {
-#if (defined(ANI_PRODUCT_TYPE_AP) || defined(ANI_PRODUCT_TYPE_AP_SDK))
-        if(((psessionEntry->limSystemRole == eLIM_AP_ROLE) ||(psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE ))  && !pMac->lim.cfgProtection.overlapFromllb)
-        {
-            // protection disabled.
-            PELOG1(limLog(pMac, LOG1, FL("overlap protection from 11b is disabled\n"));)
-            return eSIR_SUCCESS;
-        }
-#endif
     }
     else
     {
@@ -4679,14 +4476,6 @@
     if(overlap)
     {
         //overlapping protection configuration check.
-    #if (defined(ANI_PRODUCT_TYPE_AP) || defined(ANI_PRODUCT_TYPE_AP_SDK))
-        if((psessionEntry->limSystemRole == eLIM_AP_ROLE)||(psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE)) && !pMac->lim.cfgProtection.overlapOBSS) 
-        { // ToDo Update this field
-            // protection disabled.
-            PELOG1(limLog(pMac, LOG1, FL("overlap protection from Obss is disabled\n"));)
-            return eSIR_SUCCESS;
-        }
-    #endif
     } 
     else 
     {
@@ -4766,14 +4555,6 @@
         //overlapping protection configuration check.
         if(overlap)
         {
-#if (defined(ANI_PRODUCT_TYPE_AP) || defined(ANI_PRODUCT_TYPE_AP_SDK))
-        if(((psessionEntry->limSystemRole == eLIM_AP_ROLE )||(psessionEntry->limSystemRoleS == eLIM_BT_AMP_AP_ROLE ))&& !pMac->lim.cfgProtection.overlapHt20)
-            {
-                // protection disabled.
-            PELOG3(limLog(pMac, LOG3, FL("overlap protection from HT 20 is disabled\n"));)
-                return eSIR_SUCCESS;
-            }
-#endif
         }
         else
         {
@@ -4984,14 +4765,6 @@
         //overlapping protection configuration check.
         if(overlap)
         {
-#if (defined(ANI_PRODUCT_TYPE_AP) || defined(ANI_PRODUCT_TYPE_AP_SDK))
-        if(((psessionEntry->limSystemRole == eLIM_AP_ROLE)||(psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE)) && !pMac->lim.cfgProtection.overlapNonGf)
-            {
-                // protection disabled.
-            PELOG3(limLog(pMac, LOG3, FL("overlap protection from NonGf is disabled\n"));)
-                return eSIR_SUCCESS;
-            }
-#endif
         }
         else
         {
@@ -5063,14 +4836,6 @@
         //overlapping protection configuration check.
         if(overlap)
         {
-#if (defined(ANI_PRODUCT_TYPE_AP) || defined(ANI_PRODUCT_TYPE_AP_SDK))
-        if(((psessionEntry->limSystemRole == eLIM_AP_ROLE)||(psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE)) && !pMac->lim.cfgProtection.overlapLsigTxop)
-            {
-                // protection disabled.
-                PELOG3(limLog(pMac, LOG3, FL(" overlap protection from LsigTxop not supported is disabled\n"));)
-                return eSIR_SUCCESS;
-            }
-#endif
         }
         else
         {
@@ -5145,14 +4910,6 @@
         //overlapping protection configuration check.
         if(overlap)
         {
-#if (defined(ANI_PRODUCT_TYPE_AP) || defined(ANI_PRODUCT_TYPE_AP_SDK))
-        if(((psessionEntry->limSystemRole == eLIM_AP_ROLE) ||(psessionEntry == eLIM_BT_AMP_AP_ROLE))&& !pMac->lim.cfgProtection.overlapRifs)
-            {
-                // protection disabled.
-            PELOG3(limLog(pMac, LOG3, FL(" overlap protection from Rifs is disabled\n"));)
-                return eSIR_SUCCESS;
-            }
-#endif
         }
         else
         {
@@ -5684,18 +5441,6 @@
            tsinfo->traffic.tsid, tsinfo->traffic.userPrio, tsinfo->traffic.direction);)
 
        // if no Access Control, ignore the request
-#if (defined(ANI_PRODUCT_TYPE_AP) || defined(ANI_PRODUCT_TYPE_AP_SDK))
-       if ((tsinfo->traffic.accessPolicy == SIR_MAC_ACCESSPOLICY_EDCA))
-           if (((psessionEntry->limSystemRole == eLIM_AP_ROLE) || (psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE))&& 
-                       (! psessionEntry->gLimEdcaParamsBC[upToAc(tsinfo->traffic.userPrio)].aci.acm))
-                   || (((psessionEntry->limSystemRole != eLIM_AP_ROLE) ||(psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE)) && 
-                       (! psessionEntry->gLimEdcaParams[upToAc(tsinfo->traffic.userPrio)].aci.acm)))
-       {
-           limLog(pMac, LOGW, FL("DelTs with acecssPolicy = %d and UP %d , AC = %d has no AC - ignoring request\n"),
-                  tsinfo->traffic.accessPolicy, tsinfo->traffic.userPrio, upToAc(tsinfo->traffic.userPrio));
-           return eSIR_FAILURE;
-       }
-#endif
 
     if (limAdmitControlDeleteTS(pMac, pSta->assocId, tsinfo, &tsStatus, &tspecIdx)
         != eSIR_SUCCESS)
@@ -6848,7 +6593,6 @@
 {
 
     tSirRetStatus retCode = eSIR_SUCCESS;
-#if defined(ANI_PRODUCT_TYPE_CLIENT) || defined(ANI_AP_CLIENT_SDK)
     tANI_U32      val = 0;
 
     if (psessionEntry->limSystemRole != eLIM_STA_ROLE)
@@ -6897,7 +6641,6 @@
             return (eSIR_FAILURE);
         }
     }
-#endif
     return (retCode);
 }
 
@@ -6913,7 +6656,6 @@
 {
 
     tSirRetStatus retCode = eSIR_SUCCESS;
-#if defined(ANI_PRODUCT_TYPE_CLIENT) || defined(ANI_AP_CLIENT_SDK)
     tANI_U32      val = 0;
  
     if (pMac->lim.gLimSystemRole != eLIM_STA_ROLE)
@@ -6961,7 +6703,6 @@
             return (eSIR_FAILURE);
         }
     }
-#endif    
     return (retCode);
 }
 
@@ -6988,7 +6729,6 @@
 void 
 limPrepareFor11hChannelSwitch(tpAniSirGlobal pMac, tpPESession psessionEntry)
 {
-#if defined(ANI_PRODUCT_TYPE_CLIENT) || defined(ANI_AP_CLIENT_SDK)
     if (psessionEntry->limSystemRole != eLIM_STA_ROLE)
         return;
      
@@ -7025,7 +6765,6 @@
         /** We are safe to switch channel at this point */
         limStopTxAndSwitchChannel(pMac, psessionEntry->peSessionId);
     }
-#endif
 }
 
 
diff --git a/CORE/MAC/src/pe/lim/limUtils.h b/CORE/MAC/src/pe/lim/limUtils.h
index cc79eac..cb4b220 100644
--- a/CORE/MAC/src/pe/lim/limUtils.h
+++ b/CORE/MAC/src/pe/lim/limUtils.h
@@ -141,10 +141,6 @@
  */
 void    limReleasePeerIdx(tpAniSirGlobal, tANI_U16, tpPESession);
 
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-// LIM informs WSM that radar is detected
-void limDetectRadar(tpAniSirGlobal, tANI_U32 *);
-#endif
 
 void limDecideApProtection(tpAniSirGlobal pMac, tSirMacAddr peerMacAddr,  tpUpdateBeaconParams pBeaconParams,tpPESession);
 void
@@ -185,9 +181,6 @@
 void limProcessAddtsRspTimeout(tpAniSirGlobal pMac, tANI_U32 param);
 
 // 11h Support
-#ifdef ANI_PRODUCT_TYPE_AP
-tANI_U32 computeChannelSwitchCount(tpAniSirGlobal, tANI_U32);
-#endif
 void limStopTxAndSwitchChannel(tpAniSirGlobal pMac, tANI_U8 sessionId);
 void limProcessChannelSwitchTimeout(tpAniSirGlobal);
 tSirRetStatus limStartChannelSwitch(tpAniSirGlobal pMac, tpPESession psessionEntry);
diff --git a/CORE/MAC/src/pe/pmm/pmmAP.c b/CORE/MAC/src/pe/pmm/pmmAP.c
index 3af455b..a5c636d 100644
--- a/CORE/MAC/src/pe/pmm/pmmAP.c
+++ b/CORE/MAC/src/pe/pmm/pmmAP.c
@@ -59,174 +59,11 @@
 #include "schApi.h"
 #include "limApi.h"
 #include "cfgApi.h"
-#include "wniCfgAp.h"
+#include "wniCfgSta.h"
 
 #include "pmmApi.h"
 #include "pmmDebug.h"
 
-#define PMM_TIM_BITS_LIMIT        10
-#define PMM_CF_POLLABLE_SCH_LIMIT 100
-
-// sets how many beacons are skipped after a ps-poll before rxactivityset
-// processing for that sta starts again
-#define PMM_PSPOLL_PERSISTENCE    2
-
-#if (WNI_POLARIS_FW_PRODUCT==AP)
-// --------------------------------------------------------------------
-/**
- *  @function: __isTimChanged
- *
- *  @brief : Compares and returns TRUE if the TIM BitMap needs change
- *
- * LOGIC:
- *
- * ASSUMPTIONS:
- *
- * NOTE:
- *
- * @param pMac      AniSirGlobal 
- * @param newTim    Newly created Tim Data's
- * @param prevTim    Current Tim Data's
- * @return eANI_BOOLEAN     eANI_BOOLEAN_TRUE - If there is change in Tim Data's
- *                                      eANI_BOOLEAN_FALSE - If there is no need to change in Tim
- */
-
-static tANI_BOOLEAN 
-__isTimChanged(tpAniSirGlobal pMac, tpPmmTim pNewTim, tpPmmTim pPrevTim)
-{
-    if ( pNewTim->dtimCount != pPrevTim->dtimCount ||
-         pNewTim->maxAssocId != pPrevTim->maxAssocId ||
-         pNewTim->minAssocId != pPrevTim->minAssocId ||
-         pNewTim->numStaWithData != pPrevTim->numStaWithData)         
-        return eANI_BOOLEAN_TRUE;
-    
-    if (!palEqualMemory(pMac->hHdd, pNewTim->pTim, pPrevTim->pTim, sizeof(*pPrevTim->pTim) * pMac->lim.maxStation))
-        return eANI_BOOLEAN_TRUE;
- 
-    return eANI_BOOLEAN_FALSE;
-}
-
-/**
- *  @function: __updatePmmGlobal
- *
- *  @brief : Updates the PMM Global Structure
- *
- * LOGIC:
- *
- * ASSUMPTIONS:
- *
- * NOTE:
- *
- * @param pMac      AniSirGlobal 
- * @param newHdr    Header Details to be updated in Pmm globalHeader
- * @param globalHdr  global Header
- * @return None
- */
-static /*inline */
-void    __updatePmmGlobal( tpAniSirGlobal pMac, tpPmmTim pNewTim)
-{
-    tpPmmTim    pGlobalTim = &pMac->pmm.gPmmTim;
-    palCopyMemory(pMac->hHdd, pGlobalTim->pTim,  pNewTim->pTim,
-                                                        sizeof(*pNewTim->pTim) * pMac->lim.maxStation);
-
-    pGlobalTim->dtimCount = pNewTim->dtimCount;
-    pGlobalTim->maxAssocId = pNewTim->maxAssocId;
-    pGlobalTim->minAssocId = pNewTim->minAssocId;
-    pGlobalTim->numStaWithData = pNewTim->numStaWithData;    
-}
-
-
-void pmmUpdatePSPollState(tpAniSirGlobal pMac)
-{
-    tANI_U16 psFlag = 0;
-    tANI_U32 sta;
-
-    // if there are no stations which performed a ps-poll update, we are done
-    if (pMac->pmm.gPmmPsPollUpdate == 0)
-        return;
-
-    /*
-     * for all stations which had a state udpate due to a ps-poll, we check
-     * if it is time to update their state from hardware. This is tracked with
-     * per sta psPollUpdate counter which is initialized during ps-poll
-     * processing.
-     * if no stations need any further ps-poll processing, clear the global flag
-     * so that we don't have to keep going thru the stations at every beacon
-     */
-    for (sta = 1; sta < pMac->lim.maxStation; sta++)
-    {
-        tANI_U8 ps = 0;
-
-        if (pMac->pmm.gpPmmStaState[sta].psPollUpdate == 0)
-            continue;
-
-        if (pMac->pmm.gpPmmStaState[sta].psPollUpdate == 1)
-        {
-            pmmUpdatePMMode(pMac, sta, ps);
-        }
-        pMac->pmm.gpPmmStaState[sta].psPollUpdate--;
-        psFlag++;
-        PELOG4(pmmLog(pMac, LOG4, FL("UpdatePSPollState: sta %d, state %d (count %d)\n"), sta, ps, pMac->pmm.gpPmmStaState[sta].psPollUpdate););
-    }
-
-    if (psFlag == 0)
-        pMac->pmm.gPmmPsPollUpdate = 0;
-    PELOG3(pmmLog(pMac, LOG3, FL("UpdatePSPollState: %d ps-poll flagged sta's\n"), psFlag);)
-}
-
-/**
- * @function : pmmHandleTimBasedDisassociation
- * 
- * @brief :  Handle TIM based Disassoc for STA's in PS
- *
- * LOGIC:
- * Checks whether the AP has sent TIM enough
- * number of times for the station and if STA in PS didn't collect the buffered pckts,
- * disconnect the station
- *
- * NOTE:
- * @param : pMac - tpAniSirGlobal
- * @return : none
- **/
- 
-void pmmHandleTimBasedDisassociation (tpAniSirGlobal pMac, tpPESession psessionEntry)
-{
-    tpPmmStaInfo pmmStaInfo = pMac->pmm.gPmmTim.pStaInfo;
-    tANI_U32    staCnt;
-    tANI_U32    staWithData = pMac->pmm.gPmmTim.numStaWithData;
-    
-
-    /** Traverse through all the assocId's in PS */
-    for (staCnt = 0; staCnt < pMac->pmm.gPmmNumSta; staCnt++) {
-        tpDphHashNode pSta = dphGetHashEntry(pMac, pmmStaInfo[staCnt].assocId);
-
-        if ((pSta == NULL) ||(!pSta->valid )) {
-            pmmLog(pMac, LOGE, FL("Invalid ASSOCID / associd points to notvalid STA assocId [%d] NumSta [%d]\n"),pmmStaInfo[staCnt].assocId, 
-                pMac->pmm.gPmmNumSta );
-            continue;
-        }
-        
-        if (staCnt >= staWithData) /** If the AP doesn't have any data buffered for this STA*/
-            pSta->timWaitCount = GET_TIM_WAIT_COUNT(pSta->mlmStaContext.listenInterval);   /** Reset the timWaitCount*/
-        else {  /** AP has got some data buffered for this STA*/
-            if (pSta->curTxMpduCnt == pmmStaInfo[staCnt].staTxAckCnt) {
-                /** If we have sent enough number of TIM's to the STA trigger DisAssoc*/
-                if ( !(--pSta->timWaitCount)) { 
-                    PELOGE(pmmLog(pMac, LOGE, FL(" STA with AID %d did not respond to TIM, deleting..."),pmmStaInfo[staCnt].assocId);)
-                    limTriggerSTAdeletion(pMac, pSta, psessionEntry);
-                    continue;
-                }
-            }else /** if the STA in PS came up and got some data*/
-                pSta->timWaitCount = GET_TIM_WAIT_COUNT(pSta->mlmStaContext.listenInterval);  /** Reset the timWaitCount*/
-        }
-        pSta->curTxMpduCnt = pmmStaInfo[staCnt].staTxAckCnt;
-    }
-
-    return;
- }
-
-#endif
-
 /**
  * pmmGenerateTIM
  *
@@ -272,426 +109,9 @@
     *ptr++ = 0xFF; // location for dtimCount. will be filled in by FW.
     *ptr++ = (tANI_U8)val;
 
-    *ptr++ = 0xFF; // location for bitmap contorl. will be filled in by FW.
+    *ptr++ = 0xFF; // location for bitmap control. will be filled in by FW.
     ptr += (N2 - N1 + 1);
 
     PELOG2(sirDumpBuf(pMac, SIR_PMM_MODULE_ID, LOG2, *pPtr, (*timLength)+2);)
     *pPtr = ptr;
 }
-
-#ifdef ANI_PRODUCT_TYPE_AP
-/**
- * pmmUpdateTIM
- *
- * FUNCTION: This function creates TIM information and saves it under PMM context.
- * This TIM bit information is used to generated beacons later on.
- *
- * LOGIC:
- *
- * ASSUMPTIONS:
- *
- * NOTE:
- *
- * @param pMac pointer to global mac structure
- * @param pBeaconGenParams pointer to structure which has power save information returned by HAL.
- * @return None
- */
-
-void pmmUpdateTIM(tpAniSirGlobal pMac, tpBeaconGenParams pBeaconGenParams)
-{
-    tANI_U16 i;
-    tANI_U16 assocId;
-    tPmmTim curTim;
-    tPmmTim *pPmmTim = &pMac->pmm.gPmmTim;
-    tANI_U16 totalSta;
-    tpBeaconGenStaInfo pStaInfo;
-
-    totalSta = pBeaconGenParams->numOfSta + pBeaconGenParams->numOfStaWithoutData;
-
-    if(totalSta > pMac->lim.maxStation)
-    {
-        PELOGE(pmmLog(pMac, LOGE, FL("Error in TIM Update: Total STA count %d exceeds the MAX Allowed %d \n"), totalSta, pMac->lim.maxStation);)
-        return;
-    }
-    palZeroMemory(pMac->hHdd, &curTim,  sizeof(curTim));
-    palZeroMemory(pMac->hHdd, pMac->pmm.gpPmmPSState, 
-        sizeof(*pMac->pmm.gpPmmPSState) * pMac->lim.maxStation);
-
-    if( eHAL_STATUS_SUCCESS != palAllocateMemory( pMac->hHdd,
-                  (void **) &curTim.pTim, sizeof(tANI_U8)*pMac->lim.maxStation))
-    {
-        pmmLog( pMac, LOGE, FL( "Unable to PAL allocate memory\n" ));
-        return;                 
-    }
-    palZeroMemory(pMac->hHdd, curTim.pTim, sizeof(tANI_U8) * pMac->lim.maxStation);
-    pPmmTim->numStaWithData = curTim.numStaWithData = pBeaconGenParams->numOfSta;
-    pMac->pmm.gPmmNumSta = totalSta;
-    curTim.minAssocId= pMac->lim.maxStation - 1;
-    curTim.maxAssocId= 0;
-    curTim.dtimCount = pBeaconGenParams->dtimCount;
-    pStaInfo = (tpBeaconGenStaInfo)((tANI_U8 *)pBeaconGenParams + sizeof(*pBeaconGenParams));
-
-    if (totalSta > 0) 
-        palCopyMemory(pMac->hHdd, pPmmTim->pStaInfo, pStaInfo, 
-                                                                sizeof(*pPmmTim->pStaInfo) * totalSta);
-    
-    for(i=0; i<totalSta; i++)
-    {
-        assocId = pStaInfo[i].assocId;      
-        if(assocId < pMac->lim.maxStation)
-        {
-            //Update TIM for power save stations which have data pending.
-            if(i<pBeaconGenParams->numOfSta)
-            {
-                PELOG2(pmmLog(pMac, LOG2, FL("Setting TIM for assocId: %d\n"), assocId);)
-                curTim.pTim[assocId] = 1;
-                if (assocId < curTim.minAssocId)
-                    curTim.minAssocId= assocId;
-                if (assocId > curTim.maxAssocId)
-                    curTim.maxAssocId= assocId;
-            }
-            pMac->pmm.gpPmmPSState[assocId] = 1;
-                    
-        }    
-    }
-
-    if (!curTim.maxAssocId)
-        curTim.minAssocId = 0;
-
-    if(pBeaconGenParams->fBroadcastTrafficPending)
-        curTim.pTim[0] = 1;
-
-    //Now check if TIM contents have changed from the last beacon.
-    if (!__isTimChanged(pMac, &curTim, pPmmTim)) {
-        palFreeMemory(pMac->hHdd, curTim.pTim);
-        return;
-    }
-
-    //Time to update the beacon
-    __updatePmmGlobal(pMac, &curTim);
-    
-    pMac->sch.schObject.fBeaconChanged = 1;
-    palFreeMemory(pMac->hHdd, curTim.pTim);
-    
-    return;
-}
-
-
-
-
-// --------------------------------------------------------------------
-/**
- * pmmProcessPSPoll
- *
- * FUNCTION:
- * Process the PS poll message
- *
- * LOGIC:
- *
- * ASSUMPTIONS:
- *
- * NOTE:
- *
- * @param pBD pointer to the buffer descriptor for PS poll message
- * @return None
- */
-
-void pmmProcessPSPoll(tpAniSirGlobal pMac, tpHalBufDesc pBd)
-{
-
-    tpSirMacMgmtHdr mh = SIR_MAC_BD_TO_MPDUHEADER(pBd);
-
-
-    // Extract the AID of the station
-    tANI_U16 aid = mh->durationLo + ((mh->durationHi & 0x3f) << 8);
-
-    PELOG1(pmmLog(pMac, LOG1, FL("Received PS Poll AID 0x%x\n"), aid);)
-    if (aid == 0 || aid >= pMac->lim.maxStation)
-    {
-       PELOG1(pmmLog(pMac, LOG1, FL("STA id %d in update PM, should be [1,%d]\n"),
-               aid, pMac->lim.maxStation);)
-        return;
-    }
-
-    tpDphHashNode pSta = dphGetHashEntry(pMac, aid);
-    if (pSta && pSta->valid)
-        pSta->numTimSent = 0;
-
-    /*
-     * since PS poll arrives asynchornously wrt the rx activity set, check
-     * the current state of the BMU PS state for this sta (only for non-Ani)
-     *
-     * Since an asynchronous PS poll is being processed, we can't trust the
-     * rx activity set for PSPOLL_PERSISTENCE beacons. So set the
-     * Update counter - this will be checked during beacon processing
-     */
-    pMac->pmm.gpPmmStaState[aid].psPollUpdate = PMM_PSPOLL_PERSISTENCE;
-    pMac->pmm.gPmmPsPollUpdate = 1;
-    if (mh->fc.powerMgmt != pMac->pmm.gpPmmStaState[aid].powerSave)
-    {
-        tANI_U8 ps = 0;
-        if (pMac->pmm.gpPmmStaState[aid].powerSave != ps)
-        {
-           PELOG1(pmmLog(pMac, LOG1, FL("Sta %d: PS Poll processing PS-state %d -> %d\n"),
-                   aid, pMac->pmm.gpPmmStaState[aid].powerSave, ps);)
-            pmmUpdatePMMode(pMac, aid, ps);
-        }
-    }
-
-#ifdef PMM_APSD
-    /*
-     * See if all ACs are trigger enabled.
-     * Section 3.6.1.6 of WMM-APSD spec.
-     *
-     * In case all ACs associated with the WMM STA are delivery-enabled ACs,
-     * then no ACs have been selected for legacy power-save, and the AP shall
-     * immediately send either an ACK frame, a Null function Data frame with
-     * the More Data bit set to zero, or a Null function QoS Data frame with
-     * the More Data bit and the EOSP bit set to zero in response to the
-     * receipt of a PS-Poll frame.
-     */
-
-    {
-        tANI_U8 uapsdFlag = (*((tANI_U8*) &pSta->qos.capability.qosInfo)) & 0xF;
-
-        if ((uapsdFlag & 0xf) == 0xf)
-        {
-            /*
-             * All ACs are trigger/delivery enabled.
-             */
-            apsdSendQosNull(pMac, pSta->assocId, 0, pSta->staAddr);
-        }
-    }
-
-#endif
-
-    /*
-     * Set the PS_EN1 bit in BMU to enable transmission
-     * of one packet from that queue
-     * This is being done by the RHP now
-     */
-
-    // TBD - if HCF mode, schedule a transmission
-}
-
-void pmmProcessRxActivity(tpAniSirGlobal pMac, tANI_U16 staId, tANI_U8 pmMode)
-{
-    if (staId == 0 || staId >= pMac->lim.maxStation)
-    {
-       PELOG1(pmmLog(pMac, LOG1, FL("STA id %d in RxActProc, should be [1,%d]\n"),
-               staId, pMac->lim.maxStation);)
-        return;
-    }
-
-    PELOG1(pmmLog(pMac, LOG1, FL("STA id %d;) pmMode %d\n"), staId, pmMode);)
-
-    // ignore rxActivity if the state has been updated asynchronously
-    if (pMac->pmm.gpPmmStaState[staId].psPollUpdate == 0)
-    {
-        pmmUpdatePMMode(pMac, staId, pmMode);
-    }
-}
-
-// --------------------------------------------------------------------
-/**
- * pmmUpdatePMMode
- *
- * FUNCTION:
- * Update the power mode bit
- *
- * LOGIC:
- *
- * ASSUMPTIONS:
- *
- * NOTE:
- *
- * @param staId STA id of the station
- * @param pmMode PM bit received from the STA
- * @return None
- */
-
-void pmmUpdatePMMode(tpAniSirGlobal pMac, tANI_U16 staId, tANI_U8 pmMode)
-{
-    if ((staId == 0) ||
-        (staId == 1) ||
-        (staId >= pMac->lim.maxStation))
-    {
-        pmmLog(pMac, LOGE, FL("STA id %d in update PM, should be [2,%d]\n"),
-               staId, pMac->lim.maxStation);
-        return;
-    }
-
-    // If the STA has been deleted, ignore this call
-    tpDphHashNode pSta = dphGetHashEntry(pMac, staId);
-    if (pSta == NULL || pSta->valid == 0)
-        return;
-
-    if (pMac->pmm.gpPmmStaState[staId].powerSave != pmMode)
-    {
-       PELOG1(pmmLog(pMac, LOG1, FL("STA id %d, PM mode %d\n"),
-               staId, pmMode);)
-#ifdef WMM_APSD
-        pmmLog(pMac, LOGE, FL("pm mode change: STA id %d, PM mode %d\n"),
-               staId, pmMode);
-#endif
-
-        // Update PM mode for sta id
-        pMac->pmm.gpPmmStaState[staId].powerSave = pmMode;
-
-        // Find the numerically preceding STA in power save state
-        tANI_U16 i = (staId == 2) ? pMac->lim.maxStation-1 : staId-1;
-        while (i != staId &&
-               !(pMac->pmm.gpPmmStaState[i].powerSave == 1 &&
-                 pMac->pmm.gpPmmStaState[i].cfPollable == pMac->pmm.gpPmmStaState[staId].cfPollable)
-              )
-        {
-            i = (i == 2) ? pMac->lim.maxStation-1 : i-1;
-        }
-
-        // Adjust the linked list appropriately
-        if (pMac->pmm.gpPmmStaState[staId].cfPollable)
-            pmmUpdatePollablePMMode(pMac, staId, pmMode, i);
-        else
-            pmmUpdateNonPollablePMMode(pMac, staId, pmMode, i);
-
-        // Update the count of number of STAs in PS
-        if (pmMode)
-            pMac->pmm.gPmmNumSta++;
-        else
-        {
-            pMac->pmm.gPmmNumSta--;
-
-            // reset the num TIMs sent since STA is out of power save
-            pSta->numTimSent = 0;
-        }
-
-        // Update multicast PM mode bit appropriately
-        tANI_U8 multicastPS = pMac->pmm.gPmmNumSta ? 1 : 0;
-        if (pMac->pmm.gpPmmStaState[0].powerSave != multicastPS)
-        {
-            pMac->pmm.gpPmmStaState[0].powerSave = multicastPS;
-            // TBD - write to BMU PS bit for STA 0
-        }
-    }
-}
-
-// --------------------------------------------------------------------
-/**
- * pmmUpdateNonPollablePMMode
- *
- * FUNCTION:
- * Update the power mode bit
- *
- * LOGIC:
- *
- * ASSUMPTIONS:
- *
- * NOTE:
- *
- * @param staId STA id of the station
- * @param pmMode PM bit received from the STA
- * @param i index of the previous STA in the linked list
- * @return None
- */
-
-void pmmUpdateNonPollablePMMode(tpAniSirGlobal pMac, tANI_U16 staId, tANI_U8 pmMode, tANI_U16 i)
-{
-    if (i == staId)
-    {
-        // There is no other non pollable STA in PS
-        pMac->pmm.gpPmmStaState[staId].nextPS = (tANI_U8)staId;
-        if (pmMode)
-        {
-            // Current STA is the only non pollable STA in PS
-            pMac->pmm.gPmmNextSta = staId;
-        }
-        else
-        {
-            // There is absolutely no non pollable STA in PS
-            pMac->pmm.gPmmNextSta = 0;
-        }
-    }
-    else
-    {
-        // There is(are) other non pollable STA(s) in PS mode
-        if (pmMode)
-        {
-            // Link in the current STA to the list of non pollable PS STAs
-            pMac->pmm.gpPmmStaState[staId].nextPS = pMac->pmm.gpPmmStaState[i].nextPS;
-            pMac->pmm.gpPmmStaState[i].nextPS = (tANI_U8)staId;
-        }
-        else
-        {
-            // Remove the current STA from the list of non pollable PS STAs
-            pMac->pmm.gpPmmStaState[i].nextPS = pMac->pmm.gpPmmStaState[staId].nextPS;
-
-            // If the STA being removed is the nextSTA, update nextSTA
-            if (staId == pMac->pmm.gPmmNextSta)
-                pMac->pmm.gPmmNextSta = pMac->pmm.gpPmmStaState[staId].nextPS;
-        }
-    }
-}
-
-// --------------------------------------------------------------------
-/**
- * pmmUpdatePollablePMMode
- *
- * FUNCTION:
- * Update the power mode bit
- *
- * LOGIC:
- *
- * ASSUMPTIONS:
- *
- * NOTE:
- *
- * @param staId STA id of the station
- * @param pmMode PM bit received from the STA
- * @param i index of the previous STA in the linked list
- * @return None
- */
-
-void pmmUpdatePollablePMMode(tpAniSirGlobal pMac, tANI_U16 staId, tANI_U8 pmMode, tANI_U16 i)
-{
-    if (i == staId)
-    {
-        // There is no other pollable STA in PS
-        pMac->pmm.gpPmmStaState[staId].nextPS = (tANI_U8)staId;
-        if (pmMode)
-        {
-            // Current STA is the only pollable STA in PS
-            pMac->pmm.gPmmNextCFPSta = staId;
-        }
-        else
-        {
-            // There is absolutely no pollable STA in PS
-            pMac->pmm.gPmmNextCFPSta = 0;
-        }
-    }
-    else
-    {
-        // There is(are) other pollable STA(s) in PS mode
-        if (pmMode)
-        {
-            // Link in the current STA to the list of pollable PS STAs
-            pMac->pmm.gpPmmStaState[staId].nextPS = pMac->pmm.gpPmmStaState[i].nextPS;
-            pMac->pmm.gpPmmStaState[i].nextPS = (tANI_U8)staId;
-        }
-        else
-        {
-            // Remove the current STA from the list of pollable PS STAs
-            pMac->pmm.gpPmmStaState[i].nextPS = pMac->pmm.gpPmmStaState[staId].nextPS;
-
-            // If the STA being removed is the nextSTA, update nextSTA
-            if (staId == pMac->pmm.gPmmNextCFPSta)
-                pMac->pmm.gPmmNextCFPSta = pMac->pmm.gpPmmStaState[staId].nextPS;
-        }
-    }
-}
-
-
-
-#endif // (WNI_POLARIS_FW_PRODUCT==AP)
-
-// --------------------------------------------------------------------
-
diff --git a/CORE/MAC/src/pe/pmm/pmmApi.c b/CORE/MAC/src/pe/pmm/pmmApi.c
index 4e1c009..c587802 100644
--- a/CORE/MAC/src/pe/pmm/pmmApi.c
+++ b/CORE/MAC/src/pe/pmm/pmmApi.c
@@ -104,10 +104,6 @@
 pmmInitialize(tpAniSirGlobal pMac)
 {
 
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-    pMac->pmm.gPmmNextSta = 0;
-    pMac->pmm.gPmmNumSta = 0;
-#endif
 
     pmmResetStats(pMac);
 
@@ -115,20 +111,6 @@
     pMac->pmm.gPmmState = ePMM_STATE_READY;
 
 
-#ifdef ANI_PRODUCT_TYPE_AP
-
-    palZeroMemory(pMac->hHdd,
-                    pMac->pmm.gPmmTim.pTim, sizeof(tANI_U8)*pMac->lim.maxStation);
-
-    palZeroMemory(pMac->hHdd,
-                     pMac->pmm.gPmmTim.pStaInfo, sizeof(*pMac->pmm.gPmmTim.pStaInfo)*pMac->lim.maxStation);
-
-    palZeroMemory(pMac->hHdd,
-                    pMac->pmm.gpPmmStaState, sizeof(tPmmStaState)*pMac->lim.maxStation);
-
-    palZeroMemory(pMac->hHdd,
-                    pMac->pmm.gpPmmPSState, sizeof(tANI_U8)*pMac->lim.maxStation);
-#endif
 
     pMac->pmm.inMissedBeaconScenario = FALSE;
 
diff --git a/CORE/MAC/src/pe/rrm/rrmApi.c b/CORE/MAC/src/pe/rrm/rrmApi.c
index c5f3f34..5b9e453 100644
--- a/CORE/MAC/src/pe/rrm/rrmApi.c
+++ b/CORE/MAC/src/pe/rrm/rrmApi.c
@@ -62,11 +62,7 @@
 #include "wniApi.h"
 #include "sirApi.h"
 #include "aniGlobal.h"
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-#include "wniCfgAp.h"
-#else
 #include "wniCfgSta.h"
-#endif
 #include "limTypes.h"
 #include "limUtils.h"
 #include "limSendSmeRspMessages.h"
diff --git a/CORE/MAC/src/pe/sch/schApi.c b/CORE/MAC/src/pe/sch/schApi.c
index f9d5239..0b65b64 100644
--- a/CORE/MAC/src/pe/sch/schApi.c
+++ b/CORE/MAC/src/pe/sch/schApi.c
@@ -55,7 +55,7 @@
 #include "palTypes.h"
 #include "sirWrapper.h"
 #include "aniGlobal.h"
-#include "wniCfgAp.h"
+#include "wniCfgSta.h"
 
 #include "sirMacProtDef.h"
 #include "sirMacPropExts.h"
diff --git a/CORE/MAC/src/pe/sch/schBeaconGen.c b/CORE/MAC/src/pe/sch/schBeaconGen.c
index 90efe93..a811e22 100644
--- a/CORE/MAC/src/pe/sch/schBeaconGen.c
+++ b/CORE/MAC/src/pe/sch/schBeaconGen.c
@@ -52,7 +52,7 @@
  */
  
 #include "palTypes.h"
-#include "wniCfgAp.h"
+#include "wniCfgSta.h"
 #include "aniGlobal.h"
 #include "sirMacProtDef.h"
 
@@ -76,11 +76,6 @@
 
 const tANI_U8 P2pOui[] = {0x50, 0x6F, 0x9A, 0x9};
 
-#ifdef ANI_PRODUCT_TYPE_AP
-
-static void
-specialBeaconProcessing(tpAniSirGlobal pMac, tANI_U32 beaconSize);
-#endif
 
 #if defined(WLAN_FEATURE_P2P)
 tSirRetStatus schGetP2pIeOffset(tANI_U8 *pExtraIe, tANI_U32 extraIeLen, tANI_U16 *pP2pIeOffset)
@@ -347,32 +342,6 @@
       PopulateDot11fTPCReport( pMac, &pBcn2->TPCReport, psessionEntry);
     }
 
-#ifdef ANI_PRODUCT_TYPE_AP
-    if( psessionEntry->lim11hEnable && (eLIM_QUIET_RUNNING == psessionEntry->gLimSpecMgmt.quietState))
-    {
-      PopulateDot11fQuiet( pMac, &pBcn2->Quiet );
-    }
-
-    /* If 11h is enabled, and AP is in the state of changing either the
-     * primary channel, or both primary & secondary channel, and the
-     * channel switch count is still being decremented, then AP shall
-     * populate the 802.11h channel switch IE in its Beacons and Probe
-     * Responses.
-     */
-    if ( (psessionEntry->lim11hEnable) &&
-         (psessionEntry->gLimChannelSwitch.switchCount != 0) &&
-         (psessionEntry->gLimSpecMgmt.dot11hChanSwState == eLIM_11H_CHANSW_RUNNING))
-
-    {
-      PopulateDot11fChanSwitchAnn( pMac, &pBcn2->ChanSwitchAnn,psessionEntry );
-      PopulateDot11fExtChanSwitchAnn(pMac, &pBcn2->ExtChanSwitchAnn,psessionEntry);
-#ifdef WLAN_FEATURE_11AC
-      if(psessionEntry->vhtCapability)
-          PopulateDot11fWiderBWChanSwitchAnn(pMac, &pBcn2->WiderBWChanSwitchAnn, psessionEntry );
-#endif
-
-    }
-#endif
 
     if (psessionEntry->dot11mode != WNI_CFG_DOT11_MODE_11B)
         PopulateDot11fERPInfo( pMac, &pBcn2->ERPInfo, psessionEntry );
@@ -738,56 +707,6 @@
 }
 
 
-#ifdef ANI_PRODUCT_TYPE_AP
-
-//----------------------------
-/**
-  *     @function : schUpdateCfpParam
-  *     @brief      : Generate the CFP Parameter Set
-  *     
-  *     @param    :  pMac - tpAniSirGlobal
-  *                       ptr    - Pointer to the BeaconFrame
-  *                       pbeaconSize - The beaconSize
-  *
-  *     @return    :  Return the Updated Ptrlocation
-  */
-static tANI_U8 *
-__schUpdateCfpParam(tpAniSirGlobal pMac, tANI_U8 *ptr, tANI_U32 *pbeaconSize)
-{  
-    tANI_U32 val;
-
-    *ptr++ = SIR_MAC_CF_PARAM_SET_EID;
-    *ptr++ = SIR_MAC_CF_PARAM_SET_EID_MIN;
-
-    wlan_cfgGetInt(pMac, WNI_CFG_CFP_PERIOD, &val);
-    if (++pMac->sch.schObject.gSchCFPCount == val)
-        pMac->sch.schObject.gSchCFPCount = 0;
-
-    *ptr++ = pMac->sch.schObject.gSchCFPCount;
-    *ptr++ = (tANI_U8)val;
-
-    wlan_cfgGetInt(pMac, WNI_CFG_CFP_MAX_DURATION, &val);
-    pMac->sch.schObject.gSchCFPMaxDuration = (tANI_U8)val;
-
-    sirStoreU16(ptr, (tANI_U16)val);
-    ptr += 2;
-
-    if (pMac->sch.schObject.gSchCFPCount == 0)
-        pMac->sch.schObject.gSchCFPDurRemaining = pMac->sch.schObject.gSchCFPMaxDuration;
-    else if (pMac->sch.schObject.gSchCFPDurRemaining > pMac->sch.schObject.gSchBeaconInterval)
-        pMac->sch.schObject.gSchCFPDurRemaining -= pMac->sch.schObject.gSchBeaconInterval;
-    else
-        pMac->sch.schObject.gSchCFPDurRemaining = 0;
-
-    sirStoreU16(ptr, pMac->sch.schObject.gSchCFPDurRemaining);
-    ptr += 2;
-
-    (*pbeaconSize) += 2 + SIR_MAC_CF_PARAM_SET_EID_MIN;
-
-    return ptr;
-}
-
-#endif
 
 // --------------------------------------------------------------------
 /**
@@ -922,31 +841,6 @@
          }
      break;
 
-#ifdef ANI_PRODUCT_TYPE_AP
-    case eLIM_AP_ROLE: 
-    {
-        tANI_U8 *ptr = &pMac->sch.schObject.gSchBeaconFrameBegin[pMac->sch.schObject.gSchBeaconOffsetBegin];
-        tANI_U16 timLength = 0;
-
-        if (pMac->sch.schObject.gSchCFPEnabled)
-          ptr = __schUpdateCfpParam( pMac, ptr, &beaconSize);
-
-        // generate TIM
-        pmmGenerateTIM(pMac, &ptr, &timLength);
-        beaconSize += 2 + timLength;
-
-        /**
-        * Safe to call this each time.
-        * Based on the requirement for updating the
-        * fixed beacon fields, this routine will
-        * appropriately update the fixed fields
-        */
-        specialBeaconProcessing(pMac, beaconSize);
-        writeBeaconToMemory(pMac, beaconSize, beaconSize, psessionEntry);
-        pmmHandleTimBasedDisassociation( pMac, psessionEntry );
-    }
-    break;
-#endif
 
     default:
         PELOGE(schLog(pMac, LOGE, FL("Error-PE has Receive PreBeconGenIndication when System is in %d role"),
@@ -957,118 +851,3 @@
     palFreeMemory(pMac->hHdd, (void*)pMsg);
 
 }
-
-/**-------------------------------------------------------------
- \fn       specialBeaconProcessing
- \brief   To add/update channel switch IE/ Quiet IE in beacons.
-          And also to resume transmission and measurement after
-          switching the channel.
-      
- \param   pMac
- \param   beaconSize  Size of the beacon
- \return   NONE
- --------------------------------------------------------------*/
-#ifdef ANI_PRODUCT_TYPE_AP
-
-static void
-specialBeaconProcessing( tpAniSirGlobal pMac, tANI_U32 beaconSize)
-{
-
-    tpPESession psessionEntry = &pMac->lim.gpSession[0]; //TBD-RAJESH HOW TO GET sessionEntry?????
-    tANI_BOOLEAN fBeaconChanged = eANI_BOOLEAN_FALSE;
-
-    fBeaconChanged = limUpdateQuietIEInBeacons( pMac );
-
-    if((pMac->lim.wscIeInfo.wscEnrollmentState == eLIM_WSC_ENROLL_BEGIN) ||
-       (pMac->lim.wscIeInfo.wscEnrollmentState == eLIM_WSC_ENROLL_END))
-    {
-        fBeaconChanged = eANI_BOOLEAN_TRUE;
-    }
-
-
-    /*******************************
-     * Processing Channel Switch IE
-     *******************************/
-    if (pMac->lim.gLimSpecMgmt.dot11hChanSwState == eLIM_11H_CHANSW_RUNNING)
-    {
-        fBeaconChanged = eANI_BOOLEAN_TRUE;
-
-#if 0
-        // If the station doesn't support 11h or have link monitoring enabled,
-        // AP has to send disassoc frame to indicate station before going
-        // to new channel. Otherwise station wont connect to AP in new channel.
-        if (pMac->lim.gLimChannelSwitch.switchCount == 1)
-        {
-            if((pMac->lim.gLimChannelSwitch.state
-                == eLIM_CHANNEL_SWITCH_PRIMARY_ONLY) ||
-                (pMac->lim.gLimChannelSwitch.state
-                == eLIM_CHANNEL_SWITCH_PRIMARY_AND_SECONDARY))
-            {
-                tSirMacAddr   bcAddr = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
-
-                limSendDisassocMgmtFrame(pMac,
-                                   eSIR_MAC_DISASSOC_LEAVING_BSS_REASON,
-                                   bcAddr);
-            }
-        }
-#endif
-        if (pMac->lim.gLimChannelSwitch.switchCount == 0)
-        {
-            
-            /* length is set to 0, so that no beacon is transmitted without channel switch IE
-                       * before switching  to new channel */
-            pMac->sch.schObject.fBeaconChanged = 1;
-            writeBeaconToMemory(pMac, beaconSize, 0, psessionEntry);
-            schSetFixedBeaconFields(pMac,psessionEntry);
-
-           PELOG3(limLog(pMac, LOG3, FL("Channel switch state = %d\n"), pMac->lim.gLimChannelSwitch.state);)
-            switch(pMac->lim.gLimChannelSwitch.state)
-            {
-                case eLIM_CHANNEL_SWITCH_PRIMARY_ONLY:
-                    limSwitchPrimaryChannel(pMac, pMac->lim.gLimChannelSwitch.primaryChannel);
-                    break;
-                case eLIM_CHANNEL_SWITCH_SECONDARY_ONLY:
-                    limSwitchPrimarySecondaryChannel(pMac, psessionEntry,
-                                             psessionEntry->currentOperChannel,
-                                             pMac->lim.gLimChannelSwitch.secondarySubBand);
-                    break;
-                case eLIM_CHANNEL_SWITCH_PRIMARY_AND_SECONDARY:
-                    limSwitchPrimarySecondaryChannel(pMac, psessionEntry,
-                                             pMac->lim.gLimChannelSwitch.primaryChannel,
-                                             pMac->lim.gLimChannelSwitch.secondarySubBand);
-                    break;
-                case eLIM_CHANNEL_SWITCH_IDLE:
-                    PELOGE(schLog(pMac, LOGE, FL("incorrect state - CHANNEL_SWITCH_IDLE\n"));)
-                    break;
-
-                default:
-                    break;
-            }
-            pMac->lim.gLimChannelSwitch.state = eLIM_CHANNEL_SWITCH_IDLE;
-
-            limSendSmeRsp(pMac, eWNI_SME_SWITCH_CHL_RSP, eSIR_SME_SUCCESS);
-
-            limFrameTransmissionControl(pMac, eLIM_TX_BSS_BUT_BEACON, eLIM_RESUME_TX);
-            /* Flag to indicate 11h channel switch is done. */
-            pMac->lim.gLimSpecMgmt.dot11hChanSwState = eLIM_11H_CHANSW_INIT;
-            pMac->lim.gLimSpecMgmt.quietState = eLIM_QUIET_INIT;
-            LIM_SET_RADAR_DETECTED(pMac, eANI_BOOLEAN_FALSE);
-            
-            if (pMac->lim.gpLimMeasReq)
-                limReEnableLearnMode(pMac);
-
-            return;
-        }
-    }
-
-    if (fBeaconChanged)
-    {
-        schSetFixedBeaconFields(pMac,psessionEntry);
-
-        if (pMac->lim.gLimChannelSwitch.switchCount > 0)
-            pMac->lim.gLimChannelSwitch.switchCount--;
-    }
-}
-#endif
-
-
diff --git a/CORE/MAC/src/pe/sch/schBeaconProcess.c b/CORE/MAC/src/pe/sch/schBeaconProcess.c
index 924ebc2..4249bb1 100644
--- a/CORE/MAC/src/pe/sch/schBeaconProcess.c
+++ b/CORE/MAC/src/pe/sch/schBeaconProcess.c
@@ -52,7 +52,7 @@
  */
 
 #include "palTypes.h"
-#include "wniCfgAp.h"
+#include "wniCfgSta.h"
 
 #include "cfgApi.h"
 #include "pmmApi.h"
@@ -470,7 +470,6 @@
         limUpdateStaRunTimeHTSwitchChnlParams( pMac, &pBeacon->HTInfo, bssIdx,psessionEntry);
     }
 
-#if defined(ANI_PRODUCT_TYPE_CLIENT) || defined(ANI_AP_CLIENT_SDK)
     if ( (psessionEntry->limSystemRole == eLIM_STA_ROLE) ||(psessionEntry->limSystemRole == eLIM_BT_AMP_STA_ROLE) ||
           (psessionEntry->limSystemRole == eLIM_STA_IN_IBSS_ROLE) )
     {
@@ -485,7 +484,6 @@
             limCancelDot11hChannelSwitch(pMac, psessionEntry);
         }   
     }
-#endif
 
 #ifdef WLAN_FEATURE_11AC
     if ( (psessionEntry->limSystemRole == eLIM_STA_ROLE) ||(psessionEntry->limSystemRole == eLIM_BT_AMP_STA_ROLE) || (psessionEntry->limSystemRole == eLIM_STA_IN_IBSS_ROLE) ) 
diff --git a/CORE/MAC/src/pe/sch/schDebug.c b/CORE/MAC/src/pe/sch/schDebug.c
index 0dde12d..5156b60 100644
--- a/CORE/MAC/src/pe/sch/schDebug.c
+++ b/CORE/MAC/src/pe/sch/schDebug.c
@@ -49,13 +49,13 @@
  * History:-
  * Date            Modified by    Modification Information
  * --------------------------------------------------------------------
- * 
+ *
  */
 
 
 #include "schDebug.h"
 
-void schLog(tpAniSirGlobal pMac, tANI_U32 loglevel, const char *pString,...) 
+void schLog(tpAniSirGlobal pMac, tANI_U32 loglevel, const char *pString,...)
 {
 #ifdef WLAN_DEBUG
     // Verify against current log level
@@ -68,82 +68,11 @@
         va_start( marker, pString );     /* Initialize variable arguments. */
 
         logDebug(pMac, SIR_SCH_MODULE_ID, loglevel, pString, marker);
-        
+
         va_end( marker );              /* Reset variable arguments.      */
     }
 #endif
 }
 
-#if (WNI_POLARIS_FW_PRODUCT==AP)
-#ifdef WMM_SA
-
-#include "schClass.h"
-#include "schDebug.h"
-
-
-void dumpSchedule(tANI_U8 index)
-{
-  tpSchSchedule s = &schedule[index];
-
-  PELOG2(schLog(pMac, LOG2, FL("============== SCHEDULE %d ===============\n"), index);)
-  dumpSchedule(s);
-}
-
-void schClass::dumpSchedule(tpSchSchedule s)
-{
- PELOG2(schLog(pMac, LOG2, FL("\ttotTxop %d totInst %d curInst %d\n"), 
-         s->totTxopLo+0x100*s->totTxopHi, s->totInst, s->curInst);)
-  for(tANI_U32 i=0; i<s->totInst; i++)
-    {
-      PELOG2(schLog(pMac, LOG2, FL("\t[%d] "), i);)
-      dumpInstruction(&s->inst[i]);
-    }
-  PELOG2(schLog(pMac, LOG2, FL("\t+++++++++++++++++++++++++++++++++++++++++++\n"));)
-}
-
-void dumpInstruction(tpSchInstruction t)
-{
-  if (t->type == SCH_INST_DATA)
-   PELOG2(schLog(pMac, LOG2, "DATA (%d,%d) txop %d feedback %d\n", 
-                 t->staidLo+0x10*t->staidHi, t->pri, 
-                 t->txopLo+0x100*t->txopHi, t->feedback);)
-  else
-   PELOG2(schLog(pMac, LOG2, "POLL (%d,%d) txop %d feedback %d\n", 
-                 t->staidLo+0x10*t->staidHi, t->pri, 
-                 t->txopLo+0x100*t->txopHi, t->feedback);)
-}
-
-void dumpQueueSizes()
-{
-  PELOG3(schLog(pMac, LOG3, FL("------- QUEUE SIZES [sta][pri][DL(0)/UL(1)] -------\n"));)
-  for(int i=0; i<256; i++)
-    for(int j=0; j<8; j++)
-      for(int k=0; k<2; k++)
-      {
-         if (queue[i][j][k].packets > 0)
-            PELOG3(schLog(pMac, LOG3, FL("\tQueueLength[%d][%d][%d] = %d packets %d txop (serviced %d)\n"), 
-                          i, j, k,
-                          queue[i][j][k].packets, queue[i][j][k].txop, queue[i][j][k].serviced);)
-      }
-}
-
-void printQosClass(tANI_U8 classId)
-{
-  schQoSClass *q = &qosClass[classId];
-
-  if (q->activeNext == NULL)
-    PELOG3(schLog(pMac, LOG3, FL("printQosClass[%d] : Active list empty\n"), classId);)
-  else
-    {
-      tpSchQueueState ptr = q->activeNext->next;
-      tANI_U16 i;
-      for(i=1; ptr != q->activeNext; ptr = ptr->next, i++);
-     PELOG3(schLog(pMac, LOG3, FL("printQosClass[%d] : Active Qs %d nextPtr %x prevPtr %x creditsRem %d\n"), 
-                   classId, i, (tANI_U32) q->activeNext, (tANI_U32) q->activePrev, q->creditsRemaining);)
-    }
-}
-
-#endif /* WMM_SA */
-#endif // (WNI_POLARIS_FW_PRODUCT==AP)
 
 // --------------------------------------------------------------------
diff --git a/CORE/MAC/src/pe/sch/schMessage.c b/CORE/MAC/src/pe/sch/schMessage.c
index a621f46..abd386f 100644
--- a/CORE/MAC/src/pe/sch/schMessage.c
+++ b/CORE/MAC/src/pe/sch/schMessage.c
@@ -52,7 +52,7 @@
 #include "palTypes.h"
 #include "sirCommon.h"
 
-#include "wniCfgAp.h"
+#include "wniCfgSta.h"
 #include "aniGlobal.h"
 #include "cfgApi.h"
 #include "limApi.h"
@@ -235,12 +235,6 @@
            PELOG3(schLog(pMac, LOG3,
                    FL("Received STOP_SCAN_NTF from LIM\n"));)
             pMac->sch.gSchScanReqRcvd = false;
-#ifdef WMM_SA
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-            if (psessionEntry->limSystemRole == eLIM_AP_ROLE && pMac->sch.gSchHcfEnabled)
-                startCFB();
-#endif
-#endif
             break;
 
         case SIR_CFG_PARAM_UPDATE_IND:
@@ -330,10 +324,6 @@
 {
     tSirMsgQ schMsg;
 
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-    if (pMac->lim.gLimSystemRole == eLIM_AP_ROLE)
-        pMac->sch.gSchRRRecd = false;
-#endif
     memset(&schMsg, 0, sizeof(tSirMsgQ));
     while (1)
     {
@@ -343,38 +333,8 @@
 
         schProcessMessage(pMac, &schMsg);
     }
-#ifdef WMM_SA
-#if (WNI_POLARIS_FW_PRODUCT == AP)
-    if (pMac->lim.gLimSystemRole == eLIM_AP_ROLE && pMac->sch.gSchRRRecd)
-        startCFB();
-#endif
-#endif
 }
 
-#if 0 /* This function is not used anywhere */
-// set the default values for all params of interest
-void
-schUpdateQosInfo( tpAniSirGlobal pMac)
-{
-    // need to populate local info only on AP or IBSS, beacon processing
-    // takes care of others
-    psessionEntry->gLimEdcaParamSetCount = 0xFF;
-
-    if (pMac->lim.gLimSystemRole == eLIM_STA_IN_IBSS_ROLE)
-    {
-        schQosUpdateLocal(pMac);
-    }
-    else if (pMac->lim.gLimSystemRole == eLIM_AP_ROLE)
-    {
-        // fill local AP values
-        schQosUpdateLocal(pMac);
-
-        // fill broadcast values
-        schQosUpdateBroadcast(pMac, psessionEntry);
-    }
-}
-
-#endif
 
 // get the local or broadcast parameters based on the profile sepcified in the config
 // params are delivered in this order: BK, BE, VI, VO