Kaynağa Gözat

qcacmn: Set/get scan blanking feature support

Extract the scan blanking feature support from WMI service ready
event and store it in target if data structures. Add API to check
whether scan blanking feature is supported for a given pdev.

Change-Id: I65fefbb879b8433a68338bfcd3e4f729eff3ddd8
CRs-Fixed: 3413922
Edayilliam Jayadev 2 yıl önce
ebeveyn
işleme
84ec76c1aa

+ 15 - 0
target_if/core/inc/target_if.h

@@ -2604,6 +2604,21 @@ QDF_STATUS
 target_pdev_scan_radio_is_dfs_enabled(struct wlan_objmgr_pdev *pdev,
 				      bool *is_dfs_en);
 
+/**
+ * target_is_scan_blanking_enabled() - API to check
+ * whether scan blanking needs to be enabled/disabled for scan radio.
+ * @pdev:  pointer to pdev
+ * @blanking_en: Pointer to scan blanking enable flag
+ *
+ * API to check whether scan blanking needs to be enabled/disabled for
+ * scan radio. This API should be used only for a scan radio pdev.
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS
+target_is_scan_blanking_enabled(struct wlan_objmgr_pdev *pdev,
+				bool *blanking_en);
+
 /**
  * target_psoc_get_preamble_puncture_cap() - Get Preamble Puncturing capability
  * @psoc_info: pointer to structure target_psoc_info

+ 72 - 0
target_if/core/src/target_if_main.c

@@ -1018,6 +1018,78 @@ target_pdev_scan_radio_is_dfs_enabled(struct wlan_objmgr_pdev *pdev,
 	return QDF_STATUS_E_INVAL;
 }
 
+QDF_STATUS
+target_is_scan_blanking_enabled(struct wlan_objmgr_pdev *pdev,
+				bool *blanking_en)
+{
+	struct wlan_objmgr_psoc *psoc;
+	struct wlan_psoc_host_scan_radio_caps *scan_radio_caps;
+	uint8_t cap_idx;
+	uint32_t num_scan_radio_caps, pdev_id;
+	int32_t phy_id;
+	struct target_psoc_info *tgt_psoc_info;
+	struct target_pdev_info *tgt_pdev;
+
+	if (!blanking_en) {
+		target_if_err("input argument is null");
+		return QDF_STATUS_E_NULL_VALUE;
+	}
+	*blanking_en = false;
+
+	if (!pdev) {
+		target_if_err("pdev is null");
+		return QDF_STATUS_E_NULL_VALUE;
+	}
+
+	psoc = wlan_pdev_get_psoc(pdev);
+	if (!psoc) {
+		target_if_err("psoc is null");
+		return QDF_STATUS_E_NULL_VALUE;
+	}
+
+	tgt_psoc_info = wlan_psoc_get_tgt_if_handle(psoc);
+	if (!tgt_psoc_info) {
+		target_if_err("target_psoc_info is null");
+		return QDF_STATUS_E_NULL_VALUE;
+	}
+
+	num_scan_radio_caps =
+		target_psoc_get_num_scan_radio_caps(tgt_psoc_info);
+	if (!num_scan_radio_caps) {
+		target_if_err("scan radio not supported for psoc");
+		return QDF_STATUS_E_NULL_VALUE;
+	}
+
+	scan_radio_caps = target_psoc_get_scan_radio_caps(tgt_psoc_info);
+	if (!scan_radio_caps) {
+		target_if_err("scan radio capabilities is null");
+		return QDF_STATUS_E_NULL_VALUE;
+	}
+
+	tgt_pdev = (struct target_pdev_info *)wlan_pdev_get_tgt_if_handle(pdev);
+	if (!tgt_pdev) {
+		target_if_err("target_pdev_info is null");
+		return QDF_STATUS_E_NULL_VALUE;
+	}
+
+	pdev_id = wlan_objmgr_pdev_get_pdev_id(pdev);
+	phy_id = target_pdev_get_phy_idx(tgt_pdev);
+	if (phy_id < 0) {
+		target_if_err("phy_id is invalid");
+		return QDF_STATUS_E_INVAL;
+	}
+
+	for (cap_idx = 0; cap_idx < num_scan_radio_caps; cap_idx++)
+		if (scan_radio_caps[cap_idx].phy_id == phy_id) {
+			*blanking_en = scan_radio_caps[cap_idx].blanking_en;
+			return QDF_STATUS_SUCCESS;
+		}
+
+	target_if_err("No scan radio cap found in pdev %d", pdev_id);
+
+	return QDF_STATUS_E_INVAL;
+}
+
 void target_if_set_reg_cc_ext_supp(struct target_psoc_info *tgt_hdl,
 				   struct wlan_objmgr_psoc *psoc)
 {

+ 2 - 0
target_if/init_deinit/inc/service_ready_param.h

@@ -302,11 +302,13 @@ struct wlan_psoc_host_mac_phy_caps_ext2 {
  * @phy_id: phy id
  * @scan_radio_supported: indicates scan radio support
  * @dfs_en: indicates DFS needs to be enabled/disabled for scan radio vap
+ * @blanking_en: Indicates whether scan blanking feature is enabled
  */
 struct wlan_psoc_host_scan_radio_caps {
 	uint32_t phy_id;
 	bool scan_radio_supported;
 	bool dfs_en;
+	bool blanking_en;
 };
 
 /**

+ 2 - 0
umac/cmn_services/obj_mgr/inc/wlan_objmgr_pdev_obj.h

@@ -113,6 +113,8 @@
 #define WLAN_PDEV_FEXT_AGILE_SPECTRAL_SCAN_320_DIS     0x00000100
 /* WiFi Radar support enabled */
 #define WLAN_PDEV_FEXT_WIFI_RADAR_ENABLE               0x00000200
+/* Scan blanking support enabled.valid only for scan radio supported pdevs */
+#define WLAN_PDEV_FEXT_SCAN_BLANKING_EN                0x00000400
 
 /* PDEV op flags */
    /* Enable htrate for wep and tkip */

+ 2 - 0
wmi/src/wmi_unified_tlv.c

@@ -14823,6 +14823,8 @@ static QDF_STATUS extract_scan_radio_cap_service_ready_ext2_tlv(
 		WMI_SCAN_RADIO_CAP_SCAN_RADIO_FLAG_GET(scan_radio_caps->flags);
 	param->dfs_en =
 		WMI_SCAN_RADIO_CAP_DFS_FLAG_GET(scan_radio_caps->flags);
+	param->blanking_en =
+		WMI_SCAN_RADIO_CAP_BLANKING_SUPPORT_GET(scan_radio_caps->flags);
 
 	return QDF_STATUS_SUCCESS;
 }