kern/72344: QUIRK: Dane-Elec zMate 512 MB USB flash drive (PNY USB DISK Pro)

parv at pair.com parv at pair.com
Mon Oct 4 22:00:47 PDT 2004


>Number:         72344
>Category:       kern
>Synopsis:       QUIRK: Dane-Elec zMate 512 MB USB flash drive (PNY USB DISK Pro)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Oct 05 05:00:46 GMT 2004
>Closed-Date:
>Last-Modified:
>Originator:     parv
>Release:        FreeBSD 4.10-RELEASE-p3 i386
>Organization:
>Environment:

Non-regular kernel configuration wrt USB and SCSI ...

  device  atapicam  #  burncd(1) doesn't in FreeBSD 4.10-p2
  options USB_DEBUG


>Description:

Add a QUIRK for "Dane-Elec zMate 512 MB USB flash drive" which is
identified as listed below.

BEFORE ADDING THE QUIRK
-----------------------
  INSERTION
  ---------
  umass0: PNY USB DISK Pro, rev 2.00/0.02, addr 2
  (da0:umass-sim0:0:0:0): got CAM status 0x4
  (da0:umass-sim0:0:0:0): fatal error, failed to attach to device
  (da0:umass-sim0:0:0:0): lost device
  (da0:umass-sim0:0:0:0): removing device entry

  DEV LIST
  --------
  # usbd -d -v
  usbd: device-detach event at 1096930120.119438000, product 0x1420, PNY:
    vndr=0x0d7d prdct=0x1420 rlse=0x0002 clss=0x0000 subclss=0x0000 prtcl=0x0000

  # camcontrol devlist -v
  scbus0 on ata0 bus 0:
  <  >                               at scbus0 target -1 lun -1 ()
  scbus1 on ata1 bus 0:
  <  >                               at scbus1 target -1 lun -1 ()
  scbus2 on umass-sim0 bus 0:
  < USB DISK Pro 1.08>               at scbus2 target 0 lun 0 (pass0)
  scbus-1 on xpt0 bus 0:
  <  >                               at scbus-1 target -1 lun -1 (xpt0)

  REMOVAL
  -------
  umass0: at uhub0 port 1 (addr 2) disconnected
  umass0: detached

AFTER ADDING THE QUIRK (listed elsewhere)
-----------------------------------------
  INSERTION
  ---------
  # dmesg | egrep -i 'uhci|usb|da0|pass0|scsi'
  uhci0: <Intel 82371AB/EB (PIIX4) USB controller> port 0x1060-0x107f irq 5 at device 7.2 on pci0
  usb0: <Intel 82371AB/EB (PIIX4) USB controller> on uhci0
  usb0: USB revision 1.0
  uhub0: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
  umass0: PNY USB DISK Pro, rev 2.00/0.02, addr 2, SCSI over Bulk-Only
  Creating DISK da0
  pass0 at umass-sim0 bus 0 target 0 lun 0
  pass0: < USB DISK Pro 1.08> Removable Direct Access SCSI-0 device
  pass0: Serial Number \^_
  pass0: 650KB/s transfers
  da0 at umass-sim0 bus 0 target 0 lun 0
  da0: < USB DISK Pro 1.08> Removable Direct Access SCSI-0 device
  da0: Serial Number \^_
  da0: 650KB/s transfers
  da0: 494MB (1012736 512 byte sectors: 64H 32S/T 494C)

  # camcontrol inquiry da0
  pass0: < USB DISK Pro 1.08> Removable Direct Access SCSI-0 device
  pass0: Serial Number
  pass0: 650KB/s transfers

  # camcontrol devlist -v
  scbus0 on umass-sim0 bus 0:
  < USB DISK Pro 1.08>               at scbus0 target 0 lun 0 (pass0,da0)
  scbus1 on ata0 bus 0:
  <  >                               at scbus1 target -1 lun -1 ()
  scbus2 on ata1 bus 0:
  <  >                               at scbus2 target -1 lun -1 ()
  scbus-1 on xpt0 bus 0:
  <  >                               at scbus-1 target -1 lun -1 (xpt0)

  # usbdevs -v
  Controller /dev/usb0:
  addr 1: full speed, self powered, config 1, UHCI root hub(0x0000), Intel(0x0000), rev 1.00
  port 1 addr 2: full speed, power 200 mA, config 1, USB DISK Pro(0x1420), PNY(0x0d7d), rev 0.02
  port 2 powered

  REMOVAL
  -------
  umass0: at uhub0 port 1 (addr 2) disconnected
  (pass0:umass-sim0:0:0:0): lost device
  (pass0:umass-sim0:0:0:0): removing device entry
  (da0:umass-sim0:0:0:0): lost device
  (da0:umass-sim0:0:0:0): removing device entry
  umass0: detached

  REINSERTION
  -----------
  umass0: PNY USB DISK Pro, rev 2.00/0.02, addr 2, SCSI over Bulk-Only
  umass0:0:0:-1: Attached to scbus0 as device 0
  pass0 at umass-sim0 bus 0 target 0 lun 0
  pass0: < USB DISK Pro 1.08> Removable Direct Access SCSI-0 device
  pass0: Serial Number
  pass0: 650KB/s transfers
  Creating DISK da0
  da0 at umass-sim0 bus 0 target 0 lun 0
  da0: < USB DISK Pro 1.08> Removable Direct Access SCSI-0 device
  da0: Serial Number
  da0: 650KB/s transfers
  da0: 494MB (1012736 512 byte sectors: 64H 32S/T 494C)


The patch is based on...

  http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/65436

...which adds support for "256MB PNY Attache USB 2.0 Flash Drive".
Purpose of this "QUIRK"/patch is mainly and only to add an identifier
for the Dane-Elec 512 MB USB flash drive to make it usable.


>How-To-Repeat:

On FreeBSD 4.10-p3, install the kernel with all the necessary/standard
USB/SCSI options.  Insert above mentioned device; see the kernel
messages.

  (After applying the patch AND before recompiling the kernel, run "cd
  /sys/dev/usb && make -f Makefile.usbdevs" as usbdevs(_data).h
  are/were not generated with only a kernel build even after
  (re)moving them.)

>Fix:

--- /sys/cam/scsi/scsi_da.c.orig	Mon Oct  4 19:03:33 2004
+++ /sys/cam/scsi/scsi_da.c	Mon Oct  4 19:11:37 2004
@@ -310,6 +310,15 @@
 		{T_DIRECT, SIP_MEDIA_REMOVABLE, "SigmaTel", "MSCN", "*"},
 		/*quirks*/ DA_Q_NO_SYNC_CACHE|DA_Q_NO_PREVENT
 	},
+	{
+		/*
+		 * Dane-Elec USB 2.0 512 MB flash drive
+		 * based on PR kern/65436, PNY Attache 256MB USB 2.0 Flash
+		 * Drive, opened by Peter D Quilty <pdquilty at adelphia.net>
+		 */
+		{T_DIRECT, SIP_MEDIA_REMOVABLE, "*", "USB DISK*", "*"},
+		/*quirks*/ DA_Q_NO_SYNC_CACHE
+	},
 };
 
 static	d_open_t	daopen;
--- /sys/dev/usb/usbdevs.orig	Mon Oct  4 18:50:40 2004
+++ /sys/dev/usb/usbdevs	Mon Oct  4 19:47:10 2004
@@ -1074,6 +1074,7 @@
 
 /* PNY products */
 product PNY ATTACHE		0x1300	USB 2.0 Flash Drive
+product PNY DISKPRO512		0x1420	USB 2.0 Flash Drive (DANE-ELEC zMate 512MB USB flash drive)
 
 /* Primax products */
 product PRIMAX G2X300		0x0300	G2-200 scanner
--- /sys/dev/usb/umass.c.orig	Mon Oct  4 18:54:47 2004
+++ /sys/dev/usb/umass.c	Mon Oct  4 19:30:52 2004
@@ -739,7 +739,8 @@
 		sc->quirks |= NO_TEST_UNIT_READY;
 	}
 	if (UGETW(dd->idVendor) == USB_VENDOR_PNY &&
-	    UGETW(dd->idProduct) == USB_PRODUCT_PNY_ATTACHE) {
+	    (UGETW(dd->idProduct) == USB_PRODUCT_PNY_ATTACHE ||
+	     UGETW(dd->idProduct) == USB_PRODUCT_PNY_DISKPRO512)) {
 		sc->proto = UMASS_PROTO_SCSI | UMASS_PROTO_BBB;
 		sc->quirks |= IGNORE_RESIDUE;
 	}
>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list