Quellcode durchsuchen

qcacld-3.0: Add ini to enable/disable WLS 6ghz support

Host sends the WLAN_MSG_WLAN_STATUS_IND to WiFi Location Service(WLS) via
cnss daemon which includes supported channels. WLS service is yet not 6GHz
capable. Hence to limit the 2.4GHz/5GHz channels only in
WLAN_MSG_WLAN_STATUS_IND introduce new INI "wls_6ghz_capable".

Change-Id: I77b284d2025601fec72aa35d430f18865f15f247
CRs-Fixed: 2748489
Abhishek Ambure vor 4 Jahren
Ursprung
Commit
ab079ed334

+ 1 - 0
components/mlme/core/src/wlan_mlme_main.c

@@ -331,6 +331,7 @@ static void mlme_init_generic_cfg(struct wlan_objmgr_psoc *psoc,
 	gen->debug_packet_log = cfg_get(psoc, CFG_ENABLE_DEBUG_PACKET_LOG);
 	gen->enable_deauth_to_disassoc_map =
 		cfg_get(psoc, CFG_ENABLE_DEAUTH_TO_DISASSOC_MAP);
+	gen->wls_6ghz_capable = cfg_get(psoc, CFG_WLS_6GHZ_CAPABLE);
 	mlme_init_pmf_cfg(psoc, gen);
 	mlme_init_lpass_support_cfg(psoc, gen);
 

+ 23 - 1
components/mlme/dispatcher/inc/cfg_mlme_generic.h

@@ -760,6 +760,27 @@
 				0, 0x52, 0x49, CFG_VALUE_OR_DEFAULT, \
 				"Bit mask to retry Auth and full connection on assoc timeout to same AP for SAE connection")
 
+/*
+ * <ini>
+ *
+ * wls_6ghz_capable - WiFi Location Service(WLS) is 6Ghz capable
+ * @Min: 0 (WLS 6Ghz non-capable)
+ * @Max: 1 (WLS 6Ghz capable)
+ * @Default: 0 (WLS 6Ghz non-capable)
+ *
+ * Related: None
+ *
+ * Supported Feature: General
+ *
+ * Usage: Internal
+ *
+ * </ini>
+ */
+#define CFG_WLS_6GHZ_CAPABLE CFG_INI_BOOL( \
+	"wls_6ghz_capable", \
+	0, \
+	"WiFi Location Service(WLS) is 6Ghz capable or not")
+
 #define CFG_GENERIC_ALL \
 	CFG(CFG_ENABLE_DEBUG_PACKET_LOG) \
 	CFG(CFG_PMF_SA_QUERY_MAX_RETRIES) \
@@ -791,5 +812,6 @@
 	CFG(CFG_BMISS_SKIP_FULL_SCAN) \
 	CFG(CFG_ENABLE_RING_BUFFER) \
 	CFG(CFG_DFS_CHAN_AGEOUT_TIME) \
-	CFG(CFG_SAE_CONNECION_RETRIES)
+	CFG(CFG_SAE_CONNECION_RETRIES) \
+	CFG(CFG_WLS_6GHZ_CAPABLE)
 #endif /* __CFG_MLME_GENERIC_H */

+ 11 - 0
components/mlme/dispatcher/inc/wlan_mlme_api.h

@@ -319,6 +319,17 @@ QDF_STATUS wlan_mlme_get_crash_inject(struct wlan_objmgr_psoc *psoc,
 QDF_STATUS wlan_mlme_get_lpass_support(struct wlan_objmgr_psoc *psoc,
 				       bool *lpass_support);
 
+/**
+ * wlan_mlme_get_wls_6ghz_cap() - Get the wifi location service(WLS)
+ * 6ghz capability
+ * @psoc: pointer to psoc object
+ * @wls_6ghz_capable: Pointer to the variable from caller
+ *
+ * Return: void
+ */
+void wlan_mlme_get_wls_6ghz_cap(struct wlan_objmgr_psoc *psoc,
+				bool *wls_6ghz_capable);
+
 /**
  * wlan_mlme_get_self_recovery() - Get the self recovery config
  * @psoc: pointer to psoc object

+ 2 - 0
components/mlme/dispatcher/inc/wlan_mlme_public_struct.h

@@ -1110,6 +1110,7 @@ struct wlan_mlme_chainmask {
  * @peer_create_conf_support: Peer create confirmation command support
  * @dual_sta_roam_fw_support: Firmware support for dual sta roaming feature
  * @sae_connect_retries: sae connect retry bitmask
+ * @wls_6ghz_capable: wifi location service(WLS) is 6ghz capable
  */
 struct wlan_mlme_generic {
 	uint32_t band_capability;
@@ -1151,6 +1152,7 @@ struct wlan_mlme_generic {
 	bool peer_create_conf_support;
 	bool dual_sta_roam_fw_support;
 	uint32_t sae_connect_retries;
+	bool wls_6ghz_capable;
 };
 
 /*

+ 15 - 0
components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h

@@ -325,6 +325,21 @@ QDF_STATUS ucfg_mlme_get_lpass_support(struct wlan_objmgr_psoc *psoc,
 	return wlan_mlme_get_lpass_support(psoc, lpass_support);
 }
 
+/**
+ * ucfg_mlme_get_wls_6ghz_cap() - Get the WiFi Location Service(WLS)
+ * 6ghz capability
+ * @psoc: pointer to psoc object
+ * @wls_6ghz_capable: Pointer to the variable from caller
+ *
+ * Return: void
+ */
+static inline
+void ucfg_mlme_get_wls_6ghz_cap(struct wlan_objmgr_psoc *psoc,
+				bool *wls_6ghz_capable)
+{
+	wlan_mlme_get_wls_6ghz_cap(psoc, wls_6ghz_capable);
+}
+
 /**
  * ucfg_mlme_get_self_recovery() - Get the self recovery config
  * @psoc: pointer to psoc object

+ 13 - 0
components/mlme/dispatcher/src/wlan_mlme_api.c

@@ -285,6 +285,19 @@ QDF_STATUS wlan_mlme_get_lpass_support(struct wlan_objmgr_psoc *psoc,
 	return QDF_STATUS_SUCCESS;
 }
 
+void wlan_mlme_get_wls_6ghz_cap(struct wlan_objmgr_psoc *psoc,
+				bool *wls_6ghz_capable)
+{
+	struct wlan_mlme_psoc_ext_obj *mlme_obj;
+
+	mlme_obj = mlme_get_psoc_ext_obj(psoc);
+	if (!mlme_obj) {
+		*wls_6ghz_capable = cfg_default(CFG_WLS_6GHZ_CAPABLE);
+		return;
+	}
+	*wls_6ghz_capable = mlme_obj->cfg.gen.wls_6ghz_capable;
+}
+
 QDF_STATUS wlan_mlme_get_self_recovery(struct wlan_objmgr_psoc *psoc,
 				       bool *self_recovery)
 {

+ 15 - 8
core/hdd/src/wlan_hdd_lpass.c

@@ -88,7 +88,7 @@ static int wlan_hdd_gen_wlan_status_pack(struct wlan_status_data *data,
 	uint32_t chan_id;
 	uint32_t *chan_freq_list, chan_freq_len;
 	struct svc_channel_info *chan_info;
-	bool lpass_support;
+	bool lpass_support, wls_6ghz_capable = false;
 	QDF_STATUS status;
 
 	if (!data) {
@@ -116,7 +116,7 @@ static int wlan_hdd_gen_wlan_status_pack(struct wlan_status_data *data,
 		hdd_err("Failed to get LPASS support config");
 		return -EIO;
 	}
-
+	ucfg_mlme_get_wls_6ghz_cap(hdd_ctx->psoc, &wls_6ghz_capable);
 	if (hdd_ctx->lpss_support && lpass_support)
 		data->lpss_support = 1;
 	else
@@ -130,17 +130,24 @@ static int wlan_hdd_gen_wlan_status_pack(struct wlan_status_data *data,
 	chan_freq_len = WLAN_SVC_MAX_NUM_CHAN;
 	sme_get_cfg_valid_channels(chan_freq_list, &chan_freq_len);
 
-	data->numChannels = chan_freq_len;
+	data->numChannels = 0;
+	for (i = 0; i < chan_freq_len; i++) {
+		if (!wls_6ghz_capable &&
+		    wlan_reg_is_6ghz_chan_freq(chan_freq_list[i]))
+			continue;
+
+		chan_id = wlan_reg_freq_to_chan(hdd_ctx->pdev,
+						chan_freq_list[i]);
+		if (!chan_id)
+			continue;
 
-	for (i = 0; i < data->numChannels; i++) {
-		chan_info = &data->channel_info[i];
-		data->channel_list[i] =
-			wlan_reg_freq_to_chan(hdd_ctx->pdev, chan_freq_list[i]);
-		chan_id = data->channel_list[i];
+		chan_info = &data->channel_info[data->numChannels];
+		data->channel_list[data->numChannels] = chan_id;
 		chan_info->chan_id = chan_id;
 		wlan_hdd_get_channel_info(hdd_ctx,
 					  chan_info,
 					  chan_freq_list[i]);
+		data->numChannels++;
 	}
 
 	qdf_mem_free(chan_freq_list);