Lines Matching +full:country +full:- +full:code
1 // SPDX-License-Identifier: BSD-3-Clause-Clear
3 * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
4 * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved.
12 #define ATH11K_2GHZ_CH01_11 REG_RULE(2412 - 10, 2462 + 10, 40, 0, 20, 0)
13 #define ATH11K_5GHZ_5150_5350 REG_RULE(5150 - 10, 5350 + 10, 80, 0, 30,\
15 #define ATH11K_5GHZ_5725_5850 REG_RULE(5725 - 10, 5850 + 10, 80, 0, 30,\
36 regd = rcu_dereference_rtnl(ar->hw->wiphy->regd); in ath11k_regdom_changes()
44 return memcmp(regd->alpha2, alpha2, 2) != 0; in ath11k_regdom_changes()
52 struct ath11k *ar = hw->priv; in ath11k_reg_notifier()
55 ath11k_dbg(ar->ab, ATH11K_DBG_REG, in ath11k_reg_notifier()
63 if (!(request->initiator == NL80211_REGDOM_SET_BY_USER && in ath11k_reg_notifier()
64 request->user_reg_hint_type == NL80211_USER_REG_HINT_USER)) { in ath11k_reg_notifier()
65 ath11k_warn(ar->ab, "Unexpected Regulatory event for this wiphy\n"); in ath11k_reg_notifier()
70 ath11k_dbg(ar->ab, ATH11K_DBG_REG, in ath11k_reg_notifier()
71 "Country Setting is not allowed\n"); in ath11k_reg_notifier()
75 if (!ath11k_regdom_changes(ar, request->alpha2)) { in ath11k_reg_notifier()
76 ath11k_dbg(ar->ab, ATH11K_DBG_REG, "Country is already set\n"); in ath11k_reg_notifier()
80 /* Set the country code to the firmware and will receive in ath11k_reg_notifier()
84 if (ar->ab->hw_params.current_cc_support) { in ath11k_reg_notifier()
85 memcpy(&ar->alpha2, request->alpha2, 2); in ath11k_reg_notifier()
88 ath11k_warn(ar->ab, in ath11k_reg_notifier()
89 "failed set current country code: %d\n", ret); in ath11k_reg_notifier()
92 memcpy(&init_country_param.cc_info.alpha2, request->alpha2, 2); in ath11k_reg_notifier()
97 ath11k_warn(ar->ab, in ath11k_reg_notifier()
98 "INIT Country code set to fw failed : %d\n", ret); in ath11k_reg_notifier()
102 ar->regdom_set_by_user = true; in ath11k_reg_notifier()
110 struct ieee80211_hw *hw = ar->hw; in ath11k_reg_update_chan_list()
116 if (wait && ar->state_11d != ATH11K_11D_IDLE) { in ath11k_reg_update_chan_list()
117 left = wait_for_completion_timeout(&ar->completed_11d_scan, in ath11k_reg_update_chan_list()
120 ath11k_dbg(ar->ab, ATH11K_DBG_REG, in ath11k_reg_update_chan_list()
122 ar->state_11d = ATH11K_11D_IDLE; in ath11k_reg_update_chan_list()
124 ath11k_dbg(ar->ab, ATH11K_DBG_REG, in ath11k_reg_update_chan_list()
129 (ar->scan.state == ATH11K_SCAN_STARTING || in ath11k_reg_update_chan_list()
130 ar->scan.state == ATH11K_SCAN_RUNNING)) { in ath11k_reg_update_chan_list()
131 left = wait_for_completion_timeout(&ar->scan.completed, in ath11k_reg_update_chan_list()
134 ath11k_dbg(ar->ab, ATH11K_DBG_REG, in ath11k_reg_update_chan_list()
137 ath11k_dbg(ar->ab, ATH11K_DBG_REG, in ath11k_reg_update_chan_list()
141 if (ar->state == ATH11K_STATE_RESTARTING) in ath11k_reg_update_chan_list()
144 bands = hw->wiphy->bands; in ath11k_reg_update_chan_list()
149 for (i = 0; i < bands[band]->n_channels; i++) { in ath11k_reg_update_chan_list()
150 if (bands[band]->channels[i].flags & in ath11k_reg_update_chan_list()
159 return -EINVAL; in ath11k_reg_update_chan_list()
164 return -ENOMEM; in ath11k_reg_update_chan_list()
166 params->pdev_id = ar->pdev->pdev_id; in ath11k_reg_update_chan_list()
167 params->nallchans = num_channels; in ath11k_reg_update_chan_list()
169 ch = params->ch_param; in ath11k_reg_update_chan_list()
175 for (i = 0; i < bands[band]->n_channels; i++) { in ath11k_reg_update_chan_list()
176 channel = &bands[band]->channels[i]; in ath11k_reg_update_chan_list()
178 if (channel->flags & IEEE80211_CHAN_DISABLED) in ath11k_reg_update_chan_list()
182 ch->allow_ht = true; in ath11k_reg_update_chan_list()
183 ch->allow_vht = true; in ath11k_reg_update_chan_list()
184 ch->allow_he = true; in ath11k_reg_update_chan_list()
186 ch->dfs_set = in ath11k_reg_update_chan_list()
187 !!(channel->flags & IEEE80211_CHAN_RADAR); in ath11k_reg_update_chan_list()
188 ch->is_chan_passive = !!(channel->flags & in ath11k_reg_update_chan_list()
190 ch->is_chan_passive |= ch->dfs_set; in ath11k_reg_update_chan_list()
191 ch->mhz = channel->center_freq; in ath11k_reg_update_chan_list()
192 ch->cfreq1 = channel->center_freq; in ath11k_reg_update_chan_list()
193 ch->minpower = 0; in ath11k_reg_update_chan_list()
194 ch->maxpower = channel->max_power * 2; in ath11k_reg_update_chan_list()
195 ch->maxregpower = channel->max_reg_power * 2; in ath11k_reg_update_chan_list()
196 ch->antennamax = channel->max_antenna_gain * 2; in ath11k_reg_update_chan_list()
199 if (channel->band == NL80211_BAND_2GHZ) in ath11k_reg_update_chan_list()
200 ch->phy_mode = MODE_11G; in ath11k_reg_update_chan_list()
202 ch->phy_mode = MODE_11A; in ath11k_reg_update_chan_list()
204 if (channel->band == NL80211_BAND_6GHZ && in ath11k_reg_update_chan_list()
206 ch->psc_channel = true; in ath11k_reg_update_chan_list()
208 ath11k_dbg(ar->ab, ATH11K_DBG_WMI, in ath11k_reg_update_chan_list()
210 i, params->nallchans, in ath11k_reg_update_chan_list()
211 ch->mhz, ch->maxpower, ch->maxregpower, in ath11k_reg_update_chan_list()
212 ch->antennamax, ch->phy_mode); in ath11k_reg_update_chan_list()
235 for (i = 0; i < regd_orig->n_reg_rules; i++) in ath11k_copy_regd()
236 memcpy(®d_copy->reg_rules[i], ®d_orig->reg_rules[i], in ath11k_copy_regd()
246 ab = ar->ab; in ath11k_regd_update()
247 pdev_id = ar->pdev_idx; in ath11k_regd_update()
249 spin_lock_bh(&ab->base_lock); in ath11k_regd_update()
252 if (ab->new_regd[pdev_id]) { in ath11k_regd_update()
253 regd = ab->new_regd[pdev_id]; in ath11k_regd_update()
260 if (ab->default_regd[pdev_id]) { in ath11k_regd_update()
261 regd = ab->default_regd[pdev_id]; in ath11k_regd_update()
270 ret = -EINVAL; in ath11k_regd_update()
271 spin_unlock_bh(&ab->base_lock); in ath11k_regd_update()
275 regd_len = sizeof(*regd) + (regd->n_reg_rules * in ath11k_regd_update()
282 spin_unlock_bh(&ab->base_lock); in ath11k_regd_update()
285 ret = -ENOMEM; in ath11k_regd_update()
289 ret = regulatory_set_wiphy_regd(ar->hw->wiphy, regd_copy); in ath11k_regd_update()
296 if (ar->state == ATH11K_STATE_ON) { in ath11k_regd_update()
371 start_freq1 = rule1->freq_range.start_freq_khz; in ath11k_reg_can_intersect()
372 start_freq2 = rule2->freq_range.start_freq_khz; in ath11k_reg_can_intersect()
374 end_freq1 = rule1->freq_range.end_freq_khz; in ath11k_reg_can_intersect()
375 end_freq2 = rule2->freq_range.end_freq_khz; in ath11k_reg_can_intersect()
400 start_freq1 = rule1->freq_range.start_freq_khz; in ath11k_reg_intersect_rules()
401 start_freq2 = rule2->freq_range.start_freq_khz; in ath11k_reg_intersect_rules()
403 end_freq1 = rule1->freq_range.end_freq_khz; in ath11k_reg_intersect_rules()
404 end_freq2 = rule2->freq_range.end_freq_khz; in ath11k_reg_intersect_rules()
406 new_rule->freq_range.start_freq_khz = max_t(u32, start_freq1, in ath11k_reg_intersect_rules()
408 new_rule->freq_range.end_freq_khz = min_t(u32, end_freq1, end_freq2); in ath11k_reg_intersect_rules()
410 freq_diff = new_rule->freq_range.end_freq_khz - in ath11k_reg_intersect_rules()
411 new_rule->freq_range.start_freq_khz; in ath11k_reg_intersect_rules()
412 max_bw = min_t(u32, rule1->freq_range.max_bandwidth_khz, in ath11k_reg_intersect_rules()
413 rule2->freq_range.max_bandwidth_khz); in ath11k_reg_intersect_rules()
414 new_rule->freq_range.max_bandwidth_khz = min_t(u32, max_bw, freq_diff); in ath11k_reg_intersect_rules()
416 new_rule->power_rule.max_antenna_gain = in ath11k_reg_intersect_rules()
417 min_t(u32, rule1->power_rule.max_antenna_gain, in ath11k_reg_intersect_rules()
418 rule2->power_rule.max_antenna_gain); in ath11k_reg_intersect_rules()
420 new_rule->power_rule.max_eirp = min_t(u32, rule1->power_rule.max_eirp, in ath11k_reg_intersect_rules()
421 rule2->power_rule.max_eirp); in ath11k_reg_intersect_rules()
424 new_rule->flags = rule1->flags | rule2->flags; in ath11k_reg_intersect_rules()
426 if ((rule1->flags & NL80211_RRF_PSD) && (rule2->flags & NL80211_RRF_PSD)) in ath11k_reg_intersect_rules()
427 new_rule->psd = min_t(s8, rule1->psd, rule2->psd); in ath11k_reg_intersect_rules()
429 new_rule->flags &= ~NL80211_RRF_PSD; in ath11k_reg_intersect_rules()
432 new_rule->dfs_cac_ms = max_t(u32, rule1->dfs_cac_ms, in ath11k_reg_intersect_rules()
433 rule2->dfs_cac_ms); in ath11k_reg_intersect_rules()
445 num_old_regd_rules = default_regd->n_reg_rules; in ath11k_regd_intersect()
446 num_curr_regd_rules = curr_regd->n_reg_rules; in ath11k_regd_intersect()
451 old_rule = default_regd->reg_rules + i; in ath11k_regd_intersect()
453 curr_rule = curr_regd->reg_rules + j; in ath11k_regd_intersect()
470 /* We set the new country and dfs region directly and only trim in ath11k_regd_intersect()
474 new_regd->n_reg_rules = num_new_regd_rules; in ath11k_regd_intersect()
475 memcpy(new_regd->alpha2, curr_regd->alpha2, sizeof(new_regd->alpha2)); in ath11k_regd_intersect()
476 new_regd->dfs_region = curr_regd->dfs_region; in ath11k_regd_intersect()
477 new_rule = new_regd->reg_rules; in ath11k_regd_intersect()
480 old_rule = default_regd->reg_rules + i; in ath11k_regd_intersect()
482 curr_rule = curr_regd->reg_rules + j; in ath11k_regd_intersect()
515 bw = end_freq - start_freq; in ath11k_reg_adjust_bw()
535 reg_rule->freq_range.start_freq_khz = MHZ_TO_KHZ(start_freq); in ath11k_reg_update_rule()
536 reg_rule->freq_range.end_freq_khz = MHZ_TO_KHZ(end_freq); in ath11k_reg_update_rule()
537 reg_rule->freq_range.max_bandwidth_khz = MHZ_TO_KHZ(bw); in ath11k_reg_update_rule()
538 reg_rule->power_rule.max_antenna_gain = DBI_TO_MBI(ant_gain); in ath11k_reg_update_rule()
539 reg_rule->power_rule.max_eirp = DBM_TO_MBM(reg_pwr); in ath11k_reg_update_rule()
540 reg_rule->psd = psd; in ath11k_reg_update_rule()
541 reg_rule->flags = reg_flags; in ath11k_reg_update_rule()
558 i--; in ath11k_reg_update_weather_radar_band()
561 bw = ath11k_reg_adjust_bw(reg_rule->start_freq, in ath11k_reg_update_weather_radar_band()
566 ath11k_reg_update_rule(regd->reg_rules + i, in ath11k_reg_update_weather_radar_band()
567 reg_rule->start_freq, in ath11k_reg_update_weather_radar_band()
569 reg_rule->ant_gain, reg_rule->reg_power, in ath11k_reg_update_weather_radar_band()
570 reg_rule->psd_eirp, flags); in ath11k_reg_update_weather_radar_band()
573 "\t%d. (%d - %d @ %d) (%d, %d) (%d ms) (FLAGS %d)\n", in ath11k_reg_update_weather_radar_band()
574 i + 1, reg_rule->start_freq, in ath11k_reg_update_weather_radar_band()
575 ETSI_WEATHER_RADAR_BAND_LOW, bw, reg_rule->ant_gain, in ath11k_reg_update_weather_radar_band()
576 reg_rule->reg_power, regd->reg_rules[i].dfs_cac_ms, in ath11k_reg_update_weather_radar_band()
581 start_freq = max_t(u32, reg_rule->start_freq, in ath11k_reg_update_weather_radar_band()
583 end_freq = min_t(u32, reg_rule->end_freq, ETSI_WEATHER_RADAR_BAND_HIGH); in ath11k_reg_update_weather_radar_band()
589 ath11k_reg_update_rule(regd->reg_rules + i, start_freq, in ath11k_reg_update_weather_radar_band()
590 end_freq, bw, reg_rule->ant_gain, in ath11k_reg_update_weather_radar_band()
591 reg_rule->reg_power, reg_rule->psd_eirp, flags); in ath11k_reg_update_weather_radar_band()
593 regd->reg_rules[i].dfs_cac_ms = ETSI_WEATHER_RADAR_BAND_CAC_TIMEOUT; in ath11k_reg_update_weather_radar_band()
596 "\t%d. (%d - %d @ %d) (%d, %d) (%d ms) (FLAGS %d)\n", in ath11k_reg_update_weather_radar_band()
598 reg_rule->ant_gain, reg_rule->reg_power, in ath11k_reg_update_weather_radar_band()
599 regd->reg_rules[i].dfs_cac_ms, flags); in ath11k_reg_update_weather_radar_band()
604 reg_rule->end_freq, max_bw); in ath11k_reg_update_weather_radar_band()
608 ath11k_reg_update_rule(regd->reg_rules + i, in ath11k_reg_update_weather_radar_band()
610 reg_rule->end_freq, bw, in ath11k_reg_update_weather_radar_band()
611 reg_rule->ant_gain, reg_rule->reg_power, in ath11k_reg_update_weather_radar_band()
612 reg_rule->psd_eirp, flags); in ath11k_reg_update_weather_radar_band()
615 "\t%d. (%d - %d @ %d) (%d, %d) (%d ms) (FLAGS %d)\n", in ath11k_reg_update_weather_radar_band()
617 reg_rule->end_freq, bw, reg_rule->ant_gain, in ath11k_reg_update_weather_radar_band()
618 reg_rule->reg_power, regd->reg_rules[i].dfs_cac_ms, in ath11k_reg_update_weather_radar_band()
654 num_rules = reg_info->num_5ghz_reg_rules + reg_info->num_2ghz_reg_rules; in ath11k_reg_build_regd()
656 if (reg_info->is_ext_reg_event) { in ath11k_reg_build_regd()
665 reg_6ghz_number = reg_info->num_6ghz_rules_client in ath11k_reg_build_regd()
670 reg_6ghz_number = reg_info->num_6ghz_rules_client in ath11k_reg_build_regd()
674 reg_rule_6ghz = reg_info->reg_rules_6ghz_client_ptr in ath11k_reg_build_regd()
676 max_bw_6ghz = reg_info->max_bw_6ghz_client in ath11k_reg_build_regd()
679 reg_6ghz_number = reg_info->num_6ghz_rules_ap[WMI_REG_INDOOR_AP]; in ath11k_reg_build_regd()
681 reg_info->reg_rules_6ghz_ap_ptr[WMI_REG_INDOOR_AP]; in ath11k_reg_build_regd()
682 max_bw_6ghz = reg_info->max_bw_6ghz_ap[WMI_REG_INDOOR_AP]; in ath11k_reg_build_regd()
692 if (reg_info->dfs_region == ATH11K_DFS_REG_ETSI) in ath11k_reg_build_regd()
701 memcpy(tmp_regd->alpha2, reg_info->alpha2, REG_ALPHA2_LEN + 1); in ath11k_reg_build_regd()
702 memcpy(alpha2, reg_info->alpha2, REG_ALPHA2_LEN + 1); in ath11k_reg_build_regd()
704 tmp_regd->dfs_region = ath11k_map_fw_dfs_region(reg_info->dfs_region); in ath11k_reg_build_regd()
707 "Country %s, CFG Regdomain %s FW Regdomain %d, num_reg_rules %d\n", in ath11k_reg_build_regd()
708 alpha2, ath11k_reg_get_regdom_str(tmp_regd->dfs_region), in ath11k_reg_build_regd()
709 reg_info->dfs_region, num_rules); in ath11k_reg_build_regd()
714 if (reg_info->num_2ghz_reg_rules && in ath11k_reg_build_regd()
715 (i < reg_info->num_2ghz_reg_rules)) { in ath11k_reg_build_regd()
716 reg_rule = reg_info->reg_rules_2ghz_ptr + i; in ath11k_reg_build_regd()
717 max_bw = min_t(u16, reg_rule->max_bw, in ath11k_reg_build_regd()
718 reg_info->max_bw_2ghz); in ath11k_reg_build_regd()
720 } else if (reg_info->num_5ghz_reg_rules && in ath11k_reg_build_regd()
721 (j < reg_info->num_5ghz_reg_rules)) { in ath11k_reg_build_regd()
722 reg_rule = reg_info->reg_rules_5ghz_ptr + j++; in ath11k_reg_build_regd()
723 max_bw = min_t(u16, reg_rule->max_bw, in ath11k_reg_build_regd()
724 reg_info->max_bw_5ghz); in ath11k_reg_build_regd()
733 } else if (reg_info->is_ext_reg_event && reg_6ghz_number && in ath11k_reg_build_regd()
736 max_bw = min_t(u16, reg_rule->max_bw, max_bw_6ghz); in ath11k_reg_build_regd()
738 if (reg_rule->psd_flag) in ath11k_reg_build_regd()
744 flags |= ath11k_map_fw_reg_flags(reg_rule->flags); in ath11k_reg_build_regd()
745 flags |= ath11k_map_fw_phy_flags(reg_info->phybitmap); in ath11k_reg_build_regd()
747 ath11k_reg_update_rule(tmp_regd->reg_rules + i, in ath11k_reg_build_regd()
748 reg_rule->start_freq, in ath11k_reg_build_regd()
749 reg_rule->end_freq, max_bw, in ath11k_reg_build_regd()
750 reg_rule->ant_gain, reg_rule->reg_power, in ath11k_reg_build_regd()
751 reg_rule->psd_eirp, flags); in ath11k_reg_build_regd()
759 reg_info->dfs_region == ATH11K_DFS_REG_ETSI && in ath11k_reg_build_regd()
760 (reg_rule->end_freq > ETSI_WEATHER_RADAR_BAND_LOW && in ath11k_reg_build_regd()
761 reg_rule->start_freq < ETSI_WEATHER_RADAR_BAND_HIGH)){ in ath11k_reg_build_regd()
768 if (reg_info->is_ext_reg_event) { in ath11k_reg_build_regd()
770 "\t%d. (%d - %d @ %d) (%d, %d) (%d ms) (FLAGS %d) (%d, %d)\n", in ath11k_reg_build_regd()
771 i + 1, reg_rule->start_freq, reg_rule->end_freq, in ath11k_reg_build_regd()
772 max_bw, reg_rule->ant_gain, reg_rule->reg_power, in ath11k_reg_build_regd()
773 tmp_regd->reg_rules[i].dfs_cac_ms, flags, in ath11k_reg_build_regd()
774 reg_rule->psd_flag, reg_rule->psd_eirp); in ath11k_reg_build_regd()
777 "\t%d. (%d - %d @ %d) (%d, %d) (%d ms) (FLAGS %d)\n", in ath11k_reg_build_regd()
778 i + 1, reg_rule->start_freq, reg_rule->end_freq, in ath11k_reg_build_regd()
779 max_bw, reg_rule->ant_gain, reg_rule->reg_power, in ath11k_reg_build_regd()
780 tmp_regd->reg_rules[i].dfs_cac_ms, in ath11k_reg_build_regd()
785 tmp_regd->n_reg_rules = i; in ath11k_reg_build_regd()
788 default_regd = ab->default_regd[reg_info->phy_id]; in ath11k_reg_build_regd()
824 * reg rules. It means multi-interface concurrency in the same ath11k is in ath11k_reg_get_ar_vdev_type()
828 arvif = list_first_entry_or_null(&ar->arvifs, struct ath11k_vif, list); in ath11k_reg_get_ar_vdev_type()
830 return arvif->vdev_type; in ath11k_reg_get_ar_vdev_type()
847 if (reg_info->status_code != REG_SET_CC_STATUS_PASS) { in ath11k_reg_handle_chan_list()
852 ath11k_warn(ab, "Failed to set the requested Country regulatory setting\n"); in ath11k_reg_handle_chan_list()
853 return -EINVAL; in ath11k_reg_handle_chan_list()
856 pdev_idx = reg_info->phy_id; in ath11k_reg_handle_chan_list()
861 spin_lock_bh(&ab->base_lock); in ath11k_reg_handle_chan_list()
862 if (test_bit(ATH11K_FLAG_RECOVERY, &ab->dev_flags) && in ath11k_reg_handle_chan_list()
863 ab->default_regd[pdev_idx]) { in ath11k_reg_handle_chan_list()
864 spin_unlock_bh(&ab->base_lock); in ath11k_reg_handle_chan_list()
867 spin_unlock_bh(&ab->base_lock); in ath11k_reg_handle_chan_list()
869 if (pdev_idx >= ab->num_radios) { in ath11k_reg_handle_chan_list()
878 if (ab->hw_params.single_pdev_only && in ath11k_reg_handle_chan_list()
879 pdev_idx < ab->hw_params.num_rxdma_per_pdev) in ath11k_reg_handle_chan_list()
885 * stop-start after mac registration. in ath11k_reg_handle_chan_list()
887 if (ab->default_regd[pdev_idx] && !ab->new_regd[pdev_idx] && in ath11k_reg_handle_chan_list()
888 !memcmp((char *)ab->default_regd[pdev_idx]->alpha2, in ath11k_reg_handle_chan_list()
889 (char *)reg_info->alpha2, 2)) in ath11k_reg_handle_chan_list()
892 /* Intersect new rules with default regd if a new country setting was in ath11k_reg_handle_chan_list()
894 * and the regd coming from this event has a valid country info. in ath11k_reg_handle_chan_list()
896 if (ab->default_regd[pdev_idx] && in ath11k_reg_handle_chan_list()
898 ab->default_regd[pdev_idx]->alpha2) && in ath11k_reg_handle_chan_list()
899 !ath11k_reg_is_world_alpha((char *)reg_info->alpha2)) in ath11k_reg_handle_chan_list()
902 ar = ab->pdevs[pdev_idx].ar; in ath11k_reg_handle_chan_list()
916 ath11k_reg_reset_info(&ab->reg_info_store[pdev_idx]); in ath11k_reg_handle_chan_list()
917 ab->reg_info_store[pdev_idx] = *reg_info; in ath11k_reg_handle_chan_list()
920 spin_lock_bh(&ab->base_lock); in ath11k_reg_handle_chan_list()
921 if (ab->default_regd[pdev_idx]) { in ath11k_reg_handle_chan_list()
929 ar = ab->pdevs[pdev_idx].ar; in ath11k_reg_handle_chan_list()
930 kfree(ab->new_regd[pdev_idx]); in ath11k_reg_handle_chan_list()
931 ab->new_regd[pdev_idx] = regd; in ath11k_reg_handle_chan_list()
932 queue_work(ab->workqueue, &ar->regd_update_work); in ath11k_reg_handle_chan_list()
937 ab->default_regd[pdev_idx] = regd; in ath11k_reg_handle_chan_list()
939 ab->dfs_region = reg_info->dfs_region; in ath11k_reg_handle_chan_list()
940 spin_unlock_bh(&ab->base_lock); in ath11k_reg_handle_chan_list()
945 /* Fallback to older reg (by sending previous country setting in ath11k_reg_handle_chan_list()
957 return -EINVAL; in ath11k_reg_handle_chan_list()
971 * the prev or default country code to the firmware. in ath11k_regd_update_work()
979 ar->hw->wiphy->regulatory_flags = REGULATORY_WIPHY_SELF_MANAGED; in ath11k_reg_init()
980 ar->hw->wiphy->reg_notifier = ath11k_reg_notifier; in ath11k_reg_init()
990 kfree(reg_info->reg_rules_2ghz_ptr); in ath11k_reg_reset_info()
991 kfree(reg_info->reg_rules_5ghz_ptr); in ath11k_reg_reset_info()
994 kfree(reg_info->reg_rules_6ghz_ap_ptr[i]); in ath11k_reg_reset_info()
997 kfree(reg_info->reg_rules_6ghz_client_ptr[i][j]); in ath11k_reg_reset_info()
1007 for (i = 0; i < ab->num_radios; i++) in ath11k_reg_free()
1008 ath11k_reg_reset_info(&ab->reg_info_store[i]); in ath11k_reg_free()
1010 kfree(ab->reg_info_store); in ath11k_reg_free()
1011 ab->reg_info_store = NULL; in ath11k_reg_free()
1013 for (i = 0; i < ab->hw_params.max_radios; i++) { in ath11k_reg_free()
1014 kfree(ab->default_regd[i]); in ath11k_reg_free()
1015 kfree(ab->new_regd[i]); in ath11k_reg_free()
1023 memcpy(&set_current_param.alpha2, ar->alpha2, 2); in ath11k_reg_set_cc()