Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 Jan 2013 22:42:30 +0100
From:      Hans Petter Selasky <hselasky@c2i.net>
To:        freebsd-usb@freebsd.org
Cc:        Lowell Gilbert <Lgfbsd@be-well.ilk.org>
Subject:   Re: auto-dismount fake CD (was Re: Android device problems with MTP ID)
Message-ID:  <201301042242.30325.hselasky@c2i.net>
In-Reply-To: <4438ygbplz.fsf_-_@be-well.ilk.org>
References:  <44d2xmrrfp.fsf@lowell-desk.lan> <201301032104.54225.hselasky@c2i.net> <4438ygbplz.fsf_-_@be-well.ilk.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Friday 04 January 2013 22:33:12 Lowell Gilbert wrote:
> Hans Petter Selasky <hselasky@c2i.net> writes:
> > On Thursday 03 January 2013 20:58:15 Lowell Gilbert wrote:
> >> Hans Petter Selasky <hselasky@c2i.net> writes:
> >> > On Thursday 03 January 2013 20:34:50 Lowell Gilbert wrote:
> >> >> On my (updated to Android 4.1.1) phone, MTP only works if the phone's
> >> >> USB debugging option is enabled. If it is, usbconfig(8) sees a
> >> >> ugen(4) interface of MTP type; but otherwise it just shows up as a
> >> >> CD device.
> >> > 
> >> > Try to use cdcontrol to eject the CD.
> >> 
> >> Thanks! That works! [And I can see the logic behind it, even, from a
> >> firmware point of view.]
> >> 
> >> I should be able to automate the eject command through devd, I think.
> >> It would be nice to put something in the tree that would do that, but
> >> being sure not to catch cases you'd want such a feature would be
> >> error-prone.
> >> 
> >> I'll move forward on making MTP more convenient on FreeBSD. A lot of
> >> devices are starting to force it on us, and it keeps the device usable
> >> while the computer is accessing its files.
> >> 
> >> Thanks again!
> >> 
> >> Be well.
> >> 
> >>         Lowell
> > 
> > There might be a quirk for that.
> > 
> > See usbconfig, and send a patch for that if you figure it out :-)
> 
> I was wrong about being able to do this in userland; devd doesn't have
> the device name, and devfs doesn't have enough information to identify
> the disk as being bogus (as well as not currently having a mechanism to
> do anything to the device except ownership/permissions/etc.).
> 
> So I guess a quirk would be the best way to do it, and I don't see any
> existing functionality that even resembles this.  Is this something that
> would be worth my while to create?
> 
> I wouldn't mind writing it if it were generally useful, but I don't know
> for a fact that anyone else would want to use it. A scheme flexible
> enough to have a hope of working with future devices would be
> substantially more complicated than I need for my own purposes, so I'd
> like to know if anyone else would want it also.
> 

See the serial/u3g.c driver and usb/usb_msctest.c and look for SCSI EJECT.

--HPS



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