Re: Standard USB Descriptor question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Jan 15, 2017 at 07:03:34PM -0800, bruce m beach wrote:
> On 1/13/17, Greg KH <gregkh@xxxxxxxxxxxxxxxxxxx> wrote:
> > On Fri, Jan 13, 2017 at 07:24:10PM -0800, bruce m beach wrote:
> >> Hello everybody
> >>
> >>   I have been stuck for ages trying to figure out something
> >> in the Standard USB Descriptor during the enumeration. It
> >> looks like it should should be quite simple but I am not
> >> getting it because maybe some mind block, maybe becuase the
> >> documentation is unclear, or maybe because I'm brain-dead.
> >> Here is the problem:
> >>
> >> I think the host starts out requesting the device descriptor
> >> This is okay and works no problem. At some point the host
> >> requests the configuration descriptor and I get stuck. The
> >> usb 2.0 spec. says:
> >>
> >> "When the host requests the configuration descriptor, all
> >> related interface and endpoint descriptors are returned"
> >>
> >> How is the host supposed to know how much data is coming in
> >> or how much data to request until it reads wTotalLength?
> >>
> >> I would assume the host would request the 9 bytes of the
> >> configuration descriptor, then make subsequent requests to
> >> get the interfaces and endpoints but for instance in the
> >> section on the interface descriptor the spec says
> >>
> >> " An interface descriptor is always returned as part of a
> >> configuration descriptor.
> >>
> >> Again how is this supposed happen if the host is only
> >> requesting 9 bytes in the configuration descriptor stage
> >
> > Have you looked at the data on the wire?  The host asks for 9 bytes, and
> > then it uses the information there to get the "real" size of the
> > descriptor and then it asks for the full descriptor with all of the
> > information in it.
> >
> > hope this helps,
> >
> > greg k-h
> >
> 
>   Yes it helps. Makes sense. I made some changes and can get the
>   descriptors from a userland program so I know its working (i.e.
>   from userland I can upload firmware and have control over the
>   chip includeing the usb subsystem) but at this point after
>   a reset there is no re-unumeration. It justs lists the original
>   configuration.(using lsusb). Notice I am using ioctl's.

I don't understand how you can be using ioctls to enumerate a USB
device, that's the kernel's job, not userspace.

And what do you mean by "reset"?  What reset?  How?

What exactly are you trying to do here that the kernel is not already
providing for you?  What problem are you trying to solve?

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux