diff --git a/core/cds/inc/cds_reg_service.h b/core/cds/inc/cds_reg_service.h index b8bc47c2df..65f3f9d983 100644 --- a/core/cds/inc/cds_reg_service.h +++ b/core/cds/inc/cds_reg_service.h @@ -78,85 +78,79 @@ typedef enum { } v_REGDOMAIN_t; enum channel_enum { - RF_CHAN_1 = 0, - RF_CHAN_2, - RF_CHAN_3, - RF_CHAN_4, - RF_CHAN_5, - RF_CHAN_6, - RF_CHAN_7, - RF_CHAN_8, - RF_CHAN_9, - RF_CHAN_10, - RF_CHAN_11, - RF_CHAN_12, - RF_CHAN_13, - RF_CHAN_14, + CHAN_ENUM_1 = 0, + CHAN_ENUM_2, + CHAN_ENUM_3, + CHAN_ENUM_4, + CHAN_ENUM_5, + CHAN_ENUM_6, + CHAN_ENUM_7, + CHAN_ENUM_8, + CHAN_ENUM_9, + CHAN_ENUM_10, + CHAN_ENUM_11, + CHAN_ENUM_12, + CHAN_ENUM_13, + CHAN_ENUM_14, - RF_CHAN_36, - RF_CHAN_40, - RF_CHAN_44, - RF_CHAN_48, - RF_CHAN_52, - RF_CHAN_56, - RF_CHAN_60, - RF_CHAN_64, + CHAN_ENUM_36, + CHAN_ENUM_40, + CHAN_ENUM_44, + CHAN_ENUM_48, + CHAN_ENUM_52, + CHAN_ENUM_56, + CHAN_ENUM_60, + CHAN_ENUM_64, - RF_CHAN_100, - RF_CHAN_104, - RF_CHAN_108, - RF_CHAN_112, - RF_CHAN_116, - RF_CHAN_120, - RF_CHAN_124, - RF_CHAN_128, - RF_CHAN_132, - RF_CHAN_136, - RF_CHAN_140, - RF_CHAN_144, + CHAN_ENUM_100, + CHAN_ENUM_104, + CHAN_ENUM_108, + CHAN_ENUM_112, + CHAN_ENUM_116, + CHAN_ENUM_120, + CHAN_ENUM_124, + CHAN_ENUM_128, + CHAN_ENUM_132, + CHAN_ENUM_136, + CHAN_ENUM_140, + CHAN_ENUM_144, - RF_CHAN_149, - RF_CHAN_153, - RF_CHAN_157, - RF_CHAN_161, - RF_CHAN_165, + CHAN_ENUM_149, + CHAN_ENUM_153, + CHAN_ENUM_157, + CHAN_ENUM_161, + CHAN_ENUM_165, - RF_CHAN_170, - RF_CHAN_171, - RF_CHAN_172, - RF_CHAN_173, - RF_CHAN_174, - RF_CHAN_175, - RF_CHAN_176, - RF_CHAN_177, - RF_CHAN_178, - RF_CHAN_179, - RF_CHAN_180, - RF_CHAN_181, - RF_CHAN_182, - RF_CHAN_183, - RF_CHAN_184, + CHAN_ENUM_170, + CHAN_ENUM_171, + CHAN_ENUM_172, + CHAN_ENUM_173, + CHAN_ENUM_174, + CHAN_ENUM_175, + CHAN_ENUM_176, + CHAN_ENUM_177, + CHAN_ENUM_178, + CHAN_ENUM_179, + CHAN_ENUM_180, + CHAN_ENUM_181, + CHAN_ENUM_182, + CHAN_ENUM_183, + CHAN_ENUM_184, - NUM_RF_CHANNELS, + NUM_CHANNELS, - MIN_24GHZ_CHANNEL = RF_CHAN_1, - MAX_24GHZ_CHANNEL = RF_CHAN_14, + MIN_24GHZ_CHANNEL = CHAN_ENUM_1, + MAX_24GHZ_CHANNEL = CHAN_ENUM_14, NUM_24GHZ_CHANNELS = (MAX_24GHZ_CHANNEL - MIN_24GHZ_CHANNEL + 1), - MIN_5GHZ_CHANNEL = RF_CHAN_36, - MAX_5GHZ_CHANNEL = RF_CHAN_184, + MIN_5GHZ_CHANNEL = CHAN_ENUM_36, + MAX_5GHZ_CHANNEL = CHAN_ENUM_184, NUM_5GHZ_CHANNELS = (MAX_5GHZ_CHANNEL - MIN_5GHZ_CHANNEL + 1), - MIN_20MHZ_RF_CHANNEL = RF_CHAN_1, - MAX_20MHZ_RF_CHANNEL = RF_CHAN_184, - NUM_20MHZ_RF_CHANNELS = - (MAX_20MHZ_RF_CHANNEL - MIN_20MHZ_RF_CHANNEL + 1), + MIN_59GHZ_CHANNEL = CHAN_ENUM_170, + MAX_59GHZ_CHANNEL = CHAN_ENUM_184, - MIN_59GHZ_CHANNEL = RF_CHAN_170, - MAX_59GHZ_CHANNEL = RF_CHAN_184, - - INVALID_RF_CHANNEL = 0xBAD, - RF_CHANNEL_INVALID_MAX_FIELD = 0x7FFFFFFF + INVALID_CHANNEL = 0xBAD, }; /** @@ -274,8 +268,8 @@ enum channel_width { CHAN_WIDTH_160MHZ }; -extern const struct chan_map chan_mapping[NUM_RF_CHANNELS]; -extern struct regulatory_channel reg_channels[NUM_RF_CHANNELS]; +extern const struct chan_map chan_mapping[NUM_CHANNELS]; +extern struct regulatory_channel reg_channels[NUM_CHANNELS]; QDF_STATUS cds_get_reg_domain_from_country_code(v_REGDOMAIN_t *pRegDomain, const uint8_t *country_alpha2, diff --git a/core/cds/src/cds_reg_service.c b/core/cds/src/cds_reg_service.c index 463d0a19b4..5f77ce5e9e 100644 --- a/core/cds/src/cds_reg_service.c +++ b/core/cds/src/cds_reg_service.c @@ -40,64 +40,68 @@ #include "cds_reg_service.h" #include "cds_regdomain.h" -const struct chan_map chan_mapping[NUM_RF_CHANNELS] = { - {2412, 1}, - {2417, 2}, - {2422, 3}, - {2427, 4}, - {2432, 5}, - {2437, 6}, - {2442, 7}, - {2447, 8}, - {2452, 9}, - {2457, 10}, - {2462, 11}, - {2467, 12}, - {2472, 13}, - {2484, 14}, - {5180, 36}, - {5200, 40}, - {5220, 44}, - {5240, 48}, - {5260, 52}, - {5280, 56}, - {5300, 60}, - {5320, 64}, - {5500, 100}, - {5520, 104}, - {5540, 108}, - {5560, 112}, - {5580, 116}, - {5600, 120}, - {5620, 124}, - {5640, 128}, - {5660, 132}, - {5680, 136}, - {5700, 140}, - {5720, 144}, - {5745, 149}, - {5765, 153}, - {5785, 157}, - {5805, 161}, - {5825, 165}, - {5852, 170}, - {5855, 171}, - {5860, 172}, - {5865, 173}, - {5870, 174}, - {5875, 175}, - {5880, 176}, - {5885, 177}, - {5890, 178}, - {5895, 179}, - {5900, 180}, - {5905, 181}, - {5910, 182}, - {5915, 183}, - {5920, 184}, +const struct chan_map chan_mapping[NUM_CHANNELS] = { + [CHAN_ENUM_1] = {2412, 1}, + [CHAN_ENUM_2] = {2417, 2}, + [CHAN_ENUM_3] = {2422, 3}, + [CHAN_ENUM_4] = {2427, 4}, + [CHAN_ENUM_5] = {2432, 5}, + [CHAN_ENUM_6] = {2437, 6}, + [CHAN_ENUM_7] = {2442, 7}, + [CHAN_ENUM_8] = {2447, 8}, + [CHAN_ENUM_9] = {2452, 9}, + [CHAN_ENUM_10] = {2457, 10}, + [CHAN_ENUM_11] = {2462, 11}, + [CHAN_ENUM_12] = {2467, 12}, + [CHAN_ENUM_13] = {2472, 13}, + [CHAN_ENUM_14] = {2484, 14}, + + [CHAN_ENUM_36] = {5180, 36}, + [CHAN_ENUM_40] = {5200, 40}, + [CHAN_ENUM_44] = {5220, 44}, + [CHAN_ENUM_48] = {5240, 48}, + [CHAN_ENUM_52] = {5260, 52}, + [CHAN_ENUM_56] = {5280, 56}, + [CHAN_ENUM_60] = {5300, 60}, + [CHAN_ENUM_64] = {5320, 64}, + + [CHAN_ENUM_100] = {5500, 100}, + [CHAN_ENUM_104] = {5520, 104}, + [CHAN_ENUM_108] = {5540, 108}, + [CHAN_ENUM_112] = {5560, 112}, + [CHAN_ENUM_116] = {5580, 116}, + [CHAN_ENUM_120] = {5600, 120}, + [CHAN_ENUM_124] = {5620, 124}, + [CHAN_ENUM_128] = {5640, 128}, + [CHAN_ENUM_132] = {5660, 132}, + [CHAN_ENUM_136] = {5680, 136}, + [CHAN_ENUM_140] = {5700, 140}, + [CHAN_ENUM_144] = {5720, 144}, + + [CHAN_ENUM_149] = {5745, 149}, + [CHAN_ENUM_153] = {5765, 153}, + [CHAN_ENUM_157] = {5785, 157}, + [CHAN_ENUM_161] = {5805, 161}, + [CHAN_ENUM_165] = {5825, 165}, + + [CHAN_ENUM_170] = {5852, 170}, + [CHAN_ENUM_171] = {5855, 171}, + [CHAN_ENUM_172] = {5860, 172}, + [CHAN_ENUM_173] = {5865, 173}, + [CHAN_ENUM_174] = {5870, 174}, + [CHAN_ENUM_175] = {5875, 175}, + [CHAN_ENUM_176] = {5880, 176}, + [CHAN_ENUM_177] = {5885, 177}, + [CHAN_ENUM_178] = {5890, 178}, + [CHAN_ENUM_179] = {5895, 179}, + [CHAN_ENUM_180] = {5900, 180}, + [CHAN_ENUM_181] = {5905, 181}, + [CHAN_ENUM_182] = {5910, 182}, + [CHAN_ENUM_183] = {5915, 183}, + [CHAN_ENUM_184] = {5920, 184}, }; -struct regulatory_channel reg_channels[NUM_RF_CHANNELS]; +struct regulatory_channel reg_channels[NUM_CHANNELS]; uint8_t default_country[CDS_COUNTRY_CODE_LEN + 1]; uint8_t dfs_region; @@ -117,7 +121,7 @@ QDF_STATUS cds_get_channel_list_with_power(struct channel_power if (base_channels && num_base_channels) { count = 0; - for (i = 0; i <= RF_CHAN_14; i++) { + for (i = 0; i <= CHAN_ENUM_14; i++) { if (reg_channels[i].state) { base_channels[count].chan_num = chan_mapping[i].chan_num; @@ -125,7 +129,7 @@ QDF_STATUS cds_get_channel_list_with_power(struct channel_power reg_channels[i].pwr_limit; } } - for (i = RF_CHAN_36; i <= RF_CHAN_184; i++) { + for (i = CHAN_ENUM_36; i <= CHAN_ENUM_184; i++) { if (reg_channels[i].state) { base_channels[count].chan_num = chan_mapping[i].chan_num; @@ -169,14 +173,14 @@ static enum channel_enum cds_get_channel_enum(uint32_t chan_num) { uint32_t loop; - for (loop = 0; loop <= RF_CHAN_184; loop++) + for (loop = 0; loop <= CHAN_ENUM_184; loop++) if (chan_mapping[loop].chan_num == chan_num) return loop; QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR, "invalid channel number %d", chan_num); - return INVALID_RF_CHANNEL; + return INVALID_CHANNEL; } @@ -191,7 +195,7 @@ enum channel_state cds_get_channel_state(uint32_t chan_num) enum channel_enum chan_enum; chan_enum = cds_get_channel_enum(chan_num); - if (INVALID_RF_CHANNEL == chan_enum) + if (INVALID_CHANNEL == chan_enum) return CHANNEL_STATE_INVALID; else return reg_channels[chan_enum].state; @@ -211,7 +215,7 @@ enum channel_state cds_get_bonded_channel_state(uint32_t chan_num, bool bw_enabled = false; chan_enum = cds_get_channel_enum(chan_num); - if (INVALID_RF_CHANNEL == chan_enum) + if (INVALID_CHANNEL == chan_enum) return CHANNEL_STATE_INVALID; if (reg_channels[chan_enum].state) { @@ -253,7 +257,7 @@ enum channel_width cds_get_max_channel_bw(uint32_t chan_num) chan_enum = cds_get_channel_enum(chan_num); - if ((INVALID_RF_CHANNEL != chan_enum) && + if ((INVALID_CHANNEL != chan_enum) && (CHANNEL_STATE_DISABLE != reg_channels[chan_enum].state)) { if (!(reg_channels[chan_enum].flags & diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index 796e10da61..dbb6ac4812 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -1245,7 +1245,7 @@ struct hdd_context_s { struct regulatory reg; #ifdef FEATURE_WLAN_CH_AVOID uint16_t unsafe_channel_count; - uint16_t unsafe_channel_list[NUM_20MHZ_RF_CHANNELS]; + uint16_t unsafe_channel_list[NUM_CHANNELS]; #endif /* FEATURE_WLAN_CH_AVOID */ uint8_t max_intf_count; diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 9176680ed3..2abd3ffef3 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -1266,20 +1266,20 @@ static void wlan_hdd_set_acs_ch_range(tsap_Config_t *sap_cfg, bool ht_enabled, int i; if (sap_cfg->acs_cfg.hw_mode == QCA_ACS_MODE_IEEE80211B) { sap_cfg->acs_cfg.hw_mode = eCSR_DOT11_MODE_11b; - sap_cfg->acs_cfg.start_ch = CDS_CHANNEL_NUM(RF_CHAN_1); - sap_cfg->acs_cfg.end_ch = CDS_CHANNEL_NUM(RF_CHAN_14); + sap_cfg->acs_cfg.start_ch = CDS_CHANNEL_NUM(CHAN_ENUM_1); + sap_cfg->acs_cfg.end_ch = CDS_CHANNEL_NUM(CHAN_ENUM_14); } else if (sap_cfg->acs_cfg.hw_mode == QCA_ACS_MODE_IEEE80211G) { sap_cfg->acs_cfg.hw_mode = eCSR_DOT11_MODE_11g; - sap_cfg->acs_cfg.start_ch = CDS_CHANNEL_NUM(RF_CHAN_1); - sap_cfg->acs_cfg.end_ch = CDS_CHANNEL_NUM(RF_CHAN_13); + sap_cfg->acs_cfg.start_ch = CDS_CHANNEL_NUM(CHAN_ENUM_1); + sap_cfg->acs_cfg.end_ch = CDS_CHANNEL_NUM(CHAN_ENUM_13); } else if (sap_cfg->acs_cfg.hw_mode == QCA_ACS_MODE_IEEE80211A) { sap_cfg->acs_cfg.hw_mode = eCSR_DOT11_MODE_11a; - sap_cfg->acs_cfg.start_ch = CDS_CHANNEL_NUM(RF_CHAN_36); - sap_cfg->acs_cfg.end_ch = CDS_CHANNEL_NUM(RF_CHAN_165); + sap_cfg->acs_cfg.start_ch = CDS_CHANNEL_NUM(CHAN_ENUM_36); + sap_cfg->acs_cfg.end_ch = CDS_CHANNEL_NUM(CHAN_ENUM_165); } else if (sap_cfg->acs_cfg.hw_mode == QCA_ACS_MODE_IEEE80211ANY) { sap_cfg->acs_cfg.hw_mode = eCSR_DOT11_MODE_abg; - sap_cfg->acs_cfg.start_ch = CDS_CHANNEL_NUM(RF_CHAN_1); - sap_cfg->acs_cfg.end_ch = CDS_CHANNEL_NUM(RF_CHAN_165); + sap_cfg->acs_cfg.start_ch = CDS_CHANNEL_NUM(CHAN_ENUM_1); + sap_cfg->acs_cfg.end_ch = CDS_CHANNEL_NUM(CHAN_ENUM_165); } if (ht_enabled) @@ -5812,7 +5812,7 @@ QDF_STATUS wlan_hdd_validate_operation_channel(hdd_adapter_t *pAdapter, if (hdd_pConfig_ini->sapAllowAllChannel) { /* Validate the channel */ - for (count = RF_CHAN_1; count <= RF_CHAN_165; count++) { + for (count = CHAN_ENUM_1; count <= CHAN_ENUM_165; count++) { if (channel == CDS_CHANNEL_NUM(count)) { fValidChannel = true; break; diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index 4351c7219b..901db25255 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -3703,8 +3703,8 @@ static int __iw_softap_get_channel_list(struct net_device *dev, { uint32_t num_channels = 0; uint8_t i = 0; - uint8_t bandStartChannel = RF_CHAN_1; - uint8_t bandEndChannel = RF_CHAN_184; + uint8_t bandStartChannel = CHAN_ENUM_1; + uint8_t bandEndChannel = CHAN_ENUM_184; hdd_adapter_t *pHostapdAdapter = (netdev_priv(dev)); tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pHostapdAdapter); tpChannelListInfo channel_list = (tpChannelListInfo) extra; @@ -3726,11 +3726,11 @@ static int __iw_softap_get_channel_list(struct net_device *dev, wrqu->data.length = sizeof(tChannelListInfo); if (eCSR_BAND_24 == curBand) { - bandStartChannel = RF_CHAN_1; - bandEndChannel = RF_CHAN_14; + bandStartChannel = CHAN_ENUM_1; + bandEndChannel = CHAN_ENUM_14; } else if (eCSR_BAND_5G == curBand) { - bandStartChannel = RF_CHAN_36; - bandEndChannel = RF_CHAN_184; + bandStartChannel = CHAN_ENUM_36; + bandEndChannel = CHAN_ENUM_184; } hddLog(LOG1, FL("curBand = %d, StartChannel = %hu, EndChannel = %hu "), diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 8c4a7bf3bd..f7137745e6 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -4623,7 +4623,7 @@ static void hdd_set_thermal_level_cb(void *context, u_int8_t level) static uint8_t hdd_find_prefd_safe_chnl(hdd_context_t *hdd_ctxt, hdd_adapter_t *ap_adapter) { - uint16_t safe_channels[NUM_20MHZ_RF_CHANNELS]; + uint16_t safe_channels[NUM_CHANNELS]; uint16_t safe_channel_count; uint16_t unsafe_channel_count; uint8_t is_unsafe = 1; @@ -4637,9 +4637,9 @@ static uint8_t hdd_find_prefd_safe_chnl(hdd_context_t *hdd_ctxt, safe_channel_count = 0; unsafe_channel_count = QDF_MIN((uint16_t)hdd_ctxt->unsafe_channel_count, - (uint16_t)NUM_20MHZ_RF_CHANNELS); + (uint16_t)NUM_CHANNELS); - for (i = 0; i < NUM_20MHZ_RF_CHANNELS; i++) { + for (i = 0; i < NUM_CHANNELS; i++) { is_unsafe = 0; for (channel_loop = 0; channel_loop < unsafe_channel_count; channel_loop++) { @@ -4693,8 +4693,8 @@ static void hdd_ch_avoid_cb(void *hdd_context, void *indi_param) hdd_context_t *hdd_ctxt; tSirChAvoidIndType *ch_avoid_indi; uint8_t range_loop; - enum channel_enum channel_loop, start_channel_idx = INVALID_RF_CHANNEL, - end_channel_idx = INVALID_RF_CHANNEL; + enum channel_enum channel_loop, start_channel_idx = INVALID_CHANNEL, + end_channel_idx = INVALID_CHANNEL; uint16_t start_channel; uint16_t end_channel; v_CONTEXT_t cds_context; @@ -4737,7 +4737,7 @@ static void hdd_ch_avoid_cb(void *hdd_context, void *indi_param) for (range_loop = 0; range_loop < ch_avoid_indi->avoid_range_count; range_loop++) { - if (hdd_ctxt->unsafe_channel_count >= NUM_20MHZ_RF_CHANNELS) { + if (hdd_ctxt->unsafe_channel_count >= NUM_CHANNELS) { hddLog(LOGW, FL("LTE Coex unsafe channel list full")); break; } @@ -4758,8 +4758,8 @@ static void hdd_ch_avoid_cb(void *hdd_context, void *indi_param) if (start_channel == 0 || end_channel == 0) continue; - for (channel_loop = MIN_20MHZ_RF_CHANNEL; channel_loop <= - MAX_20MHZ_RF_CHANNEL; channel_loop++) { + for (channel_loop = CHAN_ENUM_1; channel_loop <= + CHAN_ENUM_184; channel_loop++) { if (CDS_CHANNEL_FREQ(channel_loop) >= ch_avoid_indi->avoid_freq_range[ range_loop].start_freq) { @@ -4767,8 +4767,8 @@ static void hdd_ch_avoid_cb(void *hdd_context, void *indi_param) break; } } - for (channel_loop = MIN_20MHZ_RF_CHANNEL; channel_loop <= - MAX_20MHZ_RF_CHANNEL; channel_loop++) { + for (channel_loop = CHAN_ENUM_1; channel_loop <= + CHAN_ENUM_184; channel_loop++) { if (CDS_CHANNEL_FREQ(channel_loop) >= ch_avoid_indi->avoid_freq_range[ range_loop].end_freq) { @@ -4781,8 +4781,8 @@ static void hdd_ch_avoid_cb(void *hdd_context, void *indi_param) } } - if (start_channel_idx == INVALID_RF_CHANNEL || - end_channel_idx == INVALID_RF_CHANNEL) + if (start_channel_idx == INVALID_CHANNEL || + end_channel_idx == INVALID_CHANNEL) continue; for (channel_loop = start_channel_idx; channel_loop <= @@ -4791,7 +4791,7 @@ static void hdd_ch_avoid_cb(void *hdd_context, void *indi_param) hdd_ctxt->unsafe_channel_count++] = CDS_CHANNEL_FREQ(channel_loop); if (hdd_ctxt->unsafe_channel_count >= - NUM_20MHZ_RF_CHANNELS) { + NUM_CHANNELS) { hddLog(LOGW, FL("LTECoex unsafe ch list full")); break; } @@ -4893,13 +4893,13 @@ static void hdd_init_channel_avoidance(hdd_context_t *hdd_ctx) cnss_get_wlan_unsafe_channel(hdd_ctx->unsafe_channel_list, &(hdd_ctx->unsafe_channel_count), - sizeof(uint16_t) * NUM_20MHZ_RF_CHANNELS); + sizeof(uint16_t) * NUM_CHANNELS); hddLog(QDF_TRACE_LEVEL_INFO, FL("num of unsafe channels is %d"), hdd_ctx->unsafe_channel_count); unsafe_channel_count = QDF_MIN((uint16_t)hdd_ctx->unsafe_channel_count, - (uint16_t)NUM_20MHZ_RF_CHANNELS); + (uint16_t)NUM_CHANNELS); for (index = 0; index < unsafe_channel_count; index++) { hddLog(QDF_TRACE_LEVEL_INFO, FL("channel %d is not safe"), diff --git a/core/hdd/src/wlan_hdd_regulatory.c b/core/hdd/src/wlan_hdd_regulatory.c index 8e0e9aef41..46ee2fdf12 100644 --- a/core/hdd/src/wlan_hdd_regulatory.c +++ b/core/hdd/src/wlan_hdd_regulatory.c @@ -428,7 +428,7 @@ static void hdd_process_regulatory_data(hdd_context_t *hdd_ctx, if (0 == (hdd_ctx->reg.eeprom_rd_ext & (1 << WHAL_REG_EXT_FCC_CH_144))) { - temp_chan = &(reg_channels[RF_CHAN_144]); + temp_chan = &(reg_channels[CHAN_ENUM_144]); temp_chan->state = CHANNEL_STATE_DISABLE; } diff --git a/core/mac/src/pe/lim/lim_process_action_frame.c b/core/mac/src/pe/lim/lim_process_action_frame.c index 9069d5c1fd..99bc342e0a 100644 --- a/core/mac/src/pe/lim/lim_process_action_frame.c +++ b/core/mac/src/pe/lim/lim_process_action_frame.c @@ -473,7 +473,7 @@ static void __lim_process_operating_mode_action_frame(tpAniSirGlobal mac_ctx, lim_log(mac_ctx, LOG1, FL("Received Operating Mode action frame")); - if (RF_CHAN_14 >= session->currentOperChannel) + if (CHAN_ENUM_14 >= session->currentOperChannel) cb_mode = mac_ctx->roam.configParam.channelBondingMode24GHz; else cb_mode = mac_ctx->roam.configParam.channelBondingMode5GHz; diff --git a/core/mac/src/pe/sch/sch_beacon_process.c b/core/mac/src/pe/sch/sch_beacon_process.c index a9595b4025..7b8c2661a0 100644 --- a/core/mac/src/pe/sch/sch_beacon_process.c +++ b/core/mac/src/pe/sch/sch_beacon_process.c @@ -532,7 +532,7 @@ sch_bcn_process_sta_bt_amp_sta_ibss(tpAniSirGlobal mac_ctx, uint32_t fw_vht_ch_wd = wma_get_vht_ch_width(); bool skip_opmode_update = false; - if (RF_CHAN_14 >= session->currentOperChannel) + if (CHAN_ENUM_14 >= session->currentOperChannel) cb_mode = mac_ctx->roam.configParam.channelBondingMode24GHz; else cb_mode = mac_ctx->roam.configParam.channelBondingMode5GHz; diff --git a/core/sap/inc/sap_api.h b/core/sap/inc/sap_api.h index e7930449da..de6a143d16 100644 --- a/core/sap/inc/sap_api.h +++ b/core/sap/inc/sap_api.h @@ -485,7 +485,7 @@ struct sap_acs_cfg { #endif uint16_t ch_width; - uint8_t pcl_channels[NUM_RF_CHANNELS]; + uint8_t pcl_channels[NUM_CHANNELS]; uint32_t pcl_ch_count; /* ACS Algo Output */ uint8_t pri_ch; diff --git a/core/sap/src/sap_ch_select.c b/core/sap/src/sap_ch_select.c index 8dab98eb2b..9e0b14385d 100644 --- a/core/sap/src/sap_ch_select.c +++ b/core/sap/src/sap_ch_select.c @@ -84,86 +84,46 @@ } #ifdef FEATURE_WLAN_CH_AVOID -sapSafeChannelType safe_channels[NUM_20MHZ_RF_CHANNELS] = { - /*CH , SAFE, default safe */ - {1, true} - , /* RF_CHAN_1, */ - {2, true} - , /* RF_CHAN_2, */ - {3, true} - , /* RF_CHAN_3, */ - {4, true} - , /* RF_CHAN_4, */ - {5, true} - , /* RF_CHAN_5, */ - {6, true} - , /* RF_CHAN_6, */ - {7, true} - , /* RF_CHAN_7, */ - {8, true} - , /* RF_CHAN_8, */ - {9, true} - , /* RF_CHAN_9, */ - {10, true} - , /* RF_CHAN_10, */ - {11, true} - , /* RF_CHAN_11, */ - {12, true} - , /* RF_CHAN_12, */ - {13, true} - , /* RF_CHAN_13, */ - {14, true} - , /* RF_CHAN_14, */ - {36, true} - , /* RF_CHAN_36, */ - {40, true} - , /* RF_CHAN_40, */ - {44, true} - , /* RF_CHAN_44, */ - {48, true} - , /* RF_CHAN_48, */ - {52, true} - , /* RF_CHAN_52, */ - {56, true} - , /* RF_CHAN_56, */ - {60, true} - , /* RF_CHAN_60, */ - {64, true} - , /* RF_CHAN_64, */ - {100, true} - , /* RF_CHAN_100, */ - {104, true} - , /* RF_CHAN_104, */ - {108, true} - , /* RF_CHAN_108, */ - {112, true} - , /* RF_CHAN_112, */ - {116, true} - , /* RF_CHAN_116, */ - {120, true} - , /* RF_CHAN_120, */ - {124, true} - , /* RF_CHAN_124, */ - {128, true} - , /* RF_CHAN_128, */ - {132, true} - , /* RF_CHAN_132, */ - {136, true} - , /* RF_CHAN_136, */ - {140, true} - , /* RF_CHAN_140, */ - {144, true} - , /* RF_CHAN_144, */ - {149, true} - , /* RF_CHAN_149, */ - {153, true} - , /* RF_CHAN_153, */ - {157, true} - , /* RF_CHAN_157, */ - {161, true} - , /* RF_CHAN_161, */ - {165, true} - , /* RF_CHAN_165, */ +sapSafeChannelType safe_channels[NUM_CHANNELS] = { + {1, true}, + {2, true}, + {3, true}, + {4, true}, + {5, true}, + {6, true}, + {7, true}, + {8, true}, + {9, true}, + {10, true}, + {11, true}, + {12, true}, + {13, true}, + {14, true}, + {36, true}, + {40, true}, + {44, true}, + {48, true}, + {52, true}, + {56, true}, + {60, true}, + {64, true}, + {100, true}, + {104, true}, + {108, true}, + {112, true}, + {116, true}, + {120, true}, + {124, true}, + {128, true}, + {132, true}, + {136, true}, + {140, true}, + {144, true}, + {149, true}, + {153, true}, + {157, true}, + {161, true}, + {165, true}, }; #endif @@ -411,17 +371,17 @@ void sap_process_avoid_ie(tHalHandle hal, void sap_update_unsafe_channel_list(ptSapContext pSapCtx) { uint16_t i, j; - uint16_t unsafe_channel_list[NUM_20MHZ_RF_CHANNELS]; + uint16_t unsafe_channel_list[NUM_CHANNELS]; uint16_t unsafe_channel_count = 0; /* Flush, default set all channel safe */ - for (i = 0; i < NUM_20MHZ_RF_CHANNELS; i++) { + for (i = 0; i < NUM_CHANNELS; i++) { safe_channels[i].isSafe = true; } /* Try to find unsafe channel */ #if defined(FEATURE_WLAN_STA_AP_MODE_DFS_DISABLE) - for (i = 0; i < NUM_20MHZ_RF_CHANNELS; i++) { + for (i = 0; i < NUM_CHANNELS; i++) { if (pSapCtx->dfs_ch_disable == true) { if (CDS_IS_DFS_CH(safe_channels[i].channelNumber)) { safe_channels[i].isSafe = false; @@ -441,7 +401,7 @@ void sap_update_unsafe_channel_list(ptSapContext pSapCtx) sizeof(unsafe_channel_list)); for (i = 0; i < unsafe_channel_count; i++) { - for (j = 0; j < NUM_20MHZ_RF_CHANNELS; j++) { + for (j = 0; j < NUM_CHANNELS; j++) { if (safe_channels[j].channelNumber == unsafe_channel_list[i]) { /* Found unsafe channel, update it */ @@ -661,7 +621,7 @@ bool sap_chan_sel_init(tHalHandle halHandle, } #ifdef FEATURE_WLAN_CH_AVOID - for (i = 0; i < NUM_20MHZ_RF_CHANNELS; i++) { + for (i = 0; i < NUM_CHANNELS; i++) { if ((safe_channels[i].channelNumber == *pChans) && (false == safe_channels[i].isSafe)) { QDF_TRACE(QDF_MODULE_ID_SAP, @@ -2012,7 +1972,7 @@ uint8_t sap_select_channel(tHalHandle halHandle, ptSapContext pSapCtx, if (SAP_CHANNEL_NOT_SELECTED != firstSafeChannelInRange) return firstSafeChannelInRange; - for (i = 0; i < NUM_20MHZ_RF_CHANNELS; i++) { + for (i = 0; i < NUM_CHANNELS; i++) { if ((safe_channels[i].channelNumber >= startChannelNum) && (safe_channels[i].channelNumber <= endChannelNum)) { diff --git a/core/sap/src/sap_ch_select.h b/core/sap/src/sap_ch_select.h index 692def6cbc..8fe2d1738c 100644 --- a/core/sap/src/sap_ch_select.h +++ b/core/sap/src/sap_ch_select.h @@ -192,7 +192,7 @@ typedef struct sSapTxLeakInfo { typedef struct sSapChanMatrixInfo { uint8_t channel; /* channel to switch from */ - tSapTxLeakInfo chan_matrix[RF_CHAN_144 - RF_CHAN_36 + 1]; + tSapTxLeakInfo chan_matrix[CHAN_ENUM_144 - CHAN_ENUM_36 + 1]; } tSapChanMatrixInfo; #endif /* if !defined __SAP_CH_SELECT_H */ diff --git a/core/sap/src/sap_fsm.c b/core/sap/src/sap_fsm.c index b5a7353d48..112a3b8b24 100644 --- a/core/sap/src/sap_fsm.c +++ b/core/sap/src/sap_fsm.c @@ -961,7 +961,7 @@ sap_mark_channels_leaking_into_nol(ptSapContext sap_ctx, uint8_t *temp_ch_lst) { tSapTxLeakInfo *target_chan_matrix = NULL; - uint32_t num_channel = (RF_CHAN_144 - RF_CHAN_36) + 1; + uint32_t num_channel = (CHAN_ENUM_144 - CHAN_ENUM_36) + 1; uint32_t i = 0; uint32_t j = 0; uint32_t k = 0; @@ -4181,10 +4181,10 @@ static QDF_STATUS sap_get_channel_list(ptSapContext sap_ctx, sme_cfg_get_int(hal, WNI_CFG_ENABLE_LTE_COEX, &en_lte_coex); /* Check if LTE coex is enabled and 2.4GHz is selected */ - if (en_lte_coex && (band_start_ch == RF_CHAN_1) && - (band_end_ch == RF_CHAN_14)) { + if (en_lte_coex && (band_start_ch == CHAN_ENUM_1) && + (band_end_ch == CHAN_ENUM_14)) { /* Set 2.4GHz upper limit to channel 9 for LTE COEX */ - band_end_ch = RF_CHAN_9; + band_end_ch = CHAN_ENUM_9; } /* Allocate the max number of channel supported */ @@ -4219,7 +4219,7 @@ static QDF_STATUS sap_get_channel_list(ptSapContext sap_ctx, continue; #ifdef FEATURE_WLAN_CH_AVOID - for (i = 0; i < NUM_20MHZ_RF_CHANNELS; i++) { + for (i = 0; i < NUM_CHANNELS; i++) { if ((safe_channels[i].channelNumber == CDS_CHANNEL_NUM(loop_count))) { /* Check if channel is safe */ @@ -4324,7 +4324,7 @@ static QDF_STATUS sap_get5_g_hz_channel_list(ptSapContext sapContext) return QDF_STATUS_E_NOMEM; } - for (i = RF_CHAN_36; i <= RF_CHAN_165; i++) { + for (i = CHAN_ENUM_36; i <= CHAN_ENUM_165; i++) { if (CDS_CHANNEL_STATE(i) == CHANNEL_STATE_ENABLE || CDS_CHANNEL_STATE(i) == CHANNEL_STATE_DFS) { sapContext->SapAllChnlList.channelList[count].channel = @@ -4619,7 +4619,7 @@ QDF_STATUS sap_init_dfs_channel_nol_list(ptSapContext sapContext) bFound = true; } - for (i = RF_CHAN_36; i <= RF_CHAN_165; i++) { + for (i = CHAN_ENUM_36; i <= CHAN_ENUM_165; i++) { if (CDS_CHANNEL_STATE(i) == CHANNEL_STATE_DFS) { /* if dfs nol is not found, initialize it */ if (!bFound) { diff --git a/core/sap/src/sap_module.c b/core/sap/src/sap_module.c index a2aee093c0..5958c30db7 100644 --- a/core/sap/src/sap_module.c +++ b/core/sap/src/sap_module.c @@ -1377,7 +1377,7 @@ static QDF_STATUS wlansap_update_csa_channel_params(ptSapContext sap_context, mac_ctx = PMAC_STRUCT(hal); - if (channel <= RF_CHAN_14) { + if (channel <= CHAN_ENUM_14) { /* * currently OBSS scan is done in hostapd, so to avoid * SAP coming up in HT40 on channel switch we are @@ -2818,22 +2818,22 @@ void wlansap_extend_to_acs_range(uint8_t *startChannelNum, uint8_t tmp_startChannelNum = 0, tmp_endChannelNum = 0; if (*startChannelNum <= 14 && *endChannelNum <= 14) { - *bandStartChannel = RF_CHAN_1; - *bandEndChannel = RF_CHAN_14; + *bandStartChannel = CHAN_ENUM_1; + *bandEndChannel = CHAN_ENUM_14; tmp_startChannelNum = *startChannelNum > 5 ? (*startChannelNum - ACS_2G_EXTEND) : 1; tmp_endChannelNum = (*endChannelNum + ACS_2G_EXTEND) <= 14 ? (*endChannelNum + ACS_2G_EXTEND) : 14; } else if (*startChannelNum >= 36 && *endChannelNum >= 36) { - *bandStartChannel = RF_CHAN_36; - *bandEndChannel = RF_CHAN_165; + *bandStartChannel = CHAN_ENUM_36; + *bandEndChannel = CHAN_ENUM_165; tmp_startChannelNum = (*startChannelNum - ACS_5G_EXTEND) > 36 ? (*startChannelNum - ACS_5G_EXTEND) : 36; tmp_endChannelNum = (*endChannelNum + ACS_5G_EXTEND) <= 165 ? (*endChannelNum + ACS_5G_EXTEND) : 165; } else { - *bandStartChannel = RF_CHAN_1; - *bandEndChannel = RF_CHAN_165; + *bandStartChannel = CHAN_ENUM_1; + *bandEndChannel = CHAN_ENUM_165; tmp_startChannelNum = *startChannelNum > 5 ? (*startChannelNum - ACS_2G_EXTEND) : 1; tmp_endChannelNum = (*endChannelNum + ACS_5G_EXTEND) <= 165 ? diff --git a/core/sme/src/csr/csr_util.c b/core/sme/src/csr/csr_util.c index 0b0c5d1b75..9a67586bc7 100644 --- a/core/sme/src/csr/csr_util.c +++ b/core/sme/src/csr/csr_util.c @@ -5523,7 +5523,7 @@ uint16_t sme_chn_to_freq(uint8_t chanNum) { int i; - for (i = 0; i < NUM_RF_CHANNELS; i++) { + for (i = 0; i < NUM_CHANNELS; i++) { if (CDS_CHANNEL_NUM(i) == chanNum) return CDS_CHANNEL_FREQ(i); }