diff options
author | Gustavo Padovan <gustavo.padovan@collabora.co.uk> | 2012-10-12 07:35:24 -0400 |
---|---|---|
committer | Gustavo Padovan <gustavo.padovan@collabora.co.uk> | 2012-10-15 08:43:29 -0400 |
commit | 2dc4e5105f012bda7eef2f459ed3d5299ded9672 (patch) | |
tree | 2be48be9acb76a53cd37a53dec803967503c2ed8 /net/bluetooth/l2cap_core.c | |
parent | 644912e18ac1d27f57f6673b0236b568ff750fd1 (diff) |
Bluetooth: Add chan->ops->defer()
When DEFER_SETUP is set defer() will trigger an authorization
request to the userspace.
l2cap_chan_no_defer() is meant to be used when one does not want to
support DEFER_SETUP (A2MP for example).
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Diffstat (limited to 'net/bluetooth/l2cap_core.c')
-rw-r--r-- | net/bluetooth/l2cap_core.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index 9d84050bed2c..314d95580d73 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c | |||
@@ -1120,11 +1120,9 @@ static void l2cap_conn_start(struct l2cap_conn *conn) | |||
1120 | lock_sock(sk); | 1120 | lock_sock(sk); |
1121 | if (test_bit(BT_SK_DEFER_SETUP, | 1121 | if (test_bit(BT_SK_DEFER_SETUP, |
1122 | &bt_sk(sk)->flags)) { | 1122 | &bt_sk(sk)->flags)) { |
1123 | struct sock *parent = bt_sk(sk)->parent; | ||
1124 | rsp.result = __constant_cpu_to_le16(L2CAP_CR_PEND); | 1123 | rsp.result = __constant_cpu_to_le16(L2CAP_CR_PEND); |
1125 | rsp.status = __constant_cpu_to_le16(L2CAP_CS_AUTHOR_PEND); | 1124 | rsp.status = __constant_cpu_to_le16(L2CAP_CS_AUTHOR_PEND); |
1126 | if (parent) | 1125 | chan->ops->defer(chan); |
1127 | parent->sk_data_ready(parent, 0); | ||
1128 | 1126 | ||
1129 | } else { | 1127 | } else { |
1130 | __l2cap_state_change(chan, BT_CONFIG); | 1128 | __l2cap_state_change(chan, BT_CONFIG); |
@@ -3460,7 +3458,7 @@ static void __l2cap_connect(struct l2cap_conn *conn, struct l2cap_cmd_hdr *cmd, | |||
3460 | __l2cap_state_change(chan, BT_CONNECT2); | 3458 | __l2cap_state_change(chan, BT_CONNECT2); |
3461 | result = L2CAP_CR_PEND; | 3459 | result = L2CAP_CR_PEND; |
3462 | status = L2CAP_CS_AUTHOR_PEND; | 3460 | status = L2CAP_CS_AUTHOR_PEND; |
3463 | parent->sk_data_ready(parent, 0); | 3461 | chan->ops->defer(chan); |
3464 | } else { | 3462 | } else { |
3465 | __l2cap_state_change(chan, BT_CONFIG); | 3463 | __l2cap_state_change(chan, BT_CONFIG); |
3466 | result = L2CAP_CR_SUCCESS; | 3464 | result = L2CAP_CR_SUCCESS; |
@@ -5523,11 +5521,9 @@ int l2cap_security_cfm(struct hci_conn *hcon, u8 status, u8 encrypt) | |||
5523 | if (!status) { | 5521 | if (!status) { |
5524 | if (test_bit(BT_SK_DEFER_SETUP, | 5522 | if (test_bit(BT_SK_DEFER_SETUP, |
5525 | &bt_sk(sk)->flags)) { | 5523 | &bt_sk(sk)->flags)) { |
5526 | struct sock *parent = bt_sk(sk)->parent; | ||
5527 | res = L2CAP_CR_PEND; | 5524 | res = L2CAP_CR_PEND; |
5528 | stat = L2CAP_CS_AUTHOR_PEND; | 5525 | stat = L2CAP_CS_AUTHOR_PEND; |
5529 | if (parent) | 5526 | chan->ops->defer(chan); |
5530 | parent->sk_data_ready(parent, 0); | ||
5531 | } else { | 5527 | } else { |
5532 | __l2cap_state_change(chan, BT_CONFIG); | 5528 | __l2cap_state_change(chan, BT_CONFIG); |
5533 | res = L2CAP_CR_SUCCESS; | 5529 | res = L2CAP_CR_SUCCESS; |