usbd_set_config_no vs. usbd_set_config_index

Hans Petter Selasky hselasky at c2i.net
Fri Aug 17 11:15:22 PDT 2007


On Thursday 16 August 2007, Andriy Gapon wrote:
> on 16/08/2007 19:41 Hans Petter Selasky said the following:
> > On Thursday 16 August 2007, Andriy Gapon wrote:
> >> on 16/08/2007 19:15 Hans Petter Selasky said the following:
> >>> Hi,
> >>>
> >>> I would say that "usbd_set_config_index()" is more reliable and faster
> >>> than "usbd_set_config_no()". I tried to get rid of
> >>> all "usbd_set_config_no()".
> >>
> >> Hmm, then I am puzzled how my change from *_index() to *_no() helped in
> >> my case. Maybe some parameters were incorrect, or maybe different
> >> devices need different parameters and that's where _no() comes useful.
> >
> > What config number are you setting?
> >
> > Have you dumped the configuration of your device using "udesc_dump"
> > (See /usr/ports/sysutils/udesc_dump) ?
>
> Thank you for bearing with me.
> To reiterate: I was trying palm/uppc-kmod on amd64 6.2 with standard USB
> stack. attach routine had the following line:
> err = usbd_set_config_index(dev, UPPC_CONFIG_INDEX, 1);
> where UPPC_CONFIG_INDEX is defined to 1.
> It failed with:
> kernel: ucom0: failed to set configuration, err=STALLED
> kernel: device_attach: ucom0 attach returned 6
>
> My only change was from _index to _no and then it started to work.
> Here's udesc_dump full output:
>

From this you should set config index 0 or config no 1. Note the difference!

--HPS


More information about the freebsd-usb mailing list