Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 6 Oct 2004 14:49:20 +0200
From:      Bernd Walter <ticso@cicely12.cicely.de>
To:        Niki Denev <nike_d@cytexbg.com>
Cc:        hackers@freebsd.org
Subject:   Re: attaching ugen(4) on multi interface USB devices
Message-ID:  <20041006124919.GZ15371@cicely12.cicely.de>
In-Reply-To: <cone.1097065805.20394.26649.1001@niked.office.suresupport.com>
References:  <cone.1097065805.20394.26649.1001@niked.office.suresupport.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Oct 06, 2004 at 03:30:05PM +0300, Niki Denev wrote:
> 
> Hello everyone!, 
> 
> The last 1-2 days i've been trying to make some userspace OBEX utilities to 
> work with a USB based Nokia GSM phone and doing this i discovered something 
> that confuses me a little:
> The phone in question is Nokia 6230 and it has an USB interface.
> The phone has 11 interface descriptors,
> 2 of them are used for the Modem and CM over data.
> Judging from the windows drivers it seems that four of the other interfaces
> are OBEX compatible.
> But if i kldload umodem and plug the phone it detects only one ucom(4).
> and if i plug the phone without any u* modules loaded the kernel attaches
> ugen0 only.
> >From what i understand it attaches the ugen0 using the info in the first 
> interface descriptor in the device.
> Wouldn't it be more usefull for the kernel to attach ugen for every unknown 
> interface in a device.
> For example when attaching the phone with umodem loaded, i will get
> the ucom(4) device and the other unrecognised interfaces will show up as 
> ugens ?
> What do you think about that?

ugen attaches to the whole device and supporting all interfaces in one
driver instance.
If you already an interface driver atatched then ugen fails to attach
the whole device.
11 interface descriptors sounds unlikely to be correct - it's more
likely that some of them are alternative configurations and a device
or interface can only be in a single configuration at a given time.
You can switch between alternative configurations via ugen.

I don't know about OBEX, but why don't you just create an interface
class driver that attaches to OBEX interfaces - writing USB drivers is
not very difficult if you know USB and a few kernel basics.

> P.S.: anyone know some good way to list the attached usb devices beyond 
> usbdevs?
> It seems that the information that can be gathered from usbdevs is very 
> limited. For example 'lsusb' in linux can show much more info. What do you 
> think about that too?

I like usbctl from NetBSDs usbutils.
An older port draft is available under:
http://www.cosmo-project.de/~bernd/usbutil.tgz
It will also show you the interface configurations with all
alternatives.

-- 
B.Walter                   BWCT                http://www.bwct.de
bernd@bwct.de                                  info@bwct.de



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20041006124919.GZ15371>