浏览代码

qcacmn: Get new scan capability

Host needs to check new scan is enabled on device before
sending scan request.
Changes are as follows:

-Add new scan bit to scan obj.
-Fetch new scan service bit from FW.
-Update new scan in scan obj based on service bit from FW.

Change-Id: I19d874e859208dcdb2476e0fd2fbd61fcc77e565
CRs-Fixed: 3509136
David Oladunjoye 2 年之前
父节点
当前提交
096449a4fe

+ 2 - 0
target_if/init_deinit/src/init_event_handler.c

@@ -43,6 +43,7 @@
 #include <wlan_mlo_mgr_setup.h>
 #endif
 #include <target_if_twt.h>
+#include <target_if_scan.h>
 
 static void init_deinit_set_send_init_cmd(struct wlan_objmgr_psoc *psoc,
 					  struct target_psoc_info *tgt_hdl)
@@ -429,6 +430,7 @@ static int init_deinit_service_ready_event_handler(ol_scn_t scn_handle,
 	target_if_reg_set_6ghz_info(psoc);
 	target_if_reg_set_5dot9_ghz_info(psoc);
 	target_if_twt_fill_tgt_caps(psoc, wmi_handle);
+	target_if_update_aux_support(psoc);
 
 	/* Send num_msdu_desc to DP layer */
 	cdp_soc_set_param(wlan_psoc_get_dp_handle(psoc),

+ 10 - 0
target_if/scan/inc/target_if_scan.h

@@ -129,5 +129,15 @@ target_if_scan_tx_ops_register(struct wlan_lmac_if_tx_ops *tx_ops);
 QDF_STATUS
 target_if_scan_set_max_active_scans(struct wlan_objmgr_psoc *psoc,
 				    uint32_t max_active_scans);
+/**
+ * target_if_update_aux_support() - update aux mac support in scan
+ * object via service bit from FW
+ * @psoc: psoc object
+ *
+ * This function updates aux mac support bit in scan object via service bit
+ * from FW.
+ *
+ */
+QDF_STATUS target_if_update_aux_support(struct wlan_objmgr_psoc *psoc);
 
 #endif

+ 27 - 1
target_if/scan/src/target_if_scan.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -44,6 +44,32 @@ target_if_scan_get_rx_ops(struct wlan_objmgr_psoc *psoc)
 	return &rx_ops->scan;
 }
 
+QDF_STATUS target_if_update_aux_support(struct wlan_objmgr_psoc *psoc)
+{
+	struct wmi_unified *wmi_handle;
+	struct wlan_scan_obj *scan_obj;
+
+	wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
+
+	if (!wmi_handle) {
+		target_if_err("null wmi handle");
+		return QDF_STATUS_E_FAILURE;
+	}
+	scan_obj = wlan_psoc_get_scan_obj(psoc);
+
+	if (!scan_obj) {
+		target_if_err("Failed to get scan object");
+		return QDF_STATUS_E_FAILURE;
+	}
+	if (wmi_service_enabled(wmi_handle, wmi_service_aux_mac_support))
+		scan_obj->aux_mac_support = true;
+	else
+		scan_obj->aux_mac_support = false;
+
+	target_if_debug("aux_mac_support:%d", scan_obj->aux_mac_support);
+	return QDF_STATUS_SUCCESS;
+}
+
 static int
 target_if_scan_event_handler(ol_scn_t scn, uint8_t *data, uint32_t datalen)
 {

+ 8 - 0
umac/scan/core/src/wlan_scan_main.h

@@ -165,6 +165,12 @@ struct probe_time_dwell_time {
 /* Passive dwell time if bt_a2dp is enabled. Time in msecs*/
 #define PASSIVE_DWELL_TIME_BT_A2DP_ENABLED 28
 
+/* Aux Scan Flags */
+#define SCAN_FLAG_EXT_AUX_LOW_POWER_SCAN	0x0000020000
+#define SCAN_FLAG_EXT_AUX_LOW_LATENCY_SCAN	0x0000040000
+#define SCAN_FLAG_EXT_AUX_FAST_SCAN		0x0000080000
+#define SCAN_FLAG_EXT_AUX_RELIABLE_SCAN		0x0000100000
+
 /**
  * struct cb_handler - defines scan event handler
  * call back function and arguments
@@ -550,6 +556,7 @@ struct scan_cb {
  *                        on the ini scan_mode_6ghz_duty_cycle.
  * @allow_bss_with_incomplete_ie: Continue scan entry even if any corrupted
  *                                IEs are present.
+ * @aux_mac_support: advertise aux mac support from FW
  */
 struct wlan_scan_obj {
 	uint32_t scan_disabled;
@@ -586,6 +593,7 @@ struct wlan_scan_obj {
 #endif
 	uint16_t duty_cycle_cnt_6ghz;
 	bool allow_bss_with_incomplete_ie;
+	bool aux_mac_support;
 };
 
 #ifdef ENABLE_SCAN_PROFILE

+ 11 - 0
umac/scan/dispatcher/inc/wlan_scan_api.h

@@ -541,4 +541,15 @@ QDF_STATUS
 wlan_scan_get_mld_addr_by_link_addr(struct wlan_objmgr_pdev *pdev,
 				    struct qdf_mac_addr *link_addr,
 				    struct qdf_mac_addr *mld_mac_addr);
+
+/**
+ * wlan_scan_get_aux_support() - get aux scan policy
+ * @psoc: psoc object
+ *
+ * Set aux scan bits in scan_ctrl_ext_flag value depending on scan type.
+ *
+ * Return: true/false
+ */
+bool wlan_scan_get_aux_support(struct wlan_objmgr_psoc *psoc);
+
 #endif

+ 18 - 0
umac/scan/dispatcher/src/wlan_scan_api.c

@@ -886,3 +886,21 @@ wlan_scan_get_scan_entry_by_mac_freq(struct wlan_objmgr_pdev *pdev,
 {
 	return scm_scan_get_scan_entry_by_mac_freq(pdev, bssid, freq);
 }
+
+bool wlan_scan_get_aux_support(struct wlan_objmgr_psoc *psoc)
+
+{
+	struct wlan_scan_obj *scan_obj;
+
+	scan_obj = wlan_psoc_get_scan_obj(psoc);
+	if (!scan_obj)
+		return false;
+
+	if (scan_obj->aux_mac_support)
+		scm_debug("aux mac support: %d", scan_obj->aux_mac_support);
+	else
+		scm_debug("aux mac not supported");
+
+	return scan_obj->aux_mac_support;
+}
+

+ 1 - 0
umac/scan/dispatcher/src/wlan_scan_ucfg_api.c

@@ -829,6 +829,7 @@ wlan_scan_global_init(struct wlan_objmgr_psoc *psoc,
 		cfg_get(psoc, CFG_SKIP_6GHZ_AND_INDOOR_FREQ_SCAN);
 	scan_obj->scan_def.last_scan_ageout_time =
 		cfg_get(psoc, CFG_LAST_SCAN_AGEOUT_TIME);
+	scan_obj->aux_mac_support = false;
 
 	/* init scan id seed */
 	qdf_atomic_init(&scan_obj->scan_ids);