[rt2x00-users] [PATCH] rt2x00: Fix beacon de-synchronization while update beacon (rt73usb)

Ivo van Doorn ivdoorn at gmail.com
Sat Aug 8 21:41:50 UTC 2009


On Monday 03 August 2009, Igor Perminov wrote:
> On Sat, 01/08/2009 at 15:21 +0200, Ivo van Doorn wrote:
> > Hi,
> > 
> > > When beacon is being updated to refresh TIM (AP mode), beacon frames are
> > > de-synchronizing (i.e. two neighbor beacon frames - before and after
> > > update - are being transmitted with a wrong time interval).
> > > That is because rt73usb_write_beacon should clear only
> > > TXRX_CSR9_BEACON_GEN flag, but not TXRX_CSR9_TSF_TICKING and
> > > TXRX_CSR9_TBTT_ENABLE.
> > 
> > Sorry for the late reply, after discovering that your mails are ending up
> > in my spambox I have now gone through the entire folder to see what
> > other mails were incorrectly marked as spam. :S
> > 
> > > Signed-off-by: Igor Perminov <igor.perminov at inbox.ru>
> > > ---
> > > diff -urN a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c
> > > --- a/drivers/net/wireless/rt2x00/rt73usb.c	2009-07-16 23:12:43.000000000 +0400
> > > +++ b/drivers/net/wireless/rt2x00/rt73usb.c	2009-07-23 00:56:07.000000000 +0400
> > > @@ -1545,8 +1545,6 @@
> > >  	 * otherwise we might be sending out invalid data.
> > >  	 */
> > >  	rt2x00usb_register_read(rt2x00dev, TXRX_CSR9, &reg);
> > > -	rt2x00_set_field32(&reg, TXRX_CSR9_TSF_TICKING, 0);
> > > -	rt2x00_set_field32(&reg, TXRX_CSR9_TBTT_ENABLE, 0);
> > >  	rt2x00_set_field32(&reg, TXRX_CSR9_BEACON_GEN, 0);
> > >  	rt2x00usb_register_write(rt2x00dev, TXRX_CSR9, reg);
> > 
> > Could you update this patch for the other drivers as well?
> > 
> > Thanks,
> > 
> > Ivo
> 
> Hi,
> 
> As for rt2400pci, rt2500pci, rt61pci and rt2800usb, beacon on/off code
> is almost the same and I can update the patch for these drivers easily.
> 
> And as for rt2500usb, this driver has an extra code in
> rt2500usb_kick_tx_queue (lines 6 - 14 in the code snippet below):
> 
>  1:	rt2500usb_register_read(rt2x00dev, TXRX_CSR19, &reg);
>  2:	if (!rt2x00_get_field16(reg, TXRX_CSR19_BEACON_GEN)) {
>  3:		rt2x00_set_field16(&reg, TXRX_CSR19_TSF_COUNT, 1);
>  4:		rt2x00_set_field16(&reg, TXRX_CSR19_TBCN, 1);
>  5:		rt2x00_set_field16(&reg, TXRX_CSR19_BEACON_GEN, 1);
>  6:		/*
>  7:		 * Beacon generation will fail initially.
>  8:		 * To prevent this we need to register the TXRX_CSR19
>  9:		 * register several times.
> 10:		 */
> 11:		rt2500usb_register_write(rt2x00dev, TXRX_CSR19, reg);
> 12:		rt2500usb_register_write(rt2x00dev, TXRX_CSR19, 0);
> 13:		rt2500usb_register_write(rt2x00dev, TXRX_CSR19, reg);
> 14:		rt2500usb_register_write(rt2x00dev, TXRX_CSR19, 0);
> 15:		rt2500usb_register_write(rt2x00dev, TXRX_CSR19, reg);
> 16:	}
> 
> This extra code will also de-synchronize beacon frames.
> 
> It is surprisingly, but my rt2500usb stick generates beacon frames fine
> even without this part of code, I've tested it.
> May be this was a workaround for some early version of a buggy rt2500usb
> hardware?

The Ralink code suggests that some models have problems, but so far
I haven't seen anybody with such a device. I suggest to only reset 
TXRX_CSR19_BEACON_GEN 3 times rather then resetting the entire register.

Thanks,

Ivo



More information about the users mailing list