summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRakesh Sunki <rsunki@qca.qualcomm.com>2014-09-02 13:42:17 -0700
committerAnjaneeDevi Kapparapu <c_akappa@qti.qualcomm.com>2014-09-24 20:22:15 +0530
commitef87b5010e342f57f2e1166b9b7f461432f6a3de (patch)
tree69f92e4e691443286e3600a9eb515b72ca7add2e
parenta5a4736f23ea5c68922158c381473de3f55078c2 (diff)
qcacld: [Protocol]Add SAP DFS Random Channel switch restrictions.
Add support to enable the below restrictions in the SAP DFS random selection algorithm in W53 regulatory domain 1. Add support for blocking W53 channels from being picked during SAP random channel selection after radar indication. 2.Add support for restricting channel switches between Indoor and outdoor channels after radar indication. Change-Id: Id9a7f1efa7a01a7c1d7631030ca88ba82e1fdd98 CRs-Fixed: 718419
-rw-r--r--CORE/SAP/inc/sapApi.h83
-rw-r--r--CORE/SAP/src/sapFsm.c169
-rw-r--r--CORE/SAP/src/sapInternal.h57
-rw-r--r--CORE/SAP/src/sapModule.c140
4 files changed, 448 insertions, 1 deletions
diff --git a/CORE/SAP/inc/sapApi.h b/CORE/SAP/inc/sapApi.h
index 4d71ac89730e..37cd529d9803 100644
--- a/CORE/SAP/inc/sapApi.h
+++ b/CORE/SAP/inc/sapApi.h
@@ -592,6 +592,34 @@ typedef struct sSapDfsInfo
tANI_U8 orig_chanWidth;
tANI_U8 new_chanWidth;
tANI_U8 new_cbMode;
+
+ /*
+ * INI param to enable/disable SAP W53
+ * channel operation.
+ */
+ v_U8_t is_dfs_w53_disabled;
+
+ /*
+ * sap_operating_channel_location holds SAP indoor,
+ * outdoor location information. Currently, if this
+ * param is set this Indoor/outdoor channel interop
+ * restriction will only be implemented for JAPAN
+ * regulatory domain.
+ *
+ * 0 - Indicates that location unknown
+ * (or) SAP Indoor/outdoor interop is allowed
+ *
+ * 1 - Indicates device is operating on Indoor channels
+ * and SAP cannot pick next random channel from outdoor
+ * list of channels when a radar is found on current operating
+ * DFS channel.
+ *
+ * 2 - Indicates device is operating on Outdoor Channels
+ * and SAP cannot pick next random channel from indoor
+ * list of channels when a radar is found on current
+ * operating DFS channel.
+ */
+ v_U8_t sap_operating_chan_preferred_location;
} tSapDfsInfo;
typedef struct tagSapCtxList
@@ -2034,6 +2062,61 @@ VOS_STATUS
WLANSAP_Set_Dfs_Ignore_CAC(tHalHandle hHal, v_U8_t ignore_cac);
/*==========================================================================
+ FUNCTION WLANSAP_set_Dfs_Restrict_JapanW53
+
+ DESCRIPTION
+ This API is used to enable or disable Japan W53 Band
+
+ DEPENDENCIES
+ NA.
+
+ PARAMETERS
+ IN
+ hHal : HAL pointer
+ disable_Dfs_JapanW3 :Indicates if Japan W53 is disabled when set to 1
+ Indicates if Japan W53 is enabled when set to 0
+
+ RETURN VALUE
+ The VOS_STATUS code associated with performing the operation
+
+ VOS_STATUS_SUCCESS: Success
+
+ SIDE EFFECTS
+============================================================================*/
+VOS_STATUS
+WLANSAP_set_Dfs_Restrict_JapanW53(tHalHandle hHal, v_U8_t disable_Dfs_JapanW3);
+
+/*==========================================================================
+ FUNCTION WLANSAP_set_Dfs_Preferred_Channel_location
+
+ DESCRIPTION
+ This API is used to set sap preferred channels location
+ to resetrict the DFS random channel selection algorithm
+ either Indoor/Outdoor channels only.
+
+ DEPENDENCIES
+ NA.
+
+ PARAMETERS
+ IN
+ hHal : HAL pointer
+ dfs_Preferred_Channels_location :
+ 0 - Indicates No preferred channel location restrictions
+ 1 - Indicates SAP Indoor Channels operation only.
+ 2 - Indicates SAP Outdoor Channels operation only.
+
+ RETURN VALUE
+ The VOS_STATUS code associated with performing the operation
+
+ VOS_STATUS_SUCCESS: Success
+
+ SIDE EFFECTS
+============================================================================*/
+VOS_STATUS
+WLANSAP_set_Dfs_Preferred_Channel_location(tHalHandle hHal,
+ v_U8_t dfs_Preferred_Channels_location);
+
+/*==========================================================================
FUNCTION WLANSAP_Set_Dfs_Target_Chnl
DESCRIPTION
diff --git a/CORE/SAP/src/sapFsm.c b/CORE/SAP/src/sapFsm.c
index 6ca1f903669b..169b7643262f 100644
--- a/CORE/SAP/src/sapFsm.c
+++ b/CORE/SAP/src/sapFsm.c
@@ -922,6 +922,125 @@ static v_U8_t sapPopulateAvailableChannels(chan_bonding_bitmap *pBitmap,
}
/*
+ * FUNCTION sapFetchRegulatoryDomain
+ *
+ * DESCRIPTION Fetches the Regulatory domain based up on the coutry code.
+ *
+ * DEPENDENCIES PARAMETERS
+ * IN hHAL : HAL pointer
+ *
+ * RETURN VALUE : v_REGDOMAIN_t, returns the regulatory domain
+ *
+ * SIDE EFFECTS
+ */
+v_REGDOMAIN_t sapFetchRegulatoryDomain(tHalHandle hHal)
+{
+ tpAniSirGlobal pMac;
+ v_COUNTRYCODE_t country_code;
+ v_REGDOMAIN_t regDomain;
+ pMac = PMAC_STRUCT(hHal);
+
+ /*
+ * Fetch the REG DOMAIN from the country code.
+ */
+ country_code[0] = pMac->scan.countryCodeCurrent[0];
+ country_code[1] = pMac->scan.countryCodeCurrent[1];
+
+ vos_nv_getRegDomainFromCountryCode(&regDomain,
+ country_code, COUNTRY_QUERY);
+
+ return regDomain;
+}
+
+/*
+ * FUNCTION sapDfsIsW53Invalid
+ *
+ * DESCRIPTION Checks if the passed channel is W53 and returns if
+ * SAP W53 opearation is allowed.
+ *
+ * DEPENDENCIES PARAMETERS
+ * IN hHAL : HAL pointer
+ * channelID: Channel Number to be verified
+ *
+ * RETURN VALUE : v_BOOL_t
+ * VOS_TRUE: If W53 operation is disabled
+ * VOS_FALSE: If W53 operation is enabled
+ *
+ * SIDE EFFECTS
+ */
+v_BOOL_t sapDfsIsW53Invalid(tHalHandle hHal, v_U8_t channelID)
+{
+ tpAniSirGlobal pMac;
+
+ pMac = PMAC_STRUCT(hHal);
+ if (NULL == pMac)
+ {
+ VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
+ FL("invalid pMac"));
+ return VOS_FALSE;
+ }
+
+ /*
+ * Check for JAPAN W53 Channel operation capability
+ */
+ if (VOS_TRUE == pMac->sap.SapDfsInfo.is_dfs_w53_disabled &&
+ VOS_TRUE == IS_CHAN_JAPAN_W53(channelID))
+ {
+ return VOS_TRUE;
+ }
+
+ return VOS_FALSE;
+}
+
+/*
+ * FUNCTION sapDfsIsChannelInPreferredLocation
+ *
+ * DESCRIPTION Checks if the passed channel is in accordance with preferred
+ * Channel location settings.
+ *
+ * DEPENDENCIES PARAMETERS
+ * IN hHAL : HAL pointer
+ * channelID: Channel Number to be verified
+ *
+ * RETURN VALUE :v_BOOL_t
+ * VOS_TRUE:If Channel location is same as the preferred location
+ * VOS_FALSE:If Channel location is not same as the preferred location
+ *
+ * SIDE EFFECTS
+ */
+v_BOOL_t sapDfsIsChannelInPreferredLocation(tHalHandle hHal, v_U8_t channelID)
+{
+ tpAniSirGlobal pMac;
+
+ pMac = PMAC_STRUCT(hHal);
+ if (NULL == pMac) {
+ VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
+ FL("invalid pMac"));
+ return VOS_TRUE;
+ }
+ if ( (SAP_CHAN_PREFERRED_INDOOR ==
+ pMac->sap.SapDfsInfo.sap_operating_chan_preferred_location) &&
+ (VOS_TRUE == IS_CHAN_JAPAN_OUTDOOR(channelID)) )
+ {
+ VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_LOW,
+ FL("CHAN=%d is Outdoor so invalid,preferred Indoor only"),
+ channelID);
+ return VOS_FALSE;
+ }
+ else if ( (SAP_CHAN_PREFERRED_OUTDOOR ==
+ pMac->sap.SapDfsInfo.sap_operating_chan_preferred_location) &&
+ (VOS_TRUE == IS_CHAN_JAPAN_INDOOR(channelID)) )
+ {
+ VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_LOW,
+ FL("CHAN=%d is Indoor so invalid,preferred Outdoor only"),
+ channelID);
+ return VOS_FALSE;
+ }
+
+ return VOS_TRUE;
+}
+
+/*
* This function randomly pick up an AVAILABLE channel
*/
static v_U8_t sapRandomChannelSel(ptSapContext sapContext)
@@ -939,6 +1058,7 @@ static v_U8_t sapRandomChannelSel(ptSapContext sapContext)
tpAniSirGlobal pMac;
tANI_U32 chanWidth;
ePhyChanBondState cbModeCurrent;
+ v_REGDOMAIN_t regDomain;
if (NULL == hHal) {
VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
@@ -992,12 +1112,61 @@ static v_U8_t sapRandomChannelSel(ptSapContext sapContext)
return target_channel;
}
+ regDomain = sapFetchRegulatoryDomain(hHal);
/* loop to check ACS range or NOL channels */
for (i = 0; i < sapContext->SapAllChnlList.numChannel; i++)
{
channelID = sapContext->SapAllChnlList.channelList[i].channel;
+ /*
+ * IN JAPAN REGULATORY DOMAIN CHECK IF THE FOLLOWING TWO
+ * TWO RULES APPLY AND FILTER THE AVAILABLE CHANNELS
+ * ACCORDINGLY.
+ *
+ * 1. If we are operating in Japan regulatory domain
+ * Check if Japan W53 Channel operation is NOT
+ * allowed and if its not allowed then mark all the
+ * W53 channels as Invalid.
+ *
+ * 2. If we are operating in Japan regulatory domain
+ * Check if channel switch between Indoor/Outdoor
+ * is allowed. If it is not allowed then limit
+ * the avaiable channels to Indoor or Outdoor
+ * channels only based up on the SAP Channel location
+ * indicated by "sap_operating_channel_location" param.
+ */
+ if (REGDOMAIN_JAPAN == regDomain)
+ {
+ /*
+ * Check for JAPAN W53 Channel operation capability
+ */
+ if (VOS_TRUE == sapDfsIsW53Invalid(hHal, channelID))
+ {
+ VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_LOW,
+ FL("index:%d, Channel=%d Invalid,Japan W53 Disabled"),
+ i, channelID);
+ sapContext->SapAllChnlList.channelList[i].valid = VOS_FALSE;
+ }
+
+ /*
+ * If SAP's preferred channel location is Indoor
+ * then set all the outdoor channels in the domain
+ * to invalid.If the preferred channel location is
+ * outdoor then set all the Indoor channels in the
+ * domain to Invalid.
+ */
+ if (VOS_FALSE ==
+ sapDfsIsChannelInPreferredLocation(hHal, channelID))
+ {
+ VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_LOW,
+ FL("CHAN=%d is invalid,preferred Channel Location %d Only"),
+ channelID,
+ pMac->sap.SapDfsInfo.sap_operating_chan_preferred_location);
+ sapContext->SapAllChnlList.channelList[i].valid = VOS_FALSE;
+ }
+ }
+
if (vos_nv_getChannelEnabledState(channelID) == NV_CHANNEL_DFS)
{
isChannelNol = sapDfsIsChannelInNolList(sapContext,
diff --git a/CORE/SAP/src/sapInternal.h b/CORE/SAP/src/sapInternal.h
index f3ccf19f05f5..517ee933a966 100644
--- a/CORE/SAP/src/sapInternal.h
+++ b/CORE/SAP/src/sapInternal.h
@@ -107,9 +107,14 @@ when who what, where, why
//MAC Address length
#define ANI_EAPOL_KEY_RSN_NONCE_SIZE 32
-#define IS_ETSI_WEATHER_CH(_ch) ((_ch >= 120) && (_ch <= 130))
+#define IS_ETSI_WEATHER_CH(_ch) ((_ch >= 120) && (_ch <= 130))
+#define IS_CHAN_JAPAN_W53(_ch) ((_ch >= 52) && (_ch <= 64))
+#define IS_CHAN_JAPAN_INDOOR(_ch) ((_ch >= 36) && (_ch <= 64))
+#define IS_CHAN_JAPAN_OUTDOOR(_ch)((_ch >= 100) && (_ch <= 140))
#define DEFAULT_CAC_TIMEOUT (60 * 1000) //msecs - 1 min
#define ETSI_WEATHER_CH_CAC_TIMEOUT (10 * 60 * 1000) //msecs - 10 min
+#define SAP_CHAN_PREFERRED_INDOOR 1
+#define SAP_CHAN_PREFERRED_OUTDOOR 2
extern const sRegulatoryChannel *regChannels;
@@ -930,6 +935,56 @@ v_BOOL_t is_concurrent_sap_ready_for_channel_change(tHalHandle hHal,
*
*/
v_U8_t sap_get_total_number_sap_intf(tHalHandle hHal);
+/*---------------------------------------------------------------------------
+FUNCTION sapFetchRegulatoryDomain
+
+DESCRIPTION Fetches the Regulatory domain based up on the coutry code.
+
+DEPENDENCIES PARAMETERS
+IN hHAL : HAL pointer
+
+RETURN VALUE : v_REGDOMAIN_t, returns the regulatory domain
+
+SIDE EFFECTS
+---------------------------------------------------------------------------*/
+v_REGDOMAIN_t sapFetchRegulatoryDomain(tHalHandle hHal);
+
+/*---------------------------------------------------------------------------
+FUNCTION sapDfsIsW53Invalid
+
+DESCRIPTION Checks if the passed channel is W53 and returns if
+ SAP W53 opearation is allowed.
+
+DEPENDENCIES PARAMETERS
+IN hHAL : HAL pointer
+channelID: Channel Number to be verified
+
+RETURN VALUE : v_BOOL_t
+ VOS_TRUE: If W53 operation is disabled
+ VOS_FALSE: If W53 operation is enabled
+
+SIDE EFFECTS
+---------------------------------------------------------------------------*/
+v_BOOL_t sapDfsIsW53Invalid(tHalHandle hHal, v_U8_t channelID);
+
+/*---------------------------------------------------------------------------
+FUNCTION sapDfsIsChannelInPreferredLocation
+
+DESCRIPTION Checks if the passed channel is in accordance with preferred
+ Channel location settings.
+
+DEPENDENCIES PARAMETERS
+IN hHAL : HAL pointer
+channelID: Channel Number to be verified
+
+RETURN VALUE :v_BOOL_t
+ VOS_TRUE:If Channel location is same as the preferred location
+ VOS_FALSE:If Channel location is not same as the preferred location
+
+SIDE EFFECTS
+---------------------------------------------------------------------------*/
+v_BOOL_t sapDfsIsChannelInPreferredLocation(tHalHandle hHal, v_U8_t channelID);
+
#ifdef __cplusplus
}
#endif
diff --git a/CORE/SAP/src/sapModule.c b/CORE/SAP/src/sapModule.c
index e3f0852ef86b..b246dd09dc5c 100644
--- a/CORE/SAP/src/sapModule.c
+++ b/CORE/SAP/src/sapModule.c
@@ -3056,6 +3056,146 @@ VOS_STATUS WLANSAP_Set_Dfs_Ignore_CAC(tHalHandle hHal, v_U8_t ignore_cac)
}
/*==========================================================================
+ FUNCTION WLANSAP_set_Dfs_Restrict_JapanW53
+
+ DESCRIPTION
+ This API is used to enable or disable Japan W53 Band
+
+ DEPENDENCIES
+ NA.
+
+ PARAMETERS
+ IN
+ hHal : HAL pointer
+ disable_Dfs_JapanW3 :Indicates if Japan W53 is disabled when set to 1
+ Indicates if Japan W53 is enabled when set to 0
+
+ RETURN VALUE
+ The VOS_STATUS code associated with performing the operation
+
+ VOS_STATUS_SUCCESS: Success
+
+ SIDE EFFECTS
+============================================================================*/
+VOS_STATUS
+WLANSAP_set_Dfs_Restrict_JapanW53(tHalHandle hHal, v_U8_t disable_Dfs_W53)
+{
+ tpAniSirGlobal pMac = NULL;
+ v_REGDOMAIN_t regDomain;
+ VOS_STATUS status;
+
+ if (NULL != hHal)
+ {
+ pMac = PMAC_STRUCT( hHal );
+ }
+ else
+ {
+ VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
+ "%s: Invalid hHal pointer", __func__);
+ return VOS_STATUS_E_FAULT;
+ }
+
+ regDomain = sapFetchRegulatoryDomain(hHal);
+
+ /*
+ * Set the JAPAN W53 restriction only if the current
+ * regulatory domain is JAPAN.
+ */
+ if (REGDOMAIN_JAPAN == regDomain)
+ {
+ pMac->sap.SapDfsInfo.is_dfs_w53_disabled = disable_Dfs_W53;
+ VOS_TRACE(VOS_MODULE_ID_SAP,
+ VOS_TRACE_LEVEL_INFO_LOW,
+ FL("sapdfs: SET DFS JAPAN W53 DISABLED = %d"),
+ pMac->sap.SapDfsInfo.is_dfs_w53_disabled);
+
+ status = VOS_STATUS_SUCCESS;
+ }
+ else
+ {
+ VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
+ FL("Regdomain not japan, set disable JP W53 not valid"));
+
+ status = VOS_STATUS_E_FAULT;
+ }
+
+ return status;
+}
+
+/*==========================================================================
+ FUNCTION WLANSAP_set_Dfs_Preferred_Channel_location
+
+ DESCRIPTION
+ This API is used to set sap preferred channels location
+ to resetrict the DFS random channel selection algorithm
+ either Indoor/Outdoor channels only.
+
+ DEPENDENCIES
+ NA.
+
+ PARAMETERS
+ IN
+ hHal : HAL pointer
+ dfs_Preferred_Channels_location :
+ 0 - Indicates No preferred channel location restrictions
+ 1 - Indicates SAP Indoor Channels operation only.
+ 2 - Indicates SAP Outdoor Channels operation only.
+
+ RETURN VALUE
+ The VOS_STATUS code associated with performing the operation
+
+ VOS_STATUS_SUCCESS: Success
+
+ SIDE EFFECTS
+============================================================================*/
+VOS_STATUS
+WLANSAP_set_Dfs_Preferred_Channel_location(tHalHandle hHal,
+ v_U8_t dfs_Preferred_Channels_location)
+{
+ tpAniSirGlobal pMac = NULL;
+ v_REGDOMAIN_t regDomain;
+ VOS_STATUS status;
+ if (NULL != hHal)
+ {
+ pMac = PMAC_STRUCT( hHal );
+ }
+ else
+ {
+ VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
+ "%s: Invalid hHal pointer", __func__);
+ return VOS_STATUS_E_FAULT;
+ }
+
+ regDomain = sapFetchRegulatoryDomain(hHal);
+
+ /*
+ * The Indoor/Outdoor only random channel selection
+ * restriction is currently enforeced only for
+ * JAPAN regulatory domain.
+ */
+ if (REGDOMAIN_JAPAN == regDomain)
+ {
+ pMac->sap.SapDfsInfo.sap_operating_chan_preferred_location =
+ dfs_Preferred_Channels_location;
+ VOS_TRACE(VOS_MODULE_ID_SAP,
+ VOS_TRACE_LEVEL_INFO_LOW,
+ FL("sapdfs:Set Preferred Operating Channel location=%d"),
+ pMac->sap.SapDfsInfo.sap_operating_chan_preferred_location);
+
+ status = VOS_STATUS_SUCCESS;
+ }
+ else
+ {
+ VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
+ FL("sapdfs:NOT JAPAN REG, Invalid Set preferred chans location"));
+
+ status = VOS_STATUS_E_FAULT;
+ }
+
+ return status;
+}
+
+/*==========================================================================
FUNCTION WLANSAP_Set_Dfs_Target_Chnl
DESCRIPTION