From: Mahesh Palivela <maheshp@posedge.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: "linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
Johannes Berg <johannes.berg@intel.com>
Subject: Re: [RFC v2 4/8] nl80211/cfg80211: support VHT channel configuration
Date: Mon, 19 Nov 2012 17:48:07 +0530 [thread overview]
Message-ID: <50AA237F.4090102@posedge.com> (raw)
In-Reply-To: <1352492254-29399-5-git-send-email-johannes@sipsolutions.net>
On 11/10/2012 01:47 AM, Johannes Berg wrote:
> From: Johannes Berg <johannes.berg@intel.com>
> +bool cfg80211_chan_def_valid(const struct cfg80211_chan_def *chandef)
> +{
> + u32 control_freq;
> +
> + if (!chandef->chan)
> + return false;
> +
> + control_freq = chandef->chan->center_freq;
> +
> + switch (chandef->width) {
> + case NL80211_CHAN_WIDTH_20:
> + case NL80211_CHAN_WIDTH_20_NOHT:
> + if (chandef->center_freq1 != control_freq)
> + return false;
> + if (chandef->center_freq2)
> + return false;
> + break;
> + case NL80211_CHAN_WIDTH_40:
> + if (chandef->center_freq1 != control_freq + 10 &&
> + chandef->center_freq1 != control_freq - 10)
> + return false;
> + if (chandef->center_freq2)
> + return false;
> + break;
> + case NL80211_CHAN_WIDTH_80P80:
> + if (chandef->center_freq1 != control_freq + 30 &&
> + chandef->center_freq1 != control_freq + 10 &&
> + chandef->center_freq1 != control_freq - 10 &&
> + chandef->center_freq1 != control_freq - 30)
> + return false;
> + if (!chandef->center_freq2)
> + return false;
> + break;
> + case NL80211_CHAN_WIDTH_80:
> + if (chandef->center_freq1 != control_freq + 30 &&
> + chandef->center_freq1 != control_freq + 10 &&
> + chandef->center_freq1 != control_freq - 10 &&
> + chandef->center_freq1 != control_freq - 30)
> + return false;
> + if (chandef->center_freq2)
> + return false;
> + break;
> + case NL80211_CHAN_WIDTH_160:
> + if (chandef->center_freq1 != control_freq + 70 &&
> + chandef->center_freq1 != control_freq + 50 &&
> + chandef->center_freq1 != control_freq + 30 &&
> + chandef->center_freq1 != control_freq + 10 &&
> + chandef->center_freq1 != control_freq - 10 &&
> + chandef->center_freq1 != control_freq - 30 &&
> + chandef->center_freq1 != control_freq - 50 &&
> + chandef->center_freq1 != control_freq - 70)
> + return false;
Should we create a macro instead of +70 to -70 to take care of all 3
cases 80, 80p80 and 160?
> + if (chandef->center_freq2)
next prev parent reply other threads:[~2012-11-19 12:18 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-09 20:17 VHT support, take 2 Johannes Berg
2012-11-09 20:17 ` [RFC v2 1/8] cfg80211: remove remain-on-channel channel type Johannes Berg
2012-11-09 20:17 ` [RFC v2 2/8] nl80211: add documentation for " Johannes Berg
2012-11-15 11:00 ` Mahesh Palivela
2012-11-15 12:09 ` Johannes Berg
2012-11-09 20:17 ` [RFC v2 3/8] cfg80211: pass a channel definition struct Johannes Berg
2012-11-09 20:17 ` [RFC v2 4/8] nl80211/cfg80211: support VHT channel configuration Johannes Berg
2012-11-12 10:55 ` Johannes Berg
2012-11-16 12:21 ` Mahesh Palivela
2012-11-16 12:37 ` Johannes Berg
2012-11-19 4:18 ` Mahesh Palivela
2012-11-19 8:33 ` Johannes Berg
2012-11-19 12:18 ` Mahesh Palivela [this message]
2012-11-19 14:11 ` Johannes Berg
2012-11-20 6:03 ` Mahesh Palivela
2012-11-20 7:27 ` Johannes Berg
2012-11-20 8:27 ` Mahesh Palivela
2012-11-20 8:41 ` Johannes Berg
2012-11-20 9:39 ` Johannes Berg
2012-11-20 11:59 ` Mahesh Palivela
2012-11-20 12:21 ` Johannes Berg
2012-11-20 12:56 ` Mahesh Palivela
2012-11-09 20:17 ` [RFC v2 5/8] mac80211: convert to channel definition struct Johannes Berg
2012-11-09 20:17 ` [RFC v2 6/8] nl80211/cfg80211: add VHT MCS support Johannes Berg
2012-11-09 20:17 ` [RFC v2 7/8] mac80211: support drivers reporting VHT RX Johannes Berg
2012-11-09 20:17 ` [RFC v2 8/8] mac80211: support VHT rates in TX info Johannes Berg
2012-11-09 20:21 ` VHT support, take 2 Johannes Berg
2012-11-15 12:09 ` Mahesh Palivela
2012-11-16 13:28 ` Johannes Berg
2012-11-16 14:57 ` Arend van Spriel
2012-11-17 0:10 ` Luis R. Rodriguez
2012-11-17 8:48 ` Johannes Berg
2012-11-17 23:34 ` Luis R. Rodriguez
2012-11-18 11:03 ` Johannes Berg
2012-11-18 11:05 ` Johannes Berg
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=50AA237F.4090102@posedge.com \
--to=maheshp@posedge.com \
--cc=johannes.berg@intel.com \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.