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 | |
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')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt61pci.c | 25 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt61pci.h | 3 |
2 files changed, 8 insertions, 20 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; |
diff --git a/drivers/net/wireless/rt2x00/rt61pci.h b/drivers/net/wireless/rt2x00/rt61pci.h index 86590c6de0ef..cd86def8de53 100644 --- a/drivers/net/wireless/rt2x00/rt61pci.h +++ b/drivers/net/wireless/rt2x00/rt61pci.h | |||
@@ -1190,7 +1190,8 @@ struct hw_pairwise_ta_entry { | |||
1190 | #define EEPROM_NIC 0x0011 | 1190 | #define EEPROM_NIC 0x0011 |
1191 | #define EEPROM_NIC_ENABLE_DIVERSITY FIELD16(0x0001) | 1191 | #define EEPROM_NIC_ENABLE_DIVERSITY FIELD16(0x0001) |
1192 | #define EEPROM_NIC_TX_DIVERSITY FIELD16(0x0002) | 1192 | #define EEPROM_NIC_TX_DIVERSITY FIELD16(0x0002) |
1193 | #define EEPROM_NIC_TX_RX_FIXED FIELD16(0x000c) | 1193 | #define EEPROM_NIC_RX_FIXED FIELD16(0x0004) |
1194 | #define EEPROM_NIC_TX_FIXED FIELD16(0x0008) | ||
1194 | #define EEPROM_NIC_EXTERNAL_LNA_BG FIELD16(0x0010) | 1195 | #define EEPROM_NIC_EXTERNAL_LNA_BG FIELD16(0x0010) |
1195 | #define EEPROM_NIC_CARDBUS_ACCEL FIELD16(0x0020) | 1196 | #define EEPROM_NIC_CARDBUS_ACCEL FIELD16(0x0020) |
1196 | #define EEPROM_NIC_EXTERNAL_LNA_A FIELD16(0x0040) | 1197 | #define EEPROM_NIC_EXTERNAL_LNA_A FIELD16(0x0040) |