From d2c03e6a745d6e204cef03588769a487d449ef43 Mon Sep 17 00:00:00 2001 From: Vignesh U Date: Sun, 2 Feb 2020 23:05:46 +0530 Subject: [PATCH] qcacmn: Have same rows orders for the channel enums and channel maps In many functions, in the regulatory component (e.g reg_modify_chan_list_for_freq_range), the channel enum iterations assumes the channel enums and channel maps have the same order so that there is a one-to-one mapping. The change I5fe2c7a5db44f1cf8d6cb6317396c4527482137c removed (compile-conditionally) a few channels. The removal violated the one-to-one mapping principle. This led to 2Ghz channels being added to 5Ghz only radio, which in turn caused many auto-channel selection issues and test failures. Instead of removing the channels, add (compile-conditionally) invalid channels to maintain the one-to-one mapping. Change-Id: I023de9732e02d52e544199b77680e9f7706d5210 CRs-Fixed: 2612990 --- umac/regulatory/core/src/reg_services_common.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/umac/regulatory/core/src/reg_services_common.c b/umac/regulatory/core/src/reg_services_common.c index 86e0c039fd30..0e5fe26650f7 100644 --- a/umac/regulatory/core/src/reg_services_common.c +++ b/umac/regulatory/core/src/reg_services_common.c @@ -259,10 +259,16 @@ const struct chan_map channel_map_us[NUM_CHANNELS] = { [CHAN_ENUM_5850] = {5850, 170, 2, 160}, [CHAN_ENUM_5855] = {5855, 171, 2, 160}, [CHAN_ENUM_5860] = {5860, 172, 2, 160}, +#else + [CHAN_ENUM_5850] = {5850, INVALID_CHANNEL_NUM, 2, 160}, + [CHAN_ENUM_5855] = {5855, INVALID_CHANNEL_NUM, 2, 160}, + [CHAN_ENUM_5860] = {5860, INVALID_CHANNEL_NUM, 2, 160}, #endif [CHAN_ENUM_5865] = {5865, 173, 2, 160}, #ifdef WLAN_FEATURE_DSRC [CHAN_ENUM_5870] = {5870, 174, 2, 160}, +#else + [CHAN_ENUM_5870] = {5870, INVALID_CHANNEL_NUM, 2, 160}, #endif [CHAN_ENUM_5875] = {5875, 175, 2, 160}, [CHAN_ENUM_5880] = {5880, 176, 2, 160},