[PATCH] rt2x00: Use enum defines
authorIvo van Doorn <ivdoorn@gmail.com>
Sat, 13 Oct 2007 14:26:18 +0000 (16:26 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 28 Jan 2008 23:02:50 +0000 (15:02 -0800)
When setting the default EEPROM values use
the values from the enums instead of "magic" values.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/wireless/rt2x00/rt2500pci.c
drivers/net/wireless/rt2x00/rt2500usb.c
drivers/net/wireless/rt2x00/rt61pci.c
drivers/net/wireless/rt2x00/rt73usb.c

index e66a9429fd48e6d8566fee2242dedc9e16a95263..4386823f49d185b1b9a93c91213bb34259a4ab3d 100644 (file)
@@ -1421,9 +1421,12 @@ static int rt2500pci_validate_eeprom(struct rt2x00_dev *rt2x00dev)
        rt2x00_eeprom_read(rt2x00dev, EEPROM_ANTENNA, &word);
        if (word == 0xffff) {
                rt2x00_set_field16(&word, EEPROM_ANTENNA_NUM, 2);
-               rt2x00_set_field16(&word, EEPROM_ANTENNA_TX_DEFAULT, 0);
-               rt2x00_set_field16(&word, EEPROM_ANTENNA_RX_DEFAULT, 0);
-               rt2x00_set_field16(&word, EEPROM_ANTENNA_LED_MODE, 0);
+               rt2x00_set_field16(&word, EEPROM_ANTENNA_TX_DEFAULT,
+                                  ANTENNA_SW_DIVERSITY);
+               rt2x00_set_field16(&word, EEPROM_ANTENNA_RX_DEFAULT,
+                                  ANTENNA_SW_DIVERSITY);
+               rt2x00_set_field16(&word, EEPROM_ANTENNA_LED_MODE,
+                                  LED_MODE_DEFAULT);
                rt2x00_set_field16(&word, EEPROM_ANTENNA_DYN_TXAGC, 0);
                rt2x00_set_field16(&word, EEPROM_ANTENNA_HARDWARE_RADIO, 0);
                rt2x00_set_field16(&word, EEPROM_ANTENNA_RF_TYPE, RF2522);
index 7d3e2828747a4574609fab2ccf2f4a6caa9bcb82..98edd621c13b0e26ec94aabb47152459e94fbe0c 100644 (file)
@@ -1163,9 +1163,12 @@ static int rt2500usb_validate_eeprom(struct rt2x00_dev *rt2x00dev)
        rt2x00_eeprom_read(rt2x00dev, EEPROM_ANTENNA, &word);
        if (word == 0xffff) {
                rt2x00_set_field16(&word, EEPROM_ANTENNA_NUM, 2);
-               rt2x00_set_field16(&word, EEPROM_ANTENNA_TX_DEFAULT, 0);
-               rt2x00_set_field16(&word, EEPROM_ANTENNA_RX_DEFAULT, 0);
-               rt2x00_set_field16(&word, EEPROM_ANTENNA_LED_MODE, 0);
+               rt2x00_set_field16(&word, EEPROM_ANTENNA_TX_DEFAULT,
+                                  ANTENNA_SW_DIVERSITY);
+               rt2x00_set_field16(&word, EEPROM_ANTENNA_RX_DEFAULT,
+                                  ANTENNA_SW_DIVERSITY);
+               rt2x00_set_field16(&word, EEPROM_ANTENNA_LED_MODE,
+                                  LED_MODE_DEFAULT);
                rt2x00_set_field16(&word, EEPROM_ANTENNA_DYN_TXAGC, 0);
                rt2x00_set_field16(&word, EEPROM_ANTENNA_HARDWARE_RADIO, 0);
                rt2x00_set_field16(&word, EEPROM_ANTENNA_RF_TYPE, RF2522);
index f893825ce6ddca2c5854e280c110ecbdff530fc9..83b95a675f0895e12b1e59525ddc2d627027301e 100644 (file)
@@ -1920,8 +1920,10 @@ static int rt61pci_validate_eeprom(struct rt2x00_dev *rt2x00dev)
        rt2x00_eeprom_read(rt2x00dev, EEPROM_ANTENNA, &word);
        if (word == 0xffff) {
                rt2x00_set_field16(&word, EEPROM_ANTENNA_NUM, 2);
-               rt2x00_set_field16(&word, EEPROM_ANTENNA_TX_DEFAULT, 2);
-               rt2x00_set_field16(&word, EEPROM_ANTENNA_RX_DEFAULT, 2);
+               rt2x00_set_field16(&word, EEPROM_ANTENNA_TX_DEFAULT,
+                                  ANTENNA_B);
+               rt2x00_set_field16(&word, EEPROM_ANTENNA_RX_DEFAULT,
+                                  ANTENNA_B);
                rt2x00_set_field16(&word, EEPROM_ANTENNA_FRAME_TYPE, 0);
                rt2x00_set_field16(&word, EEPROM_ANTENNA_DYN_TXAGC, 0);
                rt2x00_set_field16(&word, EEPROM_ANTENNA_HARDWARE_RADIO, 0);
index e4ff106f588e3c583ce9fad0a8571bd34b51af1e..96d85aaf4250d72ec6643e4876e5ba0e4b727516 100644 (file)
@@ -1391,8 +1391,10 @@ static int rt73usb_validate_eeprom(struct rt2x00_dev *rt2x00dev)
        rt2x00_eeprom_read(rt2x00dev, EEPROM_ANTENNA, &word);
        if (word == 0xffff) {
                rt2x00_set_field16(&word, EEPROM_ANTENNA_NUM, 2);
-               rt2x00_set_field16(&word, EEPROM_ANTENNA_TX_DEFAULT, 2);
-               rt2x00_set_field16(&word, EEPROM_ANTENNA_RX_DEFAULT, 2);
+               rt2x00_set_field16(&word, EEPROM_ANTENNA_TX_DEFAULT,
+                                  ANTENNA_B);
+               rt2x00_set_field16(&word, EEPROM_ANTENNA_RX_DEFAULT,
+                                  ANTENNA_B);
                rt2x00_set_field16(&word, EEPROM_ANTENNA_FRAME_TYPE, 0);
                rt2x00_set_field16(&word, EEPROM_ANTENNA_DYN_TXAGC, 0);
                rt2x00_set_field16(&word, EEPROM_ANTENNA_HARDWARE_RADIO, 0);