From nobody@FreeBSD.org  Mon May 24 00:31:25 2004
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 83D1616A4CF
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 24 May 2004 00:31:25 -0700 (PDT)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 7D63B43D39
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 24 May 2004 00:31:25 -0700 (PDT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.12.11/8.12.11) with ESMTP id i4O7UjAl043543
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 24 May 2004 00:30:45 -0700 (PDT)
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.12.11/8.12.11/Submit) id i4O7Uj2F043542;
	Mon, 24 May 2004 00:30:45 -0700 (PDT)
	(envelope-from nobody)
Message-Id: <200405240730.i4O7Uj2F043542@www.freebsd.org>
Date: Mon, 24 May 2004 00:30:45 -0700 (PDT)
From: "Jukka A. Ukkonen" <jau@iki.fi>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Added support for Neodio-3260 8-in-1 multi format USB memory card / flash controller
X-Send-Pr-Version: www-2.3

>Number:         67115
>Category:       kern
>Synopsis:       QUIRK: Neodio-3260 8-in-1 multi format USB memory card / flash controller
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    sanpei
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Mon May 24 00:40:14 PDT 2004
>Closed-Date:    Sun Jun 13 07:48:12 GMT 2004
>Last-Modified:  Sun Jun 13 07:48:12 GMT 2004
>Originator:     Jukka A. Ukkonen
>Release:        4.10-PRERELEASE
>Organization:
Mawit Ltd.
>Environment:
FreeBSD mjolnir 4.10-PRERELEASE FreeBSD 4.10-PRERELEASE #16: Mon May 24 09:39:44 EEST 2004     root@mjolnir:/usr/src/sys/compile/Mjolnir  i386
>Description:
      These changes allow FreeBSD to mount various types of memory cards
via Neodio-3260 multi port/format control devices.

>How-To-Repeat:
      No problem. Added functionality.
>Fix:
      Find the unidiff formatted patch below.
(The tab characters have been preserved.)



--- umass.c.old	Mon May 24 09:53:27 2004
+++ umass.c	Mon May 24 09:55:39 2004
@@ -596,6 +596,28 @@
 
 	dd = usbd_get_device_descriptor(udev);
 
+	/*
+	 *  Some examples about the inquiry fuzz...
+	 *  http://www.harald-schreiber.de/linux-2.4.2-Casio-QV.diff
+	 *  http://guillaume.valerie-et-guillaume.com/C1700T/
+	 */
+
+	if (UGETW(dd->idVendor) == USB_VENDOR_NEODIO) {
+	    switch (UGETW(dd->idProduct)) {
+	    case    USB_PRODUCT_NEODIO_ND3260:
+	    case    USB_PRODUCT_NEODIO_ND5010:
+		sc->proto = UMASS_PROTO_SCSI | UMASS_PROTO_BBB;
+		sc->quirks |= FORCE_SHORT_INQUIRY;
+
+		return(UMATCH_VENDOR_PRODUCT);
+		break;
+
+	    default:
+		/* void */;
+		break;
+	    }
+	}
+
 	/* XXX ATAPI support is untested. Don't use it for the moment */
 	if (UGETW(dd->idVendor) == USB_VENDOR_SHUTTLE
 	    && UGETW(dd->idProduct) == USB_PRODUCT_SHUTTLE_EUSB) {
--- usbdevs.old	Thu May 20 19:12:54 2004
+++ usbdevs	Mon May 24 09:56:25 2004
@@ -1004,6 +1004,7 @@
 
 /* NEODIO products */
 product NEODIO ND5010		0x5010	Multi-format Flash Controller
+product NEODIO ND3260		0x3260	8-in-1 Multi-format Flash Controller
 
 /* NetChip Technology Products */
 product NETCHIP TURBOCONNECT	0x1080	Turbo-Connect

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->sanpei 
Responsible-Changed-By: nork 
Responsible-Changed-When: Mon May 24 02:45:35 PDT 2004 
Responsible-Changed-Why:  
Over to quack master. 

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

From: MIHIRA Sanpei Yoshiro <sanpei@sanpei.org>
To: freebsd-gnats-submit@FreeBSD.org, jau@iki.fi
Cc:  
Subject: Re: kern/67115: Added support for Neodio-3260 8-in-1 multi format
 USB memory card / flash controller
Date: Thu, 03 Jun 2004 22:59:00 +0900 (JST)

 Hi.
 
   Please send below information to gnats DB.
 	Output of "camcontrol inquiry yourdevice" 
 	Output of "usbdevs -v" with device attached 
 
   If you send, I will commit your patch. 
 
 Thank you.
 ---
 MIHIRA, Sanpei Yoshiro
 Tokyo, Japan.

From: jau@iki.fi (Jukka A. Ukkonen)
To: sanpei@sanpei.org
Cc:  
Subject: Re: kern/67115: Added support for Neodio-3260 8-in-1 multi format USB memory card / flash controller
Date: Thu, 3 Jun 2004 20:26:43 +0300 (EEST)

 	Howdy!
 
 	I noticed that you had requested for some additional info
 	related to the Neodio patch I sent.
 	Sorry, if this has been delayed a bit. My spam filter was
 	apparently a bit too eager to destroy incoming mail, and
 	your mail got dropped before it got delivered to my mailbox.
 	Luckily I noticed your request when I checked the status of
 	of the change request.
 
 	So, here goes "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 98 mA, config 1, USB Storage Device(0x3260), Generic(0x0aec), rev 1.00
  port 2 powered
 
 	after the memory media has been inserted the output changes 
 	to ...
 
 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 98 mA, config 1, 8-in-1 Multi-format Flash Controller(0x3260), Neodio(0x0aec), rev 1.00
  port 2 powered
 
 	The changing "usbdevs -v" info seem to indicate that the USB
 	driver for some odd reason digs up the actual code to name 
 	mappings only after the memory media has been inserted.
 
 
 	Similarly here is the output from "camcontrol inquiry da4"
 	(if I change da4 to pass5, the output is obviously the same).
 
 pass5: <Zynet USB Storage-SMC I03A> Removable Direct Access SCSI-0 device
 pass5: Serial Number
 pass5: 150KB/s transfers
 
 	For the da5/pass6 slot inquiry shows...
 
 pass6: <Zynet USB Storage-CFC I03A> Removable Direct Access SCSI-0 device
 pass6: Serial Number
 pass6: 150KB/s transfers
 
 	The device can be attached to both USB-1.1 and USB-2.0. In
 	this case it was attached to USB-1.1.
 	After I do "camcontrol rescan 5:0:0; camcontrol rescan 5:0:1;
 	camcontrol rescan 5:0:2; camcontrol rescan 5:0:3" all of the
 	four physical slots (which can handle 2 distinct card formats
 	each) become visible in "camcontrol devlist -v" output and
 	also mountable.
 
 scbus5 on umass-sim0 bus 0:
 <Zynet USB Storage-SMC I03A>       at scbus5 target 0 lun 0 (da4,pass5)
 <Zynet USB Storage-CFC I03A>       at scbus5 target 0 lun 1 (da5,pass6)
 <Zynet USB Storage-MMC I03A>       at scbus5 target 0 lun 2 (da6,pass7)
 <Zynet USB Storage-MSC I03A>       at scbus5 target 0 lun 3 (da7,pass8)
 
 	E.g. when the card used is a CFC (Compact Flash Card) mount
 	works as shown below.
 
 # mount -p -t msdos /dev/da5s1 /USB/flash
 /dev/da5s1      /USB/flash      msdos rw        0 0
 
 
 	Anyhow there seems to be something odd about how the driver
 	handles the insertion of the actual memory media. If the media
 	is inserted to the controller when the controller is already
 	plugged in to the USB connector the inquiry data seems to be
 	lost.
 	OTOH the command "camcontrol devlist -v" still shows the
 	controller and logical sub devices until I do a rescan.
 	The inquiry data becomes available when the controller is
 	plugged to the USB connector only after the memory media is
 	already inserted in the controller.
 
 	I hope this helps.
 
 
 	Cheers,
 		// jau
 .---  ..-  -.-  -.-  .-    .-  .-.-.-    ..-  -.-  -.-  ---  -.  .  -.
   /    Jukka A. Ukkonen,                            Mawit Ltd, Finland
  /__   M.Sc. (sw-eng & cs)                    (Phone) +358-500-606-671
    /   Internet: Jukka.Ukkonen(a)Mawit.Com      (Home) +358-9-6215-280
   /    Internet: ukkonen(a)nic.funet.fi
  v     Internet: jau(a)iki.fi               
 
 + + + + My opinions are mine and mine alone, not my employers. + + + +
 
State-Changed-From-To: open->patched 
State-Changed-By: sanpei 
State-Changed-When: Fri Jun 4 22:25:53 PDT 2004 
State-Changed-Why:  
Commited to umass.c in 1.106, thanks 

http://www.freebsd.org/cgi/query-pr.cgi?pr=67115 
State-Changed-From-To: patched->closed 
State-Changed-By: sanpei 
State-Changed-When: Sun Jun 13 07:47:48 GMT 2004 
State-Changed-Why:  
Committed umass.c 1.11.2.32, thanks 

http://www.freebsd.org/cgi/query-pr.cgi?pr=67115 
>Unformatted:
