Date: Thu, 14 Nov 2013 15:37:26 -0800 (PST) From: Don Lewis <truckman@FreeBSD.org> To: freebsd-usb@FreeBSD.org Subject: U3GINIT_SCSIEJECT quirk Message-ID: <201311142337.rAENbQp7076609@gw.catspoiler.org>
next in thread | raw e-mail | index | archive | help
I've got a Virgin Mobile version of the Novatel MiFi 2200. I've added the following quirks CAM from spewing a bunch of errors when it attaches the umass (cd) device and then panicing about ten minutes later when the umass device decides to disconnect. I've also added the U3GINIT_SCSIEJECT quirk in an attempt to get the umass device to eject and bring up the u3g device. Index: dev/usb/quirk/usb_quirk.c =================================================================== --- dev/usb/quirk/usb_quirk.c (revision 258079) +++ dev/usb/quirk/usb_quirk.c (working copy) @@ -288,6 +288,7 @@ UQ_MSC_NO_INQUIRY), USB_QUIRK(NIKON, D300, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI), + USB_QUIRK(NOVATEL, MIFI2200V, 0x0000, 0xffff, UQ_MSC_NO_PREVENT_ALLOW), USB_QUIRK(OLYMPUS, C1, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_WRONG_CSWSIG), USB_QUIRK(OLYMPUS, C700, 0x0000, 0xffff, UQ_MSC_NO_GETMAXLUN), Index: dev/usb/serial/u3g.c =================================================================== --- dev/usb/serial/u3g.c (revision 258079) +++ dev/usb/serial/u3g.c (working copy) @@ -345,6 +345,7 @@ U3G_DEV(NOVATEL, MC547, 0), U3G_DEV(NOVATEL, MC950D, 0), U3G_DEV(NOVATEL, MIFI2200, U3GINIT_SCSIEJECT), + U3G_DEV(NOVATEL, MIFI2200V, U3GINIT_SCSIEJECT), U3G_DEV(NOVATEL, U720, 0), U3G_DEV(NOVATEL, U727, 0), U3G_DEV(NOVATEL, U727_2, 0), Index: dev/usb/usbdevs =================================================================== --- dev/usb/usbdevs (revision 258079) +++ dev/usb/usbdevs (working copy) @@ -3174,6 +3174,7 @@ product NOVATEL U727 0x4100 Merlin U727 CDMA product NOVATEL MC950D 0x4400 Novatel MC950D HSUPA product NOVATEL ZEROCD 0x5010 Novatel ZeroCD +product NOVATEL MIFI2200V 0x5020 Novatel MiFi 2200 CDMA Virgin Mobile product NOVATEL ZEROCD2 0x5030 Novatel ZeroCD product NOVATEL MIFI2200 0x5041 Novatel MiFi 2200 CDMA product NOVATEL U727_2 0x5100 Merlin U727 CDMA What is strange is that after rebooting the system, when I first plug in the device, the eject doesn't seem to be happening. I see the following: ugen2.2: <Novatel Wireless Inc.> at usbus2 umass0: <Novatel Wireless Inc. Novatel Wireless CDMA, class 0/0, rev 1.10/0.00, addr 2> on usbus2 umass0: SCSI over Bulk-Only; quirks = 0x8100 umass0:9:0: Attached to scbus9 cd0 at umass-sim0 bus 0 scbus9 target 0 lun 0 cd0: <Novatel Mass Storage 1.00> Removable CD-ROM SCSI-2 device cd0: Serial Number 091166643730000 cd0: 1.000MB/s transfers cd0: Attempt to query device size failed: NOT READY, Medium not present cd0: quirks=0x10<10_BYTE_ONLY> [run "camcontrol eject cd0" or wait about 10 minutes] ugen2.2: <Novatel Wireless Inc.> at usbus2 (disconnected) umass0: at uhub0, port 1, addr 2 (disconnected) cd0 at umass-sim0 bus 0 scbus9 target 0 lun 0 cd0: <Novatel Mass Storage 1.00> s/n 091166643730000 detached (cd0:umass-sim0:0:0:0): Periph destroyed ugen2.2: <Novatel Wireless Inc.> at usbus2 u3g0: <Data Interface> on usbus2 u3g0: Found 3 ports. [unplug device] ugen2.2: <Novatel Wireless Inc.> at usbus2 (disconnected) u3g0: at uhub0, port 1, addr 2 (disconnected) If I then turn off the device and plug it back in, then the eject seems to happen automatically like I would expect: ugen2.2: <Novatel Wireless Inc.> at usbus2 ugen2.2: <Novatel Wireless Inc.> at usbus2 (disconnected) ugen2.2: <Novatel Wireless Inc.> at usbus2 u3g0: <Data Interface> on usbus2 u3g0: Found 3 ports. My first question is how does U3GINIT_SCSIEJECT manage to ever work? It seems like there would be chicken vs. egg issue here. The quirk is on the u3g device, so how would it get activated until the u3g device is attached? The u3g device doesn't appear until the umass device is ejected. My second question is why does it work the second time the device is plugged in, but not the first time after a reboot? Is there a way to make it happen automatically the first time the device is plugged in?
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201311142337.rAENbQp7076609>