Hi all.  A few weeks ago I posted a similar patch for the Datafab and Jumpshot
drivers to LMKL but wanted to wait until my kernel dev box was back online
before I made a patch against linux-usb CVS.  Here it is.  I broke it into two 
separate patches: the first is for Configure.help and the second is a diff 
against linux-usb CVS.

Change summary:
  - Updates to Configure.help for Datafab and Jumpshot drivers
  - I re-added teh "EXPERIMENTAL" label to these drivers due to their nature
  - Added a patch by Joerg Schneider to handle media change events
  - It looks like the name USB_CLASS_DATA in include/linux/usb.h was changed
    to USB_CLASS_CDC_DATA in one of the 2.4.17 pre-patches.  I made the
    corresponding change to drivers/usb/devices.c 

Patch 1:
--------

--- Configure.help      Sat Jan 12 08:41:51 2002
+++ Configure.help.orig Sat Jan 12 08:40:36 2002
@@ -22620,21 +22620,12 @@
   Please note that the driver is still experimental.  And of course,
   you will need both USB and IrDA support in your kernel...
 
-Datafab/OnSpec Compact Flash Reader support
+Datafab MDCFE-B Compact Flash Reader support
 CONFIG_USB_STORAGE_DATAFAB
-  Say Y here to include additional code to support various CompactFlash
-  readers based on Datafab/OnSpec chipsets.  SmartMedia readers based
-  on these chipsets are generally unsupported -- the exception being 
-  those based on the 07c4:a006 chipset which do appear to work.
-
-  Please note that this sub-driver doesn't work for ALL Datafab/OnSpec
-  based CompactFlash readers.  Notably, it will not work with readers
-  using the newer b000 chipset and some a109-based readers also appear
-  to be non-functional.
-
-  Please be aware that this sub-driver is considered EXPERIMENTAL and can
-  result in a kernel crash (or worse!) if things go awry.  Don't use it for
-  mission-critical work.  If in doubt, select N.
+  This option enables a sub-driver of the USB Mass Storage driver.  These
+  sub-drivers are considered experimental, and should only be used by very
+  brave people.  System crashes and other bad things are likely to occur if
+  you use this driver.  If in doubt, select N.
 
 HP CD-Writer 82xx support
 CONFIG_USB_STORAGE_HP8200e
@@ -22645,10 +22636,10 @@
 
 Lexar Jumpshot Compact Flash Reader
 CONFIG_USB_STORAGE_JUMPSHOT       
-  Say Y here to include support for the Lexar Jumpshot CompactFlash
-  reader.  Please be aware that this is considered EXPERIMENTAL and can
-  result in a kernel crash (or worse!) if things go awry.  Don't use it
-  for mission-critical work.  If in doubt, select N.
+  This option enables a sub-driver of the USB Mass Storage driver.  These
+  sub-drivers are considered experimental, and should only be used by very
+  brave people.  System crashes and other bad things are likely to occur if
+  you use this driver.  If in doubt, select N.
 
 Winbond W83977AF IrDA Device Driver
 CONFIG_WINBOND_FIR


Patch 2:
--------

Index: usb/Config.in
===================================================================
RCS file: /cvsroot/linux-usb/usb/Config.in,v
retrieving revision 1.29
diff -a -u -r1.29 Config.in
--- usb/Config.in       2001/11/25 06:28:28     1.29
+++ usb/Config.in       2002/01/12 15:26:35
@@ -34,13 +34,13 @@
 dep_tristate '  USB Bluetooth support (EXPERIMENTAL)' CONFIG_USB_BLUETOOTH 
$CONFIG_USB $CONFIG_EXPERIMENTAL
 dep_tristate '  USB Mass Storage support' CONFIG_USB_STORAGE $CONFIG_USB $CONFIG_SCSI
    dep_mbool '    USB Mass Storage verbose debug' CONFIG_USB_STORAGE_DEBUG 
$CONFIG_USB_STORAGE
-   dep_mbool '    Datafab MDCFE-B Compact Flash Reader support' 
CONFIG_USB_STORAGE_DATAFAB $CONFIG_USB_STORAGE $CONFIG_EXPERIMENTAL
+   dep_mbool '    Datafab/OnSpec Compact Flash Reader support (EXPERIMENTAL)' 
+CONFIG_USB_STORAGE_DATAFAB $CONFIG_USB_STORAGE $CONFIG_EXPERIMENTAL
    dep_mbool '    Freecom USB/ATAPI Bridge support' CONFIG_USB_STORAGE_FREECOM  
$CONFIG_USB_STORAGE
    dep_mbool '    ISD-200 USB/ATA Bridge support' CONFIG_USB_STORAGE_ISD200 
$CONFIG_USB_STORAGE
    dep_mbool '    Microtech CompactFlash/SmartMedia support' CONFIG_USB_STORAGE_DPCM 
$CONFIG_USB_STORAGE
    dep_mbool '    HP CD-Writer 82xx support' CONFIG_USB_STORAGE_HP8200e 
$CONFIG_USB_STORAGE $CONFIG_EXPERIMENTAL
    dep_mbool '    SanDisk SDDR-09 (and other SmartMedia) support' 
CONFIG_USB_STORAGE_SDDR09 $CONFIG_USB_STORAGE $CONFIG_EXPERIMENTAL
-   dep_mbool '    Lexar Jumpshot Compact Flash Reader' CONFIG_USB_STORAGE_JUMPSHOT 
$CONFIG_USB_STORAGE $CONFIG_EXPERIMENTAL
+   dep_mbool '    Lexar Jumpshot Compact Flash Reader (EXPERIMENTAL)' 
+CONFIG_USB_STORAGE_JUMPSHOT $CONFIG_USB_STORAGE $CONFIG_EXPERIMENTAL
 dep_tristate '  USB Modem (CDC ACM) support' CONFIG_USB_ACM $CONFIG_USB
 dep_tristate '  USB Printer support' CONFIG_USB_PRINTER $CONFIG_USB
 
Index: usb/devices.c
===================================================================
RCS file: /cvsroot/linux-usb/usb/devices.c,v
retrieving revision 1.11
diff -a -u -r1.11 devices.c
--- usb/devices.c       2001/11/25 06:18:09     1.11
+++ usb/devices.c       2002/01/12 15:26:35
@@ -139,7 +139,7 @@
        {USB_CLASS_PHYSICAL,            "PID"},
        {USB_CLASS_PRINTER,             "print"},
        {USB_CLASS_MASS_STORAGE,        "stor."},
-       {USB_CLASS_DATA,                "data"},
+       {USB_CLASS_CDC_DATA,            "data"},
        {USB_CLASS_APP_SPEC,            "app."},
        {USB_CLASS_VENDOR_SPEC,         "vend."},
        {-1,                            "unk."}         /* leave as last */
Index: usb/storage/datafab.c
===================================================================
RCS file: /cvsroot/linux-usb/storage/datafab.c,v
retrieving revision 1.5
diff -a -u -r1.5 datafab.c
--- usb/storage/datafab.c       2001/12/08 23:32:48     1.5
+++ usb/storage/datafab.c       2002/01/12 15:26:36
@@ -1,5 +1,7 @@
 /* Driver for Datafab USB Compact Flash reader
  *
+ * $Id$
+ *
  * datafab driver v0.1:
  *
  * First release
@@ -10,6 +12,7 @@
  *   which I used as a template for this driver.
  *   Some bugfixes and scatter-gather code by Gregory P. Smith 
  *   ([EMAIL PROTECTED])
+ *   Fix for media change by Joerg Schneider ([EMAIL PROTECTED])
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the
@@ -799,6 +802,23 @@
                // popping the media out of the device (no locking doors, etc)
                //
                return USB_STOR_TRANSPORT_GOOD;
+       }
+
+       if (srb->cmnd[0] == START_STOP) {
+               /* this is used by sd.c'check_scsidisk_media_change to detect
+                  media change */
+               US_DEBUGP("datafab_transport:  START_STOP.\n");
+               /* the first datafab_id_device after a media change returns
+                  an error (determined experimentally) */
+               rc = datafab_id_device(us, info);
+               if (rc == USB_STOR_TRANSPORT_GOOD) {
+                       info->sense_key = NO_SENSE;
+                       srb->result = SUCCESS;
+               } else {
+                       info->sense_key = UNIT_ATTENTION;
+                       srb->result = CHECK_CONDITION;
+               }
+               return rc;
        }
 
        US_DEBUGP("datafab_transport:  Gah! Unknown command: %d (0x%x)\n", 
srb->cmnd[0], srb->cmnd[0]);
Index: usb/storage/jumpshot.c
===================================================================
RCS file: /cvsroot/linux-usb/storage/jumpshot.c,v
retrieving revision 1.5
diff -a -u -r1.5 jumpshot.c
--- usb/storage/jumpshot.c      2001/12/08 23:32:48     1.5
+++ usb/storage/jumpshot.c      2002/01/12 15:26:36
@@ -1,5 +1,7 @@
 /* Driver for Lexar "Jumpshot" Compact Flash reader
  *
+ * $Id$
+ *
  * jumpshot driver v0.1:
  *
  * First release
@@ -10,6 +12,7 @@
  *   which I used as a template for this driver.
  *   Some bugfixes and scatter-gather code by Gregory P. Smith 
  *   ([EMAIL PROTECTED])
+ *   Fix for media change by Joerg Schneider ([EMAIL PROTECTED])
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the
@@ -797,6 +800,23 @@
                // the media out of the device (no locking doors, etc)
                //
                return USB_STOR_TRANSPORT_GOOD;
+       }
+       
+       if (srb->cmnd[0] == START_STOP) {
+               /* this is used by sd.c'check_scsidisk_media_change to detect
+                  media change */
+               US_DEBUGP("jumpshot_transport:  START_STOP.\n");
+               /* the first datafab_id_device after a media change returns
+                  an error (determined experimentally) */
+               rc = jumpshot_id_device(us, info);
+               if (rc == USB_STOR_TRANSPORT_GOOD) {
+                       info->sense_key = NO_SENSE;
+                       srb->result = SUCCESS;
+               } else {
+                       info->sense_key = UNIT_ATTENTION;
+                       srb->result = CHECK_CONDITION;
+               }
+               return rc;
        }
 
        US_DEBUGP("jumpshot_transport:  Gah! Unknown command: %d (0x%x)\n", 
srb->cmnd[0], srb->cmnd[0]);
Index: usb/storage/unusual_devs.h
===================================================================
RCS file: /cvsroot/linux-usb/storage/unusual_devs.h,v
retrieving revision 1.24
diff -a -u -r1.24 unusual_devs.h
--- usb/storage/unusual_devs.h  2001/12/29 03:12:45     1.24
+++ usb/storage/unusual_devs.h  2002/01/12 15:26:37
@@ -289,7 +289,7 @@
                "Lexar",
                "Jumpshot USB CF Reader",
                US_SC_SCSI, US_PR_JUMPSHOT, NULL,
-               US_FL_MODE_XLATE | US_FL_START_STOP ),
+               US_FL_MODE_XLATE ),
 #endif
 
 UNUSUAL_DEV(  0x0644, 0x0000, 0x0100, 0x0100, 
@@ -381,7 +381,7 @@
                "Datafab",
                "MDCFE-B USB CF Reader",
                US_SC_SCSI, US_PR_DATAFAB, NULL,
-               US_FL_MODE_XLATE | US_FL_START_STOP ),
+               US_FL_MODE_XLATE ),
 
        /*
         * The following Datafab-based devices may or may not work
@@ -398,38 +398,38 @@
                "SIIG/Datafab",
                "SIIG/Datafab Memory Stick+CF Reader/Writer",
                US_SC_SCSI, US_PR_DATAFAB, NULL,
-               US_FL_MODE_XLATE | US_FL_START_STOP ),
+               US_FL_MODE_XLATE ),
 
 UNUSUAL_DEV( 0x07c4, 0xa003, 0x0000, 0xffff,
                "Datafab/Unknown",
                "Datafab-based Reader",
                US_SC_SCSI, US_PR_DATAFAB, NULL,
-               US_FL_MODE_XLATE | US_FL_START_STOP ),
+               US_FL_MODE_XLATE ),
 
 UNUSUAL_DEV( 0x07c4, 0xa004, 0x0000, 0xffff,
                "Datafab/Unknown",
                "Datafab-based Reader",
                US_SC_SCSI, US_PR_DATAFAB, NULL,
-               US_FL_MODE_XLATE | US_FL_START_STOP ),
+               US_FL_MODE_XLATE ),
 
 UNUSUAL_DEV( 0x07c4, 0xa005, 0x0000, 0xffff,
                "PNY/Datafab",
                "PNY/Datafab CF+SM Reader",
                US_SC_SCSI, US_PR_DATAFAB, NULL,
-               US_FL_MODE_XLATE | US_FL_START_STOP ),
+               US_FL_MODE_XLATE ),
 
 UNUSUAL_DEV( 0x07c4, 0xa006, 0x0000, 0xffff,
                "Simple Tech/Datafab",
                "Simple Tech/Datafab CF+SM Reader",
                US_SC_SCSI, US_PR_DATAFAB, NULL,
-               US_FL_MODE_XLATE | US_FL_START_STOP ),
+               US_FL_MODE_XLATE ),
 
 /* Submitted by Olaf Hering <[EMAIL PROTECTED]> */
 UNUSUAL_DEV(  0x07c4, 0xa109, 0x0000, 0xffff,
                "Datafab Systems, Inc.",
                "USB to CF + SM Combo (LC1)",
                US_SC_SCSI, US_PR_DATAFAB, NULL,
-               US_FL_MODE_XLATE | US_FL_START_STOP ),
+               US_FL_MODE_XLATE ),
 #endif
 
 /* Casio QV 2x00/3x00/4000/8000 digital still cameras are not conformant


Jimmie

-- 
Jimmie Mayfield  
http://www.sackheads.org/mayfield       email: [EMAIL PROTECTED]
My mail provider does not welcome UCE -- http://www.sackheads.org/uce


_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to