summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdhar, Mahesh Kumar <c_medhar@qti.qualcomm.com>2015-02-26 17:18:35 +0530
committerAnjaneeDevi Kapparapu <c_akappa@qti.qualcomm.com>2015-03-04 17:07:27 +0530
commitf4c7cf4dcbd41134effbcbff404170bb7cf2f274 (patch)
treed77f8edec7d7587788e0b86a1837b5b103b5c9ca
parentd5a9c66a2df1159e9bfa7f84353a9a0ef6e15d79 (diff)
qcacld: Changes to support channel switch across the bands
Currently setChanChange IOCTL restricted only to 5Ghz band. changes are made to allow channel switch across the bands. Change-Id: Ifc39e5c57ff36fa816554253cdbe5e7536c882b1 CRs-Fixed: 801141
-rw-r--r--CORE/HDD/src/wlan_hdd_hostapd.c7
-rw-r--r--CORE/MAC/inc/sirApi.h3
-rw-r--r--CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c20
-rw-r--r--CORE/SAP/src/sapModule.c29
-rw-r--r--CORE/SME/inc/csrInternal.h3
-rw-r--r--CORE/SME/inc/sme_Api.h3
-rw-r--r--CORE/SME/src/csr/csrApiRoam.c28
-rw-r--r--CORE/SME/src/sme_common/sme_Api.c16
8 files changed, 68 insertions, 41 deletions
diff --git a/CORE/HDD/src/wlan_hdd_hostapd.c b/CORE/HDD/src/wlan_hdd_hostapd.c
index a037f0932278..0b8ee7e70328 100644
--- a/CORE/HDD/src/wlan_hdd_hostapd.c
+++ b/CORE/HDD/src/wlan_hdd_hostapd.c
@@ -1857,6 +1857,13 @@ int hdd_softap_set_channel_change(struct net_device *dev, int target_channel)
return ret;
}
+ if (pHddCtx->dfs_radar_found == VOS_TRUE)
+ {
+ hddLog(VOS_TRACE_LEVEL_ERROR, "%s: Channel switch in progress!!",
+ __func__);
+ ret = -EBUSY;
+ return ret;
+ }
/*
* Set the dfs_radar_found flag to mimic channel change
* when a radar is found. This will enable synchronizing
diff --git a/CORE/MAC/inc/sirApi.h b/CORE/MAC/inc/sirApi.h
index 36cabf5bf38c..022e6826dc04 100644
--- a/CORE/MAC/inc/sirApi.h
+++ b/CORE/MAC/inc/sirApi.h
@@ -4587,6 +4587,9 @@ typedef struct sSirChanChangeRequest
tANI_U8 cbMode;
tANI_U8 vht_channel_width;
tANI_U8 bssid[VOS_MAC_ADDR_SIZE];
+ tANI_U32 dot11mode;
+ tSirMacRateSet operational_rateset;
+ tSirMacRateSet extended_rateset;
}tSirChanChangeRequest, *tpSirChanChangeRequest;
typedef struct sSirChanChangeResponse
diff --git a/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c b/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c
index df2fb652b35e..28101c72ece5 100644
--- a/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c
+++ b/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c
@@ -5974,6 +5974,7 @@ limProcessSmeChannelChangeRequest(tpAniSirGlobal pMac, tANI_U32 *pMsg)
tpPESession psessionEntry;
tANI_U8 sessionId; //PE sessionID
tPowerdBm maxTxPwr;
+ u_int32_t val = 0;
#ifdef WLAN_FEATURE_11AC
tANI_U32 centerChan;
tANI_U32 chanWidth;
@@ -6076,6 +6077,25 @@ limProcessSmeChannelChangeRequest(tpAniSirGlobal pMac, tANI_U32 *pMsg)
psessionEntry->htSupportedChannelWidthSet;
psessionEntry->currentOperChannel =
pChannelChangeReq->targetChannel;
+ psessionEntry->limRFBand =
+ limGetRFBand(psessionEntry->currentOperChannel);
+ // Initialize 11h Enable Flag
+ if (SIR_BAND_5_GHZ == psessionEntry->limRFBand)
+ {
+ if (wlan_cfgGetInt(pMac, WNI_CFG_11H_ENABLED, &val) !=
+ eSIR_SUCCESS)
+ limLog(pMac, LOGP, FL("Fail to get WNI_CFG_11H_ENABLED "));
+ }
+
+ psessionEntry->lim11hEnable = val;
+ psessionEntry->dot11mode = pChannelChangeReq->dot11mode;
+
+ vos_mem_copy((void*)&psessionEntry->rateSet,
+ (void*)&pChannelChangeReq->operational_rateset,
+ sizeof(tSirMacRateSet));
+ vos_mem_copy((void*)&psessionEntry->extRateSet,
+ (void*)&pChannelChangeReq->extended_rateset,
+ sizeof(tSirMacRateSet));
limSetChannel(pMac, pChannelChangeReq->targetChannel,
psessionEntry->htSecondaryChannelOffset,
diff --git a/CORE/SAP/src/sapModule.c b/CORE/SAP/src/sapModule.c
index 6a6c0f01fb45..973a96573843 100644
--- a/CORE/SAP/src/sapModule.c
+++ b/CORE/SAP/src/sapModule.c
@@ -1742,28 +1742,14 @@ WLANSAP_SetChannelChangeWithCsa(v_PVOID_t pvosGCtx, v_U32_t targetChannel)
pMac = PMAC_STRUCT( hHal );
/*
- * Validate if the new target channel is a valid
- * 5 Ghz Channel. We prefer to move to another
- * channel in 5 Ghz band.
- */
- if ( (targetChannel < rfChannels[RF_CHAN_36].channelNum)
- ||
- (targetChannel > rfChannels[RF_CHAN_165].channelNum) )
- {
- VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
- "%s: Invalid Channel = %d passed,Channel not in 5GHz band",
- __func__, targetChannel);
-
- return VOS_STATUS_E_FAULT;
- }
-
- /*
* Now, validate if the passed channel is valid in the
* current regulatory domain.
*/
- if ( (vos_nv_getChannelEnabledState(targetChannel) == NV_CHANNEL_ENABLE)
+ if ( sapContext->channel != targetChannel &&
+ ((vos_nv_getChannelEnabledState(targetChannel) == NV_CHANNEL_ENABLE)
||
- (vos_nv_getChannelEnabledState(targetChannel) == NV_CHANNEL_DFS) )
+ (vos_nv_getChannelEnabledState(targetChannel) == NV_CHANNEL_DFS &&
+ !vos_concurrent_open_sessions_running())) )
{
/*
* Post a CSA IE request to SAP state machine with
@@ -1778,6 +1764,8 @@ WLANSAP_SetChannelChangeWithCsa(v_PVOID_t pvosGCtx, v_U32_t targetChannel)
* to sap context.
*/
pMac->sap.SapDfsInfo.target_channel = targetChannel;
+ pMac->sap.SapDfsInfo.new_chanWidth =
+ sapContext->vht_ch_width_orig;
/*
* Set the CSA IE required flag.
@@ -3030,6 +3018,7 @@ WLANSAP_ChannelChangeRequest(v_PVOID_t pSapCtx, tANI_U8 tArgetChannel)
}
pMac = PMAC_STRUCT( hHal );
phyMode = sapContext->csrRoamProfile.phyMode;
+ sapContext->csrRoamProfile.ChannelInfo.ChannelList[0] = tArgetChannel;
/*
* We are getting channel bonding mode from sapDfsInfor structure
* because we've implemented channel width fallback mechanism for DFS
@@ -3038,10 +3027,10 @@ WLANSAP_ChannelChangeRequest(v_PVOID_t pSapCtx, tANI_U8 tArgetChannel)
cbMode = pMac->sap.SapDfsInfo.new_cbMode;
vhtChannelWidth = pMac->sap.SapDfsInfo.new_chanWidth;
sme_SelectCBMode(hHal, phyMode, tArgetChannel, &vhtChannelWidth);
+ sapContext->csrRoamProfile.vht_channel_width = vhtChannelWidth;
sapContext->vht_channel_width = vhtChannelWidth;
halStatus = sme_RoamChannelChangeReq(hHal, sapContext->bssid,
- tArgetChannel,
- phyMode, cbMode, vhtChannelWidth);
+ cbMode, &sapContext->csrRoamProfile);
if (halStatus == eHAL_STATUS_SUCCESS)
{
diff --git a/CORE/SME/inc/csrInternal.h b/CORE/SME/inc/csrInternal.h
index a86b3f8b0956..cf45be5e1322 100644
--- a/CORE/SME/inc/csrInternal.h
+++ b/CORE/SME/inc/csrInternal.h
@@ -1490,8 +1490,7 @@ tANI_BOOLEAN csrRoamIsStaMode(tpAniSirGlobal pMac, tANI_U32 sessionId);
/* Post Channel Change Indication */
eHalStatus csrRoamChannelChangeReq(tpAniSirGlobal pMac, tCsrBssid bssid,
- tANI_U8 targetChannel, tANI_U8 cbMode,
- tANI_U8 vhtChannelWidth);
+ tANI_U8 cbMode, tCsrRoamProfile *pprofile);
/* Post Beacon Tx Start Indication */
eHalStatus csrRoamStartBeaconReq( tpAniSirGlobal pMac,
diff --git a/CORE/SME/inc/sme_Api.h b/CORE/SME/inc/sme_Api.h
index 5a9c6e46c25a..6fd129d74159 100644
--- a/CORE/SME/inc/sme_Api.h
+++ b/CORE/SME/inc/sme_Api.h
@@ -3722,8 +3722,7 @@ eHalStatus sme_set_auto_shutdown_timer(tHalHandle hHal, tANI_U32 timer_value);
#endif
eHalStatus sme_RoamChannelChangeReq(tHalHandle hHal, tCsrBssid bssid,
- tANI_U8 targetChannel, eCsrPhyMode phyMode,
- tANI_U32 cbMode, tANI_U32 vhtChannelWidth);
+ tANI_U32 cbMode, tCsrRoamProfile *pprofile);
eHalStatus sme_RoamStartBeaconReq( tHalHandle hHal,
tCsrBssid bssid, tANI_U8 dfsCacWaitStatus);
diff --git a/CORE/SME/src/csr/csrApiRoam.c b/CORE/SME/src/csr/csrApiRoam.c
index 855b3b7990b6..f202168c253a 100644
--- a/CORE/SME/src/csr/csrApiRoam.c
+++ b/CORE/SME/src/csr/csrApiRoam.c
@@ -12023,7 +12023,6 @@ tANI_U8 csrRoamGetIbssStartChannelNumber24( tpAniSirGlobal pMac )
static void csrRoamGetBssStartParms( tpAniSirGlobal pMac, tCsrRoamProfile *pProfile,
tCsrRoamStartBssParams *pParam )
{
- eCsrCfgDot11Mode cfgDot11Mode;
eCsrBand eBand;
tANI_U8 channel = 0;
tSirNwType nwType;
@@ -12033,11 +12032,13 @@ static void csrRoamGetBssStartParms( tpAniSirGlobal pMac, tCsrRoamProfile *pProf
{
operationChannel = pProfile->ChannelInfo.ChannelList[0];
}
- cfgDot11Mode = csrRoamGetPhyModeBandForBss( pMac, pProfile, operationChannel, &eBand );
+
+ pParam->uCfgDot11Mode =
+ csrRoamGetPhyModeBandForBss( pMac, pProfile, operationChannel, &eBand );
if( ( (pProfile->csrPersona == VOS_P2P_CLIENT_MODE) ||
(pProfile->csrPersona == VOS_P2P_GO_MODE) )
- && ( cfgDot11Mode == eCSR_CFG_DOT11_MODE_11B)
+ && ( pParam->uCfgDot11Mode == eCSR_CFG_DOT11_MODE_11B)
)
{
/* This should never happen */
@@ -12046,7 +12047,8 @@ static void csrRoamGetBssStartParms( tpAniSirGlobal pMac, tCsrRoamProfile *pProf
pProfile->csrPersona);
VOS_ASSERT(0);
}
- switch( cfgDot11Mode )
+
+ switch( pParam->uCfgDot11Mode )
{
case eCSR_CFG_DOT11_MODE_11G:
nwType = eSIR_11G_NW_TYPE;
@@ -12133,7 +12135,7 @@ static void csrRoamGetBssStartParms( tpAniSirGlobal pMac, tCsrRoamProfile *pProf
/* For P2P Client and P2P GO, disable 11b rates */
if( (pProfile->csrPersona == VOS_P2P_CLIENT_MODE) ||
(pProfile->csrPersona == VOS_P2P_GO_MODE) ||
- (eCSR_CFG_DOT11_MODE_11G_ONLY == cfgDot11Mode)
+ (eCSR_CFG_DOT11_MODE_11G_ONLY == pParam->uCfgDot11Mode)
)
{
pParam->operationalRateSet.numRates = 8;
@@ -18254,12 +18256,13 @@ VOS_STATUS csrRoamReadTSF(tpAniSirGlobal pMac, tANI_U8 *pTimestamp,
*/
eHalStatus
csrRoamChannelChangeReq(tpAniSirGlobal pMac, tCsrBssid bssid,
- tANI_U8 targetChannel, tANI_U8 cbMode,
- tANI_U8 vhtChannelWidth )
+ tANI_U8 cbMode, tCsrRoamProfile *pprofile)
{
eHalStatus status = eHAL_STATUS_SUCCESS;
tSirChanChangeRequest *pMsg;
+ tCsrRoamStartBssParams param;
+ csrRoamGetBssStartParms(pMac, pprofile, &param);
pMsg = vos_mem_malloc( sizeof(tSirChanChangeRequest) );
if (!pMsg)
{
@@ -18270,10 +18273,17 @@ csrRoamChannelChangeReq(tpAniSirGlobal pMac, tCsrBssid bssid,
pMsg->messageType = pal_cpu_to_be16((tANI_U16)eWNI_SME_CHANNEL_CHANGE_REQ);
pMsg->messageLen = sizeof(tSirChanChangeRequest);
- pMsg->targetChannel = targetChannel;
+ pMsg->targetChannel = pprofile->ChannelInfo.ChannelList[0];
pMsg->cbMode = cbMode;
- pMsg->vht_channel_width = vhtChannelWidth;
+ pMsg->vht_channel_width = pprofile->vht_channel_width;
+ pMsg->dot11mode =
+ csrTranslateToWNICfgDot11Mode(pMac,pMac->roam.configParam.uCfgDot11Mode);
+
vos_mem_copy(pMsg->bssid, bssid, VOS_MAC_ADDR_SIZE);
+ vos_mem_copy((void*)&pMsg->operational_rateset,
+ (void*)&param.operationalRateSet, sizeof(tSirMacRateSet));
+ vos_mem_copy((void*)&pMsg->extended_rateset, (void*)&param.extendedRateSet,
+ sizeof(tSirMacRateSet));
status = palSendMBMessage(pMac->hHdd, pMsg);
diff --git a/CORE/SME/src/sme_common/sme_Api.c b/CORE/SME/src/sme_common/sme_Api.c
index 744f885ee201..3adc8ee585cc 100644
--- a/CORE/SME/src/sme_common/sme_Api.c
+++ b/CORE/SME/src/sme_common/sme_Api.c
@@ -13165,26 +13165,26 @@ eHalStatus sme_set_mas(uint32_t val)
/* -------------------------------------------------------------------------
\fn sme_RoamChannelChangeReq
\brief API to Indicate Channel change to new target channel
- \param hHal - The handle returned by macOpen
- \param targetChannel - New Channel to move the SAP to.
\return eHalStatus
---------------------------------------------------------------------------*/
eHalStatus sme_RoamChannelChangeReq(tHalHandle hHal, tCsrBssid bssid,
- tANI_U8 targetChannel, eCsrPhyMode phyMode,
- tANI_U32 cbMode, tANI_U32 vhtChannelWidth)
+ tANI_U32 cbMode, tCsrRoamProfile *pprofile)
{
eHalStatus status = eHAL_STATUS_FAILURE;
tpAniSirGlobal pMac = PMAC_STRUCT( hHal );
+ u_int8_t ch_mode;
+
+ ch_mode = (pprofile->ChannelInfo.ChannelList[0] <= 14) ?
+ pMac->roam.configParam.channelBondingMode24GHz :
+ pMac->roam.configParam.channelBondingMode5GHz;
status = sme_AcquireGlobalLock( &pMac->sme );
if ( HAL_STATUS_SUCCESS( status ) )
{
VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR,
FL("sapdfs: requested CBmode=%d & new negotiated CBmode=%d"),
- cbMode, pMac->roam.configParam.channelBondingMode5GHz);
- status = csrRoamChannelChangeReq(pMac, bssid, targetChannel,
- (tANI_U8)pMac->roam.configParam.channelBondingMode5GHz,
- (tANI_U8)vhtChannelWidth);
+ cbMode, ch_mode);
+ status = csrRoamChannelChangeReq(pMac, bssid, ch_mode, pprofile);
sme_ReleaseGlobalLock( &pMac->sme );
}
return (status);