Skip to content

Commit

Permalink
Bluetooth: Change chan_ready param from sk to chan
Browse files Browse the repository at this point in the history
Change is needed to remove dependency on sk when possible
before introducing l2cap channel lock.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
  • Loading branch information
Andrei Emeltchenko authored and Johan Hedberg committed Feb 13, 2012
1 parent 343fb14 commit cf4cd00
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions net/bluetooth/l2cap_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -907,9 +907,9 @@ static void l2cap_le_conn_ready(struct l2cap_conn *conn)
release_sock(parent);
}

static void l2cap_chan_ready(struct sock *sk)
static void l2cap_chan_ready(struct l2cap_chan *chan)
{
struct l2cap_chan *chan = l2cap_pi(sk)->chan;
struct sock *sk = chan->sk;
struct sock *parent = bt_sk(sk)->parent;

BT_DBG("sk %p, parent %p", sk, parent);
Expand Down Expand Up @@ -945,7 +945,7 @@ static void l2cap_conn_ready(struct l2cap_conn *conn)

if (conn->hcon->type == LE_LINK) {
if (smp_conn_security(conn, chan->sec_level))
l2cap_chan_ready(sk);
l2cap_chan_ready(chan);

} else if (chan->chan_type != L2CAP_CHAN_CONN_ORIENTED) {
__clear_chan_timer(chan);
Expand Down Expand Up @@ -2874,7 +2874,7 @@ static inline int l2cap_config_req(struct l2cap_conn *conn, struct l2cap_cmd_hdr
if (chan->mode == L2CAP_MODE_ERTM)
l2cap_ertm_init(chan);

l2cap_chan_ready(sk);
l2cap_chan_ready(chan);
goto unlock;
}

Expand Down Expand Up @@ -3005,7 +3005,7 @@ static inline int l2cap_config_rsp(struct l2cap_conn *conn, struct l2cap_cmd_hdr
if (chan->mode == L2CAP_MODE_ERTM)
l2cap_ertm_init(chan);

l2cap_chan_ready(sk);
l2cap_chan_ready(chan);
}

done:
Expand Down Expand Up @@ -4524,7 +4524,7 @@ int l2cap_security_cfm(struct hci_conn *hcon, u8 status, u8 encrypt)
if (chan->scid == L2CAP_CID_LE_DATA) {
if (!status && encrypt) {
chan->sec_level = hcon->sec_level;
l2cap_chan_ready(sk);
l2cap_chan_ready(chan);
}

bh_unlock_sock(sk);
Expand Down

0 comments on commit cf4cd00

Please sign in to comment.