All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Guo, Min" <min.guo@intel.com>
To: linux-hotplug@vger.kernel.org
Subject: RE: Question about Hot device Identity
Date: Thu, 26 Jun 2003 07:42:36 +0000	[thread overview]
Message-ID: <marc-linux-hotplug-105661355418513@msgid-missing> (raw)
In-Reply-To: <marc-linux-hotplug-105633765700944@msgid-missing>

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

  parent reply	other threads:[~2003-06-26  7:42 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-23  3:04 Question about Hot device Identity Guo, Min
2003-06-23  3:22 ` Greg KH
2003-06-24  7:01 ` Guo, Min
2003-06-24 16:20 ` Greg KH
2003-06-25  2:24 ` Guo, Min
2003-06-25  2:33 ` Greg KH
2003-06-25  9:05 ` Guo, Min
2003-06-25 14:45 ` Kevin P. Fleming
2003-06-25 17:00 ` Greg KH
2003-06-26  2:24 ` Guo, Min
2003-06-26  4:10 ` Kevin P. Fleming
2003-06-26  7:42 ` Guo, Min [this message]
2003-06-26 17:13 ` Greg KH
2003-06-26 19:05 ` Greg KH
2003-06-26 19:08 ` Greg KH
2003-06-27  2:00 ` Guo, Min
2003-06-27  3:18 ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=marc-linux-hotplug-105661355418513@msgid-missing \
    --to=min.guo@intel.com \
    --cc=linux-hotplug@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.