2009-01-27 18:31:36

by Larry Finger

[permalink] [raw]
Subject: [PATCH V2] rtl8187: Fix error in setting OFDM power settings for RTL8187L

After reports of poor performance, a review of the latest vendor driver
(rtl8187_linux_26.1025.0328.2007) for RTL8187L devices was undertaken.

A difference was found in the code used to index the OFDM power tables.=
When
the Linux driver was changed, my unit works at a much greater range tha=
n
before. I think this fixes Bugzilla #12380 and has been tested by at le=
ast
two other users.

Signed-off-by: Larry Finger <[email protected]>
Tested-by: Mart=C3=ADn Ernesto Barreyro <[email protected]>
Cc: Stable <[email protected]>
---

John,

This material should be included in 2.6.29. Although I have Cc'd stable=
, the
patch will need to be respun due to the file renaming.

Larry
---

Index: wireless-testing/drivers/net/wireless/rtl818x/rtl8187_rtl8225.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- wireless-testing.orig/drivers/net/wireless/rtl818x/rtl8187_rtl8225.=
c
+++ wireless-testing/drivers/net/wireless/rtl818x/rtl8187_rtl8225.c
@@ -285,7 +285,10 @@ static void rtl8225_rf_set_tx_power(stru
ofdm_power =3D priv->channels[channel - 1].hw_value >> 4;
=20
cck_power =3D min(cck_power, (u8)11);
- ofdm_power =3D min(ofdm_power, (u8)35);
+ if (ofdm_power > (u8)15)
+ ofdm_power =3D 25;
+ else
+ ofdm_power +=3D 10;
=20
rtl818x_iowrite8(priv, &priv->map->TX_GAIN_CCK,
rtl8225_tx_gain_cck_ofdm[cck_power / 6] >> 1);
@@ -536,7 +539,10 @@ static void rtl8225z2_rf_set_tx_power(st
cck_power +=3D priv->txpwr_base & 0xF;
cck_power =3D min(cck_power, (u8)35);
=20
- ofdm_power =3D min(ofdm_power, (u8)15);
+ if (ofdm_power > (u8)15)
+ ofdm_power =3D 25;
+ else
+ ofdm_power +=3D 10;
ofdm_power +=3D priv->txpwr_base >> 4;
ofdm_power =3D min(ofdm_power, (u8)35);
=20


2009-01-27 19:14:20

by Hin-Tak Leung

[permalink] [raw]
Subject: Re: [PATCH V2] rtl8187: Fix error in setting OFDM power settings for RTL8187L

--- On Tue, 27/1/09, Larry Finger <[email protected]> wrote:

> After reports of poor performance, a review of the latest
> vendor driver
> (rtl8187_linux_26.1025.0328.2007) for RTL8187L devices was
> undertaken.
>=20
> A difference was found in the code used to index the OFDM
> power tables. When
> the Linux driver was changed, my unit works at a much
> greater range than
> before. I think this fixes Bugzilla #12380 and has been
> tested by at least
> two other users.
>=20
> Signed-off-by: Larry Finger
> <[email protected]>
> Tested-by: Mart=EDn Ernesto Barreyro
> <[email protected]>
> Cc: Stable <[email protected]>

Acked-by; Hin-Tak Leung <[email protected]>

I think what this patch does is to bias the odfm power most of the time=
to the higher end of the acceptable range. (It is clipped to no bigger=
than the same old max at both places of modification).

Hin-Tak


=20