diff options
author | Ivo van Doorn <ivdoorn@gmail.com> | 2008-12-20 04:57:47 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-01-29 15:58:38 -0500 |
commit | 91581b627287d8cc3ee382ee038e04c4beca8176 (patch) | |
tree | 02ccf98e846e55885e1c906c46d318aef03e958b /drivers/net/wireless/rt2x00/rt61pci.c | |
parent | ce292a640228fded0d2e232216a19cba33e2cd0f (diff) |
rt2x00: Split EEPROM_NIC_TX_RX_FIXED
The 2 bits in EEPROM_NIC_TX_RX_FIXED each influence
a different antenna. We might as well split the
definition and directly read the correct bit.
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt61pci.c')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt61pci.c | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c index ed829879c941..875bcdcf6bc8 100644 --- a/drivers/net/wireless/rt2x00/rt61pci.c +++ b/drivers/net/wireless/rt2x00/rt61pci.c | |||
@@ -2230,7 +2230,8 @@ static int rt61pci_validate_eeprom(struct rt2x00_dev *rt2x00dev) | |||
2230 | if (word == 0xffff) { | 2230 | if (word == 0xffff) { |
2231 | rt2x00_set_field16(&word, EEPROM_NIC_ENABLE_DIVERSITY, 0); | 2231 | rt2x00_set_field16(&word, EEPROM_NIC_ENABLE_DIVERSITY, 0); |
2232 | rt2x00_set_field16(&word, EEPROM_NIC_TX_DIVERSITY, 0); | 2232 | rt2x00_set_field16(&word, EEPROM_NIC_TX_DIVERSITY, 0); |
2233 | rt2x00_set_field16(&word, EEPROM_NIC_TX_RX_FIXED, 0); | 2233 | rt2x00_set_field16(&word, EEPROM_NIC_RX_FIXED, 0); |
2234 | rt2x00_set_field16(&word, EEPROM_NIC_TX_FIXED, 0); | ||
2234 | rt2x00_set_field16(&word, EEPROM_NIC_EXTERNAL_LNA_BG, 0); | 2235 | rt2x00_set_field16(&word, EEPROM_NIC_EXTERNAL_LNA_BG, 0); |
2235 | rt2x00_set_field16(&word, EEPROM_NIC_CARDBUS_ACCEL, 0); | 2236 | rt2x00_set_field16(&word, EEPROM_NIC_CARDBUS_ACCEL, 0); |
2236 | rt2x00_set_field16(&word, EEPROM_NIC_EXTERNAL_LNA_A, 0); | 2237 | rt2x00_set_field16(&word, EEPROM_NIC_EXTERNAL_LNA_A, 0); |
@@ -2374,24 +2375,10 @@ static int rt61pci_init_eeprom(struct rt2x00_dev *rt2x00dev) | |||
2374 | */ | 2375 | */ |
2375 | if (rt2x00_rf(&rt2x00dev->chip, RF2529) && | 2376 | if (rt2x00_rf(&rt2x00dev->chip, RF2529) && |
2376 | !test_bit(CONFIG_DOUBLE_ANTENNA, &rt2x00dev->flags)) { | 2377 | !test_bit(CONFIG_DOUBLE_ANTENNA, &rt2x00dev->flags)) { |
2377 | switch (rt2x00_get_field16(eeprom, EEPROM_NIC_TX_RX_FIXED)) { | 2378 | rt2x00dev->default_ant.rx = |
2378 | case 0: | 2379 | ANTENNA_A + rt2x00_get_field16(eeprom, EEPROM_NIC_RX_FIXED); |
2379 | rt2x00dev->default_ant.tx = ANTENNA_B; | 2380 | rt2x00dev->default_ant.tx = |
2380 | rt2x00dev->default_ant.rx = ANTENNA_A; | 2381 | ANTENNA_B - rt2x00_get_field16(eeprom, EEPROM_NIC_TX_FIXED); |
2381 | break; | ||
2382 | case 1: | ||
2383 | rt2x00dev->default_ant.tx = ANTENNA_B; | ||
2384 | rt2x00dev->default_ant.rx = ANTENNA_B; | ||
2385 | break; | ||
2386 | case 2: | ||
2387 | rt2x00dev->default_ant.tx = ANTENNA_A; | ||
2388 | rt2x00dev->default_ant.rx = ANTENNA_A; | ||
2389 | break; | ||
2390 | case 3: | ||
2391 | rt2x00dev->default_ant.tx = ANTENNA_A; | ||
2392 | rt2x00dev->default_ant.rx = ANTENNA_B; | ||
2393 | break; | ||
2394 | } | ||
2395 | 2382 | ||
2396 | if (rt2x00_get_field16(eeprom, EEPROM_NIC_TX_DIVERSITY)) | 2383 | if (rt2x00_get_field16(eeprom, EEPROM_NIC_TX_DIVERSITY)) |
2397 | rt2x00dev->default_ant.tx = ANTENNA_SW_DIVERSITY; | 2384 | rt2x00dev->default_ant.tx = ANTENNA_SW_DIVERSITY; |