Eight Bit
Hardcore Member
Funny how even though I don't get over 90% what is written, I find it quite interesting stuff to read
No problem with that, also making this public so that somebody else could help if they wish (and for possible future contributions for improving it).torpor said:I realize you're doing this on a volunteer basis notaz, and that there may be some frustration in having to explain yourself over and over - I'm sure the OP team have questions too - but in the interest of preparing to help with this situation once the hardware arrives, I hope you can pitch in with some details on this thread and we can get, at least for now, extra eyeballs on the problem ..
There was never such thing as binary blob driver (unless you count firmware that runs on chip, but it's always closed as on probably every other wifi device), that idea came from speculation on these boards I think. There was only driver source under NDA that MWeston got. Initially he had problems passing that to me as TI wanted company to sign the NDA, and I don't have one (I couldn't use my day job company for this for obvious reasons).torpor said:I just want to clear something up - which version of the driver are you basing this analysis on - the Android sources ported to 2.6.27, or something else? I am a bit confused about how the Android drivers came into this scenario and what the current test-base is .. Because as I see it there are the following 'versions' of the wl12xx drivers available:
* Original binary-blob only TI module (useless unless you boot their kernel, and then its only useful to verify operational ability of the hardware: so, not *totally* useless for end-users, but certainly it would put MWestons mind to rest if this driver worked 'okay'..)
..came out which after some comparison appeared to be mostly the same code as NDA code that MWeston had, only with BSD headers slapped on them. I could then get them to work with similar results we have today (slow speed, packet loss and such). That driver has a problem of not supporting Linux wireless stack and needs custom tools to start, connect, etc. It was then decided that hardware works ok and there were some issues with the driver that nobody wanted to look at as that code is not of the best quality.torpor said:* Android quick-hack drivers
When these came out DjWillis took them and got working. They appeared much better due to proper Linux wireless stack support. However he was getting some SDIO errors due to a problem I recently fixed, and the false "wifi does not work because of SDIO" claim was born.torpor said:* wl12xx drivers which appeared from 2.6.33
The plan is to only use 2.6.27 for the first release and move to newer kernels with firmware upgrades. This is the driver I currently use, I mostly use compat-wireless backport to .27, but I've tested it on 2.6.34-rc1 too.torpor said:* newer, updated drivers (which I see you're contributing to, actually, notaz .. interesting because I thought PandoraOS was currently 'frozen stuck' at 2.6.27) in 2.6.34-rc2 ..
Simple high level wget test is enough for me.torpor said:The symptoms are simple - slow transfer or packet loss on RX path mostly (TX is performing better).
What debug output does interest you? Loads of things can be logged by the driver, but none of them are really useful IMO.
Can you describe the test procedure here - are you doing ftp transfers or http, or do you have a netcat or arping test rig set up to move up from raw packets, ARP, UDP, TCP, etc?
Not sure how that will help, but if you give me exact test cases I have no problem running them.torpor said:If it would help I could rig up some test apps that send and receive raw packets from the Pandora to a Linux host and check things like CRC values, retry counts, etc. Or we could use the test tools from the portfwd package (udp_snd/udp_rcv) with a bit more inspection of the results to see if we can determine if the packet losses are happening due to CRC errors, retry/retransmission, frequency collision, etc.
No useful information there, all error counts are 0, I can give you exact output if wish but specify a test to run in that case.torpor said:The wl12xx driver can output the following variables to debugfs, and I would like to know, pretty much, everything it reports before, during, and after a transfer test using UDP:
It's quite simple - there's lots of ways to transfer data between peripherals (in this case the SD bus) and the memory that the CPU (OMAP3530) uses. One of these is for the CPU to go directly to the peripheral and pull the data across bit, byte or word at a time (depending on bus width). Another is to use DMA - Direct Memory Access. With DMA the SD bus controller writes the data you are wanting straight in to a block of main memory, without the CPU being used. This means you get the full benefit of the memory interface - with things like block or page transfers, full memory bus width transfers, etc...Eight Bit said:Funny how even though I don't get over 90% what is written, I find it quite interesting stuff to read
No useful information there, all error counts are 0, I can give you exact output if wish but specify a test to run in that case.
hdonk said:It's quite simple - there's lots of ways to transfer data between peripherals (in this case the SD bus) and the memory that the CPU (OMAP3530) uses. One of these is for the CPU to go directly to the peripheral and pull the data across bit, byte or word at a time (depending on bus width). Another is to use DMA - Direct Memory Access. With DMA the SD bus controller writes the data you are wanting straight in to a block of main memory, without the CPU being used. This means you get the full benefit of the memory interface - with things like block or page transfers, full memory bus width transfers, etc...
However when doing DMA you have to be very careful about how things are set up - such as how the CPU sees the memory that the peripheral is transferring to. Fer instance, if the memory is marked as cached by the CPU, when your device driver goes to access the block, it may think it is in cache already, and pull that version of data in, rather that the version that has been recently DMA'd in to the main memory. Also the peripheral is likely to be very tightly constrained in how it can write in to the memory, for instance only starting on word aligned boundaries.
All in all it means that accessing the peripheral by bit banging is a lot easier, but very very CPU intensive and slow. DMA is much much faster and more CPU efficient, but can be tricky to manage.
Reading quickly through that message exchange, it looks like they were finding that the WiFi device was working ok bit banging, and when they tried DMAs, they ended up having to get the alignment & DMA transfer length exactly right for it to work without errors.
Apologies for any mistakes in my explanation
It depends - if the problem being discussed on the mailing list referred to earlier is the same as on the Pandora, then no hardware problem - just a software one. We just need to wait and see what notaz, torpor and the others find. From past experiences debugging this kind of problem, the solution could pop out in the next day, or take months - if it's a software problem. From the information notaz has been posting here though, it is very plausibly software.Eight Bit said:Wouldn't that mean that there is no Hardware issue? As I understand from your explenation the chip is working properly but very CPU intensive but when switched to DMA to streamline the process things are screwed up?
Same here, sitting at work.torpor said:I'd write you a testsuite script for this, but I am at work right now and can't really do that .. but I think you get where I'm coming from here - the more data you can glean from debugfs during both of these netcat tests (null and random data), the better ..
The DMA problem discussed there was preventing driver to work completely, and SDIO irq problem was causing slowness. Neither applies here - DMA works as the driver works, SDIO irq is not used at all as we have GPIO line for this.hdonk said:It depends - if the problem being discussed on the mailing list referred to earlier is the same as on the Pandora, then no hardware problem - just a software one. We just need to wait and see what notaz, torpor and the others find.
In that case torpor seems to have the right idea - more data on where the problem is occurring according to the debug stats would help with the speculations If the low data rate is actually caused by error'd packets rather than a DMA transfer fault though... I can see why the hardware is under suspicion.notaz said:The DMA problem discussed there was preventing driver to work completely, and SDIO irq problem was causing slowness. Neither applies here - DMA works as the driver works, SDIO irq is not used at all as we have GPIO line for this.
torpor said:For the netcat, use UDP mode and dump 1k of /dev/null over the link. Then it might actually be useful to do it again, but dump 1k of /dev/random instead. During both tests, collect all data as above.
Rocking Horse Sh1t said:Have you tried switching it off and then back on again?
torpor said:No, it doesn't matter if its /dev/urandom or /dev/random - just *some* random data, either way, compared to a full-zero's test. The entropy doesn't matter - what matters is that its just different to a block of 000's ..
$ dd if=/dev/urandom bs=1kB count=1 of=/dev/null
1+0 records in
1+0 records out
1000 bytes (1.0 kB) copied, 0.000635833 s, 1.6 MB/s
$ dd if=/dev/random bs=1kB count=1 of=/dev/null
0+1 records in
0+1 records out
128 bytes (128 B) copied, 0.000229783 s, 557 kB/s
torpor said:The degree of entropy doesn't matter .. all that matters is that we have a source of random data with which to automate the testing.
You could dump a sufficient amount of random into an actual file, and then stream that file. Done this way, you can get highly random data that is also confirmable and repeatable.Alec said:Sorry if there's a misunderstanding, but that's exactly why I am saying that using /dev/random for that is bad idea - you're not going to get much data out of it! If all you need is a bunch of garbage data, use the fast pseudo-random /dev/urandom instead.
torpor said:Either way, the thing that matters is that a proper test harness is set up to use to get details about the performance of the driver .. I'll have a look at helping out with this later this evening.