From owner-freebsd-usb@FreeBSD.ORG Thu Mar 29 01:20:04 2007 Return-Path: X-Original-To: freebsd-usb@hub.freebsd.org Delivered-To: freebsd-usb@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8F65516A401 for ; Thu, 29 Mar 2007 01:20:04 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id 718CA13C487 for ; Thu, 29 Mar 2007 01:20:04 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l2T1K4Ss020162 for ; Thu, 29 Mar 2007 01:20:04 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l2T1K47Y020161; Thu, 29 Mar 2007 01:20:04 GMT (envelope-from gnats) Resent-Date: Thu, 29 Mar 2007 01:20:04 GMT Resent-Message-Id: <200703290120.l2T1K47Y020161@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-usb@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Michael Gmelin Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A1A3B16A413 for ; Thu, 29 Mar 2007 01:18:05 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [69.147.83.33]) by mx1.freebsd.org (Postfix) with ESMTP id 7A61813C480 for ; Thu, 29 Mar 2007 01:18:05 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.13.1/8.13.1) with ESMTP id l2T1I5ZE045723 for ; Thu, 29 Mar 2007 01:18:05 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.13.1/8.13.1/Submit) id l2T1D3Bw045123; Thu, 29 Mar 2007 01:13:03 GMT (envelope-from nobody) Message-Id: <200703290113.l2T1D3Bw045123@www.freebsd.org> Date: Thu, 29 Mar 2007 01:13:03 GMT From: Michael Gmelin To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.0 Cc: Subject: usb/110991: [patch] QUIRK: Super Top IDE DEVICE (depends on usb/110988) X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Mar 2007 01:20:04 -0000 >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@bombat.bindone.de:/usr/src/sys/i386/compile/bombat i386 (CURRENT is affected as well) [root@bombat ~]# camcontrol inquiry da0 pass1: 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: 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: