]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
rt2x00: Split EEPROM_NIC_TX_RX_FIXED
authorIvo van Doorn <ivdoorn@gmail.com>
Sat, 20 Dec 2008 09:57:47 +0000 (10:57 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 29 Jan 2009 20:58:38 +0000 (15:58 -0500)
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>
drivers/net/wireless/rt2x00/rt61pci.c
drivers/net/wireless/rt2x00/rt61pci.h

index ed829879c941af371f7618cc3408678af1ce7e0c..875bcdcf6bc878659c4cc05f31348d173b988b2d 100644 (file)
@@ -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;
index 86590c6de0ef39df9a951889b0e34c360ca673ad..cd86def8de53026c7bff753410ed60456122a981 100644 (file)
@@ -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)