diff options
author | Gustavo F. Padovan <padovan@profusion.mobi> | 2011-03-25 18:58:34 -0400 |
---|---|---|
committer | Gustavo F. Padovan <padovan@profusion.mobi> | 2011-04-07 17:06:26 -0400 |
commit | 42e5c8027bad6f1591032941f0ebf4fc079405c8 (patch) | |
tree | c0f95eca98dafd0104f01b3967cd7f1d643bcfe3 /include/net/bluetooth | |
parent | 525cd1851b9faaadf5ea33e05192b8d22f42487e (diff) |
Bluetooth: Move of ERTM *_seq vars to struct l2cap_chan
As part of the moving channel to 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 | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h index 82d5b81a779b..9b43874ca6e4 100644 --- a/include/net/bluetooth/l2cap.h +++ b/include/net/bluetooth/l2cap.h | |||
@@ -288,6 +288,12 @@ struct l2cap_chan { | |||
288 | 288 | ||
289 | __u16 conn_state; | 289 | __u16 conn_state; |
290 | 290 | ||
291 | __u8 next_tx_seq; | ||
292 | __u8 expected_ack_seq; | ||
293 | __u8 expected_tx_seq; | ||
294 | __u8 buffer_seq; | ||
295 | __u8 buffer_seq_srej; | ||
296 | |||
291 | struct list_head list; | 297 | struct list_head list; |
292 | }; | 298 | }; |
293 | 299 | ||
@@ -353,11 +359,6 @@ struct l2cap_pinfo { | |||
353 | 359 | ||
354 | __u8 conf_state; | 360 | __u8 conf_state; |
355 | 361 | ||
356 | __u8 next_tx_seq; | ||
357 | __u8 expected_ack_seq; | ||
358 | __u8 expected_tx_seq; | ||
359 | __u8 buffer_seq; | ||
360 | __u8 buffer_seq_srej; | ||
361 | __u8 srej_save_reqseq; | 362 | __u8 srej_save_reqseq; |
362 | __u8 frames_sent; | 363 | __u8 frames_sent; |
363 | __u8 unacked_frames; | 364 | __u8 unacked_frames; |
@@ -421,17 +422,16 @@ struct l2cap_pinfo { | |||
421 | #define __mod_ack_timer() mod_timer(&l2cap_pi(sk)->ack_timer, \ | 422 | #define __mod_ack_timer() mod_timer(&l2cap_pi(sk)->ack_timer, \ |
422 | jiffies + msecs_to_jiffies(L2CAP_DEFAULT_ACK_TO)); | 423 | jiffies + msecs_to_jiffies(L2CAP_DEFAULT_ACK_TO)); |
423 | 424 | ||
424 | static inline int l2cap_tx_window_full(struct sock *sk) | 425 | static inline int l2cap_tx_window_full(struct l2cap_chan *ch) |
425 | { | 426 | { |
426 | struct l2cap_pinfo *pi = l2cap_pi(sk); | ||
427 | int sub; | 427 | int sub; |
428 | 428 | ||
429 | sub = (pi->next_tx_seq - pi->expected_ack_seq) % 64; | 429 | sub = (ch->next_tx_seq - ch->expected_ack_seq) % 64; |
430 | 430 | ||
431 | if (sub < 0) | 431 | if (sub < 0) |
432 | sub += 64; | 432 | sub += 64; |
433 | 433 | ||
434 | return sub == pi->remote_tx_win; | 434 | return sub == l2cap_pi(ch->sk)->remote_tx_win; |
435 | } | 435 | } |
436 | 436 | ||
437 | #define __get_txseq(ctrl) (((ctrl) & L2CAP_CTRL_TXSEQ) >> 1) | 437 | #define __get_txseq(ctrl) (((ctrl) & L2CAP_CTRL_TXSEQ) >> 1) |
@@ -456,7 +456,7 @@ struct sk_buff *l2cap_create_basic_pdu(struct sock *sk, struct msghdr *msg, size | |||
456 | struct sk_buff *l2cap_create_iframe_pdu(struct sock *sk, struct msghdr *msg, size_t len, u16 control, u16 sdulen); | 456 | struct sk_buff *l2cap_create_iframe_pdu(struct sock *sk, struct msghdr *msg, size_t len, u16 control, u16 sdulen); |
457 | int l2cap_sar_segment_sdu(struct sock *sk, struct msghdr *msg, size_t len); | 457 | int l2cap_sar_segment_sdu(struct sock *sk, struct msghdr *msg, size_t len); |
458 | void l2cap_do_send(struct sock *sk, struct sk_buff *skb); | 458 | void l2cap_do_send(struct sock *sk, struct sk_buff *skb); |
459 | void l2cap_streaming_send(struct sock *sk); | 459 | void l2cap_streaming_send(struct l2cap_chan *chan); |
460 | int l2cap_ertm_send(struct l2cap_chan *chan); | 460 | int l2cap_ertm_send(struct l2cap_chan *chan); |
461 | 461 | ||
462 | void l2cap_sock_set_timer(struct sock *sk, long timeout); | 462 | void l2cap_sock_set_timer(struct sock *sk, long timeout); |