From mboxrd@z Thu Jan 1 00:00:00 1970 From: Greg KH Date: Thu, 20 Jan 2011 17:52:11 +0000 Subject: Re: Proper way to get USB class codes Message-Id: <20110120175211.GB30124@kroah.com> List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: linux-hotplug@vger.kernel.org On Sat, Jan 15, 2011 at 07:26:28PM +0100, Jos=E9 F=E9lix Onta=F1=F3n wrote: > Hello everybody, > I've got some doubts and problems getting USB class codes via udev and > i'll be very grateful if someone could clarify. >=20 > First of all, using udevadm i've realized some usb devices left the > class/subclass/protocol attributes with 00: >=20 > ATTR{bDeviceClass}=3D"00" > ATTR{bDeviceSubClass}=3D"00" > ATTR{bDeviceProtocol}=3D"00" >=20 > Is that an issue on the usb device itself or an issue on udev reading > usb device/interface descriptor? No, that's normal, why wouldn't it be? Those attributes are properly defined for these devices in the interface values for those fields, not the main device values. > Second, i've some doubts about when should I use the > ID_USB_INTERFACES, TYPE or INTERFACE property: in which cases should I > use one or another? Why the TYPE property sometimes appear as 0/0/0 > even when the ID_USB_INTERFACES and INTERFACE properties are filled? That's normal, and to be expected. Please read the usb.org specs for details if you really are curious. thanks, greg k-h