From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L034x-0002Dn-2k for qemu-devel@nongnu.org; Tue, 11 Nov 2008 18:55:27 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L034v-0002Db-Md for qemu-devel@nongnu.org; Tue, 11 Nov 2008 18:55:25 -0500 Received: from [199.232.76.173] (port=49274 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L034v-0002DY-HB for qemu-devel@nongnu.org; Tue, 11 Nov 2008 18:55:25 -0500 Received: from yx-out-1718.google.com ([74.125.44.158]:14918) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L034v-0006Ic-92 for qemu-devel@nongnu.org; Tue, 11 Nov 2008 18:55:25 -0500 Received: by yx-out-1718.google.com with SMTP id 3so70212yxi.82 for ; Tue, 11 Nov 2008 15:55:24 -0800 (PST) Message-ID: Date: Wed, 12 Nov 2008 00:55:24 +0100 From: "andrzej zaborowski" In-Reply-To: <20081111224259.GA6240@doriath.ww600.siemens.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20081111224259.GA6240@doriath.ww600.siemens.net> Subject: [Qemu-devel] Re: bt-hci-csr problem Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Dmitry Baryshkov Cc: qemu-devel@nongnu.org Hi, 2008/11/11 Dmitry Baryshkov : > When trying to add support for bt-hci-csr to tosa I stumbled upon a > problem. hciattach always displayed "timed out" error. After short > debugging I narrowed it to the following problem: > > The first packet that hciattach was sending is: > 0x01, 0x00, 0xfc, 0x17, > 0xc2, 0x00, 0x00, 0x09, > 0x00, 0x00, 0x00, 0x19, > 0x28, 0x00, 0x00, 0x00, > 0x00, 0x00, 0x00, 0x00, > 0x00, 0x00, 0x00, 0x00, > 0x00, 0x00, 0x00, > > At first glance it's perfectly valid. However csrhci_data_len() function > adds 1 to the length of this packet and thus does not detect the end of > the packet correctly. > > Most probably we should be more precise in selecting which commands have > incorrect length, shouldn't we? Or is that a problem with my hciattach? I suppose probably your device has a standard serial HCI? The bt-hci-csr is some Broadcom CSR chip which is not standard because it aligns frame sizes to multiples of 2, so it uses a non-standard driver in the n800 linux. As far as I'm concerned the only differences are this frame size alignment and the presence of vendor specific commands for firmware upload. If you remove these two things you should get a standard serial dongle (if I can suggest a name, I'd call it bt-hci-uart.c). Cheers