Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 17 Apr 2005 18:18:29 -0700
From:      Maksim Yevmenkin <maksim.yevmenkin@savvis.net>
To:        wigglesworth02@comcast.net
Cc:        Norfolk Unix Users' Group <twuug@twuug.org>
Subject:   Re: Possible Kernel patch/hack needed, for use of Ambicom BT2000 CF	adapter...
Message-ID:  <42630AE5.2070909@savvis.net>
In-Reply-To: <1113779315.669.266.camel@Mobil1.276NET>
References:  <1113779315.669.266.camel@Mobil1.276NET>

next in thread | previous in thread | raw e-mail | index | archive | help
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: <Compact Flash Bluetooth Card> 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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?42630AE5.2070909>