소스 검색

qcacmn: SSID with zero or space should be NULL ssid

Last frame received in scan before the connect is
beacon with NULL ssid with non zero length and ssid
is sent as NULL to supplicant after association. This
will result in supplicant to trigger disconnect
casuing delay in reconnection.

Fix is to consider ssid with zeros or spaces as null
ssid.

Change-Id: If96776ae85926948d714e975c3e9b4011e8a20b3
CRs-Fixed: 2330485
Yeshwanth Sriram Guntuka 6 년 전
부모
커밋
294ce1121a
3개의 변경된 파일42개의 추가작업 그리고 8개의 파일을 삭제
  1. 3 2
      umac/scan/core/src/wlan_scan_cache_db.c
  2. 37 4
      umac/scan/dispatcher/inc/wlan_scan_utils_api.h
  3. 2 2
      umac/scan/dispatcher/src/wlan_scan_utils_api.c

+ 3 - 2
umac/scan/core/src/wlan_scan_cache_db.c

@@ -491,7 +491,8 @@ scm_copy_info_from_dup_entry(struct scan_dbs *scan_db,
 
 	scan_entry = scan_node->entry;
 	/* If old entry have the ssid but new entry does not */
-	if (!scan_params->ssid.length && scan_entry->ssid.length) {
+	if (util_scan_is_null_ssid(&scan_params->ssid) &&
+	    scan_entry->ssid.length) {
 		/*
 		 * New entry has a hidden SSID and old one has the SSID.
 		 * Add the entry by using the ssid of the old entry
@@ -510,7 +511,7 @@ scm_copy_info_from_dup_entry(struct scan_dbs *scan_db,
 				scan_entry->ssid.length;
 			qdf_mem_copy(scan_params->ssid.ssid,
 				scan_entry->ssid.ssid,
-				scan_params->ssid.length);
+				scan_entry->ssid.length);
 		}
 	}
 

+ 37 - 4
umac/scan/dispatcher/inc/wlan_scan_utils_api.h

@@ -31,6 +31,8 @@
 #include <wlan_scan_public_structs.h>
 #include<wlan_mgmt_txrx_utils_api.h>
 
+#define ASCII_SPACE_CHARACTER 32
+
 /**
  * util_is_scan_entry_match() - func to check if both scan entry
  * are from same AP
@@ -286,10 +288,6 @@ static inline bool
 util_is_ssid_match(struct wlan_ssid *ssid1,
 		struct wlan_ssid *ssid2)
 {
-
-	if (ssid1->length == 0)
-		return true;
-
 	if (ssid1->length != ssid2->length)
 		return false;
 
@@ -1562,4 +1560,39 @@ util_scan_entry_mdie(struct scan_cache_entry *scan_entry)
 	return scan_entry->ie_list.mdie;
 }
 
+/**
+ * util_scan_is_null_ssid() - to check for NULL ssid
+ * @ssid: ssid
+ *
+ * Return: true if NULL ssid else false
+ */
+static inline bool util_scan_is_null_ssid(struct wlan_ssid *ssid)
+{
+	uint32_t ssid_length;
+	uint8_t *ssid_str;
+
+	if (ssid->length == 0)
+		return true;
+
+	/* Consider 0 or space for hidden SSID */
+	if (0 == ssid->ssid[0])
+		return true;
+
+	ssid_length = ssid->length;
+	ssid_str = ssid->ssid;
+
+	while (ssid_length) {
+		if (*ssid_str != ASCII_SPACE_CHARACTER &&
+		    *ssid_str)
+			break;
+		ssid_str++;
+		ssid_length--;
+	}
+
+	if (ssid_length == 0)
+		return true;
+
+	return false;
+}
+
 #endif

+ 2 - 2
umac/scan/dispatcher/src/wlan_scan_utils_api.c

@@ -136,8 +136,8 @@ bool util_is_scan_entry_match(
 	   entry1->channel.chan_idx) ==
 	   util_scan_scm_chan_to_band(entry2->channel.chan_idx)) {
 		/* Check for BSS */
-		if (util_is_ssid_match(
-		   &entry1->ssid, &entry2->ssid))
+		if (util_is_ssid_match(&entry1->ssid, &entry2->ssid) ||
+		    util_scan_is_null_ssid(&entry1->ssid))
 			return true;
 	} else if (entry1->cap_info.wlan_caps.ibss &&
 	   (entry1->channel.chan_idx ==