David Brownell wrote:
> 
> I think I've got the answers to my questions now, and
> DaveM provided some info for DMA-mapping.txt
> to help make sure other folk get them too.
> 
> For USB device drivers:
> 
> - Buffers in URBs don't need to be aligned.  This is
>   for data transfer buffers, also control setup packets.
> 
> - However the data buffers need to be allocated
>   using __get_free_pages() or something using it
>   (kmalloc, kmem_cache, skb_alloc, ...).
I lifted the following code from someones driver for the CATC driver.

#define ALIGN(x)                x __attribute__((aligned(L1_CACHE_BYTES)))

        __u8                    ALIGN(tx_buf[USB_CATC_BUFF_SIZE]); /* outwards data
*/
        __u8                    ALIGN(rx_buf[USB_CATC_BUFF_SIZE]); /* inwards data */

Should that be sufficient?

Brad

_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
http://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to