Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 130151
b: refs/heads/master
c: a92a3ce
h: refs/heads/master
i:
  130149: 38a8491
  130147: 333f1fa
  130143: ddb81a7
v: v3
  • Loading branch information
Luis R. Rodriguez authored and John W. Linville committed Jan 16, 2009
1 parent 6366ef5 commit 637e2f6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 73e1a65d3c4a013f6fa56e47133be95143a75fe3
refs/heads/master: a92a3ce72483d7f0902dff8a3be8cdcee215a37c
25 changes: 19 additions & 6 deletions trunk/net/wireless/reg.c
Original file line number Diff line number Diff line change
Expand Up @@ -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, &reg_rule);
Expand All @@ -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)
Expand All @@ -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);
}
Expand Down

0 comments on commit 637e2f6

Please sign in to comment.