2007-11-16 22:20:06

by Edgar Toernig

[permalink] [raw]
Subject: [rtl8185] driver working but some probs

Hi,

[I'm new to wlan stuff - be kind to me if I did something
stupid ;-)]

I tried the rtl8180 driver Michael posted on 2007-10-14
( http://marc.info/?m=119238789630565 ). As he didn't
mentioned what kernel the patch was for I took a 2.6.24
snapshot from about two days ago (v2.6.24-rc2-409-g9418d5d).

There were two compile time problems: the MAC_ARG macro
was missing and the symbols from rtl8180_rtl8225.c clash
with those from rtl8187_rtl8225.c. One has to choose
either the rtl8187 driver or the rtl8180 driver.

After that, the driver works - mostly.

First thing I noticed: the reported "Link Signal Level"
from iwconfig was way off. It showed values around
-170 dBm when it was sitting directly beside the AP.
It was easy to fix:

- rx_status.ssi = (flags2 >> 8) & 0x7F;
+ rx_status.ssi = (flags2 >> 8) & 0xFF;

According to the 8180 datasheet, this field is 8 bit.

While I was there, I also added a check for the rate
field as the later indexed array isn't big enough for
a full 4 bit index:

rate = (flags >> 20) & 0xF;
+ if (rate > 11)
+ rate = 11;


Still, some problems remain:

First, bit rate almost immediately drops to 1 Mb/s
even if the card sits right beside the AP. Only
if I force both, card and AP, to a fixed bitrate do
I get reasonable performance (up to about 22 Mb/s,
giving ~1MByte/s payload rate - it seems the laptop
isn't faster; even on wired 100Mb/s ethernet I get
max 2 MByte/s throughput.).

Then, suspend doesn't work. The driver seems to
work but it won't see its AP any more. It *can*
see other APs, but not the one he is associated
with. rmmod/insmod is necessary.

With the last problem I'm not sure whether it's a
driver or a wpa_supplicant problem. I can't connect
to the AP if the ssid is hidden. wpa_supplicant stays
in SCANNING mode even though he already has the AP in
his scan list. Playing around with ap_scan=2 etc
doesn't seem to help. Any idea?

Anyway, many thanks for a basically working driver.
I hope it gets into mainline.

Ciao, ET.


2007-11-18 16:10:40

by Andrea Merello

[permalink] [raw]
Subject: Re: [rtl8185] driver working but some probs

> > First thing I noticed: the reported "Link Signal Level"
> > from iwconfig was way off. It showed values around
> > -170 dBm when it was sitting directly beside the AP.
> > It was easy to fix:
> >
> > - rx_status.ssi = (flags2 >> 8) & 0x7F;
> > + rx_status.ssi = (flags2 >> 8) & 0xFF;
> >
> > According to the 8180 datasheet, this field is 8 bit.
> >
> Ugh. The diagram (in the 8185 datasheet) shows that the rssi field is 7 bits
> long while the table after it says 8 bits, and the two figures disagree on a
> few other fields too. I'll fix that up..
>

True, the datasheet is not consistent.
However the last reference code I have from Realtek is

signal=((*(priv->rxringtail+1))& (0xff0000))>>16;
signal=(signal&0xfe)>>1; // Modify by hikaru 6.6
<snip>
if(!rtl8180_IsWirelessBMode(stats.rate) )
{ // OFDM rate.
if(signal>90)
signal=90;
else if(signal<25)
signal=25;
signal = (90-signal)*100/65;
}else{ // CCK rate.
if(signal>95)
signal = 95;
else if(signal<30)
signal = 30;
signal =(95-signal )*100/65;
}
priv->wstats.qual.level = signal;

Similar to rtl8187 this look at AGC, not RSSI, field to extract signal
strength information.

Andrea

2007-11-18 19:01:05

by Edgar Toernig

[permalink] [raw]
Subject: Re: [rtl8185] driver working but some probs

Michael Wu wrote:
>
> > and the symbols from rtl8180_rtl8225.c clash
> > with those from rtl8187_rtl8225.c. One has to choose
> > either the rtl8187 driver or the rtl8180 driver.
> >
> Are you compiling as modules or into the kernel? I have no
> problems building both as modules.

Directly into the kernel. I.e.: rtl8225_rf_set_channel
is defined in both files and produce link errors.

> > First thing I noticed: the reported "Link Signal Level"
> > from iwconfig was way off. It showed values around
> > -170 dBm when it was sitting directly beside the AP.
> > It was easy to fix:
> >
> > - rx_status.ssi = (flags2 >> 8) & 0x7F;
> > + rx_status.ssi = (flags2 >> 8) & 0xFF;
> >
> > According to the 8180 datasheet, this field is 8 bit.
> >
> Ugh. The diagram (in the 8185 datasheet) shows that the rssi field is 7 bits
> long while the table after it says 8 bits, and the two figures disagree on a
> few other fields too. I'll fix that up..

I only have the 8180 datasheet and there's no antenna flag.
At the moment the driver takes the MSB of the RSSI as the
antenna flag. It seems, something has changed from 8180
to 8185.

> > First, bit rate almost immediately drops to 1 Mb/s
> > even if the card sits right beside the AP. Only
> > if I force both, card and AP, to a fixed bitrate do
> > I get reasonable performance (up to about 22 Mb/s,
> > giving ~1MByte/s payload rate - it seems the laptop
> > isn't faster; even on wired 100Mb/s ethernet I get
> > max 2 MByte/s throughput.).
> >
> The rate control algorithm starts at 1 mbit and goes up with successful TXes.
> Try ping flooding (-f) your AP or doing a large file transfer and see if that
> gives the rate control enough information to push the speed up. It generally
> makes things settle around 18/24 mbit. (yes, mac80211 rate control needs to
> be improved)

Does not work. Once it's at 1 Mbps it won't go up again
(without force *g*).

> > Then, suspend doesn't work. The driver seems to
> > work but it won't see its AP any more. It *can*
> > see other APs, but not the one he is associated
> > with. rmmod/insmod is necessary.
> >
> Reassociation won't work?

Exactly. Nothing except rmmod/insmod works. Neither
ifdown/ifup nor manual reassoc via wpa_cli is enough.
As I said, after suspend an "iwlist scan" won't see
the AP any more and wpa_cli neither.

> > [AP with hidden SSID doesn't work]
> >
> This problem is related to mac80211 and wpa_supplicant. There have been some
> patches posted to address these.. I think wireless-2.6 has them. Try
> wireless-2.6 out.

I'll give it a try.

Thanks, ET.

2007-11-18 03:58:14

by Michael Wu

[permalink] [raw]
Subject: Re: [rtl8185] driver working but some probs

On Friday 16 November 2007 17:20:01 Edgar Toernig wrote:
> I tried the rtl8180 driver Michael posted on 2007-10-14
> ( http://marc.info/?m=119238789630565 ). As he didn't
> mentioned what kernel the patch was for I took a 2.6.24
> snapshot from about two days ago (v2.6.24-rc2-409-g9418d5d).
>
The driver has been merged in wireless-2.6 and will be picked up by -mm at
some point.

> There were two compile time problems: the MAC_ARG macro
> was missing
A patch was posted to fix that. The driver was against the wireless-2.6 tree
at the time of posting.

> and the symbols from rtl8180_rtl8225.c clash
> with those from rtl8187_rtl8225.c. One has to choose
> either the rtl8187 driver or the rtl8180 driver.
>
Are you compiling as modules or into the kernel? I have no problems building
both as modules.

> After that, the driver works - mostly.
>
> First thing I noticed: the reported "Link Signal Level"
> from iwconfig was way off. It showed values around
> -170 dBm when it was sitting directly beside the AP.
> It was easy to fix:
>
> - rx_status.ssi = (flags2 >> 8) & 0x7F;
> + rx_status.ssi = (flags2 >> 8) & 0xFF;
>
> According to the 8180 datasheet, this field is 8 bit.
>
Ugh. The diagram (in the 8185 datasheet) shows that the rssi field is 7 bits
long while the table after it says 8 bits, and the two figures disagree on a
few other fields too. I'll fix that up..

> First, bit rate almost immediately drops to 1 Mb/s
> even if the card sits right beside the AP. Only
> if I force both, card and AP, to a fixed bitrate do
> I get reasonable performance (up to about 22 Mb/s,
> giving ~1MByte/s payload rate - it seems the laptop
> isn't faster; even on wired 100Mb/s ethernet I get
> max 2 MByte/s throughput.).
>
The rate control algorithm starts at 1 mbit and goes up with successful TXes.
Try ping flooding (-f) your AP or doing a large file transfer and see if that
gives the rate control enough information to push the speed up. It generally
makes things settle around 18/24 mbit. (yes, mac80211 rate control needs to
be improved)

> Then, suspend doesn't work. The driver seems to
> work but it won't see its AP any more. It *can*
> see other APs, but not the one he is associated
> with. rmmod/insmod is necessary.
>
Reassociation won't work?

> With the last problem I'm not sure whether it's a
> driver or a wpa_supplicant problem. I can't connect
> to the AP if the ssid is hidden. wpa_supplicant stays
> in SCANNING mode even though he already has the AP in
> his scan list. Playing around with ap_scan=2 etc
> doesn't seem to help. Any idea?
>
This problem is related to mac80211 and wpa_supplicant. There have been some
patches posted to address these.. I think wireless-2.6 has them. Try
wireless-2.6 out. See http://linuxwireless.org/en/developers/git-guide for
information on pulling this tree.

Thanks for testing,
-Michael Wu


Attachments:
(No filename) (2.82 kB)
signature.asc (194.00 B)
This is a digitally signed message part.
Download all attachments

2007-11-18 19:21:00

by Edgar Toernig

[permalink] [raw]
Subject: Re: [rtl8185] driver working but some probs

Andrea Merello wrote:
>
> > > First thing I noticed: the reported "Link Signal Level"
> > > from iwconfig was way off. It showed values around
> > > -170 dBm when it was sitting directly beside the AP.
> > > It was easy to fix:
> > >
> > > - rx_status.ssi = (flags2 >> 8) & 0x7F;
> > > + rx_status.ssi = (flags2 >> 8) & 0xFF;
> > >
> > > According to the 8180 datasheet, this field is 8 bit.
> > >
> > Ugh. The diagram (in the 8185 datasheet) shows that the rssi field is 7 bits
> > long while the table after it says 8 bits, and the two figures disagree on a
> > few other fields too. I'll fix that up..

Maybe the 8185 changed it so that the LSB of the RSSI is now
the antenna flag? Just guessing though, I couldn't find an
8185 manual...

> True, the datasheet is not consistent.
> However the last reference code I have from Realtek is
>
> signal=((*(priv->rxringtail+1))& (0xff0000))>>16;
>[...]
> Similar to rtl8187 this look at AGC, not RSSI, field to extract signal
> strength information.

Hmm... there's no AGC field (16:23) in the 8180 doc.
It says 16:31 reserved.

> signal =(95-signal )*100/65;
> }
> priv->wstats.qual.level = signal;

What is the range of these fields anyway? Some seem
to be 0-255 (-256+x dBm?), some 0-65 (65 best?), some
0-100 (percent?).

Ciao, ET.