From owner-freebsd-bluetooth@FreeBSD.ORG Mon Apr 18 01:18:09 2005 Return-Path: Delivered-To: freebsd-bluetooth@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EC97716A4CE for ; Mon, 18 Apr 2005 01:18:08 +0000 (GMT) Received: from mta11.adelphia.net (mta11.adelphia.net [68.168.78.205]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3EEC843D2D for ; Mon, 18 Apr 2005 01:18:08 +0000 (GMT) (envelope-from maksim.yevmenkin@savvis.net) Received: from [192.168.1.254] (really [70.32.199.60]) by mta11.adelphia.net (InterMail vM.6.01.04.01 201-2131-118-101-20041129) with ESMTP id <20050418011807.LVKY5402.mta11.adelphia.net@[192.168.1.254]>; Sun, 17 Apr 2005 21:18:07 -0400 Message-ID: <42630AE5.2070909@savvis.net> Date: Sun, 17 Apr 2005 18:18:29 -0700 From: Maksim Yevmenkin User-Agent: Mozilla Thunderbird 0.7.1 (Windows/20040626) X-Accept-Language: en-us, en MIME-Version: 1.0 To: wigglesworth02@comcast.net References: <1113779315.669.266.camel@Mobil1.276NET> In-Reply-To: <1113779315.669.266.camel@Mobil1.276NET> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: Bluetooth cc: Norfolk Unix Users' Group Subject: Re: Possible Kernel patch/hack needed, for use of Ambicom BT2000 CF adapter... X-BeenThere: freebsd-bluetooth@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Using Bluetooth in FreeBSD environments List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2005 01:18:09 -0000 Martes, > I am having difficulties using my CF/PCCard Bluetooth adapter from > Ambicom. I have found similar error messages, associated with an > individual that was attempting to get his palm to sync with BSD, back in > 2003. The respondent to the individual's inquiry, indicated a patch, > and the subsequent response was that the patch worked. I am unable to > locate the archived mail, via google, however, I am new to patching, and > have not yet been able to figure out where I might do so. I get > continuous loop of errors when attempting to use the rc.bluetooth > script, or hcseriald with the correct ttyd4 device. > > Can anyone indicate where I might find a way to patch this problem, or > if I may be able to edit some src, that has to do with this device > interface driver? (sio4) serial bluetooth devices do not work very well currently. the reason is high interrupt latency. because of it sio(4) driver can not fetch bytes from fifo in time and this creates fifo overflows and some characters are lost. when this happens host and adapter are considered to be out of sync. unfortunately, bluetooth serial transport protocol (chapter h4 in bluetooth specification) is very simple and does not provide any way to recover from "out of sync" condition. removable bluetooth serial devices (such as pcmcia cards etc.) are even worse. not only you have the high interrupt latency problem, but now you have to try to convince the system to assign separate irq to the device. if separate irq can not be assigned (for whatever reason) the system uses shared irq. this means there could be several interrupt handlers attached to the same irq. in this case once interrupt happens every interrupt handler must be called and check if it has anything to do. i'm not sure about the patch you are talking about, but you could try to search for "silo overflow". you would normally see these messages (from sio(4) driver) when it can not fetch data from the fifo. > I get the following in my dmesg output while executing the following: > >>hcseriald -d -f /dev/ttyd4 -n sio4 -s 115200 > >>ng_h4_input: sio4 - ignoring unknown packet type=0 >>ng_h4_input: sio4 - ignoring unknown packet type=0x80 typically those errors mean that the host and the adapter are out of sync. the ng_h4(4) line discipline tries to split incoming stream data (from the bluetooth adapter) into separate bluetooth hci packets. it expects to find certain bytes that denote the beginning of each packet etc. and can not find them. >>dmesg output for the connection renders the following: >>sio4: at port 0x3e8-0x3ef irq 11 >>function 0 config 2 on pccard1 >>sio4: type 16550A >>sio4: unable to activate interrupt in fast mode - using normal mode well, "unable to activate interrupt in fast mode" is not a good thing. i think it means device got shared irq. > I am stuck, and unable to get any farther than the start of hcseriald. > I am unable to use my bluetooth at all, because I am unable to even find > a good howto for using hcseriald or even how I am supposed to connect > the interface even if I can use hcseriald. Nothing ever happens other > than the output listed above. yes, unfortunately handbook does not have any examples, but it is fairly simple. once you have plugged your bluetooth card all you need to do is to start bluetooth stack, i.e. as root # rc.bluetooth start sio4 you will find example rc.bluetooth script in /usr/share/examples/netgraph/bluetooth. this script is generic and should work for you. the script will load all required modules and will start hcseriald(8) for you. after you run the script you should see the output very similar to one in the freebsd handbook. then you should be able to follow handbook instructions - just replace adapter name, i.e. use "sio4hci" instead of "ub0hci" etc. thanks, max p.s. in the future please do not cross post into several freebsd lists.