On Tue, Feb 08, 2005 at 12:20:38AM +0100, Andrzej Polatynski wrote: > Hi, > > I'm trying to write a kernel module that would read a file from a specified > USB device. I thought of achieving this using sys_mount(), sys_open() and > sys_read() system calls, however I have a problem: I have only a pointer to > struct usb_device (from usb_find_device(<VENDOR_ID>, <PRODUCT_ID>)) and I > don't know how to get the device name like "/dev/sda" through that > structure. > > I tried to find it in usb_device.dev and some other places inside > usb_device but without any success. Neither could find any clues in > usb_stroage module code. > > How can I get the device name? You get it from userspace, which is where you should be doing all of this (not from within the kernel.) Look at the manpage for udev for more info on determining the block device for a specific usb device. Good luck, greg k-h -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/