linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Amar Singhal <asinghal@codeaurora.org>
To: johannes@sipsolutions.net, jouni@codeaurora.org
Cc: linux-wireless@vger.kernel.org, jjohnson@codeaurora.org,
	rmanohar@codeaurora.org, Amar Singhal <asinghal@codeaurora.org>
Subject: [PATCH] cfg80211: Convert 6 GHz channel frequency to channel number
Date: Thu, 29 Aug 2019 15:21:30 -0700	[thread overview]
Message-ID: <1567117290-19295-1-git-send-email-asinghal@codeaurora.org> (raw)

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


             reply	other threads:[~2019-08-29 22:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-29 22:21 Amar Singhal [this message]
2019-08-30 10:32 ` [PATCH] cfg80211: Convert 6 GHz channel frequency to channel number 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1567117290-19295-1-git-send-email-asinghal@codeaurora.org \
    --to=asinghal@codeaurora.org \
    --cc=jjohnson@codeaurora.org \
    --cc=johannes@sipsolutions.net \
    --cc=jouni@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=rmanohar@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).