aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2009-01-29 18:27:47 -0500
committerDavid S. Miller <davem@davemloft.net>2009-01-29 18:27:47 -0500
commitae9e47e9e864bc5f0a7a7e71dc3f287196b3626b (patch)
tree08aac6bd0b77fb8a3936f120e87574cb32459d2d /net
parenta4e6db07984529847c6ad8bc616485e721dcb809 (diff)
parentbe0093705c3ce98d73cac0ca8f93ea105cdf4e9c (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6
Diffstat (limited to 'net')
-rw-r--r--net/wireless/reg.c32
1 files changed, 20 insertions, 12 deletions
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index bc494cef2102..85c9034c59b2 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -498,6 +498,7 @@ static struct ieee80211_regdomain *country_ie_2_rd(
498 * calculate the number of reg rules we will need. We will need one 498 * calculate the number of reg rules we will need. We will need one
499 * for each channel subband */ 499 * for each channel subband */
500 while (country_ie_len >= 3) { 500 while (country_ie_len >= 3) {
501 int end_channel = 0;
501 struct ieee80211_country_ie_triplet *triplet = 502 struct ieee80211_country_ie_triplet *triplet =
502 (struct ieee80211_country_ie_triplet *) country_ie; 503 (struct ieee80211_country_ie_triplet *) country_ie;
503 int cur_sub_max_channel = 0, cur_channel = 0; 504 int cur_sub_max_channel = 0, cur_channel = 0;
@@ -509,9 +510,25 @@ static struct ieee80211_regdomain *country_ie_2_rd(
509 continue; 510 continue;
510 } 511 }
511 512
513 /* 2 GHz */
514 if (triplet->chans.first_channel <= 14)
515 end_channel = triplet->chans.first_channel +
516 triplet->chans.num_channels;
517 else
518 /*
519 * 5 GHz -- For example in country IEs if the first
520 * channel given is 36 and the number of channels is 4
521 * then the individual channel numbers defined for the
522 * 5 GHz PHY by these parameters are: 36, 40, 44, and 48
523 * and not 36, 37, 38, 39.
524 *
525 * See: http://tinyurl.com/11d-clarification
526 */
527 end_channel = triplet->chans.first_channel +
528 (4 * (triplet->chans.num_channels - 1));
529
512 cur_channel = triplet->chans.first_channel; 530 cur_channel = triplet->chans.first_channel;
513 cur_sub_max_channel = ieee80211_channel_to_frequency( 531 cur_sub_max_channel = end_channel;
514 cur_channel + triplet->chans.num_channels);
515 532
516 /* Basic sanity check */ 533 /* Basic sanity check */
517 if (cur_sub_max_channel < cur_channel) 534 if (cur_sub_max_channel < cur_channel)
@@ -590,15 +607,6 @@ static struct ieee80211_regdomain *country_ie_2_rd(
590 end_channel = triplet->chans.first_channel + 607 end_channel = triplet->chans.first_channel +
591 triplet->chans.num_channels; 608 triplet->chans.num_channels;
592 else 609 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 + 610 end_channel = triplet->chans.first_channel +
603 (4 * (triplet->chans.num_channels - 1)); 611 (4 * (triplet->chans.num_channels - 1));
604 612
@@ -1276,7 +1284,7 @@ static void reg_country_ie_process_debug(
1276 if (intersected_rd) { 1284 if (intersected_rd) {
1277 printk(KERN_DEBUG "cfg80211: We intersect both of these " 1285 printk(KERN_DEBUG "cfg80211: We intersect both of these "
1278 "and get:\n"); 1286 "and get:\n");
1279 print_regdomain_info(rd); 1287 print_regdomain_info(intersected_rd);
1280 return; 1288 return;
1281 } 1289 }
1282 printk(KERN_DEBUG "cfg80211: Intersection between both failed\n"); 1290 printk(KERN_DEBUG "cfg80211: Intersection between both failed\n");