rpms/kernel/F-11 git-bluetooth.patch, 1.2, 1.3 kernel.spec, 1.1600, 1.1601 git-bluetooth2.patch, 1.1, NONE git-bluetooth3.patch, 1.1, NONE

Kyle McMartin kyle at fedoraproject.org
Tue May 12 13:54:05 UTC 2009


Author: kyle

Update of /cvs/pkgs/rpms/kernel/F-11
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv30961

Modified Files:
	git-bluetooth.patch kernel.spec 
Removed Files:
	git-bluetooth2.patch git-bluetooth3.patch 
Log Message:
* Tue May 12 2009 Kyle McMartin <kyle at redhat.com> 2.6.29.3-139
- git-bluetooth.patch: suck in three more fixes from 2.6.30.


git-bluetooth.patch:

Index: git-bluetooth.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-11/git-bluetooth.patch,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -p -r1.2 -r1.3
--- git-bluetooth.patch	4 Mar 2009 15:34:03 -0000	1.2
+++ git-bluetooth.patch	12 May 2009 13:54:05 -0000	1.3
@@ -1,4 +1,256 @@
-commit b1fb06830dc870d862f7f80e276130c0ab84d59f
+commit 1e3ea965efd7fafb6b882956fe23613574dfe80e
+Author: Marcel Holtmann <marcel at holtmann.org>
+Date:   Sat May 9 12:09:21 2009 -0700
+
+    Bluetooth: Don't trigger disconnect timeout for security mode 3 pairing
+    
+    A remote device in security mode 3 that tries to connect will require
+    the pairing during the connection setup phase. The disconnect timeout
+    is now triggered within 10 milliseconds and causes the pairing to fail.
+    
+    If a connection is not fully established and a PIN code request is
+    received, don't trigger the disconnect timeout. The either successful
+    or failing connection complete event will make sure that the timeout
+    is triggered at the right time.
+    
+    The biggest problem with security mode 3 is that many Bluetooth 2.0
+    device and before use a temporary security mode 3 for dedicated
+    bonding.
+    
+    Based on a report by Johan Hedberg <johan.hedberg at nokia.com>
+    
+    Signed-off-by: Marcel Holtmann <marcel at holtmann.org>
+    Tested-by: Johan Hedberg <johan.hedberg at nokia.com>
+
+commit c5bf7426a6360fbdfc45fe25d6731733dca1e53e
+Author: Marcel Holtmann <marcel at holtmann.org>
+Date:   Sat May 9 12:04:08 2009 -0700
+
+    Bluetooth: Don't use hci_acl_connect_cancel() for incoming connections
+    
+    The connection setup phase takes around 2 seconds or longer and in
+    that time it is possible that the need for an ACL connection is no
+    longer present. If that happens then, the connection attempt will
+    be canceled.
+    
+    This only applies to outgoing connections, but currently it can also
+    be triggered by incoming connection. Don't call hci_acl_connect_cancel()
+    on incoming connection since these have to be either accepted or rejected
+    in this state. Once they are successfully connected they need to be
+    fully disconnected anyway.
+    
+    Also remove the wrong hci_acl_disconn() call for SCO and eSCO links
+    since at this stage they can't be disconnected either, because the
+    connection handle is still unknown.
+    
+    Based on a report by Johan Hedberg <johan.hedberg at nokia.com>
+    
+    Signed-off-by: Marcel Holtmann <marcel at holtmann.org>
+    Tested-by: Johan Hedberg <johan.hedberg at nokia.com>
+
+commit 17c2c44c6c6d4a060b6d77eb81a0437f50879d1a
+Author: Marcel Holtmann <marcel at holtmann.org>
+Date:   Fri May 8 18:20:43 2009 -0700
+
+    Bluetooth: Fix wrong module refcount when connection setup fails
+    
+    The module refcount is increased by hci_dev_hold() call in hci_conn_add()
+    and decreased by hci_dev_put() call in del_conn(). In case the connection
+    setup fails, hci_dev_put() is never called.
+    
+    Procedure to reproduce the issue:
+    
+      # hciconfig hci0 up
+      # lsmod | grep btusb                   -> "used by" refcount = 1
+    
+      # hcitool cc <non-exisiting bdaddr>    -> will get timeout
+    
+      # lsmod | grep btusb                   -> "used by" refcount = 2
+      # hciconfig hci0 down
+      # lsmod | grep btusb                   -> "used by" refcount = 1
+      # rmmod btusb                          -> ERROR: Module btusb is in use
+    
+    The hci_dev_put() call got moved into del_conn() with the 2.6.25 kernel
+    to fix an issue with hci_dev going away before hci_conn. However that
+    change was wrong and introduced this problem.
+    
+    When calling hci_conn_del() it has to call hci_dev_put() after freeing
+    the connection details. This handling should be fully symmetric. The
+    execution of del_conn() is done in a work queue and needs it own calls
+    to hci_dev_hold() and hci_dev_put() to ensure that the hci_dev stays
+    until the connection cleanup has been finished.
+    
+    Based on a report by Bing Zhao <bzhao at marvell.com>
+    
+    Signed-off-by: Marcel Holtmann <marcel at holtmann.org>
+    Tested-by: Bing Zhao <bzhao at marvell.com>
+
+commit 5e9f9314a7da0b3a52d23a574770dc06f7ab7318
+Author: Marcel Holtmann <marcel at holtmann.org>
+Date:   Tue Apr 28 09:04:55 2009 -0700
+
+    Bluetooth: Fix connection establishment with low security requirement
+    
+    The Bluetooth 2.1 specification introduced four different security modes
+    that can be mapped using Legacy Pairing and Simple Pairing. With the
+    usage of Simple Pairing it is required that all connections (except
+    the ones for SDP) are encrypted. So even the low security requirement
+    mandates an encrypted connection when using Simple Pairing. When using
+    Legacy Pairing (for Bluetooth 2.0 devices and older) this is not required
+    since it causes interoperability issues.
+    
+    To support this properly the low security requirement translates into
+    different host controller transactions depending if Simple Pairing is
+    supported or not. However in case of Simple Pairing the command to
+    switch on encryption after a successful authentication is not triggered
+    for the low security mode. This patch fixes this and actually makes
+    the logic to differentiate between Simple Pairing and Legacy Pairing
+    a lot simpler.
+    
+    Based on a report by Ville Tervo <ville.tervo at nokia.com>
+    
+    Signed-off-by: Marcel Holtmann <marcel at holtmann.org>
+
+commit f9a02cb37e0321844fc6532a8531dcfedc2b7dff
+Author: Marcel Holtmann <marcel at holtmann.org>
+Date:   Sun Apr 26 20:01:22 2009 +0200
+
+    Bluetooth: Add different pairing timeout for Legacy Pairing
+    
+    The Bluetooth stack uses a reference counting for all established ACL
+    links and if no user (L2CAP connection) is present, the link will be
+    terminated to save power. The problem part is the dedicated pairing
+    when using Legacy Pairing (Bluetooth 2.0 and before). At that point
+    no user is present and pairing attempts will be disconnected within
+    10 seconds or less. In previous kernel version this was not a problem
+    since the disconnect timeout wasn't triggered on incoming connections
+    for the first time. However this caused issues with broken host stacks
+    that kept the connections around after dedicated pairing. When the
+    support for Simple Pairing got added, the link establishment procedure
+    needed to be changed and now causes issues when using Legacy Pairing
+    
+    When using Simple Pairing it is possible to do a proper reference
+    counting of ACL link users. With Legacy Pairing this is not possible
+    since the specification is unclear in some areas and too many broken
+    Bluetooth devices have already been deployed. So instead of trying to
+    deal with all the broken devices, a special pairing timeout will be
+    introduced that increases the timeout to 60 seconds when pairing is
+    triggered.
+    
+    If a broken devices now puts the stack into an unforeseen state, the
+    worst that happens is the disconnect timeout triggers after 120 seconds
+    instead of 4 seconds. This allows successful pairings with legacy and
+    broken devices now.
+    
+    Based on a report by Johan Hedberg <johan.hedberg at nokia.com>
+    
+    Signed-off-by: Marcel Holtmann <marcel at holtmann.org>
+
+commit b91cd64b1639c33bc53279dd3ea78c26a8c59928
+Author: Roger Quadros <ext-roger.quadros at nokia.com>
+Date:   Thu Apr 23 14:50:54 2009 +0300
+
+    Bluetooth: Ensure that HCI sysfs add/del is preempt safe
+    
+    Use a different work_struct variables for add_conn() and del_conn() and
+    use single work queue instead of two for adding and deleting connections.
+    
+    It eliminates the following error on a preemptible kernel:
+    
+    [  204.358032] Unable to handle kernel NULL pointer dereference at virtual address 0000000c
+    [  204.370697] pgd = c0004000
+    [  204.373443] [0000000c] *pgd=00000000
+    [  204.378601] Internal error: Oops: 17 [#1] PREEMPT
+    [  204.383361] Modules linked in: vfat fat rfcomm sco l2cap sd_mod scsi_mod iphb pvr2d drm omaplfb ps
+    [  204.438537] CPU: 0    Not tainted  (2.6.28-maemo2 #1)
+    [  204.443664] PC is at klist_put+0x2c/0xb4
+    [  204.447601] LR is at klist_put+0x18/0xb4
+    [  204.451568] pc : [<c0270f08>]    lr : [<c0270ef4>]    psr: a0000113
+    [  204.451568] sp : cf1b3f10  ip : cf1b3f10  fp : cf1b3f2c
+    [  204.463104] r10: 00000000  r9 : 00000000  r8 : bf08029c
+    [  204.468353] r7 : c7869200  r6 : cfbe2690  r5 : c78692c8  r4 : 00000001
+    [  204.474945] r3 : 00000001  r2 : cf1b2000  r1 : 00000001  r0 : 00000000
+    [  204.481506] Flags: NzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM Segment kernel
+    [  204.488861] Control: 10c5387d  Table: 887fc018  DAC: 00000017
+    [  204.494628] Process btdelconn (pid: 515, stack limit = 0xcf1b22e0)
+    
+    Signed-off-by: Roger Quadros <ext-roger.quadros at nokia.com>
+    Signed-off-by: Marcel Holtmann <marcel at holtmann.org>
+
+commit d7c26bff6fb2869ff5ee6a5f5911844d559bf77f
+Author: Marcel Holtmann <marcel at holtmann.org>
+Date:   Sun Apr 19 19:30:03 2009 +0200
+
+    Bluetooth: Add workaround for wrong HCI event in eSCO setup
+    
+    The Broadcom chips with 2.1 firmware handle the fallback case to a SCO
+    link wrongly when setting up eSCO connections.
+    
+      < HCI Command: Setup Synchronous Connection (0x01|0x0028) plen 17
+          handle 11 voice setting 0x0060
+      > HCI Event: Command Status (0x0f) plen 4
+          Setup Synchronous Connection (0x01|0x0028) status 0x00 ncmd 1
+      > HCI Event: Connect Complete (0x03) plen 11
+          status 0x00 handle 1 bdaddr 00:1E:3A:xx:xx:xx type SCO encrypt 0x01
+    
+    The Link Manager negotiates the fallback to SCO, but then sends out
+    a Connect Complete event. This is wrong and the Link Manager should
+    actually send a Synchronous Connection Complete event if the Setup
+    Synchronous Connection has been used. Only the remote side is allowed
+    to use Connect Complete to indicate the missing support for eSCO in
+    the host stack.
+    
+    This patch adds a workaround for this which clearly should not be
+    needed, but reality is that broken Broadcom devices are deployed.
+    
+    Based on a report by Ville Tervo <ville.tervo at nokia.com>
+    
+    Signed-off-by: Marcel Holtman <marcel at holtmann.org>
+
+commit dd5214b3789cdeb63e4d866feba29b93c0d609b5
+Author: Marcel Holtmann <marcel at holtmann.org>
+Date:   Sun Apr 19 19:14:14 2009 +0200
+
+    Bluetooth: Fallback from eSCO to SCO on unspecified error
+    
+    Some Bluetooth chips (like the ones from Texas Instruments) don't do
+    proper eSCO negotiations inside the Link Manager. They just return an
+    error code and in case of the Kyocera ED-8800 headset it is just a
+    random error.
+    
+      < HCI Command: Setup Synchronous Connection 0x01|0x0028) plen 17
+        handle 1 voice setting 0x0060
+      > HCI Event: Command Status (0x0f) plen 4
+        Setup Synchronous Connection (0x01|0x0028) status 0x00 ncmd 1
+      > HCI Event: Synchronous Connect Complete (0x2c) plen 17
+        status 0x1f handle 257 bdaddr 00:14:0A:xx:xx:xx type eSCO
+        Error: Unspecified Error
+    
+    In these cases it is up to the host stack to fallback to a SCO setup
+    and so retry with SCO parameters.
+    
+    Based on a report by Nick Pelly <npelly at google.com>
+    
+    Signed-off-by: Marcel Holtmann <marcel at holtmann.org>
+
+commit 7441ee220db28dbba9987421de4ae7df878bbfb0
+Author: Johan Hedberg <johan.hedberg at nokia.com>
+Date:   Thu Mar 26 16:41:56 2009 +0200
+
+    Bluetooth: Fix removing of RFCOMM DLC timer with DEFER_SETUP
+    
+    There is a missing call to rfcomm_dlc_clear_timer in the case that
+    DEFER_SETUP is used and so the connection gets disconnected after the
+    timeout even if it was successfully accepted previously.
+    
+    This patch adds a call to rfcomm_dlc_clear_timer to rfcomm_dlc_accept
+    which will get called when the user accepts the connection by calling
+    read() on the socket.
+    
+    Signed-off-by: Johan Hedberg <johan.hedberg at nokia.com>
+    Signed-off-by: Marcel Holtmann <marcel at holtmann.org>
+
+commit 55294d00155240ba9008e495dcceaf255fbb9ee6
 Author: Wei Yongjun <yjwei at cn.fujitsu.com>
 Date:   Wed Feb 25 18:09:33 2009 +0800
 
@@ -9,7 +261,7 @@ Date:   Wed Feb 25 18:09:33 2009 +0800
     Signed-off-by: Wei Yongjun <yjwei at cn.fujitsu.com>
     Signed-off-by: Marcel Holtmann <marcel at holtmann.org>
 
-commit 7585b97a48180f754ebdade1be94092e36bef365
+commit c46694e3a88224e52e5a2188b84d57ae2aa02a44
 Author: Wei Yongjun <yjwei at cn.fujitsu.com>
 Date:   Wed Feb 25 18:29:52 2009 +0800
 
@@ -20,7 +272,7 @@ Date:   Wed Feb 25 18:29:52 2009 +0800
     Signed-off-by: Wei Yongjun <yjwei at cn.fujitsu.com>
     Signed-off-by: Marcel Holtmann <marcel at holtmann.org>
 
-commit 2ae9a6be5f476f3512839a4d11a8f432bfd2914c
+commit b138d79a7612a3d5dbc62115119c0db9f90b6e19
 Author: Dave Young <hidave.darkstar at gmail.com>
 Date:   Sat Feb 21 16:13:34 2009 +0800
 
@@ -227,7 +479,7 @@ Date:   Sat Feb 21 16:13:34 2009 +0800
     Signed-off-by: Dave Young <hidave.darkstar at gmail.com>
     Signed-off-by: Marcel Holtmann <marcel at holtmann.org>
 
-commit 2526d3d8b2f671a7d36cc486af984052cd5a690f
+commit fcf3f9cb7556f152f151aecee653f4d7c8bd8f18
 Author: Marcel Holtmann <marcel at holtmann.org>
 Date:   Fri Feb 20 20:54:06 2009 +0100
 
@@ -240,7 +492,7 @@ Date:   Fri Feb 20 20:54:06 2009 +0100
     Signed-off-by: Johan Hedberg <johan.hedberg at nokia.com>
     Signed-off-by: Marcel Holtmann <marcel at holtmann.org>
 
-commit 37e62f5516cfb210e64fe53457932df4341b0ad1
+commit 29c699aaa1e038177344d1eb38a347ae174ef5ec
 Author: Marcel Holtmann <marcel at holtmann.org>
 Date:   Tue Feb 17 21:49:33 2009 +0100
 
@@ -253,7 +505,7 @@ Date:   Tue Feb 17 21:49:33 2009 +0100
     
     Signed-off-by: Marcel Holtmann <marcel at holtmann.org>
 
-commit 2a517ca687232adc8f14893730644da712010ffc
+commit 1e58058c15f659ca97c38a80883c68d64ce6af79
 Author: Marcel Holtmann <marcel at holtmann.org>
 Date:   Mon Feb 16 03:20:31 2009 +0100
 
@@ -267,7 +519,7 @@ Date:   Mon Feb 16 03:20:31 2009 +0100
     
     Signed-off-by: Marcel Holtmann <marcel at holtmann.org>
 
-commit 8bf4794174659b06d43cc5e290cd384757374613
+commit 74dffad5d84eb0db0e86e99795979c6e233110f6
 Author: Marcel Holtmann <marcel at holtmann.org>
 Date:   Mon Feb 16 02:59:49 2009 +0100
 
@@ -280,7 +532,7 @@ Date:   Mon Feb 16 02:59:49 2009 +0100
     
     Signed-off-by: Marcel Holtmann <marcel at holtmann.org>
 
-commit d5f2d2be68876f65dd051b978a7b66265fde9ffd
+commit e269154213d9ed12488b925f44be1eb496125c43
 Author: Marcel Holtmann <marcel at holtmann.org>
 Date:   Mon Feb 16 02:57:30 2009 +0100
 
@@ -293,7 +545,7 @@ Date:   Mon Feb 16 02:57:30 2009 +0100
     
     Signed-off-by: Marcel Holtmann <marcel at holtmann.org>
 
-commit 96a3183322cba1a2846771b067c99b9d6f481263
+commit 0d105ec8ed68d2fc2dcecf7600daeec99d2d669c
 Author: Marcel Holtmann <marcel at holtmann.org>
 Date:   Thu Feb 12 16:23:03 2009 +0100
 
@@ -307,7 +559,7 @@ Date:   Thu Feb 12 16:23:03 2009 +0100
     
     Signed-off-by: Marcel Holtmann <marcel at holtmann.org>
 
-commit 00ae4af91d8c5b6814e2bb3bfaaf743845f989eb
+commit 33641a119177c0765420e49afcee834c83626bd2
 Author: Marcel Holtmann <marcel at holtmann.org>
 Date:   Thu Feb 12 16:19:45 2009 +0100
 
@@ -322,7 +574,7 @@ Date:   Thu Feb 12 16:19:45 2009 +0100
     
     Signed-off-by: Marcel Holtmann <marcel at holtmann.org>
 
-commit 2950f21acb0f6b8fcd964485c2ebf1e06545ac20
+commit e714c7d7337fead3ed9d0e9de4f2b9e2d6e6a3f3
 Author: Marcel Holtmann <marcel at holtmann.org>
 Date:   Thu Feb 12 14:02:50 2009 +0100
 
@@ -355,7 +607,7 @@ Date:   Thu Feb 12 14:02:50 2009 +0100
     
     Signed-off-by: Marcel Holtmann <marcel at holtmann.org>
 
-commit f29972de8e7476706ab3c01304a505e7c95d9040
+commit 6e6512b6f5abbda65ed3d27f11f681990e0f19f9
 Author: Marcel Holtmann <marcel at holtmann.org>
 Date:   Thu Feb 12 05:07:45 2009 +0100
 
@@ -373,7 +625,7 @@ Date:   Thu Feb 12 05:07:45 2009 +0100
     
     Signed-off-by: Marcel Holtmann <marcel at holtmann.org>
 
-commit e1027a7c69700301d14db03d2e049ee60c4f92df
+commit 59825c3cdfabca877a994573120a479c6e06646a
 Author: Marcel Holtmann <marcel at holtmann.org>
 Date:   Mon Feb 9 09:18:02 2009 +0100
 
@@ -387,7 +639,7 @@ Date:   Mon Feb 9 09:18:02 2009 +0100
     
     Signed-off-by: Marcel Holtmann <marcel at holtmann.org>
 
-commit 435fef20acfc48f46476abad55b0cd3aa47b8365
+commit 49fea994547a19087d962dd4e93efb0e5b40cee5
 Author: Marcel Holtmann <marcel at holtmann.org>
 Date:   Mon Feb 9 03:55:28 2009 +0100
 
@@ -408,7 +660,7 @@ Date:   Mon Feb 9 03:55:28 2009 +0100
     
     Signed-off-by: Marcel Holtmann <marcel at holtmann.org>
 
-commit 6a8d3010b313d99adbb28f1826fac0234395bb26
+commit f4befabc4c291a5f437b9845233937099e1dee05
 Author: Marcel Holtmann <marcel at holtmann.org>
 Date:   Fri Feb 6 23:56:36 2009 +0100
 
@@ -423,7 +675,7 @@ Date:   Fri Feb 6 23:56:36 2009 +0100
     
     Signed-off-by: Marcel Holtmann <marcel at holtmann.org>
 
-commit 984947dc64f82bc6cafa4d84ba1a139718f634a8
+commit fe2e4d9c758ebf18c1db55eb8f7e655845b255c4
 Author: Marcel Holtmann <marcel at holtmann.org>
 Date:   Fri Feb 6 23:35:19 2009 +0100
 
@@ -437,7 +689,7 @@ Date:   Fri Feb 6 23:35:19 2009 +0100
     
     Signed-off-by: Marcel Holtmann <marcel at holtmann.org>
 
-commit 657e17b03c80bec817975984d221bef716f83558
+commit 395c54b3da235b1827475973b95a12c153cc4600
 Author: Marcel Holtmann <marcel at holtmann.org>
 Date:   Fri Feb 6 19:45:36 2009 +0100
 
@@ -453,7 +705,7 @@ Date:   Fri Feb 6 19:45:36 2009 +0100
     
     Signed-off-by: Marcel Holtmann <marcel at holtmann.org>
 
-commit 0684e5f9fb9e3f7e168ab831dfca693bcb44805b
+commit 5a10f179e4af482474dbf9adc58ce9fae9ea6b15
 Author: Marcel Holtmann <marcel at holtmann.org>
 Date:   Mon Feb 9 02:48:38 2009 +0100
 
@@ -465,7 +717,7 @@ Date:   Mon Feb 9 02:48:38 2009 +0100
     
     Signed-off-by: Marcel Holtmann <marcel at holtmann.org>
 
-commit efc7688b557dd1be10eead7399b315efcb1dbc74
+commit 1b7c3ce31a94cce8e818a6c043f65cddae9ef047
 Author: Marcel Holtmann <marcel at holtmann.org>
 Date:   Fri Feb 6 09:13:37 2009 +0100
 
@@ -486,7 +738,7 @@ Date:   Fri Feb 6 09:13:37 2009 +0100
     
     Signed-off-by: Marcel Holtmann <marcel at holtmann.org>
 
-commit 255c76014af74165428e7aa16414b857e2bdccf2
+commit 05a0fa77ec659a5aa7608e470d3e1b359ffba314
 Author: Marcel Holtmann <marcel at holtmann.org>
 Date:   Wed Feb 4 21:07:19 2009 +0100
 
@@ -502,7 +754,7 @@ Date:   Wed Feb 4 21:07:19 2009 +0100
     
     Signed-off-by: Marcel Holtmann <marcel at holtmann.org>
 
-commit 43c2e57f94c15744495fee564610aa24602b3824
+commit 07e2928373ec26bf42a71c4a6b1e86e8db3deb7b
 Author: Marcel Holtmann <marcel at holtmann.org>
 Date:   Wed Feb 4 17:41:38 2009 +0100
 
@@ -520,7 +772,7 @@ Date:   Wed Feb 4 17:41:38 2009 +0100
     
     Signed-off-by: Marcel Holtmann <marcel at holtmann.org>
 
-commit 6e1031a40029492c10509e8c3dcac9b611438ccb
+commit 056367e0f7af33b39fa32beb4d81f47b1b505aa1
 Author: Jaikumar Ganesh <jaikumar at google.com>
 Date:   Mon Feb 2 18:03:57 2009 -0800
 
@@ -535,7 +787,7 @@ Date:   Mon Feb 2 18:03:57 2009 -0800
     Signed-off-by: Jaikumar Ganesh <jaikumar at google.com>
     Signed-off-by: Marcel Holtmann <marcel at holtmann.org>
 
-commit 34a55eda483e8177c9044f93fd2c9107f02bf1c7
+commit d242cdb6130ad02529fe5e688e8d7ae0b48301f8
 Author: Andre Haupt <andre at bitwigglers.org>
 Date:   Mon Feb 2 14:45:11 2009 -0800
 
@@ -546,7 +798,7 @@ Date:   Mon Feb 2 14:45:11 2009 -0800
     Signed-off-by: Andre Haupt <andre at bitwigglers.org>
     Signed-off-by: Marcel Holtmann <marcel at holtmann.org>
 
-commit dd2efd03b49d56ae795c71335bc7358022514c32
+commit 0fd01f772fe7ab90928084ca123f4f0df7709bbd
 Author: Dave Young <hidave.darkstar at gmail.com>
 Date:   Sat Jan 31 13:51:15 2009 +0800
 
@@ -566,7 +818,7 @@ Date:   Sat Jan 31 13:51:15 2009 +0800
     Signed-off-by: Dave Young <hidave.darkstar at gmail.com>
     Signed-off-by: Marcel Holtmann <marcel at holtmann.org>
 
-commit 5f9018af004fa8635bbbe3ab2dc61e8a686edfaa
+commit 3f4b0e5002a401ec520f39fe470a23ebe6b8e634
 Author: Marcel Holtmann <marcel at holtmann.org>
 Date:   Fri Jan 16 10:09:50 2009 +0100
 
@@ -581,7 +833,7 @@ Date:   Fri Jan 16 10:09:50 2009 +0100
     
     Signed-off-by: Marcel Holtmann <marcel at holtmann.org>
 
-commit 0588d94fd7e414367a7ae517569d2222441c255f
+commit 23094d5ee9b1ce8968c1e93ef3b59c42a57fd0cf
 Author: Marcel Holtmann <marcel at holtmann.org>
 Date:   Fri Jan 16 10:06:13 2009 +0100
 
@@ -596,7 +848,7 @@ Date:   Fri Jan 16 10:06:13 2009 +0100
     
     Signed-off-by: Marcel Holtmann <marcel at holtmann.org>
 
-commit f62e4323ab43c59e7cd7f72c1eb392d7c767ce5a
+commit 570f37485f475607cc946672302b62970e1cfdd7
 Author: Marcel Holtmann <marcel at holtmann.org>
 Date:   Thu Jan 15 21:58:44 2009 +0100
 
@@ -613,7 +865,7 @@ Date:   Thu Jan 15 21:58:44 2009 +0100
     
     Signed-off-by: Marcel Holtmann <marcel at holtmann.org>
 
-commit 8c84b83076b5062f59b6167cdda90d9e5124aa71
+commit d9cbe1221781e3eac1c7a0594def985575d56fb3
 Author: Marcel Holtmann <marcel at holtmann.org>
 Date:   Fri Jan 16 08:17:51 2009 +0100
 
@@ -634,7 +886,7 @@ Date:   Fri Jan 16 08:17:51 2009 +0100
     
     Signed-off-by: Marcel Holtmann <marcel at holtmann.org>
 
-commit 9f2c8a03fbb3048cf38b158f87aa0c3c09bca084
+commit 494b54d3b734430334b38fdc68423bc5a4112422
 Author: Marcel Holtmann <marcel at holtmann.org>
 Date:   Thu Jan 15 21:58:40 2009 +0100
 
@@ -645,7 +897,7 @@ Date:   Thu Jan 15 21:58:40 2009 +0100
     
     Signed-off-by: Marcel Holtmann <marcel at holtmann.org>
 
-commit 2af6b9d518ddfbc4d6990d5f9c9b1a05341c1cef
+commit 4a63263dc5c07f75318aded47b18a5b95cbfaab9
 Author: Marcel Holtmann <marcel at holtmann.org>
 Date:   Thu Jan 15 21:58:38 2009 +0100
 
@@ -656,7 +908,7 @@ Date:   Thu Jan 15 21:58:38 2009 +0100
     
     Signed-off-by: Marcel Holtmann <marcel at holtmann.org>
 
-commit 8c1b235594fbab9a13240a1dac12ea9fd99b6440
+commit b9849003b7f3b9a52e9d313cc5410f15c022e403
 Author: Marcel Holtmann <marcel at holtmann.org>
 Date:   Thu Jan 15 21:58:04 2009 +0100
 
@@ -692,7 +944,7 @@ Date:   Thu Jan 15 21:58:04 2009 +0100
     
     Signed-off-by: Marcel Holtmann <marcel at holtmann.org>
 
-commit c89b6e6bda4c8021195778f47567d0cc9dbfe7ec
+commit 148e04ad8caf7e613b4713aed9a3a3ae63b01ed9
 Author: Marcel Holtmann <marcel at holtmann.org>
 Date:   Thu Jan 15 21:57:03 2009 +0100
 
@@ -708,7 +960,7 @@ Date:   Thu Jan 15 21:57:03 2009 +0100
     
     Signed-off-by: Marcel Holtmann <marcel at holtmann.org>
 
-commit 71aeeaa1fd88fe7446391e0553336f0e0c2cfe6a
+commit 1d2d14c8ce227b1c2fb6584f27cfabee5a4eb3fd
 Author: Marcel Holtmann <marcel at holtmann.org>
 Date:   Thu Jan 15 21:57:02 2009 +0100
 
@@ -720,7 +972,7 @@ Date:   Thu Jan 15 21:57:02 2009 +0100
     
     Signed-off-by: Marcel Holtmann <marcel at holtmann.org>
 
-commit f66dc81f44d918ee1aa1a9d821bb2f25c7592bc0
+commit e8f4ffcd82776573bd738329be852f71a63ff1d3
 Author: Marcel Holtmann <marcel at holtmann.org>
 Date:   Thu Jan 15 21:57:00 2009 +0100
 
@@ -733,7 +985,7 @@ Date:   Thu Jan 15 21:57:00 2009 +0100
     
     Signed-off-by: Marcel Holtmann <marcel at holtmann.org>
 
-commit bb23c0ab824653be4aa7dfca15b07b3059717004
+commit 229f1d3e93e15e6d06f43a408869eb9b372d8db7
 Author: Marcel Holtmann <marcel at holtmann.org>
 Date:   Thu Jan 15 21:56:48 2009 +0100
 
@@ -749,7 +1001,7 @@ Date:   Thu Jan 15 21:56:48 2009 +0100
     
     Signed-off-by: Marcel Holtmann <marcel at holtmann.org>
 
-commit c4f912e155504e94dd4f3d63c378dab0ff03dbda
+commit e00363cd524ae1005dbf475e88d998a483137a77
 Author: Marcel Holtmann <marcel at holtmann.org>
 Date:   Thu Jan 15 21:52:16 2009 +0100
 
@@ -766,7 +1018,7 @@ Date:   Thu Jan 15 21:52:16 2009 +0100
     
     Signed-off-by: Marcel Holtmann <marcel at holtmann.org>
 
-commit d58daf42d29a3a4a4d4be46cf47ceee096789680
+commit d71f85471f699c246c6ab65042c7ddabf4b199f8
 Author: Marcel Holtmann <marcel at holtmann.org>
 Date:   Thu Jan 15 21:52:14 2009 +0100
 
@@ -780,7 +1032,7 @@ Date:   Thu Jan 15 21:52:14 2009 +0100
     
     Signed-off-by: Marcel Holtmann <marcel at holtmann.org>
 
-commit 91aa35a5aa3540223066bf6b51c935418c63a35d
+commit f1562094f31ad51a74c20ee4e7f0eba37a051d9c
 Author: Victor Shcherbatyuk <victor.shcherbatyuk at tomtom.com>
 Date:   Thu Jan 15 21:52:12 2009 +0100
 
@@ -965,10 +1217,18 @@ index a04f846..3ad5390 100644
  
  struct bt_sock_list {
 diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
-index 3645139..f69f015 100644
+index 3645139..ed3aea1 100644
 --- a/include/net/bluetooth/hci.h
 +++ b/include/net/bluetooth/hci.h
-@@ -133,8 +133,13 @@ enum {
+@@ -101,6 +101,7 @@ enum {
+ /* HCI timeouts */
+ #define HCI_CONNECT_TIMEOUT	(40000)	/* 40 seconds */
+ #define HCI_DISCONN_TIMEOUT	(2000)	/* 2 seconds */
++#define HCI_PAIRING_TIMEOUT	(60000)	/* 60 seconds */
+ #define HCI_IDLE_TIMEOUT	(6000)	/* 6 seconds */
+ #define HCI_INIT_TIMEOUT	(10000)	/* 10 seconds */
+ 
+@@ -133,8 +134,13 @@ enum {
  #define ESCO_EV3	0x0008
  #define ESCO_EV4	0x0010
  #define ESCO_EV5	0x0020
@@ -982,7 +1242,7 @@ index 3645139..f69f015 100644
  
  /* ACL flags */
  #define ACL_CONT		0x01
-@@ -176,6 +181,9 @@ enum {
+@@ -176,6 +182,9 @@ enum {
  #define LMP_EV5		0x02
  
  #define LMP_SNIFF_SUBR	0x02
@@ -993,18 +1253,30 @@ index 3645139..f69f015 100644
  #define LMP_SIMPLE_PAIR	0x08
  
 diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
-index 46a43b7..01f9316 100644
+index 46a43b7..be5bd71 100644
 --- a/include/net/bluetooth/hci_core.h
 +++ b/include/net/bluetooth/hci_core.h
-@@ -169,6 +169,7 @@ struct hci_conn {
+@@ -169,7 +169,9 @@ struct hci_conn {
  	__u16            link_policy;
  	__u32		 link_mode;
  	__u8             auth_type;
 +	__u8             sec_level;
  	__u8             power_save;
++	__u16            disc_timeout;
  	unsigned long	 pend;
  
-@@ -325,12 +326,11 @@ int hci_conn_del(struct hci_conn *conn);
+ 	unsigned int	 sent;
+@@ -179,7 +181,8 @@ struct hci_conn {
+ 	struct timer_list disc_timer;
+ 	struct timer_list idle_timer;
+ 
+-	struct work_struct work;
++	struct work_struct work_add;
++	struct work_struct work_del;
+ 
+ 	struct device	dev;
+ 
+@@ -325,12 +328,11 @@ int hci_conn_del(struct hci_conn *conn);
  void hci_conn_hash_flush(struct hci_dev *hdev);
  void hci_conn_check_pending(struct hci_dev *hdev);
  
@@ -1020,7 +1292,19 @@ index 46a43b7..01f9316 100644
  
  void hci_conn_enter_active_mode(struct hci_conn *conn);
  void hci_conn_enter_sniff_mode(struct hci_conn *conn);
-@@ -470,26 +470,26 @@ void hci_conn_del_sysfs(struct hci_conn *conn);
+@@ -348,9 +350,9 @@ static inline void hci_conn_put(struct hci_conn *conn)
+ 		if (conn->type == ACL_LINK) {
+ 			del_timer(&conn->idle_timer);
+ 			if (conn->state == BT_CONNECTED) {
+-				timeo = msecs_to_jiffies(HCI_DISCONN_TIMEOUT);
++				timeo = msecs_to_jiffies(conn->disc_timeout);
+ 				if (!conn->out)
+-					timeo *= 5;
++					timeo *= 2;
+ 			} else
+ 				timeo = msecs_to_jiffies(10);
+ 		} else
+@@ -470,26 +472,26 @@ void hci_conn_del_sysfs(struct hci_conn *conn);
  
  /* ----- HCI protocols ----- */
  struct hci_proto {
@@ -1053,7 +1337,7 @@ index 46a43b7..01f9316 100644
  	hp = hci_proto[HCI_PROTO_L2CAP];
  	if (hp && hp->connect_ind)
  		mask |= hp->connect_ind(hdev, bdaddr, type);
-@@ -514,30 +514,52 @@ static inline void hci_proto_connect_cfm(struct hci_conn *conn, __u8 status)
+@@ -514,30 +516,52 @@ static inline void hci_proto_connect_cfm(struct hci_conn *conn, __u8 status)
  		hp->connect_cfm(conn, status);
  }
  
@@ -1113,7 +1397,7 @@ index 46a43b7..01f9316 100644
  }
  
  static inline void hci_proto_encrypt_cfm(struct hci_conn *conn, __u8 status, __u8 encrypt)
-@@ -545,12 +567,12 @@ static inline void hci_proto_encrypt_cfm(struct hci_conn *conn, __u8 status, __u
+@@ -545,12 +569,12 @@ static inline void hci_proto_encrypt_cfm(struct hci_conn *conn, __u8 status, __u
  	register struct hci_proto *hp;
  
  	hp = hci_proto[HCI_PROTO_L2CAP];
@@ -1130,7 +1414,7 @@ index 46a43b7..01f9316 100644
  }
  
  int hci_register_proto(struct hci_proto *hproto);
-@@ -562,8 +584,7 @@ struct hci_cb {
+@@ -562,8 +586,7 @@ struct hci_cb {
  
  	char *name;
  
@@ -1140,7 +1424,7 @@ index 46a43b7..01f9316 100644
  	void (*key_change_cfm)	(struct hci_conn *conn, __u8 status);
  	void (*role_switch_cfm)	(struct hci_conn *conn, __u8 status, __u8 role);
  };
-@@ -571,14 +592,20 @@ struct hci_cb {
+@@ -571,14 +594,20 @@ struct hci_cb {
  static inline void hci_auth_cfm(struct hci_conn *conn, __u8 status)
  {
  	struct list_head *p;
@@ -1163,7 +1447,7 @@ index 46a43b7..01f9316 100644
  	}
  	read_unlock_bh(&hci_cb_list_lock);
  }
-@@ -587,13 +614,16 @@ static inline void hci_encrypt_cfm(struct hci_conn *conn, __u8 status, __u8 encr
+@@ -587,13 +616,16 @@ static inline void hci_encrypt_cfm(struct hci_conn *conn, __u8 status, __u8 encr
  {
  	struct list_head *p;
  
@@ -1374,7 +1658,7 @@ index c9cac77..0073ec8 100644
  
  static inline int cmtp_recv_frame(struct cmtp_session *session, struct sk_buff *skb)
 diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
-index a4a789f..1181db0 100644
+index a4a789f..8c66c9a 100644
 --- a/net/bluetooth/hci_conn.c
 +++ b/net/bluetooth/hci_conn.c
 @@ -123,6 +123,8 @@ void hci_add_sco(struct hci_conn *conn, __u16 handle)
@@ -1403,7 +1687,15 @@ index a4a789f..1181db0 100644
  
  	BT_DBG("conn %p state %d", conn, conn->state);
  
-@@ -173,7 +178,8 @@ static void hci_conn_timeout(unsigned long arg)
+@@ -166,14 +171,13 @@ static void hci_conn_timeout(unsigned long arg)
+ 	switch (conn->state) {
+ 	case BT_CONNECT:
+ 	case BT_CONNECT2:
+-		if (conn->type == ACL_LINK)
++		if (conn->type == ACL_LINK && conn->out)
+ 			hci_acl_connect_cancel(conn);
+-		else
+-			hci_acl_disconn(conn, 0x13);
  		break;
  	case BT_CONFIG:
  	case BT_CONNECTED:
@@ -1413,7 +1705,15 @@ index a4a789f..1181db0 100644
  		break;
  	default:
  		conn->state = BT_CLOSED;
-@@ -216,12 +222,13 @@ struct hci_conn *hci_conn_add(struct hci_dev *hdev, int type, bdaddr_t *dst)
+@@ -209,6 +213,7 @@ struct hci_conn *hci_conn_add(struct hci_dev *hdev, int type, bdaddr_t *dst)
+ 	conn->state = BT_OPEN;
+ 
+ 	conn->power_save = 1;
++	conn->disc_timeout = HCI_DISCONN_TIMEOUT;
+ 
+ 	switch (type) {
+ 	case ACL_LINK:
+@@ -216,12 +221,13 @@ struct hci_conn *hci_conn_add(struct hci_dev *hdev, int type, bdaddr_t *dst)
  		break;
  	case SCO_LINK:
  		if (lmp_esco_capable(hdev))
@@ -1429,16 +1729,18 @@ index a4a789f..1181db0 100644
  		break;
  	}
  
-@@ -280,6 +287,8 @@ int hci_conn_del(struct hci_conn *conn)
+@@ -280,6 +286,10 @@ int hci_conn_del(struct hci_conn *conn)
  
  	skb_queue_purge(&conn->data_q);
  
 +	hci_conn_del_sysfs(conn);
 +
++	hci_dev_put(hdev);
++
  	return 0;
  }
  
-@@ -325,7 +334,7 @@ EXPORT_SYMBOL(hci_get_route);
+@@ -325,7 +335,7 @@ EXPORT_SYMBOL(hci_get_route);
  
  /* Create SCO or ACL connection.
   * Device _must_ be locked */
@@ -1447,7 +1749,7 @@ index a4a789f..1181db0 100644
  {
  	struct hci_conn *acl;
  	struct hci_conn *sco;
-@@ -340,6 +349,7 @@ struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst, __u8
+@@ -340,6 +350,7 @@ struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst, __u8
  	hci_conn_hold(acl);
  
  	if (acl->state == BT_OPEN || acl->state == BT_CLOSED) {
@@ -1455,7 +1757,7 @@ index a4a789f..1181db0 100644
  		acl->auth_type = auth_type;
  		hci_acl_connect(acl);
  	}
-@@ -385,51 +395,59 @@ int hci_conn_check_link_mode(struct hci_conn *conn)
+@@ -385,51 +396,56 @@ int hci_conn_check_link_mode(struct hci_conn *conn)
  EXPORT_SYMBOL(hci_conn_check_link_mode);
  
  /* Authenticate remote device */
@@ -1500,12 +1802,9 @@ index a4a789f..1181db0 100644
 +	if (sec_level == BT_SECURITY_SDP)
 +		return 1;
 +
-+	if (sec_level == BT_SECURITY_LOW) {
-+		if (conn->ssp_mode > 0 && conn->hdev->ssp_mode > 0)
-+			return hci_conn_auth(conn, sec_level, auth_type);
-+		else
-+			return 1;
-+	}
++	if (sec_level == BT_SECURITY_LOW &&
++				(!conn->ssp_mode || !conn->hdev->ssp_mode))
++		return 1;
 +
  	if (conn->link_mode & HCI_LM_ENCRYPT)
 -		return hci_conn_auth(conn);
@@ -1530,7 +1829,7 @@ index a4a789f..1181db0 100644
  
  /* Change link key */
  int hci_conn_change_link_key(struct hci_conn *conn)
-@@ -442,12 +460,13 @@ int hci_conn_change_link_key(struct hci_conn *conn)
+@@ -442,12 +458,13 @@ int hci_conn_change_link_key(struct hci_conn *conn)
  		hci_send_cmd(conn->hdev, HCI_OP_CHANGE_CONN_LINK_KEY,
  							sizeof(cp), &cp);
  	}
@@ -1545,7 +1844,7 @@ index a4a789f..1181db0 100644
  {
  	BT_DBG("conn %p", conn);
  
-@@ -460,6 +479,7 @@ int hci_conn_switch_role(struct hci_conn *conn, uint8_t role)
+@@ -460,6 +477,7 @@ int hci_conn_switch_role(struct hci_conn *conn, uint8_t role)
  		cp.role = role;
  		hci_send_cmd(conn->hdev, HCI_OP_SWITCH_ROLE, sizeof(cp), &cp);
  	}
@@ -1553,7 +1852,7 @@ index a4a789f..1181db0 100644
  	return 0;
  }
  EXPORT_SYMBOL(hci_conn_switch_role);
-@@ -542,9 +562,7 @@ void hci_conn_hash_flush(struct hci_dev *hdev)
+@@ -542,9 +560,7 @@ void hci_conn_hash_flush(struct hci_dev *hdev)
  
  		c->state = BT_CLOSED;
  
@@ -1579,7 +1878,7 @@ index ba78cc1..cd06151 100644
  		if ((hdev->sent_cmd = skb_clone(skb, GFP_ATOMIC))) {
  			atomic_dec(&hdev->cmd_cnt);
 diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
-index f91ba69..5553424 100644
+index f91ba69..184ba0a 100644
 --- a/net/bluetooth/hci_event.c
 +++ b/net/bluetooth/hci_event.c
 @@ -484,6 +484,15 @@ static void hci_cc_read_local_features(struct hci_dev *hdev, struct sk_buff *skb
@@ -1598,7 +1897,34 @@ index f91ba69..5553424 100644
  	BT_DBG("%s features 0x%.2x%.2x%.2x%.2x%.2x%.2x%.2x%.2x", hdev->name,
  					hdev->features[0], hdev->features[1],
  					hdev->features[2], hdev->features[3],
-@@ -914,7 +923,8 @@ static inline void hci_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *s
+@@ -857,8 +866,16 @@ static inline void hci_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *s
+ 	hci_dev_lock(hdev);
+ 
+ 	conn = hci_conn_hash_lookup_ba(hdev, ev->link_type, &ev->bdaddr);
+-	if (!conn)
+-		goto unlock;
++	if (!conn) {
++		if (ev->link_type != SCO_LINK)
++			goto unlock;
++
++		conn = hci_conn_hash_lookup_ba(hdev, ESCO_LINK, &ev->bdaddr);
++		if (!conn)
++			goto unlock;
++
++		conn->type = SCO_LINK;
++	}
+ 
+ 	if (!ev->status) {
+ 		conn->handle = __le16_to_cpu(ev->handle);
+@@ -866,6 +883,7 @@ static inline void hci_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *s
+ 		if (conn->type == ACL_LINK) {
+ 			conn->state = BT_CONFIG;
+ 			hci_conn_hold(conn);
++			conn->disc_timeout = HCI_DISCONN_TIMEOUT;
+ 		} else
+ 			conn->state = BT_CONNECTED;
+ 
+@@ -914,7 +932,8 @@ static inline void hci_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *s
  	if (ev->status) {
  		hci_proto_connect_cfm(conn, ev->status);
  		hci_conn_del(conn);
@@ -1608,7 +1934,7 @@ index f91ba69..5553424 100644
  
  unlock:
  	hci_dev_unlock(hdev);
-@@ -1009,9 +1019,7 @@ static inline void hci_disconn_complete_evt(struct hci_dev *hdev, struct sk_buff
+@@ -1009,9 +1028,7 @@ static inline void hci_disconn_complete_evt(struct hci_dev *hdev, struct sk_buff
  	if (conn) {
  		conn->state = BT_CLOSED;
  
@@ -1619,7 +1945,67 @@ index f91ba69..5553424 100644
  		hci_conn_del(conn);
  	}
  
-@@ -1600,7 +1608,8 @@ static inline void hci_remote_ext_features_evt(struct hci_dev *hdev, struct sk_b
+@@ -1047,9 +1064,14 @@ static inline void hci_auth_complete_evt(struct hci_dev *hdev, struct sk_buff *s
+ 				hci_proto_connect_cfm(conn, ev->status);
+ 				hci_conn_put(conn);
+ 			}
+-		} else
++		} else {
+ 			hci_auth_cfm(conn, ev->status);
+ 
++			hci_conn_hold(conn);
++			conn->disc_timeout = HCI_DISCONN_TIMEOUT;
++			hci_conn_put(conn);
++		}
++
+ 		if (test_bit(HCI_CONN_ENCRYPT_PEND, &conn->pend)) {
+ 			if (!ev->status) {
+ 				struct hci_cp_set_conn_encrypt cp;
+@@ -1463,7 +1485,21 @@ static inline void hci_mode_change_evt(struct hci_dev *hdev, struct sk_buff *skb
+ 
+ static inline void hci_pin_code_request_evt(struct hci_dev *hdev, struct sk_buff *skb)
+ {
++	struct hci_ev_pin_code_req *ev = (void *) skb->data;
++	struct hci_conn *conn;
++
+ 	BT_DBG("%s", hdev->name);
++
++	hci_dev_lock(hdev);
++
++	conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr);
++	if (conn && conn->state == BT_CONNECTED) {
++		hci_conn_hold(conn);
++		conn->disc_timeout = HCI_PAIRING_TIMEOUT;
++		hci_conn_put(conn);
++	}
++
++	hci_dev_unlock(hdev);
+ }
+ 
+ static inline void hci_link_key_request_evt(struct hci_dev *hdev, struct sk_buff *skb)
+@@ -1473,7 +1509,21 @@ static inline void hci_link_key_request_evt(struct hci_dev *hdev, struct sk_buff
+ 
+ static inline void hci_link_key_notify_evt(struct hci_dev *hdev, struct sk_buff *skb)
+ {
++	struct hci_ev_link_key_notify *ev = (void *) skb->data;
++	struct hci_conn *conn;
++
+ 	BT_DBG("%s", hdev->name);
++
++	hci_dev_lock(hdev);
++
++	conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr);
++	if (conn) {
++		hci_conn_hold(conn);
++		conn->disc_timeout = HCI_DISCONN_TIMEOUT;
++		hci_conn_put(conn);
++	}
++
++	hci_dev_unlock(hdev);
+ }
+ 
+ static inline void hci_clock_offset_evt(struct hci_dev *hdev, struct sk_buff *skb)
+@@ -1600,7 +1650,8 @@ static inline void hci_remote_ext_features_evt(struct hci_dev *hdev, struct sk_b
  
  		if (conn->state == BT_CONFIG) {
  			if (!ev->status && hdev->ssp_mode > 0 &&
@@ -1629,20 +2015,151 @@ index f91ba69..5553424 100644
  				struct hci_cp_auth_requested cp;
  				cp.handle = ev->handle;
  				hci_send_cmd(hdev, HCI_OP_AUTH_REQUESTED,
-@@ -1637,6 +1646,13 @@ static inline void hci_sync_conn_complete_evt(struct hci_dev *hdev, struct sk_bu
+@@ -1637,13 +1688,28 @@ static inline void hci_sync_conn_complete_evt(struct hci_dev *hdev, struct sk_bu
  		conn->type = SCO_LINK;
  	}
  
-+	if (conn->out && ev->status == 0x1c && conn->attempt < 2) {
-+		conn->pkt_type = (hdev->esco_type & SCO_ESCO_MASK) |
+-	if (!ev->status) {
++	switch (ev->status) {
++	case 0x00:
+ 		conn->handle = __le16_to_cpu(ev->handle);
+ 		conn->state  = BT_CONNECTED;
+ 
+ 		hci_conn_add_sysfs(conn);
+-	} else
++		break;
++
++	case 0x1c:	/* SCO interval rejected */
++	case 0x1f:	/* Unspecified error */
++		if (conn->out && conn->attempt < 2) {
++			conn->pkt_type = (hdev->esco_type & SCO_ESCO_MASK) |
 +					(hdev->esco_type & EDR_ESCO_MASK);
-+		hci_setup_sync(conn, conn->link->handle);
-+		goto unlock;
++			hci_setup_sync(conn, conn->link->handle);
++			goto unlock;
++		}
++		/* fall through */
++
++	default:
+ 		conn->state = BT_CLOSED;
++		break;
 +	}
+ 
+ 	hci_proto_connect_cfm(conn, ev->status);
+ 	if (ev->status)
+diff --git a/net/bluetooth/hci_sysfs.c b/net/bluetooth/hci_sysfs.c
+index 1a1f916..41fbfa5 100644
+--- a/net/bluetooth/hci_sysfs.c
++++ b/net/bluetooth/hci_sysfs.c
+@@ -9,8 +9,7 @@
+ struct class *bt_class = NULL;
+ EXPORT_SYMBOL_GPL(bt_class);
+ 
+-static struct workqueue_struct *btaddconn;
+-static struct workqueue_struct *btdelconn;
++static struct workqueue_struct *bluetooth;
+ 
+ static inline char *link_typetostr(int type)
+ {
+@@ -88,14 +87,17 @@ static struct device_type bt_link = {
+ 
+ static void add_conn(struct work_struct *work)
+ {
+-	struct hci_conn *conn = container_of(work, struct hci_conn, work);
++	struct hci_conn *conn = container_of(work, struct hci_conn, work_add);
+ 
+-	flush_workqueue(btdelconn);
++	/* ensure previous add/del is complete */
++	flush_workqueue(bluetooth);
+ 
+ 	if (device_add(&conn->dev) < 0) {
+ 		BT_ERR("Failed to register connection device");
+ 		return;
+ 	}
 +
- 	if (!ev->status) {
- 		conn->handle = __le16_to_cpu(ev->handle);
- 		conn->state  = BT_CONNECTED;
++	hci_dev_hold(hdev);
+ }
+ 
+ void hci_conn_add_sysfs(struct hci_conn *conn)
+@@ -114,9 +116,9 @@ void hci_conn_add_sysfs(struct hci_conn *conn)
+ 
+ 	device_initialize(&conn->dev);
+ 
+-	INIT_WORK(&conn->work, add_conn);
++	INIT_WORK(&conn->work_add, add_conn);
+ 
+-	queue_work(btaddconn, &conn->work);
++	queue_work(bluetooth, &conn->work_add);
+ }
+ 
+ /*
+@@ -131,9 +133,12 @@ static int __match_tty(struct device *dev, void *data)
+ 
+ static void del_conn(struct work_struct *work)
+ {
+-	struct hci_conn *conn = container_of(work, struct hci_conn, work);
++	struct hci_conn *conn = container_of(work, struct hci_conn, work_del);
+ 	struct hci_dev *hdev = conn->hdev;
+ 
++	/* ensure previous add/del is complete */
++	flush_workqueue(bluetooth);
++
+ 	while (1) {
+ 		struct device *dev;
+ 
+@@ -146,6 +151,7 @@ static void del_conn(struct work_struct *work)
+ 
+ 	device_del(&conn->dev);
+ 	put_device(&conn->dev);
++
+ 	hci_dev_put(hdev);
+ }
+ 
+@@ -156,9 +162,9 @@ void hci_conn_del_sysfs(struct hci_conn *conn)
+ 	if (!device_is_registered(&conn->dev))
+ 		return;
+ 
+-	INIT_WORK(&conn->work, del_conn);
++	INIT_WORK(&conn->work_del, del_conn);
+ 
+-	queue_work(btdelconn, &conn->work);
++	queue_work(bluetooth, &conn->work_del);
+ }
+ 
+ static inline char *host_typetostr(int type)
+@@ -435,20 +441,13 @@ void hci_unregister_sysfs(struct hci_dev *hdev)
+ 
+ int __init bt_sysfs_init(void)
+ {
+-	btaddconn = create_singlethread_workqueue("btaddconn");
+-	if (!btaddconn)
++	bluetooth = create_singlethread_workqueue("bluetooth");
++	if (!bluetooth)
+ 		return -ENOMEM;
+ 
+-	btdelconn = create_singlethread_workqueue("btdelconn");
+-	if (!btdelconn) {
+-		destroy_workqueue(btaddconn);
+-		return -ENOMEM;
+-	}
+-
+ 	bt_class = class_create(THIS_MODULE, "bluetooth");
+ 	if (IS_ERR(bt_class)) {
+-		destroy_workqueue(btdelconn);
+-		destroy_workqueue(btaddconn);
++		destroy_workqueue(bluetooth);
+ 		return PTR_ERR(bt_class);
+ 	}
+ 
+@@ -457,8 +456,7 @@ int __init bt_sysfs_init(void)
+ 
+ void bt_sysfs_cleanup(void)
+ {
+-	destroy_workqueue(btaddconn);
+-	destroy_workqueue(btdelconn);
++	destroy_workqueue(bluetooth);
+ 
+ 	class_destroy(bt_class);
+ }
 diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c
 index b93748e..ca4d3b4 100644
 --- a/net/bluetooth/l2cap.c
@@ -2623,7 +3140,7 @@ index b93748e..ca4d3b4 100644
  };
  
 diff --git a/net/bluetooth/rfcomm/core.c b/net/bluetooth/rfcomm/core.c
-index acd84fd..1d0fb0f 100644
+index acd84fd..374536e 100644
 --- a/net/bluetooth/rfcomm/core.c
 +++ b/net/bluetooth/rfcomm/core.c
 @@ -46,7 +46,7 @@
@@ -2743,7 +3260,14 @@ index acd84fd..1d0fb0f 100644
  {
  	struct sock *sk = d->session->sock->sk;
  
-@@ -1175,12 +1199,31 @@ static void rfcomm_dlc_accept(struct rfcomm_dlc *d)
+@@ -1170,17 +1194,38 @@ static void rfcomm_dlc_accept(struct rfcomm_dlc *d)
+ 
+ 	rfcomm_send_ua(d->session, d->dlci);
+ 
++	rfcomm_dlc_clear_timer(d);
++
+ 	rfcomm_dlc_lock(d);
+ 	d->state = BT_CONNECTED;
  	d->state_change(d, 0);
  	rfcomm_dlc_unlock(d);
  
@@ -2776,7 +3300,7 @@ index acd84fd..1d0fb0f 100644
  static int rfcomm_recv_sabm(struct rfcomm_session *s, u8 dlci)
  {
  	struct rfcomm_dlc *d;
-@@ -1203,11 +1246,7 @@ static int rfcomm_recv_sabm(struct rfcomm_session *s, u8 dlci)
+@@ -1203,11 +1248,7 @@ static int rfcomm_recv_sabm(struct rfcomm_session *s, u8 dlci)
  	if (d) {
  		if (d->state == BT_OPEN) {
  			/* DLC was previously opened by PN request */
@@ -2789,7 +3313,7 @@ index acd84fd..1d0fb0f 100644
  		}
  		return 0;
  	}
-@@ -1219,11 +1258,7 @@ static int rfcomm_recv_sabm(struct rfcomm_session *s, u8 dlci)
+@@ -1219,11 +1260,7 @@ static int rfcomm_recv_sabm(struct rfcomm_session *s, u8 dlci)
  		d->addr = __addr(s->initiator, dlci);
  		rfcomm_dlc_link(s, d);
  
@@ -2802,7 +3326,7 @@ index acd84fd..1d0fb0f 100644
  	} else {
  		rfcomm_send_dm(s, dlci);
  	}
-@@ -1637,11 +1672,12 @@ static void rfcomm_process_connect(struct rfcomm_session *s)
+@@ -1637,11 +1674,12 @@ static void rfcomm_process_connect(struct rfcomm_session *s)
  		d = list_entry(p, struct rfcomm_dlc, list);
  		if (d->state == BT_CONFIG) {
  			d->mtu = s->mtu;
@@ -2818,7 +3342,7 @@ index acd84fd..1d0fb0f 100644
  		}
  	}
  }
-@@ -1717,11 +1753,17 @@ static inline void rfcomm_process_dlcs(struct rfcomm_session *s)
+@@ -1717,11 +1755,17 @@ static inline void rfcomm_process_dlcs(struct rfcomm_session *s)
  			if (d->out) {
  				rfcomm_send_pn(s, 1, d);
  				rfcomm_dlc_set_timer(d, RFCOMM_CONN_TIMEOUT);
@@ -2841,7 +3365,7 @@ index acd84fd..1d0fb0f 100644
  			}
  			continue;
  		} else if (test_and_clear_bit(RFCOMM_AUTH_REJECT, &d->flags)) {
-@@ -1734,6 +1776,9 @@ static inline void rfcomm_process_dlcs(struct rfcomm_session *s)
+@@ -1734,6 +1778,9 @@ static inline void rfcomm_process_dlcs(struct rfcomm_session *s)
  			continue;
  		}
  
@@ -2851,7 +3375,7 @@ index acd84fd..1d0fb0f 100644
  		if (test_bit(RFCOMM_TX_THROTTLED, &s->flags))
  			continue;
  
-@@ -1876,6 +1921,7 @@ static int rfcomm_add_listener(bdaddr_t *ba)
+@@ -1876,6 +1923,7 @@ static int rfcomm_add_listener(bdaddr_t *ba)
  	bacpy(&addr.l2_bdaddr, ba);
  	addr.l2_family = AF_BLUETOOTH;
  	addr.l2_psm    = htobs(RFCOMM_PSM);
@@ -2859,7 +3383,7 @@ index acd84fd..1d0fb0f 100644
  	err = kernel_bind(sock, (struct sockaddr *) &addr, sizeof(addr));
  	if (err < 0) {
  		BT_ERR("Bind failed %d", err);
-@@ -1947,42 +1993,7 @@ static int rfcomm_run(void *unused)
+@@ -1947,42 +1995,7 @@ static int rfcomm_run(void *unused)
  	return 0;
  }
  
@@ -2903,7 +3427,7 @@ index acd84fd..1d0fb0f 100644
  {
  	struct rfcomm_session *s;
  	struct rfcomm_dlc *d;
-@@ -1999,18 +2010,29 @@ static void rfcomm_encrypt_cfm(struct hci_conn *conn, u8 status, u8 encrypt)
+@@ -1999,18 +2012,29 @@ static void rfcomm_encrypt_cfm(struct hci_conn *conn, u8 status, u8 encrypt)
  	list_for_each_safe(p, n, &s->dlcs) {
  		d = list_entry(p, struct rfcomm_dlc, list);
  
@@ -2940,7 +3464,7 @@ index acd84fd..1d0fb0f 100644
  			set_bit(RFCOMM_AUTH_ACCEPT, &d->flags);
  		else
  			set_bit(RFCOMM_AUTH_REJECT, &d->flags);
-@@ -2023,8 +2045,7 @@ static void rfcomm_encrypt_cfm(struct hci_conn *conn, u8 status, u8 encrypt)
+@@ -2023,8 +2047,7 @@ static void rfcomm_encrypt_cfm(struct hci_conn *conn, u8 status, u8 encrypt)
  
  static struct hci_cb rfcomm_cb = {
  	.name		= "RFCOMM",


Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-11/kernel.spec,v
retrieving revision 1.1600
retrieving revision 1.1601
diff -u -p -r1.1600 -r1.1601
--- kernel.spec	12 May 2009 13:31:17 -0000	1.1600
+++ kernel.spec	12 May 2009 13:54:05 -0000	1.1601
@@ -586,8 +586,6 @@ Patch09: linux-2.6-upstream-reverts.patc
 # Git trees.
 Patch10: git-cpufreq.patch
 Patch11: git-bluetooth.patch
-Patch12: git-bluetooth2.patch
-Patch13: git-bluetooth3.patch
 
 # Standalone patches
 Patch20: linux-2.6-hotfixes.patch
@@ -1137,8 +1135,6 @@ fi
 
 #ApplyPatch git-cpufreq.patch
 ApplyPatch git-bluetooth.patch
-ApplyPatch git-bluetooth2.patch
-ApplyPatch git-bluetooth3.patch
 
 ApplyPatch linux-2.6-hotfixes.patch
 
@@ -1972,6 +1968,9 @@ fi
 # and build.
 
 %changelog
+* Tue May 12 2009 Kyle McMartin <kyle at redhat.com> 2.6.29.3-139
+- git-bluetooth.patch: suck in three more fixes from 2.6.30.
+
 * Tue May 12 2009 Josef Bacik <josef at toxicpanda.com>
 - bring btrfs uptodate with mainline
 


--- git-bluetooth2.patch DELETED ---


--- git-bluetooth3.patch DELETED ---




More information about the scm-commits mailing list