From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Guo, Min" Date: Thu, 26 Jun 2003 07:42:36 +0000 Subject: RE: Question about Hot device Identity Message-Id: List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org Sorry, I make a mistake, I has UHCI built-in but OHCI not, but my USB controller is OHCI type, so I can not find my cdrom in /sys/block. Here I run the Udev as following procedure. 1. mount -t sysfs sysfs /sys 2. Edit the udev.h file and replace the following variables with values that make sense for your system: #define SYSFS_ROOT "/sys" #define UDEV_ROOT "/root/udev/" #define DEV_FILE "/dev" #define MKNOD "/bin/mknod" 3 . Run make to build the project 4. Point /proc/sys/kernel/hotplug at the location of the udev binary that is created. so I change /proc/sys/kernel/hotplug 's content to /root/udev/udev.is this right? 5. Set DEVPATH to /sys/devices/pci0/0000:00:0f.2/usb1/1-1/1-1:0/host2/2:0:0:0/scd0 I don't know whether scd0 is right, because there are no scd0 in the path /sys/devices/pci0/0000:00:0f.2/usb1/1-1/1-1:0/host2/2:0:0:0,but I can mount the USB CDROM with /dev/scd0,there is a dev file in my /sys/block/sr0 directory. here is the detailed outputs of usb1. #ls /sys/devices/pci0/0000:00:0f.2/usb1/1-1/1-1:0/host2/2:0:0:0 access_count block device_blocked model name online power queue_depth rescan rev scsi_level type vendor 6. run . ./test to see the result. But what things should happen here? in my machine, there are no outputs, I think dbg information should be outputed at least. Thanks Guo Min The content of this email message solely contains my own personal views, and not those of my employer. -----Original Message----- From: Kevin P. Fleming [mailto:kpfleming@cox.net] Sent: Thursday, June 26, 2003 12:10 PM To: linux-hotplug-devel@lists.sourceforge.net Subject: Re: Question about Hot device Identity Guo, Min wrote: > I can not find the file dev in the /sys/class/usb, does it means that > Udev does not support my USB CDROM? If not, which file is behalf of > my USB CDROM device? > I think you've missed the point here. There is no such thing as a "generic" USB device that could have a dev file for it in /sys/class/usb. For a device to have a dev file, it must have some sort of device-specific driver talking to it. If that driver exists and is loaded, it will (or should) have a class of its own under /sys/class, and the dev file will be there. In the case of a USB CD-ROM, that is handled by the usb-storage driver, but that driver _still_ does not create a dev file, because it does not directly expose itself to userspace (there is no way to talk to the usb-storage driver itself). usb-storage connects the device the SCSI midlayer, which then attaches the sd (SCSI disk) driver to the device. _That_ driver is actually a real device that the user can interact with, so it creates a dev file in the appropriate place, namely /sys/block. You can think of /sys/block as a special-case class, and consider it equivalent to /sys/class/block (although it's more than that). The only devices that will ever have "dev" files in /sys for them are those that can actually can communicated with from userspace. There is no need for userspace to treat your USB CD-ROM as a USB CD-ROM, instead it just considers it to be a generic disk (block) device that holds read-only media. I don't see any reason this device will ever generate any directories under /sys/class/... with dev files in them, they're not necessary. But, this has nothing to do with whether udev can support your device or not and create a node in /dev for it. udev should be able to do exactly that, but I don't know whether it currently looks only at /sys/class (which I think is the case) or whether it also looks at /sys/block. ------------------------------------------------------- This SF.Net email is sponsored by: INetU Attention Web Developers & Consultants: Become An INetU Hosting Partner. Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission! INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel ------------------------------------------------------- This SF.Net email is sponsored by: INetU Attention Web Developers & Consultants: Become An INetU Hosting Partner. Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission! INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel