Re: Headset not working (was: Belkin USB-Dongle blocks USB subsystem)

jayjwa <[email protected]> Sun, 6 Jul 2008 07:35:21 -0400
Newsgroups gmane.linux.bluez.user
Message-ID <[email protected]>

On Fri, 4 Jul 2008, Martin Mueller wrote:

-> > if i understand it right, i need the patch, but i don't know how can i get the patch. do you have a link for me?
-> 
-> You can get the patch from:
-> 
-> http://bluetooth-alsa.cvs.sourceforge.net/*checkout*/bluetooth-alsa/plugz/patches/sco-flowcontrol-v4.4.diff?revision=1.1
-> 
-> But the following section doesn't apply anymore to my 2.6.25 debian
-> kernel maybe someone knows how to fix it:
-> 
-> diff -ru linux-2.6.22-mh3/net/bluetooth/hci_conn.c linux-2.6.22-mh3-sco-flowcontrol/net/bluetooth/hci_conn.c
-> --- linux-2.6.22-mh3/net/bluetooth/hci_conn.c	2007-10-10 15:12:04.000000000 +0200
-> +++ linux-2.6.22-mh3-sco-flowcontrol/net/bluetooth/hci_conn.c	2007-10-10 14:31:19.000000000 +0200
-> 
-> @@ -208,6 +228,11 @@
-> 
->         skb_queue_head_init(&conn->data_q);
-> 
-> +       hrtimer_init(&conn->tx_timer, CLOCK_MONOTONIC, HRTIMER_NORESTART);
-> +
-> +       if(type == SCO_LINK)
-> +               conn->tx_timer.function = hci_sco_tx_timer;
-> +
->         init_timer(&conn->disc_timer);
->         conn->disc_timer.function = hci_conn_timeout;
->         conn->disc_timer.data = (unsigned long) conn;
-> @@ -217,6 +242,7 @@
->


We seem to be talking about different patches. I am refering to the one needed 
to allow older bluetooth (I think it's 1.2?) headsets to work with newer 
kernels, that deals with SCO/ESCO. The one above modifies another file. Below 
is the one I use, and it's working now even on linux-2.6.25.9 (kernel.org) 
that I'm currently using.


--- linux-2.6.23/net/bluetooth/hci_event.c.orig 2008-02-26 12:46:36.000000000 
+0900
+++ linux-2.6.23/net/bluetooth/hci_event.c      2008-02-26 12:47:23.000000000 
+0900
@@ -1313,8 +1313,15 @@
         hci_dev_lock(hdev);

         conn = hci_conn_hash_lookup_ba(hdev, ev->link_type, &ev->bdaddr);
-       if (!conn)
-               goto unlock;
+       if (!conn) {
+               __u8 link_type = (ev->link_type == ESCO_LINK) ? SCO_LINK : 
ESCO_LINK;
+
+               conn = hci_conn_hash_lookup_ba(hdev, link_type, &ev->bdaddr);
+               if (conn)
+                       conn->type = ev->link_type;
+               else
+                       goto unlock;
+       }

         if (!ev->status) {
                 conn->handle = __le16_to_cpu(ev->handle);




The email clients will probably mangle it (wrap), so I'll try to attach a 
gzipped version. If that doesn't work for some reason, I also have it on my 
ftp server 
ftp://atr2.ath.cx/pub/linux/patches/linux-kernel-bluetooth-1.2-headset-sco.patch.gz

or you can probably find it on the Web by searching for the file name 
(hci_event.c) if my server's being naughty with MSIE or curl's "@example.com" 
login.

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08

_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
linux-kernel-bluetooth-1.2-headset-sco.patch.gz (application/x-gzip, 348 B) - not displayed