Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 130487
b: refs/heads/master
c: 615aab4
h: refs/heads/master
i:
  130485: af18425
  130483: ca7ed90
  130479: 51ff7a6
v: v3
  • Loading branch information
Luis R. Rodriguez authored and John W. Linville committed Jan 29, 2009
1 parent 538dfa1 commit 339dfd6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 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: 1f304e4e3bb161163d9f5bc3c6467a2a6fa9b3ae
refs/heads/master: 615aab4b75dfa77b00c372330d6f70edd2458bf9
30 changes: 19 additions & 11 deletions trunk/net/wireless/reg.c
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,7 @@ static struct ieee80211_regdomain *country_ie_2_rd(
* calculate the number of reg rules we will need. We will need one
* for each channel subband */
while (country_ie_len >= 3) {
int end_channel = 0;
struct ieee80211_country_ie_triplet *triplet =
(struct ieee80211_country_ie_triplet *) country_ie;
int cur_sub_max_channel = 0, cur_channel = 0;
Expand All @@ -509,9 +510,25 @@ static struct ieee80211_regdomain *country_ie_2_rd(
continue;
}

/* 2 GHz */
if (triplet->chans.first_channel <= 14)
end_channel = triplet->chans.first_channel +
triplet->chans.num_channels;
else
/*
* 5 GHz -- For example in country IEs if the first
* channel given is 36 and the number of channels is 4
* then the individual channel numbers defined for the
* 5 GHz PHY by these parameters are: 36, 40, 44, and 48
* and not 36, 37, 38, 39.
*
* See: http://tinyurl.com/11d-clarification
*/
end_channel = triplet->chans.first_channel +
(4 * (triplet->chans.num_channels - 1));

cur_channel = triplet->chans.first_channel;
cur_sub_max_channel = ieee80211_channel_to_frequency(
cur_channel + triplet->chans.num_channels);
cur_sub_max_channel = end_channel;

/* Basic sanity check */
if (cur_sub_max_channel < cur_channel)
Expand Down Expand Up @@ -590,15 +607,6 @@ static struct ieee80211_regdomain *country_ie_2_rd(
end_channel = triplet->chans.first_channel +
triplet->chans.num_channels;
else
/*
* 5 GHz -- For example in country IEs if the first
* channel given is 36 and the number of channels is 4
* then the individual channel numbers defined for the
* 5 GHz PHY by these parameters are: 36, 40, 44, and 48
* and not 36, 37, 38, 39.
*
* See: http://tinyurl.com/11d-clarification
*/
end_channel = triplet->chans.first_channel +
(4 * (triplet->chans.num_channels - 1));

Expand Down

0 comments on commit 339dfd6

Please sign in to comment.