aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/wireless/reg.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 5f6d20d98eeb..bc494cef2102 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -563,6 +563,7 @@ static struct ieee80211_regdomain *country_ie_2_rd(
563 563
564 /* This time around we fill in the rd */ 564 /* This time around we fill in the rd */
565 while (country_ie_len >= 3) { 565 while (country_ie_len >= 3) {
566 int end_channel = 0;
566 struct ieee80211_country_ie_triplet *triplet = 567 struct ieee80211_country_ie_triplet *triplet =
567 (struct ieee80211_country_ie_triplet *) country_ie; 568 (struct ieee80211_country_ie_triplet *) country_ie;
568 struct ieee80211_reg_rule *reg_rule = NULL; 569 struct ieee80211_reg_rule *reg_rule = NULL;
@@ -584,6 +585,23 @@ static struct ieee80211_regdomain *country_ie_2_rd(
584 585
585 reg_rule->flags = flags; 586 reg_rule->flags = flags;
586 587
588 /* 2 GHz */
589 if (triplet->chans.first_channel <= 14)
590 end_channel = triplet->chans.first_channel +
591 triplet->chans.num_channels;
592 else
593 /*
594 * 5 GHz -- For example in country IEs if the first
595 * channel given is 36 and the number of channels is 4
596 * then the individual channel numbers defined for the
597 * 5 GHz PHY by these parameters are: 36, 40, 44, and 48
598 * and not 36, 37, 38, 39.
599 *
600 * See: http://tinyurl.com/11d-clarification
601 */
602 end_channel = triplet->chans.first_channel +
603 (4 * (triplet->chans.num_channels - 1));
604
587 /* The +10 is since the regulatory domain expects 605 /* The +10 is since the regulatory domain expects
588 * the actual band edge, not the center of freq for 606 * the actual band edge, not the center of freq for
589 * its start and end freqs, assuming 20 MHz bandwidth on 607 * its start and end freqs, assuming 20 MHz bandwidth on
@@ -593,8 +611,7 @@ static struct ieee80211_regdomain *country_ie_2_rd(
593 triplet->chans.first_channel) - 10); 611 triplet->chans.first_channel) - 10);
594 freq_range->end_freq_khz = 612 freq_range->end_freq_khz =
595 MHZ_TO_KHZ(ieee80211_channel_to_frequency( 613 MHZ_TO_KHZ(ieee80211_channel_to_frequency(
596 triplet->chans.first_channel + 614 end_channel) + 10);
597 triplet->chans.num_channels) + 10);
598 615
599 /* Large arbitrary values, we intersect later */ 616 /* Large arbitrary values, we intersect later */
600 /* Increment this if we ever support >= 40 MHz channels 617 /* Increment this if we ever support >= 40 MHz channels