On Sat, 2 Sep 2006, Siddharth Choudhuri wrote:

> Hi,
> 
> I am trying to implement a kernel module that can
> track read/write requests to a USB-mounted flash
> device (say, mounted as FAT filesystem). 

When you say "track", exactly what do you mean?  Like Luiz said, usbmon 
will produce a log of all USB messages; is that what you want?

> I am unable to figure out how the read,write requests
> that are in the form of [sector, size] in the VFS
> layer are passed into urb structure before calling
> usb_submit_urb(). My understanding is at the lowest
> level a call to usb_submit_urb() is required to
> perform a read/write operation. Does the mtdblock do
> the conversion ? 

No.  The conversion is done in two steps.  First the block layer converts
the [sector, size] information to [sector, size, list of memory pages]
(called a scatter-gather list or a struct scatterlist).  This gets passed
to the USB mass-storage device driver, either usb-storage or ub.  That
driver, whichever you choose to load, uses the scatter-gather list to
generate a sequence of URBs and calls usb_submit_urb.

> My second question is, the urb structure has a member
> called transfer_buffer (to fill in data) and
> transfer_buffer_length to indicate the size. How does
> the driver know where (location/address) to write this
> data ? 

That information is in the scatter-gather list.

Alan Stern


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to