linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cfg80211: Convert 6 GHz channel frequency to channel number
@ 2019-08-29 22:21 Amar Singhal
  2019-08-30 10:32 ` Johannes Berg
  2019-08-30 10:45 ` Arend Van Spriel
  0 siblings, 2 replies; 7+ messages in thread
From: Amar Singhal @ 2019-08-29 22:21 UTC (permalink / raw)
  To: johannes, jouni; +Cc: linux-wireless, jjohnson, rmanohar, Amar Singhal

Enhance function ieee80211_frequency_to_channel by adding 6 GHz
channels.

Signed-off-by: Amar Singhal <asinghal@codeaurora.org>
---
 net/wireless/util.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/wireless/util.c b/net/wireless/util.c
index cf63b63..9aba8d54 100644
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -111,8 +111,10 @@ int ieee80211_frequency_to_channel(int freq)
 		return (freq - 2407) / 5;
 	else if (freq >= 4910 && freq <= 4980)
 		return (freq - 4000) / 5;
-	else if (freq <= 45000) /* DMG band lower limit */
+	else if (freq > 5000 && freq <= 5920)
 		return (freq - 5000) / 5;
+	else if (freq >= 5945 && freq <= 7205)
+		  return (freq - 5940) / 5;
 	else if (freq >= 58320 && freq <= 70200)
 		return (freq - 56160) / 2160;
 	else
--
1.9.1


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

* Re: [PATCH] cfg80211: Convert 6 GHz channel frequency to channel number
  2019-08-29 22:21 [PATCH] cfg80211: Convert 6 GHz channel frequency to channel number Amar Singhal
@ 2019-08-30 10:32 ` Johannes Berg
  2019-08-30 10:47   ` Arend Van Spriel
  2019-08-30 10:45 ` Arend Van Spriel
  1 sibling, 1 reply; 7+ messages in thread
From: Johannes Berg @ 2019-08-30 10:32 UTC (permalink / raw)
  To: Amar Singhal, jouni; +Cc: linux-wireless, jjohnson, rmanohar

On Thu, 2019-08-29 at 15:21 -0700, Amar Singhal wrote:
> Enhance function ieee80211_frequency_to_channel by adding 6 GHz
> channels.

Wait, this is already supported, no? Just implemented slightly
differently?

johannes


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

* Re: [PATCH] cfg80211: Convert 6 GHz channel frequency to channel number
  2019-08-29 22:21 [PATCH] cfg80211: Convert 6 GHz channel frequency to channel number Amar Singhal
  2019-08-30 10:32 ` Johannes Berg
@ 2019-08-30 10:45 ` Arend Van Spriel
  2019-08-30 18:03   ` asinghal
  1 sibling, 1 reply; 7+ messages in thread
From: Arend Van Spriel @ 2019-08-30 10:45 UTC (permalink / raw)
  To: Amar Singhal, johannes, jouni; +Cc: linux-wireless, jjohnson, rmanohar

On 8/30/2019 12:21 AM, Amar Singhal wrote:
> Enhance function ieee80211_frequency_to_channel by adding 6 GHz
> channels.

This look very similar to what I submitted earlier:

https://patchwork.kernel.org/patch/11073197/

Regards,
Arend

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

* Re: [PATCH] cfg80211: Convert 6 GHz channel frequency to channel number
  2019-08-30 10:32 ` Johannes Berg
@ 2019-08-30 10:47   ` Arend Van Spriel
  2019-08-30 10:48     ` Johannes Berg
  0 siblings, 1 reply; 7+ messages in thread
From: Arend Van Spriel @ 2019-08-30 10:47 UTC (permalink / raw)
  To: Johannes Berg, Amar Singhal, jouni; +Cc: linux-wireless, jjohnson, rmanohar

On 8/30/2019 12:32 PM, Johannes Berg wrote:
> On Thu, 2019-08-29 at 15:21 -0700, Amar Singhal wrote:
>> Enhance function ieee80211_frequency_to_channel by adding 6 GHz
>> channels.
> 
> Wait, this is already supported, no? Just implemented slightly
> differently?

It is Johannes, but I was unaware as well. Did you forget to email that 
it was applied or is there some automated stuff that failed on you? ;-)

Regards,
Arend

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

* Re: [PATCH] cfg80211: Convert 6 GHz channel frequency to channel number
  2019-08-30 10:47   ` Arend Van Spriel
@ 2019-08-30 10:48     ` Johannes Berg
  0 siblings, 0 replies; 7+ messages in thread
From: Johannes Berg @ 2019-08-30 10:48 UTC (permalink / raw)
  To: Arend Van Spriel, Amar Singhal, jouni; +Cc: linux-wireless, jjohnson, rmanohar

On Fri, 2019-08-30 at 12:47 +0200, Arend Van Spriel wrote:
> On 8/30/2019 12:32 PM, Johannes Berg wrote:
> > On Thu, 2019-08-29 at 15:21 -0700, Amar Singhal wrote:
> > > Enhance function ieee80211_frequency_to_channel by adding 6 GHz
> > > channels.
> > 
> > Wait, this is already supported, no? Just implemented slightly
> > differently?
> 
> It is Johannes, but I was unaware as well. Did you forget to email that 
> it was applied or is there some automated stuff that failed on you? ;-)

Truth be told, I've been very lazy (mostly due to being busy) and
haven't responded manually - and also haven't managed to set up anything
that would automate a response, I tried Kalle's tool at one point but it
didn't work for me yet.

Right now, your best bet is probably to poll patchwork, sorry about
that.

johannes


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

* Re: [PATCH] cfg80211: Convert 6 GHz channel frequency to channel number
  2019-08-30 10:45 ` Arend Van Spriel
@ 2019-08-30 18:03   ` asinghal
  2019-08-30 18:08     ` asinghal
  0 siblings, 1 reply; 7+ messages in thread
From: asinghal @ 2019-08-30 18:03 UTC (permalink / raw)
  To: Arend Van Spriel; +Cc: johannes, jouni, linux-wireless, jjohnson, rmanohar

On 2019-08-30 03:45, Arend Van Spriel wrote:
> On 8/30/2019 12:21 AM, Amar Singhal wrote:
>> Enhance function ieee80211_frequency_to_channel by adding 6 GHz
>> channels.
> 
> This look very similar to what I submitted earlier:
> 
> https://patchwork.kernel.org/patch/11073197/
> 
> Regards,
> Arend
-	else if (freq <= 45000) /* DMG band lower limit */
+	else if (freq < 5940)
  		return (freq - 5000) / 5;
+	else if (freq <= 45000) /* DMG band lower limit */
+		/* see 802.11ax D4.1 27.3.22.2 */
+		return (freq - 5940) / 5;

hi Arend,
           I see a small issue in your patch above; for frequency 5940, 
the channel number returned would be 0 which is an invalid channel. I 
guess 6 GHz center frequency numbers begin with 4945.

rgds,
Amar






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

* Re: [PATCH] cfg80211: Convert 6 GHz channel frequency to channel number
  2019-08-30 18:03   ` asinghal
@ 2019-08-30 18:08     ` asinghal
  0 siblings, 0 replies; 7+ messages in thread
From: asinghal @ 2019-08-30 18:08 UTC (permalink / raw)
  To: Arend Van Spriel; +Cc: johannes, jouni, linux-wireless, jjohnson, rmanohar

Correction in typo below:

On 2019-08-30 11:03, asinghal@codeaurora.org wrote:
> On 2019-08-30 03:45, Arend Van Spriel wrote:
>> On 8/30/2019 12:21 AM, Amar Singhal wrote:
>>> Enhance function ieee80211_frequency_to_channel by adding 6 GHz
>>> channels.
>> 
>> This look very similar to what I submitted earlier:
>> 
>> https://patchwork.kernel.org/patch/11073197/
>> 
>> Regards,
>> Arend
> -	else if (freq <= 45000) /* DMG band lower limit */
> +	else if (freq < 5940)
>  		return (freq - 5000) / 5;
> +	else if (freq <= 45000) /* DMG band lower limit */
> +		/* see 802.11ax D4.1 27.3.22.2 */
> +		return (freq - 5940) / 5;
> 
> hi Arend,
>           I see a small issue in your patch above; for frequency 5940,
> the channel number returned would be 0 which is an invalid channel. I
> guess 6 GHz center frequency numbers begin with 5945.
> 
> rgds,
> Amar

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

end of thread, other threads:[~2019-08-30 18:08 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-29 22:21 [PATCH] cfg80211: Convert 6 GHz channel frequency to channel number Amar Singhal
2019-08-30 10:32 ` Johannes Berg
2019-08-30 10:47   ` Arend Van Spriel
2019-08-30 10:48     ` Johannes Berg
2019-08-30 10:45 ` Arend Van Spriel
2019-08-30 18:03   ` asinghal
2019-08-30 18:08     ` asinghal

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).