* [RFC v3] Bluetooth: Keep master role when SCO or eSCO is active
@ 2014-06-01 5:20 Kiran Kumar Raparthy
2014-06-09 6:08 ` Kiran Raparthy
0 siblings, 1 reply; 3+ messages in thread
From: Kiran Kumar Raparthy @ 2014-06-01 5:20 UTC (permalink / raw)
To: linux-kernel
Cc: hyungseoung.yoo, Marcel Holtmann, Gustavo Padovan, Johan Hedberg,
David S. Miller, linux-bluetooth, netdev, Android Kernel Team,
John Stultz, Jaikumar Ganesh, Kiran Raparthy
From: "hyungseoung.yoo" <hyungseoung.yoo@samsung.com>
Preserve the master role when SCO or eSCO is active
as this improves compatability with lots of
headset and chipset combinations.
This is one of the number of patches from the Android AOSP
common.git tree, which is used on almost all Android devices.
It looks like it would improve support for compatibility with
lot of headset,so I wanted to submit it for review to see
if it should go upstream.
v3: Fixed formatting issues pointed by Sergei
Cc: Marcel Holtmann <marcel@holtmann.org>
Cc: Gustavo Padovan <gustavo@padovan.org>
Cc: Johan Hedberg <johan.hedberg@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: linux-bluetooth@vger.kernel.org
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: Android Kernel Team <kernel-team@android.com>
Cc: John Stultz <john.stultz@linaro.org>
Signed-off-by: hyungseoung.yoo <hyungseoung.yoo@samsung.com>
Signed-off-by: Jaikumar Ganesh <jaikumarg@android.com>
[kiran: Added context to commit message]
Signed-off-by: Kiran Raparthy <kiran.kumar@linaro.org>
---
net/bluetooth/hci_event.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 15010a2..cfb1355 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -1915,6 +1915,14 @@ 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;
@@ -1961,7 +1969,9 @@ 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 */
--
1.8.2.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [RFC v3] Bluetooth: Keep master role when SCO or eSCO is active
2014-06-01 5:20 [RFC v3] Bluetooth: Keep master role when SCO or eSCO is active Kiran Kumar Raparthy
@ 2014-06-09 6:08 ` Kiran Raparthy
2014-06-23 8:35 ` Kiran Raparthy
0 siblings, 1 reply; 3+ messages in thread
From: Kiran Raparthy @ 2014-06-09 6:08 UTC (permalink / raw)
To: linux-kernel
Cc: hyungseoung.yoo, Marcel Holtmann, Gustavo Padovan, Johan Hedberg,
David S. Miller, open list:BLUETOOTH SUBSYSTEM,
open list:NETWORKING [GENERAL], Android Kernel Team, John Stultz,
Jaikumar Ganesh, Kiran Raparthy
[-- Attachment #1: Type: text/plain, Size: 2616 bytes --]
Just a reminder.
Regards,
Kiran
On 1 June 2014 10:50, Kiran Kumar Raparthy <kiran.kumar@linaro.org> wrote:
> From: "hyungseoung.yoo" <hyungseoung.yoo@samsung.com>
>
> Preserve the master role when SCO or eSCO is active
> as this improves compatability with lots of
> headset and chipset combinations.
>
> This is one of the number of patches from the Android AOSP
> common.git tree, which is used on almost all Android devices.
> It looks like it would improve support for compatibility with
> lot of headset,so I wanted to submit it for review to see
> if it should go upstream.
>
> v3: Fixed formatting issues pointed by Sergei
>
> Cc: Marcel Holtmann <marcel@holtmann.org>
> Cc: Gustavo Padovan <gustavo@padovan.org>
> Cc: Johan Hedberg <johan.hedberg@gmail.com>
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: linux-bluetooth@vger.kernel.org
> Cc: netdev@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> Cc: Android Kernel Team <kernel-team@android.com>
> Cc: John Stultz <john.stultz@linaro.org>
> Signed-off-by: hyungseoung.yoo <hyungseoung.yoo@samsung.com>
> Signed-off-by: Jaikumar Ganesh <jaikumarg@android.com>
> [kiran: Added context to commit message]
> Signed-off-by: Kiran Raparthy <kiran.kumar@linaro.org>
> ---
> net/bluetooth/hci_event.c | 12 +++++++++++-
> 1 file changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
> index 15010a2..cfb1355 100644
> --- a/net/bluetooth/hci_event.c
> +++ b/net/bluetooth/hci_event.c
> @@ -1915,6 +1915,14 @@ 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;
> @@ -1961,7 +1969,9 @@ 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 */
> --
> 1.8.2.1
>
>
[-- Attachment #2: Type: text/html, Size: 4044 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [RFC v3] Bluetooth: Keep master role when SCO or eSCO is active
2014-06-09 6:08 ` Kiran Raparthy
@ 2014-06-23 8:35 ` Kiran Raparthy
0 siblings, 0 replies; 3+ messages in thread
From: Kiran Raparthy @ 2014-06-23 8:35 UTC (permalink / raw)
To: LKML
Cc: hyungseoung.yoo, Marcel Holtmann, Gustavo Padovan, Johan Hedberg,
David S. Miller, open list:BLUETOOTH SUBSYSTEM,
open list:NETWORKING [GENERAL], Android Kernel Team, John Stultz,
Jaikumar Ganesh, Kiran Raparthy
[-- Attachment #1: Type: text/plain, Size: 2801 bytes --]
Gentle reminder.
Regards,
Kiran
On 9 June 2014 11:38, Kiran Raparthy <kiran.kumar@linaro.org> wrote:
> Just a reminder.
> Regards,
> Kiran
>
>
> On 1 June 2014 10:50, Kiran Kumar Raparthy <kiran.kumar@linaro.org> wrote:
>
>> From: "hyungseoung.yoo" <hyungseoung.yoo@samsung.com>
>>
>> Preserve the master role when SCO or eSCO is active
>> as this improves compatability with lots of
>> headset and chipset combinations.
>>
>> This is one of the number of patches from the Android AOSP
>> common.git tree, which is used on almost all Android devices.
>> It looks like it would improve support for compatibility with
>> lot of headset,so I wanted to submit it for review to see
>> if it should go upstream.
>>
>> v3: Fixed formatting issues pointed by Sergei
>>
>> Cc: Marcel Holtmann <marcel@holtmann.org>
>> Cc: Gustavo Padovan <gustavo@padovan.org>
>> Cc: Johan Hedberg <johan.hedberg@gmail.com>
>> Cc: "David S. Miller" <davem@davemloft.net>
>> Cc: linux-bluetooth@vger.kernel.org
>> Cc: netdev@vger.kernel.org
>> Cc: linux-kernel@vger.kernel.org
>> Cc: Android Kernel Team <kernel-team@android.com>
>> Cc: John Stultz <john.stultz@linaro.org>
>> Signed-off-by: hyungseoung.yoo <hyungseoung.yoo@samsung.com>
>> Signed-off-by: Jaikumar Ganesh <jaikumarg@android.com>
>> [kiran: Added context to commit message]
>> Signed-off-by: Kiran Raparthy <kiran.kumar@linaro.org>
>> ---
>> net/bluetooth/hci_event.c | 12 +++++++++++-
>> 1 file changed, 11 insertions(+), 1 deletion(-)
>>
>> diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
>> index 15010a2..cfb1355 100644
>> --- a/net/bluetooth/hci_event.c
>> +++ b/net/bluetooth/hci_event.c
>> @@ -1915,6 +1915,14 @@ 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;
>> @@ -1961,7 +1969,9 @@ 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 */
>> --
>> 1.8.2.1
>>
>>
>
[-- Attachment #2: Type: text/html, Size: 4715 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-06-23 8:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-01 5:20 [RFC v3] Bluetooth: Keep master role when SCO or eSCO is active Kiran Kumar Raparthy
2014-06-09 6:08 ` Kiran Raparthy
2014-06-23 8:35 ` Kiran Raparthy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).