Querying USB device's bInterfaceNumber

Ping pinglinux at gmail.com
Tue Nov 3 12:19:54 PST 2009


These questions make me feel the kernel driver may need some work.  Anyway,
let me share what I have now before we can figure out a better solution:

Wacom supports both penabled and touch digitizers.  The older tablets
doesn't have touch.  So, there is no problem there.  The newer tablets have
both pen and touch through the same physical USB port. They are definded in
separate HID descriptors with the same vendor id and product id.  So, for
kernel, I think, it is one physical device.

Once it comes to xorg, the device is mapped onto two logical ports.  I need
a way to tell which logical port is for touch and which one is for
penabled.
Now you have the whole picture, I hope :).  What would be a valid solution
for my case?

Ping
On Tue, Nov 3, 2009 at 12:03 PM, Greg KH <greg at kroah.com> wrote:

>  On Tue, Nov 03, 2009 at 02:44:34PM -0500, Adam Jackson wrote:
> > On Tue, 2009-11-03 at 10:37 -0800, Greg KH wrote:
> > > On Tue, Nov 03, 2009 at 01:13:16PM -0500, Adam Jackson wrote:
> > > > On Tue, 2009-11-03 at 10:03 -0800, Ping wrote:
> > > > > I need a quick answer since searching through the X server code
> takes
> > > > > too long.
> > > > >
> > > > > Is there a way for me to get the bInterfaceNumber from a device HID
> > > > > Descriptor inside an xorg Input device driver?  I feel there should
> be
> > > > > an existing mechanism to fulfil this, maybe through an ioctl call?
> > > > > Can someone show me what parameter(s) I need to use if the ioctl is
> > > > > supported?
> > > > >
> > > > > Please also reply to me if you know there is no existing way to get
> > > > > the bInterfaceNumber inside an xorg device driver so I will add my
> own
> > > > > workaround in the kernel driver.
> > > >
> > > > X doesn't have any particular knowledge of USB internally, you'll
> need
> > > > to roll your own.
> > >
> > > As X has knowledge of PCI internally, perhaps we should add some basic
> > > USB support as well to prevent people from having to add odd hacks to
> > > kernel drivers for stuff like this?
> >
> > I'm more inclined to say that different interfaces on the same USB
> > device should be different event streams in /dev/input/event*.  But I'm
> > not completely sure what problem is being solved here; in particular, if
> > the different interfaces would affect the same state machine, then that
> > doesn't really work.
>
> They "should", but there are lots of wierd USB devices out there, some
> that have 1 driver controling multiple interfaces just because some
> hardware person didn't really read the USB spec :(
>
> Either way, exposing the USB information to the xorg driver should be
> easy enough.
>
> Ping, why do you need this information in your xorg driver?
>
> thanks,
>
> greg k-h
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.x.org/archives/xorg-devel/attachments/20091103/df371234/attachment.html 


More information about the xorg-devel mailing list