[rt2x00-users] [PATCH v2] rt2x00: Enable fallback rates for rt61pci and rt73usb
Gertjan van Wingerde
gwingerde at gmail.com
Mon Jun 7 17:35:41 UTC 2010
On 06/07/10 18:43, Ivo Van Doorn wrote:
> Explicitly enable the usage of fallback rates for
> the transmission of frames with rt61pci and rt73usb hardware.
>
> Note that for txdone reporting, only rt61pci is capable of
> reporting the fallback rates, for USB it is not possible
> to determine the number of retries. However the device will
> use the fallback rates, so it might still help in the performance.
>
> Signed-off-by: Ivo van Doorn <IvDoorn at gmail.com>
> ---
> drivers/net/wireless/rt2x00/rt61pci.c | 17 +++++++++++++++++
> drivers/net/wireless/rt2x00/rt73usb.c | 3 +++
> 2 files changed, 20 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/net/wireless/rt2x00/rt61pci.c
> b/drivers/net/wireless/rt2x00/rt61pci.c
> index 243df08..ce87f16 100644
> --- a/drivers/net/wireless/rt2x00/rt61pci.c
> +++ b/drivers/net/wireless/rt2x00/rt61pci.c
> @@ -931,6 +931,9 @@ static void rt61pci_config_retry_limit(struct
> rt2x00_dev *rt2x00dev,
> u32 reg;
>
> rt2x00pci_register_read(rt2x00dev, TXRX_CSR4, ®);
> + rt2x00_set_field32(®, TXRX_CSR4_OFDM_TX_RATE_DOWN, 1);
> + rt2x00_set_field32(®, TXRX_CSR4_OFDM_TX_RATE_STEP, 0);
> + rt2x00_set_field32(®, TXRX_CSR4_OFDM_TX_FALLBACK_CCK, 0);
> rt2x00_set_field32(®, TXRX_CSR4_LONG_RETRY_LIMIT,
> libconf->conf->long_frame_max_tx_count);
> rt2x00_set_field32(®, TXRX_CSR4_SHORT_RETRY_LIMIT,
> @@ -2130,6 +2133,8 @@ static void rt61pci_txdone(struct rt2x00_dev *rt2x00dev)
> }
> txdesc.retry = rt2x00_get_field32(reg, STA_CSR4_RETRY_COUNT);
>
> + __set_bit(TXDONE_FALLBACK, &txdesc.flags);
> +
> rt2x00pci_txdone(entry, &txdesc);
> }
> }
Shouldn't we check whether actually a fallback rate was used, instead of simply
always indicating that a fallback rate was used? Or will retry be 0 if the original
requested rate was used?
> @@ -2587,6 +2592,18 @@ static int rt61pci_probe_hw_mode(struct
> rt2x00_dev *rt2x00dev)
> EEPROM_MAC_ADDR_0));
>
> /*
> + * As rt61 has a global fallback table we cannot specify
> + * more then one tx rate per frame but since the hw will
> + * try several rates (based on the fallback table) we should
> + * still initialize max_rates to the maximum number of rates
> + * we are going to try. Otherwise mac80211 will truncate our
> + * reported tx rates and the rc algortihm will end up with
> + * incorrect data.
> + */
> + rt2x00dev->hw->max_rates = 7;
> + rt2x00dev->hw->max_rate_tries = 1;
> +
> + /*
> * Initialize hw_mode information.
> */
> spec->supported_bands = SUPPORT_BAND_2GHZ;
> diff --git a/drivers/net/wireless/rt2x00/rt73usb.c
> b/drivers/net/wireless/rt2x00/rt73usb.c
> index 113ad69..d06d90f 100644
> --- a/drivers/net/wireless/rt2x00/rt73usb.c
> +++ b/drivers/net/wireless/rt2x00/rt73usb.c
> @@ -816,6 +816,9 @@ static void rt73usb_config_retry_limit(struct
> rt2x00_dev *rt2x00dev,
> u32 reg;
>
> rt2x00usb_register_read(rt2x00dev, TXRX_CSR4, ®);
> + rt2x00_set_field32(®, TXRX_CSR4_OFDM_TX_RATE_DOWN, 1);
> + rt2x00_set_field32(®, TXRX_CSR4_OFDM_TX_RATE_STEP, 0);
> + rt2x00_set_field32(®, TXRX_CSR4_OFDM_TX_FALLBACK_CCK, 0);
> rt2x00_set_field32(®, TXRX_CSR4_LONG_RETRY_LIMIT,
> libconf->conf->long_frame_max_tx_count);
> rt2x00_set_field32(®, TXRX_CSR4_SHORT_RETRY_LIMIT,
More information about the users
mailing list