summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorhyungseoung.yoo <hyungseoung.yoo@samsung.com>2011-11-18 13:57:01 +0900
committerJohn Stultz <john.stultz@linaro.org>2012-08-10 15:47:15 -0400
commit75f92074211762c94558abe046863ec820d52294 (patch)
tree599422f06fb068997498dc6edd5f90392dbdb662 /net
parenta8a2f25b9574acd01d2298791055aa2cd636c807 (diff)
Bluetooth: Keep master role when SCO or eSCO is active
This improves compatbility with a lot of headset / chipset combinations. Ideally this should not be needed. Change-Id: I8b676701e12e416aa7d60801b9d353b15d102709 Signed-off-by: hyungseoung.yoo <hyungseoung.yoo@samsung.com> Signed-off-by: Jaikumar Ganesh <jaikumarg@android.com>
Diffstat (limited to 'net')
-rwxr-xr-x[-rw-r--r--]net/bluetooth/hci_event.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 2f87347f3aff..1f7c675a9df9 100644..100755
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -1813,6 +1813,15 @@ unlock:
hci_conn_check_pending(hdev);
}
+static inline bool is_sco_active(struct hci_dev *hdev)
+{
+ if (hci_conn_hash_lookup_state(hdev, SCO_LINK, BT_CONNECTED) ||
+ (hci_conn_hash_lookup_state(hdev, ESCO_LINK,
+ BT_CONNECTED)))
+ return true;
+ return false;
+}
+
static void hci_conn_request_evt(struct hci_dev *hdev, struct sk_buff *skb)
{
struct hci_ev_conn_request *ev = (void *) skb->data;
@@ -1856,7 +1865,8 @@ static void hci_conn_request_evt(struct hci_dev *hdev, struct sk_buff *skb)
bacpy(&cp.bdaddr, &ev->bdaddr);
- if (lmp_rswitch_capable(hdev) && (mask & HCI_LM_MASTER))
+ if (lmp_rswitch_capable(hdev) && ((mask & HCI_LM_MASTER)
+ || is_sco_active(hdev)))
cp.role = 0x00; /* Become master */
else
cp.role = 0x01; /* Remain slave */