From owner-freebsd-usb@FreeBSD.ORG Sun Sep 2 08:19:01 2012 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6FAA1106566B; Sun, 2 Sep 2012 08:19:01 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe08.c2i.net [212.247.154.226]) by mx1.freebsd.org (Postfix) with ESMTP id 8EADD8FC12; Sun, 2 Sep 2012 08:19:00 +0000 (UTC) X-T2-Spam-Status: No, hits=-0.2 required=5.0 tests=ALL_TRUSTED, BAYES_50 Received: from [176.74.212.201] (account mc467741@c2i.net HELO laptop015.hselasky.homeunix.org) by mailfe08.swip.net (CommuniGate Pro SMTP 5.4.4) with ESMTPA id 315671613; Sun, 02 Sep 2012 10:13:51 +0200 From: Hans Petter Selasky To: freebsd-usb@freebsd.org Date: Sun, 2 Sep 2012 10:14:51 +0200 User-Agent: KMail/1.13.7 (FreeBSD/9.1-PRERELEASE; KDE/4.8.4; amd64; ; ) References: <201208310822.q7V8MMqC051998@red.freebsd.org> In-Reply-To: <201208310822.q7V8MMqC051998@red.freebsd.org> X-Face: 'mmZ:T{)),Oru^0c+/}w'`gU1$ubmG?lp!=R4Wy\ELYo2)@'UZ24N@d2+AyewRX}mAm; Yp |U[@, _z/([?1bCfM{_"B<.J>mICJCHAzzGHI{y7{%JVz%R~yJHIji`y>Y}k1C4TfysrsUI -%GU9V5]iUZF&nRn9mJ'?&>O MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_7VxQQeQoI4cp+Di" Message-Id: <201209021014.51903.hselasky@c2i.net> Cc: freebsd-gnats-submit@freebsd.org, Bartek Krawczyk Subject: Re: usb/171197: ADATA Classic CH11 USB HDD doesn't work in FreeBSD 9.1-RC1 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: Sun, 02 Sep 2012 08:19:01 -0000 --Boundary-00=_7VxQQeQoI4cp+Di Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit On Friday 31 August 2012 10:22:22 Bartek Krawczyk wrote: > >Number: 171197 > >Category: usb > >Synopsis: ADATA Classic CH11 USB HDD doesn't work in FreeBSD 9.1-RC1 > >Confidential: no > >Severity: non-critical > >Priority: low > >Responsible: freebsd-usb > >State: open > >Quarter: > >Keywords: > >Date-Required: > >Class: sw-bug > >Submitter-Id: current-users > >Arrival-Date: Fri Aug 31 08:30:08 UTC 2012 > >Closed-Date: > >Last-Modified: > >Originator: Bartek Krawczyk > >Release: 9.1-RC1 > >Organization: > > >Environment: > FreeBSD xbmc 9.1-RC1 FreeBSD 9.1-RC1 #0: Tue Aug 14 04:25:06 UTC 2012 > root@farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64 > > >Description: > Hi, I recently bought a 1TB ADATA Classic CH11 USB HDD and it doesn't seem > to be recognized by FreeBSD 9.1-RC1 (it works in Windows and Linux > though). I can provide more debugging information if you tell me how to do > it. This is what I get in messages: > > Aug 31 10:04:12 xbmc kernel: usb_alloc_device: set address 2 failed > (USB_ERR_STALLED, ignored) Aug 31 10:04:12 xbmc kernel: > usbd_setup_device_desc: getting device descriptor at addr 2 failed, > USB_ERR_STALLED Aug 31 10:04:12 xbmc kernel: usbd_req_re_enumerate: > addr=2, set address failed! (USB_ERR_STALLED, ignored) Aug 31 10:04:12 > xbmc kernel: usbd_setup_device_desc: getting device descriptor at addr 2 > failed, USB_ERR_STALLED Aug 31 10:04:13 xbmc kernel: > usbd_req_re_enumerate: addr=2, set address failed! (USB_ERR_STALLED, > ignored) Aug 31 10:04:13 xbmc kernel: usbd_setup_device_desc: getting > device descriptor at addr 2 failed, USB_ERR_STALLED Aug 31 10:04:13 xbmc > kernel: ugen1.2: at usbus1 (disconnected) Aug 31 10:04:13 xbmc > kernel: uhub_reattach_port: could not allocate new device > > And this is from usbconfig: > ugen4.2: at usbus4, cfg=0 md=HOST spd=HIGH > (480Mbps) pwr=ON > Hi, Could you send the device to me for debugging? Have you tried using an external HUB in between? Is the device properly powered? Can you try the attached patch? --HPS --Boundary-00=_7VxQQeQoI4cp+Di Content-Type: text/x-patch; charset="iso-8859-15"; name="add_set_address_delay.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="add_set_address_delay.diff" === usb_request.c ================================================================== --- usb_request.c (revision 239913) +++ usb_request.c (local) @@ -1547,6 +1547,10 @@ DPRINTFN(6, "setting device address=%d\n", addr); + /* allow device time to set new address */ + usb_pause_mtx(mtx, + USB_MS_TO_TICKS(USB_SET_ADDRESS_SETTLE)); + req.bmRequestType = UT_WRITE_DEVICE; req.bRequest = UR_SET_ADDRESS; USETW(req.wValue, addr); --Boundary-00=_7VxQQeQoI4cp+Di-- From owner-freebsd-usb@FreeBSD.ORG Sun Sep 2 08:20:14 2012 Return-Path: Delivered-To: freebsd-usb@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 05B70106564A for ; Sun, 2 Sep 2012 08:20:14 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id DA3F78FC14 for ; Sun, 2 Sep 2012 08:20:13 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q828KDZ2067799 for ; Sun, 2 Sep 2012 08:20:13 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q828KDbf067795; Sun, 2 Sep 2012 08:20:13 GMT (envelope-from gnats) Date: Sun, 2 Sep 2012 08:20:13 GMT Message-Id: <201209020820.q828KDbf067795@freefall.freebsd.org> To: freebsd-usb@FreeBSD.org From: Hans Petter Selasky Cc: Subject: Re: usb/171197: ADATA Classic CH11 USB HDD doesn't work in FreeBSD 9.1-RC1 X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Hans Petter Selasky List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Sep 2012 08:20:14 -0000 The following reply was made to PR usb/171197; it has been noted by GNATS. From: Hans Petter Selasky To: freebsd-usb@freebsd.org Cc: Bartek Krawczyk , freebsd-gnats-submit@freebsd.org Subject: Re: usb/171197: ADATA Classic CH11 USB HDD doesn't work in FreeBSD 9.1-RC1 Date: Sun, 2 Sep 2012 10:14:51 +0200 --Boundary-00=_7VxQQeQoI4cp+Di Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit On Friday 31 August 2012 10:22:22 Bartek Krawczyk wrote: > >Number: 171197 > >Category: usb > >Synopsis: ADATA Classic CH11 USB HDD doesn't work in FreeBSD 9.1-RC1 > >Confidential: no > >Severity: non-critical > >Priority: low > >Responsible: freebsd-usb > >State: open > >Quarter: > >Keywords: > >Date-Required: > >Class: sw-bug > >Submitter-Id: current-users > >Arrival-Date: Fri Aug 31 08:30:08 UTC 2012 > >Closed-Date: > >Last-Modified: > >Originator: Bartek Krawczyk > >Release: 9.1-RC1 > >Organization: > > >Environment: > FreeBSD xbmc 9.1-RC1 FreeBSD 9.1-RC1 #0: Tue Aug 14 04:25:06 UTC 2012 > root@farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64 > > >Description: > Hi, I recently bought a 1TB ADATA Classic CH11 USB HDD and it doesn't seem > to be recognized by FreeBSD 9.1-RC1 (it works in Windows and Linux > though). I can provide more debugging information if you tell me how to do > it. This is what I get in messages: > > Aug 31 10:04:12 xbmc kernel: usb_alloc_device: set address 2 failed > (USB_ERR_STALLED, ignored) Aug 31 10:04:12 xbmc kernel: > usbd_setup_device_desc: getting device descriptor at addr 2 failed, > USB_ERR_STALLED Aug 31 10:04:12 xbmc kernel: usbd_req_re_enumerate: > addr=2, set address failed! (USB_ERR_STALLED, ignored) Aug 31 10:04:12 > xbmc kernel: usbd_setup_device_desc: getting device descriptor at addr 2 > failed, USB_ERR_STALLED Aug 31 10:04:13 xbmc kernel: > usbd_req_re_enumerate: addr=2, set address failed! (USB_ERR_STALLED, > ignored) Aug 31 10:04:13 xbmc kernel: usbd_setup_device_desc: getting > device descriptor at addr 2 failed, USB_ERR_STALLED Aug 31 10:04:13 xbmc > kernel: ugen1.2: at usbus1 (disconnected) Aug 31 10:04:13 xbmc > kernel: uhub_reattach_port: could not allocate new device > > And this is from usbconfig: > ugen4.2: at usbus4, cfg=0 md=HOST spd=HIGH > (480Mbps) pwr=ON > Hi, Could you send the device to me for debugging? Have you tried using an external HUB in between? Is the device properly powered? Can you try the attached patch? --HPS --Boundary-00=_7VxQQeQoI4cp+Di Content-Type: text/x-patch; charset="iso-8859-15"; name="add_set_address_delay.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="add_set_address_delay.diff" === usb_request.c ================================================================== --- usb_request.c (revision 239913) +++ usb_request.c (local) @@ -1547,6 +1547,10 @@ DPRINTFN(6, "setting device address=%d\n", addr); + /* allow device time to set new address */ + usb_pause_mtx(mtx, + USB_MS_TO_TICKS(USB_SET_ADDRESS_SETTLE)); + req.bmRequestType = UT_WRITE_DEVICE; req.bRequest = UR_SET_ADDRESS; USETW(req.wValue, addr); --Boundary-00=_7VxQQeQoI4cp+Di-- From owner-freebsd-usb@FreeBSD.ORG Sun Sep 2 08:23:31 2012 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2192F106566B for ; Sun, 2 Sep 2012 08:23:31 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe06.c2i.net [212.247.154.162]) by mx1.freebsd.org (Postfix) with ESMTP id 9FD8D8FC17 for ; Sun, 2 Sep 2012 08:23:30 +0000 (UTC) X-T2-Spam-Status: No, hits=-1.0 required=5.0 tests=ALL_TRUSTED Received: from [176.74.212.201] (account mc467741@c2i.net HELO laptop015.hselasky.homeunix.org) by mailfe06.swip.net (CommuniGate Pro SMTP 5.4.4) with ESMTPA id 313874883; Sun, 02 Sep 2012 10:18:21 +0200 From: Hans Petter Selasky To: freebsd-usb@freebsd.org Date: Sun, 2 Sep 2012 10:19:22 +0200 User-Agent: KMail/1.13.7 (FreeBSD/9.1-PRERELEASE; KDE/4.8.4; amd64; ; ) References: In-Reply-To: X-Face: 'mmZ:T{)),Oru^0c+/}w'`gU1$ubmG?lp!=R4Wy\ELYo2)@'UZ24N@d2+AyewRX}mAm; Yp |U[@, _z/([?1bCfM{_"B<.J>mICJCHAzzGHI{y7{%JVz%R~yJHIji`y>Y}k1C4TfysrsUI -%GU9V5]iUZF&nRn9mJ'?&>O MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201209021019.22289.hselasky@c2i.net> Cc: Andrew Beam Subject: Re: external usb3 disk on usb2 port full spd only 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: Sun, 02 Sep 2012 08:23:31 -0000 On Friday 31 August 2012 19:11:13 Andrew Beam wrote: > Hello, > > i have problem with my CH11 ADATA 2.5 UBS 3.0 HDD connected to USB 2.0. > Tested on 9.0-RELEASE-p3 and 9.1-RC1 > > > # usbconfig > ugen0.2: at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON > > any idea why is only 1MB/s transfer? is it possible to force high > speed on that device? Hi, Do you have a XHCI controller on your computer which is capable of USB 3.0 ? This question you need to forward to the manufacturer of your drive! --HPS From owner-freebsd-usb@FreeBSD.ORG Sun Sep 2 16:48:30 2012 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7CB310656AE for ; Sun, 2 Sep 2012 16:48:29 +0000 (UTC) (envelope-from dantavious313@gmail.com) Received: from mail-yx0-f182.google.com (mail-yx0-f182.google.com [209.85.213.182]) by mx1.freebsd.org (Postfix) with ESMTP id 9AAB68FC12 for ; Sun, 2 Sep 2012 16:48:29 +0000 (UTC) Received: by yenl7 with SMTP id l7so860422yen.13 for ; Sun, 02 Sep 2012 09:48:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:user-agent:disposition-notification-to :mime-version:content-type:content-transfer-encoding:message-id; bh=jWH9XvKNAjGSUuQl5VUecSb2J9ZCkFkdqf9qwvFh594=; b=fHi5VqM2aNTa6oKbbt3yHvVWhk+6jD4Mse8JQFfdeyZlakEiYzaoi2dtFwk27BTdrS 28M94UKphH5uE/FWntdhU7Oycmmsrcbgg+rZFuFZ4IIqki0lXYQRe8u38784F8goIn6R 0AzFd42NmXJYlhfhLOjkLz3svs86aZaiKXiyyWRv8n/SJLPxEZapNAeDRdpAebRsq3GO 0hkl6K3rier/VK4F4ApTkJPQFxwOb4o6zVJQt9Odi3HORfWwMd9/8HTOF8O+eXZzFIJb vPutxEYGMLW+jXVUV8ObzlxRwQPmZIjvuL+HRieH7kKq128n1KkSdwGO9zpJPxIvx/ao 2fLA== Received: by 10.101.22.20 with SMTP id z20mr4085367ani.75.1346604508765; Sun, 02 Sep 2012 09:48:28 -0700 (PDT) Received: from joker.localnet (c-71-226-137-213.hsd1.ga.comcast.net. [71.226.137.213]) by mx.google.com with ESMTPS id b46sm19883579yhm.3.2012.09.02.09.48.28 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 02 Sep 2012 09:48:28 -0700 (PDT) From: Derrick Edwards To: freebsd-usb@freebsd.org Date: Sun, 2 Sep 2012 12:48:16 -0400 User-Agent: KMail/1.13.7 (FreeBSD/10.0-CURRENT; KDE/4.8.4; amd64; ; ) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart3904391.m2XFE38dVT"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <201209021248.21905.dantavious313@gmail.com> Subject: USB 3.0 Issues 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: Sun, 02 Sep 2012 16:48:30 -0000 --nextPart3904391.m2XFE38dVT Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi, I have an Toshiba Satellite p875-S7200. I have noticed that when I enable U= SB=20 3.0 support in the BIOS i get the following error when I attemp to attach a= ny=20 USB device, to any USB port even the USB 2.0 ports. Sep 2 11:48:33 joker kernel: xhci_do_command: Command timeout! Sep 2 11:48:33 joker kernel: usb_alloc_device: device init 2 failed=20 (USB_ERR_TIMEOUT, ignored) Sep 2 11:48:33 joker kernel: ugen0.2: at usbus0 (disconnected) Sep 2 11:48:33 joker kernel: uhub_reattach_port: could not allocate new=20 device When I disable USB 3.0 support in the BIOS, USB functions properly. Any ide= as=20 on what could be causing this? Please let me know what additional informati= on=20 you need. =46reeBSD 10.0-CURRENT #1: Sun Sep 2 06:02:47 EDT 2012=20 xhci0: mem 0xb8700000-0xb870ffff a= t=20 device 20.0 on pci0 pcib0: matched entry for 0.20.INTA pcib0: slot 20 INTA hardwired to IRQ 21 ioapic0: routing intpin 21 (PCI IRQ 21) to lapic 0 vector 59 xhci0: 32 byte context size. usbus0 on xhci0 xhci0: usbpf: Attached pci0: at device 22.0 (no driver attached) ehci0: mem 0xb8719000-0xb87193ff i= rq=20 16 at device 26.0 on pci0 ioapic0: routing intpin 16 (PCI IRQ 16) to lapic 0 vector 60 usbus1: EHCI version 1.0 usbus1 on ehci0 ehci0: usbpf: Attached --nextPart3904391.m2XFE38dVT Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQEcBAABAgAGBQJQQ43VAAoJEPCFnSUiJPAUqV0H/1B84Myta6RhatwtWGt6uai/ 6dH3Kpq8FY+p/g1JySyEJSdP2zqU/2wJwtgLrsDei+7vjuPn7CchkMH0vo87W2/1 hRQB/vqVbNK/vYSbsjZewm1WwfuUh5c/e70GRphWkffA4PiPUducuQZI4htg001/ hqcebQCtB1ubGoeoV/vK2bZiUaaf8RZgBoQLtgrlLhSyxvzsVn5WU1FYyz3ruQTr fKUODbKXi/za7OXAaricCUjAYfuGxCeFOcw9SsxDWnDIbyucCGzi3zk9ykIyIYk3 Tebd6u+The1+sADdh2Sef2ZL2zNPmp6vkmTTVrBMs53XSrYhTcJo7h5Vab9G38M= =m68z -----END PGP SIGNATURE----- --nextPart3904391.m2XFE38dVT-- From owner-freebsd-usb@FreeBSD.ORG Sun Sep 2 19:16:06 2012 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 27F231065673 for ; Sun, 2 Sep 2012 19:16:06 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe08.c2i.net [212.247.154.226]) by mx1.freebsd.org (Postfix) with ESMTP id A67588FC0C for ; Sun, 2 Sep 2012 19:16:05 +0000 (UTC) X-T2-Spam-Status: No, hits=-0.2 required=5.0 tests=ALL_TRUSTED, BAYES_50 Received: from [176.74.212.201] (account mc467741@c2i.net HELO laptop015.hselasky.homeunix.org) by mailfe08.swip.net (CommuniGate Pro SMTP 5.4.4) with ESMTPA id 315795612; Sun, 02 Sep 2012 21:16:03 +0200 From: Hans Petter Selasky To: freebsd-usb@freebsd.org Date: Sun, 2 Sep 2012 21:17:04 +0200 User-Agent: KMail/1.13.7 (FreeBSD/9.1-PRERELEASE; KDE/4.8.4; amd64; ; ) References: <201209021248.21905.dantavious313@gmail.com> In-Reply-To: <201209021248.21905.dantavious313@gmail.com> X-Face: 'mmZ:T{)),Oru^0c+/}w'`gU1$ubmG?lp!=R4Wy\ELYo2)@'UZ24N@ =?iso-8859-1?q?d2+AyewRX=7DmAm=3BYp=0A=09=7CU=5B?=@, _z/([?1bCfM{_"B<.J>mICJCHAzzGHI{y7{%JVz%R~yJHIji`y> =?iso-8859-1?q?Y=7Dk1C4TfysrsUI=0A=09-=25GU9V5=5DiUZF=26nRn9mJ=27=3F=26?=>O MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201209022117.04464.hselasky@c2i.net> Cc: Subject: Re: USB 3.0 Issues 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: Sun, 02 Sep 2012 19:16:06 -0000 On Sunday 02 September 2012 18:48:16 Derrick Edwards wrote: > When I disable USB 3.0 support in the BIOS, USB functions properly. Any > ideas on what could be causing this? Please let me know what additional > information you need. Hi, I'm afraid I need my hand on your device to figure this out. When the device init fails, it means that SET-ADDRESS fails, and without that we are lost. You could try setting this variable in /boot/loader.conf hw.usb.xhci.xhci_port_route="0xFFFFFFFF" hw.usb.xhci.xhci_port_route="0x0" hw.usb.xhci.xhci_port_route="0x1" hw.usb.xhci.xhci_port_route="0x2" hw.usb.xhci.xhci_port_route="0x4" hw.usb.xhci.xhci_port_route="0x8" And so on. --HPS From owner-freebsd-usb@FreeBSD.ORG Sun Sep 2 19:47:30 2012 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3A8511065670 for ; Sun, 2 Sep 2012 19:47:30 +0000 (UTC) (envelope-from ondra@bimovi.cz) Received: from mail-pz0-f54.google.com (mail-pz0-f54.google.com [209.85.210.54]) by mx1.freebsd.org (Postfix) with ESMTP id 03BB98FC0A for ; Sun, 2 Sep 2012 19:47:28 +0000 (UTC) Received: by dadr6 with SMTP id r6so3028775dad.13 for ; Sun, 02 Sep 2012 12:47:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bimovi.cz; s=google; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type; bh=zz+zerXw+fYtU3IuyI7symgQDFfokN/xY46y+v/HR38=; b=fwG+VUK1bFDS5q4HmPiOBZqZdscLMlLJbmWpXuDazDClzKn6x8b2WeIYE8vlstNraA 8k9wDfScEHgZ4icNZfZN8cteriO2k52PX3KCkn2OxhP6B1401b/5ZkkD4HpRoJP/ySpn JGN7V6XLNv9AbmM5MLZKHvDgJqhP/2cyfGWxI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type :x-gm-message-state; bh=zz+zerXw+fYtU3IuyI7symgQDFfokN/xY46y+v/HR38=; b=oF7kNU0Z4YVxsawixmCCUD+FWNUwYf0phAFySaBQLkMYrAVWPMdKptF4Ow6qvemVH8 ryxFgNvgdZsVFNb6NiNd93tJLGjovFiMVo1HL13kuDtPH29oCvpWg4GLhwRLembqSit4 laBbdKqQJo44N6lQUNJgXrNGmLZs8gWsBlqzV53cyx5SveXMUWeKt9gNHci+OgOSWzG1 oGztnMcwTFxtqwawEfJHu42JdjehL52SQvSpfS8Vo7VqgBPQsngDSwanot9m867SmlrP 79OBswynLaXLwa3tlv60Ie4oG8lhJmlCGrhdWcvyFLW4t+MUK2e5VqsFOS3AfTbn5BnR u2fw== Received: by 10.66.85.133 with SMTP id h5mr24445214paz.10.1346615248136; Sun, 02 Sep 2012 12:47:28 -0700 (PDT) MIME-Version: 1.0 Sender: ondra@bimovi.cz Received: by 10.66.117.13 with HTTP; Sun, 2 Sep 2012 12:47:08 -0700 (PDT) In-Reply-To: References: <201209021019.22289.hselasky@c2i.net> From: Andrew Beam Date: Sun, 2 Sep 2012 21:47:08 +0200 X-Google-Sender-Auth: z3iZXmXGq4IxnNksUnSLReLndCA Message-ID: To: freebsd-usb@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQkuOlXFJsnCpt/qepsbRTwqq0S9NpxU+FI1FT/GSmm657esTXG12R4SGO96RMT2zcJntEFu Subject: Re: external usb3 disk on usb2 port full spd only 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: Sun, 02 Sep 2012 19:47:30 -0000 Hello, > Do you have a XHCI controller on your computer which is capable of USB 3.0 ? No, i have only USB 2.0 port in my computer. HDD is 3.0 and 2.0 compatible of course. Under Ubuntu on same hardware, disk is connected as USB 2.0, spd profile HIGH / 480Mbit. Under FreeBSD, disk is connected as USB 1.1, spd profile FULL / 12Mbit only. > This question you need to forward to the manufacturer of your drive! I don't know what to ask them. It's FreeBSD problem i think. Question is: Is it posible force FreeBSD to use profile HIGH and connect HDD as USB 2.0 device? Thanks Beam From owner-freebsd-usb@FreeBSD.ORG Sun Sep 2 19:55:31 2012 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E5FE5106566C for ; Sun, 2 Sep 2012 19:55:31 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe03.c2i.net [212.247.154.66]) by mx1.freebsd.org (Postfix) with ESMTP id 7C43E8FC15 for ; Sun, 2 Sep 2012 19:55:30 +0000 (UTC) X-T2-Spam-Status: No, hits=-1.0 required=5.0 tests=ALL_TRUSTED Received: from [176.74.212.201] (account mc467741@c2i.net HELO laptop015.hselasky.homeunix.org) by mailfe03.swip.net (CommuniGate Pro SMTP 5.4.4) with ESMTPA id 147878097; Sun, 02 Sep 2012 21:55:23 +0200 To: Andrew Beam From: Hans Petter Selasky X-Face: 'mmZ:T{)),Oru^0c+/}w'`gU1$ubmG?lp!=R4Wy\ELYo2)@'UZ24N@ =?iso-8859-1?q?d2+AyewRX=7DmAm=3BYp=0A=09=7CU=5B?=@, _z/([?1bCfM{_"B<.J>mICJCHAzzGHI{y7{%JVz%R~yJHIji`y> =?iso-8859-1?q?Y=7Dk1C4TfysrsUI=0A=09-=25GU9V5=5DiUZF=26nRn9mJ=27=3F=26?=>O Date: Sun, 2 Sep 2012 21:56:25 +0200 MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201209022156.25632.hselasky@c2i.net> Cc: freebsd-usb@freebsd.org Subject: Re: external usb3 disk on usb2 port full spd only 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: Sun, 02 Sep 2012 19:55:32 -0000 On Sunday 02 September 2012 21:35:57 Andrew Beam wrote: > Hello, > > > Do you have a XHCI controller on your computer which is capable of USB > > 3.0 ? > > No, i have only USB 2.0 port in my computer. HDD is 3.0 and 2.0 > compatible of course. > > Under Ubuntu on same hardware, disk is connected as USB 2.0, spd > profile HIGH / 480Mbit. > Under FreeBSD, disk is connected as USB 1.1, spd profile FULL / 12Mbit > only. > > > This question you need to forward to the manufacturer of your drive! > > I don't know what to ask them. It's FreeBSD problem i think. > Question is: Is it posible force FreeBSD to use profile HIGH and > connect HDD as USB 2.0 device? Hi, I cannot tell exactly why your device is not detected as HIGH speed. You will need to connect a USB analyzer to know the cause exactly. Please be aware that FreeBSD is complying to USB.org and not MS nor Linux. Does the manufacturer of your USB device put a certified USB.org logo on the product? Back to what you're asking for: The enumeration sequence works like this: 1) EHCI owns the port and tries High-Speed USB. 2) If a valid so-called CHIRP sequence is successful the EHCI software will select high speed USB. Else the EHCI ask the OHCI or UHCI to handle the FULL speed USB device. Code is here: sys/dev/usb/controller/ehci.c case UHF_PORT_RESET: DPRINTFN(6, "reset port %d\n", index); #if 0 /* ADD THIS COMMENT OUT TO FORCE ALL DEVICES HIGH SPEED: */ #ifdef USB_DEBUG if (ehcinohighspeed) { /* * Connect USB device to companion * controller. */ ehci_disown(sc, index, 1); break; } #endif if (EHCI_PS_IS_LOWSPEED(v) && (sc->sc_flags & EHCI_SCFLG_TT) == 0) { /* Low speed device, give up ownership. */ ehci_disown(sc, index, 1); break; } #endif /* END */ --HPS From owner-freebsd-usb@FreeBSD.ORG Sun Sep 2 21:10:12 2012 Return-Path: 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 902BD1065673 for ; Sun, 2 Sep 2012 21:10:12 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 680FE8FC17 for ; Sun, 2 Sep 2012 21:10:12 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q82LAClo065215 for ; Sun, 2 Sep 2012 21:10:12 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q82LAC43065198; Sun, 2 Sep 2012 21:10:12 GMT (envelope-from gnats) Resent-Date: Sun, 2 Sep 2012 21:10:12 GMT Resent-Message-Id: <201209022110.q82LAC43065198@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, Waitman Gobble Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 700D8106566C for ; Sun, 2 Sep 2012 21:03:53 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id 5A0C68FC15 for ; Sun, 2 Sep 2012 21:03:53 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q82L3rZb065245 for ; Sun, 2 Sep 2012 21:03:53 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id q82L3qhq065244; Sun, 2 Sep 2012 21:03:52 GMT (envelope-from nobody) Message-Id: <201209022103.q82L3qhq065244@red.freebsd.org> Date: Sun, 2 Sep 2012 21:03:52 GMT From: Waitman Gobble To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: usb/171262: plug in sdhc via usb reader reboots machine 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: Sun, 02 Sep 2012 21:10:12 -0000 >Number: 171262 >Category: usb >Synopsis: plug in sdhc via usb reader reboots machine >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-usb >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Sep 02 21:10:11 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Waitman Gobble >Release: FreeBSD 9.1-RC1 >Organization: Waitman Gobble >Environment: FreeBSD kamira.waitman.net 9.1-RC1 FreeBSD 9.1-RC1 #0: Tue Aug 14 04:25:06 UTC 2012 root@farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64 >Description: was dumping sdhc cards to ntfs-3g mounted usb drive (8 cards successfully, then inserting 9th card rebooted machine) this in logs 45 times: Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): SCSI sense: HARDWARE FAILURE asc:4b,0 (Data phase error) (then machine reboot.) full log starting from insert: Sep 3 04:36:54 kamira kernel: ugen1.2: at usbus1 Sep 3 04:36:54 kamira kernel: umass1: on usbus1 Sep 3 04:36:54 kamira kernel: umass1: SCSI over Bulk-Only; quirks = 0x4100 Sep 3 04:36:54 kamira kernel: umass1:6:1:-1: Attached to scbus6 Sep 3 04:36:54 kamira kernel: da1 at umass-sim1 bus 1 scbus6 target 0 lun 0 Sep 3 04:36:54 kamira kernel: da1: Removable Direct Access SCSI-0 device Sep 3 04:36:54 kamira kernel: da1: 40.000MB/s transfers Sep 3 04:36:54 kamira kernel: da1: 15287MB (31307776 512 byte sectors: 255H 63S/T 1948C) Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): WRITE(10). CDB: 2a 0 0 0 22 28 0 0 8 0 Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): CAM status: SCSI Status Error Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): SCSI status: Check Condition Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): SCSI sense: HARDWARE FAILURE asc:4b,0 (Data phase error) Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): Retrying command (per sense data) Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): WRITE(10). CDB: 2a 0 0 0 22 28 0 0 8 0 Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): CAM status: SCSI Status Error Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): SCSI status: Check Condition Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): SCSI sense: HARDWARE FAILURE asc:4b,0 (Data phase error) Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): Retrying command (per sense data) Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): WRITE(10). CDB: 2a 0 0 0 22 28 0 0 8 0 Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): CAM status: SCSI Status Error Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): SCSI status: Check Condition Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): SCSI sense: HARDWARE FAILURE asc:4b,0 (Data phase error) Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): Retrying command (per sense data) Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): WRITE(10). CDB: 2a 0 0 0 22 28 0 0 8 0 Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): CAM status: SCSI Status Error Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): SCSI status: Check Condition Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): SCSI sense: HARDWARE FAILURE asc:4b,0 (Data phase error) Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): Retrying command (per sense data) Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): WRITE(10). CDB: 2a 0 0 0 22 28 0 0 8 0 Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): CAM status: SCSI Status Error Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): SCSI status: Check Condition Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): SCSI sense: HARDWARE FAILURE asc:4b,0 (Data phase error) Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): Error 5, Retries exhausted Sep 3 04:36:59 kamira kernel: g_vfs_done():da1s1[WRITE(offset=282624, length=4096)]error = 5 Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): WRITE(10). CDB: 2a 0 0 0 22 28 0 0 8 0 Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): CAM status: SCSI Status Error Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): SCSI status: Check Condition Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): SCSI sense: HARDWARE FAILURE asc:4b,0 (Data phase error) Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): Retrying command (per sense data) Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): WRITE(10). CDB: 2a 0 0 0 22 28 0 0 8 0 Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): CAM status: SCSI Status Error Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): SCSI status: Check Condition Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): SCSI sense: HARDWARE FAILURE asc:4b,0 (Data phase error) Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): Retrying command (per sense data) Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): WRITE(10). CDB: 2a 0 0 0 22 28 0 0 8 0 Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): CAM status: SCSI Status Error Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): SCSI status: Check Condition Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): SCSI sense: HARDWARE FAILURE asc:4b,0 (Data phase error) Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): Retrying command (per sense data) Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): WRITE(10). CDB: 2a 0 0 0 22 28 0 0 8 0 Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): CAM status: SCSI Status Error Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): SCSI status: Check Condition Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): SCSI sense: HARDWARE FAILURE asc:4b,0 (Data phase error) Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): Retrying command (per sense data) Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): WRITE(10). CDB: 2a 0 0 0 22 28 0 0 8 0 Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): CAM status: SCSI Status Error Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): SCSI status: Check Condition Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): SCSI sense: HARDWARE FAILURE asc:4b,0 (Data phase error) Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): Error 5, Retries exhausted Sep 3 04:36:59 kamira kernel: g_vfs_done():da1s1[WRITE(offset=282624, length=4096)]error = 5 Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): WRITE(10). CDB: 2a 0 0 0 22 28 0 0 8 0 Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): CAM status: SCSI Status Error Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): SCSI status: Check Condition Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): SCSI sense: HARDWARE FAILURE asc:4b,0 (Data phase error) Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): Retrying command (per sense data) Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): WRITE(10). CDB: 2a 0 0 0 22 28 0 0 8 0 Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): CAM status: SCSI Status Error Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): SCSI status: Check Condition Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): SCSI sense: HARDWARE FAILURE asc:4b,0 (Data phase error) Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): Retrying command (per sense data) Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): WRITE(10). CDB: 2a 0 0 0 22 28 0 0 8 0 Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): CAM status: SCSI Status Error Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): SCSI status: Check Condition Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): SCSI sense: HARDWARE FAILURE asc:4b,0 (Data phase error) Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): Retrying command (per sense data) Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): WRITE(10). CDB: 2a 0 0 0 22 28 0 0 8 0 Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): CAM status: SCSI Status Error Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): SCSI status: Check Condition Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): SCSI sense: HARDWARE FAILURE asc:4b,0 (Data phase error) Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): Retrying command (per sense data) Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): WRITE(10). CDB: 2a 0 0 0 22 28 0 0 8 0 Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): CAM status: SCSI Status Error Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): SCSI status: Check Condition Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): SCSI sense: HARDWARE FAILURE asc:4b,0 (Data phase error) Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): Error 5, Retries exhausted Sep 3 04:36:59 kamira kernel: g_vfs_done():da1s1[WRITE(offset=282624, length=4096)]error = 5 Sep 3 04:36:59 kamira kernel: fsync: giving up on dirty Sep 3 04:36:59 kamira kernel: 0xfffffe003d70fd20: tag devfs, type VCHR Sep 3 04:36:59 kamira kernel: usecount 1, writecount 0, refcount 482 mountedhere 0xfffffe007fe62800 Sep 3 04:36:59 kamira kernel: flags (VI(0x200)) Sep 3 04:36:59 kamira kernel: v_object 0xfffffe0041cea570 ref 0 pages 480 Sep 3 04:36:59 kamira kernel: lock type devfs: UNLOCKED Sep 3 04:36:59 kamira kernel: dev da1s1 Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): WRITE(10). CDB: 2a 0 0 0 22 28 0 0 8 0 Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): CAM status: SCSI Status Error Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): SCSI status: Check Condition Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): SCSI sense: HARDWARE FAILURE asc:4b,0 (Data phase error) Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): Retrying command (per sense data) Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): WRITE(10). CDB: 2a 0 0 0 22 28 0 0 8 0 Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): CAM status: SCSI Status Error Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): SCSI status: Check Condition Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): SCSI sense: HARDWARE FAILURE asc:4b,0 (Data phase error) Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): Retrying command (per sense data) Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): WRITE(10). CDB: 2a 0 0 0 22 28 0 0 8 0 Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): CAM status: SCSI Status Error Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): SCSI status: Check Condition Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): SCSI sense: HARDWARE FAILURE asc:4b,0 (Data phase error) Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): Retrying command (per sense data) Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): WRITE(10). CDB: 2a 0 0 0 22 28 0 0 8 0 Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): CAM status: SCSI Status Error Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): SCSI status: Check Condition Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): SCSI sense: HARDWARE FAILURE asc:4b,0 (Data phase error) Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): Retrying command (per sense data) Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): WRITE(10). CDB: 2a 0 0 0 22 28 0 0 8 0 Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): CAM status: SCSI Status Error Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): SCSI status: Check Condition Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): SCSI sense: HARDWARE FAILURE asc:4b,0 (Data phase error) Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): Error 5, Retries exhausted Sep 3 04:37:02 kamira kernel: g_vfs_done():da1s1[WRITE(offset=282624, length=4096)]error = 5 Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): WRITE(10). CDB: 2a 0 0 0 22 28 0 0 8 0 Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): CAM status: SCSI Status Error Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): SCSI status: Check Condition Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): SCSI sense: HARDWARE FAILURE asc:4b,0 (Data phase error) Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): Retrying command (per sense data) Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): WRITE(10). CDB: 2a 0 0 0 22 28 0 0 8 0 Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): CAM status: SCSI Status Error Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): SCSI status: Check Condition Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): SCSI sense: HARDWARE FAILURE asc:4b,0 (Data phase error) Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): Retrying command (per sense data) Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): WRITE(10). CDB: 2a 0 0 0 22 28 0 0 8 0 Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): CAM status: SCSI Status Error Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): SCSI status: Check Condition Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): SCSI sense: HARDWARE FAILURE asc:4b,0 (Data phase error) Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): Retrying command (per sense data) Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): WRITE(10). CDB: 2a 0 0 0 22 28 0 0 8 0 Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): CAM status: SCSI Status Error Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): SCSI status: Check Condition Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): SCSI sense: HARDWARE FAILURE asc:4b,0 (Data phase error) Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): Retrying command (per sense data) Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): WRITE(10). CDB: 2a 0 0 0 22 28 0 0 8 0 Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): CAM status: SCSI Status Error Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): SCSI status: Check Condition Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): SCSI sense: HARDWARE FAILURE asc:4b,0 (Data phase error) Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): Error 5, Retries exhausted Sep 3 04:37:02 kamira kernel: g_vfs_done():da1s1[WRITE(offset=282624, length=4096)]error = 5 Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): WRITE(10). CDB: 2a 0 0 0 22 28 0 0 8 0 Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): CAM status: SCSI Status Error Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): SCSI status: Check Condition Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): SCSI sense: HARDWARE FAILURE asc:4b,0 (Data phase error) Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): Retrying command (per sense data) Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): WRITE(10). CDB: 2a 0 0 0 22 28 0 0 8 0 Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): CAM status: SCSI Status Error Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): SCSI status: Check Condition Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): SCSI sense: HARDWARE FAILURE asc:4b,0 (Data phase error) Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): Retrying command (per sense data) Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): WRITE(10). CDB: 2a 0 0 0 22 28 0 0 8 0 Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): CAM status: SCSI Status Error Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): SCSI status: Check Condition Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): SCSI sense: HARDWARE FAILURE asc:4b,0 (Data phase error) Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): Retrying command (per sense data) Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): WRITE(10). CDB: 2a 0 0 0 22 28 0 0 8 0 Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): CAM status: SCSI Status Error Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): SCSI status: Check Condition Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): SCSI sense: HARDWARE FAILURE asc:4b,0 (Data phase error) Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): Retrying command (per sense data) Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): WRITE(10). CDB: 2a 0 0 0 22 28 0 0 8 0 Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): CAM status: SCSI Status Error Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): SCSI status: Check Condition Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): SCSI sense: HARDWARE FAILURE asc:4b,0 (Data phase error) Sep 3 04:37:02 kamira kernel: (da1:umass-sim1:1:0:0): Error 5, Retries exhausted Sep 3 04:37:02 kamira kernel: g_vfs_done():da1s1[WRITE(offset=282624, length=4096)]error = 5 Sep 3 04:37:02 kamira kernel: fsync: giving up on dirty Sep 3 04:37:02 kamira kernel: 0xfffffe003d70fd20: tag devfs, type VCHR Sep 3 04:37:02 kamira kernel: usecount 1, writecount 0, refcount 482 mountedhere 0xfffffe007fe62800 Sep 3 04:37:02 kamira kernel: flags (VI(0x200)) Sep 3 04:37:02 kamira kernel: v_object 0xfffffe0041cea570 ref 0 pages 480 Sep 3 04:37:02 kamira kernel: lock type devfs: UNLOCKED Sep 3 04:37:02 kamira kernel: dev da1s1 Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): WRITE(10). CDB: 2a 0 0 0 22 28 0 0 8 0 Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): CAM status: SCSI Status Error Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): SCSI status: Check Condition Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): SCSI sense: HARDWARE FAILURE asc:4b,0 (Data phase error) Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): Retrying command (per sense data) Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): WRITE(10). CDB: 2a 0 0 0 22 28 0 0 8 0 Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): CAM status: SCSI Status Error Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): SCSI status: Check Condition Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): SCSI sense: HARDWARE FAILURE asc:4b,0 (Data phase error) Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): Retrying command (per sense data) Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): WRITE(10). CDB: 2a 0 0 0 22 28 0 0 8 0 Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): CAM status: SCSI Status Error Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): SCSI status: Check Condition Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): SCSI sense: HARDWARE FAILURE asc:4b,0 (Data phase error) Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): Retrying command (per sense data) Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): WRITE(10). CDB: 2a 0 0 0 22 28 0 0 8 0 Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): CAM status: SCSI Status Error Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): SCSI status: Check Condition Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): SCSI sense: HARDWARE FAILURE asc:4b,0 (Data phase error) Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): Retrying command (per sense data) Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): WRITE(10). CDB: 2a 0 0 0 22 28 0 0 8 0 Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): CAM status: SCSI Status Error Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): SCSI status: Check Condition Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): SCSI sense: HARDWARE FAILURE asc:4b,0 (Data phase error) Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): Error 5, Retries exhausted Sep 3 04:37:16 kamira kernel: g_vfs_done():da1s1[WRITE(offset=282624, length=4096)]error = 5 Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): WRITE(10). CDB: 2a 0 0 0 22 28 0 0 8 0 Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): CAM status: SCSI Status Error Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): SCSI status: Check Condition Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): SCSI sense: HARDWARE FAILURE asc:4b,0 (Data phase error) Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): Retrying command (per sense data) Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): WRITE(10). CDB: 2a 0 0 0 22 28 0 0 8 0 Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): CAM status: SCSI Status Error Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): SCSI status: Check Condition Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): SCSI sense: HARDWARE FAILURE asc:4b,0 (Data phase error) Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): Retrying command (per sense data) Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): WRITE(10). CDB: 2a 0 0 0 22 28 0 0 8 0 Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): CAM status: SCSI Status Error Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): SCSI status: Check Condition Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): SCSI sense: HARDWARE FAILURE asc:4b,0 (Data phase error) Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): Retrying command (per sense data) Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): WRITE(10). CDB: 2a 0 0 0 22 28 0 0 8 0 Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): CAM status: SCSI Status Error Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): SCSI status: Check Condition Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): SCSI sense: HARDWARE FAILURE asc:4b,0 (Data phase error) Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): Retrying command (per sense data) Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): WRITE(10). CDB: 2a 0 0 0 22 28 0 0 8 0 Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): CAM status: SCSI Status Error Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): SCSI status: Check Condition Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): SCSI sense: HARDWARE FAILURE asc:4b,0 (Data phase error) Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): Error 5, Retries exhausted Sep 3 04:37:16 kamira kernel: g_vfs_done():da1s1[WRITE(offset=282624, length=4096)]error = 5 Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): WRITE(10). CDB: 2a 0 0 0 22 28 0 0 8 0 Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): CAM status: SCSI Status Error Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): SCSI status: Check Condition Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): SCSI sense: HARDWARE FAILURE asc:4b,0 (Data phase error) Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): Retrying command (per sense data) Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): WRITE(10). CDB: 2a 0 0 0 22 28 0 0 8 0 Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): CAM status: SCSI Status Error Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): SCSI status: Check Condition Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): SCSI sense: HARDWARE FAILURE asc:4b,0 (Data phase error) Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): Retrying command (per sense data) Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): WRITE(10). CDB: 2a 0 0 0 22 28 0 0 8 0 Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): CAM status: SCSI Status Error Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): SCSI status: Check Condition Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): SCSI sense: HARDWARE FAILURE asc:4b,0 (Data phase error) Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): Retrying command (per sense data) Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): WRITE(10). CDB: 2a 0 0 0 22 28 0 0 8 0 Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): CAM status: SCSI Status Error Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): SCSI status: Check Condition Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): SCSI sense: HARDWARE FAILURE asc:4b,0 (Data phase error) Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): Retrying command (per sense data) Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): WRITE(10). CDB: 2a 0 0 0 22 28 0 0 8 0 Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): CAM status: SCSI Status Error Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): SCSI status: Check Condition Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): SCSI sense: HARDWARE FAILURE asc:4b,0 (Data phase error) Sep 3 04:37:16 kamira kernel: (da1:umass-sim1:1:0:0): Error 5, Retries exhausted Sep 3 04:37:16 kamira kernel: g_vfs_done():da1s1[WRITE(offset=282624, length=4096)]error = 5 Sep 3 04:37:16 kamira kernel: fsync: giving up on dirty Sep 3 04:37:16 kamira kernel: 0xfffffe003d70fd20: tag devfs, type VCHR Sep 3 04:37:16 kamira kernel: usecount 1, writecount 0, refcount 482 mountedhere 0xfffffe007fe62800 Sep 3 04:37:16 kamira kernel: flags (VI(0x200)) Sep 3 04:37:16 kamira kernel: v_object 0xfffffe0041cea570 ref 0 pages 480 Sep 3 04:37:16 kamira kernel: lock type devfs: UNLOCKED Sep 3 04:37:16 kamira kernel: dev da1s1 Sep 3 04:37:21 kamira kernel: ugen1.2: at usbus1 (disconnected) Sep 3 04:37:21 kamira kernel: umass1: at uhub1, port 4, addr 2 (disconnected) Sep 3 04:37:21 kamira kernel: (da1:umass-sim1:1:0:0): lost device - 0 outstanding, 1 refs Sep 3 04:37:21 kamira kernel: (pass2:(da1:umass-sim1:1:umass-sim1:1:0:0:0): passdevgonecb: devfs entry is gone Sep 3 04:37:21 kamira kernel: 0): removing device entry Sep 3 04:37:59 kamira syslogd: kernel boot file is /boot/kernel/kernel Sep 3 04:37:59 kamira kernel: Copyright (c) 1992-2012 The FreeBSD Project. Sep 3 04:37:59 kamira kernel: Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 Sep 3 04:37:59 kamira kernel: The Regents of the University of California. All rights reserved. Sep 3 04:37:59 kamira kernel: FreeBSD is a registered trademark of The FreeBSD Foundation. Sep 3 04:37:59 kamira kernel: FreeBSD 9.1-RC1 #0: Tue Aug 14 04:25:06 UTC 2012 Sep 3 04:37:59 kamira kernel: root@farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64 Sep 3 04:37:59 kamira kernel: CPU: AMD A4-3300 APU with Radeon(tm) HD Graphics (2493.80-MHz K8-class CPU) Sep 3 04:37:59 kamira kernel: Origin = "AuthenticAMD" Id = 0x300f10 Family = 12 Model = 1 Stepping = 0 Sep 3 04:37:59 kamira kernel: Features=0x178bfbff Sep 3 04:37:59 kamira kernel: Features2=0x802009 Sep 3 04:37:59 kamira kernel: AMD Features=0xee500800 Sep 3 04:37:59 kamira kernel: AMD Features2=0x37ff Sep 3 04:37:59 kamira kernel: TSC: P-state invariant, performance statistics Sep 3 04:37:59 kamira kernel: real memory = 4294967296 (4096 MB) Sep 3 04:37:59 kamira kernel: avail memory = 3573714944 (3408 MB) Sep 3 04:37:59 kamira kernel: Event timer "LAPIC" quality 400 Sep 3 04:37:59 kamira kernel: ACPI APIC Table: Sep 3 04:37:59 kamira kernel: FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs Sep 3 04:37:59 kamira kernel: FreeBSD/SMP: 1 package(s) x 2 core(s) Sep 3 04:37:59 kamira kernel: cpu0 (BSP): APIC ID: 0 Sep 3 04:37:59 kamira kernel: cpu1 (AP): APIC ID: 1 Sep 3 04:37:59 kamira kernel: ioapic0: Changing APIC ID to 2 Sep 3 04:37:59 kamira kernel: ioapic0 irqs 0-23 on motherboard Sep 3 04:37:59 kamira kernel: kbd1 at kbdmux0 Sep 3 04:37:59 kamira kernel: ctl: CAM Target Layer loaded Sep 3 04:37:59 kamira kernel: acpi0: on motherboard Sep 3 04:37:59 kamira kernel: acpi0: Power Button (fixed) Sep 3 04:37:59 kamira kernel: acpi0: reservation of 0, a0000 (3) failed Sep 3 04:37:59 kamira kernel: acpi0: reservation of 100000, cfcd0000 (3) failed Sep 3 04:37:59 kamira kernel: cpu0: on acpi0 Sep 3 04:37:59 kamira kernel: cpu1: on acpi0 Sep 3 04:37:59 kamira kernel: attimer0: port 0x40-0x43 on acpi0 Sep 3 04:37:59 kamira kernel: Timecounter "i8254" frequency 1193182 Hz quality 0 Sep 3 04:37:59 kamira kernel: Event timer "i8254" frequency 1193182 Hz quality 100 Sep 3 04:37:59 kamira kernel: hpet0: iomem 0xfed00000-0xfed003ff irq 0,8 on acpi0 Sep 3 04:37:59 kamira kernel: Timecounter "HPET" frequency 14318180 Hz quality 950 Sep 3 04:37:59 kamira kernel: Event timer "HPET" frequency 14318180 Hz quality 450 Sep 3 04:37:59 kamira kernel: Event timer "HPET1" frequency 14318180 Hz quality 450 Sep 3 04:37:59 kamira kernel: Event timer "HPET2" frequency 14318180 Hz quality 450 Sep 3 04:37:59 kamira kernel: atrtc0: port 0x70-0x73 on acpi0 Sep 3 04:37:59 kamira kernel: Event timer "RTC" frequency 32768 Hz quality 0 Sep 3 04:37:59 kamira kernel: Timecounter "ACPI-fast" frequency 3579545 Hz quality 900 Sep 3 04:37:59 kamira kernel: acpi_timer0: <32-bit timer at 3.579545MHz> port 0x808-0x80b on acpi0 Sep 3 04:37:59 kamira kernel: acpi_button0: on acpi0 Sep 3 04:37:59 kamira kernel: pcib0: port 0xcf8-0xcff on acpi0 Sep 3 04:37:59 kamira kernel: pci0: on pcib0 Sep 3 04:37:59 kamira kernel: vgapci0: port 0xf800-0xf8ff mem 0xd0000000-0xdfffffff,0xfdfc0000-0xfdffffff irq 18 at device 1.0 on pci0 Sep 3 04:37:59 kamira kernel: pcib1: irq 16 at device 4.0 on pci0 Sep 3 04:37:59 kamira kernel: pci1: on pcib1 Sep 3 04:37:59 kamira kernel: re0: port 0xee00-0xeeff mem 0xfdcff000-0xfdcfffff,0xfdcf8000-0xfdcfbfff irq 16 at device 0.0 on pci1 Sep 3 04:37:59 kamira kernel: re0: Using 1 MSI-X message Sep 3 04:37:59 kamira kernel: re0: Chip rev. 0x2c800000 Sep 3 04:37:59 kamira kernel: re0: MAC rev. 0x00000000 Sep 3 04:37:59 kamira kernel: miibus0: on re0 Sep 3 04:37:59 kamira kernel: rgephy0: PHY 1 on miibus0 Sep 3 04:37:59 kamira kernel: rgephy0: none, 10baseT, 10baseT-FDX, 10baseT-FDX-flow, 100baseTX, 100baseTX-FDX, 100baseTX-FDX-flow, 1000baseT, 1000baseT-master, 1000baseT-FDX, 1000baseT-FDX-master, 1000baseT-FDX-flow, 1000baseT-FDX-flow-master, auto, auto-flow Sep 3 04:37:59 kamira kernel: re0: Ethernet address: 90:2b:34:83:1b:b2 Sep 3 04:37:59 kamira kernel: atapci0: port 0xff00-0xff07,0xfe00-0xfe03,0xfd00-0xfd07,0xfc00-0xfc03,0xfb00-0xfb0f mem 0xfe02f000-0xfe02f7ff irq 19 at device 17.0 on pci0 Sep 3 04:37:59 kamira kernel: ata2: at channel 0 on atapci0 Sep 3 04:37:59 kamira kernel: ata3: at channel 1 on atapci0 Sep 3 04:37:59 kamira kernel: ohci0: mem 0xfe02e000-0xfe02efff irq 18 at device 18.0 on pci0 Sep 3 04:37:59 kamira kernel: usbus0 on ohci0 Sep 3 04:37:59 kamira kernel: ehci0: mem 0xfe02d000-0xfe02d0ff irq 17 at device 18.2 on pci0 Sep 3 04:37:59 kamira kernel: usbus1: EHCI version 1.0 Sep 3 04:37:59 kamira kernel: usbus1 on ehci0 Sep 3 04:37:59 kamira kernel: ohci1: mem 0xfe02c000-0xfe02cfff irq 18 at device 19.0 on pci0 Sep 3 04:37:59 kamira kernel: usbus2 on ohci1 Sep 3 04:37:59 kamira kernel: ehci1: mem 0xfe02b000-0xfe02b0ff irq 17 at device 19.2 on pci0 Sep 3 04:37:59 kamira kernel: usbus3: EHCI version 1.0 Sep 3 04:37:59 kamira kernel: usbus3 on ehci1 Sep 3 04:37:59 kamira kernel: pci0: at device 20.0 (no driver attached) Sep 3 04:37:59 kamira kernel: atapci1: port 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0xfa00-0xfa0f at device 20.1 on pci0 Sep 3 04:37:59 kamira kernel: ata0: at channel 0 on atapci1 Sep 3 04:37:59 kamira kernel: ata1: at channel 1 on atapci1 Sep 3 04:37:59 kamira kernel: hdac0: mem 0xfe024000-0xfe027fff irq 16 at device 20.2 on pci0 Sep 3 04:37:59 kamira kernel: isab0: at device 20.3 on pci0 Sep 3 04:37:59 kamira kernel: isa0: on isab0 Sep 3 04:37:59 kamira kernel: pcib2: at device 20.4 on pci0 Sep 3 04:37:59 kamira kernel: pci2: on pcib2 Sep 3 04:37:59 kamira kernel: ohci2: mem 0xfe02a000-0xfe02afff irq 18 at device 20.5 on pci0 Sep 3 04:37:59 kamira kernel: usbus4 on ohci2 Sep 3 04:37:59 kamira kernel: ohci3: mem 0xfe029000-0xfe029fff irq 18 at device 22.0 on pci0 Sep 3 04:37:59 kamira kernel: usbus5 on ohci3 Sep 3 04:37:59 kamira kernel: ehci2: mem 0xfe028000-0xfe0280ff irq 17 at device 22.2 on pci0 Sep 3 04:37:59 kamira kernel: usbus6: EHCI version 1.0 Sep 3 04:37:59 kamira kernel: usbus6 on ehci2 Sep 3 04:37:59 kamira kernel: uart0: <16550 or compatible> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0 Sep 3 04:37:59 kamira kernel: orm0: at iomem 0xc0000-0xcefff on isa0 Sep 3 04:37:59 kamira kernel: sc0: at flags 0x100 on isa0 Sep 3 04:37:59 kamira kernel: sc0: VGA <16 virtual consoles, flags=0x300> Sep 3 04:37:59 kamira kernel: vga0: at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0 Sep 3 04:37:59 kamira kernel: atkbdc0: at port 0x60,0x64 on isa0 Sep 3 04:37:59 kamira kernel: atkbd0: irq 1 on atkbdc0 Sep 3 04:37:59 kamira kernel: kbd0 at atkbd0 Sep 3 04:37:59 kamira kernel: atkbd0: [GIANT-LOCKED] Sep 3 04:37:59 kamira kernel: ppc0: cannot reserve I/O port range Sep 3 04:37:59 kamira kernel: hwpstate0: on cpu0 Sep 3 04:37:59 kamira kernel: Timecounters tick every 1.000 msec Sep 3 04:37:59 kamira kernel: hdacc0: at cad 0 on hdac0 Sep 3 04:37:59 kamira kernel: hdaa0: at nid 1 on hdacc0 Sep 3 04:37:59 kamira kernel: pcm0: at nid 20,27 and 24,26 on hdaa0 Sep 3 04:37:59 kamira kernel: pcm1: at nid 17 on hdaa0 Sep 3 04:37:59 kamira kernel: pcm2: at nid 25 on hdaa0 Sep 3 04:37:59 kamira kernel: usbus0: 12Mbps Full Speed USB v1.0 Sep 3 04:37:59 kamira kernel: usbus1: 480Mbps High Speed USB v2.0 Sep 3 04:37:59 kamira kernel: usbus2: 12Mbps Full Speed USB v1.0 Sep 3 04:37:59 kamira kernel: usbus3: 480Mbps High Speed USB v2.0 Sep 3 04:37:59 kamira kernel: usbus4: 12Mbps Full Speed USB v1.0 Sep 3 04:37:59 kamira kernel: usbus5: 12Mbps Full Speed USB v1.0 Sep 3 04:37:59 kamira kernel: usbus6: 480Mbps High Speed USB v2.0 Sep 3 04:37:59 kamira kernel: ugen0.1: at usbus0 Sep 3 04:37:59 kamira kernel: uhub0: on usbus0 Sep 3 04:37:59 kamira kernel: ugen1.1: at usbus1 Sep 3 04:37:59 kamira kernel: uhub1: on usbus1 Sep 3 04:37:59 kamira kernel: ugen2.1: at usbus2 Sep 3 04:37:59 kamira kernel: uhub2: on usbus2 Sep 3 04:37:59 kamira kernel: ugen3.1: at usbus3 Sep 3 04:37:59 kamira kernel: uhub3: on usbus3 Sep 3 04:37:59 kamira kernel: ugen4.1: at usbus4 Sep 3 04:37:59 kamira kernel: uhub4: on usbus4 Sep 3 04:37:59 kamira kernel: ugen5.1: at usbus5 Sep 3 04:37:59 kamira kernel: uhub5: on usbus5 Sep 3 04:37:59 kamira kernel: ugen6.1: at usbus6 Sep 3 04:37:59 kamira kernel: uhub6: on usbus6 Sep 3 04:37:59 kamira kernel: uhub4: 2 ports with 2 removable, self powered Sep 3 04:37:59 kamira kernel: uhub5: 4 ports with 4 removable, self powered Sep 3 04:37:59 kamira kernel: uhub0: 5 ports with 5 removable, self powered Sep 3 04:37:59 kamira kernel: uhub2: 5 ports with 5 removable, self powered Sep 3 04:37:59 kamira kernel: uhub6: 4 ports with 4 removable, self powered Sep 3 04:37:59 kamira kernel: uhub1: 5 ports with 5 removable, self powered Sep 3 04:37:59 kamira kernel: uhub3: 5 ports with 5 removable, self powered Sep 3 04:37:59 kamira kernel: ugen3.2: at usbus3 Sep 3 04:37:59 kamira kernel: umass0: on usbus3 Sep 3 04:37:59 kamira kernel: umass0: SCSI over Bulk-Only; quirks = 0x4100 Sep 3 04:37:59 kamira kernel: umass0:5:0:-1: Attached to scbus5 Sep 3 04:37:59 kamira kernel: ugen1.2: at usbus1 Sep 3 04:37:59 kamira kernel: umass1: on usbus1 Sep 3 04:37:59 kamira kernel: umass1: SCSI over Bulk-Only; quirks = 0x4100 Sep 3 04:37:59 kamira kernel: umass1:6:1:-1: Attached to scbus6 Sep 3 04:37:59 kamira kernel: ada0 at ata2 bus 0 scbus0 target 0 lun 0 Sep 3 04:37:59 kamira kernel: ada0: ATA-8 SATA 3.x device Sep 3 04:37:59 kamira kernel: ada0: 33.300MB/s transfers (UDMA2, PIO 8192bytes) Sep 3 04:37:59 kamira kernel: ada0: 953869MB (1953525168 512 byte sectors: 16H 63S/T 16383C) Sep 3 04:37:59 kamira kernel: ada0: Previously was known as ad4 Sep 3 04:37:59 kamira kernel: da1 at umass-sim1 bus 1 scbus6 target 0 lun 0 Sep 3 04:37:59 kamira kernel: da1: Removable Direct Access SCSI-0 device Sep 3 04:37:59 kamira kernel: da1: 40.000MB/s transfers Sep 3 04:37:59 kamira kernel: da1: 15287MB (31307776 512 byte sectors: 255H 63S/T 1948C) Sep 3 04:37:59 kamira kernel: da0 at umass-sim0 bus 0 scbus5 target 0 lun 0 Sep 3 04:37:59 kamira kernel: da0: Fixed Direct Access SCSI-0 device Sep 3 04:37:59 kamira kernel: da0: 40.000MB/s transfers Sep 3 04:37:59 kamira kernel: da0: 2861588MB (732566645 4096 byte sectors: 255H 63S/T 45600C) Sep 3 04:37:59 kamira kernel: SMP: AP CPU #1 Launched! Sep 3 04:37:59 kamira kernel: Timecounter "TSC-low" frequency 9741414 Hz quality 800 Sep 3 04:37:59 kamira kernel: Trying to mount root from ufs:/dev/ada0a [rw]... Sep 3 04:37:59 kamira kernel: WARNING: / was not properly dismounted Sep 3 04:37:59 kamira ntpd[1191]: ntpd 4.2.4p5-a (1) Sep 3 04:37:59 kamira kernel: . Sep 3 04:37:59 kamira kernel: fuse4bsd: version 0.3.9-pre1, FUSE ABI 7.8 Sep 3 04:38:00 kamira kernel: re0: link state changed to UP Sep 3 04:38:05 kamira kernel: ugen1.2: at usbus1 (disconnected) Sep 3 04:38:05 kamira kernel: umass1: at uhub1, port 4, addr 2 (disconnected) Sep 3 04:38:05 kamira kernel: (da1:umass-sim1:1:0:0): lost device - 0 outstanding, 1 refs Sep 3 04:38:05 kamira kernel: (pass2:(da1:umass-sim1:1:umass-sim1:1:0:0:0): passdevgonecb: devfs entry is gone Sep 3 04:38:05 kamira kernel: 0): removing device entry Sep 3 04:38:47 kamira su: waitman to root on /dev/pts/0 Sep 3 04:39:17 kamira ntpd[1192]: time correction of -53911 seconds exceeds sanity limit (1000); set clock manually to the correct UTC time. Sep 3 04:41:28 kamira ntfs-3g[1767]: Version 2011.4.12 external FUSE 27 Sep 3 04:41:28 kamira ntfs-3g[1767]: Mounted /dev/da0s1 (Read-Write, label "FreeAgent GoFlex Drive", NTFS 3.1) Sep 3 04:41:28 kamira ntfs-3g[1767]: Cmdline options: Sep 3 04:41:28 kamira ntfs-3g[1767]: Mount options: allow_other,nonempty,atime,fsname=/dev/da0s1 Sep 3 04:41:28 kamira ntfs-3g[1767]: Ownership and permissions disabled, configuration type 1 >How-To-Repeat: reader in usb port with sdhc card seems to work 'most of the time' but for some reason caused machine reboot in one instance. thank you. >Fix: >Release-Note: >Audit-Trail: >Unformatted: From owner-freebsd-usb@FreeBSD.ORG Mon Sep 3 11:10:14 2012 Return-Path: Delivered-To: freebsd-usb@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 62F541065689 for ; Mon, 3 Sep 2012 11:10:09 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 3F1468FC16 for ; Mon, 3 Sep 2012 11:10:09 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q83BA9te053335 for ; Mon, 3 Sep 2012 11:10:09 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q83BA7Be052924 for freebsd-usb@FreeBSD.org; Mon, 3 Sep 2012 11:10:07 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 3 Sep 2012 11:10:07 GMT Message-Id: <201209031110.q83BA7Be052924@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: gnats set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-usb@FreeBSD.org Cc: Subject: Current problem reports assigned to freebsd-usb@FreeBSD.org 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: Mon, 03 Sep 2012 11:10:14 -0000 Note: to view an individual PR, use: http://www.freebsd.org/cgi/query-pr.cgi?pr=(number). The following is a listing of current problems submitted by FreeBSD users. These represent problem reports covering all versions including experimental development code and obsolete releases. S Tracker Resp. Description -------------------------------------------------------------------------------- o usb/171262 usb plug in sdhc via usb reader reboots machine o usb/171197 usb ADATA Classic CH11 USB HDD doesn't work in FreeBSD 9.1 o usb/170699 usb FreeBSD 9.0 Doesn't list HDD or its partitions in part o usb/170688 usb patch][usbdevs][wlan] Patch for ASUS Black Diamond USB o usb/170606 usb r239222 kernel panic at boot - usb locking issue o usb/170358 usb [ums] Wrong (duplicate) button numbers o usb/170123 usb [umass] HP v210w USB stick not supported o usb/169935 usb [keyboard] Unable use USB keyboard while panic o usb/169789 usb [u3g] [patch] add support for huawei e3131 o usb/169461 usb [ugen] USB2 high-speed device detected as full speed o usb/169428 usb [ugen] ugen not detecting all endpoints on device [reg o usb/168551 usb [umass] Issues with embedded card reader (Laptop ASUS o usb/168132 usb [umass] MATSHITA memory card size reported wrong, moun o usb/167847 usb [ural] dlink dwl-122g e crashes(?) when trying wap2 cr o usb/167001 usb [USB] [PATCH] add support for Smart G2 64MB memory key o usb/166848 usb [umass] [patch] Buffalo RUF2 requires quirk o usb/165815 usb [usbdevs] [patch] add k3772z 3g modem support o usb/165163 usb [keyboard] The USB RF keyboard and mouse become non-re o usb/164058 usb [umass] Lexar 8GB USB flash drive doesn't work by defa f usb/163328 usb [usb] Support for Atheros USB abgn devices o kern/163091 usb [panic] Fatal trap 12: page fault while in kernel mode f usb/162306 usb usb devices cant get address asignation, no memories, o usb/162054 usb usbdump just hangs on 9.0-RC1 f usb/161793 usb poor EHCI usb2 i/o performance o usb/160436 usb ucom wedges machine on parity error ? o usb/160299 usb MicroSDHC-to-USB adapters do not work in FreeBSD 8.x o usb/160192 usb [install] Installation from USB-Stick doesn't find the o usb/159611 usb [PATCH] USB stick extrememory Snippy needs quirks o usb/159274 usb USB 3.0 Etron EJ168A does not work. f usb/159191 usb [fusefs-ntfs] write on fusefs-ntfs mounted partition r o usb/157376 usb LaCie USB disk not recognized o usb/157074 usb [boot] [usb8] vfs_mountroot_ask is called when no usb o usb/156898 usb [keyboard] usb keyboard does not work while boot (ps2 f usb/156735 usb Need Quirk for Goflex USB Disk Drives o usb/156726 usb [snd_uaudio]: snd_uaudio(4) fails to detach when mixer o usb/156725 usb USB stack stall cause complete system input loss o usb/156596 usb [ehci] Extremely high interrupt rate on ehci/uhci IRQ1 o usb/156000 usb rum(4) Fatal trap 18: integer divide fault while in ke f usb/155996 usb NanoBSD not booted as Disk o usb/155784 usb Problem with Transcend StoreJet 25M3 (2AJ1) on Asus M2 o usb/155663 usb [usbdevs] [patch] Add support for Supertop Nano 1GB US o usb/154753 usb [usbdevs] [patch] Support for Qualcomm USB modem/stora o usb/154506 usb [umass] Copying dir with large files makes FreeBSD loa o usb/154192 usb [umass] In Garmin Oregon GPS, only the first umass dev o i386/153851 usb [keyboard] keyboard issues on new Intel Mother boards. o usb/153703 usb [keyboard] My USB keyboard can not be used in 8-STABLE o usb/153609 usb [zyd] [panic] kernel: Fatal trap 12: page fault while o usb/153599 usb [usbdevs] [patch] Feiya Elango USB MicroSD reader sync o usb/153149 usb [umass] USB stick quirk regression [regression] o usb/152075 usb [usb8] [ehci] [request] Add quirk for CS5536 USB o usb/150892 usb [zyd] Whenever network contacted in any shape, way or o usb/150189 usb [run] [usb8] [patch] if_run appears to corrupt IP traf p usb/149764 usb [u3g] [patch] usbdevs update: Huawei K3765 3G modem o usb/149283 usb [uftdi] avrdude unable to talk to Arduino board (via u o usb/149162 usb [ural] ASUS WL-167g doesn't work in 8.1 (continue of 1 s usb/148702 usb [usb8] [request] IO DATA USB-RSAQ5 support on FreeBSD- o usb/148080 usb usbconfig(8) sometimes does not turn off the device o usb/147516 usb [umass] [usb67] kernel unable to deal with Olympus USB o i386/147475 usb [install] FreeBSD 8.x does not install on ASUS K8N4-E o usb/146840 usb [hang] FreeBSD 7.2 / 7.3 / 8.0 hang at startup after e o usb/146153 usb [axe] [usb8] Hosts in network doesn't receive any pack f usb/146054 usb [urtw] [usb8] urtw driver potentially out of date f usb/145513 usb [usb8] New USB stack: no new devices after forced usb p usb/145455 usb [usb8] [patch] USB debug support cannot be disabled o usb/145415 usb [umass] [usb8] USB card reader does not create slices a usb/145184 usb GENERIC can't mount root from USB on Asus EEE o usb/145165 usb [keyboard] [usb8] ukbd_set_leds_callback: error=USB_ER f kern/144938 usb [keyboard] [boot] Boot Failure with Apple (MB869LL/A) o usb/144387 usb [run] [panic] if_run panic o usb/144043 usb [umass] [usb8] USB DLT tape drive throws random errors a usb/143790 usb [boot] [cam] can not boot from usb hdd f usb/143620 usb [cdce] [usb8] the module if_cdce doesn't support my Op f usb/143294 usb [usb8] copying process stops at some time (10 - 50 sec o usb/143286 usb [ukbd] [usb8] [boot] boot failures on RELENG_8 system p usb/143186 usb [usbdevs] [usb8] [patch] add USB device IDs for Google a usb/143139 usb [umass] [usb8] [patch] Quirk for Century EX35SW4_SB4 J p usb/143045 usb [umass] [usb8] [patch] mounting Fujitsu 2600Z camera d o usb/142991 usb [uftdi] [usb67] [patch] Patch to add Crystalfontz 533 f usb/142989 usb [usb8] canon eos 50D attaches but detaches after few s f usb/142957 usb [umass] [usb8] [patch] patch for USB disk SYNCHRONIZE o usb/142719 usb [urtw] [usb8] AirLive WL-1600USB (RTL8187L chipset) fa o usb/142713 usb [usb67] [panic] Kernel Panik when connecting an IPhone f usb/142276 usb [umass] [usb8] Cache Synchronization Error with Olympu o usb/142229 usb [ums] [usb8] [hang] connecting a USB mouse to a Dell P f usb/141680 usb [uath] [usb8] Netgear WG111T not working with uath dri o usb/141664 usb [pcm] [usb8] Logitech USB microphone failure [regressi o usb/141474 usb [boot] [usb8] FreeBSD 8.0 can not install from USB CDR o usb/141327 usb [ukbd] [usb67] USB kbd not working with 7.1+PAE on IBM o usb/141212 usb [ukbd] [usb8] ukbd_set_leds_callback:700: error=USB_ER o kern/141011 usb [usb8] Encrypted root, geli password at boot; enter ke o usb/140920 usb [install] [usb8] USB based install fails on 8.0-RELEAS o usb/140893 usb [urtw] [usb8] WPA2 not working on rtl8187b o kern/140849 usb [ums] [usb8] USB mouse doesn't work under FreeBSD 8.0- a usb/140810 usb [uftdi] [usb8] 8.X copy and paste problem / tty overfl o usb/140477 usb [umass] [usb8] [patch] allow boot-time attachment of d o usb/140236 usb [msdosfs] [usb8] Labels wiped on external Journaled US o usb/140160 usb [usb8] [acpi] USB ports are no longer "active" after A s usb/139990 usb [panic] [patch] [usb67] Kernel frequently panics after o usb/139243 usb [uhci] [usb67] unplug prolific USB serial -> uhci_abor f usb/138882 usb [ohci] [panic] [usb67] Can't install FreeBSD 7.2 due t o usb/138798 usb [boot] [usb8] 8.0-BETA4 can't boot from USB flash driv o usb/138659 usb [usb8][uftdi] driver broken in RELENG_8/CURRENT o usb/138175 usb [usb67] [boot] System cannot boot, when USB reader wit o usb/138124 usb [snd_uaudio] [usb8] Axed uaudio functionality in the u o usb/138119 usb [usb67] [usb8] MultiBay CDROM (probably on USB bus) is f usb/137872 usb [usb67] [boot] slow booting on usb flash drive o usb/137806 usb [ukbd] [usb67] USB keyboard doesn't work until it's un o usb/137763 usb [usb67][ukbd] Logitech wireless keyboard media keys no o usb/137377 usb [usb8] request support for Huawei E180 o usb/137341 usb [usb8][rum] driver if_rum doesn't work at all and thro f usb/137190 usb [usb8][patch] inhibit spurious button releases for som o usb/137189 usb [usb8][patch] create and use sysctl nodes for HID repo p usb/137188 usb [usb8][patch] correctly handle USB report descriptors o usb/137129 usb [ums] [usb8] SteelSeries Ikari USB laser mouse not att o usb/135938 usb [aue] [usb67] aue driver only passes traffic in promis o usb/135542 usb [keyboard] boot loader does not work with a usb keyboa o usb/135206 usb machine reboots when inserted USB device f usb/135200 usb SAMSUNG i740 usb mass: Synchronize cache failed, statu o usb/134950 usb Lowering DTR for USB-modem via ubsa is not possible o usb/134299 usb Kernel Panic plugging in MF626 USB UMTS Stick u3g o usb/134193 usb System freeze on usb MP3 player insertion o usb/134085 usb [umass] Adding usb quirk for Sony USB flash drive o usb/133989 usb [usb8] [ukbd] USB keyboard dead at mountroot> prompt o usb/133712 usb [ural] [patch] RE: Fixed an issue with ural(4) that wa o usb/133390 usb umass crashes system in 7.1 when Olympus D-540 attache o usb/133296 usb [rum] driver not working properly in hostap mode o usb/132594 usb USB subsystem causes page fault and crashes o usb/132080 usb [patch] [usb] [rum] [panic] Kernel panic after NOMEM c o usb/132066 usb [ukbd] Keyboard failure USB keyboard DELL 760 o usb/132036 usb [panic] page fault when connecting Olympus C740 camera o usb/131583 usb [umass] Failure when detaching umass Device o usb/131576 usb [aue] ADMtek USB To LAN Converter can't send data o usb/131521 usb Registering Belkin UPS to usb_quirks.c o usb/131074 usb no run-time detection of usb devices plugged into exte o usb/130736 usb Page fault unplugging USB stick o usb/130230 usb [patch] [quirk] [usb67] [usb] [cam] [umass] Samsung El o usb/130208 usb Boot process severely hampered by umass0 error o usb/130122 usb [usb8] DVD drive detects as 'da' device f usb/129766 usb [usb] [panic] plugging in usb modem HUAWEI E226 panics o usb/129500 usb [umass] [panic] FreeBSD Crashes when connecting SanDis o usb/129311 usb [usb] [panic] Instant crash with an USB card reader s usb/128990 usb [usb] u3g does not handle RTS/CTS available on for exa o usb/128977 usb [usb67] [patch] uaudio is not full duplex p usb/128803 usb [usbdevs] [patch] Quirk for I-Tuner Networks USBLCD4X2 o usb/128485 usb [umodem] [patch] Nokia N80 modem support o usb/128425 usb [umass] Cannot Connect Maxtor Onetouch 4 USB drive o usb/128418 usb [panic] [rum] loading if_rum causes panic, looks like o usb/127926 usb [boot] USB Timeout during bootup s usb/127453 usb [request] ubsa, uark, ubser, uftdi, and friends should o usb/127342 usb [boot] [panic] enabling usb keyboard and mouse support o usb/127248 usb [ucom] panic while uplcom devices attach and detach o usb/126884 usb [ugen] [patch] Bug in buffer handling in ugen.c o usb/126848 usb [usb]: USB Keyboard hangs during Installation o usb/126740 usb [ulpt] doesn't work on 7.0-RELEASE, 10 second stall be o usb/126519 usb [usb] [panic] panic when plugging in an iphone o kern/126396 usb [panic] kernel panic after unplug USB Bluetooth device o usb/125631 usb [ums] [panic] kernel panic during bootup while 'Logite o usb/125510 usb [panic] repeated plug and unplug of USB mass storage d f usb/125450 usb [panic] Removing USB flash card while being accessed c o usb/125088 usb [keyboard] Touchpad not detected on Adesso AKB-430UG U o usb/124980 usb [panic] kernel panic on detaching unmounted umass devi o kern/124777 usb [ucom] USB cua devices don't revert to tty devices whe o usb/124758 usb [rum] [panic] rum panics SMP kernel o usb/124708 usb [panic] Kernel panic on USB KVM reattach o kern/124130 usb [usb] gmirror fails to start usb devices that were pre o usb/123969 usb [usb] Supermicro H8SMi-2 usb problem: port reset faile o usb/123714 usb [usb] [panic] Panic when hald-storage-probe runs with o usb/123691 usb usbd(8): usbd hangs o usb/123690 usb [usb] [panic] Panic on USB device insertion when usb l o usb/123611 usb [usb] BBB reset failed, STALLED from Imation/Mitsumi U o usb/122992 usb [umass] [patch] MotoROKR Z6 Phone not recognised by um o usb/122936 usb [ucom] [ubsa] Device does not receive interrupt o usb/122905 usb [ubsa] [patch] add Huawei E220 to ubsa s usb/122819 usb [usb67] [patch] Patch to provide dynamic additions to o usb/122813 usb [udbp] [request] udbp driver should be removed in favo o usb/122547 usb [ehci] USB Printer not being recognized after reboot o usb/122539 usb [ohci] [panic] AnyDATA ADU-E1000D - kernel panic: ohci o usb/122483 usb [panic] [ulpt] Repeatable panic in 7.0-STABLE o usb/122119 usb [umass] umass device causes creation of daX but not da o usb/121734 usb [ugen] ugen HP1022 printer device not working since up o usb/121708 usb [keyboard] nforce 650i mobo w/ usb keyboard infinite k o usb/121474 usb [cam] [patch] QUIRK: SAMSUNG HM250JI in LaCie usb hard o usb/121275 usb [boot] [panic] FreeBSD fails to boot with usb legacy s o usb/121169 usb [umass] Issues with usb mp3 player o usb/121045 usb [uftdi] [patch] Add support for PC-OP-RS1 and KURO-RS f usb/120786 usb [usb] [panic] Kernel panic when forced umount of a det o usb/120729 usb [panic] fault while in kernel mode with connecting USB o usb/120321 usb [hang] System hangs when transferring data to WD MyBoo o usb/120283 usb [panic] Automation reboot with wireless keyboard & mou o usb/120034 usb [hang] 6.2 & 6.3 hangs on boot at usb0: OHCI with 1.5 o usb/119977 usb [ums] Mouse does not work in a Cherry-USB keyboard/mou o usb/119653 usb [cam] [patch] iriver s7 player sync cache error patch o usb/119633 usb [umass] umass0: BBB reset failed, IOERROR [regression] o usb/119509 usb [usb] USB flaky on Dell Optiplex 755 o usb/119389 usb [umass] Sony DSC-W1 CBI reset failed, STALLED [regress o usb/119227 usb [ubsa] [patch] ubsa buffer is too small; should be tun o usb/118480 usb [umass] Timeout in USB mass storage freezes vfs layer o usb/118353 usb [panic] [ppp] repeatable kernel panic during ppp(4) se o usb/118141 usb [ucom] usb serial and nokia phones ucomreadcb ucomread o usb/118140 usb [ucom] [patch] quick hack for ucom to get it behave wi o usb/118098 usb [umass] 6th gen iPod causes problems when disconnectin o usb/117955 usb [umass] [panic] inserting minolta dimage a2 crashes OS o usb/117946 usb [panic] D-Link DUB-E100 rev. B1 crashes FreeBSD 7.0-BE o usb/117938 usb [ums] [patch] Adding support for MS WL Natural and MS o usb/117911 usb [ums] [request] Mouse Gembird MUSWC not work o usb/117893 usb [umass] Lacie USB DVD writing failing o usb/117613 usb [uhci] [irq] uhci interrupt storm & USB leaked memory o usb/117598 usb [snd_uaudio] [patch] Not possible to record with Plant o usb/117313 usb [umass] [panic] panic on usb camera insertion o usb/117200 usb [ugen] ugen0 prints strange string on attach if detach o usb/117183 usb [panic] USB/fusefs -- panic while transferring large a o usb/116561 usb [umodem] [panic] RELENG_6 umodem panic "trying to slee o usb/116282 usb [ulpt] Cannot print on USB HP LJ1018 or LJ1300 o usb/115935 usb [usbdevs] [patch] kernel counterproductively attaches o usb/115400 usb [ehci] Problem with EHCI on ASUS M2N4-SLI o usb/115298 usb [ulpt] [panic] Turning off USB printer panics kernel o usb/114916 usb [umass] [patch] USB Maxtor drive (L300RO) requires qui o kern/114780 usb [uplcom] [panic] Panics while stress testing the uplco o usb/114682 usb [umass] generic USB media-card reader unusable o usb/114310 usb [libusb] [patch] [panic] USB hub attachment panics ker o usb/114068 usb [usb67] [usb8] [umass] [patch] Problem with connection o conf/114013 usb [patch] WITHOUT_USB allow to compil a lot of USB stuff s usb/113060 usb [usb67] [ulpt] [patch] Samsung printer not working in o usb/110856 usb [usb67] [ugen] [patch] interrupt in msgs are truncated o usb/107827 usb [usb67] [ohci] [panic] ohci_add_done addr not found o usb/107388 usb [usb67] [usb8] [new driver] [patch] add utoppy device o usb/106041 usb [usb67] [usb8] [request] FreeBSD does not recognise Mu s usb/103917 usb [usb67] [uhub] USB driver reports "Addr 0 should never o usb/103418 usb [usb67] [usb8] [patch] [request] usbhidctl(8) add abil o usb/103046 usb [usb67] [ulpt] [patch] ulpt event driven I/O with sele o usb/100746 usb [usb67] [ukbd] system does not boot due to USB keyboar o usb/99431 usb [keyboard] FreeBSD on MSI 6566E (Intel 845E motherboar o kern/99200 usb [usb67] SMP-Kernel crashes reliably when Bluetooth con o usb/98343 usb [boot] BBB reset failed errors with Creative Muvo MP3 o usb/97472 usb [cam] [patch] add support for Olympus C150,D390 s usb/97286 usb [mouse] [request] MS Wireless Intellimouse Explorer 2. o usb/97175 usb [umass] [hang] USB cardreader hangs system o usb/96457 usb [umass] [panic] fatback on umass = reboot o usb/96381 usb [cam] [patch] add a quirk table entry for a flash ram o usb/96224 usb [usb] [msdosfs] mount_msdosfs cause page fault in sync s usb/96120 usb [ums] [request] USB mouse not always detected s usb/95636 usb [umass] [boot] 5 minute delay at boot when using VT620 o usb/95562 usb [umass] Write Stress in USB Mass drive causes "vinvalb o usb/95037 usb [umass] USB disk not recognized on hot-plug. o usb/94897 usb [panic] Kernel Panic when cleanly unmounting USB disk o usb/94717 usb [ulpt] Reading from /dev/ulpt can break work of a UHCI o usb/94384 usb [panic] kernel panic with usb2 hardware o usb/93872 usb [cam] [patch] SCSI quirk required for ELTA 8061 OL USB o usb/93828 usb [ohci] [panic] ohci causes panic on boot (HP Pavillion o usb/93389 usb [umass] [patch] Digital Camera Pentax S60 don't work o usb/92852 usb [ums] [patch] Vertical scroll not working properly on o usb/92171 usb [panic] panic unplugging Vodafone Mobile Connect (UMTS o usb/92142 usb [uhub] SET_ADDR_FAILED and SHORT_XFER errors from usb o usb/92083 usb [ural] [panic] panic using WPA on ural NIC in 6.0-RELE o usb/92052 usb [ulpt] usbd causes defunct process with busy file-hand o usb/91906 usb [ehci] [hang] FreeBSD hangs while booting with USB leg f usb/91896 usb camcontrol(8): Serial Number of USB Memory Sticks is n o usb/91811 usb [umass] Compact Flash in HP Photosmart 2610 return " o usb/91546 usb [umodem] [patch] Nokia 6630 mobile phone does not work o usb/91538 usb [ulpt] [patch] Unable to print to EPSON CX3500 o usb/91283 usb [boot] [regression] booting very slow with usb devices o usb/91238 usb [umass] USB tape unit fails to write a second tape fil o usb/90700 usb [umass] [panic] Kernel panic on connect/mount/use umas o usb/89954 usb [umass] [panic] USB Disk driver race condition? o usb/88743 usb [hang] [regression] USB makes kernel hang at boot (reg o usb/88408 usb [axe] axe0 read PHY failed o usb/87648 usb [mouse] Logitech USB-optical mouse problem. f usb/87224 usb [usb] Cannot mount USB Zip750 o usb/86767 usb [umass] [patch] bogus "slice starts beyond end of the o usb/86298 usb [mouse] Known good USB mouse won't work with correct s s usb/85067 usb [uscanner] Cannot attach ScanJet 4300C to usb device o usb/83977 usb [ucom] [panic] ucom1: open bulk out error (addr 2): IN o usb/83863 usb [ugen] Communication problem between opensc/openct via o usb/83756 usb [ums] [patch] Microsoft Intellimouse Explorer 4.0A doe o usb/83504 usb [kernel] [patch] SpeedTouch USB stop working on recent o usb/82520 usb [udbp] [reboot] Reboot when USL101 connected o usb/82350 usb [ucom] [panic] null pointer dereference in USB stack o usb/81621 usb [ehci] [hang] external hd hangs under load on ehci o usb/80935 usb [uvisor] [patch] uvisor.c is not work with CLIE TH55. s usb/80777 usb [request] usb_rem_task() should wait for callback to c s usb/80776 usb [udav] [request] UDAV device driver shouldn't use usb_ o usb/80774 usb [patch] have "usbd_find_desc" in line with the other " o usb/80361 usb [umass] [patch] mounting of Dell usb-stick fails f usb/80040 usb [sound] [hang] Use of sound mixer causes system freeze o usb/79723 usb [usb] [request] prepare for high speed isochronous tra o usb/78984 usb [umass] [patch] Creative MUVO umass failure f usb/77294 usb [ucom] [panic] ucom + ulpcom panic o usb/76653 usb [umass] [patch] Problem with Asahi Optical usb device f usb/76395 usb [uhci] USB printer does not work, usbdevs says "addr 0 s usb/75928 usb [umass] [request] Cytronix SmartMedia card (SMC) reade o usb/75800 usb [ucom] ucom1: init failed STALLED error in time of syn o usb/75764 usb [umass] [patch] "umass0: Phase Error" - no device for f usb/75705 usb [umass] [panic] da0 attach / Optio S4 (with backtrace) f usb/74771 usb [umass] [hang] mounting write-protected umass device a s usb/74453 usb [umass] [patch] Q-lity CD-RW USB ECW-043 (ScanLogic SL o usb/74211 usb [umass] USB flash drive causes CAM status 0x4 on 4.10R o usb/71417 usb [ugen] Cryptoflex e-gate USB token (ugen0) communicati o usb/71416 usb [ugen] Cryptoflex e-gate USB token (ugen0) detach is n o usb/71280 usb [aue] aue0 device (linksys usb100tx) doesn't work in 1 o usb/71155 usb [ulpt] misbehaving usb-printer hangs processes, causes o usb/69006 usb [usbdevs] [patch] Apple Cinema Display hangs USB ports o usb/67301 usb [uftdi] [panic] RTS and system panic o usb/66547 usb [ucom] Palm Tungsten T USB does not initialize correct o usb/63621 usb [umass] [panic] USB MemoryStick Reader stalls/crashes s usb/62257 usb [umass] [request] card reader UCR-61S2B is only half-s s bin/57255 usb [patch] usbd(8) and multi-function devices s usb/52026 usb [usb] [request] umass driver support for InSystem ISD2 s usb/51958 usb [urio] [patch] update for urio driver o usb/40948 usb [umass] [request] USB HP CDW8200 does not work o usb/30929 usb [usb] [patch] use usbd to initialize USB ADSL modem 310 problems total. From owner-freebsd-usb@FreeBSD.ORG Mon Sep 3 15:16:20 2012 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 49B591065674; Mon, 3 Sep 2012 15:16:20 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe04.c2i.net [212.247.154.98]) by mx1.freebsd.org (Postfix) with ESMTP id 972B28FC2B; Mon, 3 Sep 2012 15:16:19 +0000 (UTC) X-T2-Spam-Status: No, hits=-0.2 required=5.0 tests=ALL_TRUSTED, BAYES_50 Received: from [176.74.212.201] (account mc467741@c2i.net HELO laptop015.hselasky.homeunix.org) by mailfe04.swip.net (CommuniGate Pro SMTP 5.4.4) with ESMTPA id 314193595; Mon, 03 Sep 2012 17:16:10 +0200 From: Hans Petter Selasky To: freebsd-usb@freebsd.org Date: Mon, 3 Sep 2012 17:17:12 +0200 User-Agent: KMail/1.13.7 (FreeBSD/9.1-PRERELEASE; KDE/4.8.4; amd64; ; ) References: <201209022103.q82L3qhq065244@red.freebsd.org> In-Reply-To: <201209022103.q82L3qhq065244@red.freebsd.org> X-Face: 'mmZ:T{)),Oru^0c+/}w'`gU1$ubmG?lp!=R4Wy\ELYo2)@'UZ24N@d2+AyewRX}mAm; Yp |U[@, _z/([?1bCfM{_"B<.J>mICJCHAzzGHI{y7{%JVz%R~yJHIji`y>Y}k1C4TfysrsUI -%GU9V5]iUZF&nRn9mJ'?&>O MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201209031717.12600.hselasky@c2i.net> Cc: Waitman Gobble , freebsd-gnats-submit@freebsd.org Subject: Re: usb/171262: plug in sdhc via usb reader reboots machine 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: Mon, 03 Sep 2012 15:16:20 -0000 On Sunday 02 September 2012 23:03:52 Waitman Gobble wrote: > >Number: 171262 > >Category: usb > >Synopsis: plug in sdhc via usb reader reboots machine > >Confidential: no > >Severity: non-critical > >Priority: low > >Responsible: freebsd-usb > >State: open > >Quarter: > >Keywords: > >Date-Required: > >Class: sw-bug > >Submitter-Id: current-users > >Arrival-Date: Sun Sep 02 21:10:11 UTC 2012 > >Closed-Date: > >Last-Modified: > >Originator: Waitman Gobble > >Release: FreeBSD 9.1-RC1 > > >Organization: > Waitman Gobble > > >Environment: > FreeBSD kamira.waitman.net 9.1-RC1 FreeBSD 9.1-RC1 #0: Tue Aug 14 04:25:06 > UTC 2012 root@farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC > amd64 > > >Description: > was dumping sdhc cards to ntfs-3g mounted usb drive (8 cards successfully, > then inserting 9th card rebooted machine) > > this in logs 45 times: > > Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): SCSI sense: HARDWARE > FAILURE asc:4b,0 (Data phase error) > > (then machine reboot.) > > full log starting from insert: > > > >How-To-Repeat: > reader in usb port with sdhc card seems to work 'most of the time' but for > some reason caused machine reboot in one instance. thank you. > Hi, I think this is not caused by USB. Probably a CAM or filesystem issue. --HPS From owner-freebsd-usb@FreeBSD.ORG Mon Sep 3 15:20:12 2012 Return-Path: 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 6D439106566B for ; Mon, 3 Sep 2012 15:20:12 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 579AB8FC12 for ; Mon, 3 Sep 2012 15:20:12 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q83FKCML011092 for ; Mon, 3 Sep 2012 15:20:12 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q83FKC4D011077; Mon, 3 Sep 2012 15:20:12 GMT (envelope-from gnats) Date: Mon, 3 Sep 2012 15:20:12 GMT Message-Id: <201209031520.q83FKC4D011077@freefall.freebsd.org> To: freebsd-usb@FreeBSD.org From: Hans Petter Selasky Cc: Subject: Re: usb/171262: plug in sdhc via usb reader reboots machine X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Hans Petter Selasky List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Sep 2012 15:20:12 -0000 The following reply was made to PR usb/171262; it has been noted by GNATS. From: Hans Petter Selasky To: freebsd-usb@freebsd.org Cc: Waitman Gobble , freebsd-gnats-submit@freebsd.org Subject: Re: usb/171262: plug in sdhc via usb reader reboots machine Date: Mon, 3 Sep 2012 17:17:12 +0200 On Sunday 02 September 2012 23:03:52 Waitman Gobble wrote: > >Number: 171262 > >Category: usb > >Synopsis: plug in sdhc via usb reader reboots machine > >Confidential: no > >Severity: non-critical > >Priority: low > >Responsible: freebsd-usb > >State: open > >Quarter: > >Keywords: > >Date-Required: > >Class: sw-bug > >Submitter-Id: current-users > >Arrival-Date: Sun Sep 02 21:10:11 UTC 2012 > >Closed-Date: > >Last-Modified: > >Originator: Waitman Gobble > >Release: FreeBSD 9.1-RC1 > > >Organization: > Waitman Gobble > > >Environment: > FreeBSD kamira.waitman.net 9.1-RC1 FreeBSD 9.1-RC1 #0: Tue Aug 14 04:25:06 > UTC 2012 root@farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC > amd64 > > >Description: > was dumping sdhc cards to ntfs-3g mounted usb drive (8 cards successfully, > then inserting 9th card rebooted machine) > > this in logs 45 times: > > Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): SCSI sense: HARDWARE > FAILURE asc:4b,0 (Data phase error) > > (then machine reboot.) > > full log starting from insert: > > > >How-To-Repeat: > reader in usb port with sdhc card seems to work 'most of the time' but for > some reason caused machine reboot in one instance. thank you. > Hi, I think this is not caused by USB. Probably a CAM or filesystem issue. --HPS From owner-freebsd-usb@FreeBSD.ORG Mon Sep 3 15:26:59 2012 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A16E0106564A; Mon, 3 Sep 2012 15:26:59 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe04.c2i.net [212.247.154.98]) by mx1.freebsd.org (Postfix) with ESMTP id 027738FC08; Mon, 3 Sep 2012 15:26:58 +0000 (UTC) X-T2-Spam-Status: No, hits=-0.2 required=5.0 tests=ALL_TRUSTED, BAYES_50 Received: from [176.74.212.201] (account mc467741@c2i.net HELO laptop015.hselasky.homeunix.org) by mailfe04.swip.net (CommuniGate Pro SMTP 5.4.4) with ESMTPA id 314197297; Mon, 03 Sep 2012 17:26:57 +0200 To: freebsd-usb@freebsd.org From: Hans Petter Selasky X-Face: 'mmZ:T{)),Oru^0c+/}w'`gU1$ubmG?lp!=R4Wy\ELYo2)@'UZ24N@ =?iso-8859-15?q?d2+AyewRX=7DmAm=3BYp=0A=09=7CU=5B?=@, _z/([?1bCfM{_"B<.J>mICJCHAzzGHI{y7{%JVz%R~yJHIji`y> =?iso-8859-15?q?Y=7Dk1C4TfysrsUI=0A=09-=25GU9V5=5DiUZF=26nRn9mJ=27=3F=26?=>O Date: Mon, 3 Sep 2012 17:27:59 +0200 MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201209031727.59369.hselasky@c2i.net> Cc: Waitman Gobble , freebsd-gnats-submit@freebsd.org Subject: Re: usb/171262: plug in sdhc via usb reader reboots machine 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: Mon, 03 Sep 2012 15:26:59 -0000 On Sunday 02 September 2012 23:03:52 Waitman Gobble wrote: > >Number: 171262 > >Category: usb > >Synopsis: plug in sdhc via usb reader reboots machine > >Confidential: no > >Severity: non-critical > >Priority: low > >Responsible: freebsd-usb > >State: open > >Quarter: > >Keywords: > >Date-Required: > >Class: sw-bug > >Submitter-Id: current-users > >Arrival-Date: Sun Sep 02 21:10:11 UTC 2012 > >Closed-Date: > >Last-Modified: > >Originator: Waitman Gobble > >Release: FreeBSD 9.1-RC1 > > >Organization: > Waitman Gobble > > >Environment: > FreeBSD kamira.waitman.net 9.1-RC1 FreeBSD 9.1-RC1 #0: Tue Aug 14 04:25:06 > UTC 2012 root@farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC > amd64 > > >Description: > was dumping sdhc cards to ntfs-3g mounted usb drive (8 cards successfully, > then inserting 9th card rebooted machine) > > this in logs 45 times: > > Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): SCSI sense: HARDWARE > FAILURE asc:4b,0 (Data phase error) > > (then machine reboot.) > > full log starting from insert: > > > >How-To-Repeat: > reader in usb port with sdhc card seems to work 'most of the time' but for > some reason caused machine reboot in one instance. thank you. > Hi, If you add the kernel debugging options to your GENERIC file, then you will get a backtrace next time it crashes. There is also a script under: /usr/src/tools/regression/usb/ Which you can use to forcedly re-enumerate your USB card-reader. Try that when a card is inserted with NTFS and see what happens. --HPS From owner-freebsd-usb@FreeBSD.ORG Mon Sep 3 15:30:18 2012 Return-Path: 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 D29AD106564A for ; Mon, 3 Sep 2012 15:30:18 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id BD6978FC18 for ; Mon, 3 Sep 2012 15:30:18 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q83FUInP014147 for ; Mon, 3 Sep 2012 15:30:18 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q83FUIbA014131; Mon, 3 Sep 2012 15:30:18 GMT (envelope-from gnats) Date: Mon, 3 Sep 2012 15:30:18 GMT Message-Id: <201209031530.q83FUIbA014131@freefall.freebsd.org> To: freebsd-usb@FreeBSD.org From: Hans Petter Selasky Cc: Subject: Re: usb/171262: plug in sdhc via usb reader reboots machine X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Hans Petter Selasky List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Sep 2012 15:30:18 -0000 The following reply was made to PR usb/171262; it has been noted by GNATS. From: Hans Petter Selasky To: freebsd-usb@freebsd.org Cc: Waitman Gobble , freebsd-gnats-submit@freebsd.org Subject: Re: usb/171262: plug in sdhc via usb reader reboots machine Date: Mon, 3 Sep 2012 17:27:59 +0200 On Sunday 02 September 2012 23:03:52 Waitman Gobble wrote: > >Number: 171262 > >Category: usb > >Synopsis: plug in sdhc via usb reader reboots machine > >Confidential: no > >Severity: non-critical > >Priority: low > >Responsible: freebsd-usb > >State: open > >Quarter: > >Keywords: > >Date-Required: > >Class: sw-bug > >Submitter-Id: current-users > >Arrival-Date: Sun Sep 02 21:10:11 UTC 2012 > >Closed-Date: > >Last-Modified: > >Originator: Waitman Gobble > >Release: FreeBSD 9.1-RC1 > > >Organization: > Waitman Gobble > > >Environment: > FreeBSD kamira.waitman.net 9.1-RC1 FreeBSD 9.1-RC1 #0: Tue Aug 14 04:25:06 > UTC 2012 root@farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC > amd64 > > >Description: > was dumping sdhc cards to ntfs-3g mounted usb drive (8 cards successfully, > then inserting 9th card rebooted machine) > > this in logs 45 times: > > Sep 3 04:36:59 kamira kernel: (da1:umass-sim1:1:0:0): SCSI sense: HARDWARE > FAILURE asc:4b,0 (Data phase error) > > (then machine reboot.) > > full log starting from insert: > > > >How-To-Repeat: > reader in usb port with sdhc card seems to work 'most of the time' but for > some reason caused machine reboot in one instance. thank you. > Hi, If you add the kernel debugging options to your GENERIC file, then you will get a backtrace next time it crashes. There is also a script under: /usr/src/tools/regression/usb/ Which you can use to forcedly re-enumerate your USB card-reader. Try that when a card is inserted with NTFS and see what happens. --HPS From owner-freebsd-usb@FreeBSD.ORG Mon Sep 3 15:53:57 2012 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E786C106566B for ; Mon, 3 Sep 2012 15:53:56 +0000 (UTC) (envelope-from dantavious313@gmail.com) Received: from mail-yw0-f45.google.com (mail-yw0-f45.google.com [209.85.213.45]) by mx1.freebsd.org (Postfix) with ESMTP id 9B0128FC0C for ; Mon, 3 Sep 2012 15:53:56 +0000 (UTC) Received: by yhpp34 with SMTP id p34so955504yhp.18 for ; Mon, 03 Sep 2012 08:53:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:user-agent:references:in-reply-to:cc :mime-version:content-type:content-transfer-encoding:message-id; bh=b5OWv3GeGC2oPEeJy9l9K+X6lZzciv2quZp8gn5sTZk=; b=mEfFeInUX9vrBUSkZptap8frIPpXDc+5eha30eKQ2PIAfxq/4Yf8iSeqSyRxAmadxe 9lFp2wHsDgsITXHZWXgo4GDRdjw+zJs2RCEkKdSA9kMUBs+FKrcqouDW8zTUA6xEuOf5 q3DyVRteqLka3nQKGgNRQgRgPcsrD8eB4XmjcSiEWt3suocJZziZ4xFXF3GB+LVXFUOb 0nNorOnNxdtHToNel9sLja3ynrLqbweW9RpHxFPbohcDIKXPZnGYhDh1plqq/azESJXJ jVSo1srZslzmf1GfZbCThEzM9EuKiVPhRiY/16UlNsq6fqypM+xguFsWLo0YCx/jQJmk 7hRA== Received: by 10.236.191.233 with SMTP id g69mr15234079yhn.113.1346687630660; Mon, 03 Sep 2012 08:53:50 -0700 (PDT) Received: from joker.localnet (c-71-226-137-213.hsd1.ga.comcast.net. [71.226.137.213]) by mx.google.com with ESMTPS id o25sm24847536yhm.14.2012.09.03.08.53.49 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 03 Sep 2012 08:53:50 -0700 (PDT) From: Derrick Edwards To: freebsd-usb@freebsd.org Date: Mon, 3 Sep 2012 11:53:48 -0400 User-Agent: KMail/1.13.7 (FreeBSD/10.0-CURRENT; KDE/4.8.4; amd64; ; ) References: <201209021248.21905.dantavious313@gmail.com> <201209022117.04464.hselasky@c2i.net> In-Reply-To: <201209022117.04464.hselasky@c2i.net> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201209031153.48984.dantavious313@gmail.com> Cc: Subject: Re: USB 3.0 Issues 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: Mon, 03 Sep 2012 15:53:57 -0000 On Sunday, September 02, 2012 03:17:04 PM Hans Petter Selasky wrote: > On Sunday 02 September 2012 18:48:16 Derrick Edwards wrote: > > When I disable USB 3.0 support in the BIOS, USB functions properly. Any > > ideas on what could be causing this? Please let me know what additional > > information you need. > > Hi, > > I'm afraid I need my hand on your device to figure this out. > > When the device init fails, it means that SET-ADDRESS fails, and without > that we are lost. > > You could try setting this variable in /boot/loader.conf > > hw.usb.xhci.xhci_port_route="0xFFFFFFFF" > hw.usb.xhci.xhci_port_route="0x0" > hw.usb.xhci.xhci_port_route="0x1" > hw.usb.xhci.xhci_port_route="0x2" > hw.usb.xhci.xhci_port_route="0x4" > hw.usb.xhci.xhci_port_route="0x8" > > And so on. > > --HPS Hans, Thanks for the reply. I added your suggestions to /boot/loader.conf and now the enabled USB 3.0 system works 90 percent of the time so far. For example in the below example the USB stick was recongized, then not, the recongized again after multiple inserts and detachs. Sep 3 08:05:45 joker kernel: ugen2.3: at usbus2 (disconnected) Sep 3 08:05:45 joker kernel: umass0: at uhub3, port 4, addr 3 (disconnected) Sep 3 08:05:45 joker kernel: (da0:umass-sim0:0:0:0): lost device - 0 outstanding, 1 refs Sep 3 08:05:45 joker kernel: (da0:umass-sim0:0:(pass3:0:umass-sim0:0:0): removing device entry Sep 3 08:05:45 joker kernel: 0:0): passdevgonecb: devfs entry is gone Sep 3 08:06:12 joker kernel: xhci_do_command: Command timeout! Sep 3 08:06:12 joker kernel: usb_alloc_device: device init 2 failed (USB_ERR_TIMEOUT, ignored) Sep 3 08:06:12 joker kernel: ugen0.2: at usbus0 (disconnected) Sep 3 08:06:12 joker kernel: uhub_reattach_port: could not allocate new device Sep 3 08:06:36 joker kernel: ugen2.3: at usbus2 Sep 3 08:06:36 joker kernel: umass0: on usbus2 Sep 3 08:06:36 joker kernel: umass0: SCSI over Bulk-Only; quirks = 0x0100 Sep 3 08:06:36 joker kernel: umass0:6:0:-1: Attached to scbus6 Sep 3 08:06:36 joker kernel: da0 at umass-sim0 bus 0 scbus6 target 0 lun 0 Sep 3 08:06:36 joker kernel: da0: Removable Direct Access SCSI-4 device Sep 3 08:06:36 joker kernel: da0: 40.000MB/s transfers Sep 3 08:06:36 joker kernel: da0: 3864MB (7913472 512 byte sectors: 255H 63S/T 492C) From owner-freebsd-usb@FreeBSD.ORG Mon Sep 3 19:30:01 2012 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7127C106567E; Mon, 3 Sep 2012 19:30:01 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe08.c2i.net [212.247.154.226]) by mx1.freebsd.org (Postfix) with ESMTP id 2B4ED8FC21; Mon, 3 Sep 2012 19:29:59 +0000 (UTC) X-T2-Spam-Status: No, hits=-0.2 required=5.0 tests=ALL_TRUSTED, BAYES_50 Received: from [176.74.212.201] (account mc467741@c2i.net HELO laptop015.hselasky.homeunix.org) by mailfe08.swip.net (CommuniGate Pro SMTP 5.4.4) with ESMTPA id 316209875; Mon, 03 Sep 2012 21:29:50 +0200 From: Hans Petter Selasky To: Roberth =?iso-8859-1?q?Sjon=F8y?= Date: Mon, 3 Sep 2012 21:30:52 +0200 User-Agent: KMail/1.13.7 (FreeBSD/9.1-PRERELEASE; KDE/4.8.4; amd64; ; ) References: <201209021300.58695.hselasky@c2i.net> In-Reply-To: X-Face: 'mmZ:T{)),Oru^0c+/}w'`gU1$ubmG?lp!=R4Wy\ELYo2)@'UZ24N@ =?iso-8859-1?q?d2+AyewRX=7DmAm=3BYp=0A=09=7CU=5B?=@, _z/([?1bCfM{_"B<.J>mICJCHAzzGHI{y7{%JVz%R~yJHIji`y> =?iso-8859-1?q?Y=7Dk1C4TfysrsUI=0A=09-=25GU9V5=5DiUZF=26nRn9mJ=27=3F=26?=>O MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_sVQRQoKLq20BXa9" Message-Id: <201209032130.52971.hselasky@c2i.net> Cc: freebsd-multimedia@freebsd.org, freebsd-usb@freebsd.org Subject: Re: M2Tech HiFace Two and FreeBSD 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: Mon, 03 Sep 2012 19:30:01 -0000 --Boundary-00=_sVQRQoKLq20BXa9 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable On Sunday 02 September 2012 13:06:40 Roberth Sjon=F8y wrote: > Here you go, >=20 > http://pastebin.com/LKT1LkNd >=20 > Regards, >=20 > Roberth Sjon=F8y Hi, I spent some time today to pull together USB AUDIO V2.0 support for FreeBSD= =2E=20 See: http://svn.freebsd.org/changeset/base/240078 The attached patch will update uaudio.c, but is not complete. Only mixer=20 parsing is complete. Audio descriptors and sample rate selection is not=20 complete. Can you see what you get when you load snd_uaudio after applying the attach= ed=20 patch + r240078 ? If you want to help out fix the remaining few bits and pieces feel free. Th= ey=20 are all located inside "uaudio_chan_fill_info()" in uaudio.c ! =2D-HPS --Boundary-00=_sVQRQoKLq20BXa9 Content-Type: text/x-patch; charset="iso-8859-1"; name="uaudio.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="uaudio.diff" === sys/dev/sound/usb/uaudio.c ================================================================== --- sys/dev/sound/usb/uaudio.c (revision 240078) +++ sys/dev/sound/usb/uaudio.c (local) @@ -162,7 +162,6 @@ struct uaudio_softc *priv_sc; struct pcm_channel *pcm_ch; struct usb_xfer *xfer[UAUDIO_NCHANBUFS]; - const struct usb_audio_streaming_interface_descriptor *p_asid; const struct usb_audio_streaming_type1_descriptor *p_asf1d; const struct usb_audio_streaming_endpoint_descriptor *p_sed; const usb_endpoint_descriptor_audio_t *p_ed1; @@ -296,6 +295,26 @@ struct uaudio_terminal_node *root; }; +struct uaudio20_terminal_node { + union { + const struct usb_descriptor *desc; + const struct usb_audio20_clock_source_unit *csrc; + const struct usb_audio20_clock_selector_unit *csel; + const struct usb_audio20_clock_multiplier_unit *cmul; + const struct usb_audio20_input_terminal *it; + const struct usb_audio20_output_terminal *ot; + const struct usb_audio20_mixer_unit_0 *mu; + const struct usb_audio20_selector_unit *su; + const struct usb_audio20_feature_unit *fu; + const struct usb_audio20_sample_rate_unit *ru; + const struct usb_audio20_processing_unit_0 *pu; + const struct usb_audio20_extension_unit_0 *eu; + const struct usb_audio20_effect_unit *ef; + } u; + struct uaudio_search_result usr; + struct uaudio20_terminal_node *root; +}; + struct uaudio_format { uint16_t wFormat; uint8_t bPrecision; @@ -321,6 +340,31 @@ {0, 0, 0, NULL} }; +struct uaudio20_format { + uint32_t dwFormat; + uint8_t bPrecision; + uint32_t freebsd_fmt; + const char *description; +}; + +static const struct uaudio20_format uaudio20_formats[] = { + + {UA20_FMT_PCM8, 8, AFMT_U8, "8-bit U-LE PCM"}, + {UA20_FMT_PCM8, 16, AFMT_U16_LE, "16-bit U-LE PCM"}, + {UA20_FMT_PCM8, 24, AFMT_U24_LE, "24-bit U-LE PCM"}, + {UA20_FMT_PCM8, 32, AFMT_U32_LE, "32-bit U-LE PCM"}, + + {UA20_FMT_PCM, 8, AFMT_S8, "8-bit S-LE PCM"}, + {UA20_FMT_PCM, 16, AFMT_S16_LE, "16-bit S-LE PCM"}, + {UA20_FMT_PCM, 24, AFMT_S24_LE, "24-bit S-LE PCM"}, + {UA20_FMT_PCM, 32, AFMT_S32_LE, "32-bit S-LE PCM"}, + + {UA20_FMT_ALAW, 8, AFMT_A_LAW, "8-bit A-Law"}, + {UA20_FMT_MULAW, 8, AFMT_MU_LAW, "8-bit mu-Law"}, + + {0, 0, 0, NULL} +}; + #define UAC_OUTPUT 0 #define UAC_INPUT 1 #define UAC_EQUAL 2 @@ -346,18 +390,8 @@ static usb_callback_t umidi_bulk_read_callback; static usb_callback_t umidi_bulk_write_callback; -static void uaudio_chan_fill_info_sub(struct uaudio_softc *, - struct usb_device *, uint32_t, uint8_t, uint8_t); -static void uaudio_chan_fill_info(struct uaudio_softc *, - struct usb_device *); -static void uaudio_mixer_add_ctl_sub(struct uaudio_softc *, - struct uaudio_mixer_node *); -static void uaudio_mixer_add_ctl(struct uaudio_softc *, - struct uaudio_mixer_node *); -static void uaudio_mixer_add_input(struct uaudio_softc *, - const struct uaudio_terminal_node *, int); -static void uaudio_mixer_add_output(struct uaudio_softc *, - const struct uaudio_terminal_node *, int); +/* ==== USB audio v1.0 ==== */ + static void uaudio_mixer_add_mixer(struct uaudio_softc *, const struct uaudio_terminal_node *, int); static void uaudio_mixer_add_selector(struct uaudio_softc *, @@ -386,6 +420,42 @@ const uint8_t *, uint8_t, struct uaudio_search_result *); static void uaudio_mixer_find_outputs_sub(struct uaudio_terminal_node *, uint8_t, uint8_t, struct uaudio_search_result *); +static const void *uaudio_mixer_verify_desc(const void *, uint32_t); + +/* ==== USB audio v2.0 ==== */ + +static void uaudio20_mixer_add_mixer(struct uaudio_softc *, + const struct uaudio20_terminal_node *, int); +static void uaudio20_mixer_add_selector(struct uaudio_softc *, + const struct uaudio20_terminal_node *, int); +static void uaudio20_mixer_add_feature(struct uaudio_softc *, + const struct uaudio20_terminal_node *, int); +static struct usb_audio20_cluster uaudio20_mixer_get_cluster(uint8_t, + const struct uaudio20_terminal_node *); +static uint16_t uaudio20_mixer_determine_class(const struct uaudio20_terminal_node *, + struct uaudio_mixer_node *); +static uint16_t uaudio20_mixer_feature_name(const struct uaudio20_terminal_node *, + struct uaudio_mixer_node *); +static const struct uaudio20_terminal_node *uaudio20_mixer_get_input( + const struct uaudio20_terminal_node *, uint8_t); +static const struct uaudio20_terminal_node *uaudio20_mixer_get_output( + const struct uaudio20_terminal_node *, uint8_t); +static void uaudio20_mixer_find_inputs_sub(struct uaudio20_terminal_node *, + const uint8_t *, uint8_t, struct uaudio_search_result *); +static void uaudio20_mixer_find_outputs_sub(struct uaudio20_terminal_node *, + uint8_t, uint8_t, struct uaudio_search_result *); +static const void *uaudio20_mixer_verify_desc(const void *, uint32_t); + +/* USB audio v1.0 and v2.0 */ + +static void uaudio_chan_fill_info_sub(struct uaudio_softc *, + struct usb_device *, uint32_t, uint8_t, uint8_t); +static void uaudio_chan_fill_info(struct uaudio_softc *, + struct usb_device *); +static void uaudio_mixer_add_ctl_sub(struct uaudio_softc *, + struct uaudio_mixer_node *); +static void uaudio_mixer_add_ctl(struct uaudio_softc *, + struct uaudio_mixer_node *); static void uaudio_mixer_fill_info(struct uaudio_softc *, struct usb_device *, void *); static uint16_t uaudio_mixer_get(struct usb_device *, uint8_t, @@ -395,7 +465,6 @@ static usb_error_t uaudio_set_speed(struct usb_device *, uint8_t, uint32_t); static int uaudio_mixer_signext(uint8_t, int); static int uaudio_mixer_bsd2value(struct uaudio_mixer_node *, int32_t val); -static const void *uaudio_mixer_verify_desc(const void *, uint32_t); static void uaudio_mixer_init(struct uaudio_softc *); static uint8_t umidi_convert_to_usb(struct umidi_sub_chan *, uint8_t, uint8_t); static struct umidi_sub_chan *umidi_sub_by_fifo(struct usb_fifo *); @@ -413,9 +482,6 @@ #ifdef USB_DEBUG static void uaudio_chan_dump_ep_desc( const usb_endpoint_descriptor_audio_t *); -static void uaudio_mixer_dump_cluster(uint8_t, - const struct uaudio_terminal_node *); -static const char *uaudio_mixer_get_terminal_name(uint16_t); #endif static const struct usb_config @@ -614,10 +680,10 @@ id = usbd_get_interface_descriptor(uaa->iface); + uaudio_mixer_fill_info(sc, uaa->device, id); + uaudio_chan_fill_info(sc, uaa->device); - uaudio_mixer_fill_info(sc, uaa->device, id); - DPRINTF("audio rev %d.%02x\n", sc->sc_audio_rev >> 8, sc->sc_audio_rev & 0xff); @@ -862,7 +928,7 @@ uint32_t rate, uint8_t channels, uint8_t bit_resolution) { struct usb_descriptor *desc = NULL; - const struct usb_audio_streaming_interface_descriptor *asid = NULL; + const struct usb_audio_streaming_interface_descriptor *asid= NULL; const struct usb_audio_streaming_type1_descriptor *asf1d = NULL; const struct usb_audio_streaming_endpoint_descriptor *sed = NULL; usb_endpoint_descriptor_audio_t *ed1 = NULL; @@ -1047,7 +1113,6 @@ bit_resolution, p_fmt->description); chan->sample_rate = rate; - chan->p_asid = asid; chan->p_asf1d = asf1d; chan->p_ed1 = ed1; chan->p_ed2 = ed2; @@ -1724,43 +1789,94 @@ } static void -uaudio_mixer_add_input(struct uaudio_softc *sc, +uaudio_mixer_add_mixer(struct uaudio_softc *sc, const struct uaudio_terminal_node *iot, int id) { -#ifdef USB_DEBUG - const struct usb_audio_input_terminal *d = iot[id].u.it; + struct uaudio_mixer_node mix; - DPRINTFN(3, "bTerminalId=%d wTerminalType=0x%04x " - "bAssocTerminal=%d bNrChannels=%d wChannelConfig=%d " - "iChannelNames=%d\n", - d->bTerminalId, UGETW(d->wTerminalType), d->bAssocTerminal, - d->bNrChannels, UGETW(d->wChannelConfig), - d->iChannelNames); -#endif -} + const struct usb_audio_mixer_unit_0 *d0 = iot[id].u.mu; + const struct usb_audio_mixer_unit_1 *d1; -static void -uaudio_mixer_add_output(struct uaudio_softc *sc, - const struct uaudio_terminal_node *iot, int id) -{ -#ifdef USB_DEBUG - const struct usb_audio_output_terminal *d = iot[id].u.ot; + uint32_t bno; /* bit number */ + uint32_t p; /* bit number accumulator */ + uint32_t mo; /* matching outputs */ + uint32_t mc; /* matching channels */ + uint32_t ichs; /* input channels */ + uint32_t ochs; /* output channels */ + uint32_t c; + uint32_t chs; /* channels */ + uint32_t i; + uint32_t o; - DPRINTFN(3, "bTerminalId=%d wTerminalType=0x%04x " - "bAssocTerminal=%d bSourceId=%d iTerminal=%d\n", - d->bTerminalId, UGETW(d->wTerminalType), d->bAssocTerminal, - d->bSourceId, d->iTerminal); -#endif + DPRINTFN(3, "bUnitId=%d bNrInPins=%d\n", + d0->bUnitId, d0->bNrInPins); + + /* compute the number of input channels */ + + ichs = 0; + for (i = 0; i < d0->bNrInPins; i++) { + ichs += uaudio_mixer_get_cluster( + d0->baSourceId[i], iot).bNrChannels; + } + + d1 = (const void *)(d0->baSourceId + d0->bNrInPins); + + /* and the number of output channels */ + + ochs = d1->bNrChannels; + + DPRINTFN(3, "ichs=%d ochs=%d\n", ichs, ochs); + + memset(&mix, 0, sizeof(mix)); + + mix.wIndex = MAKE_WORD(d0->bUnitId, sc->sc_mixer_iface_no); + uaudio_mixer_determine_class(&iot[id], &mix); + mix.type = MIX_SIGNED_16; + + if (uaudio_mixer_verify_desc(d0, ((ichs * ochs) + 7) / 8) == NULL) + return; + + for (p = i = 0; i < d0->bNrInPins; i++) { + chs = uaudio_mixer_get_cluster( + d0->baSourceId[i], iot).bNrChannels; + mc = 0; + for (c = 0; c < chs; c++) { + mo = 0; + for (o = 0; o < ochs; o++) { + bno = ((p + c) * ochs) + o; + if (BIT_TEST(d1->bmControls, bno)) + mo++; + } + if (mo == 1) + mc++; + } + if ((mc == chs) && (chs <= MIX_MAX_CHAN)) { + + /* repeat bit-scan */ + + mc = 0; + for (c = 0; c < chs; c++) { + for (o = 0; o < ochs; o++) { + bno = ((p + c) * ochs) + o; + if (BIT_TEST(d1->bmControls, bno)) + mix.wValue[mc++] = MAKE_WORD(p + c + 1, o + 1); + } + } + mix.nchan = chs; + uaudio_mixer_add_ctl(sc, &mix); + } + p += chs; + } } static void -uaudio_mixer_add_mixer(struct uaudio_softc *sc, - const struct uaudio_terminal_node *iot, int id) +uaudio20_mixer_add_mixer(struct uaudio_softc *sc, + const struct uaudio20_terminal_node *iot, int id) { struct uaudio_mixer_node mix; - const struct usb_audio_mixer_unit_0 *d0 = iot[id].u.mu; - const struct usb_audio_mixer_unit_1 *d1; + const struct usb_audio20_mixer_unit_0 *d0 = iot[id].u.mu; + const struct usb_audio20_mixer_unit_1 *d1; uint32_t bno; /* bit number */ uint32_t p; /* bit number accumulator */ @@ -1780,8 +1896,8 @@ ichs = 0; for (i = 0; i < d0->bNrInPins; i++) { - ichs += (uaudio_mixer_get_cluster(d0->baSourceId[i], iot) - .bNrChannels); + ichs += uaudio20_mixer_get_cluster( + d0->baSourceId[i], iot).bNrChannels; } d1 = (const void *)(d0->baSourceId + d0->bNrInPins); @@ -1795,26 +1911,25 @@ memset(&mix, 0, sizeof(mix)); mix.wIndex = MAKE_WORD(d0->bUnitId, sc->sc_mixer_iface_no); - uaudio_mixer_determine_class(&iot[id], &mix); + uaudio20_mixer_determine_class(&iot[id], &mix); mix.type = MIX_SIGNED_16; - if (uaudio_mixer_verify_desc(d0, ((ichs * ochs) + 7) / 8) == NULL) { + if (uaudio20_mixer_verify_desc(d0, ((ichs * ochs) + 7) / 8) == NULL) return; - } + for (p = i = 0; i < d0->bNrInPins; i++) { - chs = uaudio_mixer_get_cluster(d0->baSourceId[i], iot).bNrChannels; + chs = uaudio20_mixer_get_cluster( + d0->baSourceId[i], iot).bNrChannels; mc = 0; for (c = 0; c < chs; c++) { mo = 0; for (o = 0; o < ochs; o++) { bno = ((p + c) * ochs) + o; - if (BIT_TEST(d1->bmControls, bno)) { + if (BIT_TEST(d1->bmControls, bno)) mo++; - } } - if (mo == 1) { + if (mo == 1) mc++; - } } if ((mc == chs) && (chs <= MIX_MAX_CHAN)) { @@ -1824,15 +1939,12 @@ for (c = 0; c < chs; c++) { for (o = 0; o < ochs; o++) { bno = ((p + c) * ochs) + o; - if (BIT_TEST(d1->bmControls, bno)) { + if (BIT_TEST(d1->bmControls, bno)) mix.wValue[mc++] = MAKE_WORD(p + c + 1, o + 1); - } } } mix.nchan = chs; uaudio_mixer_add_ctl(sc, &mix); - } else { - /* XXX */ } p += chs; } @@ -1882,6 +1994,49 @@ uaudio_mixer_add_ctl(sc, &mix); } +static void +uaudio20_mixer_add_selector(struct uaudio_softc *sc, + const struct uaudio20_terminal_node *iot, int id) +{ + const struct usb_audio20_selector_unit *d = iot[id].u.su; + struct uaudio_mixer_node mix; + uint16_t i; + + DPRINTFN(3, "bUnitId=%d bNrInPins=%d\n", + d->bUnitId, d->bNrInPins); + + if (d->bNrInPins == 0) + return; + + memset(&mix, 0, sizeof(mix)); + + mix.wIndex = MAKE_WORD(d->bUnitId, sc->sc_mixer_iface_no); + mix.wValue[0] = MAKE_WORD(0, 0); + uaudio20_mixer_determine_class(&iot[id], &mix); + mix.nchan = 1; + mix.type = MIX_SELECTOR; + + mix.ctl = SOUND_MIXER_NRDEVICES; + mix.minval = 1; + mix.maxval = d->bNrInPins; + + if (mix.maxval > MAX_SELECTOR_INPUT_PIN) + mix.maxval = MAX_SELECTOR_INPUT_PIN; + + mix.mul = (mix.maxval - mix.minval); + for (i = 0; i < MAX_SELECTOR_INPUT_PIN; i++) + mix.slctrtype[i] = SOUND_MIXER_NRDEVICES; + + for (i = 0; i < mix.maxval; i++) { + mix.slctrtype[i] = uaudio20_mixer_feature_name( + &iot[d->baSourceId[i]], &mix); + } + + mix.class = 0; /* not used */ + + uaudio_mixer_add_ctl(sc, &mix); +} + static uint32_t uaudio_mixer_feature_get_bmaControls(const struct usb_audio_feature_unit *d, uint8_t i) @@ -2031,6 +2186,127 @@ } static void +uaudio20_mixer_add_feature(struct uaudio_softc *sc, + const struct uaudio20_terminal_node *iot, int id) +{ + const struct usb_audio20_feature_unit *d = iot[id].u.fu; + struct uaudio_mixer_node mix; + uint32_t ctl; + uint32_t mmask; + uint32_t cmask; + uint16_t mixernumber; + uint8_t nchan; + uint8_t chan; + uint8_t i; + uint8_t what; + + if (UGETDW(d->bmaControls[0]) == 0) + return; + + memset(&mix, 0, sizeof(mix)); + + nchan = (d->bLength - 6) / 4; + mmask = UGETDW(d->bmaControls[0]); + cmask = 0; + + if (nchan == 0) + return; + + /* figure out what we can control */ + + for (chan = 1; chan < nchan; chan++) + cmask |= UGETDW(d->bmaControls[chan]); + + if (nchan > MIX_MAX_CHAN) + nchan = MIX_MAX_CHAN; + + mix.wIndex = MAKE_WORD(d->bUnitId, sc->sc_mixer_iface_no); + + for (ctl = 3; ctl != 0; ctl <<= 2) { + + mixernumber = uaudio20_mixer_feature_name(&iot[id], &mix); + + switch (ctl) { + case (3 << 0): + mix.type = MIX_ON_OFF; + mix.ctl = SOUND_MIXER_NRDEVICES; + what = MUTE_CONTROL; + break; + case (3 << 2): + mix.type = MIX_SIGNED_16; + mix.ctl = mixernumber; + what = VOLUME_CONTROL; + break; + case (3 << 4): + mix.type = MIX_SIGNED_8; + mix.ctl = SOUND_MIXER_BASS; + what = BASS_CONTROL; + break; + case (3 << 6): + mix.type = MIX_SIGNED_8; + mix.ctl = SOUND_MIXER_NRDEVICES; /* XXXXX */ + what = MID_CONTROL; + break; + case (3 << 8): + mix.type = MIX_SIGNED_8; + mix.ctl = SOUND_MIXER_TREBLE; + what = TREBLE_CONTROL; + break; + case (3 << 12): + mix.type = MIX_ON_OFF; + mix.ctl = SOUND_MIXER_NRDEVICES; /* XXXXX */ + what = AGC_CONTROL; + break; + case (3 << 14): + mix.type = MIX_UNSIGNED_16; + mix.ctl = SOUND_MIXER_NRDEVICES; /* XXXXX */ + what = DELAY_CONTROL; + break; + case (3 << 16): + mix.type = MIX_ON_OFF; + mix.ctl = SOUND_MIXER_NRDEVICES; /* XXXXX */ + what = BASS_BOOST_CONTROL; + break; + case (3 << 18): + mix.type = MIX_ON_OFF; + mix.ctl = SOUND_MIXER_LOUD; /* Is this correct ? */ + what = LOUDNESS_CONTROL; + break; + case (3 << 20): + mix.type = MIX_SIGNED_16; + mix.ctl = mixernumber; + what = INPUT_GAIN_CONTROL; + break; + case (3 << 22): + mix.type = MIX_SIGNED_16; + mix.ctl = mixernumber; + what = INPUT_GAIN_PAD_CONTROL; + break; + default: + continue; + } + + if ((mmask & ctl) == ctl) { + mix.nchan = 1; + mix.wValue[0] = MAKE_WORD(what, 0); + } else if ((cmask & ctl) == ctl) { + mix.nchan = nchan - 1; + for (i = 1; i < nchan; i++) { + if ((UGETDW(d->bmaControls[i]) & ctl) == ctl) + mix.wValue[i - 1] = MAKE_WORD(what, i); + else + mix.wValue[i - 1] = -1; + } + } else { + continue; + } + + if (mix.type != MIX_UNKNOWN) + uaudio_mixer_add_ctl(sc, &mix); + } +} + +static void uaudio_mixer_add_processing_updown(struct uaudio_softc *sc, const struct uaudio_terminal_node *iot, int id) { @@ -2276,35 +2552,144 @@ return (NULL); } -#ifdef USB_DEBUG -static void -uaudio_mixer_dump_cluster(uint8_t id, const struct uaudio_terminal_node *iot) +static const void * +uaudio20_mixer_verify_desc(const void *arg, uint32_t len) { - static const char *channel_names[16] = { - "LEFT", "RIGHT", "CENTER", "LFE", - "LEFT_SURROUND", "RIGHT_SURROUND", "LEFT_CENTER", "RIGHT_CENTER", - "SURROUND", "LEFT_SIDE", "RIGHT_SIDE", "TOP", - "RESERVED12", "RESERVED13", "RESERVED14", "RESERVED15", - }; - uint16_t cc; - uint8_t i; - const struct usb_audio_cluster cl = uaudio_mixer_get_cluster(id, iot); + const struct usb_audio20_mixer_unit_1 *d1; + const struct usb_audio20_extension_unit_1 *e1; + const struct usb_audio20_processing_unit_1 *u1; - cc = UGETW(cl.wChannelConfig); + union { + const struct usb_descriptor *desc; + const struct usb_audio20_clock_source_unit *csrc; + const struct usb_audio20_clock_selector_unit *csel; + const struct usb_audio20_clock_multiplier_unit *cmul; + const struct usb_audio20_input_terminal *it; + const struct usb_audio20_output_terminal *ot; + const struct usb_audio20_mixer_unit_0 *mu; + const struct usb_audio20_selector_unit *su; + const struct usb_audio20_feature_unit *fu; + const struct usb_audio20_sample_rate_unit *ru; + const struct usb_audio20_processing_unit_0 *pu; + const struct usb_audio20_extension_unit_0 *eu; + const struct usb_audio20_effect_unit *ef; + } u; - DPRINTF("cluster: bNrChannels=%u iChannelNames=%u wChannelConfig=" - "0x%04x:\n", cl.iChannelNames, cl.bNrChannels, cc); + u.desc = arg; - for (i = 0; cc; i++) { - if (cc & 1) { - DPRINTF(" - %s\n", channel_names[i]); - } - cc >>= 1; + if (u.desc == NULL) + goto error; + if (u.desc->bDescriptorType != UDESC_CS_INTERFACE) + goto error; + switch (u.desc->bDescriptorSubtype) { + case UDESCSUB_AC_INPUT: + len += sizeof(*u.it); + break; + + case UDESCSUB_AC_OUTPUT: + len += sizeof(*u.ot); + break; + + case UDESCSUB_AC_MIXER: + len += sizeof(*u.mu); + + if (u.desc->bLength < len) + goto error; + len += u.mu->bNrInPins; + + if (u.desc->bLength < len) + goto error; + + d1 = (const void *)(u.mu->baSourceId + u.mu->bNrInPins); + + len += sizeof(*d1) + d1->bNrChannels; + break; + + case UDESCSUB_AC_SELECTOR: + len += sizeof(*u.su); + + if (u.desc->bLength < len) + goto error; + + len += u.su->bNrInPins; + break; + + case UDESCSUB_AC_FEATURE: + len += sizeof(*u.fu); + break; + + case UDESCSUB_AC_EFFECT: + len += sizeof(*u.ef) + 4; + break; + + case UDESCSUB_AC_PROCESSING_V2: + len += sizeof(*u.pu); + + if (u.desc->bLength < len) + goto error; + + len += u.pu->bNrInPins; + + if (u.desc->bLength < len) + goto error; + + u1 = (const void *)(u.pu->baSourceId + u.pu->bNrInPins); + + len += sizeof(*u1); + break; + + case UDESCSUB_AC_EXTENSION_V2: + len += sizeof(*u.eu); + + if (u.desc->bLength < len) + goto error; + + len += u.eu->bNrInPins; + + if (u.desc->bLength < len) + goto error; + + e1 = (const void *)(u.eu->baSourceId + u.eu->bNrInPins); + + len += sizeof(*e1); + break; + + case UDESCSUB_AC_CLOCK_SRC: + len += sizeof(*u.csrc); + break; + + case UDESCSUB_AC_CLOCK_SEL: + len += sizeof(*u.csel); + break; + + case UDESCSUB_AC_CLOCK_MUL: + len += sizeof(*u.cmul); + break; + + case UDESCSUB_AC_SAMPLE_RT: + len += sizeof(*u.ru); + break; + + default: + goto error; } + + if (u.desc->bLength < len) + goto error; + + return (u.desc); + +error: + if (u.desc) { + DPRINTF("invalid descriptor, type=%d, " + "sub_type=%d, len=%d of %d bytes\n", + u.desc->bDescriptorType, + u.desc->bDescriptorSubtype, + u.desc->bLength, len); + } + return (NULL); } -#endif - static struct usb_audio_cluster uaudio_mixer_get_cluster(uint8_t id, const struct uaudio_terminal_node *iot) { @@ -2369,108 +2754,80 @@ return (r); } -#ifdef USB_DEBUG +static struct usb_audio20_cluster +uaudio20_mixer_get_cluster(uint8_t id, const struct uaudio20_terminal_node *iot) +{ + struct usb_audio20_cluster r; + const struct usb_descriptor *dp; + uint8_t i; -struct uaudio_tt_to_string { - uint16_t terminal_type; - const char *desc; -}; + for (i = 0; i < UAUDIO_RECURSE_LIMIT; i++) { /* avoid infinite loops */ + dp = iot[id].u.desc; + if (dp == NULL) + goto error; -static const struct uaudio_tt_to_string uaudio_tt_to_string[] = { + switch (dp->bDescriptorSubtype) { + case UDESCSUB_AC_INPUT: + r.bNrChannels = iot[id].u.it->bNrChannels; + r.bmChannelConfig[0] = iot[id].u.it->bmChannelConfig[0]; + r.bmChannelConfig[1] = iot[id].u.it->bmChannelConfig[1]; + r.bmChannelConfig[2] = iot[id].u.it->bmChannelConfig[2]; + r.bmChannelConfig[3] = iot[id].u.it->bmChannelConfig[3]; + r.iChannelNames = iot[id].u.it->iTerminal; + goto done; - /* USB terminal types */ - {UAT_UNDEFINED, "UAT_UNDEFINED"}, - {UAT_STREAM, "UAT_STREAM"}, - {UAT_VENDOR, "UAT_VENDOR"}, + case UDESCSUB_AC_OUTPUT: + id = iot[id].u.ot->bSourceId; + break; - /* input terminal types */ - {UATI_UNDEFINED, "UATI_UNDEFINED"}, - {UATI_MICROPHONE, "UATI_MICROPHONE"}, - {UATI_DESKMICROPHONE, "UATI_DESKMICROPHONE"}, - {UATI_PERSONALMICROPHONE, "UATI_PERSONALMICROPHONE"}, - {UATI_OMNIMICROPHONE, "UATI_OMNIMICROPHONE"}, - {UATI_MICROPHONEARRAY, "UATI_MICROPHONEARRAY"}, - {UATI_PROCMICROPHONEARR, "UATI_PROCMICROPHONEARR"}, + case UDESCSUB_AC_MIXER: + r = *(const struct usb_audio20_cluster *) + &iot[id].u.mu->baSourceId[iot[id].u.mu-> + bNrInPins]; + goto done; - /* output terminal types */ - {UATO_UNDEFINED, "UATO_UNDEFINED"}, - {UATO_SPEAKER, "UATO_SPEAKER"}, - {UATO_HEADPHONES, "UATO_HEADPHONES"}, - {UATO_DISPLAYAUDIO, "UATO_DISPLAYAUDIO"}, - {UATO_DESKTOPSPEAKER, "UATO_DESKTOPSPEAKER"}, - {UATO_ROOMSPEAKER, "UATO_ROOMSPEAKER"}, - {UATO_COMMSPEAKER, "UATO_COMMSPEAKER"}, - {UATO_SUBWOOFER, "UATO_SUBWOOFER"}, + case UDESCSUB_AC_SELECTOR: + if (iot[id].u.su->bNrInPins > 0) { + /* XXX This is not really right */ + id = iot[id].u.su->baSourceId[0]; + } + break; - /* bidir terminal types */ - {UATB_UNDEFINED, "UATB_UNDEFINED"}, - {UATB_HANDSET, "UATB_HANDSET"}, - {UATB_HEADSET, "UATB_HEADSET"}, - {UATB_SPEAKERPHONE, "UATB_SPEAKERPHONE"}, - {UATB_SPEAKERPHONEESUP, "UATB_SPEAKERPHONEESUP"}, - {UATB_SPEAKERPHONEECANC, "UATB_SPEAKERPHONEECANC"}, + case UDESCSUB_AC_SAMPLE_RT: + id = iot[id].u.ru->bSourceId; + break; - /* telephony terminal types */ - {UATT_UNDEFINED, "UATT_UNDEFINED"}, - {UATT_PHONELINE, "UATT_PHONELINE"}, - {UATT_TELEPHONE, "UATT_TELEPHONE"}, - {UATT_DOWNLINEPHONE, "UATT_DOWNLINEPHONE"}, + case UDESCSUB_AC_EFFECT: + id = iot[id].u.ef->bSourceId; + break; - /* external terminal types */ - {UATE_UNDEFINED, "UATE_UNDEFINED"}, - {UATE_ANALOGCONN, "UATE_ANALOGCONN"}, - {UATE_LINECONN, "UATE_LINECONN"}, - {UATE_LEGACYCONN, "UATE_LEGACYCONN"}, - {UATE_DIGITALAUIFC, "UATE_DIGITALAUIFC"}, - {UATE_SPDIF, "UATE_SPDIF"}, - {UATE_1394DA, "UATE_1394DA"}, - {UATE_1394DV, "UATE_1394DV"}, + case UDESCSUB_AC_FEATURE: + id = iot[id].u.fu->bSourceId; + break; - /* embedded function terminal types */ - {UATF_UNDEFINED, "UATF_UNDEFINED"}, - {UATF_CALIBNOISE, "UATF_CALIBNOISE"}, - {UATF_EQUNOISE, "UATF_EQUNOISE"}, - {UATF_CDPLAYER, "UATF_CDPLAYER"}, - {UATF_DAT, "UATF_DAT"}, - {UATF_DCC, "UATF_DCC"}, - {UATF_MINIDISK, "UATF_MINIDISK"}, - {UATF_ANALOGTAPE, "UATF_ANALOGTAPE"}, - {UATF_PHONOGRAPH, "UATF_PHONOGRAPH"}, - {UATF_VCRAUDIO, "UATF_VCRAUDIO"}, - {UATF_VIDEODISCAUDIO, "UATF_VIDEODISCAUDIO"}, - {UATF_DVDAUDIO, "UATF_DVDAUDIO"}, - {UATF_TVTUNERAUDIO, "UATF_TVTUNERAUDIO"}, - {UATF_SATELLITE, "UATF_SATELLITE"}, - {UATF_CABLETUNER, "UATF_CABLETUNER"}, - {UATF_DSS, "UATF_DSS"}, - {UATF_RADIORECV, "UATF_RADIORECV"}, - {UATF_RADIOXMIT, "UATF_RADIOXMIT"}, - {UATF_MULTITRACK, "UATF_MULTITRACK"}, - {UATF_SYNTHESIZER, "UATF_SYNTHESIZER"}, + case UDESCSUB_AC_PROCESSING_V2: + r = *((const struct usb_audio20_cluster *) + &iot[id].u.pu->baSourceId[iot[id].u.pu-> + bNrInPins]); + goto done; - /* unknown */ - {0x0000, "UNKNOWN"}, -}; + case UDESCSUB_AC_EXTENSION_V2: + r = *((const struct usb_audio20_cluster *) + &iot[id].u.eu->baSourceId[iot[id].u.eu-> + bNrInPins]); + goto done; -static const char * -uaudio_mixer_get_terminal_name(uint16_t terminal_type) -{ - const struct uaudio_tt_to_string *uat = uaudio_tt_to_string; - - while (uat->terminal_type) { - if (uat->terminal_type == terminal_type) { - break; + default: + goto error; } - uat++; } - if (uat->terminal_type == 0) { - DPRINTF("unknown terminal type (0x%04x)", terminal_type); - } - return (uat->desc); +error: + DPRINTF("Bad data!\n"); + memset(&r, 0, sizeof(r)); +done: + return (r); } -#endif - static uint16_t uaudio_mixer_determine_class(const struct uaudio_terminal_node *iot, struct uaudio_mixer_node *mix) @@ -2524,6 +2881,58 @@ return (terminal_type); } +static uint16_t +uaudio20_mixer_determine_class(const struct uaudio20_terminal_node *iot, + struct uaudio_mixer_node *mix) +{ + uint16_t terminal_type = 0x0000; + const struct uaudio20_terminal_node *input[2]; + const struct uaudio20_terminal_node *output[2]; + + input[0] = uaudio20_mixer_get_input(iot, 0); + input[1] = uaudio20_mixer_get_input(iot, 1); + + output[0] = uaudio20_mixer_get_output(iot, 0); + output[1] = uaudio20_mixer_get_output(iot, 1); + + /* + * check if there is only + * one output terminal: + */ + if (output[0] && (!output[1])) + terminal_type = UGETW(output[0]->u.ot->wTerminalType); + /* + * If the only output terminal is USB, + * the class is UAC_RECORD. + */ + if ((terminal_type & 0xff00) == (UAT_UNDEFINED & 0xff00)) { + + mix->class = UAC_RECORD; + if (input[0] && (!input[1])) { + terminal_type = UGETW(input[0]->u.it->wTerminalType); + } else { + terminal_type = 0; + } + goto done; + } + /* + * if the unit is connected to just + * one input terminal, the + * class is UAC_INPUT: + */ + if (input[0] && (!input[1])) { + mix->class = UAC_INPUT; + terminal_type = UGETW(input[0]->u.it->wTerminalType); + goto done; + } + /* + * Otherwise, the class is UAC_OUTPUT. + */ + mix->class = UAC_OUTPUT; +done: + return (terminal_type); +} + struct uaudio_tt_to_feature { uint16_t terminal_type; uint16_t feature; @@ -2636,6 +3045,28 @@ return (uat->feature); } +static uint16_t +uaudio20_mixer_feature_name(const struct uaudio20_terminal_node *iot, + struct uaudio_mixer_node *mix) +{ + const struct uaudio_tt_to_feature *uat; + uint16_t terminal_type = uaudio20_mixer_determine_class(iot, mix); + + if ((mix->class == UAC_RECORD) && (terminal_type == 0)) + return (SOUND_MIXER_IMIX); + + for (uat = uaudio_tt_to_feature; uat->terminal_type != 0; uat++) { + if (uat->terminal_type == terminal_type) + break; + } + + DPRINTF("terminal_type=%s (0x%04x) -> %d\n", + uaudio_mixer_get_terminal_name(terminal_type), + terminal_type, uat->feature); + + return (uat->feature); +} + static const struct uaudio_terminal_node * uaudio_mixer_get_input(const struct uaudio_terminal_node *iot, uint8_t i) { @@ -2653,6 +3084,21 @@ return (NULL); } +static const struct uaudio20_terminal_node * +uaudio20_mixer_get_input(const struct uaudio20_terminal_node *iot, uint8_t i) +{ + struct uaudio20_terminal_node *root = iot->root; + uint8_t n; + + for (n = iot->usr.id_max; n != 0xFFU; n--) { + if (iot->usr.bit_input[n / 8] & (1 << (n % 8))) { + if (!i--) + return (root + n); + } + } + return (NULL); +} + static const struct uaudio_terminal_node * uaudio_mixer_get_output(const struct uaudio_terminal_node *iot, uint8_t i) { @@ -2670,6 +3116,21 @@ return (NULL); } +static const struct uaudio20_terminal_node * +uaudio20_mixer_get_output(const struct uaudio20_terminal_node *iot, uint8_t i) +{ + struct uaudio20_terminal_node *root = iot->root; + uint8_t n; + + for (n = iot->usr.id_max; n != 0xFFU; n--) { + if (iot->usr.bit_output[n / 8] & (1 << (n % 8))) { + if (!i--) + return (root + n); + } + } + return (NULL); +} + static void uaudio_mixer_find_inputs_sub(struct uaudio_terminal_node *root, const uint8_t *p_id, uint8_t n_id, @@ -2749,6 +3210,95 @@ } static void +uaudio20_mixer_find_inputs_sub(struct uaudio20_terminal_node *root, + const uint8_t *p_id, uint8_t n_id, + struct uaudio_search_result *info) +{ + struct uaudio20_terminal_node *iot; + uint8_t n; + uint8_t i; + + if (info->recurse_level >= UAUDIO_RECURSE_LIMIT) + return; + + info->recurse_level++; + + for (n = 0; n < n_id; n++) { + + i = p_id[n]; + + if (info->bit_visited[i / 8] & (1 << (i % 8))) { + /* don't go into a circle */ + DPRINTF("avoided going into a circle at id=%d!\n", i); + continue; + } else { + info->bit_visited[i / 8] |= (1 << (i % 8)); + } + + iot = (root + i); + + if (iot->u.desc == NULL) + continue; + + switch (iot->u.desc->bDescriptorSubtype) { + case UDESCSUB_AC_INPUT: + info->bit_input[i / 8] |= (1 << (i % 8)); + break; + + case UDESCSUB_AC_OUTPUT: + uaudio20_mixer_find_inputs_sub( + root, &iot->u.ot->bSourceId, 1, info); + break; + + case UDESCSUB_AC_MIXER: + uaudio20_mixer_find_inputs_sub( + root, iot->u.mu->baSourceId, + iot->u.mu->bNrInPins, info); + break; + + case UDESCSUB_AC_SELECTOR: + uaudio20_mixer_find_inputs_sub( + root, iot->u.su->baSourceId, + iot->u.su->bNrInPins, info); + break; + + case UDESCSUB_AC_SAMPLE_RT: + uaudio20_mixer_find_inputs_sub( + root, &iot->u.ru->bSourceId, + 1, info); + break; + + case UDESCSUB_AC_EFFECT: + uaudio20_mixer_find_inputs_sub( + root, &iot->u.ef->bSourceId, + 1, info); + break; + + case UDESCSUB_AC_FEATURE: + uaudio20_mixer_find_inputs_sub( + root, &iot->u.fu->bSourceId, 1, info); + break; + + case UDESCSUB_AC_PROCESSING_V2: + uaudio20_mixer_find_inputs_sub( + root, iot->u.pu->baSourceId, + iot->u.pu->bNrInPins, info); + break; + + case UDESCSUB_AC_EXTENSION_V2: + uaudio20_mixer_find_inputs_sub( + root, iot->u.eu->baSourceId, + iot->u.eu->bNrInPins, info); + break; + default: + break; + } + } + info->recurse_level--; +} + + +static void uaudio_mixer_find_outputs_sub(struct uaudio_terminal_node *root, uint8_t id, uint8_t n_id, struct uaudio_search_result *info) { @@ -2774,6 +3324,33 @@ } static void +uaudio20_mixer_find_outputs_sub(struct uaudio20_terminal_node *root, uint8_t id, + uint8_t n_id, struct uaudio_search_result *info) +{ + struct uaudio20_terminal_node *iot = (root + id); + uint8_t j; + + for (j = n_id; j != 0xFFU; j--) { + if ((j != id) && ((root + j)->u.desc) && + ((root + j)->u.desc->bDescriptorSubtype == UDESCSUB_AC_OUTPUT)) { + + /* + * "j" (output) <--- virtual wire <--- "id" (input) + * + * if "j" has "id" on the input, then "id" have "j" on + * the output, because they are connected: + */ + if ((root + j)->usr.bit_input[id / 8] & (1 << (id % 8))) { + iot->usr.bit_output[j / 8] |= (1 << (j % 8)); + } + } + } +} + +extern uint8_t uaudio_mixer_assert[(sizeof(struct uaudio_terminal_node) == + sizeof(struct uaudio20_terminal_node)) ? 1 : -1]; + +static void uaudio_mixer_fill_info(struct uaudio_softc *sc, struct usb_device *udev, void *desc) { @@ -2809,7 +3386,8 @@ DPRINTFN(3, "found AC header, vers=%03x, len=%d\n", sc->sc_audio_rev, wTotalLen); - if (sc->sc_audio_rev != UAUDIO_VERSION) { + if (sc->sc_audio_rev != UAUDIO_VERSION && + sc->sc_audio_rev != UAUDIO_VERSION_20) { if (sc->sc_uq_bad_adc) { @@ -2835,7 +3413,10 @@ wTotalLen -= dp->bLength; } - au = uaudio_mixer_verify_desc(dp, 0); + if (sc->sc_audio_rev >= UAUDIO_VERSION_20) + au = uaudio20_mixer_verify_desc(dp, 0); + else + au = uaudio_mixer_verify_desc(dp, 0); if (au) { iot[au->bUnitId].u.desc = (const void *)au; @@ -2853,7 +3434,13 @@ */ i = ID_max; do { - uaudio_mixer_find_inputs_sub(iot, &i, 1, &((iot + i)->usr)); + if (sc->sc_audio_rev >= UAUDIO_VERSION_20) { + uaudio20_mixer_find_inputs_sub((void *)iot, + &i, 1, &((iot + i)->usr)); + } else { + uaudio_mixer_find_inputs_sub(iot, + &i, 1, &((iot + i)->usr)); + } } while (i--); /* @@ -2862,7 +3449,13 @@ */ i = ID_max; do { - uaudio_mixer_find_outputs_sub(iot, i, ID_max, &((iot + i)->usr)); + if (sc->sc_audio_rev >= UAUDIO_VERSION_20) { + uaudio20_mixer_find_outputs_sub((void *)iot, + i, ID_max, &((iot + i)->usr)); + } else { + uaudio_mixer_find_outputs_sub(iot, + i, ID_max, &((iot + i)->usr)); + } } while (i--); /* set "id_max" and "root" */ @@ -2873,106 +3466,57 @@ (iot + i)->root = iot; } while (i--); -#ifdef USB_DEBUG + /* + * Scan the config to create a linked list of "mixer" nodes: + */ + i = ID_max; do { - uint8_t j; + dp = iot[i].u.desc; - if (iot[i].u.desc == NULL) { + if (dp == NULL) continue; - } - DPRINTF("id %d:\n", i); - switch (iot[i].u.desc->bDescriptorSubtype) { - case UDESCSUB_AC_INPUT: - DPRINTF(" - AC_INPUT type=%s\n", - uaudio_mixer_get_terminal_name - (UGETW(iot[i].u.it->wTerminalType))); - uaudio_mixer_dump_cluster(i, iot); - break; + DPRINTFN(11, "id=%d subtype=%d\n", + i, dp->bDescriptorSubtype); - case UDESCSUB_AC_OUTPUT: - DPRINTF(" - AC_OUTPUT type=%s " - "src=%d\n", uaudio_mixer_get_terminal_name - (UGETW(iot[i].u.ot->wTerminalType)), - iot[i].u.ot->bSourceId); - break; + if (sc->sc_audio_rev >= UAUDIO_VERSION_20) { - case UDESCSUB_AC_MIXER: - DPRINTF(" - AC_MIXER src:\n"); - for (j = 0; j < iot[i].u.mu->bNrInPins; j++) { - DPRINTF(" - %d\n", iot[i].u.mu->baSourceId[j]); - } - uaudio_mixer_dump_cluster(i, iot); - break; + switch (dp->bDescriptorSubtype) { + case UDESCSUB_AC_HEADER: + DPRINTF("unexpected AC header\n"); + break; - case UDESCSUB_AC_SELECTOR: - DPRINTF(" - AC_SELECTOR src:\n"); - for (j = 0; j < iot[i].u.su->bNrInPins; j++) { - DPRINTF(" - %d\n", iot[i].u.su->baSourceId[j]); - } - break; + case UDESCSUB_AC_INPUT: + case UDESCSUB_AC_OUTPUT: + case UDESCSUB_AC_PROCESSING_V2: + case UDESCSUB_AC_EXTENSION_V2: + case UDESCSUB_AC_EFFECT: + case UDESCSUB_AC_CLOCK_SRC: + case UDESCSUB_AC_CLOCK_SEL: + case UDESCSUB_AC_CLOCK_MUL: + case UDESCSUB_AC_SAMPLE_RT: + break; - case UDESCSUB_AC_FEATURE: - DPRINTF(" - AC_FEATURE src=%d\n", iot[i].u.fu->bSourceId); - break; + case UDESCSUB_AC_MIXER: + uaudio20_mixer_add_mixer(sc, (void *)iot, i); + break; - case UDESCSUB_AC_PROCESSING: - DPRINTF(" - AC_PROCESSING src:\n"); - for (j = 0; j < iot[i].u.pu->bNrInPins; j++) { - DPRINTF(" - %d\n", iot[i].u.pu->baSourceId[j]); - } - uaudio_mixer_dump_cluster(i, iot); - break; + case UDESCSUB_AC_SELECTOR: + uaudio20_mixer_add_selector(sc, (void *)iot, i); + break; - case UDESCSUB_AC_EXTENSION: - DPRINTF(" - AC_EXTENSION src:\n"); - for (j = 0; j < iot[i].u.eu->bNrInPins; j++) { - DPRINTF("%d ", iot[i].u.eu->baSourceId[j]); - } - uaudio_mixer_dump_cluster(i, iot); - break; + case UDESCSUB_AC_FEATURE: + uaudio20_mixer_add_feature(sc, (void *)iot, i); + break; - default: - DPRINTF("unknown audio control (subtype=%d)\n", - iot[i].u.desc->bDescriptorSubtype); - } - - DPRINTF("Inputs to this ID are:\n"); - - j = ID_max; - do { - if (iot[i].usr.bit_input[j / 8] & (1 << (j % 8))) { - DPRINTF(" -- ID=%d\n", j); + default: + DPRINTF("bad AC desc subtype=0x%02x\n", + dp->bDescriptorSubtype); + break; } - } while (j--); - - DPRINTF("Outputs from this ID are:\n"); - - j = ID_max; - do { - if (iot[i].usr.bit_output[j / 8] & (1 << (j % 8))) { - DPRINTF(" -- ID=%d\n", j); - } - } while (j--); - - } while (i--); -#endif - - /* - * scan the config to create a linked - * list of "mixer" nodes: - */ - - i = ID_max; - do { - dp = iot[i].u.desc; - - if (dp == NULL) { continue; } - DPRINTFN(11, "id=%d subtype=%d\n", - i, dp->bDescriptorSubtype); switch (dp->bDescriptorSubtype) { case UDESCSUB_AC_HEADER: @@ -2980,11 +3524,7 @@ break; case UDESCSUB_AC_INPUT: - uaudio_mixer_add_input(sc, iot, i); - break; - case UDESCSUB_AC_OUTPUT: - uaudio_mixer_add_output(sc, iot, i); break; case UDESCSUB_AC_MIXER: @@ -3016,9 +3556,7 @@ } while (i--); done: - if (iot) { - free(iot, M_TEMP); - } + free(iot, M_TEMP); } static uint16_t @@ -3031,9 +3569,9 @@ uint8_t data[4]; usb_error_t err; - if (mc->wValue[0] == -1) { + if (mc->wValue[0] == -1) return (0); - } + req.bmRequestType = UT_READ_CLASS_INTERFACE; req.bRequest = what; USETW(req.wValue, mc->wValue[0]); @@ -3045,12 +3583,12 @@ DPRINTF("err=%s\n", usbd_errstr(err)); return (0); } - if (len < 1) { + if (len < 1) data[0] = 0; - } - if (len < 2) { + + if (len < 2) data[1] = 0; - } + val = (data[0] | (data[1] << 8)); DPRINTFN(3, "val=%d\n", val); --Boundary-00=_sVQRQoKLq20BXa9-- From owner-freebsd-usb@FreeBSD.ORG Tue Sep 4 19:54:51 2012 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51C62106566B for ; Tue, 4 Sep 2012 19:54:51 +0000 (UTC) (envelope-from anatoly@kazanfieldhockey.ru) Received: from kazanfieldhockey.ru (kazanfieldhockey.ru [78.138.152.250]) by mx1.freebsd.org (Postfix) with ESMTP id B531D8FC16 for ; Tue, 4 Sep 2012 19:54:50 +0000 (UTC) Received: from epc.localdomain (host-175-22.xdsl.telecet.ru [87.117.175.22]) (authenticated bits=0) by kazanfieldhockey.ru (8.14.3/8.14.3) with ESMTP id q84JsgYS027719 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO) for ; Tue, 4 Sep 2012 23:54:47 +0400 (MSK) (envelope-from anatoly@kazanfieldhockey.ru) Date: Tue, 4 Sep 2012 23:55:57 +0400 From: Anatoly To: freebsd-usb@freebsd.org Message-ID: <20120904235557.7ca40fc8@epc.localdomain> X-Mailer: Claws Mail 3.7.5 (GTK+ 2.18.7; i386-portbld-freebsd7.3) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (kazanfieldhockey.ru [192.168.13.2]); Tue, 04 Sep 2012 23:54:47 +0400 (MSK) Subject: how to force my 32G usb pendrive to flush write cache in RAM it has? 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: Tue, 04 Sep 2012 19:54:51 -0000 Hello, I have a problem with my new 32G pendrive: da1: Removable Direct Access SCSI-2 device da1: 40.000MB/s transfers da1: 30640MB (62750720 512 byte sectors: 255H 63S/T 3906C) I'm using fat32 partition on it. To make problem occur I can do following things: 1) write a file about 5MB in size on that partition 2) unmount 3) unplug pendrive (so it loses power) 4) plug it again 5) mount Now I can see that the end of file is corrupted. Poblem never occurs when I do: 1) write a file about 5MB in size on that partition 2) unmount 3) mount Also, problem doesn't occur if I'll wait for more than ~10 minutes before unplugging pendrive. So it seems to me that this pendrive has internal write cache in RAM that needs to be flushed before pendrive loses power. Problem never occurs with Windows. As I click "remove", windows somehow "correctly shutdowns" pendrive so it's LED goes off (Unlike if i just unmount, when the LED stays on) What can I do to get cache flushed before unpugging, turn that write cache off, or any other suggestions? I've tried camcontrol stop and camcontrol eject with no success I using FreeBSD 7.3 with generic kernel here From owner-freebsd-usb@FreeBSD.ORG Tue Sep 4 20:25:03 2012 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D061E106566B; Tue, 4 Sep 2012 20:25:03 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe06.c2i.net [212.247.154.162]) by mx1.freebsd.org (Postfix) with ESMTP id 7B8E78FC14; Tue, 4 Sep 2012 20:25:01 +0000 (UTC) X-T2-Spam-Status: No, hits=-1.0 required=5.0 tests=ALL_TRUSTED, BAYES_40 Received: from [176.74.212.201] (account mc467741@c2i.net HELO laptop015.hselasky.homeunix.org) by mailfe06.swip.net (CommuniGate Pro SMTP 5.4.4) with ESMTPA id 314936727; Tue, 04 Sep 2012 22:24:51 +0200 From: Hans Petter Selasky To: Roberth =?iso-8859-1?q?Sjon=F8y?= , Clemens Ladisch Date: Tue, 4 Sep 2012 22:25:55 +0200 User-Agent: KMail/1.13.7 (FreeBSD/9.1-PRERELEASE; KDE/4.8.4; amd64; ; ) References: <201209032130.52971.hselasky@c2i.net> In-Reply-To: <201209032130.52971.hselasky@c2i.net> X-Face: 'mmZ:T{)),Oru^0c+/}w'`gU1$ubmG?lp!=R4Wy\ELYo2)@'UZ24N@ =?iso-8859-1?q?d2+AyewRX=7DmAm=3BYp=0A=09=7CU=5B?=@, _z/([?1bCfM{_"B<.J>mICJCHAzzGHI{y7{%JVz%R~yJHIji`y> =?iso-8859-1?q?Y=7Dk1C4TfysrsUI=0A=09-=25GU9V5=5DiUZF=26nRn9mJ=27=3F=26?=>O MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_TPmRQg1hvz9TseG" Message-Id: <201209042225.55245.hselasky@c2i.net> Cc: freebsd-multimedia@freebsd.org, freebsd-usb@freebsd.org Subject: Re: M2Tech HiFace Two and FreeBSD 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: Tue, 04 Sep 2012 20:25:03 -0000 --Boundary-00=_TPmRQg1hvz9TseG Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: quoted-printable On Monday 03 September 2012 21:30:52 Hans Petter Selasky wrote: > On Sunday 02 September 2012 13:06:40 Roberth Sjon=F8y wrote: > > Here you go, > >=20 > > http://pastebin.com/LKT1LkNd > >=20 > > Regards, > >=20 > > Roberth Sjon=F8y >=20 Hi, The attached patch is for FREEBSD-10-CURRENT as of today. The attached patch adds full support for USB audio v2.0. Please test and=20 report back. Enabled uaudio debugging if something goes wrong: sysctl hw.usb.uaudio.debug=3D15 And send dmesg. Please test and report back! I don't have USB audio v2.0 devices. =2D-HPS --Boundary-00=_TPmRQg1hvz9TseG Content-Type: text/x-patch; charset="iso-8859-15"; name="uaudio_20_support.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="uaudio_20_support.patch" === sys/dev/sound/usb/uaudio.c ================================================================== --- sys/dev/sound/usb/uaudio.c (revision 240082) +++ sys/dev/sound/usb/uaudio.c (local) @@ -115,13 +115,28 @@ #endif #define UAUDIO_NFRAMES 64 /* must be factor of 8 due HS-USB */ -#define UAUDIO_NCHANBUFS 2 /* number of outstanding request */ -#define UAUDIO_RECURSE_LIMIT 24 /* rounds */ +#define UAUDIO_NCHANBUFS 2 /* number of outstanding request */ +#define UAUDIO_RECURSE_LIMIT 255 /* rounds */ #define MAKE_WORD(h,l) (((h) << 8) | (l)) #define BIT_TEST(bm,bno) (((bm)[(bno) / 8] >> (7 - ((bno) % 8))) & 1) #define UAUDIO_MAX_CHAN(x) (x) +union uaudio_asid { + const struct usb_audio_streaming_interface_descriptor *v1; + const struct usb_audio20_streaming_interface_descriptor *v2; +}; + +union uaudio_asf1d { + const struct usb_audio_streaming_type1_descriptor *v1; + const struct usb_audio20_streaming_type1_descriptor *v2; +}; + +union uaudio_sed { + const struct usb_audio_streaming_endpoint_descriptor *v1; + const struct usb_audio20_streaming_endpoint_descriptor *v2; +}; + struct uaudio_mixer_node { int32_t minval; int32_t maxval; @@ -162,11 +177,9 @@ struct uaudio_softc *priv_sc; struct pcm_channel *pcm_ch; struct usb_xfer *xfer[UAUDIO_NCHANBUFS]; - const struct usb_audio_streaming_interface_descriptor *p_asid; - const struct usb_audio_streaming_type1_descriptor *p_asf1d; - const struct usb_audio_streaming_endpoint_descriptor *p_sed; + union uaudio_asf1d p_asf1d; + union uaudio_sed p_sed; const usb_endpoint_descriptor_audio_t *p_ed1; - const usb_endpoint_descriptor_audio_t *p_ed2; const struct uaudio_format *p_fmt; uint8_t *buf; /* pointer to buffer */ @@ -192,6 +205,7 @@ uint8_t valid; uint8_t iface_index; uint8_t iface_alt_index; + uint8_t channels; }; #define UMIDI_CABLES_MAX 16 /* units */ @@ -242,12 +256,21 @@ uint8_t single_command; }; +struct uaudio_search_result { + uint8_t bit_input[(256 + 7) / 8]; + uint8_t bit_output[(256 + 7) / 8]; + uint8_t recurse_level; + uint8_t id_max; + uint8_t is_input; +}; + struct uaudio_softc { struct sbuf sc_sndstat; struct sndcard_func sc_sndcard_func; struct uaudio_chan sc_rec_chan; struct uaudio_chan sc_play_chan; struct umidi_chan sc_midi_chan; + struct uaudio_search_result sc_mixer_clocks; struct usb_device *sc_udev; struct usb_xfer *sc_mixer_xfer[1]; @@ -273,24 +296,28 @@ uint8_t sc_uq_au_vendor_class:1; }; -struct uaudio_search_result { - uint8_t bit_input[(256 + 7) / 8]; - uint8_t bit_output[(256 + 7) / 8]; - uint8_t bit_visited[(256 + 7) / 8]; - uint8_t recurse_level; - uint8_t id_max; -}; - struct uaudio_terminal_node { union { const struct usb_descriptor *desc; - const struct usb_audio_input_terminal *it; - const struct usb_audio_output_terminal *ot; - const struct usb_audio_mixer_unit_0 *mu; - const struct usb_audio_selector_unit *su; - const struct usb_audio_feature_unit *fu; - const struct usb_audio_processing_unit_0 *pu; - const struct usb_audio_extension_unit_0 *eu; + const struct usb_audio_input_terminal *it_v1; + const struct usb_audio_output_terminal *ot_v1; + const struct usb_audio_mixer_unit_0 *mu_v1; + const struct usb_audio_selector_unit *su_v1; + const struct usb_audio_feature_unit *fu_v1; + const struct usb_audio_processing_unit_0 *pu_v1; + const struct usb_audio_extension_unit_0 *eu_v1; + const struct usb_audio20_clock_source_unit *csrc_v2; + const struct usb_audio20_clock_selector_unit_0 *csel_v2; + const struct usb_audio20_clock_multiplier_unit *cmul_v2; + const struct usb_audio20_input_terminal *it_v2; + const struct usb_audio20_output_terminal *ot_v2; + const struct usb_audio20_mixer_unit_0 *mu_v2; + const struct usb_audio20_selector_unit *su_v2; + const struct usb_audio20_feature_unit *fu_v2; + const struct usb_audio20_sample_rate_unit *ru_v2; + const struct usb_audio20_processing_unit_0 *pu_v2; + const struct usb_audio20_extension_unit_0 *eu_v2; + const struct usb_audio20_effect_unit *ef_v2; } u; struct uaudio_search_result usr; struct uaudio_terminal_node *root; @@ -303,7 +330,7 @@ const char *description; }; -static const struct uaudio_format uaudio_formats[] = { +static const struct uaudio_format uaudio10_formats[] = { {UA_FMT_PCM8, 8, AFMT_U8, "8-bit U-LE PCM"}, {UA_FMT_PCM8, 16, AFMT_U16_LE, "16-bit U-LE PCM"}, @@ -321,6 +348,24 @@ {0, 0, 0, NULL} }; +static const struct uaudio_format uaudio20_formats[] = { + + {UA20_FMT_PCM, 8, AFMT_S8, "8-bit S-LE PCM"}, + {UA20_FMT_PCM, 16, AFMT_S16_LE, "16-bit S-LE PCM"}, + {UA20_FMT_PCM, 24, AFMT_S24_LE, "24-bit S-LE PCM"}, + {UA20_FMT_PCM, 32, AFMT_S32_LE, "32-bit S-LE PCM"}, + + {UA20_FMT_PCM8, 8, AFMT_U8, "8-bit U-LE PCM"}, + {UA20_FMT_PCM8, 16, AFMT_U16_LE, "16-bit U-LE PCM"}, + {UA20_FMT_PCM8, 24, AFMT_U24_LE, "24-bit U-LE PCM"}, + {UA20_FMT_PCM8, 32, AFMT_U32_LE, "32-bit U-LE PCM"}, + + {UA20_FMT_ALAW, 8, AFMT_A_LAW, "8-bit A-Law"}, + {UA20_FMT_MULAW, 8, AFMT_MU_LAW, "8-bit mu-Law"}, + + {0, 0, 0, NULL} +}; + #define UAC_OUTPUT 0 #define UAC_INPUT 1 #define UAC_EQUAL 2 @@ -346,18 +391,8 @@ static usb_callback_t umidi_bulk_read_callback; static usb_callback_t umidi_bulk_write_callback; -static void uaudio_chan_fill_info_sub(struct uaudio_softc *, - struct usb_device *, uint32_t, uint8_t, uint8_t); -static void uaudio_chan_fill_info(struct uaudio_softc *, - struct usb_device *); -static void uaudio_mixer_add_ctl_sub(struct uaudio_softc *, - struct uaudio_mixer_node *); -static void uaudio_mixer_add_ctl(struct uaudio_softc *, - struct uaudio_mixer_node *); -static void uaudio_mixer_add_input(struct uaudio_softc *, - const struct uaudio_terminal_node *, int); -static void uaudio_mixer_add_output(struct uaudio_softc *, - const struct uaudio_terminal_node *, int); +/* ==== USB audio v1.0 ==== */ + static void uaudio_mixer_add_mixer(struct uaudio_softc *, const struct uaudio_terminal_node *, int); static void uaudio_mixer_add_selector(struct uaudio_softc *, @@ -378,25 +413,56 @@ struct uaudio_mixer_node *); static uint16_t uaudio_mixer_feature_name(const struct uaudio_terminal_node *, struct uaudio_mixer_node *); -static const struct uaudio_terminal_node *uaudio_mixer_get_input( - const struct uaudio_terminal_node *, uint8_t); -static const struct uaudio_terminal_node *uaudio_mixer_get_output( - const struct uaudio_terminal_node *, uint8_t); static void uaudio_mixer_find_inputs_sub(struct uaudio_terminal_node *, const uint8_t *, uint8_t, struct uaudio_search_result *); -static void uaudio_mixer_find_outputs_sub(struct uaudio_terminal_node *, - uint8_t, uint8_t, struct uaudio_search_result *); +static const void *uaudio_mixer_verify_desc(const void *, uint32_t); +static usb_error_t uaudio_set_speed(struct usb_device *, uint8_t, uint32_t); +static int uaudio_mixer_get(struct usb_device *, uint16_t, uint8_t, + struct uaudio_mixer_node *); + +/* ==== USB audio v2.0 ==== */ + +static void uaudio20_mixer_add_mixer(struct uaudio_softc *, + const struct uaudio_terminal_node *, int); +static void uaudio20_mixer_add_selector(struct uaudio_softc *, + const struct uaudio_terminal_node *, int); +static void uaudio20_mixer_add_feature(struct uaudio_softc *, + const struct uaudio_terminal_node *, int); +static struct usb_audio20_cluster uaudio20_mixer_get_cluster(uint8_t, + const struct uaudio_terminal_node *); +static uint16_t uaudio20_mixer_determine_class(const struct uaudio_terminal_node *, + struct uaudio_mixer_node *); +static uint16_t uaudio20_mixer_feature_name(const struct uaudio_terminal_node *, + struct uaudio_mixer_node *); +static void uaudio20_mixer_find_inputs_sub(struct uaudio_terminal_node *, + const uint8_t *, uint8_t, struct uaudio_search_result *); +static const void *uaudio20_mixer_verify_desc(const void *, uint32_t); +static usb_error_t uaudio20_set_speed(struct usb_device *, uint8_t, + uint8_t, uint32_t); + +/* USB audio v1.0 and v2.0 */ + +static void uaudio_chan_fill_info_sub(struct uaudio_softc *, + struct usb_device *, uint32_t, uint8_t, uint8_t); +static void uaudio_chan_fill_info(struct uaudio_softc *, + struct usb_device *); +static void uaudio_mixer_add_ctl_sub(struct uaudio_softc *, + struct uaudio_mixer_node *); +static void uaudio_mixer_add_ctl(struct uaudio_softc *, + struct uaudio_mixer_node *); static void uaudio_mixer_fill_info(struct uaudio_softc *, struct usb_device *, void *); -static uint16_t uaudio_mixer_get(struct usb_device *, uint8_t, - struct uaudio_mixer_node *); static void uaudio_mixer_ctl_set(struct uaudio_softc *, struct uaudio_mixer_node *, uint8_t, int32_t val); -static usb_error_t uaudio_set_speed(struct usb_device *, uint8_t, uint32_t); static int uaudio_mixer_signext(uint8_t, int); static int uaudio_mixer_bsd2value(struct uaudio_mixer_node *, int32_t val); -static const void *uaudio_mixer_verify_desc(const void *, uint32_t); static void uaudio_mixer_init(struct uaudio_softc *); +static const struct uaudio_terminal_node *uaudio_mixer_get_input( + const struct uaudio_terminal_node *, uint8_t); +static const struct uaudio_terminal_node *uaudio_mixer_get_output( + const struct uaudio_terminal_node *, uint8_t); +static void uaudio_mixer_find_outputs_sub(struct uaudio_terminal_node *, + uint8_t, uint8_t, struct uaudio_search_result *); static uint8_t umidi_convert_to_usb(struct umidi_sub_chan *, uint8_t, uint8_t); static struct umidi_sub_chan *umidi_sub_by_fifo(struct usb_fifo *); static void umidi_start_read(struct usb_fifo *); @@ -413,9 +479,6 @@ #ifdef USB_DEBUG static void uaudio_chan_dump_ep_desc( const usb_endpoint_descriptor_audio_t *); -static void uaudio_mixer_dump_cluster(uint8_t, - const struct uaudio_terminal_node *); -static const char *uaudio_mixer_get_terminal_name(uint16_t); #endif static const struct usb_config @@ -614,10 +677,12 @@ id = usbd_get_interface_descriptor(uaa->iface); + /* must fill mixer info before channel info */ + uaudio_mixer_fill_info(sc, uaa->device, id); + + /* fill channel info */ uaudio_chan_fill_info(sc, uaa->device); - uaudio_mixer_fill_info(sc, uaa->device, id); - DPRINTF("audio rev %d.%02x\n", sc->sc_audio_rev >> 8, sc->sc_audio_rev & 0xff); @@ -628,7 +693,7 @@ if (sc->sc_play_chan.valid) { device_printf(dev, "Play: %d Hz, %d ch, %s format.\n", sc->sc_play_chan.sample_rate, - sc->sc_play_chan.p_asf1d->bNrChannels, + sc->sc_play_chan.channels, sc->sc_play_chan.p_fmt->description); } else { device_printf(dev, "No playback.\n"); @@ -637,7 +702,7 @@ if (sc->sc_rec_chan.valid) { device_printf(dev, "Record: %d Hz, %d ch, %s format.\n", sc->sc_rec_chan.sample_rate, - sc->sc_rec_chan.p_asf1d->bNrChannels, + sc->sc_play_chan.channels, sc->sc_rec_chan.p_fmt->description); } else { device_printf(dev, "No recording.\n"); @@ -857,28 +922,88 @@ } } +static usb_error_t +uaudio20_check_rate(struct usb_device *udev, uint8_t iface_no, + uint8_t clockid, uint32_t rate) +{ + struct usb_device_request req; + usb_error_t error; + uint8_t data[255]; + uint16_t actlen; + uint16_t rates; + uint16_t x; + + DPRINTFN(6, "ifaceno=%d clockid=%d speed=%u rate=%u\n", + iface_no, clockid, speed, rate); + + req.bmRequestType = UT_READ_CLASS_INTERFACE; + req.bRequest = UA20_CS_RANGE; + USETW2(req.wValue, UA20_CS_SAM_FREQ_CONTROL, 0); + USETW2(req.wIndex, clockid, iface_no); + USETW(req.wLength, 255); + + error = usbd_do_request_flags(udev, NULL, &req, data, + USB_SHORT_XFER_OK, &actlen, USB_DEFAULT_TIMEOUT); + + if (error != 0 || actlen < 2) + return (USB_ERR_INVAL); + + rates = data[0] | (data[1] << 8); + actlen = (actlen - 2) / 12; + + if (rates > actlen) { + DPRINTF("Too many rates\n"); + rates = actlen; + } + + for (x = 0; x != rates; x++) { + uint32_t min = UGETDW(data + 2 + (12 * x)); + uint32_t max = UGETDW(data + 6 + (12 * x)); + uint32_t res = UGETDW(data + 10 + (12 * x)); + + if (res == 0) { + DPRINTF("Zero residue\n"); + res = 1; + } + + if (min > max) { + DPRINTF("Swapped max and min\n"); + uint32_t temp; + temp = min; + min = max; + max = temp; + } + + if (rate >= min && rate <= max && + ((rate - min) % res == 0)) { + return (0); + } + } + return (USB_ERR_INVAL); +} + static void uaudio_chan_fill_info_sub(struct uaudio_softc *sc, struct usb_device *udev, uint32_t rate, uint8_t channels, uint8_t bit_resolution) { struct usb_descriptor *desc = NULL; - const struct usb_audio_streaming_interface_descriptor *asid = NULL; - const struct usb_audio_streaming_type1_descriptor *asf1d = NULL; - const struct usb_audio_streaming_endpoint_descriptor *sed = NULL; + union uaudio_asid asid = { NULL }; + union uaudio_asf1d asf1d = { NULL }; + union uaudio_sed sed = { NULL }; usb_endpoint_descriptor_audio_t *ed1 = NULL; - const usb_endpoint_descriptor_audio_t *ed2 = NULL; + const struct usb_audio_control_descriptor *acdp = NULL; struct usb_config_descriptor *cd = usbd_get_config_descriptor(udev); struct usb_interface_descriptor *id; - const struct uaudio_format *p_fmt; + const struct uaudio_format *p_fmt = NULL; struct uaudio_chan *chan; uint16_t curidx = 0xFFFF; uint16_t lastidx = 0xFFFF; uint16_t alt_index = 0; - uint16_t wFormat; + uint16_t audio_rev = 0; + uint16_t x; uint8_t ep_dir; uint8_t bChannels; uint8_t bBitResolution; - uint8_t x; uint8_t audio_if = 0; uint8_t uma_if_class; @@ -923,171 +1048,258 @@ sc->sc_midi_chan.valid = 1; } } - asid = NULL; - asf1d = NULL; + asid.v1 = NULL; + asf1d.v1 = NULL; ed1 = NULL; - ed2 = NULL; - sed = NULL; + sed.v1 = NULL; } - if ((desc->bDescriptorType == UDESC_CS_INTERFACE) && + + if ((acdp == NULL) && + (desc->bDescriptorType == UDESC_CS_INTERFACE) && (desc->bDescriptorSubtype == AS_GENERAL) && - (desc->bLength >= sizeof(*asid))) { - if (asid == NULL) { - asid = (void *)desc; + (desc->bDescriptorSubtype == UDESCSUB_AC_HEADER) && + (desc->bLength >= sizeof(*acdp))) { + acdp = (void *)desc; + audio_rev = UGETW(acdp->bcdADC); + } + + if ((acdp != NULL) && + (desc->bDescriptorType == UDESC_CS_INTERFACE) && + (desc->bDescriptorSubtype == AS_GENERAL) && + (asid.v1 == NULL)) { + if (audio_rev >= UAUDIO_VERSION_30) { + /* FALLTHROUGH */ + } else if (audio_rev >= UAUDIO_VERSION_20) { + if (desc->bLength >= sizeof(*asid.v2)) { + asid.v2 = (void *)desc; + } + } else { + if (desc->bLength >= sizeof(*asid.v1)) { + asid.v1 = (void *)desc; + } } } - if ((desc->bDescriptorType == UDESC_CS_INTERFACE) && + if ((acdp != NULL) && + (desc->bDescriptorType == UDESC_CS_INTERFACE) && (desc->bDescriptorSubtype == FORMAT_TYPE) && - (desc->bLength >= sizeof(*asf1d))) { - if (asf1d == NULL) { - asf1d = (void *)desc; - if (asf1d->bFormatType != FORMAT_TYPE_I) { - DPRINTFN(11, "ignored bFormatType = %d\n", - asf1d->bFormatType); - asf1d = NULL; - continue; + (asf1d.v1 == NULL)) { + if (audio_rev >= UAUDIO_VERSION_30) { + /* FALLTHROUGH */ + } else if (audio_rev >= UAUDIO_VERSION_20) { + if (desc->bLength >= sizeof(*asf1d.v2)) + asf1d.v2 = (void *)desc; + } else { + if (desc->bLength >= sizeof(*asf1d.v1)) { + asf1d.v1 = (void *)desc; + + if (asf1d.v1->bFormatType != FORMAT_TYPE_I) { + DPRINTFN(11, "ignored bFormatType = %d\n", + asf1d.v1->bFormatType); + asf1d.v1 = NULL; + continue; + } + if (desc->bLength < (sizeof(*asf1d.v1) + + ((asf1d.v1->bSamFreqType == 0) ? 6 : + (asf1d.v1->bSamFreqType * 3)))) { + DPRINTFN(11, "invalid descriptor, " + "too short\n"); + asf1d.v1 = NULL; + continue; + } } - if (asf1d->bLength < (sizeof(*asf1d) + - ((asf1d->bSamFreqType == 0) ? 6 : - (asf1d->bSamFreqType * 3)))) { - DPRINTFN(11, "'asf1d' descriptor is too short\n"); - asf1d = NULL; - continue; - } } } if ((desc->bDescriptorType == UDESC_ENDPOINT) && - (desc->bLength >= UEP_MINSIZE)) { - if (ed1 == NULL) { - ed1 = (void *)desc; - if (UE_GET_XFERTYPE(ed1->bmAttributes) != UE_ISOCHRONOUS) { - ed1 = NULL; - } + (desc->bLength >= UEP_MINSIZE) && + (ed1 == NULL)) { + ed1 = (void *)desc; + if (UE_GET_XFERTYPE(ed1->bmAttributes) != UE_ISOCHRONOUS) { + ed1 = NULL; + continue; } } - if ((desc->bDescriptorType == UDESC_CS_ENDPOINT) && + if ((acdp != NULL) && + (desc->bDescriptorType == UDESC_CS_ENDPOINT) && (desc->bDescriptorSubtype == AS_GENERAL) && - (desc->bLength >= sizeof(*sed))) { - if (sed == NULL) { - sed = (void *)desc; + (sed.v1 == NULL)) { + if (audio_rev >= UAUDIO_VERSION_30) { + /* FALLTHROUGH */ + } else if (audio_rev >= UAUDIO_VERSION_20) { + if (desc->bLength >= sizeof(*sed.v2)) + sed.v2 = (void *)desc; + } else { + if (desc->bLength >= sizeof(*sed.v1)) + sed.v1 = (void *)desc; } } - if (audio_if && asid && asf1d && ed1 && sed) { + if (audio_if == 0 || asid.v1 == NULL || + asf1d.v1 == NULL || ed1 == NULL || + sed.v1 == NULL) { + /* need more descriptors */ + continue; + } - ep_dir = UE_GET_DIR(ed1->bEndpointAddress); + ep_dir = UE_GET_DIR(ed1->bEndpointAddress); - /* We ignore sync endpoint information until further. */ + /* We ignore sync endpoint information until further. */ - wFormat = UGETW(asid->wFormatTag); - bChannels = UAUDIO_MAX_CHAN(asf1d->bNrChannels); - bBitResolution = asf1d->bBitResolution; + if (audio_rev >= UAUDIO_VERSION_30) { + /* FALLTHROUGH */ + } else if (audio_rev >= UAUDIO_VERSION_20) { - if (asf1d->bSamFreqType == 0) { + uint32_t dwFormat; + uint8_t bSubslotSize; + + dwFormat = UGETDW(asid.v2->bmFormats); + bChannels = asid.v2->bNrChannels; + bBitResolution = asf1d.v2->bBitResolution; + bSubslotSize = asf1d.v2->bSubslotSize; + + if (bBitResolution != (bSubslotSize * 8)) { + DPRINTF("Invalid bSubslotSize\n"); + goto next_ep; + } + + if ((bChannels != channels) || + (bBitResolution != bit_resolution)) { + DPRINTF("Wrong number of channels\n"); + goto next_ep; + } + + for (p_fmt = uaudio20_formats; + p_fmt->wFormat != 0; p_fmt++) { + if ((p_fmt->wFormat & dwFormat) && + (p_fmt->bPrecision == bBitResolution)) + break; + } + + if (p_fmt->wFormat == 0) { + DPRINTF("Unsupported audio format\n"); + goto next_ep; + } + + for (x = 0; x != 256; x++) { + if (ep_dir == UE_DIR_OUT) { + if (!(sc->sc_mixer_clocks.bit_output[x / 8] & + (1 << (x % 8)))) { + continue; + } + } else { + if (!(sc->sc_mixer_clocks.bit_input[x / 8] & + (1 << (x % 8)))) { + continue; + } + } + + DPRINTF("Checking clock ID=%d\n", id); + + if (uaudio20_check_rate(udev, + sc->sc_mixer_iface_no, x, rate)) { + DPRINTF("Unsupported sampling " + "rate, id=%d\n", x); + goto next_ep; + } + } + } else { + uint16_t wFormat; + + wFormat = UGETW(asid.v1->wFormatTag); + bChannels = UAUDIO_MAX_CHAN(asf1d.v1->bNrChannels); + bBitResolution = asf1d.v1->bBitResolution; + + if (asf1d.v1->bSamFreqType == 0) { DPRINTFN(16, "Sample rate: %d-%dHz\n", - UA_SAMP_LO(asf1d), UA_SAMP_HI(asf1d)); + UA_SAMP_LO(asf1d.v1), + UA_SAMP_HI(asf1d.v1)); - if ((rate >= UA_SAMP_LO(asf1d)) && - (rate <= UA_SAMP_HI(asf1d))) { + if ((rate >= UA_SAMP_LO(asf1d.v1)) && + (rate <= UA_SAMP_HI(asf1d.v1))) goto found_rate; - } } else { - for (x = 0; x < asf1d->bSamFreqType; x++) { + for (x = 0; x < asf1d.v1->bSamFreqType; x++) { DPRINTFN(16, "Sample rate = %dHz\n", - UA_GETSAMP(asf1d, x)); + UA_GETSAMP(asf1d.v1, x)); - if (rate == UA_GETSAMP(asf1d, x)) { + if (rate == UA_GETSAMP(asf1d.v1, x)) goto found_rate; - } } } + goto next_ep; - audio_if = 0; - continue; - found_rate: - - for (p_fmt = uaudio_formats; - p_fmt->wFormat; - p_fmt++) { + for (p_fmt = uaudio10_formats; + p_fmt->wFormat != 0; p_fmt++) { if ((p_fmt->wFormat == wFormat) && - (p_fmt->bPrecision == bBitResolution)) { - goto found_format; - } + (p_fmt->bPrecision == bBitResolution)) + break; } + if (p_fmt->wFormat == 0) { + DPRINTF("Unsupported audio format\n"); + goto next_ep; + } - audio_if = 0; - continue; + if ((bChannels != channels) || + (bBitResolution != bit_resolution)) { + DPRINTF("Wrong number of channels\n"); + goto next_ep; + } + } - found_format: + chan = (ep_dir == UE_DIR_IN) ? + &sc->sc_rec_chan : &sc->sc_play_chan; - if ((bChannels == channels) && - (bBitResolution == bit_resolution)) { + if (chan->valid != 0 || + usbd_get_iface(udev, curidx) == NULL) { + DPRINTF("Channel already exists or " + "interface is not valid\n"); + goto next_ep; + } - chan = (ep_dir == UE_DIR_IN) ? - &sc->sc_rec_chan : - &sc->sc_play_chan; - - if ((chan->valid == 0) && usbd_get_iface(udev, curidx)) { - - chan->valid = 1; + chan->valid = 1; #ifdef USB_DEBUG - uaudio_chan_dump_ep_desc(ed1); - uaudio_chan_dump_ep_desc(ed2); - - if (sed->bmAttributes & UA_SED_FREQ_CONTROL) { - DPRINTFN(2, "FREQ_CONTROL\n"); - } - if (sed->bmAttributes & UA_SED_PITCH_CONTROL) { - DPRINTFN(2, "PITCH_CONTROL\n"); - } + uaudio_chan_dump_ep_desc(ed1); #endif - DPRINTF("Sample rate = %dHz, channels = %d, " - "bits = %d, format = %s\n", rate, channels, - bit_resolution, p_fmt->description); + DPRINTF("Sample rate = %dHz, channels = %d, " + "bits = %d, format = %s\n", rate, channels, + bit_resolution, p_fmt->description); - chan->sample_rate = rate; - chan->p_asid = asid; - chan->p_asf1d = asf1d; - chan->p_ed1 = ed1; - chan->p_ed2 = ed2; - chan->p_fmt = p_fmt; - chan->p_sed = sed; - chan->iface_index = curidx; - chan->iface_alt_index = alt_index; + chan->sample_rate = rate; + chan->p_asf1d = asf1d; + chan->p_ed1 = ed1; + chan->p_fmt = p_fmt; + chan->p_sed = sed; + chan->iface_index = curidx; + chan->iface_alt_index = alt_index; - if (ep_dir == UE_DIR_IN) - chan->usb_cfg = - uaudio_cfg_record; - else - chan->usb_cfg = - uaudio_cfg_play; + if (ep_dir == UE_DIR_IN) + chan->usb_cfg = uaudio_cfg_record; + else + chan->usb_cfg = uaudio_cfg_play; - chan->sample_size = (( - UAUDIO_MAX_CHAN(chan->p_asf1d->bNrChannels) * - chan->p_asf1d->bBitResolution) / 8); + chan->sample_size = (UAUDIO_MAX_CHAN(channels) * + p_fmt->bPrecision) / 8; + chan->channels = channels; - if (ep_dir == UE_DIR_IN && - usbd_get_speed(udev) == USB_SPEED_FULL) { - uaudio_record_fix_fs(ed1, - chan->sample_size * (rate / 1000), - chan->sample_size * (rate / 4000)); - } + if (ep_dir == UE_DIR_IN && + usbd_get_speed(udev) == USB_SPEED_FULL) { + uaudio_record_fix_fs(ed1, + chan->sample_size * (rate / 1000), + chan->sample_size * (rate / 4000)); + } - if (sc->sc_sndstat_valid) { - sbuf_printf(&sc->sc_sndstat, "\n\t" - "mode %d.%d:(%s) %dch, %d/%dbit, %s, %dHz", - curidx, alt_index, - (ep_dir == UE_DIR_IN) ? "input" : "output", - asf1d->bNrChannels, asf1d->bBitResolution, - asf1d->bSubFrameSize * 8, - p_fmt->description, rate); - } - } - } - audio_if = 0; - continue; + if (sc->sc_sndstat_valid != 0) { + sbuf_printf(&sc->sc_sndstat, "\n\t" + "mode %d.%d:(%s) %dch, %dbit, %s, %dHz", + curidx, alt_index, + (ep_dir == UE_DIR_IN) ? "input" : "output", + channels, p_fmt->bPrecision, + p_fmt->description, rate); } + + next_ep: + sed.v1 = NULL; + ed1 = NULL; } } @@ -1390,7 +1602,7 @@ format = ch->p_fmt->freebsd_fmt; - switch (ch->p_asf1d->bNrChannels) { + switch (ch->channels) { case 2: /* stereo */ format = SND_FORMAT(format, 2, 0); @@ -1402,7 +1614,7 @@ default: /* surround and more */ format = feeder_matrix_default_format( - SND_FORMAT(format, ch->p_asf1d->bNrChannels, 0)); + SND_FORMAT(format, ch->channels, 0)); break; } @@ -1438,13 +1650,43 @@ * Only set the sample rate if the channel reports that it * supports the frequency control. */ - if (ch->p_sed->bmAttributes & UA_SED_FREQ_CONTROL) { + + if (sc->sc_audio_rev >= UAUDIO_VERSION_30) { + /* FALLTHROUGH */ + } else if (sc->sc_audio_rev >= UAUDIO_VERSION_20) { + unsigned int x; + + for (x = 0; x != 256; x++) { + if (dir == PCMDIR_PLAY) { + if (!(sc->sc_mixer_clocks.bit_output[x / 8] & + (1 << (x % 8)))) { + continue; + } + } else { + if (!(sc->sc_mixer_clocks.bit_input[x / 8] & + (1 << (x % 8)))) { + continue; + } + } + + if (uaudio20_set_speed(sc->sc_udev, + sc->sc_mixer_iface_no, x, ch->sample_rate)) { + /* + * If the endpoint is adaptive setting + * the speed may fail. + */ + DPRINTF("setting of sample rate failed! " + "(continuing anyway)\n"); + } + } + } else if (ch->p_sed.v1->bmAttributes & UA_SED_FREQ_CONTROL) { if (uaudio_set_speed(sc->sc_udev, endpoint, ch->sample_rate)) { /* - * If the endpoint is adaptive setting the speed may - * fail. + * If the endpoint is adaptive setting the + * speed may fail. */ - DPRINTF("setting of sample rate failed! (continuing anyway)\n"); + DPRINTF("setting of sample rate failed! " + "(continuing anyway)\n"); } } if (usbd_transfer_setup(sc->sc_udev, &iface_index, ch->xfer, @@ -1679,14 +1921,11 @@ /* determine min and max values */ - mc->minval = uaudio_mixer_get(sc->sc_udev, GET_MIN, mc); + mc->minval = uaudio_mixer_get(sc->sc_udev, + sc->sc_audio_rev, GET_MIN, mc); + mc->maxval = uaudio_mixer_get(sc->sc_udev, + sc->sc_audio_rev, GET_MAX, mc); - mc->minval = uaudio_mixer_signext(mc->type, mc->minval); - - mc->maxval = uaudio_mixer_get(sc->sc_udev, GET_MAX, mc); - - mc->maxval = uaudio_mixer_signext(mc->type, mc->maxval); - /* check if max and min was swapped */ if (mc->maxval < mc->minval) { @@ -1701,7 +1940,8 @@ mc->mul = 1; /* compute value alignment */ - res = uaudio_mixer_get(sc->sc_udev, GET_RES, mc); + res = uaudio_mixer_get(sc->sc_udev, + sc->sc_audio_rev, GET_RES, mc); DPRINTF("Resolution = %d\n", (int)res); } @@ -1724,43 +1964,94 @@ } static void -uaudio_mixer_add_input(struct uaudio_softc *sc, +uaudio_mixer_add_mixer(struct uaudio_softc *sc, const struct uaudio_terminal_node *iot, int id) { -#ifdef USB_DEBUG - const struct usb_audio_input_terminal *d = iot[id].u.it; + struct uaudio_mixer_node mix; - DPRINTFN(3, "bTerminalId=%d wTerminalType=0x%04x " - "bAssocTerminal=%d bNrChannels=%d wChannelConfig=%d " - "iChannelNames=%d\n", - d->bTerminalId, UGETW(d->wTerminalType), d->bAssocTerminal, - d->bNrChannels, UGETW(d->wChannelConfig), - d->iChannelNames); -#endif -} + const struct usb_audio_mixer_unit_0 *d0 = iot[id].u.mu_v1; + const struct usb_audio_mixer_unit_1 *d1; -static void -uaudio_mixer_add_output(struct uaudio_softc *sc, - const struct uaudio_terminal_node *iot, int id) -{ -#ifdef USB_DEBUG - const struct usb_audio_output_terminal *d = iot[id].u.ot; + uint32_t bno; /* bit number */ + uint32_t p; /* bit number accumulator */ + uint32_t mo; /* matching outputs */ + uint32_t mc; /* matching channels */ + uint32_t ichs; /* input channels */ + uint32_t ochs; /* output channels */ + uint32_t c; + uint32_t chs; /* channels */ + uint32_t i; + uint32_t o; - DPRINTFN(3, "bTerminalId=%d wTerminalType=0x%04x " - "bAssocTerminal=%d bSourceId=%d iTerminal=%d\n", - d->bTerminalId, UGETW(d->wTerminalType), d->bAssocTerminal, - d->bSourceId, d->iTerminal); -#endif + DPRINTFN(3, "bUnitId=%d bNrInPins=%d\n", + d0->bUnitId, d0->bNrInPins); + + /* compute the number of input channels */ + + ichs = 0; + for (i = 0; i < d0->bNrInPins; i++) { + ichs += uaudio_mixer_get_cluster( + d0->baSourceId[i], iot).bNrChannels; + } + + d1 = (const void *)(d0->baSourceId + d0->bNrInPins); + + /* and the number of output channels */ + + ochs = d1->bNrChannels; + + DPRINTFN(3, "ichs=%d ochs=%d\n", ichs, ochs); + + memset(&mix, 0, sizeof(mix)); + + mix.wIndex = MAKE_WORD(d0->bUnitId, sc->sc_mixer_iface_no); + uaudio_mixer_determine_class(&iot[id], &mix); + mix.type = MIX_SIGNED_16; + + if (uaudio_mixer_verify_desc(d0, ((ichs * ochs) + 7) / 8) == NULL) + return; + + for (p = i = 0; i < d0->bNrInPins; i++) { + chs = uaudio_mixer_get_cluster( + d0->baSourceId[i], iot).bNrChannels; + mc = 0; + for (c = 0; c < chs; c++) { + mo = 0; + for (o = 0; o < ochs; o++) { + bno = ((p + c) * ochs) + o; + if (BIT_TEST(d1->bmControls, bno)) + mo++; + } + if (mo == 1) + mc++; + } + if ((mc == chs) && (chs <= MIX_MAX_CHAN)) { + + /* repeat bit-scan */ + + mc = 0; + for (c = 0; c < chs; c++) { + for (o = 0; o < ochs; o++) { + bno = ((p + c) * ochs) + o; + if (BIT_TEST(d1->bmControls, bno)) + mix.wValue[mc++] = MAKE_WORD(p + c + 1, o + 1); + } + } + mix.nchan = chs; + uaudio_mixer_add_ctl(sc, &mix); + } + p += chs; + } } static void -uaudio_mixer_add_mixer(struct uaudio_softc *sc, +uaudio20_mixer_add_mixer(struct uaudio_softc *sc, const struct uaudio_terminal_node *iot, int id) { struct uaudio_mixer_node mix; - const struct usb_audio_mixer_unit_0 *d0 = iot[id].u.mu; - const struct usb_audio_mixer_unit_1 *d1; + const struct usb_audio20_mixer_unit_0 *d0 = iot[id].u.mu_v2; + const struct usb_audio20_mixer_unit_1 *d1; uint32_t bno; /* bit number */ uint32_t p; /* bit number accumulator */ @@ -1780,8 +2071,8 @@ ichs = 0; for (i = 0; i < d0->bNrInPins; i++) { - ichs += (uaudio_mixer_get_cluster(d0->baSourceId[i], iot) - .bNrChannels); + ichs += uaudio20_mixer_get_cluster( + d0->baSourceId[i], iot).bNrChannels; } d1 = (const void *)(d0->baSourceId + d0->bNrInPins); @@ -1795,26 +2086,25 @@ memset(&mix, 0, sizeof(mix)); mix.wIndex = MAKE_WORD(d0->bUnitId, sc->sc_mixer_iface_no); - uaudio_mixer_determine_class(&iot[id], &mix); + uaudio20_mixer_determine_class(&iot[id], &mix); mix.type = MIX_SIGNED_16; - if (uaudio_mixer_verify_desc(d0, ((ichs * ochs) + 7) / 8) == NULL) { + if (uaudio20_mixer_verify_desc(d0, ((ichs * ochs) + 7) / 8) == NULL) return; - } + for (p = i = 0; i < d0->bNrInPins; i++) { - chs = uaudio_mixer_get_cluster(d0->baSourceId[i], iot).bNrChannels; + chs = uaudio20_mixer_get_cluster( + d0->baSourceId[i], iot).bNrChannels; mc = 0; for (c = 0; c < chs; c++) { mo = 0; for (o = 0; o < ochs; o++) { bno = ((p + c) * ochs) + o; - if (BIT_TEST(d1->bmControls, bno)) { + if (BIT_TEST(d1->bmControls, bno)) mo++; - } } - if (mo == 1) { + if (mo == 1) mc++; - } } if ((mc == chs) && (chs <= MIX_MAX_CHAN)) { @@ -1824,15 +2114,12 @@ for (c = 0; c < chs; c++) { for (o = 0; o < ochs; o++) { bno = ((p + c) * ochs) + o; - if (BIT_TEST(d1->bmControls, bno)) { + if (BIT_TEST(d1->bmControls, bno)) mix.wValue[mc++] = MAKE_WORD(p + c + 1, o + 1); - } } } mix.nchan = chs; uaudio_mixer_add_ctl(sc, &mix); - } else { - /* XXX */ } p += chs; } @@ -1842,7 +2129,7 @@ uaudio_mixer_add_selector(struct uaudio_softc *sc, const struct uaudio_terminal_node *iot, int id) { - const struct usb_audio_selector_unit *d = iot[id].u.su; + const struct usb_audio_selector_unit *d = iot[id].u.su_v1; struct uaudio_mixer_node mix; uint16_t i; @@ -1873,8 +2160,8 @@ } for (i = 0; i < mix.maxval; i++) { - mix.slctrtype[i] = uaudio_mixer_feature_name - (&iot[d->baSourceId[i]], &mix); + mix.slctrtype[i] = uaudio_mixer_feature_name( + &iot[d->baSourceId[i]], &mix); } mix.class = 0; /* not used */ @@ -1882,6 +2169,49 @@ uaudio_mixer_add_ctl(sc, &mix); } +static void +uaudio20_mixer_add_selector(struct uaudio_softc *sc, + const struct uaudio_terminal_node *iot, int id) +{ + const struct usb_audio20_selector_unit *d = iot[id].u.su_v2; + struct uaudio_mixer_node mix; + uint16_t i; + + DPRINTFN(3, "bUnitId=%d bNrInPins=%d\n", + d->bUnitId, d->bNrInPins); + + if (d->bNrInPins == 0) + return; + + memset(&mix, 0, sizeof(mix)); + + mix.wIndex = MAKE_WORD(d->bUnitId, sc->sc_mixer_iface_no); + mix.wValue[0] = MAKE_WORD(0, 0); + uaudio20_mixer_determine_class(&iot[id], &mix); + mix.nchan = 1; + mix.type = MIX_SELECTOR; + + mix.ctl = SOUND_MIXER_NRDEVICES; + mix.minval = 1; + mix.maxval = d->bNrInPins; + + if (mix.maxval > MAX_SELECTOR_INPUT_PIN) + mix.maxval = MAX_SELECTOR_INPUT_PIN; + + mix.mul = (mix.maxval - mix.minval); + for (i = 0; i < MAX_SELECTOR_INPUT_PIN; i++) + mix.slctrtype[i] = SOUND_MIXER_NRDEVICES; + + for (i = 0; i < mix.maxval; i++) { + mix.slctrtype[i] = uaudio20_mixer_feature_name( + &iot[d->baSourceId[i]], &mix); + } + + mix.class = 0; /* not used */ + + uaudio_mixer_add_ctl(sc, &mix); +} + static uint32_t uaudio_mixer_feature_get_bmaControls(const struct usb_audio_feature_unit *d, uint8_t i) @@ -1908,7 +2238,7 @@ uaudio_mixer_add_feature(struct uaudio_softc *sc, const struct uaudio_terminal_node *iot, int id) { - const struct usb_audio_feature_unit *d = iot[id].u.fu; + const struct usb_audio_feature_unit *d = iot[id].u.fu_v1; struct uaudio_mixer_node mix; uint32_t fumask; uint32_t mmask; @@ -2024,9 +2354,129 @@ break; } - if (mix.type != MIX_UNKNOWN) { + if (mix.type != MIX_UNKNOWN) uaudio_mixer_add_ctl(sc, &mix); + } +} + +static void +uaudio20_mixer_add_feature(struct uaudio_softc *sc, + const struct uaudio_terminal_node *iot, int id) +{ + const struct usb_audio20_feature_unit *d = iot[id].u.fu_v2; + struct uaudio_mixer_node mix; + uint32_t ctl; + uint32_t mmask; + uint32_t cmask; + uint16_t mixernumber; + uint8_t nchan; + uint8_t chan; + uint8_t i; + uint8_t what; + + if (UGETDW(d->bmaControls[0]) == 0) + return; + + memset(&mix, 0, sizeof(mix)); + + nchan = (d->bLength - 6) / 4; + mmask = UGETDW(d->bmaControls[0]); + cmask = 0; + + if (nchan == 0) + return; + + /* figure out what we can control */ + + for (chan = 1; chan < nchan; chan++) + cmask |= UGETDW(d->bmaControls[chan]); + + if (nchan > MIX_MAX_CHAN) + nchan = MIX_MAX_CHAN; + + mix.wIndex = MAKE_WORD(d->bUnitId, sc->sc_mixer_iface_no); + + for (ctl = 3; ctl != 0; ctl <<= 2) { + + mixernumber = uaudio20_mixer_feature_name(&iot[id], &mix); + + switch (ctl) { + case (3 << 0): + mix.type = MIX_ON_OFF; + mix.ctl = SOUND_MIXER_NRDEVICES; + what = MUTE_CONTROL; + break; + case (3 << 2): + mix.type = MIX_SIGNED_16; + mix.ctl = mixernumber; + what = VOLUME_CONTROL; + break; + case (3 << 4): + mix.type = MIX_SIGNED_8; + mix.ctl = SOUND_MIXER_BASS; + what = BASS_CONTROL; + break; + case (3 << 6): + mix.type = MIX_SIGNED_8; + mix.ctl = SOUND_MIXER_NRDEVICES; /* XXXXX */ + what = MID_CONTROL; + break; + case (3 << 8): + mix.type = MIX_SIGNED_8; + mix.ctl = SOUND_MIXER_TREBLE; + what = TREBLE_CONTROL; + break; + case (3 << 12): + mix.type = MIX_ON_OFF; + mix.ctl = SOUND_MIXER_NRDEVICES; /* XXXXX */ + what = AGC_CONTROL; + break; + case (3 << 14): + mix.type = MIX_UNSIGNED_16; + mix.ctl = SOUND_MIXER_NRDEVICES; /* XXXXX */ + what = DELAY_CONTROL; + break; + case (3 << 16): + mix.type = MIX_ON_OFF; + mix.ctl = SOUND_MIXER_NRDEVICES; /* XXXXX */ + what = BASS_BOOST_CONTROL; + break; + case (3 << 18): + mix.type = MIX_ON_OFF; + mix.ctl = SOUND_MIXER_LOUD; /* Is this correct ? */ + what = LOUDNESS_CONTROL; + break; + case (3 << 20): + mix.type = MIX_SIGNED_16; + mix.ctl = mixernumber; + what = INPUT_GAIN_CONTROL; + break; + case (3 << 22): + mix.type = MIX_SIGNED_16; + mix.ctl = mixernumber; + what = INPUT_GAIN_PAD_CONTROL; + break; + default: + continue; } + + if ((mmask & ctl) == ctl) { + mix.nchan = 1; + mix.wValue[0] = MAKE_WORD(what, 0); + } else if ((cmask & ctl) == ctl) { + mix.nchan = nchan - 1; + for (i = 1; i < nchan; i++) { + if ((UGETDW(d->bmaControls[i]) & ctl) == ctl) + mix.wValue[i - 1] = MAKE_WORD(what, i); + else + mix.wValue[i - 1] = -1; + } + } else { + continue; + } + + if (mix.type != MIX_UNKNOWN) + uaudio_mixer_add_ctl(sc, &mix); } } @@ -2034,7 +2484,7 @@ uaudio_mixer_add_processing_updown(struct uaudio_softc *sc, const struct uaudio_terminal_node *iot, int id) { - const struct usb_audio_processing_unit_0 *d0 = iot[id].u.pu; + const struct usb_audio_processing_unit_0 *d0 = iot[id].u.pu_v1; const struct usb_audio_processing_unit_1 *d1 = (const void *)(d0->baSourceId + d0->bNrInPins); const struct usb_audio_processing_unit_updown *ud = @@ -2076,7 +2526,7 @@ uaudio_mixer_add_processing(struct uaudio_softc *sc, const struct uaudio_terminal_node *iot, int id) { - const struct usb_audio_processing_unit_0 *d0 = iot[id].u.pu; + const struct usb_audio_processing_unit_0 *d0 = iot[id].u.pu_v1; const struct usb_audio_processing_unit_1 *d1 = (const void *)(d0->baSourceId + d0->bNrInPins); struct uaudio_mixer_node mix; @@ -2121,7 +2571,7 @@ uaudio_mixer_add_extension(struct uaudio_softc *sc, const struct uaudio_terminal_node *iot, int id) { - const struct usb_audio_extension_unit_0 *d0 = iot[id].u.eu; + const struct usb_audio_extension_unit_0 *d0 = iot[id].u.eu_v1; const struct usb_audio_extension_unit_1 *d1 = (const void *)(d0->baSourceId + d0->bNrInPins); struct uaudio_mixer_node mix; @@ -2276,35 +2726,162 @@ return (NULL); } -#ifdef USB_DEBUG -static void -uaudio_mixer_dump_cluster(uint8_t id, const struct uaudio_terminal_node *iot) +static const void * +uaudio20_mixer_verify_desc(const void *arg, uint32_t len) { - static const char *channel_names[16] = { - "LEFT", "RIGHT", "CENTER", "LFE", - "LEFT_SURROUND", "RIGHT_SURROUND", "LEFT_CENTER", "RIGHT_CENTER", - "SURROUND", "LEFT_SIDE", "RIGHT_SIDE", "TOP", - "RESERVED12", "RESERVED13", "RESERVED14", "RESERVED15", - }; - uint16_t cc; - uint8_t i; - const struct usb_audio_cluster cl = uaudio_mixer_get_cluster(id, iot); + const struct usb_audio20_mixer_unit_1 *d1; + const struct usb_audio20_extension_unit_1 *e1; + const struct usb_audio20_processing_unit_1 *u1; + const struct usb_audio20_clock_selector_unit_1 *c1; - cc = UGETW(cl.wChannelConfig); + union { + const struct usb_descriptor *desc; + const struct usb_audio20_clock_source_unit *csrc; + const struct usb_audio20_clock_selector_unit_0 *csel; + const struct usb_audio20_clock_multiplier_unit *cmul; + const struct usb_audio20_input_terminal *it; + const struct usb_audio20_output_terminal *ot; + const struct usb_audio20_mixer_unit_0 *mu; + const struct usb_audio20_selector_unit *su; + const struct usb_audio20_feature_unit *fu; + const struct usb_audio20_sample_rate_unit *ru; + const struct usb_audio20_processing_unit_0 *pu; + const struct usb_audio20_extension_unit_0 *eu; + const struct usb_audio20_effect_unit *ef; + } u; - DPRINTF("cluster: bNrChannels=%u iChannelNames=%u wChannelConfig=" - "0x%04x:\n", cl.iChannelNames, cl.bNrChannels, cc); + u.desc = arg; - for (i = 0; cc; i++) { - if (cc & 1) { - DPRINTF(" - %s\n", channel_names[i]); - } - cc >>= 1; + if (u.desc == NULL) + goto error; + + if (u.desc->bDescriptorType != UDESC_CS_INTERFACE) + goto error; + + switch (u.desc->bDescriptorSubtype) { + case UDESCSUB_AC_INPUT: + len += sizeof(*u.it); + break; + + case UDESCSUB_AC_OUTPUT: + len += sizeof(*u.ot); + break; + + case UDESCSUB_AC_MIXER: + len += sizeof(*u.mu); + + if (u.desc->bLength < len) + goto error; + len += u.mu->bNrInPins; + + if (u.desc->bLength < len) + goto error; + + d1 = (const void *)(u.mu->baSourceId + u.mu->bNrInPins); + + len += sizeof(*d1) + d1->bNrChannels; + break; + + case UDESCSUB_AC_SELECTOR: + len += sizeof(*u.su); + + if (u.desc->bLength < len) + goto error; + + len += u.su->bNrInPins; + break; + + case UDESCSUB_AC_FEATURE: + len += sizeof(*u.fu) + 1; + + if (u.desc->bLength < len) + goto error; + break; + + case UDESCSUB_AC_EFFECT: + len += sizeof(*u.ef) + 4; + break; + + case UDESCSUB_AC_PROCESSING_V2: + len += sizeof(*u.pu); + + if (u.desc->bLength < len) + goto error; + + len += u.pu->bNrInPins; + + if (u.desc->bLength < len) + goto error; + + u1 = (const void *)(u.pu->baSourceId + u.pu->bNrInPins); + + len += sizeof(*u1); + break; + + case UDESCSUB_AC_EXTENSION_V2: + len += sizeof(*u.eu); + + if (u.desc->bLength < len) + goto error; + + len += u.eu->bNrInPins; + + if (u.desc->bLength < len) + goto error; + + e1 = (const void *)(u.eu->baSourceId + u.eu->bNrInPins); + + len += sizeof(*e1); + break; + + case UDESCSUB_AC_CLOCK_SRC: + len += sizeof(*u.csrc); + break; + + case UDESCSUB_AC_CLOCK_SEL: + len += sizeof(*u.csel); + + if (u.desc->bLength < len) + goto error; + + len += u.csel->bNrInPins; + + if (u.desc->bLength < len) + goto error; + + c1 = (const void *)(u.csel->baCSourceId + u.csel->bNrInPins); + + len += sizeof(*c1); + break; + + case UDESCSUB_AC_CLOCK_MUL: + len += sizeof(*u.cmul); + break; + + case UDESCSUB_AC_SAMPLE_RT: + len += sizeof(*u.ru); + break; + + default: + goto error; } + + if (u.desc->bLength < len) + goto error; + + return (u.desc); + +error: + if (u.desc) { + DPRINTF("invalid descriptor, type=%d, " + "sub_type=%d, len=%d of %d bytes\n", + u.desc->bDescriptorType, + u.desc->bDescriptorSubtype, + u.desc->bLength, len); + } + return (NULL); } -#endif - static struct usb_audio_cluster uaudio_mixer_get_cluster(uint8_t id, const struct uaudio_terminal_node *iot) { @@ -2319,43 +2896,43 @@ } switch (dp->bDescriptorSubtype) { case UDESCSUB_AC_INPUT: - r.bNrChannels = iot[id].u.it->bNrChannels; - r.wChannelConfig[0] = iot[id].u.it->wChannelConfig[0]; - r.wChannelConfig[1] = iot[id].u.it->wChannelConfig[1]; - r.iChannelNames = iot[id].u.it->iChannelNames; + r.bNrChannels = iot[id].u.it_v1->bNrChannels; + r.wChannelConfig[0] = iot[id].u.it_v1->wChannelConfig[0]; + r.wChannelConfig[1] = iot[id].u.it_v1->wChannelConfig[1]; + r.iChannelNames = iot[id].u.it_v1->iChannelNames; goto done; case UDESCSUB_AC_OUTPUT: - id = iot[id].u.ot->bSourceId; + id = iot[id].u.ot_v1->bSourceId; break; case UDESCSUB_AC_MIXER: r = *(const struct usb_audio_cluster *) - &iot[id].u.mu->baSourceId[iot[id].u.mu-> - bNrInPins]; + &iot[id].u.mu_v1->baSourceId[ + iot[id].u.mu_v1->bNrInPins]; goto done; case UDESCSUB_AC_SELECTOR: - if (iot[id].u.su->bNrInPins > 0) { + if (iot[id].u.su_v1->bNrInPins > 0) { /* XXX This is not really right */ - id = iot[id].u.su->baSourceId[0]; + id = iot[id].u.su_v1->baSourceId[0]; } break; case UDESCSUB_AC_FEATURE: - id = iot[id].u.fu->bSourceId; + id = iot[id].u.fu_v1->bSourceId; break; case UDESCSUB_AC_PROCESSING: r = *((const struct usb_audio_cluster *) - &iot[id].u.pu->baSourceId[iot[id].u.pu-> - bNrInPins]); + &iot[id].u.pu_v1->baSourceId[ + iot[id].u.pu_v1->bNrInPins]); goto done; case UDESCSUB_AC_EXTENSION: r = *((const struct usb_audio_cluster *) - &iot[id].u.eu->baSourceId[iot[id].u.eu-> - bNrInPins]); + &iot[id].u.eu_v1->baSourceId[ + iot[id].u.eu_v1->bNrInPins]); goto done; default: @@ -2369,108 +2946,80 @@ return (r); } -#ifdef USB_DEBUG +static struct usb_audio20_cluster +uaudio20_mixer_get_cluster(uint8_t id, const struct uaudio_terminal_node *iot) +{ + struct usb_audio20_cluster r; + const struct usb_descriptor *dp; + uint8_t i; -struct uaudio_tt_to_string { - uint16_t terminal_type; - const char *desc; -}; + for (i = 0; i < UAUDIO_RECURSE_LIMIT; i++) { /* avoid infinite loops */ + dp = iot[id].u.desc; + if (dp == NULL) + goto error; -static const struct uaudio_tt_to_string uaudio_tt_to_string[] = { + switch (dp->bDescriptorSubtype) { + case UDESCSUB_AC_INPUT: + r.bNrChannels = iot[id].u.it_v2->bNrChannels; + r.bmChannelConfig[0] = iot[id].u.it_v2->bmChannelConfig[0]; + r.bmChannelConfig[1] = iot[id].u.it_v2->bmChannelConfig[1]; + r.bmChannelConfig[2] = iot[id].u.it_v2->bmChannelConfig[2]; + r.bmChannelConfig[3] = iot[id].u.it_v2->bmChannelConfig[3]; + r.iChannelNames = iot[id].u.it_v2->iTerminal; + goto done; - /* USB terminal types */ - {UAT_UNDEFINED, "UAT_UNDEFINED"}, - {UAT_STREAM, "UAT_STREAM"}, - {UAT_VENDOR, "UAT_VENDOR"}, + case UDESCSUB_AC_OUTPUT: + id = iot[id].u.ot_v2->bSourceId; + break; - /* input terminal types */ - {UATI_UNDEFINED, "UATI_UNDEFINED"}, - {UATI_MICROPHONE, "UATI_MICROPHONE"}, - {UATI_DESKMICROPHONE, "UATI_DESKMICROPHONE"}, - {UATI_PERSONALMICROPHONE, "UATI_PERSONALMICROPHONE"}, - {UATI_OMNIMICROPHONE, "UATI_OMNIMICROPHONE"}, - {UATI_MICROPHONEARRAY, "UATI_MICROPHONEARRAY"}, - {UATI_PROCMICROPHONEARR, "UATI_PROCMICROPHONEARR"}, + case UDESCSUB_AC_MIXER: + r = *(const struct usb_audio20_cluster *) + &iot[id].u.mu_v2->baSourceId[ + iot[id].u.mu_v2->bNrInPins]; + goto done; - /* output terminal types */ - {UATO_UNDEFINED, "UATO_UNDEFINED"}, - {UATO_SPEAKER, "UATO_SPEAKER"}, - {UATO_HEADPHONES, "UATO_HEADPHONES"}, - {UATO_DISPLAYAUDIO, "UATO_DISPLAYAUDIO"}, - {UATO_DESKTOPSPEAKER, "UATO_DESKTOPSPEAKER"}, - {UATO_ROOMSPEAKER, "UATO_ROOMSPEAKER"}, - {UATO_COMMSPEAKER, "UATO_COMMSPEAKER"}, - {UATO_SUBWOOFER, "UATO_SUBWOOFER"}, + case UDESCSUB_AC_SELECTOR: + if (iot[id].u.su_v2->bNrInPins > 0) { + /* XXX This is not really right */ + id = iot[id].u.su_v2->baSourceId[0]; + } + break; - /* bidir terminal types */ - {UATB_UNDEFINED, "UATB_UNDEFINED"}, - {UATB_HANDSET, "UATB_HANDSET"}, - {UATB_HEADSET, "UATB_HEADSET"}, - {UATB_SPEAKERPHONE, "UATB_SPEAKERPHONE"}, - {UATB_SPEAKERPHONEESUP, "UATB_SPEAKERPHONEESUP"}, - {UATB_SPEAKERPHONEECANC, "UATB_SPEAKERPHONEECANC"}, + case UDESCSUB_AC_SAMPLE_RT: + id = iot[id].u.ru_v2->bSourceId; + break; - /* telephony terminal types */ - {UATT_UNDEFINED, "UATT_UNDEFINED"}, - {UATT_PHONELINE, "UATT_PHONELINE"}, - {UATT_TELEPHONE, "UATT_TELEPHONE"}, - {UATT_DOWNLINEPHONE, "UATT_DOWNLINEPHONE"}, + case UDESCSUB_AC_EFFECT: + id = iot[id].u.ef_v2->bSourceId; + break; - /* external terminal types */ - {UATE_UNDEFINED, "UATE_UNDEFINED"}, - {UATE_ANALOGCONN, "UATE_ANALOGCONN"}, - {UATE_LINECONN, "UATE_LINECONN"}, - {UATE_LEGACYCONN, "UATE_LEGACYCONN"}, - {UATE_DIGITALAUIFC, "UATE_DIGITALAUIFC"}, - {UATE_SPDIF, "UATE_SPDIF"}, - {UATE_1394DA, "UATE_1394DA"}, - {UATE_1394DV, "UATE_1394DV"}, + case UDESCSUB_AC_FEATURE: + id = iot[id].u.fu_v2->bSourceId; + break; - /* embedded function terminal types */ - {UATF_UNDEFINED, "UATF_UNDEFINED"}, - {UATF_CALIBNOISE, "UATF_CALIBNOISE"}, - {UATF_EQUNOISE, "UATF_EQUNOISE"}, - {UATF_CDPLAYER, "UATF_CDPLAYER"}, - {UATF_DAT, "UATF_DAT"}, - {UATF_DCC, "UATF_DCC"}, - {UATF_MINIDISK, "UATF_MINIDISK"}, - {UATF_ANALOGTAPE, "UATF_ANALOGTAPE"}, - {UATF_PHONOGRAPH, "UATF_PHONOGRAPH"}, - {UATF_VCRAUDIO, "UATF_VCRAUDIO"}, - {UATF_VIDEODISCAUDIO, "UATF_VIDEODISCAUDIO"}, - {UATF_DVDAUDIO, "UATF_DVDAUDIO"}, - {UATF_TVTUNERAUDIO, "UATF_TVTUNERAUDIO"}, - {UATF_SATELLITE, "UATF_SATELLITE"}, - {UATF_CABLETUNER, "UATF_CABLETUNER"}, - {UATF_DSS, "UATF_DSS"}, - {UATF_RADIORECV, "UATF_RADIORECV"}, - {UATF_RADIOXMIT, "UATF_RADIOXMIT"}, - {UATF_MULTITRACK, "UATF_MULTITRACK"}, - {UATF_SYNTHESIZER, "UATF_SYNTHESIZER"}, + case UDESCSUB_AC_PROCESSING_V2: + r = *((const struct usb_audio20_cluster *) + &iot[id].u.pu_v2->baSourceId[ + iot[id].u.pu_v2->bNrInPins]); + goto done; - /* unknown */ - {0x0000, "UNKNOWN"}, -}; + case UDESCSUB_AC_EXTENSION_V2: + r = *((const struct usb_audio20_cluster *) + &iot[id].u.eu_v2->baSourceId[ + iot[id].u.eu_v2->bNrInPins]); + goto done; -static const char * -uaudio_mixer_get_terminal_name(uint16_t terminal_type) -{ - const struct uaudio_tt_to_string *uat = uaudio_tt_to_string; - - while (uat->terminal_type) { - if (uat->terminal_type == terminal_type) { - break; + default: + goto error; } - uat++; } - if (uat->terminal_type == 0) { - DPRINTF("unknown terminal type (0x%04x)", terminal_type); - } - return (uat->desc); +error: + DPRINTF("Bad data!\n"); + memset(&r, 0, sizeof(r)); +done: + return (r); } -#endif - static uint16_t uaudio_mixer_determine_class(const struct uaudio_terminal_node *iot, struct uaudio_mixer_node *mix) @@ -2490,7 +3039,8 @@ * one output terminal: */ if (output[0] && (!output[1])) { - terminal_type = UGETW(output[0]->u.ot->wTerminalType); + terminal_type = + UGETW(output[0]->u.ot_v1->wTerminalType); } /* * If the only output terminal is USB, @@ -2500,7 +3050,8 @@ mix->class = UAC_RECORD; if (input[0] && (!input[1])) { - terminal_type = UGETW(input[0]->u.it->wTerminalType); + terminal_type = + UGETW(input[0]->u.it_v1->wTerminalType); } else { terminal_type = 0; } @@ -2513,7 +3064,8 @@ */ if (input[0] && (!input[1])) { mix->class = UAC_INPUT; - terminal_type = UGETW(input[0]->u.it->wTerminalType); + terminal_type = + UGETW(input[0]->u.it_v1->wTerminalType); goto done; } /* @@ -2524,6 +3076,60 @@ return (terminal_type); } +static uint16_t +uaudio20_mixer_determine_class(const struct uaudio_terminal_node *iot, + struct uaudio_mixer_node *mix) +{ + uint16_t terminal_type = 0x0000; + const struct uaudio_terminal_node *input[2]; + const struct uaudio_terminal_node *output[2]; + + input[0] = uaudio_mixer_get_input(iot, 0); + input[1] = uaudio_mixer_get_input(iot, 1); + + output[0] = uaudio_mixer_get_output(iot, 0); + output[1] = uaudio_mixer_get_output(iot, 1); + + /* + * check if there is only + * one output terminal: + */ + if (output[0] && (!output[1])) + terminal_type = UGETW(output[0]->u.ot_v2->wTerminalType); + /* + * If the only output terminal is USB, + * the class is UAC_RECORD. + */ + if ((terminal_type & 0xff00) == (UAT_UNDEFINED & 0xff00)) { + + mix->class = UAC_RECORD; + if (input[0] && (!input[1])) { + terminal_type = + UGETW(input[0]->u.it_v2->wTerminalType); + } else { + terminal_type = 0; + } + goto done; + } + /* + * if the unit is connected to just + * one input terminal, the + * class is UAC_INPUT: + */ + if (input[0] && (!input[1])) { + mix->class = UAC_INPUT; + terminal_type = + UGETW(input[0]->u.it_v2->wTerminalType); + goto done; + } + /* + * Otherwise, the class is UAC_OUTPUT. + */ + mix->class = UAC_OUTPUT; +done: + return (terminal_type); +} + struct uaudio_tt_to_feature { uint16_t terminal_type; uint16_t feature; @@ -2636,6 +3242,28 @@ return (uat->feature); } +static uint16_t +uaudio20_mixer_feature_name(const struct uaudio_terminal_node *iot, + struct uaudio_mixer_node *mix) +{ + const struct uaudio_tt_to_feature *uat; + uint16_t terminal_type = uaudio20_mixer_determine_class(iot, mix); + + if ((mix->class == UAC_RECORD) && (terminal_type == 0)) + return (SOUND_MIXER_IMIX); + + for (uat = uaudio_tt_to_feature; uat->terminal_type != 0; uat++) { + if (uat->terminal_type == terminal_type) + break; + } + + DPRINTF("terminal_type=%s (0x%04x) -> %d\n", + uaudio_mixer_get_terminal_name(terminal_type), + terminal_type, uat->feature); + + return (uat->feature); +} + static const struct uaudio_terminal_node * uaudio_mixer_get_input(const struct uaudio_terminal_node *iot, uint8_t i) { @@ -2678,77 +3306,325 @@ struct uaudio_terminal_node *iot; uint8_t n; uint8_t i; + uint8_t is_last; - if (info->recurse_level >= UAUDIO_RECURSE_LIMIT) { - return; - } - info->recurse_level++; - +top: for (n = 0; n < n_id; n++) { i = p_id[n]; - if (info->bit_visited[i / 8] & (1 << (i % 8))) { - /* don't go into a circle */ + if (info->recurse_level == UAUDIO_RECURSE_LIMIT) { DPRINTF("avoided going into a circle at id=%d!\n", i); - continue; - } else { - info->bit_visited[i / 8] |= (1 << (i % 8)); + return; } + info->recurse_level++; + iot = (root + i); - if (iot->u.desc == NULL) { + if (iot->u.desc == NULL) continue; - } + + is_last = ((n + 1) == n_id); + switch (iot->u.desc->bDescriptorSubtype) { case UDESCSUB_AC_INPUT: info->bit_input[i / 8] |= (1 << (i % 8)); break; case UDESCSUB_AC_FEATURE: - uaudio_mixer_find_inputs_sub - (root, &iot->u.fu->bSourceId, 1, info); + if (is_last) { + p_id = &iot->u.fu_v1->bSourceId; + n_id = 1; + goto top; + } + uaudio_mixer_find_inputs_sub( + root, &iot->u.fu_v1->bSourceId, 1, info); break; case UDESCSUB_AC_OUTPUT: - uaudio_mixer_find_inputs_sub - (root, &iot->u.ot->bSourceId, 1, info); + if (is_last) { + p_id = &iot->u.ot_v1->bSourceId; + n_id = 1; + goto top; + } + uaudio_mixer_find_inputs_sub( + root, &iot->u.ot_v1->bSourceId, 1, info); break; case UDESCSUB_AC_MIXER: - uaudio_mixer_find_inputs_sub - (root, iot->u.mu->baSourceId, - iot->u.mu->bNrInPins, info); + if (is_last) { + p_id = iot->u.mu_v1->baSourceId; + n_id = iot->u.mu_v1->bNrInPins; + goto top; + } + uaudio_mixer_find_inputs_sub( + root, iot->u.mu_v1->baSourceId, + iot->u.mu_v1->bNrInPins, info); break; case UDESCSUB_AC_SELECTOR: - uaudio_mixer_find_inputs_sub - (root, iot->u.su->baSourceId, - iot->u.su->bNrInPins, info); + if (is_last) { + p_id = iot->u.su_v1->baSourceId; + n_id = iot->u.su_v1->bNrInPins; + goto top; + } + uaudio_mixer_find_inputs_sub( + root, iot->u.su_v1->baSourceId, + iot->u.su_v1->bNrInPins, info); break; case UDESCSUB_AC_PROCESSING: - uaudio_mixer_find_inputs_sub - (root, iot->u.pu->baSourceId, - iot->u.pu->bNrInPins, info); + if (is_last) { + p_id = iot->u.pu_v1->baSourceId; + n_id = iot->u.pu_v1->bNrInPins; + goto top; + } + uaudio_mixer_find_inputs_sub( + root, iot->u.pu_v1->baSourceId, + iot->u.pu_v1->bNrInPins, info); break; case UDESCSUB_AC_EXTENSION: - uaudio_mixer_find_inputs_sub - (root, iot->u.eu->baSourceId, - iot->u.eu->bNrInPins, info); + if (is_last) { + p_id = iot->u.eu_v1->baSourceId; + n_id = iot->u.eu_v1->bNrInPins; + goto top; + } + uaudio_mixer_find_inputs_sub( + root, iot->u.eu_v1->baSourceId, + iot->u.eu_v1->bNrInPins, info); break; - case UDESCSUB_AC_HEADER: default: break; } } - info->recurse_level--; } static void +uaudio20_mixer_find_inputs_sub(struct uaudio_terminal_node *root, + const uint8_t *p_id, uint8_t n_id, + struct uaudio_search_result *info) +{ + struct uaudio_terminal_node *iot; + uint8_t n; + uint8_t i; + uint8_t is_last; + +top: + for (n = 0; n < n_id; n++) { + + i = p_id[n]; + + if (info->recurse_level == UAUDIO_RECURSE_LIMIT) { + DPRINTF("avoided going into a circle at id=%d!\n", i); + return; + } + + info->recurse_level++; + + iot = (root + i); + + if (iot->u.desc == NULL) + continue; + + is_last = ((n + 1) == n_id); + + switch (iot->u.desc->bDescriptorSubtype) { + case UDESCSUB_AC_INPUT: + info->bit_input[i / 8] |= (1 << (i % 8)); + break; + + case UDESCSUB_AC_OUTPUT: + if (is_last) { + p_id = &iot->u.ot_v2->bSourceId; + n_id = 1; + goto top; + } + uaudio20_mixer_find_inputs_sub( + root, &iot->u.ot_v2->bSourceId, 1, info); + break; + + case UDESCSUB_AC_MIXER: + if (is_last) { + p_id = iot->u.mu_v2->baSourceId; + n_id = iot->u.mu_v2->bNrInPins; + goto top; + } + uaudio20_mixer_find_inputs_sub( + root, iot->u.mu_v2->baSourceId, + iot->u.mu_v2->bNrInPins, info); + break; + + case UDESCSUB_AC_SELECTOR: + if (is_last) { + p_id = iot->u.su_v2->baSourceId; + n_id = iot->u.su_v2->bNrInPins; + goto top; + } + uaudio20_mixer_find_inputs_sub( + root, iot->u.su_v2->baSourceId, + iot->u.su_v2->bNrInPins, info); + break; + + case UDESCSUB_AC_SAMPLE_RT: + if (is_last) { + p_id = &iot->u.ru_v2->bSourceId; + n_id = 1; + goto top; + } + uaudio20_mixer_find_inputs_sub( + root, &iot->u.ru_v2->bSourceId, + 1, info); + break; + + case UDESCSUB_AC_EFFECT: + if (is_last) { + p_id = &iot->u.ef_v2->bSourceId; + n_id = 1; + goto top; + } + uaudio20_mixer_find_inputs_sub( + root, &iot->u.ef_v2->bSourceId, + 1, info); + break; + + case UDESCSUB_AC_FEATURE: + if (is_last) { + p_id = &iot->u.fu_v2->bSourceId; + n_id = 1; + goto top; + } + uaudio20_mixer_find_inputs_sub( + root, &iot->u.fu_v2->bSourceId, 1, info); + break; + + case UDESCSUB_AC_PROCESSING_V2: + if (is_last) { + p_id = iot->u.pu_v2->baSourceId; + n_id = iot->u.pu_v2->bNrInPins; + goto top; + } + uaudio20_mixer_find_inputs_sub( + root, iot->u.pu_v2->baSourceId, + iot->u.pu_v2->bNrInPins, info); + break; + + case UDESCSUB_AC_EXTENSION_V2: + if (is_last) { + p_id = iot->u.eu_v2->baSourceId; + n_id = iot->u.eu_v2->bNrInPins; + goto top; + } + uaudio20_mixer_find_inputs_sub( + root, iot->u.eu_v2->baSourceId, + iot->u.eu_v2->bNrInPins, info); + break; + default: + break; + } + } +} + +static void +uaudio20_mixer_find_clocks_sub(struct uaudio_terminal_node *root, + const uint8_t *p_id, uint8_t n_id, + struct uaudio_search_result *info) +{ + struct uaudio_terminal_node *iot; + uint8_t n; + uint8_t i; + uint8_t is_last; + uint8_t id; + +top: + for (n = 0; n < n_id; n++) { + + i = p_id[n]; + + if (info->recurse_level == UAUDIO_RECURSE_LIMIT) { + DPRINTF("avoided going into a circle at id=%d!\n", i); + return; + } + + info->recurse_level++; + + iot = (root + i); + + if (iot->u.desc == NULL) + continue; + + is_last = ((n + 1) == n_id); + + switch (iot->u.desc->bDescriptorSubtype) { + case UDESCSUB_AC_INPUT: + info->is_input = 1; + if (is_last) { + p_id = &iot->u.it_v2->bCSourceId; + n_id = 1; + goto top; + } + uaudio20_mixer_find_clocks_sub(root, + &iot->u.it_v2->bCSourceId, 1, info); + break; + + case UDESCSUB_AC_OUTPUT: + info->is_input = 0; + if (is_last) { + p_id = &iot->u.ot_v2->bCSourceId; + n_id = 1; + goto top; + } + uaudio20_mixer_find_clocks_sub(root, + &iot->u.ot_v2->bCSourceId, 1, info); + break; + + case UDESCSUB_AC_CLOCK_SEL: + if (is_last) { + p_id = iot->u.csel_v2->baCSourceId; + n_id = iot->u.csel_v2->bNrInPins; + goto top; + } + uaudio20_mixer_find_clocks_sub(root, + iot->u.csel_v2->baCSourceId, + iot->u.csel_v2->bNrInPins, info); + break; + + case UDESCSUB_AC_CLOCK_MUL: + if (is_last) { + p_id = &iot->u.cmul_v2->bCSourceId; + n_id = 1; + goto top; + } + uaudio20_mixer_find_clocks_sub(root, + &iot->u.cmul_v2->bCSourceId, + 1, info); + break; + + case UDESCSUB_AC_CLOCK_SRC: + + id = iot->u.csrc_v2->bClockId; + + switch (info->is_input) { + case 0: + info->bit_output[id / 8] |= (1 << (id % 8)); + break; + case 1: + info->bit_input[id / 8] |= (1 << (id % 8)); + break; + default: + break; + } + break; + + default: + break; + } + } +} + +static void uaudio_mixer_find_outputs_sub(struct uaudio_terminal_node *root, uint8_t id, uint8_t n_id, struct uaudio_search_result *info) { @@ -2774,8 +3650,8 @@ } static void -uaudio_mixer_fill_info(struct uaudio_softc *sc, struct usb_device *udev, - void *desc) +uaudio_mixer_fill_info(struct uaudio_softc *sc, + struct usb_device *udev, void *desc) { const struct usb_audio_control_descriptor *acdp; struct usb_config_descriptor *cd = usbd_get_config_descriptor(udev); @@ -2809,15 +3685,6 @@ DPRINTFN(3, "found AC header, vers=%03x, len=%d\n", sc->sc_audio_rev, wTotalLen); - if (sc->sc_audio_rev != UAUDIO_VERSION) { - - if (sc->sc_uq_bad_adc) { - - } else { - DPRINTF("invalid audio version\n"); - goto done; - } - } iot = malloc(sizeof(struct uaudio_terminal_node) * 256, M_TEMP, M_WAITOK | M_ZERO); @@ -2835,13 +3702,17 @@ wTotalLen -= dp->bLength; } - au = uaudio_mixer_verify_desc(dp, 0); + if (sc->sc_audio_rev >= UAUDIO_VERSION_30) + au = NULL; + else if (sc->sc_audio_rev >= UAUDIO_VERSION_20) + au = uaudio20_mixer_verify_desc(dp, 0); + else + au = uaudio_mixer_verify_desc(dp, 0); if (au) { iot[au->bUnitId].u.desc = (const void *)au; - if (au->bUnitId > ID_max) { + if (au->bUnitId > ID_max) ID_max = au->bUnitId; - } } } @@ -2853,7 +3724,21 @@ */ i = ID_max; do { - uaudio_mixer_find_inputs_sub(iot, &i, 1, &((iot + i)->usr)); + if (sc->sc_audio_rev >= UAUDIO_VERSION_30) { + /* FALLTHROUGH */ + } else if (sc->sc_audio_rev >= UAUDIO_VERSION_20) { + uaudio20_mixer_find_inputs_sub(iot, + &i, 1, &((iot + i)->usr)); + + sc->sc_mixer_clocks.is_input = 255; + sc->sc_mixer_clocks.recurse_level = 0; + + uaudio20_mixer_find_clocks_sub(iot, + &i, 1, &sc->sc_mixer_clocks); + } else { + uaudio_mixer_find_inputs_sub(iot, + &i, 1, &((iot + i)->usr)); + } } while (i--); /* @@ -2862,7 +3747,8 @@ */ i = ID_max; do { - uaudio_mixer_find_outputs_sub(iot, i, ID_max, &((iot + i)->usr)); + uaudio_mixer_find_outputs_sub(iot, + i, ID_max, &((iot + i)->usr)); } while (i--); /* set "id_max" and "root" */ @@ -2873,106 +3759,59 @@ (iot + i)->root = iot; } while (i--); -#ifdef USB_DEBUG + /* + * Scan the config to create a linked list of "mixer" nodes: + */ + i = ID_max; do { - uint8_t j; + dp = iot[i].u.desc; - if (iot[i].u.desc == NULL) { + if (dp == NULL) continue; - } - DPRINTF("id %d:\n", i); - switch (iot[i].u.desc->bDescriptorSubtype) { - case UDESCSUB_AC_INPUT: - DPRINTF(" - AC_INPUT type=%s\n", - uaudio_mixer_get_terminal_name - (UGETW(iot[i].u.it->wTerminalType))); - uaudio_mixer_dump_cluster(i, iot); - break; + DPRINTFN(11, "id=%d subtype=%d\n", + i, dp->bDescriptorSubtype); - case UDESCSUB_AC_OUTPUT: - DPRINTF(" - AC_OUTPUT type=%s " - "src=%d\n", uaudio_mixer_get_terminal_name - (UGETW(iot[i].u.ot->wTerminalType)), - iot[i].u.ot->bSourceId); - break; + if (sc->sc_audio_rev >= UAUDIO_VERSION_30) { + continue; + } else if (sc->sc_audio_rev >= UAUDIO_VERSION_20) { - case UDESCSUB_AC_MIXER: - DPRINTF(" - AC_MIXER src:\n"); - for (j = 0; j < iot[i].u.mu->bNrInPins; j++) { - DPRINTF(" - %d\n", iot[i].u.mu->baSourceId[j]); - } - uaudio_mixer_dump_cluster(i, iot); - break; + switch (dp->bDescriptorSubtype) { + case UDESCSUB_AC_HEADER: + DPRINTF("unexpected AC header\n"); + break; - case UDESCSUB_AC_SELECTOR: - DPRINTF(" - AC_SELECTOR src:\n"); - for (j = 0; j < iot[i].u.su->bNrInPins; j++) { - DPRINTF(" - %d\n", iot[i].u.su->baSourceId[j]); - } - break; + case UDESCSUB_AC_INPUT: + case UDESCSUB_AC_OUTPUT: + case UDESCSUB_AC_PROCESSING_V2: + case UDESCSUB_AC_EXTENSION_V2: + case UDESCSUB_AC_EFFECT: + case UDESCSUB_AC_CLOCK_SRC: + case UDESCSUB_AC_CLOCK_SEL: + case UDESCSUB_AC_CLOCK_MUL: + case UDESCSUB_AC_SAMPLE_RT: + break; - case UDESCSUB_AC_FEATURE: - DPRINTF(" - AC_FEATURE src=%d\n", iot[i].u.fu->bSourceId); - break; + case UDESCSUB_AC_MIXER: + uaudio20_mixer_add_mixer(sc, iot, i); + break; - case UDESCSUB_AC_PROCESSING: - DPRINTF(" - AC_PROCESSING src:\n"); - for (j = 0; j < iot[i].u.pu->bNrInPins; j++) { - DPRINTF(" - %d\n", iot[i].u.pu->baSourceId[j]); - } - uaudio_mixer_dump_cluster(i, iot); - break; + case UDESCSUB_AC_SELECTOR: + uaudio20_mixer_add_selector(sc, iot, i); + break; - case UDESCSUB_AC_EXTENSION: - DPRINTF(" - AC_EXTENSION src:\n"); - for (j = 0; j < iot[i].u.eu->bNrInPins; j++) { - DPRINTF("%d ", iot[i].u.eu->baSourceId[j]); - } - uaudio_mixer_dump_cluster(i, iot); - break; + case UDESCSUB_AC_FEATURE: + uaudio20_mixer_add_feature(sc, iot, i); + break; - default: - DPRINTF("unknown audio control (subtype=%d)\n", - iot[i].u.desc->bDescriptorSubtype); - } - - DPRINTF("Inputs to this ID are:\n"); - - j = ID_max; - do { - if (iot[i].usr.bit_input[j / 8] & (1 << (j % 8))) { - DPRINTF(" -- ID=%d\n", j); + default: + DPRINTF("bad AC desc subtype=0x%02x\n", + dp->bDescriptorSubtype); + break; } - } while (j--); - - DPRINTF("Outputs from this ID are:\n"); - - j = ID_max; - do { - if (iot[i].usr.bit_output[j / 8] & (1 << (j % 8))) { - DPRINTF(" -- ID=%d\n", j); - } - } while (j--); - - } while (i--); -#endif - - /* - * scan the config to create a linked - * list of "mixer" nodes: - */ - - i = ID_max; - do { - dp = iot[i].u.desc; - - if (dp == NULL) { continue; } - DPRINTFN(11, "id=%d subtype=%d\n", - i, dp->bDescriptorSubtype); switch (dp->bDescriptorSubtype) { case UDESCSUB_AC_HEADER: @@ -2980,11 +3819,7 @@ break; case UDESCSUB_AC_INPUT: - uaudio_mixer_add_input(sc, iot, i); - break; - case UDESCSUB_AC_OUTPUT: - uaudio_mixer_add_output(sc, iot, i); break; case UDESCSUB_AC_MIXER: @@ -3016,43 +3851,77 @@ } while (i--); done: - if (iot) { - free(iot, M_TEMP); - } + free(iot, M_TEMP); } -static uint16_t -uaudio_mixer_get(struct usb_device *udev, uint8_t what, - struct uaudio_mixer_node *mc) +static int +uaudio_mixer_get(struct usb_device *udev, uint16_t audio_rev, + uint8_t what, struct uaudio_mixer_node *mc) { struct usb_device_request req; - uint16_t val; - uint16_t len = MIX_SIZE(mc->type); - uint8_t data[4]; + int val; + uint8_t data[2 + (2 * 3)]; usb_error_t err; - if (mc->wValue[0] == -1) { + if (mc->wValue[0] == -1) return (0); + + if (audio_rev >= UAUDIO_VERSION_30) + return (0); + else if (audio_rev >= UAUDIO_VERSION_20) { + if (what == GET_CUR) { + req.bRequest = UA20_CS_CUR; + USETW(req.wLength, 2); + } else { + req.bRequest = UA20_CS_RANGE; + USETW(req.wLength, 8); + } + } else { + uint16_t len = MIX_SIZE(mc->type); + + req.bRequest = what; + USETW(req.wLength, len); } + req.bmRequestType = UT_READ_CLASS_INTERFACE; - req.bRequest = what; USETW(req.wValue, mc->wValue[0]); USETW(req.wIndex, mc->wIndex); - USETW(req.wLength, len); + memset(data, 0, sizeof(data)); + err = usbd_do_request(udev, NULL, &req, data); if (err) { DPRINTF("err=%s\n", usbd_errstr(err)); return (0); } - if (len < 1) { - data[0] = 0; + + if (audio_rev >= UAUDIO_VERSION_30) { + val = 0; + } else if (audio_rev >= UAUDIO_VERSION_20) { + switch (what) { + case GET_CUR: + val = (data[0] | (data[1] << 8)); + break; + case GET_MIN: + val = (data[2] | (data[3] << 8)); + break; + case GET_MAX: + val = (data[4] | (data[5] << 8)); + break; + case GET_RES: + val = (data[6] | (data[7] << 8)); + break; + default: + val = 0; + break; + } + } else { + val = (data[0] | (data[1] << 8)); } - if (len < 2) { - data[1] = 0; - } - val = (data[0] | (data[1] << 8)); + if (what == GET_CUR || what == GET_MIN || what == GET_MAX) + val = uaudio_mixer_signext(mc->type, val); + DPRINTFN(3, "val=%d\n", val); return (val); @@ -3088,8 +3957,6 @@ while (mc) { while (sc->sc_mixer_chan < mc->nchan) { - len = MIX_SIZE(mc->type); - chan = sc->sc_mixer_chan; sc->sc_mixer_chan++; @@ -3102,17 +3969,24 @@ if (update) { req.bmRequestType = UT_WRITE_CLASS_INTERFACE; - req.bRequest = SET_CUR; USETW(req.wValue, mc->wValue[chan]); USETW(req.wIndex, mc->wIndex); - USETW(req.wLength, len); - if (len > 0) { - buf[0] = (mc->wData[chan] & 0xFF); + if (sc->sc_audio_rev >= UAUDIO_VERSION_30) { + return; + } else if (sc->sc_audio_rev >= UAUDIO_VERSION_20) { + len = 2; + req.bRequest = UA20_CS_CUR; + USETW(req.wLength, len); + } else { + len = MIX_SIZE(mc->type); + req.bRequest = SET_CUR; + USETW(req.wLength, len); } - if (len > 1) { - buf[1] = (mc->wData[chan] >> 8) & 0xFF; - } + + buf[0] = (mc->wData[chan] & 0xFF); + buf[1] = (mc->wData[chan] >> 8) & 0xFF; + pc = usbd_xfer_get_frame(xfer, 0); usbd_copy_in(pc, 0, &req, sizeof(req)); pc = usbd_xfer_get_frame(xfer, 1); @@ -3166,6 +4040,29 @@ return (usbd_do_request(udev, NULL, &req, data)); } +static usb_error_t +uaudio20_set_speed(struct usb_device *udev, uint8_t iface_no, + uint8_t clockid, uint32_t speed) +{ + struct usb_device_request req; + uint8_t data[4]; + + DPRINTFN(6, "ifaceno=%d clockid=%d speed=%u\n", + iface_no, clockid, speed); + + req.bmRequestType = UT_WRITE_CLASS_INTERFACE; + req.bRequest = UA20_CS_CUR; + USETW2(req.wValue, UA20_CS_SAM_FREQ_CONTROL, 0); + USETW2(req.wIndex, clockid, iface_no); + USETW(req.wLength, 4); + data[0] = speed; + data[1] = speed >> 8; + data[2] = speed >> 16; + data[3] = speed >> 24; + + return (usbd_do_request(udev, NULL, &req, data)); +} + static int uaudio_mixer_signext(uint8_t type, int val) { === sys/dev/sound/usb/uaudioreg.h ================================================================== --- sys/dev/sound/usb/uaudioreg.h (revision 240082) +++ sys/dev/sound/usb/uaudioreg.h (local) @@ -36,6 +36,7 @@ #define UAUDIO_VERSION 0x0100 #define UAUDIO_VERSION_20 0x0200 +#define UAUDIO_VERSION_30 0x0300 #define UAUDIO_PROTOCOL_20 0x20 @@ -54,7 +55,7 @@ #define UDESCSUB_AC_FEATURE 6 #define UDESCSUB_AC_PROCESSING 7 #define UDESCSUB_AC_EXTENSION 8 -/* ==== USB audio 2.0 ==== */ +/* ==== USB audio v2.0 ==== */ #define UDESCSUB_AC_EFFECT 7 #define UDESCSUB_AC_PROCESSING_V2 8 #define UDESCSUB_AC_EXTENSION_V2 9 @@ -365,7 +366,7 @@ #define DELAY_CONTROL 0x08 #define BASS_BOOST_CONTROL 0x09 #define LOUDNESS_CONTROL 0x0a -/* ==== USB audio 2.0 ==== */ +/* ==== USB audio v2.0 ==== */ #define INPUT_GAIN_CONTROL 0x0b #define INPUT_GAIN_PAD_CONTROL 0x0c #define PHASE_INVERTER_CONTROL 0x0d @@ -380,7 +381,7 @@ #define AS_GENERAL 1 #define FORMAT_TYPE 2 #define FORMAT_SPECIFIC 3 -/* ==== USB audio 2.0 ==== */ +/* ==== USB audio v2.0 ==== */ #define FORMAT_ENCODER 3 #define FORMAT_DECODER 4 @@ -434,7 +435,7 @@ * USB audio v2.0 definitions *------------------------------------------------------------------------*/ -struct usb_audio20_as_iface_descriptor { +struct usb_audio20_streaming_interface_descriptor { uByte bLength; uByte bDescriptorType; uByte bDescriptorSubtype; @@ -488,12 +489,9 @@ uByte bInterval; } __packed; -#define UA20_GET_CUR 0x81 -#define UA20_SET_CUR 0x01 -#define UA20_GET_RANGE 0x82 -#define UA20_SET_RANGE 0x02 -#define UA20_GET_MEM 0x83 -#define UA20_SET_MEM 0x03 +#define UA20_CS_CUR 0x01 +#define UA20_CS_RANGE 0x02 +#define UA20_CS_MEM 0x03 struct usb_audio20_cur1_parameter { uByte bCur; @@ -595,14 +593,20 @@ } __packed; /* UDESCSUB_AC_CLOCK_SEL */ -struct usb_audio20_clock_selector_unit { +struct usb_audio20_clock_selector_unit_0 { uByte bLength; uByte bDescriptorType; uByte bDescriptorSubtype; uByte bClockId; uByte bNrInPins; + uByte baCSourceId[0]; } __packed; +struct usb_audio20_clock_selector_unit_1 { + uByte bmControls; + uByte iClockSelector; +} __packed; + /* UDESCSUB_AC_CLOCK_MUL */ struct usb_audio20_clock_multiplier_unit { uByte bLength; @@ -768,8 +772,6 @@ #define UA20_TF_CONTROL_PANEL 0x0C #define UA20_TF_OTHER 0xFF -#define UA20_EP_GENERAL 0x01 - #define UA20_CS_SAM_FREQ_CONTROL 0x01 #define UA20_CS_CLOCK_VALID_CONTROL 0x02 --Boundary-00=_TPmRQg1hvz9TseG-- From owner-freebsd-usb@FreeBSD.ORG Wed Sep 5 21:48:13 2012 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BC8361065670 for ; Wed, 5 Sep 2012 21:48:13 +0000 (UTC) (envelope-from anatoly@kazanfieldhockey.ru) Received: from kazanfieldhockey.ru (kazanfieldhockey.ru [78.138.152.250]) by mx1.freebsd.org (Postfix) with ESMTP id 320E98FC18 for ; Wed, 5 Sep 2012 21:48:12 +0000 (UTC) Received: from asd.localdomain (host-175-22.xdsl.telecet.ru [87.117.175.22]) (authenticated bits=0) by kazanfieldhockey.ru (8.14.3/8.14.3) with ESMTP id q85LlvRm047423 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO) for ; Thu, 6 Sep 2012 01:48:02 +0400 (MSK) (envelope-from anatoly@kazanfieldhockey.ru) Date: Thu, 6 Sep 2012 01:47:53 +0400 From: Anatoly To: freebsd-usb@freebsd.org Message-ID: <20120906014753.2aaa126f@asd.localdomain> In-Reply-To: <20120904235557.7ca40fc8@epc.localdomain> References: <20120904235557.7ca40fc8@epc.localdomain> X-Mailer: Claws Mail 3.7.5 (GTK+ 2.18.7; i386-portbld-freebsd7.3) Mime-Version: 1.0 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 8bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (kazanfieldhockey.ru [192.168.13.2]); Thu, 06 Sep 2012 01:48:03 +0400 (MSK) Subject: Re: how to force my 32G usb pendrive to flush write cache in RAM it has? 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: Wed, 05 Sep 2012 21:48:13 -0000 В Tue, 4 Sep 2012 23:55:57 +0400 Anatoly пишет: > Hello, > I have a problem with my new 32G pendrive: > > da1: Removable Direct Access SCSI-2 > device da1: 40.000MB/s transfers > da1: 30640MB (62750720 512 byte sectors: 255H 63S/T 3906C) > > I'm using fat32 partition on it. > To make problem occur I can do following things: > 1) write a file about 5MB in size on that partition > 2) unmount > 3) unplug pendrive (so it loses power) > 4) plug it again > 5) mount > Now I can see that the end of file is corrupted. > > Poblem never occurs when I do: > 1) write a file about 5MB in size on that partition > 2) unmount > 3) mount > Also, problem doesn't occur if I'll wait for more than ~10 minutes > before unplugging pendrive. > > So it seems to me that this pendrive has internal write cache in RAM > that needs to be flushed before pendrive loses power. > Problem never occurs with Windows. As I click "remove", windows > somehow "correctly shutdowns" pendrive so it's LED goes off (Unlike > if i just unmount, when the LED stays on) > > What can I do to get cache flushed before unpugging, turn that write > cache off, or any other suggestions? > I've tried camcontrol stop and camcontrol eject with no > success > I using FreeBSD 7.3 with generic kernel here I've found solution: http://lists.freebsd.org/pipermail/freebsd-usb/2008-March/004677.html that 'upower' utility allows to suspend pendrive, and I get cache flushed (And LED goes off): upower /dev/usb0 2 suspend From owner-freebsd-usb@FreeBSD.ORG Thu Sep 6 13:18:23 2012 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5DEAD106566C for ; Thu, 6 Sep 2012 13:18:23 +0000 (UTC) (envelope-from erikses@gmail.com) Received: from mail-ee0-f54.google.com (mail-ee0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id E248F8FC15 for ; Thu, 6 Sep 2012 13:18:22 +0000 (UTC) Received: by eeke52 with SMTP id e52so809095eek.13 for ; Thu, 06 Sep 2012 06:18:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=Uw0cMuRgBaFnhq41QyeejjrlfPzJi6jMRRncDqOqaOU=; b=apGKCK7ltUBUTgJAloMO4ejl2V8GZEkxJIHUMT1L/2rtz+vKgQBG9oop9Rsx/1BbpV wxqf3hScraG4hZl4mZWMSVCl4AlO3bXr2O/wwvPJc4Dnb1fkoG4XcjGH7L6gjAZv9lIG FIqfTb968N59oSX7B+EpV4lsy6YQW5EV2163KVP4PwqBLgN61MrArROZy7A3HYGQBpQc EKESi51+Qw+jxSiR9pX8fLXogo9eaPhI/TvLPmoPElnxYj9aerJFz3hXS20yLszWWdNA thQg/hT/YYVpjh6gM9U9bLeaeQOztLIWiPiEW9WeF2+Ku6dDuUe4veag2hpid9e2BsjB 2pRg== Received: by 10.14.184.134 with SMTP id s6mr2827335eem.46.1346937501708; Thu, 06 Sep 2012 06:18:21 -0700 (PDT) Received: from [192.168.16.117] (r5.toya.net.pl. [85.89.187.38]) by mx.google.com with ESMTPS id i41sm5942683eem.7.2012.09.06.06.18.19 (version=SSLv3 cipher=OTHER); Thu, 06 Sep 2012 06:18:20 -0700 (PDT) Message-ID: <5048A29A.80305@gmail.com> Date: Thu, 06 Sep 2012 15:18:18 +0200 From: "Stanislaw W." User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120714 Thunderbird/14.0 MIME-Version: 1.0 To: freebsd-usb@freebsd.org References: <20120904235557.7ca40fc8@epc.localdomain> <20120906014753.2aaa126f@asd.localdomain> In-Reply-To: <20120906014753.2aaa126f@asd.localdomain> Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 8bit Cc: Subject: Re: how to force my 32G usb pendrive to flush write cache in RAM it has? 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, 06 Sep 2012 13:18:23 -0000 W dniu 05.09.2012 23:47, Anatoly pisze: > В Tue, 4 Sep 2012 23:55:57 +0400 > Anatoly <> пишет: > >> Hello, >> I have a problem with my new 32G pendrive: >> >> da1: Removable Direct Access SCSI-2 >> device da1: 40.000MB/s transfers >> da1: 30640MB (62750720 512 byte sectors: 255H 63S/T 3906C) >> >> I'm using fat32 partition on it. >> To make problem occur I can do following things: >> 1) write a file about 5MB in size on that partition >> 2) unmount >> 3) unplug pendrive (so it loses power) >> 4) plug it again >> 5) mount >> Now I can see that the end of file is corrupted. >> >> Poblem never occurs when I do: >> 1) write a file about 5MB in size on that partition >> 2) unmount >> 3) mount >> Also, problem doesn't occur if I'll wait for more than ~10 minutes >> before unplugging pendrive. >> >> So it seems to me that this pendrive has internal write cache in RAM >> that needs to be flushed before pendrive loses power. >> Problem never occurs with Windows. As I click "remove", windows >> somehow "correctly shutdowns" pendrive so it's LED goes off (Unlike >> if i just unmount, when the LED stays on) >> >> What can I do to get cache flushed before unpugging, turn that write >> cache off, or any other suggestions? >> I've tried camcontrol stop and camcontrol eject with no >> success >> I using FreeBSD 7.3 with generic kernel here > I've found solution: > http://lists.freebsd.org/pipermail/freebsd-usb/2008-March/004677.html > that 'upower' utility allows to suspend pendrive, and I get cache > flushed (And LED goes off): > upower /dev/usb0 2 suspend > _______________________________________________ > freebsd-usb@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-usb > To unsubscribe, send any mail to "freebsd-usb-unsubscribe@freebsd.org" > To flush cache You can also use sync(8) Stanislaw. From owner-freebsd-usb@FreeBSD.ORG Thu Sep 6 18:41:57 2012 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9FADA106566C for ; Thu, 6 Sep 2012 18:41:57 +0000 (UTC) (envelope-from dieterbsd@engineer.com) Received: from mailout-us.gmx.com (mailout-us.gmx.com [74.208.5.67]) by mx1.freebsd.org (Postfix) with SMTP id 6E85D8FC15 for ; Thu, 6 Sep 2012 18:41:57 +0000 (UTC) Received: (qmail 18738 invoked by uid 0); 6 Sep 2012 18:41:50 -0000 Received: from 67.206.184.2 by rms-us002 with HTTP Content-Type: text/plain; charset="utf-8" Date: Thu, 06 Sep 2012 14:41:48 -0400 From: "Dieter BSD" Message-ID: <20120906184149.165820@gmx.com> MIME-Version: 1.0 To: freebsd-usb@freebsd.org X-Authenticated: #74169980 X-Flags: 0001 X-Mailer: GMX.com Web Mailer x-registered: 0 Content-Transfer-Encoding: 8bit X-GMX-UID: Oos6cKIh3zOlNR3dAHAh7sh+IGRvbwB5 Subject: Disks are 1 sector smaller with USB bridge 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, 06 Sep 2012 18:41:57 -0000 FreeBSD reports that disks are 1 sector smaller when connected via a usb-to-sata bridge than when connected to a sata controller. This creates a problem when migrating a disk from a sata controller to a usb bridge, the data in the last sector is no longer accessable. How do I access the disk's last sector when connected via usb? From owner-freebsd-usb@FreeBSD.ORG Thu Sep 6 20:37:57 2012 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E20E1065670 for ; Thu, 6 Sep 2012 20:37:57 +0000 (UTC) (envelope-from anatoly@kazanfieldhockey.ru) Received: from kazanfieldhockey.ru (kazanfieldhockey.ru [78.138.152.250]) by mx1.freebsd.org (Postfix) with ESMTP id BFBEC8FC0C for ; Thu, 6 Sep 2012 20:37:56 +0000 (UTC) Received: from epc.localdomain (host-175-22.xdsl.telecet.ru [87.117.175.22]) (authenticated bits=0) by kazanfieldhockey.ru (8.14.3/8.14.3) with ESMTP id q86KbpQF065607 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO) for ; Fri, 7 Sep 2012 00:37:53 +0400 (MSK) (envelope-from anatoly@kazanfieldhockey.ru) Date: Fri, 7 Sep 2012 00:39:18 +0400 From: Anatoly To: freebsd-usb@freebsd.org Message-ID: <20120907003918.7620fb1e@epc.localdomain> X-Mailer: Claws Mail 3.7.5 (GTK+ 2.18.7; i386-portbld-freebsd7.3) Mime-Version: 1.0 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 8bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (kazanfieldhockey.ru [192.168.13.2]); Fri, 07 Sep 2012 00:37:53 +0400 (MSK) Subject: Re: how to force my 32G usb pendrive to flush write cache in RAM it has? 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, 06 Sep 2012 20:37:57 -0000 В Thu, 06 Sep 2012 15:18:18 +0200 "Stanislaw W." пишет: > W dniu 05.09.2012 23:47, Anatoly pisze: > > В Tue, 4 Sep 2012 23:55:57 +0400 > > Anatoly <> пишет: > > > >> Hello, > >> I have a problem with my new 32G pendrive: > >> > >> da1: Removable Direct Access SCSI-2 > >> device da1: 40.000MB/s transfers > >> da1: 30640MB (62750720 512 byte sectors: 255H 63S/T 3906C) > >> > >> I'm using fat32 partition on it. > >> To make problem occur I can do following things: > >> 1) write a file about 5MB in size on that partition > >> 2) unmount > >> 3) unplug pendrive (so it loses power) > >> 4) plug it again > >> 5) mount > >> Now I can see that the end of file is corrupted. > >> > >> Poblem never occurs when I do: > >> 1) write a file about 5MB in size on that partition > >> 2) unmount > >> 3) mount > >> Also, problem doesn't occur if I'll wait for more than ~10 minutes > >> before unplugging pendrive. > >> > >> So it seems to me that this pendrive has internal write cache in > >> RAM that needs to be flushed before pendrive loses power. > >> Problem never occurs with Windows. As I click "remove", windows > >> somehow "correctly shutdowns" pendrive so it's LED goes off (Unlike > >> if i just unmount, when the LED stays on) > >> > >> What can I do to get cache flushed before unpugging, turn that > >> write cache off, or any other suggestions? > >> I've tried camcontrol stop and camcontrol eject with no > >> success > >> I using FreeBSD 7.3 with generic kernel here > > I've found solution: > > http://lists.freebsd.org/pipermail/freebsd-usb/2008-March/004677.html > > that 'upower' utility allows to suspend pendrive, and I get cache > > flushed (And LED goes off): > > upower /dev/usb0 2 suspend > > _______________________________________________ > > freebsd-usb@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/freebsd-usb > > To unsubscribe, send any mail to > > "freebsd-usb-unsubscribe@freebsd.org" > > > To flush cache You can also use sync(8) > > > Stanislaw. Thank you for advice, Stanislaw I've just tried sync. Doesn't help yet. From owner-freebsd-usb@FreeBSD.ORG Fri Sep 7 03:27:38 2012 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 935E3106566C for ; Fri, 7 Sep 2012 03:27:38 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from mail-ob0-f182.google.com (mail-ob0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 4BDDE8FC08 for ; Fri, 7 Sep 2012 03:27:38 +0000 (UTC) Received: by obbun3 with SMTP id un3so4842050obb.13 for ; Thu, 06 Sep 2012 20:27:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer :x-gm-message-state; bh=80LvzaXiltCpYyG7byX3uzxJky731/aE4rGtEUoUmTY=; b=P36hVqTq063N50UA/YECYtVIq9fv/RUEUzhgfHZO+LXjJlLbeHccq3p4w29YKdvJpi HSu2zD4zM5zlI76BhUueZ/VR+CDjxy6XUW5TEklsq1O7T4Jnh9oD+6ByuI63CR6aooZr 4/L8wrqQi6UldRTXw3zwirNonmwDOiCHcUiw6jqenm++DoksrmTVsJK4sw1h/RPddR+X 2jljSthqQnaOQxkSwWJe9gVBTg0ax0f3HIJEfMOXOiJZwYJEaTYo1XYU78X9cb+8n47B zp6MZFTFLjIDGwGIo6s/lZ1KqTgydRh9EKWHt2/xyXnQVgaAz/1dDeWhnuF12kOFdnEN X9OA== Received: by 10.60.12.167 with SMTP id z7mr4375294oeb.121.1346988457466; Thu, 06 Sep 2012 20:27:37 -0700 (PDT) Received: from 63.imp.bsdimp.com (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPS id d6sm3763328obx.15.2012.09.06.20.27.35 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 06 Sep 2012 20:27:36 -0700 (PDT) Sender: Warner Losh Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: <20120906184149.165820@gmx.com> Date: Thu, 6 Sep 2012 21:27:34 -0600 Content-Transfer-Encoding: 7bit Message-Id: <6E36E102-71F2-4DF3-AB08-9BF1DF4D8AA5@bsdimp.com> References: <20120906184149.165820@gmx.com> To: Dieter BSD X-Mailer: Apple Mail (2.1084) X-Gm-Message-State: ALoCoQl0wSlRr+5a4HwEHhwc8hJOuSrvhaTzmqSVCj/QNDRPb2tQw+B0DMjrZFNb42FuB6gBJLye Cc: freebsd-usb@freebsd.org Subject: Re: Disks are 1 sector smaller with USB bridge 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: Fri, 07 Sep 2012 03:27:38 -0000 On Sep 6, 2012, at 12:41 PM, Dieter BSD wrote: > FreeBSD reports that disks are 1 sector smaller when connected via > a usb-to-sata bridge than when connected to a sata controller. > This creates a problem when migrating a disk from a sata controller > to a usb bridge, the data in the last sector is no longer accessable. > > How do I access the disk's last sector when connected via usb? Which version? I fixed this exact bug years ago, I thought... Warner From owner-freebsd-usb@FreeBSD.ORG Sat Sep 8 18:02:06 2012 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D8C8106564A for ; Sat, 8 Sep 2012 18:02:06 +0000 (UTC) (envelope-from dieterbsd@engineer.com) Received: from mailout-us.gmx.com (mailout-us.gmx.com [74.208.5.67]) by mx1.freebsd.org (Postfix) with SMTP id 14A228FC12 for ; Sat, 8 Sep 2012 18:02:06 +0000 (UTC) Received: (qmail 28197 invoked by uid 0); 8 Sep 2012 18:02:05 -0000 Received: from 67.206.186.149 by rms-us004 with HTTP Content-Type: text/plain; charset="utf-8" Date: Sat, 08 Sep 2012 14:02:03 -0400 From: "Dieter BSD" Message-ID: <20120908180204.165830@gmx.com> MIME-Version: 1.0 To: freebsd-usb@freebsd.org X-Authenticated: #74169980 X-Flags: 0001 X-Mailer: GMX.com Web Mailer x-registered: 0 Content-Transfer-Encoding: 8bit X-GMX-UID: S+05cKMh3zOlNR3dAHAhDRx+IGRvb0Ae Subject: Re: Disks are 1 sector smaller with USB bridge 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: Sat, 08 Sep 2012 18:02:06 -0000 [ ml didn't get cc-ed ] > ----- Original Message ----- > From: Dieter BSD > Sent: 09/07/12 11:28 AM > To: Warner Losh > Subject: Re: Disks are 1 sector smaller with USB bridge > > > ----- Original Message ----- > > From: Warner Losh > > Sent: 09/06/12 08:27 PM > > To: Dieter BSD > > Subject: Re: Disks are 1 sector smaller with USB bridge > > > > On Sep 6, 2012, at 12:41 PM, Dieter BSD wrote: > > > FreeBSD reports that disks are 1 sector smaller when connected via > > > a usb-to-sata bridge than when connected to a sata controller. > > > This creates a problem when migrating a disk from a sata controller > > > to a usb bridge, the data in the last sector is no longer accessable. > > > > > > How do I access the disk's last sector when connected via usb? > > > > Which version? I fixed this exact bug years ago, I thought... > > > > Warner > > FreeBSD 8.2 amd64 > Disk is recent Seagate 3TB external, the bridge provides 4KiB > sectors, but I recall seeing the same off-by-one problem > with an older bridge with 512 byte sectors. (Don't recall offhand > what version of FreeBSD I was running at the time.) > If it matters, bridge is usb3 but host is only usb2.