Re: Driver for something that's neither a device nor an interface driver?

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

 



On Fri, 2019-09-27 at 20:57 +0200, Greg KH wrote:
> On Fri, Sep 27, 2019 at 07:44:08PM +0200, Bastien Nocera wrote:
> > On Fri, 2019-09-27 at 19:38 +0200, Greg KH wrote:
> > > What does the usb descriptors for the device look like?  Is it
> > > only
> > > the
> > > "default" control endpoint and no interfaces?  What does the
> > > output
> > > of
> > > 'usbdevices' show for the device?
> > 
> > The device in question can be an iPhone, an iPod Classic/Nano, or
> > an
> > iPad, amongst others, and they usually have useful interfaces, such
> > as
> > mass storage for the older ones, or ethernet, PTP, etc.
> 
> Ah.  Then why do you have to do this from a kernel driver?  Why can't
> you do this from userspace?

Because the kernel has a well-defined API for doing this sort of thing,
and I'd like device drivers to live in the kernel if they can live in
the kernel, making it easier to point at them when writing a policy
daemon, rather than getting told "I won't be using this daemon because
it uses the wrong language, or the wrong library".

I can imagine other implementation for other vendors once the ball
starts rolling.

> > > Normally you just bind to the "default" interface for the device,
> > > and
> > > all is good, there should be a few other drivers in the tree that
> > > do
> > > this, but I can't think of one off the top of my head at the
> > > moment.
> > 
> > All the interfaces (in the different configurations) are used for
> > something in the case of the iPhone 6S I'm trying to use.
> > 
> > I've attached the output of "lsusb -v" for the device below.
> 
> What about interface "9", the "Apple USB Multiplexor"?  What driver
> binds to that thing?  It's a vendor-specific protocol, so there
> shouldn't be any class driver assigned to it, unlike most of the
> other
> interfaces.

There's a user-space daemon called "usbmuxd" that will unbind it and
claim it. This daemon has the exact same API as this daemon under
macOS, and is a drop-in replacement too.

Finds the right configuration:
https://github.com/libimobiledevice/usbmuxd/blob/master/src/usb.h#L28
https://github.com/libimobiledevice/usbmuxd/blob/master/src/usb.c#L448
and claims it:
https://github.com/libimobiledevice/usbmuxd/blob/master/src/usb.c#L485




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

  Powered by Linux