public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [Bluez-devel] patch: new card
@ 2005-01-06 14:57 Tim Hurman
  0 siblings, 0 replies; only message in thread
From: Tim Hurman @ 2005-01-06 14:57 UTC (permalink / raw)
  To: bluez-devel


[-- 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 --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-01-06 14:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-06 14:57 [Bluez-devel] patch: new card Tim Hurman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox