From mboxrd@z Thu Jan 1 00:00:00 1970 From: Greg KH Date: Fri, 23 Jan 2004 03:03:44 +0000 Subject: Re: [PATCH] udev - udevinfo with device chain walk Message-Id: <20040123030344.GC16893@kroah.com> List-Id: References: <20040123013054.GA2437@vrfy.org> In-Reply-To: <20040123013054.GA2437@vrfy.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.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