Bluetooth: Allow AMP move to wait for Cfm Rsp before LL complete

It is possible for the AMP move state to become WAIT_CONFIRM_RSP
before the logical link complete handler runs, so must allow
that state in the handler.

This fixes an issue where the move to AMP fails when moving a
second channel onto an existing logical link. In this case
the move responses are received from the remote very close
together (because there is no logical link to create) and they
are processed (and the state changed to WAIT_CONFIRM_RSP) before
the logical link complete handler runs on the work queue.

Change-Id: I0fc33c3e447ec8bd0009db406622adfc1cd83429
CRs-fixed: 348299
Signed-off-by: Peter Krystad <pkrystad@codeaurora.org>
This commit is contained in:
Peter Krystad 2012-04-03 16:06:17 -07:00 committed by Stephen Boyd
parent ffbdb5f0b3
commit 6b58ed23c7

View file

@ -5465,7 +5465,9 @@ int l2cap_logical_link_complete(struct hci_chan *chan, u8 status)
} else if ((pi->amp_move_state !=
L2CAP_AMP_STATE_WAIT_MOVE_RSP_SUCCESS) &&
(pi->amp_move_state !=
L2CAP_AMP_STATE_WAIT_MOVE_CONFIRM)) {
L2CAP_AMP_STATE_WAIT_MOVE_CONFIRM) &&
(pi->amp_move_state !=
L2CAP_AMP_STATE_WAIT_MOVE_CONFIRM_RSP)) {
/* Move was not in expected state, free the channel */
ampchan = pi->ampchan;
ampcon = pi->ampcon;