Re: [Libusbx-devel] Linux sysfs usb descriptors file has broken configuration length handling

2013-05-18 Thread Hans de Goede
Hi, Greg, Alan, All, On 05/18/2013 06:17 PM, Greg KH wrote: On Sat, May 18, 2013 at 12:14:08PM -0400, Alan Stern wrote: On Sat, 18 May 2013, Hans de Goede wrote: But the sysfs descriptors file will just packs the rawdescriptors one behind the other, using usb_device->config[x].desc.wTotalLengt

Re: Question about "generic" HID devices

2013-05-18 Thread Daniel Santos
First off, thanks for your helpful response! :) On 05/18/2013 10:53 AM, Alan Stern wrote: On Fri, 17 May 2013, Daniel Santos wrote: Hello. I'm working on a driver for a USB to SPI bridge chip (Microchip's MCP2210) that acts as a HID device (generic subclass). Of course, it can be used from us

Re: Question about "generic" HID devices

2013-05-18 Thread Daniel Santos
The HID protocol is a separate specification, see the usb-if.org web site for it. Thank you, found it! It's quite a read and I think I see where I've gone wrong. I've made some terrible assumptions it would appear! :) That's ok, I've had fun and learned a lot thus far. Daniel -- To unsubs

Re: [Libusbx-devel] Linux sysfs usb descriptors file has broken configuration length handling

2013-05-18 Thread Greg KH
On Sat, May 18, 2013 at 12:14:08PM -0400, Alan Stern wrote: > On Sat, 18 May 2013, Hans de Goede wrote: > > But the sysfs descriptors file will just packs the > > rawdescriptors one behind the other, using > > usb_device->config[x].desc.wTotalLength, where as > > userspace only sees the length adve

Re: [Libusbx-devel] Linux sysfs usb descriptors file has broken configuration length handling

2013-05-18 Thread Alan Stern
On Sat, 18 May 2013, Hans de Goede wrote: > Hi All, > > While working on libusb's descriptor parsing code I ended up > referencing the kernels drivers/usb/core/sysfs.c and > drivers/usb/core/devio.c files. And I noticed a worrisome > discrepancy. > > The sysfs descriptors file for a usb device,

Re: usb sysfs file handling functions don't take

2013-05-18 Thread Alan Stern
On Sat, 18 May 2013, Hans de Goede wrote: > Hi, > > As written in my mail titled: "Linux sysfs usb descriptors > file has broken configuration length handling" > > I've been taking a close look at the usb sysfs handling > code, specifically for the descriptors sysfs file. > > One other differen

Re: Question about "generic" HID devices

2013-05-18 Thread Alan Stern
On Fri, 17 May 2013, Daniel Santos wrote: > Hello. I'm working on a driver for a USB to SPI bridge chip > (Microchip's MCP2210) that acts as a HID device (generic subclass). Of > course, it can be used from user-space via hid-generic, but I'm not > really interested in that. I started this wor

Linux sysfs usb descriptors file has broken configuration length handling

2013-05-18 Thread Hans de Goede
Hi All, While working on libusb's descriptor parsing code I ended up referencing the kernels drivers/usb/core/sysfs.c and drivers/usb/core/devio.c files. And I noticed a worrisome discrepancy. The sysfs descriptors file for a usb device, as well as its /dev/bus/usb/xxx/yyy device node both behav

usb sysfs file handling functions don't take

2013-05-18 Thread Hans de Goede
Hi, As written in my mail titled: "Linux sysfs usb descriptors file has broken configuration length handling" I've been taking a close look at the usb sysfs handling code, specifically for the descriptors sysfs file. One other difference I've noticed is that the usbfs code for reading the descr