summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgaolez <gaolez@codeaurora.org>2016-11-03 20:01:19 +0800
committerGerrit - the friendly Code Review server <code-review@localhost>2016-12-07 22:00:39 -0800
commit9bd1ccc0c3ba0219c7ccffe7eaf41e115b97a128 (patch)
treea4ec1f76ebf3608776332405ae60f2ccf20037e7
parentbcf888592bf52159aa855840e763c9bfe39924b2 (diff)
qcacld-2.0: Add ini option for action frame based channel switch
Add ini option to enable/disable action frame based channel switch. Change-Id: I340464a18ef0b5cf09f481a23b01edcf04904e34 CRs-Fixed: 1094958
-rw-r--r--CORE/HDD/inc/wlan_hdd_cfg.h22
-rw-r--r--CORE/HDD/src/wlan_hdd_cfg.c9
-rw-r--r--CORE/HDD/src/wlan_hdd_cfg80211.c3
-rw-r--r--CORE/MAC/inc/sirApi.h1
-rw-r--r--CORE/MAC/src/pe/include/limGlobal.h2
-rw-r--r--CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c13
-rw-r--r--CORE/SAP/inc/sapApi.h4
-rw-r--r--CORE/SAP/src/sapModule.c2
-rw-r--r--CORE/SME/src/csr/csrApiRoam.c1
9 files changed, 51 insertions, 6 deletions
diff --git a/CORE/HDD/inc/wlan_hdd_cfg.h b/CORE/HDD/inc/wlan_hdd_cfg.h
index a15dd7ee225e..111ec682013c 100644
--- a/CORE/HDD/inc/wlan_hdd_cfg.h
+++ b/CORE/HDD/inc/wlan_hdd_cfg.h
@@ -4311,6 +4311,26 @@ FG_BTC_BT_INTERVAL_PAGE_P2P_STA_DEFAULT
#define CFG_RX_WAKELOCK_TIMEOUT_MIN (0)
#define CFG_RX_WAKELOCK_TIMEOUT_MAX (100)
+/*
+ * <ini>
+ * g_sap_chanswitch_beacon_cnt - channel switch beacon count
+ * @Min: 1
+ * @Max: 5
+ * @Default: 5
+ *
+ * This ini is used to configure channel switch beacon count
+ *
+ * Related: none
+ *
+ * Usage: External
+ *
+ * </ini>
+ */
+#define CFG_SAP_CH_SWITCH_BEACON_CNT "g_sap_chanswitch_beacon_cnt"
+#define CFG_SAP_CH_SWITCH_BEACON_CNT_MIN (1)
+#define CFG_SAP_CH_SWITCH_BEACON_CNT_MAX (5)
+#define CFG_SAP_CH_SWITCH_BEACON_CNT_DEFAULT (5)
+
/*---------------------------------------------------------------------------
Type declarations
-------------------------------------------------------------------------*/
@@ -5145,6 +5165,8 @@ struct hdd_config {
/* parameter for indicating sub20 channel width */
uint8_t sub_20_channel_width;
uint32_t rx_wakelock_timeout;
+ /* beacon count before channel switch */
+ uint8_t sap_chanswitch_beacon_cnt;
};
typedef struct hdd_config hdd_config_t;
diff --git a/CORE/HDD/src/wlan_hdd_cfg.c b/CORE/HDD/src/wlan_hdd_cfg.c
index ff6a99900659..83395ac1e981 100644
--- a/CORE/HDD/src/wlan_hdd_cfg.c
+++ b/CORE/HDD/src/wlan_hdd_cfg.c
@@ -4937,7 +4937,14 @@ REG_TABLE_ENTRY g_registry_table[] =
VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
CFG_RX_WAKELOCK_TIMEOUT_DEFAULT,
CFG_RX_WAKELOCK_TIMEOUT_MIN,
- CFG_RX_WAKELOCK_TIMEOUT_MAX)
+ CFG_RX_WAKELOCK_TIMEOUT_MAX),
+
+ REG_VARIABLE(CFG_SAP_CH_SWITCH_BEACON_CNT, WLAN_PARAM_Integer,
+ hdd_config_t, sap_chanswitch_beacon_cnt,
+ VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
+ CFG_SAP_CH_SWITCH_BEACON_CNT_DEFAULT,
+ CFG_SAP_CH_SWITCH_BEACON_CNT_MIN,
+ CFG_SAP_CH_SWITCH_BEACON_CNT_MAX),
};
diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c
index fd99471996b8..9b66ec893907 100644
--- a/CORE/HDD/src/wlan_hdd_cfg80211.c
+++ b/CORE/HDD/src/wlan_hdd_cfg80211.c
@@ -15601,6 +15601,9 @@ static int wlan_hdd_cfg80211_start_bss(hdd_adapter_t *pHostapdAdapter,
pConfig->disableDFSChSwitch = iniConfig->disableDFSChSwitch;
+ pConfig->sap_chanswitch_beacon_cnt =
+ iniConfig->sap_chanswitch_beacon_cnt;
+
//channel is already set in the set_channel Call back
//pConfig->channel = pCommitConfig->channel;
diff --git a/CORE/MAC/inc/sirApi.h b/CORE/MAC/inc/sirApi.h
index 0cdec16fcd70..33bcd3ea00db 100644
--- a/CORE/MAC/inc/sirApi.h
+++ b/CORE/MAC/inc/sirApi.h
@@ -5052,6 +5052,7 @@ typedef struct sSirDfsCsaIeRequest
tANI_U8 bssid[VOS_MAC_ADDR_SIZE];
u_int8_t ch_bandwidth;
uint8_t sub20_channelwidth;
+ uint8_t ch_switch_beacon_cnt;
}tSirDfsCsaIeRequest, *tpSirDfsCsaIeRequest;
/* Indication from lower layer indicating the completion of first beacon send
diff --git a/CORE/MAC/src/pe/include/limGlobal.h b/CORE/MAC/src/pe/include/limGlobal.h
index aaf4cbed4ac2..705963002e64 100644
--- a/CORE/MAC/src/pe/include/limGlobal.h
+++ b/CORE/MAC/src/pe/include/limGlobal.h
@@ -68,8 +68,6 @@
#define IS_5G_BAND(__rfBand) ((__rfBand & 0x3) == 0x2)
#define IS_24G_BAND(__rfBand) ((__rfBand & 0x3) == 0x1)
-#define LIM_MAX_CSA_IE_UPDATES ( 5 )
-
// enums exported by LIM are as follows
/// System role definition
diff --git a/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c b/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c
index 5ba49133c921..1afe24b82501 100644
--- a/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c
+++ b/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c
@@ -7330,6 +7330,7 @@ static void send_extended_chan_switch_action_frame(tpAniSirGlobal mac_ctx,
uint16_t op_class;
uint8_t switch_mode = 0, i;
tpDphHashNode psta;
+ uint8_t switch_count;
op_class = regdm_get_opclass_from_channel(
@@ -7341,6 +7342,8 @@ static void send_extended_chan_switch_action_frame(tpAniSirGlobal mac_ctx,
(mac_ctx->sap.SapDfsInfo.disable_dfs_ch_switch == VOS_FALSE))
switch_mode = 1;
+ switch_count = session_entry->gLimChannelSwitch.switchCount;
+
if (LIM_IS_AP_ROLE(session_entry)) {
for (i = 0; i < mac_ctx->lim.maxStation; i++) {
psta =
@@ -7350,14 +7353,14 @@ static void send_extended_chan_switch_action_frame(tpAniSirGlobal mac_ctx,
mac_ctx,
psta->staAddr,
switch_mode, op_class, new_channel,
- LIM_MAX_CSA_IE_UPDATES, session_entry);
+ switch_count, session_entry);
}
}
} else if (LIM_IS_STA_ROLE(session_entry)) {
lim_send_extended_chan_switch_action_frame(mac_ctx,
session_entry->bssId,
switch_mode, op_class, new_channel,
- LIM_MAX_CSA_IE_UPDATES, session_entry);
+ switch_count, session_entry);
}
}
@@ -7419,7 +7422,11 @@ limProcessSmeDfsCsaIeRequest(tpAniSirGlobal pMac, tANI_U32 *pMsg)
/* Channel switch announcement needs to be included in beacon */
psessionEntry->dfsIncludeChanSwIe = VOS_TRUE;
- psessionEntry->gLimChannelSwitch.switchCount = LIM_MAX_CSA_IE_UPDATES;
+
+ psessionEntry->gLimChannelSwitch.switchCount =
+ pDfsCsaIeRequest->ch_switch_beacon_cnt;
+
+
if (pMac->sap.SapDfsInfo.disable_dfs_ch_switch == VOS_FALSE)
psessionEntry->gLimChannelSwitch.switchMode = 1;
psessionEntry->gLimChannelSwitch.secondarySubBand =
diff --git a/CORE/SAP/inc/sapApi.h b/CORE/SAP/inc/sapApi.h
index fcb675414da0..191fa412a6f1 100644
--- a/CORE/SAP/inc/sapApi.h
+++ b/CORE/SAP/inc/sapApi.h
@@ -575,6 +575,8 @@ typedef struct sap_Config {
tSirMacRateSet extended_rates;
eCsrBand target_band;
uint16_t sub20_channelwidth;
+ /* beacon count before channel switch */
+ uint8_t sap_chanswitch_beacon_cnt;
} tsap_Config_t;
#ifdef FEATURE_WLAN_AP_AP_ACS_OPTIMIZE
@@ -686,6 +688,8 @@ typedef struct sSapDfsInfo
v_U8_t disable_dfs_ch_switch;
uint16_t tx_leakage_threshold;
uint8_t new_sub20_channelwidth;
+ /* beacon count before channel switch */
+ uint8_t sap_ch_switch_beacon_cnt;
} tSapDfsInfo;
typedef struct tagSapCtxList
diff --git a/CORE/SAP/src/sapModule.c b/CORE/SAP/src/sapModule.c
index b1fcf2254a8d..8316e04117ce 100644
--- a/CORE/SAP/src/sapModule.c
+++ b/CORE/SAP/src/sapModule.c
@@ -819,6 +819,8 @@ WLANSAP_StartBss
*/
pmac->sap.SapDfsInfo.disable_dfs_ch_switch =
pConfig->disableDFSChSwitch;
+ pmac->sap.SapDfsInfo.sap_ch_switch_beacon_cnt =
+ pConfig->sap_chanswitch_beacon_cnt;
// Copy MAC filtering settings to sap context
pSapCtx->eSapMacAddrAclMode = pConfig->SapMacaddr_acl;
vos_mem_copy(pSapCtx->acceptMacList, pConfig->accept_mac, sizeof(pConfig->accept_mac));
diff --git a/CORE/SME/src/csr/csrApiRoam.c b/CORE/SME/src/csr/csrApiRoam.c
index 4703b1354921..49f12254e2b8 100644
--- a/CORE/SME/src/csr/csrApiRoam.c
+++ b/CORE/SME/src/csr/csrApiRoam.c
@@ -19746,6 +19746,7 @@ csrRoamSendChanSwIERequest(tpAniSirGlobal pMac, tCsrBssid bssid,
vos_mem_copy(pMsg->bssid, bssid, VOS_MAC_ADDR_SIZE);
pMsg->ch_bandwidth = ch_bandwidth;
pMsg->sub20_channelwidth = pMac->sap.SapDfsInfo.new_sub20_channelwidth;
+ pMsg->ch_switch_beacon_cnt = pMac->sap.SapDfsInfo.sap_ch_switch_beacon_cnt;
status = palSendMBMessage(pMac->hHdd, pMsg);