瀏覽代碼

qcacld-3.0: Enhance dfs beacon tx

qcacld-2.0 to qcacld-3.0 propagation

Send one action frame along with each beacon tx to reduce failure
of channel switching on sta side.

Change-Id: Idbbe1a4bcb4976101680974214fe85d9886ba7d1
CRs-Fixed: 1094958
lifeng 7 年之前
父節點
當前提交
1c16b6b0ac

+ 22 - 0
core/hdd/inc/wlan_hdd_cfg.h

@@ -13271,6 +13271,27 @@ enum hdd_external_acs_freq_band {
 #define CFG_ENABLE_PACKET_FILTERS_MIN      (0)
 #define CFG_ENABLE_PACKET_FILTERS_MAX      (63)
 
+
+/*
+ * <ini>
+ * gDfsBeaconTxEnhanced - beacon tx enhanced
+ * @Min: 0
+ * @Max: 1
+ * @Default: 0
+ *
+ * This ini is used to enhance dfs beacon tx
+ *
+ * Related: none
+ *
+ * Usage: External
+ *
+ * </ini>
+ */
+#define CFG_DFS_BEACON_TX_ENHANCED         "gDfsBeaconTxEnhanced"
+#define CFG_DFS_BEACON_TX_ENHANCED_MIN     (0)
+#define CFG_DFS_BEACON_TX_ENHANCED_MAX     (1)
+#define CFG_DFS_BEACON_TX_ENHANCED_DEFAULT (0)
+
 /*
  * Type declarations
  */
@@ -14135,6 +14156,7 @@ struct hdd_config {
 	int8_t mbo_candidate_rssi_btc_thres;
 	uint8_t packet_filters_bitmap;
 	uint8_t enable_phy_reg_retention;
+	uint8_t dfs_beacon_tx_enhanced;
 };
 
 #define VAR_OFFSET(_Struct, _Var) (offsetof(_Struct, _Var))

+ 7 - 0
core/hdd/src/wlan_hdd_cfg.c

@@ -5215,6 +5215,13 @@ struct reg_table_entry g_registry_table[] = {
 		CFG_ENABLE_PACKET_FILTERS_DEFAULT,
 		CFG_ENABLE_PACKET_FILTERS_MIN,
 		CFG_ENABLE_PACKET_FILTERS_MAX),
+
+	REG_VARIABLE(CFG_DFS_BEACON_TX_ENHANCED, WLAN_PARAM_Integer,
+		struct hdd_config, dfs_beacon_tx_enhanced,
+		VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
+		CFG_DFS_BEACON_TX_ENHANCED_DEFAULT,
+		CFG_DFS_BEACON_TX_ENHANCED_MIN,
+		CFG_DFS_BEACON_TX_ENHANCED_MAX),
 };
 
 

+ 1 - 0
core/hdd/src/wlan_hdd_hostapd.c

@@ -7597,6 +7597,7 @@ int wlan_hdd_cfg80211_start_bss(struct hdd_adapter *adapter,
 
 	pConfig->enOverLapCh = iniConfig->gEnableOverLapCh;
 	pConfig->dtim_period = pBeacon->dtim_period;
+	pConfig->dfs_beacon_tx_enhanced = iniConfig->dfs_beacon_tx_enhanced;
 	hdd_debug("acs_mode %d", pConfig->acs_cfg.acs_mode);
 
 	if (pConfig->acs_cfg.acs_mode == true) {

+ 0 - 13
core/mac/src/pe/lim/lim_process_sme_req_messages.c

@@ -5623,19 +5623,6 @@ static void send_extended_chan_switch_action_frame(tpAniSirGlobal mac_ctx,
 
 }
 
-/**
- * lim_send_chan_switch_action_frame()- Send an action frame
- * containing CSA IE or ECSA IE depending on the connected
- * sta capability.
- *
- * @mac_ctx: pointer to global mac structure
- * @new_channel: new channel to switch to.
- * @ch_bandwidth: BW of channel to calculate op_class
- * @session_entry: pe session
- *
- * Return: void
- */
-static
 void lim_send_chan_switch_action_frame(tpAniSirGlobal mac_ctx,
 				       uint16_t new_channel,
 				       uint8_t ch_bandwidth,

+ 9 - 0
core/mac/src/pe/lim/lim_send_sme_rsp_messages.c

@@ -2559,6 +2559,7 @@ lim_process_beacon_tx_success_ind(tpAniSirGlobal pMac, uint16_t msgType, void *e
 	uint8_t length = sizeof(tSirSmeCSAIeTxCompleteRsp);
 	tpSirFirstBeaconTxCompleteInd pBcnTxInd =
 		(tSirFirstBeaconTxCompleteInd *) event;
+	uint8_t ch, ch_width;
 
 	psessionEntry = pe_find_session_by_bss_idx(pMac, pBcnTxInd->bssIdx);
 	if (psessionEntry == NULL) {
@@ -2579,6 +2580,14 @@ lim_process_beacon_tx_success_ind(tpAniSirGlobal pMac, uint16_t msgType, void *e
 			 * Send the next beacon with updated CSA IE count
 			 */
 			lim_send_dfs_chan_sw_ie_update(pMac, psessionEntry);
+
+			ch = psessionEntry->gLimChannelSwitch.primaryChannel;
+			ch_width = psessionEntry->gLimChannelSwitch.ch_width;
+			if (pMac->sap.SapDfsInfo.dfs_beacon_tx_enhanced)
+				/* Send Action frame after updating beacon */
+				lim_send_chan_switch_action_frame(pMac,
+					ch, ch_width, psessionEntry);
+
 			/* Decrement the IE count */
 			psessionEntry->gLimChannelSwitch.switchCount--;
 		} else {

+ 17 - 0
core/mac/src/pe/lim/lim_utils.h

@@ -1220,4 +1220,21 @@ QDF_STATUS lim_util_get_type_subtype(void *pkt, uint8_t *type,
  */
 enum rateid lim_get_min_session_txrate(tpPESession session);
 
+/**
+ * lim_send_chan_switch_action_frame()- Send an action frame
+ * containing CSA IE or ECSA IE depending on the connected
+ * sta capability.
+ *
+ * @mac_ctx: pointer to global mac structure
+ * @new_channel: new channel to switch to.
+ * @ch_bandwidth: BW of channel to calculate op_class
+ * @session_entry: pe session
+ *
+ * Return: void
+ */
+void lim_send_chan_switch_action_frame(tpAniSirGlobal mac_ctx,
+				       uint16_t new_channel,
+				       uint8_t ch_bandwidth,
+				       tpPESession session_entry);
+
 #endif /* __LIM_UTILS_H */

+ 2 - 0
core/sap/inc/sap_api.h

@@ -628,6 +628,7 @@ typedef struct sap_Config {
 	uint8_t sap_chanswitch_beacon_cnt;
 	uint8_t sap_chanswitch_mode;
 	bool chan_switch_hostapd_rate_enabled;
+	bool dfs_beacon_tx_enhanced;
 } tsap_Config_t;
 
 #ifdef FEATURE_WLAN_AP_AP_ACS_OPTIMIZE
@@ -721,6 +722,7 @@ typedef struct sSapDfsInfo {
 	/* beacon count before channel switch */
 	uint8_t sap_ch_switch_beacon_cnt;
 	uint8_t sap_ch_switch_mode;
+	bool dfs_beacon_tx_enhanced;
 } tSapDfsInfo;
 
 typedef struct tagSapCtxList {

+ 2 - 0
core/sap/src/sap_module.c

@@ -746,6 +746,8 @@ QDF_STATUS wlansap_start_bss(struct sap_context *sap_ctx,
 		sap_ctx->csr_roamProfile.csrPersona;
 	pmac->sap.sapCtxList[sap_ctx->sessionId].sessionID =
 		sap_ctx->sessionId;
+	pmac->sap.SapDfsInfo.dfs_beacon_tx_enhanced =
+		pConfig->dfs_beacon_tx_enhanced;
 
 	/* Copy MAC filtering settings to sap context */
 	sap_ctx->eSapMacAddrAclMode = pConfig->SapMacaddr_acl;