* [PATCH] Bluetooth: Set different event mask for LE-only controllers
@ 2013-08-13 17:00 Marcel Holtmann
2013-08-15 8:16 ` Gustavo Padovan
2013-08-15 8:18 ` Gustavo Padovan
0 siblings, 2 replies; 3+ messages in thread
From: Marcel Holtmann @ 2013-08-13 17:00 UTC (permalink / raw)
To: linux-bluetooth
In case of a Low Energy only controller it makes no sense to configure
the full BR/EDR event mask. It will just enable events that can not be
send anyway and there is no guarantee that such a controller will accept
this value.
Use event mask 0x90 0xe8 0x04 0x02 0x00 0x80 0x00 0x20 for LE-only
controllers which enables the following events:
Disconnection Complete
Encryption Change
Read Remote Version Information Complete
Command Complete
Command Status
Hardware Error
Number of Completed Packets
Data Buffer Overflow
Encryption Key Refresh Complete
LE Meta
This is according to Core Specification, Part E, Section 3.
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
---
net/bluetooth/hci_core.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index b821b19..8d9b87d 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -454,6 +454,18 @@ static void hci_setup_event_mask(struct hci_request *req)
events[4] |= 0x04; /* Read Remote Extended Features Complete */
events[5] |= 0x08; /* Synchronous Connection Complete */
events[5] |= 0x10; /* Synchronous Connection Changed */
+ } else {
+ /* Use a different default for LE-only devices */
+ memset(events, 0, sizeof(events));
+ events[0] |= 0x10; /* Disconnection Complete */
+ events[0] |= 0x80; /* Encryption Change */
+ events[1] |= 0x08; /* Read Remote Version Information Complete */
+ events[1] |= 0x20; /* Command Complete */
+ events[1] |= 0x40; /* Command Status */
+ events[1] |= 0x80; /* Hardware Error */
+ events[2] |= 0x04; /* Number of Completed Packets */
+ events[3] |= 0x02; /* Data Buffer Overflow */
+ events[5] |= 0x80; /* Encryption Key Refresh Complete */
}
if (lmp_inq_rssi_capable(hdev))
--
1.8.3.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Bluetooth: Set different event mask for LE-only controllers
2013-08-13 17:00 [PATCH] Bluetooth: Set different event mask for LE-only controllers Marcel Holtmann
@ 2013-08-15 8:16 ` Gustavo Padovan
2013-08-15 8:18 ` Gustavo Padovan
1 sibling, 0 replies; 3+ messages in thread
From: Gustavo Padovan @ 2013-08-15 8:16 UTC (permalink / raw)
To: Marcel Holtmann; +Cc: linux-bluetooth
Hi Marcel,
* Marcel Holtmann <marcel@holtmann.org> [2013-08-13 10:00:54 -0700]:
> In case of a Low Energy only controller it makes no sense to configure
> the full BR/EDR event mask. It will just enable events that can not be
> send anyway and there is no guarantee that such a controller will accept
> this value.
>
> Use event mask 0x90 0xe8 0x04 0x02 0x00 0x80 0x00 0x20 for LE-only
> controllers which enables the following events:
>
> Disconnection Complete
> Encryption Change
> Read Remote Version Information Complete
> Command Complete
> Command Status
> Hardware Error
> Number of Completed Packets
> Data Buffer Overflow
> Encryption Key Refresh Complete
> LE Meta
>
> This is according to Core Specification, Part E, Section 3.
>
> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
> ---
> net/bluetooth/hci_core.c | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
Patch has been applied to bluetooth-next. Thanks.
Gustavo
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Bluetooth: Set different event mask for LE-only controllers
2013-08-13 17:00 [PATCH] Bluetooth: Set different event mask for LE-only controllers Marcel Holtmann
2013-08-15 8:16 ` Gustavo Padovan
@ 2013-08-15 8:18 ` Gustavo Padovan
1 sibling, 0 replies; 3+ messages in thread
From: Gustavo Padovan @ 2013-08-15 8:18 UTC (permalink / raw)
To: Marcel Holtmann; +Cc: linux-bluetooth
Hi Marcel,
* Marcel Holtmann <marcel@holtmann.org> [2013-08-13 10:00:54 -0700]:
> In case of a Low Energy only controller it makes no sense to configure
> the full BR/EDR event mask. It will just enable events that can not be
> send anyway and there is no guarantee that such a controller will accept
> this value.
>
> Use event mask 0x90 0xe8 0x04 0x02 0x00 0x80 0x00 0x20 for LE-only
> controllers which enables the following events:
>
> Disconnection Complete
> Encryption Change
> Read Remote Version Information Complete
> Command Complete
> Command Status
> Hardware Error
> Number of Completed Packets
> Data Buffer Overflow
> Encryption Key Refresh Complete
> LE Meta
>
> This is according to Core Specification, Part E, Section 3.
>
> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
> ---
> net/bluetooth/hci_core.c | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
Patch has been applied to bluetooth-next. Thanks.
Gustavo
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-08-15 8:18 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-13 17:00 [PATCH] Bluetooth: Set different event mask for LE-only controllers Marcel Holtmann
2013-08-15 8:16 ` Gustavo Padovan
2013-08-15 8:18 ` Gustavo Padovan
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.