tech-userlevel archive

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

"ZeroCD" filesystem mount?



Hi,
   I have here a Globetrotter HSDPA modem (iCON 225) that upon connection
presents as a umass device (containing windows/mac drivers)

umass0 at uhub0 port 2 configuration 1 interface 0
umass0: Option N.V. Globetrotter HSDPA Modem, rev 1.10/0.00, addr 2
umass0: using SCSI over Bulk-Only
scsibus0 at umass0: 2 targets, 1 lun per target
cd1 at scsibus0 target 0 lun 0: <ZCOPTION, HSDPA Modem, 3.00> cdrom removable

I was trying to look at the contents of the filesystem (just out of
interest) but mount reports device not configured and I see

cd1(umass0:0:0:0):  Check Condition on CDB: 0x00 00 00 00 00 00
   SENSE KEY:  Not Ready
    ASC/ASCQ:  Medium Not Present

on the console, any ideas?  (I tried "eject -l cd1" no success)


The device itself acts on a SCSI REZERO_UNIT command to detach and
reattach as the actual modem and I added a command to scsictl(8) so I
could play with it (see attached) but though it does work, I get a bunch
of errors on the console

umass0: BBB bulk-out stall clear failed, STALLED
umass0: BBB reset failed, STALLED
umass0: BBB bulk-in clear stall failed, STALLED
umass0: BBB bulk-out clear stall failed, STALLED
cd1(umass0:0:0:0): unknown error category 8 from adapter
umass0: BBB reset failed, STALLED
umass0: BBB bulk-in clear stall failed, STALLED
umass0: BBB bulk-out clear stall failed, STALLED
umass0: BBB reset failed, STALLED
umass0: BBB bulk-in clear stall failed, STALLED
umass0: BBB bulk-out clear stall failed, STALLED
umass0: BBB reset failed, STALLED
umass0: BBB bulk-in clear stall failed, STALLED
umass0: BBB bulk-out clear stall failed, STALLED
umass0: at uhub0 port 2 (addr 2) disconnected
cd1(umass0:0:0:0): generic HBA error
cd1(umass0:0:0:0): generic HBA error
cd1: detached
scsibus0: detached
umass0: detached

and "device had unknown status 4" printed ..is that likely normal?


The device itself then presents a number of interfaces, most of which are
normal serial interfaces and I threw together a simple ucom wrapper that
allows it to work with pppd but I'm looking at the hso drivers for FreeBSD
and Linux that set up a generic network interface.

iain
Index: scsictl.8
===================================================================
RCS file: /cvsroot/src/sbin/scsictl/scsictl.8,v
retrieving revision 1.25
diff -u -r1.25 scsictl.8
--- scsictl.8   30 Apr 2008 13:10:53 -0000      1.25
+++ scsictl.8   29 Jun 2009 08:40:39 -0000
@@ -28,7 +28,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd January 22, 2007
+.Dd June 29, 2009
 .Dt SCSICTL 8
 .Os
 .Sh NAME
@@ -150,6 +150,16 @@
 .Li SCIOCRESET
 ioctl.
 .Pp
+.Nm rezero
+.Pp
+Send a
+.Dq REZERO UNIT
+command to the device.
+This is useful for devices that initially attach as a CD-ROM
+containing drivers.
+Upon receipt of this command, such devices may detach from the
+bus and reattach as a different type of device.
+.Pp
 .Nm start
 .Pp
 Send a
Index: scsictl.c
===================================================================
RCS file: /cvsroot/src/sbin/scsictl/scsictl.c,v
retrieving revision 1.31
diff -u -r1.31 scsictl.c
--- scsictl.c   28 Apr 2008 20:23:09 -0000      1.31
+++ scsictl.c   29 Jun 2009 08:40:40 -0000
@@ -82,6 +82,7 @@
 void   device_release(int, char *[]);
 void   device_reserve(int, char *[]);
 void   device_reset(int, char *[]);
+void   device_rezero(int, char *[]);
 void   device_debug(int, char *[]);
 void   device_prevent(int, char *[]);
 void   device_allow(int, char *[]);
@@ -102,6 +103,7 @@
        { "release",    "",                     device_release },
        { "reserve",    "",                     device_reserve },
        { "reset",      "",                     device_reset },
+       { "rezero",     "",                     device_rezero },
        { "debug",      "level",                device_debug },
        { "prevent",    "",                     device_prevent },
        { "allow",      "",                     device_allow },
@@ -807,6 +809,29 @@
 }
 
 /*
+ * device_rezero:
+ *
+ *     Issue a REZERO command to a SCSI device.
+ */
+void
+device_rezero(int argc, char *argv[])
+{
+       struct scsi_rezero_unit cmd;
+
+       /* No arguments. */
+       if (argc != 0)
+               usage();
+
+       memset(&cmd, 0, sizeof(cmd));
+
+       cmd.opcode = SCSI_REZERO_UNIT;
+
+       scsi_command(fd, &cmd, sizeof(cmd), NULL, 0, 10000, 0);
+
+       return;
+}
+
+/*
  * device_debug:
  *
  *     Set debug level to a SCSI device.


Home | Main Index | Thread Index | Old Index