From: Johannes Berg <johannes@sipsolutions.net>
To: "Luis R. Rodriguez" <lrodriguez@atheros.com>
Cc: linville@tuxdriver.com, linux-wireless@vger.kernel.org
Subject: Re: [PATCH 2/6] cfg80211: make handle_band() and handle_channel() wiphy specific
Date: Thu, 08 Jan 2009 13:58:49 +0100 [thread overview]
Message-ID: <1231419529.3685.2.camel@johannes> (raw)
In-Reply-To: <1231379017-28363-3-git-send-email-lrodriguez@atheros.com>
[-- Attachment #1: Type: text/plain, Size: 2430 bytes --]
On Wed, 2009-01-07 at 17:43 -0800, Luis R. Rodriguez wrote:
> This allows us to make more wiphy specific judgements when
> handling the channels later on.
>
> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
> ---
> net/wireless/reg.c | 25 +++++++++++++++++++------
> 1 files changed, 19 insertions(+), 6 deletions(-)
>
> diff --git a/net/wireless/reg.c b/net/wireless/reg.c
> index 2f2ba92..87b3011 100644
> --- a/net/wireless/reg.c
> +++ b/net/wireless/reg.c
> @@ -778,13 +778,22 @@ static int freq_reg_info(u32 center_freq, u32 *bandwidth,
> return !max_bandwidth;
> }
>
> -static void handle_channel(struct ieee80211_channel *chan)
> +static void handle_channel(struct wiphy *wiphy, enum ieee80211_band band,
> + unsigned int chan_idx)
> {
> int r;
> - u32 flags = chan->orig_flags;
> + u32 flags;
> u32 max_bandwidth = 0;
> const struct ieee80211_reg_rule *reg_rule = NULL;
> const struct ieee80211_power_rule *power_rule = NULL;
> + struct ieee80211_supported_band *sband;
> + struct ieee80211_channel *chan;
> +
> + sband = wiphy->bands[band];
> + BUG_ON(chan_idx >= sband->n_channels);
> + chan = &sband->channels[chan_idx];
> +
> + flags = chan->orig_flags;
>
> r = freq_reg_info(MHZ_TO_KHZ(chan->center_freq),
> &max_bandwidth, ®_rule);
> @@ -808,12 +817,16 @@ static void handle_channel(struct ieee80211_channel *chan)
> chan->max_power = (int) MBM_TO_DBM(power_rule->max_eirp);
> }
>
> -static void handle_band(struct ieee80211_supported_band *sband)
> +static void handle_band(struct wiphy *wiphy, enum ieee80211_band band)
> {
> - int i;
> + unsigned int i;
> + struct ieee80211_supported_band *sband;
> +
> + BUG_ON(!wiphy->bands[band]);
> + sband = wiphy->bands[band];
>
> for (i = 0; i < sband->n_channels; i++)
> - handle_channel(&sband->channels[i]);
> + handle_channel(wiphy, band, i);
> }
>
> static bool ignore_reg_update(struct wiphy *wiphy, enum reg_set_by setby)
> @@ -840,7 +853,7 @@ void wiphy_update_regulatory(struct wiphy *wiphy, enum reg_set_by setby)
> enum ieee80211_band band;
> for (band = 0; band < IEEE80211_NUM_BANDS; band++) {
> if (wiphy->bands[band])
> - handle_band(wiphy->bands[band]);
> + handle_band(wiphy, band);
> }
> if (wiphy->reg_notifier)
> wiphy->reg_notifier(wiphy, setby);
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2009-01-08 12:57 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-08 1:43 [PATCH 0/6] cfg80211: few fixes and adds support for multiple reg hints Luis R. Rodriguez
2009-01-08 1:43 ` [PATCH 1/6] cfg80211: call reg_notifier() once Luis R. Rodriguez
2009-01-08 1:43 ` [PATCH 2/6] cfg80211: make handle_band() and handle_channel() wiphy specific Luis R. Rodriguez
2009-01-08 1:43 ` [PATCH 3/6] cfg80211: allow multiple driver regulatory_hints() Luis R. Rodriguez
2009-01-08 1:43 ` [PATCH 4/6] cfg80211: fix typo on message after intersection Luis R. Rodriguez
2009-01-08 1:43 ` [PATCH 5/6] cfg80211: Fix regression with 11d on bands Luis R. Rodriguez
2009-01-08 1:43 ` [PATCH 6/6] cfg80211: Fix parsed country IE info for 5 GHz Luis R. Rodriguez
2009-01-08 13:04 ` Johannes Berg
2009-01-08 13:03 ` [PATCH 5/6] cfg80211: Fix regression with 11d on bands Johannes Berg
2009-01-08 13:00 ` [PATCH 4/6] cfg80211: fix typo on message after intersection Johannes Berg
2009-01-08 12:59 ` [PATCH 3/6] cfg80211: allow multiple driver regulatory_hints() Johannes Berg
2009-01-08 12:58 ` Johannes Berg [this message]
2009-01-08 12:58 ` [PATCH 1/6] cfg80211: call reg_notifier() once 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=1231419529.3685.2.camel@johannes \
--to=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=lrodriguez@atheros.com \
/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