Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 341547
b: refs/heads/master
c: 62748ca
h: refs/heads/master
i:
  341545: 7a64281
  341543: 45aa4dc
v: v3
  • Loading branch information
Andrei Emeltchenko authored and Gustavo Padovan committed Nov 20, 2012
1 parent b9bd157 commit e3ecc76
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d1244adc4281eb983a7f41b753164233a7b16b55
refs/heads/master: 62748ca16f2f79a62d90fb45963233fb10f726c4
29 changes: 18 additions & 11 deletions trunk/net/bluetooth/l2cap_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -4517,15 +4517,31 @@ void l2cap_move_start(struct l2cap_chan *chan)
static void l2cap_do_create(struct l2cap_chan *chan, int result,
u8 local_amp_id, u8 remote_amp_id)
{
BT_DBG("chan %p state %s %u -> %u", chan, state_to_string(chan->state),
local_amp_id, remote_amp_id);

chan->fcs = L2CAP_FCS_NONE;

if (!test_bit(CONF_CONNECT_PEND, &chan->conf_state)) {
/* Outgoing channel on AMP */
if (chan->state == BT_CONNECT) {
if (result == L2CAP_CR_SUCCESS) {
chan->local_amp_id = local_amp_id;
l2cap_send_create_chan_req(chan, remote_amp_id);
} else {
/* Revert to BR/EDR connect */
l2cap_send_conn_req(chan);
}

return;
}

/* Incoming channel on AMP */
if (__l2cap_no_conn_pending(chan)) {
struct l2cap_conn_rsp rsp;
char buf[128];
rsp.scid = cpu_to_le16(chan->dcid);
rsp.dcid = cpu_to_le16(chan->scid);

/* Incoming channel on AMP */
if (result == L2CAP_CR_SUCCESS) {
/* Send successful response */
rsp.result = __constant_cpu_to_le16(L2CAP_CR_SUCCESS);
Expand All @@ -4547,15 +4563,6 @@ static void l2cap_do_create(struct l2cap_chan *chan, int result,
l2cap_build_conf_req(chan, buf), buf);
chan->num_conf_req++;
}
} else {
/* Outgoing channel on AMP */
if (result == L2CAP_CR_SUCCESS) {
chan->local_amp_id = local_amp_id;
l2cap_send_create_chan_req(chan, remote_amp_id);
} else {
/* Revert to BR/EDR connect */
l2cap_send_conn_req(chan);
}
}
}

Expand Down

0 comments on commit e3ecc76

Please sign in to comment.