Subject: kern/20666: SanDisk ImageMate 6-in-1 card reader needs quirk table entry
To: None <gnats-bugs@gnats.netbsd.org>
From: seebs <seebs@vash.cel.plethora.net>
List: netbsd-bugs
Date: 03/11/2003 22:36:57
>Number:         20666
>Category:       kern
>Synopsis:       SanDisk ImageMate 6-in-1 card reader needs quirk table entry
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Mar 11 21:38:00 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     seebs
>Release:        NetBSD 1.6P
>Organization:
>Environment:
System: NetBSD vash.cel.plethora.net 1.6P NetBSD 1.6P (VASH) #0: Tue Mar 11 18:31:01 CST 2003 root@vash.cel.plethora.net:/usr/src/sys/arch/i386/compile/VASH i386
Architecture: i386
Machine: i386
>Description:
	The SanDisk ImageMate 6-in-1 card reader is a SCSI device with 4 LUNs,
	each of which corresponds to one of its four ports.  (One port does CF
	and MicroDrive, one does SecureDigital and MMC, thus the "6" part.)

	However, there's a test in scsiconf.c which, since this device has
	"version 0", makes NetBSD assume it can't handle LUNs.  We can either
	fix the version or set PQUIRK_FORCELUNS.

>How-To-Repeat:
	Plug it in.

>Fix:
	This fix adds the device to usbdevs, and puts in the corresponding
	quirk.  I would not be surprised if a "better" fix were to set the
	version to something other than 0, but this works fine.

Index: umass_quirks.c
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/umass_quirks.c,v
retrieving revision 1.34
diff -c -r1.34 umass_quirks.c
*** umass_quirks.c	2003/02/24 13:11:55	1.34
--- umass_quirks.c	2003/03/12 05:35:21
***************
*** 154,160 ****
  	  NULL, NULL
  	},
  
- 
  	{ { USB_VENDOR_MELCO, USB_PRODUCT_MELCO_DUBPXXG },
  	  UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UNSPEC,
  	  UMASS_QUIRK_FORCE_SHORT_INQUIRY | UMASS_QUIRK_NO_START_STOP,
--- 154,159 ----
***************
*** 255,260 ****
--- 254,267 ----
  	  UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UNSPEC,
  	  0,
  	  PQUIRK_NOMODESENSE | PQUIRK_NODOORLOCK,
+ 	  UMATCH_VENDOR_PRODUCT,
+ 	  NULL, NULL
+ 	},
+ 
+ 	{ { USB_VENDOR_SANDISK, USB_PRODUCT_SANDISK_SDDR86 },
+ 	  UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UNSPEC,
+ 	  0,
+ 	  PQUIRK_FORCELUNS,
  	  UMATCH_VENDOR_PRODUCT,
  	  NULL, NULL
  	},
Index: usbdevs
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/usbdevs,v
retrieving revision 1.307
diff -c -r1.307 usbdevs
*** usbdevs	2003/02/24 13:06:45	1.307
--- usbdevs	2003/03/12 05:35:23
***************
*** 1197,1202 ****
--- 1197,1203 ----
  product SANDISK SDDR31		0x0002	ImageMate SDDR-31
  product SANDISK SDDR12		0x0100	ImageMate SDDR-12
  product SANDISK SDDR09		0x0200	ImageMate SDDR-09
+ product	SANDISK	SDDR86		0x0621	ImageMate 6-in-1 (SDDR-86)
  
  /* Sanwa Supply products */
  product SANWASUPPLY JYDV9USB	0x9806	JY-DV9USB gamepad
Index: usbdevs.h
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/usbdevs.h,v
retrieving revision 1.312
diff -c -r1.312 usbdevs.h
*** usbdevs.h	2003/02/24 13:07:52	1.312
--- usbdevs.h	2003/03/12 05:35:25
***************
*** 1,4 ****
! /*	$NetBSD: usbdevs.h,v 1.312 2003/02/24 13:07:52 nakayama Exp $	*/
  
  /*
   * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
--- 1,4 ----
! /*	$NetBSD$	*/
  
  /*
   * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
***************
*** 1204,1209 ****
--- 1204,1210 ----
  #define	USB_PRODUCT_SANDISK_SDDR31	0x0002		/* ImageMate SDDR-31 */
  #define	USB_PRODUCT_SANDISK_SDDR12	0x0100		/* ImageMate SDDR-12 */
  #define	USB_PRODUCT_SANDISK_SDDR09	0x0200		/* ImageMate SDDR-09 */
+ #define	USB_PRODUCT_SANDISK_SDDR86	0x0621		/* ImageMate 6-in-1 (SDDR-86) */
  
  /* Sanwa Supply products */
  #define	USB_PRODUCT_SANWASUPPLY_JYDV9USB	0x9806		/* JY-DV9USB gamepad */
Index: usbdevs_data.h
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/usbdevs_data.h,v
retrieving revision 1.313
diff -c -r1.313 usbdevs_data.h
*** usbdevs_data.h	2003/02/24 13:07:52	1.313
--- usbdevs_data.h	2003/03/12 05:35:29
***************
*** 1,4 ****
! /*	$NetBSD: usbdevs_data.h,v 1.313 2003/02/24 13:07:52 nakayama Exp $	*/
  
  /*
   * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
--- 1,4 ----
! /*	$NetBSD$	*/
  
  /*
   * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
***************
*** 3206,3211 ****
--- 3206,3217 ----
  	    0,
  	    "SanDisk Corp",
  	    "ImageMate SDDR-09",
+ 	},
+ 	{
+ 	    USB_VENDOR_SANDISK, USB_PRODUCT_SANDISK_SDDR86,
+ 	    0,
+ 	    "SanDisk Corp",
+ 	    "ImageMate 6-in-1 (SDDR-86)",
  	},
  	{
  	    USB_VENDOR_SANWASUPPLY, USB_PRODUCT_SANWASUPPLY_JYDV9USB,
>Release-Note:
>Audit-Trail:
>Unformatted: