linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: p54spi - mesh mode summary
@ 2009-03-26 18:33 Christian Lamparter
  2009-03-27  1:55 ` Max Filippov
  0 siblings, 1 reply; 13+ messages in thread
From: Christian Lamparter @ 2009-03-26 18:33 UTC (permalink / raw)
  To: Max Filippov; +Cc: Johannes Berg, linux-wireless

rmgl... looks like the first mail got lost... so _resend_

On Thursday 26 March 2009 16:15:24 Max Filippov wrote:
> >> 3) Beaconing works, but not the way it should: like MPs don't hear=
 each other. Timestamps never get in sync
> >> and both MPs issue beacon during 0.1s beacon interval.
> >> I've seen it before, with stlc45xx. It shows when LMAC is set up w=
ith LMAC_SETUP_IBSS | LMAC_SETUP_TRANSPARENT flags.
> >> If there's no LMAC_SETUP_TRANSPARENT flag in LMAC setup then times=
tamps get in sync.
> >
> > FYI: The TSF will always reset when a new beacon is submitted to th=
e firmware.
> > The specs talks about that.
>=20
> I'd like to make it clear: there are timestamp field in the beacon an=
d
> timestamp associated with the received packet. These two do not
> correlate. First gets reset at beacon submission (and why firmware
> wouldn't pick up timestamp from the submitted beacon?). The second
> only gets reset on firmware reset. And it seems to me that there's no
> way to find out, what the current value of beacon timestamp is. TSF
> reported in p54_rx_data is the second.

because the hardware has at least 3 timers ;)
- One for the _mactime_ (as in rx_status.mactime)
  (of course, we can always drop RX_FLAG_TSFT flag.)
- the second one for beacon - (some firmware will fire a trap for every
  beacon they send P54_TRAP_BEACON_TX )
- and one is for the user. (which we don't need...)

> And if so, how timestamp syncing is expected to work in the following=
 case:
>=20
> <7>[  353.579189] RX beacon SA=3D00:1d:6e:9b:ee:6d
> BSSID=3D7e:2e:03:09:31:25 TSF=3D0x4aaa81 BCN=3D0x618f1f6 diff=3D-9740=
4789
> @1513
> <7>[  353.579250] wlan0: beacon TSF higher than local TSF - IBSS merg=
e
> with BSSID 7e:2e:03:09:31:25
>=20
> After which stack submit new beacon which we send to LMAC, effectivel=
y
> resetting timestamp in our beacon and not affecting TSF that we would
> report on the next received frame.
I know... p54 is does not really follow IBSS standard, but TSF sync is =
not a
"MUST" for IBSS.
http://wireless.kernel.org/en/developers/Documentation/mac80211/API

> I see constant beacon resubmission cycle. How does it work on pci/usb=
 p54?
firmware does it... all we need is to submit a beacon template. The fir=
mware
knows how to extract everything it needs (e.g intervals/dtim etc.)
out of the frame itself...

> >> - when LMAC was set up with LMAC_SETUP_TRANSPARENT flag firmware s=
eem to truncate last 2 bytes of the packet
> >> =A0 that it reports.
> > Heh, that's also a ISL3887 (USB 2nd gen) bug... But PCI devices are=
 not affected.
> > The reason "why" has probably to do with the firmware's frame align=
ment code.
> > Unfortunately the firmware for (ISL3887 and SPI) is rounding "down"=
 to 4 bytes instead of up...
> > So the FCS will be clipped... But fortunately the firmware set a bi=
t in the header that tells
> > us whenever the frames was corrupted or not (P54_HDR_FLAG_DATA_IN_F=
CS_GOOD).
> Thank you for the explanation, it made me feel much better (:
>=20
> > what happens if you change p54spi_rx the following way:?
> Actually, I did this kind of thing. And it works this way.
> But I considered it a major hack, as noone acknowledged that there's =
a
> firmware problem:
>=20
> https://garage.maemo.org/pipermail/stlc45xx-devel/2009-January/000126=
=2Ehtml
>=20
> But if there's real problem in firmware, I'd consider it mere
> workaround and put it back.
>=20
yes please do... And don't worry the frame which we'll pass to mac80211
will always have the correct length, even when the extra padding wasn't=
 used.

Regards,
	Chr
--
To unsubscribe from this list: send the line "unsubscribe linux-wireles=
s" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 13+ messages in thread
* Re: p54spi - mesh mode summary
@ 2009-03-26 12:49 Chunkeey
  2009-03-26 15:15 ` Max Filippov
  0 siblings, 1 reply; 13+ messages in thread
From: Chunkeey @ 2009-03-26 12:49 UTC (permalink / raw)
  To: Christian Lamparter, Max Filippov
  Cc: Johannes Berg, linux-wireless, John W. Linville

> 2) Today it doesn't reproduce. Plink establishment passes, altough, w=
arning remains:
>=20
> 3) Beaconing works, but not the way it should: like MPs don't hear ea=
ch other. Timestamps never get in sync
> and both MPs issue beacon during 0.1s beacon interval.
> I've seen it before, with stlc45xx. It shows when LMAC is set up with=
 LMAC_SETUP_IBSS | LMAC_SETUP_TRANSPARENT flags.
> If there's no LMAC_SETUP_TRANSPARENT flag in LMAC setup then timestam=
ps get in sync.

=46YI: The TSF will always reset when a new beacon is submitted to the =
firmware.
The specs talks about that.

> 4) Pings don't go, because MPs don't answer ARP requests sent to it. =
Haven't tested for the root cause yet.
> But again, I have seen this with stlc45xx with two different causes:
> - when LMAC was set up without LMAC_SETUP_TRANSPARENT flag, ARP reque=
sts didn't pass LMAC packet filter
>   and weren't reported to the driver;
Yup, that's because the firmware will filter out any frames which are n=
ot from/for the BSSID.
(the bssid the field right next to the device own MAC in p54_setup_mac)

> - when LMAC was set up with LMAC_SETUP_TRANSPARENT flag firmware seem=
 to truncate last 2 bytes of the packet
>   that it reports.
Heh, that's also a ISL3887 (USB 2nd gen) bug... But PCI devices are not=
 affected.
The reason "why" has probably to do with the firmware's frame alignment=
 code.
Unfortunately the firmware for (ISL3887 and SPI) is rounding "down" to =
4 bytes instead of up...
So the FCS will be clipped... But fortunately the firmware set a bit in=
 the header that tells
us whenever the frames was corrupted or not (P54_HDR_FLAG_DATA_IN_FCS_G=
OOD).

what happens if you change p54spi_rx the following way:?=20

-        skb =3D dev_alloc_skb(len);
+        skb =3D dev_alloc_skb(len + 4);
        if (!skb) {
                dev_err(&priv->spi->dev, "could not alloc skb");
                return 0;
        }

        p54spi_spi_read(priv, SPI_ADRS_DMA_DATA, skb_put(skb, len), len=
);
        p54spi_sleep(priv);

+      skb_put(skb, 4);=20
        if (p54_rx(priv->hw, skb) =3D=3D 0)
                dev_kfree_skb(skb);

=20
> > Is there anything else I can do, or something you want to know?
> Are there other p54 species that use 3826.arm firmware?
I guess no... there are pci/usb/spi and shmem devices but all have thei=
r own firmware.

> Are there other sources of information regarding LMAC interaction exc=
ept
> http://wireless.kernel.org/en/developers/Documentation/specs?action=3D=
AttachFile&do=3Dget&target=3DSTSW45x0C_LMAC_API_ED1P4.pdf ?

hmm, maybe the old islsm... But then, this driver is very old now...
=20
> Who should be contacted with questions about firmware behavior?
>=20
No idea, maybe nokia knows... because the "frame alignment" can also cl=
ip QoS-(Data) or WDS Frames.

Regards,
   Chr
____________________________________________________________________
Psssst! Schon vom neuen WEB.DE MultiMessenger geh=F6rt?=20
Der kann`s mit allen: http://www.produkte.web.de/messenger/?did=3D3124

--
To unsubscribe from this list: send the line "unsubscribe linux-wireles=
s" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 13+ messages in thread
* [PATCH 1/2] p54spi: mask value read from SPI_ADRS_DMA_WRITE_CTRL in p54spi_wait_bit
@ 2009-03-25  5:30 Max Filippov
  2009-03-25 13:42 ` [PATCH 2/2 v2] p54spi: fix p54spi_upload_firmware Christian Lamparter
  0 siblings, 1 reply; 13+ messages in thread
From: Max Filippov @ 2009-03-25  5:30 UTC (permalink / raw)
  To: linux-wireless; +Cc: Christian Lamparter, Max Filippov

 Mask value read from SPI_ADRS_DMA_WRITE_CTRL in p54spi_wait_bit.
 Without this, 'fw_upload not allowed to DMA write' is observed at both N800 and N810.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
---
 drivers/net/wireless/p54/p54spi.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/p54/p54spi.c b/drivers/net/wireless/p54/p54spi.c
index 2b222aa..d13268f 100644
--- a/drivers/net/wireless/p54/p54spi.c
+++ b/drivers/net/wireless/p54/p54spi.c
@@ -171,7 +171,7 @@ static int p54spi_wait_bit(struct p54s_priv *priv, u16 reg, __le32 bits)
 
 	for (i = 0; i < 2000; i++) {
 		p54spi_spi_read(priv, reg, &buffer, sizeof(buffer));
-		if (buffer == bits)
+		if ((buffer & bits) == bits)
 			return 1;
 
 		msleep(1);
-- 
1.5.4.3


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2009-03-30  4:38 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-26 18:33 p54spi - mesh mode summary Christian Lamparter
2009-03-27  1:55 ` Max Filippov
  -- strict thread matches above, loose matches on Subject: below --
2009-03-26 12:49 Chunkeey
2009-03-26 15:15 ` Max Filippov
2009-03-25  5:30 [PATCH 1/2] p54spi: mask value read from SPI_ADRS_DMA_WRITE_CTRL in p54spi_wait_bit Max Filippov
2009-03-25 13:42 ` [PATCH 2/2 v2] p54spi: fix p54spi_upload_firmware Christian Lamparter
2009-03-25 14:34   ` Christian Lamparter
2009-03-26  6:22     ` p54spi - mesh mode summary Max Filippov
2009-03-26  8:12       ` Johannes Berg
2009-03-27  5:03         ` Max Filippov
2009-03-27 14:06           ` Christian Lamparter
2009-03-28  3:21             ` Max Filippov
2009-03-28 21:51               ` Christian Lamparter
2009-03-29  4:41                 ` Max Filippov
2009-03-29 13:49                   ` Christian Lamparter
2009-03-30  4:38                     ` Max Filippov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).