Subject: Re: sony memory stick and umass quirks
To: MAEKAWA Masahide <bishop@rr.iij4u.or.jp>
From: john heasley <heas@shrubbery.net>
List: current-users
Date: 05/20/2002 03:29:42
Mon, May 06, 2002 at 12:46:43PM +0900, MAEKAWA Masahide:
> john heasley <heas@shrubbery.net> wrote:
> >before i start digging; are the defined quirks documented anywhere?
> >umassvar.h has them (all?), but is thin on documentation.  anyone have
> >pointers on where i might look first?
> 
> The quirks (uq_flags) are defined in sys/dev/usb/umassvar.h.
> The quirks (uq_busquirks) are defined in sys/dev/scsipi/scsipiconf.h.
> 
> --- MAEKAWA Masahide @ AXE,Inc.
> --- Key fingerprint = BC5E D8CB 816C 2CB5 8560  FDE3 6CB8 BF5D 8D50 F2EE

after going through the umass spec and a little trial and error, i came
up with following changes to umass_quirks.c for the MSC memory stick.  the
memory stick slot on this vaio z505ls with an 8m and 128m stick works
reliably.  i'm not getting errors writing data to a mounted partition (msdos
from a sony dsc camera).  this might fix the similar errors with accessing
the memory stick through a dsc camera, but i havent tried it.

i have no idea why it reports 'drive offline' when it has medium inserted.

dmesg w/o medium:
uhub1 at uhub0 port 1
uhub1: Philips Semiconductors hub, class 9/0, rev 1.10/1.10, addr 2
uhub1: 3 ports with 3 removable, self powered
umass0 at uhub1 port 1 configuration 1 interface 0
umass0: Sony USB Memory Stick Slot, rev 1.10/1.31, addr 3
umass0: using UFI over CBI
atapibus0 at umass0 channel 0: 2 targets
sd0 at atapibus0 drive 0: <, , > type 0 direct fixed
sd0: drive offline
boot device: wd0

dmesg w/ medium:
uhub1 at uhub0 port 1
uhub1: Philips Semiconductors hub, class 9/0, rev 1.10/1.10, addr 2
uhub1: 3 ports with 3 removable, self powered
umass0 at uhub1 port 1 configuration 1 interface 0
umass0: Sony USB Memory Stick Slot, rev 1.10/1.31, addr 3
umass0: using UFI over CBI
atapibus0 at umass0 channel 0: 2 targets
sd0 at atapibus0 drive 0: <, , > type 0 direct fixed
sd0: drive offline
boot device: wd0

Index: umass_quirks.c
===================================================================
RCS file: /cvsroot/syssrc/sys/dev/usb/umass_quirks.c,v
retrieving revision 1.13
diff -u -r1.13 umass_quirks.c
--- umass_quirks.c	2002/04/22 12:48:40	1.13
+++ umass_quirks.c	2002/05/20 03:19:46
@@ -155,11 +155,11 @@
 	},
 
 	{ { USB_VENDOR_SONY, USB_PRODUCT_SONY_MSC },
-	  UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UNSPEC,
-	  UMASS_QUIRK_FORCE_SHORT_INQUIRY,
-	  0,
+	  UMASS_WPROTO_CBI, UMASS_CPROTO_UFI,
+	  UMASS_QUIRK_FORCE_SHORT_INQUIRY | UMASS_QUIRK_RS_NO_CLEAR_UA,
+	  PQUIRK_NOMODESENSE,
 	  UMATCH_DEVCLASS_DEVSUBCLASS_DEVPROTO,
-	  NULL, umass_fixup_sony
+	  NULL, NULL
 	},
 
 	{ { USB_VENDOR_SONY, USB_PRODUCT_ANY },