diff options
author | Gustavo Padovan <gustavo.padovan@collabora.co.uk> | 2012-05-27 21:27:51 -0400 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2012-06-04 23:34:10 -0400 |
commit | 80b980279508edd1a92d8d77ec99b0ddad00c5fe (patch) | |
tree | 28ef9be0b618f37c3fc2b08c1114748517c3fe4a /net/bluetooth | |
parent | 3df92b31b2b593c5a067634ef2c30e76b2b2548d (diff) |
Bluetooth: Use chan as parameters for l2cap chan ops
Use chan instead of void * makes more sense here.
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth')
-rw-r--r-- | net/bluetooth/l2cap_core.c | 30 | ||||
-rw-r--r-- | net/bluetooth/l2cap_sock.c | 16 |
2 files changed, 23 insertions, 23 deletions
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index de0dc9ec9862..7edc8146db26 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c | |||
@@ -180,7 +180,7 @@ static void __l2cap_state_change(struct l2cap_chan *chan, int state) | |||
180 | state_to_string(state)); | 180 | state_to_string(state)); |
181 | 181 | ||
182 | chan->state = state; | 182 | chan->state = state; |
183 | chan->ops->state_change(chan->data, state); | 183 | chan->ops->state_change(chan, state); |
184 | } | 184 | } |
185 | 185 | ||
186 | static void l2cap_state_change(struct l2cap_chan *chan, int state) | 186 | static void l2cap_state_change(struct l2cap_chan *chan, int state) |
@@ -381,7 +381,7 @@ static void l2cap_chan_timeout(struct work_struct *work) | |||
381 | 381 | ||
382 | l2cap_chan_unlock(chan); | 382 | l2cap_chan_unlock(chan); |
383 | 383 | ||
384 | chan->ops->close(chan->data); | 384 | chan->ops->close(chan); |
385 | mutex_unlock(&conn->chan_lock); | 385 | mutex_unlock(&conn->chan_lock); |
386 | 386 | ||
387 | l2cap_chan_put(chan); | 387 | l2cap_chan_put(chan); |
@@ -569,7 +569,7 @@ static void l2cap_chan_cleanup_listen(struct sock *parent) | |||
569 | l2cap_chan_close(chan, ECONNRESET); | 569 | l2cap_chan_close(chan, ECONNRESET); |
570 | l2cap_chan_unlock(chan); | 570 | l2cap_chan_unlock(chan); |
571 | 571 | ||
572 | chan->ops->close(chan->data); | 572 | chan->ops->close(chan); |
573 | } | 573 | } |
574 | } | 574 | } |
575 | 575 | ||
@@ -1213,7 +1213,7 @@ static void l2cap_le_conn_ready(struct l2cap_conn *conn) | |||
1213 | goto clean; | 1213 | goto clean; |
1214 | } | 1214 | } |
1215 | 1215 | ||
1216 | chan = pchan->ops->new_connection(pchan->data); | 1216 | chan = pchan->ops->new_connection(pchan); |
1217 | if (!chan) | 1217 | if (!chan) |
1218 | goto clean; | 1218 | goto clean; |
1219 | 1219 | ||
@@ -1324,7 +1324,7 @@ static void l2cap_conn_del(struct hci_conn *hcon, int err) | |||
1324 | 1324 | ||
1325 | l2cap_chan_unlock(chan); | 1325 | l2cap_chan_unlock(chan); |
1326 | 1326 | ||
1327 | chan->ops->close(chan->data); | 1327 | chan->ops->close(chan); |
1328 | l2cap_chan_put(chan); | 1328 | l2cap_chan_put(chan); |
1329 | } | 1329 | } |
1330 | 1330 | ||
@@ -2568,7 +2568,7 @@ static void l2cap_raw_recv(struct l2cap_conn *conn, struct sk_buff *skb) | |||
2568 | if (!nskb) | 2568 | if (!nskb) |
2569 | continue; | 2569 | continue; |
2570 | 2570 | ||
2571 | if (chan->ops->recv(chan->data, nskb)) | 2571 | if (chan->ops->recv(chan, nskb)) |
2572 | kfree_skb(nskb); | 2572 | kfree_skb(nskb); |
2573 | } | 2573 | } |
2574 | 2574 | ||
@@ -3411,7 +3411,7 @@ static inline int l2cap_connect_req(struct l2cap_conn *conn, struct l2cap_cmd_hd | |||
3411 | goto response; | 3411 | goto response; |
3412 | } | 3412 | } |
3413 | 3413 | ||
3414 | chan = pchan->ops->new_connection(pchan->data); | 3414 | chan = pchan->ops->new_connection(pchan); |
3415 | if (!chan) | 3415 | if (!chan) |
3416 | goto response; | 3416 | goto response; |
3417 | 3417 | ||
@@ -3420,7 +3420,7 @@ static inline int l2cap_connect_req(struct l2cap_conn *conn, struct l2cap_cmd_hd | |||
3420 | /* Check if we already have channel with that dcid */ | 3420 | /* Check if we already have channel with that dcid */ |
3421 | if (__l2cap_get_chan_by_dcid(conn, scid)) { | 3421 | if (__l2cap_get_chan_by_dcid(conn, scid)) { |
3422 | sock_set_flag(sk, SOCK_ZAPPED); | 3422 | sock_set_flag(sk, SOCK_ZAPPED); |
3423 | chan->ops->close(chan->data); | 3423 | chan->ops->close(chan); |
3424 | goto response; | 3424 | goto response; |
3425 | } | 3425 | } |
3426 | 3426 | ||
@@ -3831,7 +3831,7 @@ static inline int l2cap_disconnect_req(struct l2cap_conn *conn, struct l2cap_cmd | |||
3831 | 3831 | ||
3832 | l2cap_chan_unlock(chan); | 3832 | l2cap_chan_unlock(chan); |
3833 | 3833 | ||
3834 | chan->ops->close(chan->data); | 3834 | chan->ops->close(chan); |
3835 | l2cap_chan_put(chan); | 3835 | l2cap_chan_put(chan); |
3836 | 3836 | ||
3837 | mutex_unlock(&conn->chan_lock); | 3837 | mutex_unlock(&conn->chan_lock); |
@@ -3865,7 +3865,7 @@ static inline int l2cap_disconnect_rsp(struct l2cap_conn *conn, struct l2cap_cmd | |||
3865 | 3865 | ||
3866 | l2cap_chan_unlock(chan); | 3866 | l2cap_chan_unlock(chan); |
3867 | 3867 | ||
3868 | chan->ops->close(chan->data); | 3868 | chan->ops->close(chan); |
3869 | l2cap_chan_put(chan); | 3869 | l2cap_chan_put(chan); |
3870 | 3870 | ||
3871 | mutex_unlock(&conn->chan_lock); | 3871 | mutex_unlock(&conn->chan_lock); |
@@ -4435,7 +4435,7 @@ static int l2cap_reassemble_sdu(struct l2cap_chan *chan, struct sk_buff *skb, | |||
4435 | if (chan->sdu) | 4435 | if (chan->sdu) |
4436 | break; | 4436 | break; |
4437 | 4437 | ||
4438 | err = chan->ops->recv(chan->data, skb); | 4438 | err = chan->ops->recv(chan, skb); |
4439 | break; | 4439 | break; |
4440 | 4440 | ||
4441 | case L2CAP_SAR_START: | 4441 | case L2CAP_SAR_START: |
@@ -4485,7 +4485,7 @@ static int l2cap_reassemble_sdu(struct l2cap_chan *chan, struct sk_buff *skb, | |||
4485 | if (chan->sdu->len != chan->sdu_len) | 4485 | if (chan->sdu->len != chan->sdu_len) |
4486 | break; | 4486 | break; |
4487 | 4487 | ||
4488 | err = chan->ops->recv(chan->data, chan->sdu); | 4488 | err = chan->ops->recv(chan, chan->sdu); |
4489 | 4489 | ||
4490 | if (!err) { | 4490 | if (!err) { |
4491 | /* Reassembly complete */ | 4491 | /* Reassembly complete */ |
@@ -5207,7 +5207,7 @@ static inline int l2cap_data_channel(struct l2cap_conn *conn, u16 cid, struct sk | |||
5207 | if (chan->imtu < skb->len) | 5207 | if (chan->imtu < skb->len) |
5208 | goto drop; | 5208 | goto drop; |
5209 | 5209 | ||
5210 | if (!chan->ops->recv(chan->data, skb)) | 5210 | if (!chan->ops->recv(chan, skb)) |
5211 | goto done; | 5211 | goto done; |
5212 | break; | 5212 | break; |
5213 | 5213 | ||
@@ -5246,7 +5246,7 @@ static inline int l2cap_conless_channel(struct l2cap_conn *conn, __le16 psm, str | |||
5246 | if (chan->imtu < skb->len) | 5246 | if (chan->imtu < skb->len) |
5247 | goto drop; | 5247 | goto drop; |
5248 | 5248 | ||
5249 | if (!chan->ops->recv(chan->data, skb)) | 5249 | if (!chan->ops->recv(chan, skb)) |
5250 | return 0; | 5250 | return 0; |
5251 | 5251 | ||
5252 | drop: | 5252 | drop: |
@@ -5272,7 +5272,7 @@ static inline int l2cap_att_channel(struct l2cap_conn *conn, u16 cid, | |||
5272 | if (chan->imtu < skb->len) | 5272 | if (chan->imtu < skb->len) |
5273 | goto drop; | 5273 | goto drop; |
5274 | 5274 | ||
5275 | if (!chan->ops->recv(chan->data, skb)) | 5275 | if (!chan->ops->recv(chan, skb)) |
5276 | return 0; | 5276 | return 0; |
5277 | 5277 | ||
5278 | drop: | 5278 | drop: |
diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c index d244361a455c..db787f67c52a 100644 --- a/net/bluetooth/l2cap_sock.c +++ b/net/bluetooth/l2cap_sock.c | |||
@@ -872,9 +872,9 @@ static int l2cap_sock_release(struct socket *sock) | |||
872 | return err; | 872 | return err; |
873 | } | 873 | } |
874 | 874 | ||
875 | static struct l2cap_chan *l2cap_sock_new_connection_cb(void *data) | 875 | static struct l2cap_chan *l2cap_sock_new_connection_cb(struct l2cap_chan *chan) |
876 | { | 876 | { |
877 | struct sock *sk, *parent = data; | 877 | struct sock *sk, *parent = chan->data; |
878 | 878 | ||
879 | sk = l2cap_sock_alloc(sock_net(parent), NULL, BTPROTO_L2CAP, | 879 | sk = l2cap_sock_alloc(sock_net(parent), NULL, BTPROTO_L2CAP, |
880 | GFP_ATOMIC); | 880 | GFP_ATOMIC); |
@@ -888,10 +888,10 @@ static struct l2cap_chan *l2cap_sock_new_connection_cb(void *data) | |||
888 | return l2cap_pi(sk)->chan; | 888 | return l2cap_pi(sk)->chan; |
889 | } | 889 | } |
890 | 890 | ||
891 | static int l2cap_sock_recv_cb(void *data, struct sk_buff *skb) | 891 | static int l2cap_sock_recv_cb(struct l2cap_chan *chan, struct sk_buff *skb) |
892 | { | 892 | { |
893 | int err; | 893 | int err; |
894 | struct sock *sk = data; | 894 | struct sock *sk = chan->data; |
895 | struct l2cap_pinfo *pi = l2cap_pi(sk); | 895 | struct l2cap_pinfo *pi = l2cap_pi(sk); |
896 | 896 | ||
897 | lock_sock(sk); | 897 | lock_sock(sk); |
@@ -924,16 +924,16 @@ done: | |||
924 | return err; | 924 | return err; |
925 | } | 925 | } |
926 | 926 | ||
927 | static void l2cap_sock_close_cb(void *data) | 927 | static void l2cap_sock_close_cb(struct l2cap_chan *chan) |
928 | { | 928 | { |
929 | struct sock *sk = data; | 929 | struct sock *sk = chan->data; |
930 | 930 | ||
931 | l2cap_sock_kill(sk); | 931 | l2cap_sock_kill(sk); |
932 | } | 932 | } |
933 | 933 | ||
934 | static void l2cap_sock_state_change_cb(void *data, int state) | 934 | static void l2cap_sock_state_change_cb(struct l2cap_chan *chan, int state) |
935 | { | 935 | { |
936 | struct sock *sk = data; | 936 | struct sock *sk = chan->data; |
937 | 937 | ||
938 | sk->sk_state = state; | 938 | sk->sk_state = state; |
939 | } | 939 | } |