Forráskód Böngészése

qcacmn: Add a condition in reg_compute_chan_to_freq for 6G channel 2

When 6G IEEE channel 2 (5935 MHz) is enabled in the master channel list,
and if the channel 1 (5955 MHz) is the input to the API
reg_compute_chan_to_freq, the API returns 0 as the output channel
frequency.

Since the IEEE number 2 is greater than 1 (but in terms of frequency it
is a lesser value), the break condition in the for-loop gets
satisfied, and since the enum of channel 2 is equal to MIN_6GHZ_CHANNEL,
the API returns 0.

To fix this issue, in reg_chan_band_to_freq, handle 6G channel 2 as a
special case by directly returning its frequency, and also
skip it from the search space of reg_compute_chan_to_freq.

Change-Id: Ief79ee2d93f4d547688e10113a8105a763c767f8
CRs-Fixed: 3013255
Hariharan Basuthkar 3 éve
szülő
commit
e1708ea080

+ 22 - 1
umac/regulatory/core/src/reg_services_common.c

@@ -2300,7 +2300,28 @@ qdf_freq_t reg_chan_band_to_freq(struct wlan_objmgr_pdev *pdev,
 				return 0;
 		}
 
-		min_chan = MIN_6GHZ_CHANNEL;
+		/* Handle 6G channel 2 as a special case as it does not follow
+		 * the regular increasing order of channel numbers
+		 */
+		if (chan_num == SIXG_CHAN_2) {
+			struct regulatory_channel *mas_chan_list;
+
+			mas_chan_list = pdev_priv_obj->mas_chan_list;
+			/* Check if chan 2 is in the master list */
+			if ((mas_chan_list[CHAN_ENUM_SIXG_2].state !=
+			     CHANNEL_STATE_DISABLE) &&
+			    !(mas_chan_list[CHAN_ENUM_SIXG_2].chan_flags &
+			     REGULATORY_CHAN_DISABLED))
+				return mas_chan_list[CHAN_ENUM_SIXG_2].
+								center_freq;
+			else
+				return 0;
+		}
+
+		/* MIN_6GHZ_CHANNEL corresponds to CHAN_ENUM_5935
+		 * ( a.k.a SIXG_CHAN_2). Skip it from the search space
+		 */
+		min_chan = MIN_6GHZ_CHANNEL + 1;
 		max_chan = MAX_6GHZ_CHANNEL;
 		return reg_compute_chan_to_freq(pdev, chan_num,
 						min_chan,

+ 7 - 0
umac/regulatory/core/src/reg_services_common.h

@@ -138,6 +138,13 @@
 #define DEFAULT_HIGH_6GFREQ   7125
 #endif
 
+#define SIXG_CHAN_2           2
+#ifdef CONFIG_BAND_6GHZ
+#define CHAN_ENUM_SIXG_2      CHAN_ENUM_5935
+#else
+#define CHAN_ENUM_SIXG_2      INVALID_CHANNEL
+#endif
+
 extern const struct chan_map *channel_map;
 extern const struct chan_map channel_map_us[];
 extern const struct chan_map channel_map_eu[];