aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2400pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2400pci.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2400pci.c40
1 files changed, 24 insertions, 16 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c
index 4c0538d6099..0107cec18b2 100644
--- a/drivers/net/wireless/rt2x00/rt2400pci.c
+++ b/drivers/net/wireless/rt2x00/rt2400pci.c
@@ -1404,7 +1404,7 @@ static int rt2400pci_init_eeprom(struct rt2x00_dev *rt2x00dev)
1404 * RF value list for RF2420 & RF2421 1404 * RF value list for RF2420 & RF2421
1405 * Supports: 2.4 GHz 1405 * Supports: 2.4 GHz
1406 */ 1406 */
1407static const struct rf_channel rf_vals_bg[] = { 1407static const struct rf_channel rf_vals_b[] = {
1408 { 1, 0x00022058, 0x000c1fda, 0x00000101, 0 }, 1408 { 1, 0x00022058, 0x000c1fda, 0x00000101, 0 },
1409 { 2, 0x00022058, 0x000c1fee, 0x00000101, 0 }, 1409 { 2, 0x00022058, 0x000c1fee, 0x00000101, 0 },
1410 { 3, 0x00022058, 0x000c2002, 0x00000101, 0 }, 1410 { 3, 0x00022058, 0x000c2002, 0x00000101, 0 },
@@ -1421,10 +1421,11 @@ static const struct rf_channel rf_vals_bg[] = {
1421 { 14, 0x00022058, 0x000c20fa, 0x00000101, 0 }, 1421 { 14, 0x00022058, 0x000c20fa, 0x00000101, 0 },
1422}; 1422};
1423 1423
1424static void rt2400pci_probe_hw_mode(struct rt2x00_dev *rt2x00dev) 1424static int rt2400pci_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
1425{ 1425{
1426 struct hw_mode_spec *spec = &rt2x00dev->spec; 1426 struct hw_mode_spec *spec = &rt2x00dev->spec;
1427 u8 *txpower; 1427 struct channel_info *info;
1428 char *tx_power;
1428 unsigned int i; 1429 unsigned int i;
1429 1430
1430 /* 1431 /*
@@ -1440,23 +1441,28 @@ static void rt2400pci_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
1440 EEPROM_MAC_ADDR_0)); 1441 EEPROM_MAC_ADDR_0));
1441 1442
1442 /* 1443 /*
1443 * Convert tx_power array in eeprom.
1444 */
1445 txpower = rt2x00_eeprom_addr(rt2x00dev, EEPROM_TXPOWER_START);
1446 for (i = 0; i < 14; i++)
1447 txpower[i] = TXPOWER_FROM_DEV(txpower[i]);
1448
1449 /*
1450 * Initialize hw_mode information. 1444 * Initialize hw_mode information.
1451 */ 1445 */
1452 spec->supported_bands = SUPPORT_BAND_2GHZ; 1446 spec->supported_bands = SUPPORT_BAND_2GHZ;
1453 spec->supported_rates = SUPPORT_RATE_CCK; 1447 spec->supported_rates = SUPPORT_RATE_CCK;
1454 spec->tx_power_a = NULL;
1455 spec->tx_power_bg = txpower;
1456 spec->tx_power_default = DEFAULT_TXPOWER;
1457 1448
1458 spec->num_channels = ARRAY_SIZE(rf_vals_bg); 1449 spec->num_channels = ARRAY_SIZE(rf_vals_b);
1459 spec->channels = rf_vals_bg; 1450 spec->channels = rf_vals_b;
1451
1452 /*
1453 * Create channel information array
1454 */
1455 info = kzalloc(spec->num_channels * sizeof(*info), GFP_KERNEL);
1456 if (!info)
1457 return -ENOMEM;
1458
1459 spec->channels_info = info;
1460
1461 tx_power = rt2x00_eeprom_addr(rt2x00dev, EEPROM_TXPOWER_START);
1462 for (i = 0; i < 14; i++)
1463 info[i].tx_power1 = TXPOWER_FROM_DEV(tx_power[i]);
1464
1465 return 0;
1460} 1466}
1461 1467
1462static int rt2400pci_probe_hw(struct rt2x00_dev *rt2x00dev) 1468static int rt2400pci_probe_hw(struct rt2x00_dev *rt2x00dev)
@@ -1477,7 +1483,9 @@ static int rt2400pci_probe_hw(struct rt2x00_dev *rt2x00dev)
1477 /* 1483 /*
1478 * Initialize hw specifications. 1484 * Initialize hw specifications.
1479 */ 1485 */
1480 rt2400pci_probe_hw_mode(rt2x00dev); 1486 retval = rt2400pci_probe_hw_mode(rt2x00dev);
1487 if (retval)
1488 return retval;
1481 1489
1482 /* 1490 /*
1483 * This device requires the atim queue and DMA-mapped skbs. 1491 * This device requires the atim queue and DMA-mapped skbs.