I have a board based on ixp425 (linux 2.4.22) with an NEC usb controller (4 ports). Linux kernel is compiled for usb storage support and scsi support. I can access the storage devices attached to these ports as sda and sdb.
When board boots up, if the storage device is present in port0, it will get a drive number of sda and the one in port1 will bet a drive name of sdb.
But when the board boots up, if only the storage device attached to port1 is present, it will get a drive name as sda. Later if I push in a storage device to port0, it will get a drive name of sdb.
My application requires some relation to be established between usb port number and drive name. I was looking into drivers/usb/storage/{usbstorage.c,usb.c}, drivers/scsi/sg.c. It seems to be a little complex. Any pointers/help/howtos?
PS.
I tried with 2.6.9 on a normal pc and got what I wanted.
$ ls /sys/bus/scsi/devices -l
total 0
lrwxrwxrwx 1 root root 0 Jan 15 04:04 0:0:0:0 -> ../../../devices/pci0000:00/0000:00:1d.7/usb1/1-1/1-1:1.0/host0/0:0:0:0/
Such an entry is what I exactly looking for. But I *cannot* upgrade the board to 2.6.x.
Regards, Om.
-- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/