Re: packet status error of sl811h with at76c503a based usb wlan adapter

[email protected]
Newsgroups gmane.linux.drivers.atmel-wlan
Message-ID <[email protected]>
Hi,
 
> because sl811 doesn't support DMA operation in host mode, I deleted the
> 'GFP_DMA' flag in kmalloc of ctx:

IMHO no need to do this, the GFP_DMA simply tells kmalloc to allocate
the buffer in a host memory region accessible for DMA. If the drivers
decides not to use DMA it will work fine.
 
> /*00268 in usbdfu.c, function dfu_alloc_ctx*/
> 	ctx = kmalloc(sizeof(struct dfu_ctx) + DFU_PACKETSIZE, GFP_KERNEL);
> //GFP_KERNEL|GFP_DMA IS CHANGED INTO GFP_KERNEL
> 
> So, I think the next line (00199 in usbdfu.c, function dfu_download_block)
> may not work:
> 
>    	memcpy(tmpbuf, buffer, bytes);

No, tmpbuf still points to memory of the host. This memcpy is needed, 
because some hosts (i386?) cannot DMA access all memory, but the
USB hc drivers requires the buffer to be accessible via DMA.
And the code makes no assumption about where the buffer input 
parameter points to, but copies its contents into DMA accessible area.

> Does this line means that data will transfered from at76c503 to ctx->buf?

It a simple memcpy between ordinary memory locations
in the host's addr space.

> If it is true, then errors will occur to my board, because transactions
> between arm cpu and sl811 are through a static address, (0x3605000 in my
> board). the sl811 has a data buffer of 240 bytes, and support "auto
address
> increment mode",if only the cpu countinuously read or write base address
> pointer of the data buffer.

But all this should be hidden inside the USB host controller driver !
Does usb_control_msg()  of your hc driver accept a input data buffer
longer than 240 byte (aka does the hc driver repeats the above
transactions for longer buffers) ?
If you are not sure, try to set DFU_PACKETSIZE in usbdfu.c below
240 (- some header ?).

/Jörg

-- 
COMPUTERBILD 15/03: Premium-e-mail-Dienste im Test
--------------------------------------------------
1. GMX TopMail - Platz 1 und Testsieger!
2. GMX ProMail - Platz 2 und Preis-Qualitätssieger!
3. Arcor - 4. web.de - 5. T-Online - 6. freenet.de - 7. daybyday - 8. e-Post
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.