aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGertjan van Wingerde <gwingerde@gmail.com>2011-04-30 11:15:13 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-05-02 14:49:17 -0400
commit9328fdac499b969ec57a195845f168e7c5168ccd (patch)
tree976fca4e43892e0869174af7f7d5bc9dcdc826e8
parentd4c838ef5e5c2c7e205adf9e011d2e8bd6eae738 (diff)
rt2x00: Streamline rt2800 eeprom initialisations.
In rt2800lib.c the rt2800_init_eeprom function the same eeprom words were read multiple times, due to inefficient ordering of the eeprom checks. Reorder the checks so that each EEPROM word only has to be read once. Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/rt2x00/rt2800lib.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
index d79c8fd4113..71c16c618c4 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -3727,16 +3727,8 @@ int rt2800_init_eeprom(struct rt2x00_dev *rt2x00dev)
3727 } 3727 }
3728 3728
3729 /* 3729 /*
3730 * Read frequency offset and RF programming sequence. 3730 * Determine external LNA informations.
3731 */ 3731 */
3732 rt2x00_eeprom_read(rt2x00dev, EEPROM_FREQ, &eeprom);
3733 rt2x00dev->freq_offset = rt2x00_get_field16(eeprom, EEPROM_FREQ_OFFSET);
3734
3735 /*
3736 * Read external LNA informations.
3737 */
3738 rt2x00_eeprom_read(rt2x00dev, EEPROM_NIC_CONF1, &eeprom);
3739
3740 if (rt2x00_get_field16(eeprom, EEPROM_NIC_CONF1_EXTERNAL_LNA_5G)) 3732 if (rt2x00_get_field16(eeprom, EEPROM_NIC_CONF1_EXTERNAL_LNA_5G))
3741 __set_bit(CAPABILITY_EXTERNAL_LNA_A, &rt2x00dev->cap_flags); 3733 __set_bit(CAPABILITY_EXTERNAL_LNA_A, &rt2x00dev->cap_flags);
3742 if (rt2x00_get_field16(eeprom, EEPROM_NIC_CONF1_EXTERNAL_LNA_2G)) 3734 if (rt2x00_get_field16(eeprom, EEPROM_NIC_CONF1_EXTERNAL_LNA_2G))
@@ -3749,6 +3741,12 @@ int rt2800_init_eeprom(struct rt2x00_dev *rt2x00dev)
3749 __set_bit(CAPABILITY_HW_BUTTON, &rt2x00dev->cap_flags); 3741 __set_bit(CAPABILITY_HW_BUTTON, &rt2x00dev->cap_flags);
3750 3742
3751 /* 3743 /*
3744 * Read frequency offset and RF programming sequence.
3745 */
3746 rt2x00_eeprom_read(rt2x00dev, EEPROM_FREQ, &eeprom);
3747 rt2x00dev->freq_offset = rt2x00_get_field16(eeprom, EEPROM_FREQ_OFFSET);
3748
3749 /*
3752 * Store led settings, for correct led behaviour. 3750 * Store led settings, for correct led behaviour.
3753 */ 3751 */
3754#ifdef CONFIG_RT2X00_LIB_LEDS 3752#ifdef CONFIG_RT2X00_LIB_LEDS
@@ -3756,7 +3754,7 @@ int rt2800_init_eeprom(struct rt2x00_dev *rt2x00dev)
3756 rt2800_init_led(rt2x00dev, &rt2x00dev->led_assoc, LED_TYPE_ASSOC); 3754 rt2800_init_led(rt2x00dev, &rt2x00dev->led_assoc, LED_TYPE_ASSOC);
3757 rt2800_init_led(rt2x00dev, &rt2x00dev->led_qual, LED_TYPE_QUALITY); 3755 rt2800_init_led(rt2x00dev, &rt2x00dev->led_qual, LED_TYPE_QUALITY);
3758 3756
3759 rt2x00_eeprom_read(rt2x00dev, EEPROM_FREQ, &rt2x00dev->led_mcu_reg); 3757 rt2x00dev->led_mcu_reg = eeprom;
3760#endif /* CONFIG_RT2X00_LIB_LEDS */ 3758#endif /* CONFIG_RT2X00_LIB_LEDS */
3761 3759
3762 /* 3760 /*