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>
This commit is contained in:
parent
ce292a6402
commit
91581b6272
@ -2230,7 +2230,8 @@ static int rt61pci_validate_eeprom(struct rt2x00_dev *rt2x00dev)
|
||||
if (word == 0xffff) {
|
||||
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_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_CARDBUS_ACCEL, 0);
|
||||
rt2x00_set_field16(&word, EEPROM_NIC_EXTERNAL_LNA_A, 0);
|
||||
@ -2374,24 +2375,10 @@ static int rt61pci_init_eeprom(struct rt2x00_dev *rt2x00dev)
|
||||
*/
|
||||
if (rt2x00_rf(&rt2x00dev->chip, RF2529) &&
|
||||
!test_bit(CONFIG_DOUBLE_ANTENNA, &rt2x00dev->flags)) {
|
||||
switch (rt2x00_get_field16(eeprom, EEPROM_NIC_TX_RX_FIXED)) {
|
||||
case 0:
|
||||
rt2x00dev->default_ant.tx = ANTENNA_B;
|
||||
rt2x00dev->default_ant.rx = ANTENNA_A;
|
||||
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;
|
||||
}
|
||||
rt2x00dev->default_ant.rx =
|
||||
ANTENNA_A + rt2x00_get_field16(eeprom, EEPROM_NIC_RX_FIXED);
|
||||
rt2x00dev->default_ant.tx =
|
||||
ANTENNA_B - rt2x00_get_field16(eeprom, EEPROM_NIC_TX_FIXED);
|
||||
|
||||
if (rt2x00_get_field16(eeprom, EEPROM_NIC_TX_DIVERSITY))
|
||||
rt2x00dev->default_ant.tx = ANTENNA_SW_DIVERSITY;
|
||||
|
@ -1190,7 +1190,8 @@ struct hw_pairwise_ta_entry {
|
||||
#define EEPROM_NIC 0x0011
|
||||
#define EEPROM_NIC_ENABLE_DIVERSITY FIELD16(0x0001)
|
||||
#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_CARDBUS_ACCEL FIELD16(0x0020)
|
||||
#define EEPROM_NIC_EXTERNAL_LNA_A FIELD16(0x0040)
|
||||
|
Loading…
Reference in New Issue
Block a user