diff options
author | Gustavo F. Padovan <padovan@profusion.mobi> | 2011-03-24 23:22:30 -0400 |
---|---|---|
committer | Gustavo F. Padovan <padovan@profusion.mobi> | 2011-04-07 17:06:25 -0400 |
commit | 48454079c2d4b9ee65c570a22c5fdfe1827996a4 (patch) | |
tree | 9476bb42ae7eac59ac53688a267c4cc0f7b13b86 /include/net/bluetooth | |
parent | db940cb0db7c69a217661ecd49e1e6b0d680a6cc (diff) |
Bluetooth: Create struct l2cap_chan
struct l2cap_chan cames to create a clear separation between what
properties and data belongs to the L2CAP channel and what belongs to the
socket. By now we just fold the struct sock * in struct l2cap_chan as all
the channel info is struct l2cap_pinfo today.
In the next commits we will see a move of channel stuff to struct
l2cap_chan.
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'include/net/bluetooth')
-rw-r--r-- | include/net/bluetooth/l2cap.h | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h index 2b9ca0d5c4a0..6378bcc94e2b 100644 --- a/include/net/bluetooth/l2cap.h +++ b/include/net/bluetooth/l2cap.h | |||
@@ -276,9 +276,16 @@ struct l2cap_conn_param_update_rsp { | |||
276 | #define L2CAP_CONN_PARAM_ACCEPTED 0x0000 | 276 | #define L2CAP_CONN_PARAM_ACCEPTED 0x0000 |
277 | #define L2CAP_CONN_PARAM_REJECTED 0x0001 | 277 | #define L2CAP_CONN_PARAM_REJECTED 0x0001 |
278 | 278 | ||
279 | /* ----- L2CAP connections ----- */ | 279 | /* ----- L2CAP channels and connections ----- */ |
280 | |||
281 | struct l2cap_chan { | ||
282 | struct sock *sk; | ||
283 | struct l2cap_chan *next_c; | ||
284 | struct l2cap_chan *prev_c; | ||
285 | }; | ||
286 | |||
280 | struct l2cap_chan_list { | 287 | struct l2cap_chan_list { |
281 | struct sock *head; | 288 | struct l2cap_chan *head; |
282 | rwlock_t lock; | 289 | rwlock_t lock; |
283 | }; | 290 | }; |
284 | 291 | ||
@@ -317,7 +324,7 @@ struct sock_del_list { | |||
317 | #define L2CAP_INFO_FEAT_MASK_REQ_SENT 0x04 | 324 | #define L2CAP_INFO_FEAT_MASK_REQ_SENT 0x04 |
318 | #define L2CAP_INFO_FEAT_MASK_REQ_DONE 0x08 | 325 | #define L2CAP_INFO_FEAT_MASK_REQ_DONE 0x08 |
319 | 326 | ||
320 | /* ----- L2CAP channel and socket info ----- */ | 327 | /* ----- L2CAP socket info ----- */ |
321 | #define l2cap_pi(sk) ((struct l2cap_pinfo *) sk) | 328 | #define l2cap_pi(sk) ((struct l2cap_pinfo *) sk) |
322 | #define TX_QUEUE(sk) (&l2cap_pi(sk)->tx_queue) | 329 | #define TX_QUEUE(sk) (&l2cap_pi(sk)->tx_queue) |
323 | #define SREJ_QUEUE(sk) (&l2cap_pi(sk)->srej_queue) | 330 | #define SREJ_QUEUE(sk) (&l2cap_pi(sk)->srej_queue) |
@@ -389,8 +396,7 @@ struct l2cap_pinfo { | |||
389 | struct work_struct busy_work; | 396 | struct work_struct busy_work; |
390 | struct srej_list srej_l; | 397 | struct srej_list srej_l; |
391 | struct l2cap_conn *conn; | 398 | struct l2cap_conn *conn; |
392 | struct sock *next_c; | 399 | struct l2cap_chan *chan; |
393 | struct sock *prev_c; | ||
394 | }; | 400 | }; |
395 | 401 | ||
396 | #define L2CAP_CONF_REQ_SENT 0x01 | 402 | #define L2CAP_CONF_REQ_SENT 0x01 |
@@ -471,7 +477,7 @@ void l2cap_sock_init(struct sock *sk, struct sock *parent); | |||
471 | struct sock *l2cap_sock_alloc(struct net *net, struct socket *sock, | 477 | struct sock *l2cap_sock_alloc(struct net *net, struct socket *sock, |
472 | int proto, gfp_t prio); | 478 | int proto, gfp_t prio); |
473 | void l2cap_send_disconn_req(struct l2cap_conn *conn, struct sock *sk, int err); | 479 | void l2cap_send_disconn_req(struct l2cap_conn *conn, struct sock *sk, int err); |
474 | void l2cap_chan_del(struct sock *sk, int err); | 480 | void l2cap_chan_del(struct l2cap_chan *chan, int err); |
475 | int l2cap_do_connect(struct sock *sk); | 481 | int l2cap_do_connect(struct sock *sk); |
476 | 482 | ||
477 | #endif /* __L2CAP_H */ | 483 | #endif /* __L2CAP_H */ |