Re: USB MTP driver question

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

 



On Tue, 2011-10-04 at 08:32 -0700, Greg KH wrote:
> On Tue, Oct 04, 2011 at 05:19:13PM +0200, Jack Smith wrote:
> > On Tue, 2011-10-04 at 07:57 -0700, Greg KH wrote:
> > > If you want the host side of the MTP solution, that too is done in
> > > userspace, no kernel driver needed.  I think it's in the gphoto library
> > > code that uses libusb to talk to the devices.  I'd recommend digging
> > > around in that.
> > > 
> > OK, so, can I ask why this is done in user space, instead of as a kernel
> > module ?  
> 
> Because it can :)
> 
> > Also, why are some USB protocols are handled as drivers, e.g. Mass
> > Storage, while others are not ?  Pardon me asking, but why the
> > inconsistency ?
> 
> A USB driver is done in the kernel if it needs to provide the interface
> to userspace in a consistant manner like other types of devices of the
> same type.
> 
> So, for a usb storage device, it needs to act like a "normal" block
> device, so the driver is in the kernel so that userspace doesn't need to
> know about what type of device this is (scsi, ata, ide, usb, etc.)  Same
> goes for USB video cameras, they have a kernel driver that exposes to
> userspace a "normal" video device.
> 
> But, for other devices that do not have a corrisponding "traditional"
> way to be exposed to userspace, like the MTP api describes), and there
> are no speed or performance benifits from being within the kernel, then
> those will be implemented as userspace drivers, using libusb or usbfs
> directly.
> 
> > > Hope this helps,
> > > 
> > Yes, very helpful, but:
> > 
> > The thing is, I really want to work on device drivers.  It seemed like
> > USB-MTP would be a good candidate since USB is clearly not going away,
> > and MTP seems fairly poorly supported within Linux (unless I'm missing
> > something).
> 
> Look at the libgphoto library, I think all of the code you want to use
> is there.
> 

OK, I'll have a look.

> And yes, writing device drivers is fun, but we only do it if it is
> necessary.  Sometimes making a driver actually makes things more complex
> than if we did it only as a userspace driver.
> 
> Take this protocol for example, how would you export the MTP interface
> to userspace in a manner that would be easy for userspace programs to
> interact with it?

Good point.  The voice of experience shines through.

Thanks again for your help.
> 
> 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