[PATCH 13/24] RT2x00: Allow link tuning while scanning
>From Ivo van Doorn <[EMAIL PROTECTED]> rt2x00 does not know when we are scanning, unless passive_scan() is being used. For consistent behaviour we should not block tuning while scanning. We should however not tune the connection when it has been disabled in the hardware. Signed-off-by: Ivo van Doorn <[EMAIL PROTECTED]> --- diff -rU3 wireless-dev-newdev/drivers/net/wireless/d80211/rt2x00/rt2500pci.c wireless-dev-tuning/drivers/net/wireless/d80211/rt2x00/rt2500pci.c --- wireless-dev-newdev/drivers/net/wireless/d80211/rt2x00/rt2500pci.c 2006-07-23 22:41:58.0 +0200 +++ wireless-dev-tuning/drivers/net/wireless/d80211/rt2x00/rt2500pci.c 2006-07-23 22:59:00.0 +0200 @@ -811,9 +811,10 @@ u8 reg_r17; /* -* Don't perform any tuning during scan. +* Don't perform any tuning when it is disabled +* in the EEPROM. */ - if (rt2x00dev->scan) + if (GET_FLAG(rt2x00dev, CONFIG_DISABLE_BBP_TUNING)) return; rt2x00_register_read(rt2x00dev, CSR0, ®); @@ -2488,7 +2489,16 @@ SET_FLAG(rt2x00dev, DEVICE_SUPPORT_HW_BUTTON); /* -* 7 - Read BBP data from EEPROM and store in private structure. +* 7 - Check if the BBP tuning should be enabled. +*/ + rt2x00_eeprom_read(rt2x00dev, EEPROM_NIC, &eeprom); + if (eeprom == 0x) + eeprom = 0; + if (rt2x00_get_field16(eeprom, EEPROM_NIC_DYN_BBP_TUNE)) + SET_FLAG(rt2x00dev, CONFIG_DISABLE_BBP_TUNING); + + /* +* 8 - Read BBP data from EEPROM and store in private structure. */ rt2x00dev->eeprom = kzalloc(EEPROM_BBP_SIZE * sizeof(u16), GFP_KERNEL); if (!rt2x00dev->eeprom) diff -rU3 wireless-dev-newdev/drivers/net/wireless/d80211/rt2x00/rt2500usb.c wireless-dev-tuning/drivers/net/wireless/d80211/rt2x00/rt2500usb.c --- wireless-dev-newdev/drivers/net/wireless/d80211/rt2x00/rt2500usb.c 2006-07-23 22:42:03.0 +0200 +++ wireless-dev-tuning/drivers/net/wireless/d80211/rt2x00/rt2500usb.c 2006-07-23 23:00:43.0 +0200 @@ -617,15 +617,16 @@ */ static void rt2500usb_link_tuner(struct rt2x00_dev *rt2x00dev, char rssi) { - u16 reg; + u16 reg; u8 reg_r17; u8 up_bound; u8 low_bound; /* -* Don't perform any tuning during scan. +* Don't perform any tuning when it is disabled +* in the EEPROM. */ - if (rt2x00dev->scan) + if (GET_FLAG(rt2x00dev, CONFIG_DISABLE_BBP_TUNING)) return; low_bound = 0x32; @@ -2105,7 +2106,16 @@ EEPROM_ANTENNA_LED_MODE); /* -* 5 - Read BBP data from EEPROM and store in private structure. +* 5 - Check if the BBP tuning should be disabled. +*/ + rt2x00_eeprom_read(rt2x00dev, EEPROM_NIC, &eeprom); + if (eeprom == 0x) + eeprom = 0; + if (rt2x00_get_field16(eeprom, EEPROM_NIC_DYN_BBP_TUNE)) + SET_FLAG(rt2x00dev, CONFIG_DISABLE_BBP_TUNING); + + /* +* 6 - Read BBP data from EEPROM and store in private structure. */ rt2x00dev->eeprom = kzalloc(EEPROM_BBP_SIZE * sizeof(u16), GFP_KERNEL); if (!rt2x00dev->eeprom) diff -rU3 wireless-dev-newdev/drivers/net/wireless/d80211/rt2x00/rt61pci.c wireless-dev-tuning/drivers/net/wireless/d80211/rt2x00/rt61pci.c --- wireless-dev-newdev/drivers/net/wireless/d80211/rt2x00/rt61pci.c 2006-07-23 22:42:09.0 +0200 +++ wireless-dev-tuning/drivers/net/wireless/d80211/rt2x00/rt61pci.c 2006-07-23 23:04:25.0 +0200 @@ -1043,12 +1043,6 @@ u8 up_bound; u8 low_bound; - /* -* Don't perform any tuning during scan. -*/ - if (rt2x00dev->scan) - return; - if (rt2x00dev->rx_params.phymode == MODE_IEEE80211A) { up_bound = 0x48; low_bound = 0x28; diff -rU3 wireless-dev-newdev/drivers/net/wireless/d80211/rt2x00/rt73usb.c wireless-dev-tuning/drivers/net/wireless/d80211/rt2x00/rt73usb.c --- wireless-dev-newdev/drivers/net/wireless/d80211/rt2x00/rt73usb.c 2006-07-23 22:47:41.0 +0200 +++ wireless-dev-tuning/drivers/net/wireless/d80211/rt2x00/rt73usb.c 2006-07-23 23:04:31.0 +0200 @@ -757,12 +757,6 @@ u8 up_bound; u8 low_bound; - /* -* Don't perform any tuning during scan. -*/ - if (rt2x00dev->scan) - return; - if (rt2x00dev->rx_params.phymode == MODE_IEEE80211A) { up_bound = 0x48; low_bound = 0x28; - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 13/24] RT2x00: Allow link tuning while scanning
>From Ivo van Doorn <[EMAIL PROTECTED]> rt2x00 does not know when we are scanning, unless passive_scan() is being used. For consistent behaviour we should not block tuning while scanning. We should however not tune the connection when it has been disabled in the hardware. Signed-off-by: Ivo van Doorn <[EMAIL PROTECTED]> diff -rU3 wireless-dev-newdev/drivers/net/wireless/d80211/rt2x00/rt2500pci.c wireless-dev-tuning/drivers/net/wireless/d80211/rt2x00/rt2500pci.c --- wireless-dev-newdev/drivers/net/wireless/d80211/rt2x00/rt2500pci.c 2006-07-23 22:41:58.0 +0200 +++ wireless-dev-tuning/drivers/net/wireless/d80211/rt2x00/rt2500pci.c 2006-07-23 22:59:00.0 +0200 @@ -811,9 +811,10 @@ u8 reg_r17; /* -* Don't perform any tuning during scan. +* Don't perform any tuning when it is disabled +* in the EEPROM. */ - if (rt2x00dev->scan) + if (GET_FLAG(rt2x00dev, CONFIG_DISABLE_BBP_TUNING)) return; rt2x00_register_read(rt2x00dev, CSR0, ®); @@ -2488,7 +2489,16 @@ SET_FLAG(rt2x00dev, DEVICE_SUPPORT_HW_BUTTON); /* -* 7 - Read BBP data from EEPROM and store in private structure. +* 7 - Check if the BBP tuning should be enabled. +*/ + rt2x00_eeprom_read(rt2x00dev, EEPROM_NIC, &eeprom); + if (eeprom == 0x) + eeprom = 0; + if (rt2x00_get_field16(eeprom, EEPROM_NIC_DYN_BBP_TUNE)) + SET_FLAG(rt2x00dev, CONFIG_DISABLE_BBP_TUNING); + + /* +* 8 - Read BBP data from EEPROM and store in private structure. */ rt2x00dev->eeprom = kzalloc(EEPROM_BBP_SIZE * sizeof(u16), GFP_KERNEL); if (!rt2x00dev->eeprom) diff -rU3 wireless-dev-newdev/drivers/net/wireless/d80211/rt2x00/rt2500usb.c wireless-dev-tuning/drivers/net/wireless/d80211/rt2x00/rt2500usb.c --- wireless-dev-newdev/drivers/net/wireless/d80211/rt2x00/rt2500usb.c 2006-07-23 22:42:03.0 +0200 +++ wireless-dev-tuning/drivers/net/wireless/d80211/rt2x00/rt2500usb.c 2006-07-23 23:00:43.0 +0200 @@ -617,15 +617,16 @@ */ static void rt2500usb_link_tuner(struct rt2x00_dev *rt2x00dev, char rssi) { - u16 reg; + u16 reg; u8 reg_r17; u8 up_bound; u8 low_bound; /* -* Don't perform any tuning during scan. +* Don't perform any tuning when it is disabled +* in the EEPROM. */ - if (rt2x00dev->scan) + if (GET_FLAG(rt2x00dev, CONFIG_DISABLE_BBP_TUNING)) return; low_bound = 0x32; @@ -2105,7 +2106,16 @@ EEPROM_ANTENNA_LED_MODE); /* -* 5 - Read BBP data from EEPROM and store in private structure. +* 5 - Check if the BBP tuning should be disabled. +*/ + rt2x00_eeprom_read(rt2x00dev, EEPROM_NIC, &eeprom); + if (eeprom == 0x) + eeprom = 0; + if (rt2x00_get_field16(eeprom, EEPROM_NIC_DYN_BBP_TUNE)) + SET_FLAG(rt2x00dev, CONFIG_DISABLE_BBP_TUNING); + + /* +* 6 - Read BBP data from EEPROM and store in private structure. */ rt2x00dev->eeprom = kzalloc(EEPROM_BBP_SIZE * sizeof(u16), GFP_KERNEL); if (!rt2x00dev->eeprom) diff -rU3 wireless-dev-newdev/drivers/net/wireless/d80211/rt2x00/rt61pci.c wireless-dev-tuning/drivers/net/wireless/d80211/rt2x00/rt61pci.c --- wireless-dev-newdev/drivers/net/wireless/d80211/rt2x00/rt61pci.c 2006-07-23 22:42:09.0 +0200 +++ wireless-dev-tuning/drivers/net/wireless/d80211/rt2x00/rt61pci.c 2006-07-23 23:04:25.0 +0200 @@ -1043,12 +1043,6 @@ u8 up_bound; u8 low_bound; - /* -* Don't perform any tuning during scan. -*/ - if (rt2x00dev->scan) - return; - if (rt2x00dev->rx_params.phymode == MODE_IEEE80211A) { up_bound = 0x48; low_bound = 0x28; diff -rU3 wireless-dev-newdev/drivers/net/wireless/d80211/rt2x00/rt73usb.c wireless-dev-tuning/drivers/net/wireless/d80211/rt2x00/rt73usb.c --- wireless-dev-newdev/drivers/net/wireless/d80211/rt2x00/rt73usb.c 2006-07-23 22:47:41.0 +0200 +++ wireless-dev-tuning/drivers/net/wireless/d80211/rt2x00/rt73usb.c 2006-07-23 23:04:31.0 +0200 @@ -757,12 +757,6 @@ u8 up_bound; u8 low_bound; - /* -* Don't perform any tuning during scan. -*/ - if (rt2x00dev->scan) - return; - if (rt2x00dev->rx_params.phymode == MODE_IEEE80211A) { up_bound = 0x48; low_bound = 0x28; - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html