From: Tim Hurman <kano@kano.org.uk>
To: bluez-devel@lists.sourceforge.net
Subject: [Bluez-devel] patch: new card
Date: Thu, 6 Jan 2005 14:57:23 +0000 [thread overview]
Message-ID: <20050106145723.GA10565@zorg.kano.org.uk> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 685 bytes --]
Hi,
I have attached a patch for a new card, the CC&C/Bulemonkey CF card.
Unfortunately the card silly and does not set the vendor/device IDs
properly, instead they are set to 0x0000,0x0000. I have had to create a
fudge table in /etc/pcmcia/bluetooth as this device/vendor ID is
used by hciattach. To do this I have detected the a $MANFID of "0000,0000"
and converted it to "bcsp" (the card is CSR BlueCore).
I have also added some detection for the hciattach executable as on some
platforms (notably OpenEmbedded), it does not reside in /usr/sbin/.
Finally I have also added some backup in case fuser is non existant, which
happens busybox based platforms (again OpenEmbedded).
Tim
[-- Attachment #1.2: bluez.patch --]
[-- Type: text/plain, Size: 2104 bytes --]
diff -urN bluez-utils-2.13.orig/pcmcia/bluetooth bluez-utils-2.13/pcmcia/bluetooth
--- bluez-utils-2.13.orig/pcmcia/bluetooth 2004-06-17 17:05:36.000000000 +0100
+++ bluez-utils-2.13/pcmcia/bluetooth 2005-01-06 14:43:44.000000000 +0000
@@ -19,16 +19,52 @@
get_info $DEVICE
#
+# Where are the executables
+#
+if [ -x /sbin/hciattach ]; then
+ HCIATTACH=/sbin/hciattach
+elif [ -x /usr/sbin/hciattach ]; then
+ HCIATTACH=/usr/sbin/hciattach
+elif [ -x /usr/local/sbin/hciattach ]; then
+ HCIATTACH=/usr/local/sbin/hciattach
+else
+ HCIATTACH=""
+fi
+
+#
# Serial devices
#
start_serial() {
+ if [ -z $HCIATTACH ]; then
+ log hciattach: command not found
+ return
+ fi
+
IRQ=`setserial /dev/$DEVICE | sed -e 's/.*IRQ: //'`
setserial /dev/$DEVICE irq 0 ; setserial /dev/$DEVICE irq $IRQ
-
- /usr/sbin/hciattach $DEVICE $MANFID
+
+ # some replacements - This is because hciattach only knows of a few
+ # cards. Worse, some have broken vendor/device IDs
+ case $MANFID in
+ "0000,0000")
+ # Bluemonkey/CC&C Tech bluetooth card.
+ MANFID="bcsp"
+ ;;
+ esac
+ $HCIATTACH $DEVICE $MANFID
}
stop_serial() {
do_fuser -k -HUP /dev/$DEVICE > /dev/null
+ hcilist=`ps -ef | grep hciattach | grep -v grep`
+ if [ "x$hcilist" = "x" ]; then
+ return
+ fi
+ killall $HCIATTACH > /dev/null 2>&1
+ hcilist=`ps -ef | grep hciattach | grep -v grep`
+ if [ "x$hcilist" = "x" ]; then
+ return
+ fi
+ killall hciattach > /dev/null 2>&1
}
suspend_serial() {
stop_serial
diff -urN bluez-utils-2.13.orig/pcmcia/bluetooth.conf bluez-utils-2.13/pcmcia/bluetooth.conf
--- bluez-utils-2.13.orig/pcmcia/bluetooth.conf 2004-12-25 18:06:01.000000000 +0000
+++ bluez-utils-2.13/pcmcia/bluetooth.conf 2005-01-06 14:20:54.000000000 +0000
@@ -106,3 +106,8 @@
card "Cyber-blue Compact Flash Card"
version "BT", "", "", ""
bind "btuart_cs"
+
+card "Bluetooth BT0100M"
+ version "Bluetooth BT0100M", ""
+ bind "serial_cs" class "bluetooth"
+
[-- Attachment #2: Type: application/pgp-signature, Size: 185 bytes --]
reply other threads:[~2005-01-06 14:57 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050106145723.GA10565@zorg.kano.org.uk \
--to=kano@kano.org.uk \
--cc=bluez-devel@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox