Pārlūkot izejas kodu

qcacmn: Add custom filter function to scan filter

Add change to support custom filter function to the scan filter.

Change-Id: If312d7627d11e8938a4f8444e1f930a8fcc25aa8
CRs-Fixed: 2746158
Santosh Anbu 4 gadi atpakaļ
vecāks
revīzija
a729bdd857

+ 17 - 1
umac/scan/core/src/wlan_scan_filter.c

@@ -665,13 +665,29 @@ bool scm_filter_match(struct wlan_objmgr_psoc *psoc,
 	if (filter->rrm_measurement_filter)
 		return true;
 
-	if (!filter->ignore_auth_enc_type &&
+	if (!filter->ignore_auth_enc_type && !filter->match_security_func &&
 	    !scm_is_security_match(filter, db_entry, security)) {
 		scm_debug("%pM : Ignore as security profile didn't match",
 			  db_entry->bssid.bytes);
 		return false;
 	}
 
+	if (filter->match_security_func &&
+	    !filter->match_security_func(filter->match_security_func_arg,
+					 db_entry)) {
+		scm_debug("%pM : Ignore as custom security match failed",
+			  db_entry->bssid.bytes);
+		return false;
+	}
+
+	if (filter->ccx_validate_bss &&
+	    !filter->ccx_validate_bss(filter->ccx_validate_bss_arg,
+				      db_entry, 0)) {
+		scm_debug("%pM : Ignore as CCX validateion failed",
+			  db_entry->bssid.bytes);
+		return false;
+	}
+
 	/* Match realm */
 	if (!scm_is_fils_config_match(filter, db_entry)) {
 		scm_debug("%pM :Ignore as fils config didn't match",

+ 14 - 0
umac/scan/dispatcher/inc/wlan_scan_public_structs.h

@@ -467,6 +467,12 @@ struct fils_filter_info {
 };
 #endif
 
+/*
+ * struct filter_arg: Opaque pointer for the filter arguments
+ */
+struct filter_arg;
+typedef struct filter_arg *bss_filter_arg_t;
+
 /**
  * struct scan_filter: scan filter
  * @enable_adaptive_11r:    flag to check if adaptive 11r ini is enabled
@@ -497,6 +503,10 @@ struct fils_filter_info {
  * @bssid_list: bssid list
  * @ssid_list: ssid list
  * @chan_freq_list: channel frequency list, frequency unit: MHz
+ * @match_security_func: Function pointer to custom security filter
+ * @match_security_func_arg: Function argument to custom security filter
+ * @ccx_validate_bss: Function pointer to custom bssid filter
+ * @ccx_validate_bss_arg: Function argument to custom bssid filter
  */
 struct scan_filter {
 	uint8_t enable_adaptive_11r:1,
@@ -526,6 +536,10 @@ struct scan_filter {
 	struct qdf_mac_addr bssid_list[WLAN_SCAN_FILTER_NUM_BSSID];
 	struct wlan_ssid ssid_list[WLAN_SCAN_FILTER_NUM_SSID];
 	qdf_freq_t chan_freq_list[NUM_CHANNELS];
+	bool (*match_security_func)(void *, struct scan_cache_entry *);
+	bss_filter_arg_t match_security_func_arg;
+	bool (*ccx_validate_bss)(void *, struct scan_cache_entry *, int);
+	bss_filter_arg_t ccx_validate_bss_arg;
 };
 
 /**