Sfoglia il codice sorgente

qcacmn: Temporary WAR to bypass beacon channel mismatch check

For 4.9GHz, firmware converts the frequency to old regulatory channel
numbers and sends it to host. But host uses new regulatory channel numbers.
Since the received fw channel and beacon channel number is different,
host drops the received beacon and scan entry doesnot get updated.

As a temporary fix, bypass the beacon mismatch check in host.

Change-Id: Ib3e6b7b39ef2feaa1bcf0e0b16a702caccbf6744
Shashikala Prabhu 7 anni fa
parent
commit
7edbb05f11

+ 18 - 0
umac/regulatory/core/src/reg_services.c

@@ -1776,6 +1776,24 @@ uint32_t reg_chan_to_freq(struct wlan_objmgr_pdev *pdev,
 	return 0;
 }
 
+#ifndef CONFIG_LEGACY_CHAN_ENUM
+bool reg_chan_is_49ghz(struct wlan_objmgr_pdev *pdev,
+		uint8_t chan_num)
+{
+	uint32_t freq = 0;
+
+	freq = reg_chan_to_freq(pdev, chan_num);
+
+	return REG_IS_49GHZ_FREQ(freq) ? true : false;
+}
+#else
+bool reg_chan_is_49ghz(struct wlan_objmgr_pdev *pdev,
+		uint8_t chan_num)
+{
+	return false;
+}
+#endif
+
 enum band_info reg_chan_to_band(uint32_t chan_num)
 {
 	if (chan_num <= 14)

+ 10 - 0
umac/regulatory/core/src/reg_services.h

@@ -317,6 +317,16 @@ uint32_t reg_freq_to_chan(struct wlan_objmgr_pdev *pdev, uint32_t freq);
 
 uint32_t reg_chan_to_freq(struct wlan_objmgr_pdev *pdev, uint32_t chan_num);
 
+/**
+ * reg_chan_is_49ghz() - Check if the input channel number is 4.9GHz
+ * @pdev: Pdev pointer
+ * @chan_num: Input channel number
+ *
+ * Return: true if the channel is 4.9GHz else false.
+ */
+bool reg_chan_is_49ghz(struct wlan_objmgr_pdev *pdev,
+		uint8_t chan_num);
+
 /**
  * reg_set_config_vars () - set configration variables
  * @psoc: psoc ptr

+ 11 - 0
umac/regulatory/dispatcher/inc/wlan_reg_services_api.h

@@ -390,6 +390,17 @@ bool wlan_reg_is_world(uint8_t *country);
  */
 bool wlan_reg_is_us(uint8_t *country);
 
+/**
+ * wlan_reg_chan_is_49ghz() - Check if the input channel number is 4.9GHz
+ * @pdev: Pdev pointer
+ * @chan_num: Input channel number
+ *
+ * Return: true if the channel is 4.9GHz else false.
+ */
+
+bool wlan_reg_chan_is_49ghz(struct wlan_objmgr_pdev *pdev,
+		uint8_t chan_num);
+
 /**
  * wlan_reg_set_country() - Set the current regulatory country
  * @pdev: The physical dev to set current country for

+ 6 - 0
umac/regulatory/dispatcher/src/wlan_reg_services_api.c

@@ -445,6 +445,12 @@ uint32_t wlan_reg_chan_to_freq(struct wlan_objmgr_pdev *pdev,
 	return reg_chan_to_freq(pdev, chan_num);
 }
 
+bool wlan_reg_chan_is_49ghz(struct wlan_objmgr_pdev *pdev,
+		uint8_t chan_num)
+{
+	return reg_chan_is_49ghz(pdev, chan_num);
+}
+
 QDF_STATUS wlan_reg_set_country(struct wlan_objmgr_pdev *pdev,
 				       uint8_t *country)
 {

+ 1 - 1
umac/scan/core/src/wlan_scan_cache_db.c

@@ -736,7 +736,7 @@ QDF_STATUS scm_handle_bcn_probe(struct scheduler_msg *msg)
 	}
 
 	scan_list =
-		 util_scan_unpack_beacon_frame(qdf_nbuf_data(bcn->buf),
+		 util_scan_unpack_beacon_frame(pdev, qdf_nbuf_data(bcn->buf),
 			qdf_nbuf_len(bcn->buf), bcn->frm_type,
 			bcn->rx_data);
 	if (!scan_list || qdf_list_empty(scan_list)) {

+ 2 - 0
umac/scan/dispatcher/inc/wlan_scan_utils_api.h

@@ -47,6 +47,7 @@ bool util_is_scan_entry_match(
 
 /**
  * util_scan_unpack_beacon_frame() - func to unpack beacon frame to scan entry
+ * @pdev: pdev pointer
  * @frame: beacon/probe frame
  * @frame_len: beacon frame len
  * @frm_subtype: beacon or probe
@@ -57,6 +58,7 @@ bool util_is_scan_entry_match(
  * Return: unpacked list of scan entries.
  */
 qdf_list_t *util_scan_unpack_beacon_frame(
+	struct wlan_objmgr_pdev *pdev,
 	uint8_t *frame, qdf_size_t frame_len, uint32_t frm_subtype,
 	struct mgmt_rx_event_params *rx_param);
 

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

@@ -815,7 +815,7 @@ static int util_scan_scm_calc_nss_supported_by_ap(
 }
 
 qdf_list_t *
-util_scan_unpack_beacon_frame(uint8_t *frame,
+util_scan_unpack_beacon_frame(struct wlan_objmgr_pdev *pdev, uint8_t *frame,
 	qdf_size_t frame_len, uint32_t frm_subtype,
 	struct mgmt_rx_event_params *rx_param)
 {
@@ -931,7 +931,8 @@ util_scan_unpack_beacon_frame(uint8_t *frame,
 				rx_param->channel;
 	} else if (rx_param->channel !=
 	   scan_entry->channel.chan_idx) {
-		scan_entry->channel_mismatch = true;
+		if (!wlan_reg_chan_is_49ghz(pdev, scan_entry->channel.chan_idx))
+			scan_entry->channel_mismatch = true;
 	}
 
 	if (util_scan_is_hidden_ssid(ssid)) {