diff options
author | Gustavo F. Padovan <gustavo@las.ic.unicamp.br> | 2009-08-20 21:26:03 -0400 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2009-08-22 18:01:25 -0400 |
commit | 8f17154f1f70fcc6faa31ac82164fcf7f0599f38 (patch) | |
tree | f210dae590f600720b974d367082c368d03eac86 /include | |
parent | fcc203c30d72dde82692f6b761a80e5ca5fdd8fa (diff) |
Bluetooth: Add support for L2CAP SREJ exception
When L2CAP loses an I-frame we send a SREJ frame to the transmitter side
requesting the lost packet. This patch implement all Recv I-frame events
on SREJ_SENT state table except the ones that deal with SendRej (the REJ
exception at receiver side is yet not implemented).
Signed-off-by: Gustavo F. Padovan <gustavo@las.ic.unicamp.br>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/net/bluetooth/bluetooth.h | 1 | ||||
-rw-r--r-- | include/net/bluetooth/l2cap.h | 14 |
2 files changed, 14 insertions, 1 deletions
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h index b8b9a8479525..718394e2c01e 100644 --- a/include/net/bluetooth/bluetooth.h +++ b/include/net/bluetooth/bluetooth.h | |||
@@ -140,6 +140,7 @@ struct bt_skb_cb { | |||
140 | __u8 incoming; | 140 | __u8 incoming; |
141 | __u8 tx_seq; | 141 | __u8 tx_seq; |
142 | __u8 retries; | 142 | __u8 retries; |
143 | __u8 sar; | ||
143 | }; | 144 | }; |
144 | #define bt_cb(skb) ((struct bt_skb_cb *)((skb)->cb)) | 145 | #define bt_cb(skb) ((struct bt_skb_cb *)((skb)->cb)) |
145 | 146 | ||
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h index 59b26bf10f30..9f2126a4f6f5 100644 --- a/include/net/bluetooth/l2cap.h +++ b/include/net/bluetooth/l2cap.h | |||
@@ -108,6 +108,7 @@ struct l2cap_conninfo { | |||
108 | 108 | ||
109 | #define L2CAP_CTRL_TXSEQ_SHIFT 1 | 109 | #define L2CAP_CTRL_TXSEQ_SHIFT 1 |
110 | #define L2CAP_CTRL_REQSEQ_SHIFT 8 | 110 | #define L2CAP_CTRL_REQSEQ_SHIFT 8 |
111 | #define L2CAP_CTRL_SAR_SHIFT 14 | ||
111 | 112 | ||
112 | /* L2CAP Supervisory Function */ | 113 | /* L2CAP Supervisory Function */ |
113 | #define L2CAP_SUPER_RCV_READY 0x0000 | 114 | #define L2CAP_SUPER_RCV_READY 0x0000 |
@@ -290,6 +291,13 @@ struct l2cap_conn { | |||
290 | /* ----- L2CAP channel and socket info ----- */ | 291 | /* ----- L2CAP channel and socket info ----- */ |
291 | #define l2cap_pi(sk) ((struct l2cap_pinfo *) sk) | 292 | #define l2cap_pi(sk) ((struct l2cap_pinfo *) sk) |
292 | #define TX_QUEUE(sk) (&l2cap_pi(sk)->tx_queue) | 293 | #define TX_QUEUE(sk) (&l2cap_pi(sk)->tx_queue) |
294 | #define SREJ_QUEUE(sk) (&l2cap_pi(sk)->srej_queue) | ||
295 | #define SREJ_LIST(sk) (&l2cap_pi(sk)->srej_l.list) | ||
296 | |||
297 | struct srej_list { | ||
298 | __u8 tx_seq; | ||
299 | struct list_head list; | ||
300 | }; | ||
293 | 301 | ||
294 | struct l2cap_pinfo { | 302 | struct l2cap_pinfo { |
295 | struct bt_sock bt; | 303 | struct bt_sock bt; |
@@ -318,6 +326,8 @@ struct l2cap_pinfo { | |||
318 | __u8 expected_ack_seq; | 326 | __u8 expected_ack_seq; |
319 | __u8 req_seq; | 327 | __u8 req_seq; |
320 | __u8 expected_tx_seq; | 328 | __u8 expected_tx_seq; |
329 | __u8 buffer_seq; | ||
330 | __u8 buffer_seq_srej; | ||
321 | __u8 unacked_frames; | 331 | __u8 unacked_frames; |
322 | __u8 retry_count; | 332 | __u8 retry_count; |
323 | __u8 num_to_ack; | 333 | __u8 num_to_ack; |
@@ -338,6 +348,8 @@ struct l2cap_pinfo { | |||
338 | struct timer_list retrans_timer; | 348 | struct timer_list retrans_timer; |
339 | struct timer_list monitor_timer; | 349 | struct timer_list monitor_timer; |
340 | struct sk_buff_head tx_queue; | 350 | struct sk_buff_head tx_queue; |
351 | struct sk_buff_head srej_queue; | ||
352 | struct srej_list srej_l; | ||
341 | struct l2cap_conn *conn; | 353 | struct l2cap_conn *conn; |
342 | struct sock *next_c; | 354 | struct sock *next_c; |
343 | struct sock *prev_c; | 355 | struct sock *prev_c; |
@@ -356,7 +368,7 @@ struct l2cap_pinfo { | |||
356 | #define L2CAP_CONF_MAX_CONF_RSP 2 | 368 | #define L2CAP_CONF_MAX_CONF_RSP 2 |
357 | 369 | ||
358 | #define L2CAP_CONN_SAR_SDU 0x01 | 370 | #define L2CAP_CONN_SAR_SDU 0x01 |
359 | #define L2CAP_CONN_UNDER_REJ 0x02 | 371 | #define L2CAP_CONN_SREJ_SENT 0x02 |
360 | #define L2CAP_CONN_WAIT_F 0x04 | 372 | #define L2CAP_CONN_WAIT_F 0x04 |
361 | 373 | ||
362 | #define __mod_retrans_timer() mod_timer(&l2cap_pi(sk)->retrans_timer, \ | 374 | #define __mod_retrans_timer() mod_timer(&l2cap_pi(sk)->retrans_timer, \ |