linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHv2] ath10k: Update available channel list for 5G radio
@ 2017-02-20  5:06 c_traja
  2017-02-20  5:07 ` Raja, Tamizh Chelvam
  0 siblings, 1 reply; 4+ messages in thread
From: c_traja @ 2017-02-20  5:06 UTC (permalink / raw)
  To: ath10k; +Cc: linux-wireless, Tamizh chelvam

From: Tamizh chelvam <c_traja@qti.qualcomm.com>

If a 5 GHz radio is calibrated for operation in both
the low band (channels 36 to 64) and
high band(channels 100 to 169), hardware allows operations
in all the listed channels. However, if the chip has been
calibrated only for the low/high band and a high/low band
channel is configured, due to lack of calibration there will
be potentially invalid signal on those non calibrated channels.
To avoid this problem this patch introduces ath10k_low_5ghz_channel
and ath10k_high_5ghz_channel lists as separate arrays.
The channel list will be initialized depending on the low_5ghz_chan
and high_5ghz_chan values which we get from target through
wmi service ready event.

Signed-off-by: Tamizh chelvam <c_traja@qti.qualcomm.com>
---
v2:
  * Addressed Jouni and Kalle's comments

 drivers/net/wireless/ath/ath10k/core.h |    2 ++
 drivers/net/wireless/ath/ath10k/mac.c  |   55 +++++++++++++++++++++++++++++---
 drivers/net/wireless/ath/ath10k/wmi.c  |    6 ++++
 drivers/net/wireless/ath/ath10k/wmi.h  |    2 ++
 4 files changed, 61 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h
index 88d14be..d07d567 100644
--- a/drivers/net/wireless/ath/ath10k/core.h
+++ b/drivers/net/wireless/ath/ath10k/core.h
@@ -774,6 +774,8 @@ struct ath10k {
 	u32 vht_cap_info;
 	u32 num_rf_chains;
 	u32 max_spatial_stream;
+	u32 low_5ghz_chan;
+	u32 high_5ghz_chan;
 	/* protected by conf_mutex */
 	bool ani_enabled;
 
diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index 3029f25..0840efb 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -7623,6 +7623,38 @@ static void ath10k_mac_op_sta_pre_rcu_remove(struct ieee80211_hw *hw,
 	CHAN2G(14, 2484, 0),
 };
 
+static const struct ieee80211_channel ath10k_low_5ghz_channels[] = {
+	CHAN5G(36, 5180, 0),
+	CHAN5G(40, 5200, 0),
+	CHAN5G(44, 5220, 0),
+	CHAN5G(48, 5240, 0),
+	CHAN5G(52, 5260, 0),
+	CHAN5G(56, 5280, 0),
+	CHAN5G(60, 5300, 0),
+	CHAN5G(64, 5320, 0),
+};
+
+static const struct ieee80211_channel ath10k_high_5ghz_channels[] = {
+	CHAN5G(100, 5500, 0),
+	CHAN5G(104, 5520, 0),
+	CHAN5G(108, 5540, 0),
+	CHAN5G(112, 5560, 0),
+	CHAN5G(116, 5580, 0),
+	CHAN5G(120, 5600, 0),
+	CHAN5G(124, 5620, 0),
+	CHAN5G(128, 5640, 0),
+	CHAN5G(132, 5660, 0),
+	CHAN5G(136, 5680, 0),
+	CHAN5G(140, 5700, 0),
+	CHAN5G(144, 5720, 0),
+	CHAN5G(149, 5745, 0),
+	CHAN5G(153, 5765, 0),
+	CHAN5G(157, 5785, 0),
+	CHAN5G(161, 5805, 0),
+	CHAN5G(165, 5825, 0),
+	CHAN5G(169, 5845, 0),
+};
+
 static const struct ieee80211_channel ath10k_5ghz_channels[] = {
 	CHAN5G(36, 5180, 0),
 	CHAN5G(40, 5200, 0),
@@ -8014,6 +8046,7 @@ int ath10k_mac_register(struct ath10k *ar)
 	};
 	struct ieee80211_supported_band *band;
 	void *channels;
+	int n_channels;
 	int ret;
 
 	SET_IEEE80211_PERM_ADDR(ar->hw, ar->mac_addr);
@@ -8049,16 +8082,30 @@ int ath10k_mac_register(struct ath10k *ar)
 	}
 
 	if (ar->phy_capability & WHAL_WLAN_11A_CAPABILITY) {
-		channels = kmemdup(ath10k_5ghz_channels,
-				   sizeof(ath10k_5ghz_channels),
-				   GFP_KERNEL);
+		if (ar->high_5ghz_chan <= 5350) {
+			channels = kmemdup(ath10k_low_5ghz_channels,
+					   sizeof(ath10k_low_5ghz_channels),
+					   GFP_KERNEL);
+			n_channels = ARRAY_SIZE(ath10k_low_5ghz_channels);
+		} else if (ar->low_5ghz_chan >= 5490 &&
+			   ar->high_5ghz_chan <= 5885) {
+			channels = kmemdup(ath10k_high_5ghz_channels,
+					   sizeof(ath10k_high_5ghz_channels),
+					   GFP_KERNEL);
+			n_channels = ARRAY_SIZE(ath10k_high_5ghz_channels);
+		} else {
+			channels = kmemdup(ath10k_5ghz_channels,
+					   sizeof(ath10k_5ghz_channels),
+					   GFP_KERNEL);
+			n_channels = ARRAY_SIZE(ath10k_5ghz_channels);
+		}
 		if (!channels) {
 			ret = -ENOMEM;
 			goto err_free;
 		}
 
 		band = &ar->mac.sbands[NL80211_BAND_5GHZ];
-		band->n_channels = ARRAY_SIZE(ath10k_5ghz_channels);
+		band->n_channels = n_channels;
 		band->channels = channels;
 		band->n_bitrates = ath10k_a_rates_size;
 		band->bitrates = ath10k_a_rates;
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
index 2f1743e..b31c4f7 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -4593,6 +4593,8 @@ static int ath10k_wmi_alloc_host_mem(struct ath10k *ar, u32 req_id,
 	arg->phy_capab = ev->phy_capability;
 	arg->num_rf_chains = ev->num_rf_chains;
 	arg->eeprom_rd = ev->hal_reg_capabilities.eeprom_rd;
+	arg->low_5ghz_chan = ev->hal_reg_capabilities.low_5ghz_chan;
+	arg->high_5ghz_chan = ev->hal_reg_capabilities.high_5ghz_chan;
 	arg->num_mem_reqs = ev->num_mem_reqs;
 	arg->service_map = ev->wmi_service_bitmap;
 	arg->service_map_len = sizeof(ev->wmi_service_bitmap);
@@ -4629,6 +4631,8 @@ static int ath10k_wmi_alloc_host_mem(struct ath10k *ar, u32 req_id,
 	arg->phy_capab = ev->phy_capability;
 	arg->num_rf_chains = ev->num_rf_chains;
 	arg->eeprom_rd = ev->hal_reg_capabilities.eeprom_rd;
+	arg->low_5ghz_chan = ev->hal_reg_capabilities.low_5ghz_chan;
+	arg->high_5ghz_chan = ev->hal_reg_capabilities.high_5ghz_chan;
 	arg->num_mem_reqs = ev->num_mem_reqs;
 	arg->service_map = ev->wmi_service_bitmap;
 	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)
 	ar->phy_capability = __le32_to_cpu(arg.phy_capab);
 	ar->num_rf_chains = __le32_to_cpu(arg.num_rf_chains);
 	ar->hw_eeprom_rd = __le32_to_cpu(arg.eeprom_rd);
+	ar->low_5ghz_chan = __le32_to_cpu(arg.low_5ghz_chan);
+	ar->high_5ghz_chan = __le32_to_cpu(arg.high_5ghz_chan);
 
 	ath10k_dbg_dump(ar, ATH10K_DBG_WMI, NULL, "wmi svc: ",
 			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 386aa51..78350d4 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 {
 	__le32 num_rf_chains;
 	__le32 eeprom_rd;
 	__le32 num_mem_reqs;
+	__le32 low_5ghz_chan;
+	__le32 high_5ghz_chan;
 	const __le32 *service_map;
 	size_t service_map_len;
 	const struct wlan_host_mem_req *mem_reqs[WMI_MAX_MEM_REQS];
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* RE: [PATCHv2] ath10k: Update available channel list for 5G radio
  2017-02-20  5:06 [PATCHv2] ath10k: Update available channel list for 5G radio c_traja
@ 2017-02-20  5:07 ` Raja, Tamizh Chelvam
  0 siblings, 0 replies; 4+ messages in thread
From: Raja, Tamizh Chelvam @ 2017-02-20  5:07 UTC (permalink / raw)
  To: ath10k; +Cc: linux-wireless

Please ignore this patch:(

> -----Original Message-----
> From: Raja, Tamizh Chelvam
> Sent: Monday, February 20, 2017 10:37 AM
> To: ath10k@lists.infradead.org
> Cc: linux-wireless@vger.kernel.org; Raja, Tamizh Chelvam
> <c_traja@qti.qualcomm.com>
> Subject: [PATCHv2] ath10k: Update available channel list for 5G radio
>=20
> From: Tamizh chelvam <c_traja@qti.qualcomm.com>
>=20
> If a 5 GHz radio is calibrated for operation in both the low band (channe=
ls 36 to
> 64) and high band(channels 100 to 169), hardware allows operations in all=
 the
> listed channels. However, if the chip has been calibrated only for the lo=
w/high
> band and a high/low band channel is configured, due to lack of calibratio=
n
> there will be potentially invalid signal on those non calibrated channels=
.
> To avoid this problem this patch introduces ath10k_low_5ghz_channel and
> ath10k_high_5ghz_channel lists as separate arrays.
> The channel list will be initialized depending on the low_5ghz_chan and
> high_5ghz_chan values which we get from target through wmi service ready
> event.
>=20
> Signed-off-by: Tamizh chelvam <c_traja@qti.qualcomm.com>
> ---
> v2:
>   * Addressed Jouni and Kalle's comments
>=20
>  drivers/net/wireless/ath/ath10k/core.h |    2 ++
>  drivers/net/wireless/ath/ath10k/mac.c  |   55
> +++++++++++++++++++++++++++++---
>  drivers/net/wireless/ath/ath10k/wmi.c  |    6 ++++
>  drivers/net/wireless/ath/ath10k/wmi.h  |    2 ++
>  4 files changed, 61 insertions(+), 4 deletions(-)
>=20
> diff --git a/drivers/net/wireless/ath/ath10k/core.h
> b/drivers/net/wireless/ath/ath10k/core.h
> index 88d14be..d07d567 100644
> --- a/drivers/net/wireless/ath/ath10k/core.h
> +++ b/drivers/net/wireless/ath/ath10k/core.h
> @@ -774,6 +774,8 @@ struct ath10k {
>  	u32 vht_cap_info;
>  	u32 num_rf_chains;
>  	u32 max_spatial_stream;
> +	u32 low_5ghz_chan;
> +	u32 high_5ghz_chan;
>  	/* protected by conf_mutex */
>  	bool ani_enabled;
>=20
> diff --git a/drivers/net/wireless/ath/ath10k/mac.c
> b/drivers/net/wireless/ath/ath10k/mac.c
> index 3029f25..0840efb 100644
> --- a/drivers/net/wireless/ath/ath10k/mac.c
> +++ b/drivers/net/wireless/ath/ath10k/mac.c
> @@ -7623,6 +7623,38 @@ static void
> ath10k_mac_op_sta_pre_rcu_remove(struct ieee80211_hw *hw,
>  	CHAN2G(14, 2484, 0),
>  };
>=20
> +static const struct ieee80211_channel ath10k_low_5ghz_channels[] =3D {
> +	CHAN5G(36, 5180, 0),
> +	CHAN5G(40, 5200, 0),
> +	CHAN5G(44, 5220, 0),
> +	CHAN5G(48, 5240, 0),
> +	CHAN5G(52, 5260, 0),
> +	CHAN5G(56, 5280, 0),
> +	CHAN5G(60, 5300, 0),
> +	CHAN5G(64, 5320, 0),
> +};
> +
> +static const struct ieee80211_channel ath10k_high_5ghz_channels[] =3D {
> +	CHAN5G(100, 5500, 0),
> +	CHAN5G(104, 5520, 0),
> +	CHAN5G(108, 5540, 0),
> +	CHAN5G(112, 5560, 0),
> +	CHAN5G(116, 5580, 0),
> +	CHAN5G(120, 5600, 0),
> +	CHAN5G(124, 5620, 0),
> +	CHAN5G(128, 5640, 0),
> +	CHAN5G(132, 5660, 0),
> +	CHAN5G(136, 5680, 0),
> +	CHAN5G(140, 5700, 0),
> +	CHAN5G(144, 5720, 0),
> +	CHAN5G(149, 5745, 0),
> +	CHAN5G(153, 5765, 0),
> +	CHAN5G(157, 5785, 0),
> +	CHAN5G(161, 5805, 0),
> +	CHAN5G(165, 5825, 0),
> +	CHAN5G(169, 5845, 0),
> +};
> +
>  static const struct ieee80211_channel ath10k_5ghz_channels[] =3D {
>  	CHAN5G(36, 5180, 0),
>  	CHAN5G(40, 5200, 0),
> @@ -8014,6 +8046,7 @@ int ath10k_mac_register(struct ath10k *ar)
>  	};
>  	struct ieee80211_supported_band *band;
>  	void *channels;
> +	int n_channels;
>  	int ret;
>=20
>  	SET_IEEE80211_PERM_ADDR(ar->hw, ar->mac_addr); @@ -8049,16
> +8082,30 @@ int ath10k_mac_register(struct ath10k *ar)
>  	}
>=20
>  	if (ar->phy_capability & WHAL_WLAN_11A_CAPABILITY) {
> -		channels =3D kmemdup(ath10k_5ghz_channels,
> -				   sizeof(ath10k_5ghz_channels),
> -				   GFP_KERNEL);
> +		if (ar->high_5ghz_chan <=3D 5350) {
> +			channels =3D kmemdup(ath10k_low_5ghz_channels,
> +					   sizeof(ath10k_low_5ghz_channels),
> +					   GFP_KERNEL);
> +			n_channels =3D ARRAY_SIZE(ath10k_low_5ghz_channels);
> +		} else if (ar->low_5ghz_chan >=3D 5490 &&
> +			   ar->high_5ghz_chan <=3D 5885) {
> +			channels =3D kmemdup(ath10k_high_5ghz_channels,
> +					   sizeof(ath10k_high_5ghz_channels),
> +					   GFP_KERNEL);
> +			n_channels =3D
> ARRAY_SIZE(ath10k_high_5ghz_channels);
> +		} else {
> +			channels =3D kmemdup(ath10k_5ghz_channels,
> +					   sizeof(ath10k_5ghz_channels),
> +					   GFP_KERNEL);
> +			n_channels =3D ARRAY_SIZE(ath10k_5ghz_channels);
> +		}
>  		if (!channels) {
>  			ret =3D -ENOMEM;
>  			goto err_free;
>  		}
>=20
>  		band =3D &ar->mac.sbands[NL80211_BAND_5GHZ];
> -		band->n_channels =3D ARRAY_SIZE(ath10k_5ghz_channels);
> +		band->n_channels =3D n_channels;
>  		band->channels =3D channels;
>  		band->n_bitrates =3D ath10k_a_rates_size;
>  		band->bitrates =3D ath10k_a_rates;
> diff --git a/drivers/net/wireless/ath/ath10k/wmi.c
> b/drivers/net/wireless/ath/ath10k/wmi.c
> index 2f1743e..b31c4f7 100644
> --- a/drivers/net/wireless/ath/ath10k/wmi.c
> +++ b/drivers/net/wireless/ath/ath10k/wmi.c
> @@ -4593,6 +4593,8 @@ static int ath10k_wmi_alloc_host_mem(struct ath10k
> *ar, u32 req_id,
>  	arg->phy_capab =3D ev->phy_capability;
>  	arg->num_rf_chains =3D ev->num_rf_chains;
>  	arg->eeprom_rd =3D ev->hal_reg_capabilities.eeprom_rd;
> +	arg->low_5ghz_chan =3D ev->hal_reg_capabilities.low_5ghz_chan;
> +	arg->high_5ghz_chan =3D ev->hal_reg_capabilities.high_5ghz_chan;
>  	arg->num_mem_reqs =3D ev->num_mem_reqs;
>  	arg->service_map =3D ev->wmi_service_bitmap;
>  	arg->service_map_len =3D sizeof(ev->wmi_service_bitmap); @@ -4629,6
> +4631,8 @@ static int ath10k_wmi_alloc_host_mem(struct ath10k *ar, u32
> req_id,
>  	arg->phy_capab =3D ev->phy_capability;
>  	arg->num_rf_chains =3D ev->num_rf_chains;
>  	arg->eeprom_rd =3D ev->hal_reg_capabilities.eeprom_rd;
> +	arg->low_5ghz_chan =3D ev->hal_reg_capabilities.low_5ghz_chan;
> +	arg->high_5ghz_chan =3D ev->hal_reg_capabilities.high_5ghz_chan;
>  	arg->num_mem_reqs =3D ev->num_mem_reqs;
>  	arg->service_map =3D ev->wmi_service_bitmap;
>  	arg->service_map_len =3D sizeof(ev->wmi_service_bitmap); @@ -4682,6
> +4686,8 @@ static void ath10k_wmi_event_service_ready_work(struct
> work_struct *work)
>  	ar->phy_capability =3D __le32_to_cpu(arg.phy_capab);
>  	ar->num_rf_chains =3D __le32_to_cpu(arg.num_rf_chains);
>  	ar->hw_eeprom_rd =3D __le32_to_cpu(arg.eeprom_rd);
> +	ar->low_5ghz_chan =3D __le32_to_cpu(arg.low_5ghz_chan);
> +	ar->high_5ghz_chan =3D __le32_to_cpu(arg.high_5ghz_chan);
>=20
>  	ath10k_dbg_dump(ar, ATH10K_DBG_WMI, NULL, "wmi svc: ",
>  			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 386aa51..78350d4 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 {
>  	__le32 num_rf_chains;
>  	__le32 eeprom_rd;
>  	__le32 num_mem_reqs;
> +	__le32 low_5ghz_chan;
> +	__le32 high_5ghz_chan;
>  	const __le32 *service_map;
>  	size_t service_map_len;
>  	const struct wlan_host_mem_req
> *mem_reqs[WMI_MAX_MEM_REQS];
> --
> 1.7.9.5

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCHv2] ath10k: Update available channel list for 5G radio
  2017-02-23 13:18 c_traja
@ 2017-03-16  8:54 ` Kalle Valo
  0 siblings, 0 replies; 4+ messages in thread
From: Kalle Valo @ 2017-03-16  8:54 UTC (permalink / raw)
  To: c_traja; +Cc: ath10k, Tamizh chelvam, linux-wireless

c_traja@qti.qualcomm.com wrote:
> From: Tamizh chelvam <c_traja@qti.qualcomm.com>
> 
> If a 5 GHz radio is calibrated for operation in both
> the low band (channels 36 to 64) and high band(channels 100 to 169),
> hardware allows operations in all the listed channels. However,
> if the chip has been calibrated only for the low/high band and
> a high/low band channel is configured, due to lack of calibration
> there will be potentially invalid signal on those non calibrated channels.
> To avoid this problem this patch sets IEEE80211_CHAN_DISABLED flag for
> those non calibrated channels by using low_5ghz_chan and high_5ghz_chan
> values which we get from target through wmi service ready event.
> 
> Driver initialized flags are getting re initialized in handle_channel
> in cfg80211. So calling the function to disable the non supported channel
> from reg_notifier().
> 
> Signed-off-by: Tamizh chelvam <c_traja@qti.qualcomm.com>

Patch applied to ath-next branch of ath.git, thanks.

523f6701dbab ath10k: update available channel list for 5G radio

-- 
https://patchwork.kernel.org/patch/9588297/

Documentation about submitting wireless patches and checking status
from patchwork:

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCHv2] ath10k: Update available channel list for 5G radio
@ 2017-02-23 13:18 c_traja
  2017-03-16  8:54 ` Kalle Valo
  0 siblings, 1 reply; 4+ messages in thread
From: c_traja @ 2017-02-23 13:18 UTC (permalink / raw)
  To: ath10k; +Cc: linux-wireless, Tamizh chelvam

From: Tamizh chelvam <c_traja@qti.qualcomm.com>

If a 5 GHz radio is calibrated for operation in both
the low band (channels 36 to 64) and high band(channels 100 to 169),
hardware allows operations in all the listed channels. However,
if the chip has been calibrated only for the low/high band and
a high/low band channel is configured, due to lack of calibration
there will be potentially invalid signal on those non calibrated channels.
To avoid this problem this patch sets IEEE80211_CHAN_DISABLED flag for
those non calibrated channels by using low_5ghz_chan and high_5ghz_chan
values which we get from target through wmi service ready event.

Driver initialized flags are getting re initialized in handle_channel
in cfg80211. So calling the function to disable the non supported channel
from reg_notifier().

Signed-off-by: Tamizh chelvam <c_traja@qti.qualcomm.com>
---
v2:
  * Removed two separate arrays for channel list, and changed logic
    to disable non calibrated channels.

 drivers/net/wireless/ath/ath10k/core.h |    2 ++
 drivers/net/wireless/ath/ath10k/mac.c  |   19 +++++++++++++++++++
 drivers/net/wireless/ath/ath10k/wmi.c  |    6 ++++++
 drivers/net/wireless/ath/ath10k/wmi.h  |    2 ++
 4 files changed, 29 insertions(+)

diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h
index 88d14be..d4b9a0e 100644
--- a/drivers/net/wireless/ath/ath10k/core.h
+++ b/drivers/net/wireless/ath/ath10k/core.h
@@ -775,6 +775,8 @@ struct ath10k {
 	u32 num_rf_chains;
 	u32 max_spatial_stream;
 	/* protected by conf_mutex */
+	u32 low_5ghz_chan;
+	u32 high_5ghz_chan;
 	bool ani_enabled;
 
 	bool p2p;
diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index abc291d..c5b6c2a 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)
 		ath10k_warn(ar, "failed to set pdev regdomain: %d\n", ret);
 }
 
+void ath10k_mac_update_channel_list(struct ath10k *ar,
+				    struct ieee80211_supported_band *band)
+{
+	int i;
+
+	if (ar->low_5ghz_chan && ar->high_5ghz_chan) {
+		for (i = 0; i < band->n_channels; i++) {
+			if (band->channels[i].center_freq < ar->low_5ghz_chan ||
+			    band->channels[i].center_freq > ar->high_5ghz_chan)
+				band->channels[i].flags |=
+					IEEE80211_CHAN_DISABLED;
+		}
+	}
+}
+
 static void ath10k_reg_notifier(struct wiphy *wiphy,
 				struct regulatory_request *request)
 {
@@ -3149,6 +3164,10 @@ static void ath10k_reg_notifier(struct wiphy *wiphy,
 	if (ar->state == ATH10K_STATE_ON)
 		ath10k_regd_update(ar);
 	mutex_unlock(&ar->conf_mutex);
+
+	if (ar->phy_capability & WHAL_WLAN_11A_CAPABILITY)
+		ath10k_mac_update_channel_list(ar,
+				ar->hw->wiphy->bands[NL80211_BAND_5GHZ]);
 }
 
 /***************/
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
index 2f1743e..b31c4f7 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -4593,6 +4593,8 @@ static int ath10k_wmi_alloc_host_mem(struct ath10k *ar, u32 req_id,
 	arg->phy_capab = ev->phy_capability;
 	arg->num_rf_chains = ev->num_rf_chains;
 	arg->eeprom_rd = ev->hal_reg_capabilities.eeprom_rd;
+	arg->low_5ghz_chan = ev->hal_reg_capabilities.low_5ghz_chan;
+	arg->high_5ghz_chan = ev->hal_reg_capabilities.high_5ghz_chan;
 	arg->num_mem_reqs = ev->num_mem_reqs;
 	arg->service_map = ev->wmi_service_bitmap;
 	arg->service_map_len = sizeof(ev->wmi_service_bitmap);
@@ -4629,6 +4631,8 @@ static int ath10k_wmi_alloc_host_mem(struct ath10k *ar, u32 req_id,
 	arg->phy_capab = ev->phy_capability;
 	arg->num_rf_chains = ev->num_rf_chains;
 	arg->eeprom_rd = ev->hal_reg_capabilities.eeprom_rd;
+	arg->low_5ghz_chan = ev->hal_reg_capabilities.low_5ghz_chan;
+	arg->high_5ghz_chan = ev->hal_reg_capabilities.high_5ghz_chan;
 	arg->num_mem_reqs = ev->num_mem_reqs;
 	arg->service_map = ev->wmi_service_bitmap;
 	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)
 	ar->phy_capability = __le32_to_cpu(arg.phy_capab);
 	ar->num_rf_chains = __le32_to_cpu(arg.num_rf_chains);
 	ar->hw_eeprom_rd = __le32_to_cpu(arg.eeprom_rd);
+	ar->low_5ghz_chan = __le32_to_cpu(arg.low_5ghz_chan);
+	ar->high_5ghz_chan = __le32_to_cpu(arg.high_5ghz_chan);
 
 	ath10k_dbg_dump(ar, ATH10K_DBG_WMI, NULL, "wmi svc: ",
 			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 386aa51..78350d4 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 {
 	__le32 num_rf_chains;
 	__le32 eeprom_rd;
 	__le32 num_mem_reqs;
+	__le32 low_5ghz_chan;
+	__le32 high_5ghz_chan;
 	const __le32 *service_map;
 	size_t service_map_len;
 	const struct wlan_host_mem_req *mem_reqs[WMI_MAX_MEM_REQS];
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-03-16  8:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-20  5:06 [PATCHv2] ath10k: Update available channel list for 5G radio c_traja
2017-02-20  5:07 ` Raja, Tamizh Chelvam
2017-02-23 13:18 c_traja
2017-03-16  8:54 ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).