usb/110991: [patch] QUIRK: Super Top IDE DEVICE (depends on usb/110988)

Michael Gmelin freebsdusb at bindone.de
Thu Mar 29 01:20:04 UTC 2007


>Number:         110991
>Category:       usb
>Synopsis:       [patch] QUIRK: Super Top IDE DEVICE (depends on usb/110988)
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-usb
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Mar 29 01:20:04 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator:     Michael Gmelin
>Release:        FreeBSD 6.2-RELEASE-p3 i386
>Organization:
/bin/done digital solutions GmbH
>Environment:
FreeBSD bombat.bindone.de 6.2-RELEASE-p3 FreeBSD 6.2-RELEASE-p3 #21: Wed Mar 28 04:08:44 CEST 2007     root at bombat.bindone.de:/usr/src/sys/i386/compile/bombat  i386
(CURRENT is affected as well)
[root at bombat ~]# camcontrol inquiry da0
pass1: <SAMSUNG HM160JC \0000\0000> Fixed Direct Access SCSI-0 device 
pass1: Serial Number 
pass1: 40.000MB/s transfers 

Raidsonic ICY BOX IB-220U-Wh USB PATA/SATA-to-USB adaptor. The chipset is also used in other IDE-to-USB that are broken in the same way, thus I stick with "Super Top IDE DEVICE".
UMASS device over SCSI

(the output below is from an already patched umass.c, but besides the quirk info it doesn't differ at all)
umass0: Super Top USB 2.0  IDE DEVICE, rev 2.00/2.01, addr 2
umass0: SCSI over Bulk-Only; quirks = 0x0080
umass0:2:0:-1: Attached to scbus2
da0 at umass-sim0 bus 0 target 0 lun 0
da0: <SAMSUNG HM160JC \0000\0000> Fixed Direct Access SCSI-0 device 
da0: 40.000MB/s transfers
da0: 152627MB (312581808 512 byte sectors: 255H 63S/T 19457C)


>Description:
Device can be attached without problems, but every attempt to write on it fails with error messages.
E.g.:

dd if=/dev/zero of=/dev/da0 count=10
da0: end of device
0+0 records in
0+0 records out

disklabel da0
read: Unknow error 0

newfs /dev/da0s1
(some error message like newfs: wtfs: invalid sector blabla)

Writing on a already formatted drive works, but the files disappear (most probably read not possible)

The chipset has the same problems on Linux and OpenBSD (read reports from users using the ICY BOX and other products and other releases of the chipset)

>How-To-Repeat:

>Fix:
The attached patches rely on the patch suggested in PR usb/110988(!!!)

Patch for usbdevs adds vendor and product (vendorId 0x14cd, productId 0x6600).
Patch for umass.c adds the following:
- New entry to umass_devdescrs
- New command protocol define: UMASS_PROTO_PROBE, which causes umass_match_proto
  to continue getting the correct protocol from the device, after quirks have been applied
  (this seems to be quite practical for maintenance)
  + make use of UMASS_PROTO_PROBE in umass_match_proto

again, this patch is against the patched umass.c that results from usb/110988, otherwise there is no change in (broken) behaviour.


Patch attached with submission follows:

--- usbdevs.orig	Thu Mar 15 16:23:52 2007
+++ usbdevs	Thu Mar 29 03:09:07 2007
@@ -514,6 +514,7 @@
 vendor RALINK		0x148f	Ralink Technology
 vendor IMAGINATION	0x149a	Imagination Technologies
 vendor CONCEPTRONIC	0x14b2	Conceptronic
+vendor SUPERTOP		0x14cd	Super Top
 vendor SILICONPORTALS	0x1527	Silicon Portals
 vendor PNY		0x154b	PNY
 vendor SOHOWARE		0x15e8	SOHOware
@@ -1596,6 +1597,9 @@
 product DIAMOND2 SUPRA2890	0x0b4a	SupraMax 2890 56K Modem
 product DIAMOND2 RIO600USB	0x5001	Rio 600 USB
 product DIAMOND2 RIO800USB	0x5002	Rio 800 USB
+
+/* Super Top products */
+product SUPERTOP IDEDEVICE 	0x6600 Super Top IDE DEVICE (e.g. ICY BOX)
 
 /* System TALKS, Inc. */
 product SYSTEMTALKS SGCX2UL	0x1920	SGC-X2UL
--- umass.c.orig	Thu Mar 29 02:08:06 2007
+++ umass.c	Thu Mar 29 03:10:20 2007
@@ -282,6 +282,7 @@
 #	define UMASS_PROTO_UFI		0x0400
 #	define UMASS_PROTO_RBC		0x0800
 #	define UMASS_PROTO_COMMAND	0xff00	/* command protocol mask */
+#	define UMASS_PROTO_PROBE	0xffff	/* probe the protocol, even if found in umass_devdescr) */
 
 	/* Device specific quirks */
 	u_int16_t	quirks;
@@ -494,6 +495,10 @@
 	  UMASS_PROTO_RBC | UMASS_PROTO_CBI,
 	  NO_QUIRKS
 	},
+	{ USB_VENDOR_SUPERTOP, USB_PRODUCT_SUPERTOP_IDEDEVICE, RID_WILDCARD,
+	  UMASS_PROTO_PROBE,
+	  IGNORE_RESIDUE
+	},
 	{ USB_VENDOR_TREK, USB_PRODUCT_TREK_THUMBDRIVE_8MB, RID_WILDCARD,
           UMASS_PROTO_ATAPI | UMASS_PROTO_BBB,
 	  IGNORE_RESIDUE
@@ -845,12 +850,18 @@
 		    	if (umass_devdescrs[i].rid == RID_WILDCARD) {
 				sc->proto = umass_devdescrs[i].proto;
 				sc->quirks = umass_devdescrs[i].quirks;
-				return (UMATCH_VENDOR_PRODUCT);
+				if (sc->proto == UMASS_PROTO_PROBE)
+					sc->proto = 0;
+				else
+					return (UMATCH_VENDOR_PRODUCT);
 			} else if (umass_devdescrs[i].rid ==
 			    UGETW(dd->bcdDevice)) {
 				sc->proto = umass_devdescrs[i].proto;
 				sc->quirks = umass_devdescrs[i].quirks;
-				return (UMATCH_VENDOR_PRODUCT_REV);
+				if (sc->proto == UMASS_PROTO_PROBE)
+					sc->proto = 0;
+				else
+					return (UMATCH_VENDOR_PRODUCT_REV);
 			} /* else RID does not match */
 		}
 	}

>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-usb mailing list