summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManikandan Mohan <manikand@qti.qualcomm.com>2014-04-07 12:56:14 -0700
committerAkash Patel <c_akashp@qca.qualcomm.com>2014-04-10 07:12:43 -0700
commit31f15243360fdb162c549095e229255a2b36cb8f (patch)
treeb86096b55da351e96db1d3502c8cd957e45d5e60
parent0b13b244d3a5e2f875672d5acec3bf75011db312 (diff)
qcacld: wlan: Update for MCC to SCC auto switch
MCC to SCC auto switch feature is needed when operating channels of the virtual interfaces interfere with each other due to MCC techniques used. This feature is applied to SAP interface to change its operating frequency to that of station for STA-AP or previously initiated SAP1 for AP-AP based on operting channel and bandwidth. Change-Id: I4ff8942e322032959519ab12b56359a01431aaf1 CRs-fixed: 644806
-rw-r--r--CORE/HDD/inc/wlan_hdd_cfg.h11
-rw-r--r--CORE/HDD/inc/wlan_hdd_cfg80211.h3
-rw-r--r--CORE/HDD/inc/wlan_hdd_main.h11
-rw-r--r--CORE/HDD/src/wlan_hdd_assoc.c11
-rw-r--r--CORE/HDD/src/wlan_hdd_cfg.c14
-rw-r--r--CORE/HDD/src/wlan_hdd_cfg80211.c6
-rw-r--r--CORE/HDD/src/wlan_hdd_main.c97
-rw-r--r--CORE/MAC/inc/sirApi.h28
-rw-r--r--CORE/MAC/src/pe/include/limSession.h3
-rw-r--r--CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c7
-rw-r--r--CORE/MAC/src/pe/lim/limSendSmeRspMessages.c49
-rw-r--r--CORE/MAC/src/pe/lim/limSerDesUtils.c19
-rw-r--r--CORE/SAP/inc/sapApi.h21
-rw-r--r--CORE/SAP/src/sapFsm.c31
-rw-r--r--CORE/SAP/src/sapInternal.h3
-rw-r--r--CORE/SAP/src/sapModule.c37
-rw-r--r--CORE/SME/inc/csrApi.h22
-rw-r--r--CORE/SME/inc/csrInternal.h7
-rw-r--r--CORE/SME/inc/sme_Api.h4
-rw-r--r--CORE/SME/src/csr/csrApiRoam.c115
-rw-r--r--CORE/SME/src/csr/csrUtil.c167
-rw-r--r--CORE/SME/src/sme_common/sme_Api.c19
-rw-r--r--CORE/VOSS/inc/vos_types.h10
-rw-r--r--Kbuild3
-rwxr-xr-xfirmware_bin/WCNSS_qcom_cfg.ini3
25 files changed, 692 insertions, 9 deletions
diff --git a/CORE/HDD/inc/wlan_hdd_cfg.h b/CORE/HDD/inc/wlan_hdd_cfg.h
index 319bd46e9581..bc3ee167022d 100644
--- a/CORE/HDD/inc/wlan_hdd_cfg.h
+++ b/CORE/HDD/inc/wlan_hdd_cfg.h
@@ -473,6 +473,14 @@ typedef enum
#define CFG_WLAN_AUTO_SHUTDOWN_DEFAULT ( 0 )
#endif
+#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
+#define CFG_WLAN_MCC_TO_SCC_SWITCH_MODE "gWlanMccToSccSwitchMode"
+#define CFG_WLAN_MCC_TO_SCC_SWITCH_MODE_MIN ( VOS_MCC_TO_SCC_SWITCH_DISABLE)
+#define CFG_WLAN_MCC_TO_SCC_SWITCH_MODE_MAX ( VOS_MCC_TO_SCC_SWITCH_FORCE )
+#define CFG_WLAN_MCC_TO_SCC_SWITCH_MODE_DEFAULT (VOS_MCC_TO_SCC_SWITCH_DISABLE)
+#endif
+
+
#define CFG_FRAMES_PROCESSING_TH_MODE_NAME "gMinFramesProcThres"
#define CFG_FRAMES_PROCESSING_TH_MIN ( 0 )
#define CFG_FRAMES_PROCESSING_TH_MAX ( 39 )
@@ -2809,6 +2817,9 @@ typedef struct
v_BOOL_t IpaRMEnable;
v_U32_t IpaDescSize;
#endif
+#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
+ v_U32_t WlanMccToSccSwitchMode;
+#endif
#ifdef FEATURE_WLAN_AUTO_SHUTDOWN
v_U32_t WlanAutoShutdown;
#endif
diff --git a/CORE/HDD/inc/wlan_hdd_cfg80211.h b/CORE/HDD/inc/wlan_hdd_cfg80211.h
index 17f9941dab27..ae0949510eb5 100644
--- a/CORE/HDD/inc/wlan_hdd_cfg80211.h
+++ b/CORE/HDD/inc/wlan_hdd_cfg80211.h
@@ -223,6 +223,9 @@ void hdd_select_cbmode( hdd_adapter_t *pAdapter,v_U8_t operationChannel);
v_U8_t* wlan_hdd_cfg80211_get_ie_ptr(v_U8_t *pIes, int length, v_U8_t eid);
+int wlan_hdd_cfg80211_del_station(struct wiphy *wiphy,
+ struct net_device *dev, u8 *mac);
+
#if defined(QCA_WIFI_2_0) && defined(QCA_WIFI_FTM) \
&& !defined(QCA_WIFI_ISOC) && defined(CONFIG_NL80211_TESTMODE)
void wlan_hdd_testmode_rx_event(void *buf, size_t buf_len);
diff --git a/CORE/HDD/inc/wlan_hdd_main.h b/CORE/HDD/inc/wlan_hdd_main.h
index b9f08e4856d2..535a83a11462 100644
--- a/CORE/HDD/inc/wlan_hdd_main.h
+++ b/CORE/HDD/inc/wlan_hdd_main.h
@@ -61,6 +61,9 @@
#include "wlan_hdd_tdls.h"
#endif
#include "wlan_hdd_cfg80211.h"
+#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
+#include <adf_os_defer.h>
+#endif
#ifdef WLAN_FEATURE_MBSSID
#include "sapApi.h"
#endif
@@ -1375,7 +1378,9 @@ struct hdd_context_s
#ifdef FEATURE_WLAN_AUTO_SHUTDOWN
vos_timer_t hdd_wlan_shutdown_timer;
#endif
-
+#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
+ adf_os_work_t sta_ap_intf_check_work;
+#endif
};
@@ -1383,6 +1388,10 @@ struct hdd_context_s
/*---------------------------------------------------------------------------
Function declarations and documenation
-------------------------------------------------------------------------*/
+#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
+void wlan_hdd_check_sta_ap_concurrent_ch_intf(void *sta_pAdapter);
+#endif
+
VOS_STATUS hdd_get_front_adapter( hdd_context_t *pHddCtx,
hdd_adapter_list_node_t** ppAdapterNode);
diff --git a/CORE/HDD/src/wlan_hdd_assoc.c b/CORE/HDD/src/wlan_hdd_assoc.c
index 18064d8399a1..fe3b978acb66 100644
--- a/CORE/HDD/src/wlan_hdd_assoc.c
+++ b/CORE/HDD/src/wlan_hdd_assoc.c
@@ -1372,6 +1372,17 @@ static eHalStatus hdd_AssociationCompletionHandler( hdd_adapter_t *pAdapter, tCs
wlan_hdd_auto_shutdown_enable(pHddCtx, VOS_FALSE);
#endif
+#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
+ if (pHddCtx->cfg_ini->WlanMccToSccSwitchMode
+ != VOS_MCC_TO_SCC_SWITCH_DISABLE) {
+ adf_os_create_work(0, &pHddCtx->sta_ap_intf_check_work,
+ wlan_hdd_check_sta_ap_concurrent_ch_intf, (void *)pAdapter);
+ adf_os_sched_work(0, &pHddCtx->sta_ap_intf_check_work);
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO,
+ "Checking for Concurrent Channge interference");
+ }
+#endif
+
#ifdef FEATURE_WLAN_TDLS
wlan_hdd_tdls_connection_callback(pAdapter);
#endif
diff --git a/CORE/HDD/src/wlan_hdd_cfg.c b/CORE/HDD/src/wlan_hdd_cfg.c
index 9e568594e935..f4be26669234 100644
--- a/CORE/HDD/src/wlan_hdd_cfg.c
+++ b/CORE/HDD/src/wlan_hdd_cfg.c
@@ -1871,6 +1871,14 @@ REG_TABLE_ENTRY g_registry_table[] =
CFG_AP_AUTO_SHUT_OFF_MIN,
CFG_AP_AUTO_SHUT_OFF_MAX ),
+#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
+ REG_VARIABLE( CFG_WLAN_MCC_TO_SCC_SWITCH_MODE , WLAN_PARAM_Integer,
+ hdd_config_t, WlanMccToSccSwitchMode,
+ VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
+ CFG_WLAN_MCC_TO_SCC_SWITCH_MODE_DEFAULT,
+ CFG_WLAN_MCC_TO_SCC_SWITCH_MODE_MIN,
+ CFG_WLAN_MCC_TO_SCC_SWITCH_MODE_MAX ),
+#endif
#ifdef FEATURE_WLAN_AUTO_SHUTDOWN
REG_VARIABLE( CFG_WLAN_AUTO_SHUTDOWN , WLAN_PARAM_Integer,
hdd_config_t, WlanAutoShutdown,
@@ -3531,6 +3539,9 @@ static void print_hdd_cfg(hdd_context_t *pHddCtx)
pHddCtx->cfg_ini->apCntryCode[2]);
VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "Name = [gEnableApProt] value = [%u]", pHddCtx->cfg_ini->apProtEnabled);
VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "Name = [gAPAutoShutOff] Value = [%u]", pHddCtx->cfg_ini->nAPAutoShutOff);
+#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "Name = [gWlanMccToSccSwitchMode] Value = [%u]", pHddCtx->cfg_ini->WlanMccToSccSwitchMode);
+#endif
#ifdef FEATURE_WLAN_AUTO_SHUTDOWN
VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "Name = [gWlanAutoShutdown] Value = [%u]", pHddCtx->cfg_ini->WlanAutoShutdown);
#endif
@@ -5388,6 +5399,9 @@ VOS_STATUS hdd_set_sme_config( hdd_context_t *pHddCtx )
smeConfig.csrConfig.scanCfgAgingTime = pConfig->scanAgingTimeout;
smeConfig.csrConfig.enableTxLdpc = pConfig->enableTxLdpc;
+#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
+ smeConfig.csrConfig.cc_switch_mode = pConfig->WlanMccToSccSwitchMode;
+#endif
smeConfig.csrConfig.isAmsduSupportInAMPDU = pConfig->isAmsduSupportInAMPDU;
smeConfig.csrConfig.nSelect5GHzMargin = pConfig->nSelect5GHzMargin;
diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c
index ae8676bd3e33..c36657b96dac 100644
--- a/CORE/HDD/src/wlan_hdd_cfg80211.c
+++ b/CORE/HDD/src/wlan_hdd_cfg80211.c
@@ -2362,6 +2362,10 @@ static int wlan_hdd_cfg80211_start_bss(hdd_adapter_t *pHostapdAdapter,
pConfig->SapMacaddr_acl = eSAP_ACCEPT_UNLESS_DENIED;
pConfig->num_accept_mac = 0;
pConfig->num_deny_mac = 0;
+#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
+ pConfig->cc_switch_mode =
+ (WLAN_HDD_GET_CTX(pHostapdAdapter))->cfg_ini->WlanMccToSccSwitchMode;
+#endif
pIe = wlan_hdd_get_vendor_oui_ie_ptr(BLACKLIST_OUI_TYPE, WPA_OUI_TYPE_SIZE,
pBeacon->tail, pBeacon->tail_len);
@@ -8157,7 +8161,7 @@ static int wlan_hdd_set_txq_params(struct wiphy *wiphy,
}
#endif //LINUX_VERSION_CODE
-static int wlan_hdd_cfg80211_del_station(struct wiphy *wiphy,
+int wlan_hdd_cfg80211_del_station(struct wiphy *wiphy,
struct net_device *dev, u8 *mac)
{
hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c
index 34313e87f2bb..729e96bd69bb 100644
--- a/CORE/HDD/src/wlan_hdd_main.c
+++ b/CORE/HDD/src/wlan_hdd_main.c
@@ -8711,14 +8711,14 @@ void hdd_dump_concurrency_info(hdd_context_t *pHddCtx)
if (staChannel > 0 && (apChannel > 0 || p2pChannel > 0)) {
ccMode = (p2pChannel==staChannel||apChannel==staChannel) ? "SCC" : "MCC";
}
- hddLog(VOS_TRACE_LEVEL_INFO, "wlan(%d) " MAC_ADDRESS_STR " %s",
+ hddLog(VOS_TRACE_LEVEL_ERROR, "wlan(%d) " MAC_ADDRESS_STR " %s",
staChannel, MAC_ADDR_ARRAY(staBssid), ccMode);
if (p2pChannel > 0) {
hddLog(VOS_TRACE_LEVEL_INFO, "p2p-%s(%d) " MAC_ADDRESS_STR,
p2pMode, p2pChannel, MAC_ADDR_ARRAY(p2pBssid));
}
if (apChannel > 0) {
- hddLog(VOS_TRACE_LEVEL_INFO, "AP(%d) " MAC_ADDRESS_STR,
+ hddLog(VOS_TRACE_LEVEL_ERROR, "AP(%d) " MAC_ADDRESS_STR,
apChannel, MAC_ADDR_ARRAY(apBssid));
}
@@ -12199,6 +12199,99 @@ void hdd_stop_bus_bw_compute_timer(hdd_adapter_t *pAdapter)
}
#endif
+#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
+void wlan_hdd_restart_sap(hdd_adapter_t *ap_pAdapter)
+{
+ hdd_ap_ctx_t *pHddApCtx;
+ hdd_hostapd_state_t *pHostapdState;
+ VOS_STATUS vos_status;
+ hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(ap_pAdapter);
+
+ pHddApCtx = WLAN_HDD_GET_AP_CTX_PTR(ap_pAdapter);
+
+ mutex_lock(&pHddCtx->sap_lock);
+ if(test_bit(SOFTAP_BSS_STARTED, &ap_pAdapter->event_flags))
+ {
+ wlan_hdd_cfg80211_del_station(ap_pAdapter->wdev.wiphy, ap_pAdapter->dev,
+ NULL);
+ hdd_cleanup_actionframe(pHddCtx, ap_pAdapter);
+
+ pHostapdState = WLAN_HDD_GET_HOSTAP_STATE_PTR(ap_pAdapter);
+ if ( VOS_STATUS_SUCCESS == (vos_status = WLANSAP_StopBss(
+#ifdef WLAN_FEATURE_MBSSID
+ pHddApCtx->sapContext
+#else
+ (WLAN_HDD_GET_CTX(ap_pAdapter))->pvosContext
+#endif
+ ))) {
+ vos_status = vos_wait_single_event(&pHostapdState->vosEvent, 10000);
+
+ if (!VOS_IS_STATUS_SUCCESS(vos_status)) {
+ hddLog(LOGE,FL("%s: SAP Stop Failed"), __func__);
+ goto end;
+ }
+ }
+ clear_bit(SOFTAP_BSS_STARTED, &ap_pAdapter->event_flags);
+ hddLog(LOGE,FL("%s: SAP Stop Success"), __func__);
+
+ if (WLANSAP_StartBss(
+#ifdef WLAN_FEATURE_MBSSID
+ pHddApCtx->sapContext,
+#else
+ pHddCtx->pvosContext,
+#endif
+ hdd_hostapd_SAPEventCB, &pHddApCtx->sapConfig,
+ (v_PVOID_t)ap_pAdapter->dev) != VOS_STATUS_SUCCESS) {
+ hddLog(LOGE,FL("%s: SAP Start Bss fail"), __func__);
+ goto end;
+ }
+
+ hddLog(LOG1, FL("%s: Waiting for SAP to start"), __func__);
+ vos_status = vos_wait_single_event(&pHostapdState->vosEvent, 10000);
+ if (!VOS_IS_STATUS_SUCCESS(vos_status)) {
+ hddLog(LOGE,FL("%s: SAP Start failed"), __func__);
+ goto end;
+ }
+ hddLog(LOGE,FL("%s: SAP Start Success"), __func__);
+ set_bit(SOFTAP_BSS_STARTED, &ap_pAdapter->event_flags);
+ pHostapdState->bCommit = TRUE;
+ }
+end:
+ mutex_unlock(&pHddCtx->sap_lock);
+ return;
+}
+
+void wlan_hdd_check_sta_ap_concurrent_ch_intf(void *data)
+{
+ hdd_adapter_t *ap_pAdapter = NULL, *sta_pAdapter = (hdd_adapter_t *)data;
+ hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(sta_pAdapter);
+ hdd_ap_ctx_t *pHddApCtx;
+ v_U16_t intf_ch = 0;
+
+ if ((pHddCtx->cfg_ini->WlanMccToSccSwitchMode == VOS_MCC_TO_SCC_SWITCH_DISABLE)
+ || !(vos_concurrent_sessions_running()
+ || !(vos_get_concurrency_mode() == VOS_STA_SAP)))
+ return;
+
+ ap_pAdapter = hdd_get_adapter(pHddCtx, WLAN_HDD_SOFTAP);
+ if (ap_pAdapter == NULL)
+ return;
+ pHddApCtx = WLAN_HDD_GET_AP_CTX_PTR(ap_pAdapter);
+
+#ifdef WLAN_FEATURE_MBSSID
+ intf_ch = WLANSAP_CheckCCIntf(pHddApCtx->sapContext);
+#else
+ intf_ch = WLANSAP_CheckCCIntf(pHddCtx->pvosContext);
+#endif
+ if (intf_ch == 0)
+ return;
+
+ pHddApCtx->sapConfig.channel = intf_ch;
+ wlan_hdd_restart_sap(ap_pAdapter);
+}
+
+#endif
+
//Register the module init/exit functions
module_init(hdd_module_init);
module_exit(hdd_module_exit);
diff --git a/CORE/MAC/inc/sirApi.h b/CORE/MAC/inc/sirApi.h
index 744e1ad9939a..de7195ba26c4 100644
--- a/CORE/MAC/inc/sirApi.h
+++ b/CORE/MAC/inc/sirApi.h
@@ -635,6 +635,9 @@ typedef struct sSirSmeStartBssReq
tSirMacAddr selfMacAddr; //Added for BT-AMP Support
tANI_U16 beaconInterval; //Added for BT-AMP Support
tANI_U8 dot11mode;
+#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
+ tANI_U8 cc_switch_mode;
+#endif
tSirBssType bssType;
tSirMacSSid ssId;
tANI_U8 channelId;
@@ -720,6 +723,22 @@ typedef struct sSirBssDescription
tANI_U32 ieFields[1];
} tSirBssDescription, *tpSirBssDescription;
+#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
+typedef struct sSirSmeHTProfile
+{
+ tANI_U8 dot11mode;
+ tANI_U8 htCapability;
+ tANI_U8 htSupportedChannelWidthSet;
+ tANI_U8 htRecommendedTxWidthSet;
+ ePhyChanBondState htSecondaryChannelOffset;
+#ifdef WLAN_FEATURE_11AC
+ tANI_U8 vhtCapability;
+ tANI_U8 vhtTxChannelWidthSet;
+ tANI_U8 apCenterChan;
+ tANI_U8 apChanWidth;
+#endif
+} tSirSmeHTProfile;
+#endif
/// Definition for response message to previously
/// issued start BSS request
/// MAC --->
@@ -734,6 +753,9 @@ typedef struct sSirSmeStartBssRsp
tANI_U16 beaconInterval;//Beacon Interval for both type
tANI_U32 staId;//Staion ID for Self
tSirBssDescription bssDescription;//Peer BSS description
+#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
+ tSirSmeHTProfile HTProfile;
+#endif
} tSirSmeStartBssRsp, *tpSirSmeStartBssRsp;
@@ -1032,6 +1054,9 @@ typedef struct sSirSmeJoinReq
tSirMacAddr selfMacAddr; // self Mac address
tSirBssType bsstype; // add new type for BT -AMP STA and AP Modules
tANI_U8 dot11mode; // to support BT-AMP
+#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
+ tANI_U8 cc_switch_mode;
+#endif
tVOS_CON_MODE staPersona; //Persona
ePhyChanBondState cbMode; // Pass CB mode value in Join.
@@ -1142,6 +1167,9 @@ typedef struct sSirSmeJoinRsp
tANI_U8 timingMeasCap;
tANI_U8 frames[ 1 ];
+#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
+ tSirSmeHTProfile HTProfile;
+#endif
} tSirSmeJoinRsp, *tpSirSmeJoinRsp;
/// Definition for Authentication indication from peer
diff --git a/CORE/MAC/src/pe/include/limSession.h b/CORE/MAC/src/pe/include/limSession.h
index 9546b0ace976..8ce8cf4915d9 100644
--- a/CORE/MAC/src/pe/include/limSession.h
+++ b/CORE/MAC/src/pe/include/limSession.h
@@ -417,6 +417,9 @@ typedef struct sPESession // Added to Support BT-AMP
/* Flag to indicate Chan Sw announcement is required */
tANI_U8 dfsIncludeChanSwIe;
+#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
+ tANI_U8 cc_switch_mode;
+#endif
}tPESession, *tpPESession;
#define LIM_MAX_ACTIVE_SESSIONS 4
diff --git a/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c b/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c
index d506ec0eeb69..fa62695dfe23 100644
--- a/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c
+++ b/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c
@@ -629,8 +629,10 @@ __limHandleSmeStartBssRequest(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf)
psessionEntry->maxTxPower = cfgGetRegulatoryMaxTransmitPower( pMac,
psessionEntry->currentOperChannel );
/* Store the dot 11 mode in to the session Table*/
-
psessionEntry->dot11mode = pSmeStartBssReq->dot11mode;
+#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
+ psessionEntry->cc_switch_mode = pSmeStartBssReq->cc_switch_mode;
+#endif
psessionEntry->htCapability = IS_DOT11_MODE_HT(psessionEntry->dot11mode);
#ifdef WLAN_FEATURE_11AC
psessionEntry->vhtCapability = IS_DOT11_MODE_VHT(psessionEntry->dot11mode);
@@ -1761,6 +1763,9 @@ __limProcessSmeJoinReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf)
/* Copy the dot 11 mode in to the session table */
psessionEntry->dot11mode = pSmeJoinReq->dot11mode;
+#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
+ psessionEntry->cc_switch_mode = pSmeJoinReq->cc_switch_mode;
+#endif
psessionEntry->nwType = pSmeJoinReq->bssDescription.nwType;
psessionEntry->enableAmpduPs = pSmeJoinReq->enableAmpduPs;
psessionEntry->enableHtSmps = pSmeJoinReq->enableHtSmps;
diff --git a/CORE/MAC/src/pe/lim/limSendSmeRspMessages.c b/CORE/MAC/src/pe/lim/limSendSmeRspMessages.c
index 803b7c19d296..20e9b414e12b 100644
--- a/CORE/MAC/src/pe/lim/limSendSmeRspMessages.c
+++ b/CORE/MAC/src/pe/lim/limSendSmeRspMessages.c
@@ -383,6 +383,30 @@ limSendSmeJoinReassocRsp(tpAniSirGlobal pMac, tANI_U16 msgType,
#ifdef WLAN_FEATURE_VOWIFI_11R_DEBUG
PELOG1(limLog(pMac, LOG1, FL("AssocRsp=%d"), psessionEntry->assocRspLen);)
#endif
+#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
+ if (psessionEntry->cc_switch_mode != VOS_MCC_TO_SCC_SWITCH_DISABLE) {
+ pSirSmeJoinRsp->HTProfile.htSupportedChannelWidthSet =
+ psessionEntry->htSupportedChannelWidthSet;
+ pSirSmeJoinRsp->HTProfile.htRecommendedTxWidthSet =
+ psessionEntry->htRecommendedTxWidthSet;
+ pSirSmeJoinRsp->HTProfile.htSecondaryChannelOffset =
+ psessionEntry->htSecondaryChannelOffset;
+ pSirSmeJoinRsp->HTProfile.dot11mode =
+ psessionEntry->dot11mode;
+ pSirSmeJoinRsp->HTProfile.htCapability =
+ psessionEntry->htCapability;
+#ifdef WLAN_FEATURE_11AC
+ pSirSmeJoinRsp->HTProfile.vhtCapability =
+ psessionEntry->vhtCapability;
+ pSirSmeJoinRsp->HTProfile.vhtTxChannelWidthSet =
+ psessionEntry->vhtTxChannelWidthSet;
+ pSirSmeJoinRsp->HTProfile.apCenterChan =
+ psessionEntry->apCenterChan;
+ pSirSmeJoinRsp->HTProfile.apChanWidth =
+ psessionEntry->apChanWidth;
+#endif
+ }
+#endif
}
else
{
@@ -570,6 +594,31 @@ limSendSmeStartBssRsp(tpAniSirGlobal pMac,
ieLen;
//This is the size of the message, subtracting the size of the pointer to ieFields
size += ieLen - sizeof(tANI_U32);
+#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
+ if (psessionEntry->cc_switch_mode
+ != VOS_MCC_TO_SCC_SWITCH_DISABLE) {
+ pSirSmeRsp->HTProfile.htSupportedChannelWidthSet =
+ psessionEntry->htSupportedChannelWidthSet;
+ pSirSmeRsp->HTProfile.htRecommendedTxWidthSet =
+ psessionEntry->htRecommendedTxWidthSet;
+ pSirSmeRsp->HTProfile.htSecondaryChannelOffset =
+ psessionEntry->htSecondaryChannelOffset;
+ pSirSmeRsp->HTProfile.dot11mode =
+ psessionEntry->dot11mode;
+ pSirSmeRsp->HTProfile.htCapability =
+ psessionEntry->htCapability;
+#ifdef WLAN_FEATURE_11AC
+ pSirSmeRsp->HTProfile.vhtCapability =
+ psessionEntry->vhtCapability;
+ pSirSmeRsp->HTProfile.vhtTxChannelWidthSet =
+ psessionEntry->vhtTxChannelWidthSet;
+ pSirSmeRsp->HTProfile.apCenterChan =
+ psessionEntry->apCenterChan;
+ pSirSmeRsp->HTProfile.apChanWidth =
+ psessionEntry->apChanWidth;
+#endif
+ }
+#endif
}
diff --git a/CORE/MAC/src/pe/lim/limSerDesUtils.c b/CORE/MAC/src/pe/lim/limSerDesUtils.c
index 05cd4ab88aa4..d24f2fdb32bc 100644
--- a/CORE/MAC/src/pe/lim/limSerDesUtils.c
+++ b/CORE/MAC/src/pe/lim/limSerDesUtils.c
@@ -539,6 +539,14 @@ limStartBssReqSerDes(tpAniSirGlobal pMac, tpSirSmeStartBssReq pStartBssReq, tANI
if (limCheckRemainingLength(pMac, len) == eSIR_FAILURE)
return eSIR_FAILURE;
+#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
+ // Extract mcc to scc switch mode
+ pStartBssReq->cc_switch_mode = *pBuf++;
+ len --;
+ if (limCheckRemainingLength(pMac, len) == eSIR_FAILURE)
+ return eSIR_FAILURE;
+#endif
+
// Extract bssType
pStartBssReq->bssType = (tSirBssType) limGetU32(pBuf);
pBuf += sizeof(tANI_U32);
@@ -964,6 +972,17 @@ limJoinReqSerDes(tpAniSirGlobal pMac, tpSirSmeJoinReq pJoinReq, tANI_U8 *pBuf)
return eSIR_FAILURE;
}
+#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
+ // Extract mcc to scc switch mode
+ pJoinReq->cc_switch_mode= *pBuf++;
+ len--;
+ if (limCheckRemainingLength(pMac, len) == eSIR_FAILURE)
+ {
+ limLog(pMac, LOGE, FL("remaining len %d is too short"), len);
+ return eSIR_FAILURE;
+ }
+#endif
+
// Extract bssPersona
pJoinReq->staPersona = *pBuf++;
len--;
diff --git a/CORE/SAP/inc/sapApi.h b/CORE/SAP/inc/sapApi.h
index f7d4b3193be5..c2d6f94fd173 100644
--- a/CORE/SAP/inc/sapApi.h
+++ b/CORE/SAP/inc/sapApi.h
@@ -464,6 +464,9 @@ typedef struct sap_Config {
v_BOOL_t mfpRequired;
v_BOOL_t mfpCapable;
#endif
+#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
+ v_U8_t cc_switch_mode;
+#endif
} tsap_Config_t;
typedef enum {
@@ -940,6 +943,24 @@ WLANSAP_StartBss
v_PVOID_t pUsrContext
);
+#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
+/*==========================================================================
+ FUNCTION WLANSAP_CheckCCIntf
+
+ DESCRIPTION Restart SAP if Concurrent Channel interfering
+
+ DEPENDENCIES NA.
+
+ PARAMETERS
+ IN
+ Ctx: Pointer to vos Context or Sap Context based on MBSSID
+
+ RETURN VALUE Interference channel value
+
+ SIDE EFFECTS
+============================================================================*/
+v_U16_t WLANSAP_CheckCCIntf(v_PVOID_t Ctx);
+#endif
/*==========================================================================
FUNCTION WLANSAP_SetMacACL
diff --git a/CORE/SAP/src/sapFsm.c b/CORE/SAP/src/sapFsm.c
index 01809af31984..c42df017275d 100644
--- a/CORE/SAP/src/sapFsm.c
+++ b/CORE/SAP/src/sapFsm.c
@@ -296,7 +296,9 @@ sapGotoChannelSel
v_U8_t numOfChannels = 0 ;
#endif
tHalHandle hHal;
+#ifndef FEATURE_WLAN_MCC_TO_SCC_SWITCH
tANI_U8 channel;
+#endif
hHal = (tHalHandle)vos_get_context( VOS_MODULE_ID_SME, sapContext->pvosGCtx);
if (NULL == hHal)
@@ -307,11 +309,11 @@ sapGotoChannelSel
return VOS_STATUS_E_FAULT;
}
+#ifndef FEATURE_WLAN_MCC_TO_SCC_SWITCH
/*If STA-AP concurrency is enabled take the concurrent connected channel first. In other cases wpa_supplicant should take care */
if (vos_get_concurrency_mode() == VOS_STA_SAP)
{
channel = sme_GetConcurrentOperationChannel(hHal);
-
if (channel)
{ /*if a valid channel is returned then use concurrent channel.
Else take whatever comes from configuartion*/
@@ -321,6 +323,7 @@ sapGotoChannelSel
channel);
}
}
+#endif
if (sapContext->channel == AUTO_CHANNEL_SELECT)
{
@@ -1036,6 +1039,30 @@ sapFsm
if (msg == eSAP_MAC_SCAN_COMPLETE)
{
+#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
+ v_U16_t cc_ch;
+ tHalHandle hHal = VOS_GET_HAL_CB(sapContext->pvosGCtx);
+ if (NULL != hHal &&
+ sapContext->cc_switch_mode != VOS_MCC_TO_SCC_SWITCH_DISABLE)
+ {
+ cc_ch = sme_CheckConcurrentChannelOverlap(hHal,
+ sapContext->channel,
+ sapConvertSapPhyModeToCsrPhyMode(
+ sapContext->csrRoamProfile.phyMode),
+ sapContext->cc_switch_mode);
+ if (cc_ch)
+ {
+ VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
+ "%s: Override Chosen Ch:%d to %d due to CC Intf!!",
+ __func__,sapContext->channel, cc_ch);
+ sapContext->channel = cc_ch;
+ sme_SelectCBMode(hHal,
+ sapConvertSapPhyModeToCsrPhyMode(
+ sapContext->csrRoamProfile.phyMode),
+ sapContext->channel);
+ }
+ }
+#endif
/* Transition from eSAP_CH_SELECT to eSAP_STARTING (both without substates) */
VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, from state %s => %s",
__func__, "eSAP_CH_SELECT", "eSAP_STARTING");
@@ -1262,7 +1289,7 @@ sapFsm
"In %s, Send CSA IE Request", __func__);
/* Request for CSA IE transmission */
- WLANSAP_DfsSendCSAIeRequest((v_PVOID_t)sapContext);
+ vosStatus = WLANSAP_DfsSendCSAIeRequest((v_PVOID_t)sapContext);
}
else
{
diff --git a/CORE/SAP/src/sapInternal.h b/CORE/SAP/src/sapInternal.h
index b94e92e47aea..a54954c8ed37 100644
--- a/CORE/SAP/src/sapInternal.h
+++ b/CORE/SAP/src/sapInternal.h
@@ -278,6 +278,9 @@ typedef struct sSapContext {
v_U16_t acsBandSwitchThreshold;
tSapAcsChannelInfo acsBestChannelInfo;
tANI_BOOLEAN enableOverLapCh;
+#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
+ v_U8_t cc_switch_mode;
+#endif
} *ptSapContext;
diff --git a/CORE/SAP/src/sapModule.c b/CORE/SAP/src/sapModule.c
index 08480ac42723..90605a037f46 100644
--- a/CORE/SAP/src/sapModule.c
+++ b/CORE/SAP/src/sapModule.c
@@ -567,6 +567,40 @@ v_U8_t WLANSAP_getState
return pSapCtx->sapsMachine;
}
+#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
+/*==========================================================================
+ FUNCTION WLANSAP_CheckCCIntf
+
+ DESCRIPTION Restart SAP if Concurrent Channel interfering
+
+ DEPENDENCIES NA.
+
+ PARAMETERS
+ IN
+ Ctx: Pointer to vos Context or Sap Context based on MBSSID
+
+ RETURN VALUE NONE
+
+ SIDE EFFECTS
+============================================================================*/
+v_U16_t WLANSAP_CheckCCIntf(v_PVOID_t Ctx)
+{
+ tHalHandle hHal;
+ v_U16_t intf_ch;
+ ptSapContext pSapCtx = VOS_GET_SAP_CB(Ctx);
+
+ hHal = (tHalHandle)VOS_GET_HAL_CB(pSapCtx->pvosGCtx);
+ if (NULL == hHal)
+ {
+ VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
+ "%s: Invalid MAC context from pvosGCtx", __func__);
+ return 0;
+ }
+ intf_ch = sme_CheckConcurrentChannelOverlap(hHal, 0, 0,
+ pSapCtx->cc_switch_mode);
+ return intf_ch;
+}
+#endif
/*==========================================================================
FUNCTION WLANSAP_StartBss
@@ -635,6 +669,9 @@ WLANSAP_StartBss
/* Channel selection is auto or configured */
pSapCtx->channel = pConfig->channel;
+#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
+ pSapCtx->cc_switch_mode = pConfig->cc_switch_mode;
+#endif
pSapCtx->scanBandPreference = pConfig->scanBandPreference;
pSapCtx->acsBandSwitchThreshold = pConfig->acsBandSwitchThreshold;
pSapCtx->pUsrContext = pUsrContext;
diff --git a/CORE/SME/inc/csrApi.h b/CORE/SME/inc/csrApi.h
index 6ed035c5bace..b00e746a7914 100644
--- a/CORE/SME/inc/csrApi.h
+++ b/CORE/SME/inc/csrApi.h
@@ -908,6 +908,22 @@ typedef struct tagCsrRoamProfile
}tCsrRoamProfile;
+#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
+typedef struct tagCsrRoamHTProfile
+{
+ eCsrPhyMode phymode;
+ tANI_U8 htCapability;
+ tANI_U8 htSupportedChannelWidthSet;
+ tANI_U8 htRecommendedTxWidthSet;
+ ePhyChanBondState htSecondaryChannelOffset;
+#ifdef WLAN_FEATURE_11AC
+ tANI_U8 vhtCapability;
+ tANI_U8 vhtTxChannelWidthSet;
+ tANI_U8 apCenterChan;
+ tANI_U8 apChanWidth;
+#endif
+}tCsrRoamHTProfile;
+#endif
typedef struct tagCsrRoamConnectedProfile
{
tSirMacSSid SSID;
@@ -947,6 +963,9 @@ typedef struct tagCsrRoamConnectedProfile
#endif
tANI_U32 dot11Mode;
tANI_U8 proxyARPService;
+#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
+ tCsrRoamHTProfile HTProfile;
+#endif
}tCsrRoamConnectedProfile;
@@ -1147,6 +1166,9 @@ typedef struct tagCsrConfigParam
tANI_U8 isCoalesingInIBSSAllowed;
eCsrBand scanBandPreference;
+#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
+ tANI_U8 cc_switch_mode;
+#endif
}tCsrConfigParam;
//Tush
diff --git a/CORE/SME/inc/csrInternal.h b/CORE/SME/inc/csrInternal.h
index a837418cd48c..707d35a4e106 100644
--- a/CORE/SME/inc/csrInternal.h
+++ b/CORE/SME/inc/csrInternal.h
@@ -676,6 +676,9 @@ typedef struct tagCsrConfig
tANI_U8 isAmsduSupportInAMPDU;
tANI_U8 nSelect5GHzMargin;
tANI_U8 isCoalesingInIBSSAllowed;
+#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
+ tANI_U8 cc_switch_mode;
+#endif
}tCsrConfig;
typedef struct tagCsrChannelPowerInfo
@@ -1392,6 +1395,10 @@ tANI_S8 csrGetInfraSessionId( tpAniSirGlobal pMac );
tANI_U8 csrGetInfraOperationChannel( tpAniSirGlobal pMac, tANI_U8 sessionId);
tANI_U8 csrGetConcurrentOperationChannel( tpAniSirGlobal pMac );
+#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
+v_U16_t csrCheckConcurrentChannelOverlap(tpAniSirGlobal pMac, v_U16_t sap_ch,
+ eCsrPhyMode sap_phymode, v_U8_t cc_switch_mode );
+#endif
eHalStatus csrRoamCopyConnectProfile(tpAniSirGlobal pMac, tANI_U32 sessionId,
tCsrRoamConnectedProfile *pProfile);
tANI_BOOLEAN csrIsSetKeyAllowed(tpAniSirGlobal pMac, tANI_U32 sessionId);
diff --git a/CORE/SME/inc/sme_Api.h b/CORE/SME/inc/sme_Api.h
index 4213e45e1600..632ea783d6f5 100644
--- a/CORE/SME/inc/sme_Api.h
+++ b/CORE/SME/inc/sme_Api.h
@@ -2146,6 +2146,10 @@ tANI_U8 sme_GetInfraOperationChannel( tHalHandle hHal, tANI_U8 sessionId);
-------------------------------------------------------------------------------*/
tANI_U8 sme_GetConcurrentOperationChannel( tHalHandle hHal );
+#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
+v_U16_t sme_CheckConcurrentChannelOverlap( tHalHandle hHal, v_U16_t sap_ch,
+ eCsrPhyMode sapPhyMode, v_U8_t cc_switch_mode);
+#endif
/* ---------------------------------------------------------------------------
\fn sme_AbortMacScan
\brief API to cancel MAC scan.
diff --git a/CORE/SME/src/csr/csrApiRoam.c b/CORE/SME/src/csr/csrApiRoam.c
index a96612cd4d63..6d2e591fedd3 100644
--- a/CORE/SME/src/csr/csrApiRoam.c
+++ b/CORE/SME/src/csr/csrApiRoam.c
@@ -1825,6 +1825,9 @@ eHalStatus csrChangeDefaultConfigParam(tpAniSirGlobal pMac, tCsrConfigParam *pPa
pMac->roam.configParam.nSelect5GHzMargin = pParam->nSelect5GHzMargin;
pMac->roam.configParam.isCoalesingInIBSSAllowed =
pParam->isCoalesingInIBSSAllowed;
+#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
+ pMac->roam.configParam.cc_switch_mode = pParam->cc_switch_mode;
+#endif
}
return status;
@@ -1953,6 +1956,9 @@ eHalStatus csrGetConfigParam(tpAniSirGlobal pMac, tCsrConfigParam *pParam)
}
#endif
+#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
+ pParam->cc_switch_mode = pMac->roam.configParam.cc_switch_mode;
+#endif
pParam->enableTxLdpc = pMac->roam.configParam.txLdpcEnable;
pParam->isAmsduSupportInAMPDU = pMac->roam.configParam.isAmsduSupportInAMPDU;
@@ -5231,6 +5237,56 @@ tANI_BOOLEAN csrRoamIsEseIniFeatureEnabled(tpAniSirGlobal pMac)
}
#endif /*FEATURE_WLAN_ESE*/
+#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
+eCsrPhyMode csrRoamdot11modeToPhymode(tANI_U8 dot11mode)
+{
+ eCsrPhyMode phymode = eCSR_DOT11_MODE_abg;
+
+ switch (dot11mode)
+ {
+ case WNI_CFG_DOT11_MODE_ALL:
+ phymode = eCSR_DOT11_MODE_abg;
+ break;
+ case WNI_CFG_DOT11_MODE_11A:
+ phymode = eCSR_DOT11_MODE_11a;
+ break;
+ case WNI_CFG_DOT11_MODE_11B:
+ phymode = eCSR_DOT11_MODE_11b;
+ break;
+ case WNI_CFG_DOT11_MODE_11G:
+ phymode = eCSR_DOT11_MODE_11g;
+ break;
+ case WNI_CFG_DOT11_MODE_11N:
+ phymode = eCSR_DOT11_MODE_11n;
+ break;
+ case WNI_CFG_DOT11_MODE_POLARIS:
+ phymode = eCSR_DOT11_MODE_POLARIS;
+ break;
+ case WNI_CFG_DOT11_MODE_TITAN:
+ phymode = eCSR_DOT11_MODE_TITAN;
+ break;
+ case WNI_CFG_DOT11_MODE_TAURUS:
+ phymode = eCSR_DOT11_MODE_TAURUS;
+ break;
+ case WNI_CFG_DOT11_MODE_11G_ONLY:
+ phymode = eCSR_DOT11_MODE_11g_ONLY;
+ break;
+ case WNI_CFG_DOT11_MODE_11N_ONLY:
+ phymode = eCSR_DOT11_MODE_11n_ONLY;
+ break;
+ case WNI_CFG_DOT11_MODE_11AC:
+ phymode = eCSR_DOT11_MODE_11ac;
+ break;
+ case WNI_CFG_DOT11_MODE_11AC_ONLY:
+ phymode = eCSR_DOT11_MODE_11ac_ONLY;
+ break;
+ default:
+ break;
+ }
+
+ return phymode;
+}
+#endif
//Return true means the command can be release, else not
static tANI_BOOLEAN csrRoamProcessResults( tpAniSirGlobal pMac, tSmeCmd *pCommand,
eCsrRoamCompleteResult Result, void *Context )
@@ -5454,6 +5510,31 @@ static tANI_BOOLEAN csrRoamProcessResults( tpAniSirGlobal pMac, tSmeCmd *pComman
roamInfo.ucastSig = ( tANI_U8 )pJoinRsp->ucastSig;
roamInfo.bcastSig = ( tANI_U8 )pJoinRsp->bcastSig;
roamInfo.timingMeasCap = pJoinRsp->timingMeasCap;
+#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
+ if (pMac->roam.configParam.cc_switch_mode
+ != VOS_MCC_TO_SCC_SWITCH_DISABLE) {
+ pSession->connectedProfile.HTProfile.phymode =
+ csrRoamdot11modeToPhymode(pJoinRsp->HTProfile.dot11mode);
+ pSession->connectedProfile.HTProfile.htCapability =
+ pJoinRsp->HTProfile.htCapability;
+ pSession->connectedProfile.HTProfile.htSupportedChannelWidthSet =
+ pJoinRsp->HTProfile.htSupportedChannelWidthSet;
+ pSession->connectedProfile.HTProfile.htRecommendedTxWidthSet =
+ pJoinRsp->HTProfile.htRecommendedTxWidthSet;
+ pSession->connectedProfile.HTProfile.htSecondaryChannelOffset =
+ pJoinRsp->HTProfile.htSecondaryChannelOffset;
+#ifdef WLAN_FEATURE_11AC
+ pSession->connectedProfile.HTProfile.vhtCapability =
+ pJoinRsp->HTProfile.vhtCapability;
+ pSession->connectedProfile.HTProfile.vhtTxChannelWidthSet =
+ pJoinRsp->HTProfile.vhtTxChannelWidthSet;
+ pSession->connectedProfile.HTProfile.apCenterChan =
+ pJoinRsp->HTProfile.apCenterChan;
+ pSession->connectedProfile.HTProfile.apChanWidth =
+ pJoinRsp->HTProfile.apChanWidth;
+#endif
+ }
+#endif
}
else
{
@@ -5708,6 +5789,31 @@ static tANI_BOOLEAN csrRoamProcessResults( tpAniSirGlobal pMac, tSmeCmd *pComman
pMac->roam.configParam.doBMPSWorkaround = 1;
}
+#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
+ if (pMac->roam.configParam.cc_switch_mode
+ != VOS_MCC_TO_SCC_SWITCH_DISABLE) {
+ pSession->connectedProfile.HTProfile.phymode =
+ csrRoamdot11modeToPhymode(pSmeStartBssRsp->HTProfile.dot11mode);
+ pSession->connectedProfile.HTProfile.htCapability =
+ pSmeStartBssRsp->HTProfile.htCapability;
+ pSession->connectedProfile.HTProfile.htSupportedChannelWidthSet =
+ pSmeStartBssRsp->HTProfile.htSupportedChannelWidthSet;
+ pSession->connectedProfile.HTProfile.htRecommendedTxWidthSet =
+ pSmeStartBssRsp->HTProfile.htRecommendedTxWidthSet;
+ pSession->connectedProfile.HTProfile.htSecondaryChannelOffset =
+ pSmeStartBssRsp->HTProfile.htSecondaryChannelOffset;
+#ifdef WLAN_FEATURE_11AC
+ pSession->connectedProfile.HTProfile.vhtCapability =
+ pSmeStartBssRsp->HTProfile.vhtCapability;
+ pSession->connectedProfile.HTProfile.vhtTxChannelWidthSet =
+ pSmeStartBssRsp->HTProfile.vhtTxChannelWidthSet;
+ pSession->connectedProfile.HTProfile.apCenterChan =
+ pSmeStartBssRsp->HTProfile.apCenterChan;
+ pSession->connectedProfile.HTProfile.apChanWidth =
+ pSmeStartBssRsp->HTProfile.apChanWidth;
+#endif
+ }
+#endif
csrRoamCallCallback( pMac, sessionId, &roamInfo, pCommand->u.roamCmd.roamId, roamStatus, roamResult );
}
@@ -12624,6 +12730,10 @@ eHalStatus csrSendJoinReqMsg( tpAniSirGlobal pMac, tANI_U32 sessionId, tSirBssDe
}
*pBuf = (tANI_U8)ucDot11Mode;
pBuf++;
+#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
+ *pBuf = pMac->roam.configParam.cc_switch_mode;
+ pBuf += 1;
+#endif
//Persona
*pBuf = (tANI_U8)pProfile->csrPersona;
pBuf++;
@@ -13854,6 +13964,11 @@ eHalStatus csrSendMBStartBssReqMsg( tpAniSirGlobal pMac, tANI_U32 sessionId, eCs
// dot11mode
*pBuf = (tANI_U8)csrTranslateToWNICfgDot11Mode( pMac, pParam->uCfgDot11Mode );
pBuf += 1;
+#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
+ *pBuf = pMac->roam.configParam.cc_switch_mode;
+ pBuf += 1;
+#endif
+
// bssType
dwTmp = pal_cpu_to_be32( csrTranslateBsstypeToMacType( bssType ) );
vos_mem_copy(pBuf, &dwTmp, sizeof(tSirBssType));
diff --git a/CORE/SME/src/csr/csrUtil.c b/CORE/SME/src/csr/csrUtil.c
index 00cdecf968e3..89414d9429ea 100644
--- a/CORE/SME/src/csr/csrUtil.c
+++ b/CORE/SME/src/csr/csrUtil.c
@@ -43,9 +43,9 @@
#include "smsDebug.h"
#include "smeQosInternal.h"
#include "wlan_qct_wda.h"
+#include "vos_utils.h"
#if defined(FEATURE_WLAN_ESE) && !defined(FEATURE_WLAN_ESE_UPLOAD)
-#include "vos_utils.h"
#include "csrEse.h"
#endif /* FEATURE_WLAN_ESE && !FEATURE_WLAN_ESE_UPLOAD*/
@@ -1462,6 +1462,171 @@ tANI_U8 csrGetConcurrentOperationChannel( tpAniSirGlobal pMac )
}
return 0;
}
+#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
+void csrGetChFromHTProfile (tpAniSirGlobal pMac, tCsrRoamHTProfile *htp,
+ tANI_U16 och, tANI_U16 *cfreq, tANI_U16 *hbw)
+{
+ tANI_U16 cch, ch_bond;
+
+ if (och > 14)
+ ch_bond = pMac->roam.configParam.channelBondingMode5GHz;
+ else
+ ch_bond = pMac->roam.configParam.channelBondingMode24GHz;
+
+ cch = och;
+ *hbw = 10;
+
+ if (!ch_bond) {
+ goto ret;
+ }
+ smsLog(pMac, LOG1,
+ FL("##HTC: %d scbw: %d rcbw: %d sco: %d"
+#ifdef WLAN_FEATURE_11AC
+ "VHTC: %d apc: %d apbw: %d"
+#endif
+ ),
+ htp->htCapability, htp->htSupportedChannelWidthSet,
+ htp->htRecommendedTxWidthSet, htp->htSecondaryChannelOffset,
+#ifdef WLAN_FEATURE_11AC
+ htp->vhtCapability, htp->apCenterChan, htp->apChanWidth
+#endif
+ );
+
+#ifdef WLAN_FEATURE_11AC
+ if (htp->vhtCapability) {
+ cch = htp->apCenterChan;
+ *hbw = (htp->apChanWidth * 80) / 2;
+
+ if (!*hbw && htp->htCapability) {
+ if (htp->htSupportedChannelWidthSet == eHT_CHANNEL_WIDTH_40MHZ)
+ *hbw = 20;
+ else
+ *hbw = 10;
+ }
+ } else
+#endif
+ if (htp->htCapability) {
+ if (htp->htSupportedChannelWidthSet == eHT_CHANNEL_WIDTH_40MHZ) {
+ *hbw = 20;
+ if (htp->htSecondaryChannelOffset == PHY_DOUBLE_CHANNEL_LOW_PRIMARY)
+ cch = och + *hbw/10;
+ else if (htp->htSecondaryChannelOffset ==
+ PHY_DOUBLE_CHANNEL_HIGH_PRIMARY)
+ cch = och - *hbw/10;
+ } else {
+ cch = och;
+ *hbw = 10;
+ }
+ }
+
+ret:
+ *cfreq = vos_chan_to_freq(cch);
+ return;
+}
+
+v_U16_t csrCheckConcurrentChannelOverlap(tpAniSirGlobal pMac, v_U16_t sap_ch,
+ eCsrPhyMode sap_phymode, v_U8_t cc_switch_mode)
+{
+ tCsrRoamSession *pSession = NULL;
+ v_U8_t i = 0, chb = PHY_SINGLE_CHANNEL_CENTERED;
+ v_U16_t intf_ch=0, sap_hbw = 0, intf_hbw = 0, intf_cfreq = 0, sap_cfreq = 0;
+ v_U16_t sap_lfreq, sap_hfreq, intf_lfreq, intf_hfreq;
+
+ if (pMac->roam.configParam.cc_switch_mode == VOS_MCC_TO_SCC_SWITCH_DISABLE)
+ return 0;
+
+ if (sap_ch !=0) {
+
+ sap_cfreq = vos_chan_to_freq(sap_ch);
+ sap_hbw = 20/2;
+
+ if (sap_ch > 14)
+ chb = pMac->roam.configParam.channelBondingMode5GHz;
+ else
+ chb = pMac->roam.configParam.channelBondingMode24GHz;
+
+ if (chb) {
+ if (sap_phymode == eCSR_DOT11_MODE_11n ||
+ sap_phymode == eCSR_DOT11_MODE_11n_ONLY)
+ sap_hbw = 40/2;
+ else if (sap_phymode == eCSR_DOT11_MODE_11ac ||
+ sap_phymode == eCSR_DOT11_MODE_11ac_ONLY)
+ sap_hbw = 80/2;
+ }
+ }
+
+ for( i = 0; i < CSR_ROAM_SESSION_MAX; i++ ) {
+ if( !CSR_IS_SESSION_VALID( pMac, i ) )
+ continue;
+
+ pSession = CSR_GET_SESSION( pMac, i );
+
+ if (NULL != pSession->pCurRoamProfile) {
+ if (((pSession->pCurRoamProfile->csrPersona == VOS_STA_MODE) ||
+ (pSession->pCurRoamProfile->csrPersona ==
+ VOS_P2P_CLIENT_MODE)) &&
+ (pSession->connectState ==
+ eCSR_ASSOC_STATE_TYPE_INFRA_ASSOCIATED)) {
+ intf_ch = pSession->connectedProfile.operationChannel;
+ csrGetChFromHTProfile(pMac,
+ &pSession->connectedProfile.HTProfile, intf_ch,
+ &intf_cfreq, &intf_hbw);
+ } else if(((pSession->pCurRoamProfile->csrPersona ==
+ VOS_P2P_GO_MODE) ||
+ (pSession->pCurRoamProfile->csrPersona ==
+ VOS_STA_SAP_MODE)) &&
+ (pSession->connectState !=
+ eCSR_ASSOC_STATE_TYPE_NOT_CONNECTED)) {
+ if (sap_ch == 0) {
+ sap_ch = pSession->connectedProfile.operationChannel;
+ csrGetChFromHTProfile(pMac,
+ &pSession->connectedProfile.HTProfile, sap_ch,
+ &sap_cfreq, &sap_hbw);
+ } else if (sap_ch !=
+ pSession->connectedProfile.operationChannel) {
+ intf_ch = pSession->connectedProfile.operationChannel;
+ csrGetChFromHTProfile(pMac,
+ &pSession->connectedProfile.HTProfile, intf_ch,
+ &intf_cfreq, &intf_hbw);
+ }
+ }
+ }
+ }
+
+
+ if (intf_ch && sap_ch != intf_ch &&
+ cc_switch_mode != VOS_MCC_TO_SCC_SWITCH_FORCE) {
+ sap_lfreq = sap_cfreq - sap_hbw;
+ sap_hfreq = sap_cfreq + sap_hbw;
+ intf_lfreq = intf_cfreq -intf_hbw;
+ intf_hfreq = intf_cfreq +intf_hbw;
+
+ smsLog(pMac, LOGE,
+ FL("\nSAP: OCH: %03d OCF: %d CCH: %03d CF: %d BW: %d LF: %d HF: %d\n"
+ "INTF: OCH: %03d OCF: %d CCH: %03d CF: %d BW: %d LF: %d HF: %d"),
+ sap_ch, vos_chan_to_freq(sap_ch), vos_freq_to_chan(sap_cfreq),
+ sap_cfreq, sap_hbw*2, sap_lfreq, sap_hfreq,
+ intf_ch, vos_chan_to_freq(intf_ch),
+ vos_freq_to_chan(intf_cfreq),
+ intf_cfreq, intf_hbw*2, intf_lfreq, intf_hfreq);
+
+ if ( !((sap_lfreq >= intf_lfreq && sap_lfreq <= intf_hfreq)
+ || (sap_hfreq >= intf_lfreq && sap_hfreq <= intf_hfreq)) ) {
+ intf_ch = 0;
+ }
+ }
+ else if (intf_ch && sap_ch!= intf_ch &&
+ cc_switch_mode == VOS_MCC_TO_SCC_SWITCH_FORCE) {
+ if (!((intf_ch < 14 && sap_ch < 14) || (intf_ch > 14 && sap_ch > 14)))
+ intf_ch = 0;
+ }else if (intf_ch == sap_ch)
+ intf_ch = 0;
+
+ smsLog(pMac, LOGE, FL("##Concurrent Channels %s Interfering"), intf_ch == 0 ?
+ "Not" : "Are" );
+ return intf_ch;
+}
+#endif
tANI_BOOLEAN csrIsAllSessionDisconnected( tpAniSirGlobal pMac )
{
diff --git a/CORE/SME/src/sme_common/sme_Api.c b/CORE/SME/src/sme_common/sme_Api.c
index 2d75ed2fd835..5891dc914cea 100644
--- a/CORE/SME/src/sme_common/sme_Api.c
+++ b/CORE/SME/src/sme_common/sme_Api.c
@@ -7473,6 +7473,25 @@ tANI_U8 sme_GetConcurrentOperationChannel( tHalHandle hHal )
return (channel);
}
+#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
+v_U16_t sme_CheckConcurrentChannelOverlap( tHalHandle hHal, v_U16_t sap_ch,
+ eCsrPhyMode sapPhyMode, v_U8_t cc_switch_mode)
+{
+ eHalStatus status = eHAL_STATUS_FAILURE;
+ tpAniSirGlobal pMac = PMAC_STRUCT( hHal );
+ v_U16_t channel = 0;
+
+ status = sme_AcquireGlobalLock( &pMac->sme );
+ if ( HAL_STATUS_SUCCESS( status ) )
+ {
+ channel = csrCheckConcurrentChannelOverlap( pMac, sap_ch, sapPhyMode,
+ cc_switch_mode);
+ sme_ReleaseGlobalLock( &pMac->sme );
+ }
+
+ return (channel);
+}
+#endif
#ifdef FEATURE_WLAN_SCAN_PNO
/******************************************************************************
diff --git a/CORE/VOSS/inc/vos_types.h b/CORE/VOSS/inc/vos_types.h
index 62866c48a4c2..0c72d248427b 100644
--- a/CORE/VOSS/inc/vos_types.h
+++ b/CORE/VOSS/inc/vos_types.h
@@ -168,6 +168,16 @@ typedef enum
VOS_P2P_GO=8,
} tVOS_CONCURRENCY_MODE;
+#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
+typedef enum
+{
+ VOS_MCC_TO_SCC_SWITCH_DISABLE = 0,
+ VOS_MCC_TO_SCC_SWITCH_ENABLE,
+ VOS_MCC_TO_SCC_SWITCH_FORCE,
+ VOS_MCC_TO_SCC_SWITCH_MAX
+} tVOS_MCC_TO_SCC_SWITCH_MODE;
+#endif
+
#if !defined( NULL )
#ifdef __cplusplus
#define NULL 0
diff --git a/Kbuild b/Kbuild
index 070c24141c16..0b2590b1997e 100644
--- a/Kbuild
+++ b/Kbuild
@@ -169,6 +169,7 @@ ADF_INC := -I$(WLAN_ROOT)/$(ADF_DIR) \
ADF_OBJS := $(ADF_DIR)/adf_nbuf.o \
$(ADF_DIR)/adf_os_lock.o \
$(ADF_DIR)/adf_os_mem.o \
+ $(ADF_DIR)/linux/adf_os_defer_pvt.o \
$(ADF_DIR)/linux/adf_os_lock_pvt.o
endif
@@ -1124,7 +1125,7 @@ endif
#enable wlan auto shutdown feature for mdm9630
ifeq ($(CONFIG_ARCH_MDM9630), y)
-CDEFINES += -DFEATURE_WLAN_AUTO_SHUTDOWN
+CDEFINES += -DFEATURE_WLAN_AUTO_SHUTDOWN -DFEATURE_WLAN_MCC_TO_SCC_SWITCH
endif
#Open P2P device interface only for non-MDM9630 platform
diff --git a/firmware_bin/WCNSS_qcom_cfg.ini b/firmware_bin/WCNSS_qcom_cfg.ini
index b2ecb277197c..4a2e072a9b9e 100755
--- a/firmware_bin/WCNSS_qcom_cfg.ini
+++ b/firmware_bin/WCNSS_qcom_cfg.ini
@@ -404,6 +404,9 @@ gSetRxChainmask1x1=1
#If set to 0, MCC is not allowed.
gEnableMCCMode=1
+# MCC to SCC Switch mode: 0-Disable 1-Enable 2-Force SCC if same band
+gWlanMccToSccSwitchMode = 0
+
# 1=enable STBC; 0=disable STBC
gEnableRXSTBC=1