Remove holding the AMP manger list lock when sending the
A2MP Change Notify message, as this uses L2CAP and will
lock the socket and possibly sleep.
This removes a potential deadlock and a "BUG: sleeping
function called from invalid context" message from the
kernel log.
Change-Id: Icf8c5afc1a5cde36517bb979820c83a20ee207fd
CRs-fixed: 358736
Signed-off-by: Peter Krystad <pkrystad@codeaurora.org>
Take a reference on the hci_conn and do not de-reference l2cap_conn
while setting up the A2MP fixed channel. l2cap_conn is not reference
counted and may go away before the channel is set up.
This fixes scenario where the ACL disconnects (and l2cap_conn goes
away) while amp_conn_ind worker is running or is on the workqueue
waiting to run.
Change-Id: I10fc6d9b146fcc5e010f26a046f7e0570f2b93dd
CRs-fixed: 347079
Signed-off-by: Peter Krystad <pkrystad@codeaurora.org>
Ensure the full A2MP Get Info Response message is pulled from the
skb when the status is not SUCCESS. Also fix similiar scenario in
Get AMP Assoc and remove unneeded check for mismatched id's.
Change-Id: Ia676d89238113e24f06aaa5d9e955afcc4de0307
Signed-off-by: Peter Krystad <pkrystad@codeaurora.org>
Previously an offset was added to the hci dev number to generate the
AMP controller ID, because it was possible for the PAL to register
as hci0, and 0 is invalid for an AMP controller ID. Since this commit
462bf76d294a480c775a040476bd7eb81f718ec2 it is not possible for
the PAL to register as hci0, so this offset is no longer necessary.
Change-Id: I4b01ddca5fad3aebeb4c138b5aee8819bb146f3d
Signed-off-by: Peter Krystad <pkrystad@codeaurora.org>
In three places a reference was taken without being returned.
Change-Id: I15b9ab7de530a77832d8b10fe756cfdf0b01760f
Signed-off-by: Peter Krystad <pkrystad@codeaurora.org>
Since all AMP Manager processing is done on work queues no
bottom-half locking is required.
CRs-fixed: 318632
Change-Id: I3a07c412ccf30d62d68cc80124fad5700bcc0917
Signed-off-by: Peter Krystad <pkrystad@codeaurora.org>
Using the reference count ensures that the socket pointer passed to
the AMP manager remains valid.
Change-Id: I5b9cd4bdf25350f1daa436be2723745f57de0706
Signed-off-by: Mat Martineau <mathewm@codeaurora.org>
A2MP Create Physical Link requests must be processed sequentially. When
one is received while processing another defer it until the first one
is finished.
Change-Id: I83ff970e6d26372eb5e609885e5620ee87a79b9f
Signed-off-by: Peter Krystad <pkrystad@codeaurora.org>
CRs-fixed: 290103, 292790
BT 3.0 spec states MTU and MPS for A2MP fixed channel are to be
equal.
Change-Id: Iad068234c2f5393c96b2ae33d0b7b65e09683e36
Signed-off-by: Peter Krystad <pkrystad@codeaurora.org>
Changes made for BT 4.0 mean the A2MP CID must be set before
kernel_bind() and kernel_connect() are used to create the A2MP
kernel socket.
Change-Id: Ie0d471701f0f323bd589b1f92b3044ab91537ec8
Signed-off-by: Peter Krystad <pkrystad@codeaurora.org>
BT 3.0+HS spec requires that encryption be enabled on the BR-EDR ACL
link before any AMP links may be created.
CRs-fixed: 288818
Signed-off-by: Peter Krystad <pkrystad@codeaurora.org>
The A2MP Discover response may contain a variable length
feature mask field, which is extended by setting a bit every
two octets. Previously it was assumed this field was a fixed
size of 2 octets.
CRs-fixed: 285775
Change-Id: Iec5eab15c84c572530900b6e5028125a85bc0492
Signed-off-by: Peter Krystad <pkrystad@codeaurora.org>
When an AMP Manager initiating a Physical Link receives the A2MP
Create Physical Link response message from the remote device it has
already started the physical link creation process with the local
AMP Controller. It should cancel this creation process if the remote
device indicates it will not accept the link.
Change-Id: I4dc67cf5f798347ace7030a94e0a50b0e74f93be
Signed-off-by: Mat Martineau <mathewm@codeaurora.org>
The A2MP Discover response may contain a variable length
feature mask field, which is extended by setting a bit every
two octets. Previously it was assumed this field was a fixed
size of 2 octets.
Change-Id: I768d2a8d883fde293d46acdf7a6b36b185ecaa95
Signed-off-by: Mat Martineau <mathewm@codeaurora.org>
Bluetooth 3.0+HS depends on an AMP manager to coordinate the setup and
teardown of AMP physical and logical links using the A2MP protocol.
There are also new L2CAP signals that allow two Bluetooth devices to
move L2CAP channels to and from a high-speed link, and a new socket
option for applications to use to control the type of Bluetooth link
used for L2CAP traffic.
Change-Id: I98067e0781b31f5d694e7b7da5cf5006dc21f514
Signed-off-by: Mat Martineau <mathewm@codeaurora.org>