Hi,

I'm currently working on a Linux USB emulation layer for FreeBSD. In that 
regard I have some issues that makes the stack peform non-optimal due to its 
API design.

The main issue is that DMA'able memory is allocated per USB host controller on 
Linux and not per USB host controller and pipe combination. Due to that I 
have to pre-allocate memory for all pipes to avoid blocking behaviour when 
one submits an URB. Further I have to split all large transfers into a fixed 
buffer size. If the fixed buffer is too large I will waste memory. If it is 
too small I will get lousy performance.

What I would suggest is that when you allocate an URB and DMA'able memory, you 
have to specify which pipe {CONTROL, BULK, INTERRUPT or ISOC} it belongs to.

What do you think?

The reason is that in the new USB stack on FreeBSD, the USB transfer 
descriptors are allocated along with the data-buffer, so that when you 
unsetup an USB transfer, absolutely all memory related to a transfer is 
freed. This also has a security implication in that when you have 
pre-allocated all buffers and all USB host controller descriptors, you will 
never get in the situation of not being able to allocate transfer descriptors 
on the fly, like done on Linux.

--HPS

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to