Subject: Re: kern/34070: btconfig: SIOCSBTFLAGS: Resource temporarily
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: Matthias Drochner <M.Drochner@fz-juelich.de>
List: netbsd-bugs
Date: 11/24/2006 10:55:02
The following reply was made to PR kern/34070; it has been noted by GNATS.
From: Matthias Drochner <M.Drochner@fz-juelich.de>
To: Iain Hibbert <plunky@rya-online.net>
Cc: gnats-bugs@NetBSD.org, kern-bug-people@NetBSD.org,
gnats-admin@NetBSD.org, netbsd-bugs@NetBSD.org, wulf@NetBSD.org
Subject: Re: kern/34070: btconfig: SIOCSBTFLAGS: Resource temporarily
unavailable
Date: Fri, 24 Nov 2006 11:54:46 +0100
This is a multipart MIME message.
--==_Exmh_7070402042130
Content-Type: text/plain; charset=us-ascii
OK, another try...
[data toggle code in ehci.c]
M.Drochner@fz-juelich.de said:
> The code above looks bogus - I can't imagine how transactions which
> are not executed could contribute to the state of the data toggle
> protocol.
Now I understand that that code (partially) rolls back a data toggle
pre-computation in ehci_alloc_sqtd_chain().
There is an obvious flaw however: It doesn't care about alignment
wrt wMaxPacketSize, so it will miss a packet under some conditions.
I'm not so eager to mess with that code right now, but I see an easy
workaround which is at least good to prove that theory: Allocate
transfer buffers in multiples of wMaxPacketSize.
With the appended patch my ubt initializes, and an "btconfig -vvv"
finishes successfully.
best regards
Matthias
--==_Exmh_7070402042130
Content-Type: text/plain ; name="ubtalign.txt"; charset=us-ascii
Content-Description: ubtalign.txt
Content-Disposition: attachment; filename="ubtalign.txt"
Index: ubt.c
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/ubt.c,v
retrieving revision 1.20
diff -u -p -r1.20 ubt.c
--- ubt.c 16 Nov 2006 01:33:26 -0000 1.20
+++ ubt.c 24 Nov 2006 10:38:31 -0000
@@ -151,7 +151,7 @@ SYSCTL_SETUP(sysctl_hw_ubt_debug_setup,
*/
#define UBT_BUFSIZ_CMD (HCI_CMD_PKT_SIZE - 1)
#define UBT_BUFSIZ_ACL (2048 - 1)
-#define UBT_BUFSIZ_EVENT (HCI_EVENT_PKT_SIZE - 1)
+#define UBT_BUFSIZ_EVENT 272 /*(HCI_EVENT_PKT_SIZE - 1)*/
/* Interrupt Interval from (Bluetooth spec) */
#define UBT_EVENT_INTERVAL 1 /* 1ms */
--==_Exmh_7070402042130--