Bluetooth: host: Fix disconnect priority event handling
Fix issue is host handling of connected and disconnected event.
Since the host wants the disconnected event to be processed as a
priority event as well as in reguler event context while the connected
event is always in reguler event context we can end up in a situation
where the disconnected priority event is processed before the connected
event.
Since the disconnected priority event is there to release unack'ed TX
pending on the connection in case the RX thread is blocked waiting
for TX resources, we need to keep this behavior. Otherwise this would
be a potential deadlock of the RX thread waiting for resources that can
only be released by the RX thread.
When this situation happens we know that there cannot be any pending TX
on this connection so we can safely skip releasing of unack'ed TX.
The second thing the disconnected priority event does is marking the TX
path on the connection as disconnected. We need to do the same in this
situation, so we make sure that the TX path is already marked
disconnected when providing the connected callback to the application.
This fixes a regression from 4be66bd33d
.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
This commit is contained in:
parent
c99b7ba71c
commit
8a32c2d967
4 changed files with 53 additions and 5 deletions
|
@ -47,7 +47,9 @@ struct bt_hci_evt_hdr {
|
|||
#define BT_ACL_POINT_TO_POINT 0x00
|
||||
#define BT_ACL_BROADCAST 0x01
|
||||
|
||||
#define bt_acl_handle(h) ((h) & BIT_MASK(12))
|
||||
#define BT_ACL_HANDLE_MASK BIT_MASK(12)
|
||||
|
||||
#define bt_acl_handle(h) ((h) & BT_ACL_HANDLE_MASK)
|
||||
#define bt_acl_flags(h) ((h) >> 12)
|
||||
#define bt_acl_flags_pb(f) ((f) & BIT_MASK(2))
|
||||
#define bt_acl_flags_bc(f) ((f) >> 2)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue