Commit 91581b62 authored by Ivo van Doorn's avatar Ivo van Doorn Committed by John W. Linville
Browse files

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: default avatarIvo van Doorn <IvDoorn@gmail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent ce292a64
...@@ -2230,7 +2230,8 @@ static int rt61pci_validate_eeprom(struct rt2x00_dev *rt2x00dev) ...@@ -2230,7 +2230,8 @@ static int rt61pci_validate_eeprom(struct rt2x00_dev *rt2x00dev)
if (word == 0xffff) { if (word == 0xffff) {
rt2x00_set_field16(&word, EEPROM_NIC_ENABLE_DIVERSITY, 0); rt2x00_set_field16(&word, EEPROM_NIC_ENABLE_DIVERSITY, 0);
rt2x00_set_field16(&word, EEPROM_NIC_TX_DIVERSITY, 0); rt2x00_set_field16(&word, EEPROM_NIC_TX_DIVERSITY, 0);
rt2x00_set_field16(&word, EEPROM_NIC_TX_RX_FIXED, 0); rt2x00_set_field16(&word, EEPROM_NIC_RX_FIXED, 0);
rt2x00_set_field16(&word, EEPROM_NIC_TX_FIXED, 0);
rt2x00_set_field16(&word, EEPROM_NIC_EXTERNAL_LNA_BG, 0); rt2x00_set_field16(&word, EEPROM_NIC_EXTERNAL_LNA_BG, 0);
rt2x00_set_field16(&word, EEPROM_NIC_CARDBUS_ACCEL, 0); rt2x00_set_field16(&word, EEPROM_NIC_CARDBUS_ACCEL, 0);
rt2x00_set_field16(&word, EEPROM_NIC_EXTERNAL_LNA_A, 0); rt2x00_set_field16(&word, EEPROM_NIC_EXTERNAL_LNA_A, 0);
...@@ -2374,24 +2375,10 @@ static int rt61pci_init_eeprom(struct rt2x00_dev *rt2x00dev) ...@@ -2374,24 +2375,10 @@ static int rt61pci_init_eeprom(struct rt2x00_dev *rt2x00dev)
*/ */
if (rt2x00_rf(&rt2x00dev->chip, RF2529) && if (rt2x00_rf(&rt2x00dev->chip, RF2529) &&
!test_bit(CONFIG_DOUBLE_ANTENNA, &rt2x00dev->flags)) { !test_bit(CONFIG_DOUBLE_ANTENNA, &rt2x00dev->flags)) {
switch (rt2x00_get_field16(eeprom, EEPROM_NIC_TX_RX_FIXED)) { rt2x00dev->default_ant.rx =
case 0: ANTENNA_A + rt2x00_get_field16(eeprom, EEPROM_NIC_RX_FIXED);
rt2x00dev->default_ant.tx = ANTENNA_B; rt2x00dev->default_ant.tx =
rt2x00dev->default_ant.rx = ANTENNA_A; ANTENNA_B - rt2x00_get_field16(eeprom, EEPROM_NIC_TX_FIXED);
break;
case 1:
rt2x00dev->default_ant.tx = ANTENNA_B;
rt2x00dev->default_ant.rx = ANTENNA_B;
break;
case 2:
rt2x00dev->default_ant.tx = ANTENNA_A;
rt2x00dev->default_ant.rx = ANTENNA_A;
break;
case 3:
rt2x00dev->default_ant.tx = ANTENNA_A;
rt2x00dev->default_ant.rx = ANTENNA_B;
break;
}
if (rt2x00_get_field16(eeprom, EEPROM_NIC_TX_DIVERSITY)) if (rt2x00_get_field16(eeprom, EEPROM_NIC_TX_DIVERSITY))
rt2x00dev->default_ant.tx = ANTENNA_SW_DIVERSITY; rt2x00dev->default_ant.tx = ANTENNA_SW_DIVERSITY;
......
...@@ -1190,7 +1190,8 @@ struct hw_pairwise_ta_entry { ...@@ -1190,7 +1190,8 @@ struct hw_pairwise_ta_entry {
#define EEPROM_NIC 0x0011 #define EEPROM_NIC 0x0011
#define EEPROM_NIC_ENABLE_DIVERSITY FIELD16(0x0001) #define EEPROM_NIC_ENABLE_DIVERSITY FIELD16(0x0001)
#define EEPROM_NIC_TX_DIVERSITY FIELD16(0x0002) #define EEPROM_NIC_TX_DIVERSITY FIELD16(0x0002)
#define EEPROM_NIC_TX_RX_FIXED FIELD16(0x000c) #define EEPROM_NIC_RX_FIXED FIELD16(0x0004)
#define EEPROM_NIC_TX_FIXED FIELD16(0x0008)
#define EEPROM_NIC_EXTERNAL_LNA_BG FIELD16(0x0010) #define EEPROM_NIC_EXTERNAL_LNA_BG FIELD16(0x0010)
#define EEPROM_NIC_CARDBUS_ACCEL FIELD16(0x0020) #define EEPROM_NIC_CARDBUS_ACCEL FIELD16(0x0020)
#define EEPROM_NIC_EXTERNAL_LNA_A FIELD16(0x0040) #define EEPROM_NIC_EXTERNAL_LNA_A FIELD16(0x0040)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment