linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] wcn36xx: Disable 5GHz for wcn3610
@ 2018-03-29  6:58 Ramon Fried
  2018-03-29  7:15 ` Kalle Valo
  0 siblings, 1 reply; 5+ messages in thread
From: Ramon Fried @ 2018-03-29  6:58 UTC (permalink / raw)
  To: kvalo, loic.poulain
  Cc: wcn36xx, linux-wireless, netdev, linux-kernel, Ramon Fried

wcn3610 can only operate on 2.4GHz band due to RF limitation.
If wcn36xx digital block is associated with an external IRIS
RF module, retrieve the id and disable 5GHz band in case of
wcn3610 id.

Signed-off-by: Ramon Fried <rfried@codeaurora.org>
---
v2: fixed wrong assignment, which is logically introduces the 
	same behaviour, but for correctness.

 drivers/net/wireless/ath/wcn36xx/main.c    | 4 +++-
 drivers/net/wireless/ath/wcn36xx/wcn36xx.h | 1 +
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c
index ab5be6d2c691..833531a68c95 100644
--- a/drivers/net/wireless/ath/wcn36xx/main.c
+++ b/drivers/net/wireless/ath/wcn36xx/main.c
@@ -1146,7 +1146,7 @@ static int wcn36xx_init_ieee80211(struct wcn36xx *wcn)
 		BIT(NL80211_IFTYPE_MESH_POINT);
 
 	wcn->hw->wiphy->bands[NL80211_BAND_2GHZ] = &wcn_band_2ghz;
-	if (wcn->rf_id != RF_IRIS_WCN3620)
+	if (wcn->rf_id != RF_IRIS_WCN3610 && wcn->rf_id != RF_IRIS_WCN3620)
 		wcn->hw->wiphy->bands[NL80211_BAND_5GHZ] = &wcn_band_5ghz;
 
 	wcn->hw->wiphy->max_scan_ssids = WCN36XX_MAX_SCAN_SSIDS;
@@ -1248,6 +1248,8 @@ static int wcn36xx_platform_get_resources(struct wcn36xx *wcn,
 	if (iris_node) {
 		if (of_device_is_compatible(iris_node, "qcom,wcn3620"))
 			wcn->rf_id = RF_IRIS_WCN3620;
+		else if (of_device_is_compatible(iris_node, "qcom,wcn3610"))
+			wcn->rf_id = RF_IRIS_WCN3610;
 		of_node_put(iris_node);
 	}
 
diff --git a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h
index 81017e6703b4..bc4d1a10d90e 100644
--- a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h
+++ b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h
@@ -95,6 +95,7 @@ enum wcn36xx_ampdu_state {
 #define WCN36XX_MAX_POWER(__wcn) (__wcn->hw->conf.chandef.chan->max_power)
 
 #define RF_UNKNOWN	0x0000
+#define RF_IRIS_WCN3610	0x3610
 #define RF_IRIS_WCN3620	0x3620
 
 static inline void buff_to_be(u32 *buf, size_t len)
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

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

* Re: [PATCH v2] wcn36xx: Disable 5GHz for wcn3610
  2018-03-29  6:58 [PATCH v2] wcn36xx: Disable 5GHz for wcn3610 Ramon Fried
@ 2018-03-29  7:15 ` Kalle Valo
  2018-03-29  7:32   ` Ramon Fried
  0 siblings, 1 reply; 5+ messages in thread
From: Kalle Valo @ 2018-03-29  7:15 UTC (permalink / raw)
  To: Ramon Fried
  Cc: loic.poulain, wcn36xx, linux-wireless, netdev, linux-kernel, devicetree

(adding devicetree list)

Ramon Fried <rfried@codeaurora.org> writes:

> wcn3610 can only operate on 2.4GHz band due to RF limitation.
> If wcn36xx digital block is associated with an external IRIS
> RF module, retrieve the id and disable 5GHz band in case of
> wcn3610 id.
>
> Signed-off-by: Ramon Fried <rfried@codeaurora.org>
> ---
> v2: fixed wrong assignment, which is logically introduces the 
> 	same behaviour, but for correctness.
>
>  drivers/net/wireless/ath/wcn36xx/main.c    | 4 +++-
>  drivers/net/wireless/ath/wcn36xx/wcn36xx.h | 1 +
>  2 files changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c
> index ab5be6d2c691..833531a68c95 100644
> --- a/drivers/net/wireless/ath/wcn36xx/main.c
> +++ b/drivers/net/wireless/ath/wcn36xx/main.c
> @@ -1146,7 +1146,7 @@ static int wcn36xx_init_ieee80211(struct wcn36xx *wcn)
>  		BIT(NL80211_IFTYPE_MESH_POINT);
>  
>  	wcn->hw->wiphy->bands[NL80211_BAND_2GHZ] = &wcn_band_2ghz;
> -	if (wcn->rf_id != RF_IRIS_WCN3620)
> +	if (wcn->rf_id != RF_IRIS_WCN3610 && wcn->rf_id != RF_IRIS_WCN3620)
>  		wcn->hw->wiphy->bands[NL80211_BAND_5GHZ] = &wcn_band_5ghz;
>  
>  	wcn->hw->wiphy->max_scan_ssids = WCN36XX_MAX_SCAN_SSIDS;
> @@ -1248,6 +1248,8 @@ static int wcn36xx_platform_get_resources(struct wcn36xx *wcn,
>  	if (iris_node) {
>  		if (of_device_is_compatible(iris_node, "qcom,wcn3620"))
>  			wcn->rf_id = RF_IRIS_WCN3620;
> +		else if (of_device_is_compatible(iris_node, "qcom,wcn3610"))
> +			wcn->rf_id = RF_IRIS_WCN3610;
>  		of_node_put(iris_node);
>  	}

Should we document qcom,wcn3610 just like wcn3620 is:

Documentation/devicetree/bindings/remoteproc/qcom,wcnss-pil.txt:                    "qcom,wcn3620",

-- 
Kalle Valo

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

* Re: [PATCH v2] wcn36xx: Disable 5GHz for wcn3610
  2018-03-29  7:15 ` Kalle Valo
@ 2018-03-29  7:32   ` Ramon Fried
  2018-03-29  7:40     ` Loic Poulain
  2018-03-29  7:45     ` Kalle Valo
  0 siblings, 2 replies; 5+ messages in thread
From: Ramon Fried @ 2018-03-29  7:32 UTC (permalink / raw)
  To: Kalle Valo
  Cc: loic.poulain, wcn36xx, linux-wireless, netdev, linux-kernel, devicetree

(adding Bjorn Andersson)


On 3/29/2018 10:15 AM, Kalle Valo wrote:
> (adding devicetree list)
>
> Ramon Fried <rfried@codeaurora.org> writes:
>
>> wcn3610 can only operate on 2.4GHz band due to RF limitation.
>> If wcn36xx digital block is associated with an external IRIS
>> RF module, retrieve the id and disable 5GHz band in case of
>> wcn3610 id.
>>
>> Signed-off-by: Ramon Fried <rfried@codeaurora.org>
>> ---
>> v2: fixed wrong assignment, which is logically introduces the 
>> 	same behaviour, but for correctness.
>>
>>  drivers/net/wireless/ath/wcn36xx/main.c    | 4 +++-
>>  drivers/net/wireless/ath/wcn36xx/wcn36xx.h | 1 +
>>  2 files changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c
>> index ab5be6d2c691..833531a68c95 100644
>> --- a/drivers/net/wireless/ath/wcn36xx/main.c
>> +++ b/drivers/net/wireless/ath/wcn36xx/main.c
>> @@ -1146,7 +1146,7 @@ static int wcn36xx_init_ieee80211(struct wcn36xx *wcn)
>>  		BIT(NL80211_IFTYPE_MESH_POINT);
>>  
>>  	wcn->hw->wiphy->bands[NL80211_BAND_2GHZ] = &wcn_band_2ghz;
>> -	if (wcn->rf_id != RF_IRIS_WCN3620)
>> +	if (wcn->rf_id != RF_IRIS_WCN3610 && wcn->rf_id != RF_IRIS_WCN3620)
>>  		wcn->hw->wiphy->bands[NL80211_BAND_5GHZ] = &wcn_band_5ghz;
>>  
>>  	wcn->hw->wiphy->max_scan_ssids = WCN36XX_MAX_SCAN_SSIDS;
>> @@ -1248,6 +1248,8 @@ static int wcn36xx_platform_get_resources(struct wcn36xx *wcn,
>>  	if (iris_node) {
>>  		if (of_device_is_compatible(iris_node, "qcom,wcn3620"))
>>  			wcn->rf_id = RF_IRIS_WCN3620;
>> +		else if (of_device_is_compatible(iris_node, "qcom,wcn3610"))
>> +			wcn->rf_id = RF_IRIS_WCN3610;
>>  		of_node_put(iris_node);
>>  	}
> Should we document qcom,wcn3610 just like wcn3620 is:
>
> Documentation/devicetree/bindings/remoteproc/qcom,wcnss-pil.txt:                    "qcom,wcn3620",
IMHO the mentioned bindings is related to the PIL (peripheral image loaded) which is just the firmware part and has
nothing to do with wifi frontend(IRIS).

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

* Re: [PATCH v2] wcn36xx: Disable 5GHz for wcn3610
  2018-03-29  7:32   ` Ramon Fried
@ 2018-03-29  7:40     ` Loic Poulain
  2018-03-29  7:45     ` Kalle Valo
  1 sibling, 0 replies; 5+ messages in thread
From: Loic Poulain @ 2018-03-29  7:40 UTC (permalink / raw)
  To: Ramon Fried
  Cc: Kalle Valo, wcn36xx, linux-wireless, netdev, linux-kernel, devicetree

Hi Ramon,

On 29 March 2018 at 09:32, Ramon Fried <rfried@codeaurora.org> wrote:

>> Should we document qcom,wcn3610 just like wcn3620 is:
>>
>> Documentation/devicetree/bindings/remoteproc/qcom,wcnss-pil.txt:                    "qcom,wcn3620",
> IMHO the mentioned bindings is related to the PIL (peripheral image loaded) which is just the firmware part and has
> nothing to do with wifi frontend(IRIS).
>

It seems that the RF is a subnode of the PIL node:

"= SUBNODES
A required subnode of the WCNSS PIL is used to describe the attached rf module
and its resource dependencies. It is described by the following properties:"

So we should add qcom,wcn3610 to the exiting list of 'compatible' rf modules.

Regards,
Loic

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

* Re: [PATCH v2] wcn36xx: Disable 5GHz for wcn3610
  2018-03-29  7:32   ` Ramon Fried
  2018-03-29  7:40     ` Loic Poulain
@ 2018-03-29  7:45     ` Kalle Valo
  1 sibling, 0 replies; 5+ messages in thread
From: Kalle Valo @ 2018-03-29  7:45 UTC (permalink / raw)
  To: Ramon Fried
  Cc: loic.poulain, wcn36xx, linux-wireless, netdev, linux-kernel,
	devicetree, bjorn.andersson

(really adding Bjorn)

Ramon Fried <rfried@codeaurora.org> writes:

> (adding Bjorn Andersson)
>
>
> On 3/29/2018 10:15 AM, Kalle Valo wrote:
>> (adding devicetree list)
>>
>> Ramon Fried <rfried@codeaurora.org> writes:
>>
>>> wcn3610 can only operate on 2.4GHz band due to RF limitation.
>>> If wcn36xx digital block is associated with an external IRIS
>>> RF module, retrieve the id and disable 5GHz band in case of
>>> wcn3610 id.
>>>
>>> Signed-off-by: Ramon Fried <rfried@codeaurora.org>
>>> ---
>>> v2: fixed wrong assignment, which is logically introduces the 
>>> 	same behaviour, but for correctness.
>>>
>>>  drivers/net/wireless/ath/wcn36xx/main.c    | 4 +++-
>>>  drivers/net/wireless/ath/wcn36xx/wcn36xx.h | 1 +
>>>  2 files changed, 4 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c
>>> index ab5be6d2c691..833531a68c95 100644
>>> --- a/drivers/net/wireless/ath/wcn36xx/main.c
>>> +++ b/drivers/net/wireless/ath/wcn36xx/main.c
>>> @@ -1146,7 +1146,7 @@ static int wcn36xx_init_ieee80211(struct wcn36xx *wcn)
>>>  		BIT(NL80211_IFTYPE_MESH_POINT);
>>>  
>>>  	wcn->hw->wiphy->bands[NL80211_BAND_2GHZ] = &wcn_band_2ghz;
>>> -	if (wcn->rf_id != RF_IRIS_WCN3620)
>>> +	if (wcn->rf_id != RF_IRIS_WCN3610 && wcn->rf_id != RF_IRIS_WCN3620)
>>>  		wcn->hw->wiphy->bands[NL80211_BAND_5GHZ] = &wcn_band_5ghz;
>>>  
>>>  	wcn->hw->wiphy->max_scan_ssids = WCN36XX_MAX_SCAN_SSIDS;
>>> @@ -1248,6 +1248,8 @@ static int wcn36xx_platform_get_resources(struct wcn36xx *wcn,
>>>  	if (iris_node) {
>>>  		if (of_device_is_compatible(iris_node, "qcom,wcn3620"))
>>>  			wcn->rf_id = RF_IRIS_WCN3620;
>>> +		else if (of_device_is_compatible(iris_node, "qcom,wcn3610"))
>>> +			wcn->rf_id = RF_IRIS_WCN3610;
>>>  		of_node_put(iris_node);
>>>  	}
>> Should we document qcom,wcn3610 just like wcn3620 is:
>>
>> Documentation/devicetree/bindings/remoteproc/qcom,wcnss-pil.txt:
>> "qcom,wcn3620",
>
> IMHO the mentioned bindings is related to the PIL (peripheral image
> loaded) which is just the firmware part and has
> nothing to do with wifi frontend(IRIS).

Should we then have a bindings document for wcn36xx or is it ok to use
compatible strings like this without any docs? I'm not very familiar
with the devicetree stuff.

-- 
Kalle Valo

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

end of thread, other threads:[~2018-03-29  7:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-29  6:58 [PATCH v2] wcn36xx: Disable 5GHz for wcn3610 Ramon Fried
2018-03-29  7:15 ` Kalle Valo
2018-03-29  7:32   ` Ramon Fried
2018-03-29  7:40     ` Loic Poulain
2018-03-29  7:45     ` 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).