From: Greg KH <greg@kroah.com>
To: linux-hotplug@vger.kernel.org
Subject: Re: [PATCH] udev - udevinfo with device chain walk
Date: Fri, 23 Jan 2004 03:03:44 +0000 [thread overview]
Message-ID: <20040123030344.GC16893@kroah.com> (raw)
In-Reply-To: <20040123013054.GA2437@vrfy.org>
Ananth, I think this is pointing out a bug in libsysfs, see below:
On Fri, Jan 23, 2004 at 02:30:54AM +0100, Kay Sievers wrote:
> udevinfo is now capable to print "all" attributes along the device chain
> of a sysfs device. Just like udev itself it walks the chain upwards and
> prints all usable attributes in the udev key format.
> So it should be easy to find unique attributes to compose a rule.
>
> All multiline attribute values and values containing non printable
> characters are skipped now. I hope nothing useful gets lost with this :)
>
> NOTE:
> The BUS value corresponding with the attributes is printed for every
> device. Don't specify BUS= in a rule and mix SYSFS_attributes from
> different busses, the rule can't match.
>
> thanks,
> Kay
>
>
>
> ./udevinfo /sys/block/sda/sda1
>
> device '/sys/block/sda/sda1' has major:minor 8:1
> looking at class device '/sys/block/sda/sda1':
> SYSFS_dev="8:1"
> SYSFS_start="32"
> SYSFS_size="160"
> SYSFS_stat=" 0 0 0 0"
>
> follow the class device's "device"
> looking at the device chain at '/sys/devices/pci0000:00/0000:00:1d.0/usb1/1-1/1-1.3/1-1.3:1.0/host32/32:0:0:0':
> BUS="scsi"
> ID="32:0:0:0"
> SYSFS_detach_state="0"
> SYSFS_type="0"
> SYSFS_model="USB 2 HS-CF"
> SYSFS_vendor="SMSC "
> SYSFS_max_sectors="240"
> SYSFS_device_blocked="0"
> SYSFS_queue_depth="1"
> SYSFS_scsi_level="3"
> SYSFS_rev="1.25"
> SYSFS_online="1"
>
> looking at the device chain at '/sys/devices/pci0000:00/0000:00:1d.0/usb1/1-1/1-1.3/1-1.3:1.0/host32':
> BUS=""
> ID="host32"
> SYSFS_detach_state="0"
>
> looking at the device chain at '/sys/devices/pci0000:00/0000:00:1d.0/usb1/1-1/1-1.3/1-1.3:1.0':
> BUS="usb"
> ID="1-1.3:1.0"
> SYSFS_detach_state="0"
> SYSFS_bInterfaceNumber="00"
> SYSFS_bAlternateSetting=" 0"
> SYSFS_bNumEndpoints="02"
> SYSFS_bInterfaceClass="08"
> SYSFS_bInterfaceSubClass="06"
> SYSFS_bInterfaceProtocol="50"
> SYSFS_iInterface="00"
>
> looking at the device chain at '/sys/devices/pci0000:00/0000:00:1d.0/usb1/1-1/1-1.3':
> BUS="usb"
> ID="1-1.3"
> SYSFS_detach_state="0"
> SYSFS_bNumConfigurations="1"
> SYSFS_bNumInterfaces=" 1"
> SYSFS_bConfigurationValue="1"
> SYSFS_bmAttributes="80"
> SYSFS_bMaxPower=" 96mA"
> SYSFS_idVendor="0424"
> SYSFS_idProduct="20fc"
> SYSFS_bcdDevice="0125"
> SYSFS_bDeviceClass="00"
> SYSFS_bDeviceSubClass="00"
> SYSFS_bDeviceProtocol="00"
> SYSFS_speed="12"
> SYSFS_manufacturer="SMSC"
> SYSFS_product="USB 2 Flash Media Device"
> SYSFS_serial="0305037000C2"
>
> looking at the device chain at '/sys/devices/pci0000:00/0000:00:1d.0/usb1/1-1':
> BUS="usb"
> ID="1-1"
> SYSFS_detach_state="0"
> SYSFS_bNumConfigurations="1"
> SYSFS_bNumInterfaces=" 1"
> SYSFS_bConfigurationValue="1"
> SYSFS_bmAttributes="e0"
> SYSFS_bMaxPower=" 64mA"
> SYSFS_idVendor="03eb"
> SYSFS_idProduct="3301"
> SYSFS_bcdDevice="0300"
> SYSFS_bDeviceClass="09"
> SYSFS_bDeviceSubClass="00"
> SYSFS_bDeviceProtocol="00"
> SYSFS_speed="12"
> SYSFS_product="Standard USB Hub"
>
> looking at the device chain at '/sys/devices/pci0000:00/0000:00:1d.0/usb1':
> BUS="usb"
> ID="usb1"
> SYSFS_detach_state="0"
> SYSFS_bNumConfigurations="1"
> SYSFS_bNumInterfaces=" 1"
> SYSFS_bConfigurationValue="1"
> SYSFS_bmAttributes="40"
> SYSFS_bMaxPower=" 0mA"
> SYSFS_idVendor="0000"
> SYSFS_idProduct="0000"
> SYSFS_bcdDevice="0206"
> SYSFS_bDeviceClass="09"
> SYSFS_bDeviceSubClass="00"
> SYSFS_bDeviceProtocol="00"
> SYSFS_speed="12"
> SYSFS_manufacturer="Linux 2.6.2-rc1-p4 uhci_hcd"
> SYSFS_product="UHCI Host Controller"
> SYSFS_serial="0000:00:1d.0"
>
> looking at the device chain at '/sys/devices/pci0000:00/0000:00:1d.0':
> BUS="pci"
> ID="0000:00:1d.0"
> SYSFS_detach_state="0"
> SYSFS_vendor="0x8086"
> SYSFS_device="0x2482"
> SYSFS_subsystem_vendor="0x1014"
> SYSFS_subsystem_device="0x0220"
> SYSFS_class="0x0c0300"
> SYSFS_irq="9"
>
> looking at the device chain at '/sys/devices/pci0000:00':
> BUS=""
> ID="pci0000:00"
> SYSFS_detach_state="0"
This device should show up on with BUS="pci", right?
thanks,
greg k-h
-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
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
next prev parent reply other threads:[~2004-01-23 3:03 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-01-23 1:30 [PATCH] udev - udevinfo with device chain walk Kay Sievers
2004-01-23 3:01 ` Greg KH
2004-01-23 3:03 ` Greg KH [this message]
2004-01-23 4:53 ` Ananth N Mavinakayanahalli
2004-01-23 20:43 ` 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=20040123030344.GC16893@kroah.com \
--to=greg@kroah.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).