aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJames Ketrenos <jketreno@linux.intel.com>2005-08-03 21:36:56 -0400
committerJames Ketrenos <jketreno@linux.intel.com>2005-11-07 18:50:32 -0500
commit4f36f8088ada6c63719a970616078887f82e226c (patch)
treed3d36c3f1c7d872db0ea583ed89470613ebe27d5 /drivers
parent2b184d5b5401bf87036cd0c2a0242fa5320129d7 (diff)
Added more useful geography encoding so people's experience with
iwconfig matches what their hardware can actually do in regard to supported channel maps, etc. Signed-off-by: James Ketrenos <jketreno@linux.intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/ipw2200.c279
1 files changed, 259 insertions, 20 deletions
diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c
index 073721f10577..6e79ae24ee1c 100644
--- a/drivers/net/wireless/ipw2200.c
+++ b/drivers/net/wireless/ipw2200.c
@@ -10374,28 +10374,256 @@ static int ipw_config(struct ipw_priv *priv)
10374 return -EIO; 10374 return -EIO;
10375} 10375}
10376 10376
10377static const struct ieee80211_geo ipw_geo = { 10377/*
10378 "---", 10378 * NOTE:
10379 .bg_channels = 11, 10379 *
10380 .bg = {{2412, 1}, {2417, 2}, {2422, 3}, 10380 * These tables have been tested in conjunction with the
10381 {2427, 4}, {2432, 5}, {2437, 6}, 10381 * Intel PRO/Wireless 2200BG and 2915ABG Network Connection Adapters.
10382 {2442, 7}, {2447, 8}, {2452, 9}, 10382 *
10383 {2457, 10}, {2462, 11}}, 10383 * Altering this values, using it on other hardware, or in geographies
10384 .a_channels = 8, 10384 * not intended for resale of the above mentioned Intel adapters has
10385 .a = {{5180, 36}, 10385 * not been tested.
10386 {5200, 40}, 10386 *
10387 {5220, 44}, 10387 */
10388 {5240, 48}, 10388static const struct ieee80211_geo ipw_geos[] = {
10389 {5260, 52, IEEE80211_CH_PASSIVE_ONLY}, 10389 { /* Restricted */
10390 {5280, 56, IEEE80211_CH_PASSIVE_ONLY}, 10390 "---",
10391 {5300, 60, IEEE80211_CH_PASSIVE_ONLY}, 10391 .bg_channels = 11,
10392 {5320, 64, IEEE80211_CH_PASSIVE_ONLY}}, 10392 .bg = {{2412, 1}, {2417, 2}, {2422, 3},
10393 {2427, 4}, {2432, 5}, {2437, 6},
10394 {2442, 7}, {2447, 8}, {2452, 9},
10395 {2457, 10}, {2462, 11}},
10396 },
10397
10398 { /* Custom US/Canada */
10399 "ZZF",
10400 .bg_channels = 11,
10401 .bg = {{2412, 1}, {2417, 2}, {2422, 3},
10402 {2427, 4}, {2432, 5}, {2437, 6},
10403 {2442, 7}, {2447, 8}, {2452, 9},
10404 {2457, 10}, {2462, 11}},
10405 .a_channels = 8,
10406 .a = {{5180, 36},
10407 {5200, 40},
10408 {5220, 44},
10409 {5240, 48},
10410 {5260, 52, IEEE80211_CH_PASSIVE_ONLY},
10411 {5280, 56, IEEE80211_CH_PASSIVE_ONLY},
10412 {5300, 60, IEEE80211_CH_PASSIVE_ONLY},
10413 {5320, 64, IEEE80211_CH_PASSIVE_ONLY}},
10414 },
10415
10416 { /* Rest of World */
10417 "ZZD",
10418 .bg_channels = 13,
10419 .bg = {{2412, 1}, {2417, 2}, {2422, 3},
10420 {2427, 4}, {2432, 5}, {2437, 6},
10421 {2442, 7}, {2447, 8}, {2452, 9},
10422 {2457, 10}, {2462, 11}, {2467, 12},
10423 {2472, 13}},
10424 },
10425
10426 { /* Custom USA & Europe & High */
10427 "ZZA",
10428 .bg_channels = 11,
10429 .bg = {{2412, 1}, {2417, 2}, {2422, 3},
10430 {2427, 4}, {2432, 5}, {2437, 6},
10431 {2442, 7}, {2447, 8}, {2452, 9},
10432 {2457, 10}, {2462, 11}},
10433 .a_channels = 13,
10434 .a = {{5180, 36},
10435 {5200, 40},
10436 {5220, 44},
10437 {5240, 48},
10438 {5260, 52, IEEE80211_CH_PASSIVE_ONLY},
10439 {5280, 56, IEEE80211_CH_PASSIVE_ONLY},
10440 {5300, 60, IEEE80211_CH_PASSIVE_ONLY},
10441 {5320, 64, IEEE80211_CH_PASSIVE_ONLY},
10442 {5745, 149},
10443 {5765, 153},
10444 {5785, 157},
10445 {5805, 161},
10446 {5825, 165}},
10447 },
10448
10449 { /* Custom NA & Europe */
10450 "ZZB",
10451 .bg_channels = 11,
10452 .bg = {{2412, 1}, {2417, 2}, {2422, 3},
10453 {2427, 4}, {2432, 5}, {2437, 6},
10454 {2442, 7}, {2447, 8}, {2452, 9},
10455 {2457, 10}, {2462, 11}},
10456 .a_channels = 13,
10457 .a = {{5180, 36},
10458 {5200, 40},
10459 {5220, 44},
10460 {5240, 48},
10461 {5260, 52, IEEE80211_CH_PASSIVE_ONLY},
10462 {5280, 56, IEEE80211_CH_PASSIVE_ONLY},
10463 {5300, 60, IEEE80211_CH_PASSIVE_ONLY},
10464 {5320, 64, IEEE80211_CH_PASSIVE_ONLY},
10465 {5745, 149, IEEE80211_CH_PASSIVE_ONLY},
10466 {5765, 153, IEEE80211_CH_PASSIVE_ONLY},
10467 {5785, 157, IEEE80211_CH_PASSIVE_ONLY},
10468 {5805, 161, IEEE80211_CH_PASSIVE_ONLY},
10469 {5825, 165, IEEE80211_CH_PASSIVE_ONLY}},
10470 },
10471
10472 { /* Custom Japan */
10473 "ZZC",
10474 .bg_channels = 11,
10475 .bg = {{2412, 1}, {2417, 2}, {2422, 3},
10476 {2427, 4}, {2432, 5}, {2437, 6},
10477 {2442, 7}, {2447, 8}, {2452, 9},
10478 {2457, 10}, {2462, 11}},
10479 .a_channels = 4,
10480 .a = {{5170, 34}, {5190, 38},
10481 {5210, 42}, {5230, 46}},
10482 },
10483
10484 { /* Custom */
10485 "ZZM",
10486 .bg_channels = 11,
10487 .bg = {{2412, 1}, {2417, 2}, {2422, 3},
10488 {2427, 4}, {2432, 5}, {2437, 6},
10489 {2442, 7}, {2447, 8}, {2452, 9},
10490 {2457, 10}, {2462, 11}},
10491 },
10492
10493 { /* Europe */
10494 "ZZE",
10495 .bg_channels = 13,
10496 .bg = {{2412, 1}, {2417, 2}, {2422, 3},
10497 {2427, 4}, {2432, 5}, {2437, 6},
10498 {2442, 7}, {2447, 8}, {2452, 9},
10499 {2457, 10}, {2462, 11}, {2467, 12},
10500 {2472, 13}},
10501 .a_channels = 19,
10502 .a = {{5180, 36},
10503 {5200, 40},
10504 {5220, 44},
10505 {5240, 48},
10506 {5260, 52, IEEE80211_CH_PASSIVE_ONLY},
10507 {5280, 56, IEEE80211_CH_PASSIVE_ONLY},
10508 {5300, 60, IEEE80211_CH_PASSIVE_ONLY},
10509 {5320, 64, IEEE80211_CH_PASSIVE_ONLY},
10510 {5500, 100, IEEE80211_CH_PASSIVE_ONLY},
10511 {5520, 104, IEEE80211_CH_PASSIVE_ONLY},
10512 {5540, 108, IEEE80211_CH_PASSIVE_ONLY},
10513 {5560, 112, IEEE80211_CH_PASSIVE_ONLY},
10514 {5580, 116, IEEE80211_CH_PASSIVE_ONLY},
10515 {5600, 120, IEEE80211_CH_PASSIVE_ONLY},
10516 {5620, 124, IEEE80211_CH_PASSIVE_ONLY},
10517 {5640, 128, IEEE80211_CH_PASSIVE_ONLY},
10518 {5660, 132, IEEE80211_CH_PASSIVE_ONLY},
10519 {5680, 136, IEEE80211_CH_PASSIVE_ONLY},
10520 {5700, 140, IEEE80211_CH_PASSIVE_ONLY}},
10521 },
10522
10523 { /* Custom Japan */
10524 "ZZJ",
10525 .bg_channels = 14,
10526 .bg = {{2412, 1}, {2417, 2}, {2422, 3},
10527 {2427, 4}, {2432, 5}, {2437, 6},
10528 {2442, 7}, {2447, 8}, {2452, 9},
10529 {2457, 10}, {2462, 11}, {2467, 12},
10530 {2472, 13}, {2484, 14, IEEE80211_CH_B_ONLY}},
10531 .a_channels = 4,
10532 .a = {{5170, 34}, {5190, 38},
10533 {5210, 42}, {5230, 46}},
10534 },
10535
10536 { /* High Band */
10537 "ZZH",
10538 .bg_channels = 13,
10539 .bg = {{2412, 1}, {2417, 2}, {2422, 3},
10540 {2427, 4}, {2432, 5}, {2437, 6},
10541 {2442, 7}, {2447, 8}, {2452, 9},
10542 {2457, 10}, {2462, 11},
10543 {2467, 12, IEEE80211_CH_PASSIVE_ONLY},
10544 {2472, 13, IEEE80211_CH_PASSIVE_ONLY}},
10545 .a_channels = 4,
10546 .a = {{5745, 149}, {5765, 153},
10547 {5785, 157}, {5805, 161}},
10548 },
10549
10550 { /* Custom Europe */
10551 "ZZG",
10552 .bg_channels = 13,
10553 .bg = {{2412, 1}, {2417, 2}, {2422, 3},
10554 {2427, 4}, {2432, 5}, {2437, 6},
10555 {2442, 7}, {2447, 8}, {2452, 9},
10556 {2457, 10}, {2462, 11},
10557 {2467, 12}, {2472, 13}},
10558 .a_channels = 4,
10559 .a = {{5180, 36}, {5200, 40},
10560 {5220, 44}, {5240, 48}},
10561 },
10562
10563 { /* Europe */
10564 "ZZK",
10565 .bg_channels = 13,
10566 .bg = {{2412, 1}, {2417, 2}, {2422, 3},
10567 {2427, 4}, {2432, 5}, {2437, 6},
10568 {2442, 7}, {2447, 8}, {2452, 9},
10569 {2457, 10}, {2462, 11},
10570 {2467, 12, IEEE80211_CH_PASSIVE_ONLY},
10571 {2472, 13, IEEE80211_CH_PASSIVE_ONLY}},
10572 .a_channels = 24,
10573 .a = {{5180, 36, IEEE80211_CH_PASSIVE_ONLY},
10574 {5200, 40, IEEE80211_CH_PASSIVE_ONLY},
10575 {5220, 44, IEEE80211_CH_PASSIVE_ONLY},
10576 {5240, 48, IEEE80211_CH_PASSIVE_ONLY},
10577 {5260, 52, IEEE80211_CH_PASSIVE_ONLY},
10578 {5280, 56, IEEE80211_CH_PASSIVE_ONLY},
10579 {5300, 60, IEEE80211_CH_PASSIVE_ONLY},
10580 {5320, 64, IEEE80211_CH_PASSIVE_ONLY},
10581 {5500, 100, IEEE80211_CH_PASSIVE_ONLY},
10582 {5520, 104, IEEE80211_CH_PASSIVE_ONLY},
10583 {5540, 108, IEEE80211_CH_PASSIVE_ONLY},
10584 {5560, 112, IEEE80211_CH_PASSIVE_ONLY},
10585 {5580, 116, IEEE80211_CH_PASSIVE_ONLY},
10586 {5600, 120, IEEE80211_CH_PASSIVE_ONLY},
10587 {5620, 124, IEEE80211_CH_PASSIVE_ONLY},
10588 {5640, 128, IEEE80211_CH_PASSIVE_ONLY},
10589 {5660, 132, IEEE80211_CH_PASSIVE_ONLY},
10590 {5680, 136, IEEE80211_CH_PASSIVE_ONLY},
10591 {5700, 140, IEEE80211_CH_PASSIVE_ONLY},
10592 {5745, 149, IEEE80211_CH_PASSIVE_ONLY},
10593 {5765, 153, IEEE80211_CH_PASSIVE_ONLY},
10594 {5785, 157, IEEE80211_CH_PASSIVE_ONLY},
10595 {5805, 161, IEEE80211_CH_PASSIVE_ONLY},
10596 {5825, 165, IEEE80211_CH_PASSIVE_ONLY}},
10597 },
10598
10599 { /* Europe */
10600 "ZZL",
10601 .bg_channels = 11,
10602 .bg = {{2412, 1}, {2417, 2}, {2422, 3},
10603 {2427, 4}, {2432, 5}, {2437, 6},
10604 {2442, 7}, {2447, 8}, {2452, 9},
10605 {2457, 10}, {2462, 11}},
10606 .a_channels = 13,
10607 .a = {{5180, 36, IEEE80211_CH_PASSIVE_ONLY},
10608 {5200, 40, IEEE80211_CH_PASSIVE_ONLY},
10609 {5220, 44, IEEE80211_CH_PASSIVE_ONLY},
10610 {5240, 48, IEEE80211_CH_PASSIVE_ONLY},
10611 {5260, 52, IEEE80211_CH_PASSIVE_ONLY},
10612 {5280, 56, IEEE80211_CH_PASSIVE_ONLY},
10613 {5300, 60, IEEE80211_CH_PASSIVE_ONLY},
10614 {5320, 64, IEEE80211_CH_PASSIVE_ONLY},
10615 {5745, 149, IEEE80211_CH_PASSIVE_ONLY},
10616 {5765, 153, IEEE80211_CH_PASSIVE_ONLY},
10617 {5785, 157, IEEE80211_CH_PASSIVE_ONLY},
10618 {5805, 161, IEEE80211_CH_PASSIVE_ONLY},
10619 {5825, 165, IEEE80211_CH_PASSIVE_ONLY}},
10620 }
10393}; 10621};
10394 10622
10395#define MAX_HW_RESTARTS 5 10623#define MAX_HW_RESTARTS 5
10396static int ipw_up(struct ipw_priv *priv) 10624static int ipw_up(struct ipw_priv *priv)
10397{ 10625{
10398 int rc, i; 10626 int rc, i, j;
10399 10627
10400 if (priv->status & STATUS_EXIT_PENDING) 10628 if (priv->status & STATUS_EXIT_PENDING)
10401 return -EIO; 10629 return -EIO;
@@ -10414,9 +10642,20 @@ static int ipw_up(struct ipw_priv *priv)
10414 eeprom_parse_mac(priv, priv->mac_addr); 10642 eeprom_parse_mac(priv, priv->mac_addr);
10415 memcpy(priv->net_dev->dev_addr, priv->mac_addr, ETH_ALEN); 10643 memcpy(priv->net_dev->dev_addr, priv->mac_addr, ETH_ALEN);
10416 10644
10417 memcpy(priv->country, &priv->eeprom[EEPROM_COUNTRY_CODE], 3); 10645 for (j = 0; j < ARRAY_SIZE(ipw_geos); j++) {
10418 priv->country[3] = '\0'; 10646 if (!memcmp(&priv->eeprom[EEPROM_COUNTRY_CODE],
10419 ieee80211_set_geo(priv->ieee, &ipw_geo); 10647 ipw_geos[j].name, 3))
10648 break;
10649 }
10650 if (j == ARRAY_SIZE(ipw_geos))
10651 j = 0;
10652 if (ieee80211_set_geo(priv->ieee, &ipw_geos[j])) {
10653 IPW_WARNING("Could not set geography.");
10654 return 0;
10655 }
10656
10657 IPW_DEBUG_INFO("Geography %03d [%s] detected.\n",
10658 j, priv->ieee->geo.name);
10420 10659
10421 if (priv->status & STATUS_RF_KILL_SW) { 10660 if (priv->status & STATUS_RF_KILL_SW) {
10422 IPW_WARNING("Radio disabled by module parameter.\n"); 10661 IPW_WARNING("Radio disabled by module parameter.\n");