diff options
-rw-r--r-- | drivers/net/wireless/ath/ath10k/core.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath10k/mac.c | 19 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath10k/wmi.c | 6 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath10k/wmi.h | 2 |
4 files changed, 29 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h index 88d14be7fcce..d4b9a0ec1bdc 100644 --- a/drivers/net/wireless/ath/ath10k/core.h +++ b/drivers/net/wireless/ath/ath10k/core.h | |||
@@ -775,6 +775,8 @@ struct ath10k { | |||
775 | u32 num_rf_chains; | 775 | u32 num_rf_chains; |
776 | u32 max_spatial_stream; | 776 | u32 max_spatial_stream; |
777 | /* protected by conf_mutex */ | 777 | /* protected by conf_mutex */ |
778 | u32 low_5ghz_chan; | ||
779 | u32 high_5ghz_chan; | ||
778 | bool ani_enabled; | 780 | bool ani_enabled; |
779 | 781 | ||
780 | bool p2p; | 782 | bool p2p; |
diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index f0e46804ad82..167bde5cbbad 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c | |||
@@ -3126,6 +3126,21 @@ static void ath10k_regd_update(struct ath10k *ar) | |||
3126 | ath10k_warn(ar, "failed to set pdev regdomain: %d\n", ret); | 3126 | ath10k_warn(ar, "failed to set pdev regdomain: %d\n", ret); |
3127 | } | 3127 | } |
3128 | 3128 | ||
3129 | void ath10k_mac_update_channel_list(struct ath10k *ar, | ||
3130 | struct ieee80211_supported_band *band) | ||
3131 | { | ||
3132 | int i; | ||
3133 | |||
3134 | if (ar->low_5ghz_chan && ar->high_5ghz_chan) { | ||
3135 | for (i = 0; i < band->n_channels; i++) { | ||
3136 | if (band->channels[i].center_freq < ar->low_5ghz_chan || | ||
3137 | band->channels[i].center_freq > ar->high_5ghz_chan) | ||
3138 | band->channels[i].flags |= | ||
3139 | IEEE80211_CHAN_DISABLED; | ||
3140 | } | ||
3141 | } | ||
3142 | } | ||
3143 | |||
3129 | static void ath10k_reg_notifier(struct wiphy *wiphy, | 3144 | static void ath10k_reg_notifier(struct wiphy *wiphy, |
3130 | struct regulatory_request *request) | 3145 | struct regulatory_request *request) |
3131 | { | 3146 | { |
@@ -3149,6 +3164,10 @@ static void ath10k_reg_notifier(struct wiphy *wiphy, | |||
3149 | if (ar->state == ATH10K_STATE_ON) | 3164 | if (ar->state == ATH10K_STATE_ON) |
3150 | ath10k_regd_update(ar); | 3165 | ath10k_regd_update(ar); |
3151 | mutex_unlock(&ar->conf_mutex); | 3166 | mutex_unlock(&ar->conf_mutex); |
3167 | |||
3168 | if (ar->phy_capability & WHAL_WLAN_11A_CAPABILITY) | ||
3169 | ath10k_mac_update_channel_list(ar, | ||
3170 | ar->hw->wiphy->bands[NL80211_BAND_5GHZ]); | ||
3152 | } | 3171 | } |
3153 | 3172 | ||
3154 | /***************/ | 3173 | /***************/ |
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c index 2f1743e60fa1..b31c4f71b413 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.c +++ b/drivers/net/wireless/ath/ath10k/wmi.c | |||
@@ -4593,6 +4593,8 @@ ath10k_wmi_main_op_pull_svc_rdy_ev(struct ath10k *ar, struct sk_buff *skb, | |||
4593 | arg->phy_capab = ev->phy_capability; | 4593 | arg->phy_capab = ev->phy_capability; |
4594 | arg->num_rf_chains = ev->num_rf_chains; | 4594 | arg->num_rf_chains = ev->num_rf_chains; |
4595 | arg->eeprom_rd = ev->hal_reg_capabilities.eeprom_rd; | 4595 | arg->eeprom_rd = ev->hal_reg_capabilities.eeprom_rd; |
4596 | arg->low_5ghz_chan = ev->hal_reg_capabilities.low_5ghz_chan; | ||
4597 | arg->high_5ghz_chan = ev->hal_reg_capabilities.high_5ghz_chan; | ||
4596 | arg->num_mem_reqs = ev->num_mem_reqs; | 4598 | arg->num_mem_reqs = ev->num_mem_reqs; |
4597 | arg->service_map = ev->wmi_service_bitmap; | 4599 | arg->service_map = ev->wmi_service_bitmap; |
4598 | arg->service_map_len = sizeof(ev->wmi_service_bitmap); | 4600 | arg->service_map_len = sizeof(ev->wmi_service_bitmap); |
@@ -4629,6 +4631,8 @@ ath10k_wmi_10x_op_pull_svc_rdy_ev(struct ath10k *ar, struct sk_buff *skb, | |||
4629 | arg->phy_capab = ev->phy_capability; | 4631 | arg->phy_capab = ev->phy_capability; |
4630 | arg->num_rf_chains = ev->num_rf_chains; | 4632 | arg->num_rf_chains = ev->num_rf_chains; |
4631 | arg->eeprom_rd = ev->hal_reg_capabilities.eeprom_rd; | 4633 | arg->eeprom_rd = ev->hal_reg_capabilities.eeprom_rd; |
4634 | arg->low_5ghz_chan = ev->hal_reg_capabilities.low_5ghz_chan; | ||
4635 | arg->high_5ghz_chan = ev->hal_reg_capabilities.high_5ghz_chan; | ||
4632 | arg->num_mem_reqs = ev->num_mem_reqs; | 4636 | arg->num_mem_reqs = ev->num_mem_reqs; |
4633 | arg->service_map = ev->wmi_service_bitmap; | 4637 | arg->service_map = ev->wmi_service_bitmap; |
4634 | arg->service_map_len = sizeof(ev->wmi_service_bitmap); | 4638 | arg->service_map_len = sizeof(ev->wmi_service_bitmap); |
@@ -4682,6 +4686,8 @@ static void ath10k_wmi_event_service_ready_work(struct work_struct *work) | |||
4682 | ar->phy_capability = __le32_to_cpu(arg.phy_capab); | 4686 | ar->phy_capability = __le32_to_cpu(arg.phy_capab); |
4683 | ar->num_rf_chains = __le32_to_cpu(arg.num_rf_chains); | 4687 | ar->num_rf_chains = __le32_to_cpu(arg.num_rf_chains); |
4684 | ar->hw_eeprom_rd = __le32_to_cpu(arg.eeprom_rd); | 4688 | ar->hw_eeprom_rd = __le32_to_cpu(arg.eeprom_rd); |
4689 | ar->low_5ghz_chan = __le32_to_cpu(arg.low_5ghz_chan); | ||
4690 | ar->high_5ghz_chan = __le32_to_cpu(arg.high_5ghz_chan); | ||
4685 | 4691 | ||
4686 | ath10k_dbg_dump(ar, ATH10K_DBG_WMI, NULL, "wmi svc: ", | 4692 | ath10k_dbg_dump(ar, ATH10K_DBG_WMI, NULL, "wmi svc: ", |
4687 | arg.service_map, arg.service_map_len); | 4693 | arg.service_map, arg.service_map_len); |
diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h index 386aa51435f1..78350d4c7b79 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.h +++ b/drivers/net/wireless/ath/ath10k/wmi.h | |||
@@ -6335,6 +6335,8 @@ struct wmi_svc_rdy_ev_arg { | |||
6335 | __le32 num_rf_chains; | 6335 | __le32 num_rf_chains; |
6336 | __le32 eeprom_rd; | 6336 | __le32 eeprom_rd; |
6337 | __le32 num_mem_reqs; | 6337 | __le32 num_mem_reqs; |
6338 | __le32 low_5ghz_chan; | ||
6339 | __le32 high_5ghz_chan; | ||
6338 | const __le32 *service_map; | 6340 | const __le32 *service_map; |
6339 | size_t service_map_len; | 6341 | size_t service_map_len; |
6340 | const struct wlan_host_mem_req *mem_reqs[WMI_MAX_MEM_REQS]; | 6342 | const struct wlan_host_mem_req *mem_reqs[WMI_MAX_MEM_REQS]; |