> > 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? > By track what I mean is, a log that monitors all data read/write activities from/to the usb-flash drive. Something like a tuple [R/W, sector number, size] that can capture all usb-flash drive data traffic. I think where I am confused is trying to figure out the sector number (or the address being sent to the flash drive by the lowest level of software that interfaces with the flash's controller). For eg: if a process writes X bytes of data to a file that resides on usb-flash drive; somewhere in the low level driver, this request would be converted to an [address, buffer] that is sent to flash controller ?
> > 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. > I looked at the struct scatterlist. How can I get the address to where data is read/written from this structure ? Thanks in advance, -siddharth __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ------------------------------------------------------------------------- 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
