Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 291067
b: refs/heads/master
c: 9b27f35
h: refs/heads/master
i:
  291065: 0892574
  291063: af45226
v: v3
  • Loading branch information
Andrei Emeltchenko authored and Johan Hedberg committed Feb 24, 2012
1 parent d50e6b1 commit ff9591b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 31 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: 5b4cedaa14bd1fe3ca1d59c684203a6ae7747faa
refs/heads/master: 9b27f350688c9399da10c2b888c4044c2c1bd923
49 changes: 19 additions & 30 deletions trunk/net/bluetooth/l2cap_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,21 @@ static inline int __l2cap_no_conn_pending(struct l2cap_chan *chan)
return !test_bit(CONF_CONNECT_PEND, &chan->conf_state);
}

static void l2cap_send_conn_req(struct l2cap_chan *chan)
{
struct l2cap_conn *conn = chan->conn;
struct l2cap_conn_req req;

req.scid = cpu_to_le16(chan->scid);
req.psm = chan->psm;

chan->ident = l2cap_get_ident(conn);

set_bit(CONF_CONNECT_PEND, &chan->conf_state);

l2cap_send_cmd(conn, chan->ident, L2CAP_CONN_REQ, sizeof(req), &req);
}

static void l2cap_do_start(struct l2cap_chan *chan)
{
struct l2cap_conn *conn = chan->conn;
Expand All @@ -676,17 +691,8 @@ static void l2cap_do_start(struct l2cap_chan *chan)
return;

if (l2cap_chan_check_security(chan) &&
__l2cap_no_conn_pending(chan)) {
struct l2cap_conn_req req;
req.scid = cpu_to_le16(chan->scid);
req.psm = chan->psm;

chan->ident = l2cap_get_ident(conn);
set_bit(CONF_CONNECT_PEND, &chan->conf_state);

l2cap_send_cmd(conn, chan->ident, L2CAP_CONN_REQ,
sizeof(req), &req);
}
__l2cap_no_conn_pending(chan))
l2cap_send_conn_req(chan);
} else {
struct l2cap_info_req req;
req.type = cpu_to_le16(L2CAP_IT_FEAT_MASK);
Expand Down Expand Up @@ -763,8 +769,6 @@ static void l2cap_conn_start(struct l2cap_conn *conn)
}

if (chan->state == BT_CONNECT) {
struct l2cap_conn_req req;

if (!l2cap_chan_check_security(chan) ||
!__l2cap_no_conn_pending(chan)) {
l2cap_chan_unlock(chan);
Expand All @@ -779,14 +783,7 @@ static void l2cap_conn_start(struct l2cap_conn *conn)
continue;
}

req.scid = cpu_to_le16(chan->scid);
req.psm = chan->psm;

chan->ident = l2cap_get_ident(conn);
set_bit(CONF_CONNECT_PEND, &chan->conf_state);

l2cap_send_cmd(conn, chan->ident, L2CAP_CONN_REQ,
sizeof(req), &req);
l2cap_send_conn_req(chan);

} else if (chan->state == BT_CONNECT2) {
struct l2cap_conn_rsp rsp;
Expand Down Expand Up @@ -4593,15 +4590,7 @@ int l2cap_security_cfm(struct hci_conn *hcon, u8 status, u8 encrypt)

if (chan->state == BT_CONNECT) {
if (!status) {
struct l2cap_conn_req req;
req.scid = cpu_to_le16(chan->scid);
req.psm = chan->psm;

chan->ident = l2cap_get_ident(conn);
set_bit(CONF_CONNECT_PEND, &chan->conf_state);

l2cap_send_cmd(conn, chan->ident,
L2CAP_CONN_REQ, sizeof(req), &req);
l2cap_send_conn_req(chan);
} else {
__clear_chan_timer(chan);
__set_chan_timer(chan,
Expand Down

0 comments on commit ff9591b

Please sign in to comment.