Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Oct 2005 20:54:17 -0400
From:      "Brian K. White" <brian@aljex.com>
To:        "Loren M. Lang" <lorenl@alzatex.com>
Cc:        freebsd-usb@freebsd.org
Subject:   Re: LibUSB fails to enumerate all devices
Message-ID:  <032e01c5da91$04ff9920$6600000a@venti>
References:  <20051023095137.GC18930@alzatex.com> <041301c5d8d4$62749100$6600000a@venti> <20051025075602.GB4759@alzatex.com>

next in thread | previous in thread | raw e-mail | index | archive | help
----- Original Message ----- 
From: "Loren M. Lang" <lorenl@alzatex.com>
To: "Brian K. White" <brian@aljex.com>
Cc: "Loren M. Lang" <lorenl@alzatex.com>; <freebsd-usb@freebsd.org>
Sent: Tuesday, October 25, 2005 3:56 AM
Subject: Re: LibUSB fails to enumerate all devices

> On Mon, Oct 24, 2005 at 03:51:27PM -0400, Brian K. White wrote:
> >
> > ----- Original Message ----- 
> > From: "Loren M. Lang" <lorenl@alzatex.com>
> > To: <freebsd-usb@freebsd.org>
> > Sent: Sunday, October 23, 2005 5:51 AM
> > Subject: LibUSB fails to enumerate all devices
> >
> > > I am developing a USB device which has two interfaces, one interface
> > > uses a standard HID protocol, the other is completely custom at the
> > > moment.  FreeBSD attaches appropriately to the HID interface and works
> > > correctly.  For the custom interface, I was going to write a device
> > > driver in userspace using libusb, but I can't seem to find it.  I 
> > > wrote
> > > a program to enumerate all devices on all busses, but the only device 
> > > I
> > > see is the one device I don't have any driver loaded for.  Does 
> > > FreeBSD
> > > not allow a userspace to access an interface of a usb device when any 
> > > of
> > > it's interfaces are grabbed by a kernel driver even though the 
> > > interface
> > > I want is not grabbed?
> >
> > I am not a kernel or usb developer at all. But what you describe  sounds
> > like it might be related to a problem I have.
> > I have a wireless usb keyboard with 3 devices that share the single usb
> > receiver. The keyboard, the touchpad mouse built in to it, and a 
> > seperate
> > wireless mouse.
> > On linux ever since 2.6.<low number>, it all works out of the box. suse
> > 9.3, 10.0, and knoppix 4.0 all work for example. Suse 9.2 almost worked,
> > the touchpad worked but not the button on the touch pad.
> >
> > On freebsd, _only_ the keyboard works.
>
> This is not the same problem, but I also have it as well.  I have a usb
> keyboard and mouse combo.  The keyboard also has extra keys on it for
> extra functions.  Nothing besides the basic keyboard works out of the
> box.  I was able to get the mouse and extra keys to work by creating a C
> program to read events from /dev/uhid0 and do the appropriate action.
> Both the keyboard, basic and extra keys; and the mouse work fine now
> that I have this program running.  I believe the problem is that the
> keyboard I have sends all hid event for everything through the same
> interface, just with different hid report numbers and only the hid to
> keyboard translator was able to conect to the interface.  Other
> mouse/keyboard combos may use two interfaces for each and should work
> fine.  If I get some free time, I might work on fixing freebsd to avoid
> this program.  I can provide you with the program I wrote, but it would
> need to be tweaked for your keyboard.  There should be some fine like
> /dev/uhid0 that you can cat to test with.  It may not be 0, do an ls
> /dev/uhid* to list all uhid devices.
>
> BTW, this program I wrote works for both 5.4 and 6.0, otherwise neither
> version will work with my keyboard.

I would love to give it a try.

Also, as I hinted at, I'm currently using it on linux and everything works, 
so I can capture stuff like /proc/bus/usb and maybe that will mean something 
to someone who's familiar with FreeBSD's usb system.

> Once someone here asked me to try catting /dev/uhid0  (the only device to
> appear in dmesg besides the keyboard) while moving the mouse/touchpad and
> pressing mouse/touchpad buttons. The result was no output at all.
>
> Someone else said that is was because multiple devices needed to use the
> same usb receiver and there was an enhancement in 6.0 (I was using 5.4)
> that allowed for it.
> I have 6.0 now and it made no difference.
>
> I hope you are hitting the same thing I'm hitting, and that it becomes a
> more common problem, and that someone then finally firgures it out so I 
> can
> use my $150 keyboard without having to host a copy of knoppix on on my
> freebsd box just so my diskless thin client can pxe boot it.
>
> What I don't get is, why don't all devices that need to share a single
> physical port just make themselves look like hubs? I have a different usb
> keyboard that has two usb ports on it (ie a built in 2 port usb hub) and I
> can plug a usb mouse into that keyboard, and the keyboard into the pc, and
> it all works fine even back on 5.4 .

Answering myself... maybe to look like a hub, you effectively need another 
chip that actually impliments a hub, and maybe you can get the functionality 
with less hardware by making it all look like one device with a lot of 
functions.

Brian K. White  --  brian@aljex.com  --  http://www.aljex.com/bkw/
+++++[>+++[>+++++>+++++++<<-]<-]>>+.>.+++++.+++++++.-.[>+<---]>++.
filePro  BBx    Linux  SCO  FreeBSD    #callahans  Satriani  Filk!




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?032e01c5da91$04ff9920$6600000a>