diff options
Diffstat (limited to 'include/net/bluetooth/l2cap.h')
-rw-r--r-- | include/net/bluetooth/l2cap.h | 41 |
1 files changed, 29 insertions, 12 deletions
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h index 17a689f27a6a..7c695bfd853c 100644 --- a/include/net/bluetooth/l2cap.h +++ b/include/net/bluetooth/l2cap.h | |||
@@ -30,11 +30,12 @@ | |||
30 | #define L2CAP_DEFAULT_MIN_MTU 48 | 30 | #define L2CAP_DEFAULT_MIN_MTU 48 |
31 | #define L2CAP_DEFAULT_FLUSH_TO 0xffff | 31 | #define L2CAP_DEFAULT_FLUSH_TO 0xffff |
32 | #define L2CAP_DEFAULT_TX_WINDOW 63 | 32 | #define L2CAP_DEFAULT_TX_WINDOW 63 |
33 | #define L2CAP_DEFAULT_NUM_TO_ACK (L2CAP_DEFAULT_TX_WINDOW/5) | ||
34 | #define L2CAP_DEFAULT_MAX_TX 3 | 33 | #define L2CAP_DEFAULT_MAX_TX 3 |
35 | #define L2CAP_DEFAULT_RETRANS_TO 1000 /* 1 second */ | 34 | #define L2CAP_DEFAULT_RETRANS_TO 1000 /* 1 second */ |
36 | #define L2CAP_DEFAULT_MONITOR_TO 12000 /* 12 seconds */ | 35 | #define L2CAP_DEFAULT_MONITOR_TO 12000 /* 12 seconds */ |
37 | #define L2CAP_DEFAULT_MAX_PDU_SIZE 672 | 36 | #define L2CAP_DEFAULT_MAX_PDU_SIZE 672 |
37 | #define L2CAP_DEFAULT_ACK_TO 200 | ||
38 | #define L2CAP_LOCAL_BUSY_TRIES 12 | ||
38 | 39 | ||
39 | #define L2CAP_CONN_TIMEOUT (40000) /* 40 seconds */ | 40 | #define L2CAP_CONN_TIMEOUT (40000) /* 40 seconds */ |
40 | #define L2CAP_INFO_TIMEOUT (4000) /* 4 seconds */ | 41 | #define L2CAP_INFO_TIMEOUT (4000) /* 4 seconds */ |
@@ -55,6 +56,8 @@ struct l2cap_options { | |||
55 | __u16 flush_to; | 56 | __u16 flush_to; |
56 | __u8 mode; | 57 | __u8 mode; |
57 | __u8 fcs; | 58 | __u8 fcs; |
59 | __u8 max_tx; | ||
60 | __u16 txwin_size; | ||
58 | }; | 61 | }; |
59 | 62 | ||
60 | #define L2CAP_CONNINFO 0x02 | 63 | #define L2CAP_CONNINFO 0x02 |
@@ -292,6 +295,7 @@ struct l2cap_conn { | |||
292 | #define l2cap_pi(sk) ((struct l2cap_pinfo *) sk) | 295 | #define l2cap_pi(sk) ((struct l2cap_pinfo *) sk) |
293 | #define TX_QUEUE(sk) (&l2cap_pi(sk)->tx_queue) | 296 | #define TX_QUEUE(sk) (&l2cap_pi(sk)->tx_queue) |
294 | #define SREJ_QUEUE(sk) (&l2cap_pi(sk)->srej_queue) | 297 | #define SREJ_QUEUE(sk) (&l2cap_pi(sk)->srej_queue) |
298 | #define BUSY_QUEUE(sk) (&l2cap_pi(sk)->busy_queue) | ||
295 | #define SREJ_LIST(sk) (&l2cap_pi(sk)->srej_l.list) | 299 | #define SREJ_LIST(sk) (&l2cap_pi(sk)->srej_l.list) |
296 | 300 | ||
297 | struct srej_list { | 301 | struct srej_list { |
@@ -320,7 +324,7 @@ struct l2cap_pinfo { | |||
320 | __u8 conf_req[64]; | 324 | __u8 conf_req[64]; |
321 | __u8 conf_len; | 325 | __u8 conf_len; |
322 | __u8 conf_state; | 326 | __u8 conf_state; |
323 | __u8 conn_state; | 327 | __u16 conn_state; |
324 | 328 | ||
325 | __u8 next_tx_seq; | 329 | __u8 next_tx_seq; |
326 | __u8 expected_ack_seq; | 330 | __u8 expected_ack_seq; |
@@ -328,27 +332,35 @@ struct l2cap_pinfo { | |||
328 | __u8 buffer_seq; | 332 | __u8 buffer_seq; |
329 | __u8 buffer_seq_srej; | 333 | __u8 buffer_seq_srej; |
330 | __u8 srej_save_reqseq; | 334 | __u8 srej_save_reqseq; |
335 | __u8 frames_sent; | ||
331 | __u8 unacked_frames; | 336 | __u8 unacked_frames; |
332 | __u8 retry_count; | 337 | __u8 retry_count; |
333 | __u8 num_to_ack; | 338 | __u8 num_acked; |
334 | __u16 sdu_len; | 339 | __u16 sdu_len; |
335 | __u16 partial_sdu_len; | 340 | __u16 partial_sdu_len; |
336 | struct sk_buff *sdu; | 341 | struct sk_buff *sdu; |
337 | 342 | ||
338 | __u8 ident; | 343 | __u8 ident; |
339 | 344 | ||
345 | __u8 tx_win; | ||
346 | __u8 max_tx; | ||
340 | __u8 remote_tx_win; | 347 | __u8 remote_tx_win; |
341 | __u8 remote_max_tx; | 348 | __u8 remote_max_tx; |
342 | __u16 retrans_timeout; | 349 | __u16 retrans_timeout; |
343 | __u16 monitor_timeout; | 350 | __u16 monitor_timeout; |
344 | __u16 max_pdu_size; | 351 | __u16 remote_mps; |
352 | __u16 mps; | ||
345 | 353 | ||
346 | __le16 sport; | 354 | __le16 sport; |
347 | 355 | ||
356 | spinlock_t send_lock; | ||
348 | struct timer_list retrans_timer; | 357 | struct timer_list retrans_timer; |
349 | struct timer_list monitor_timer; | 358 | struct timer_list monitor_timer; |
359 | struct timer_list ack_timer; | ||
350 | struct sk_buff_head tx_queue; | 360 | struct sk_buff_head tx_queue; |
351 | struct sk_buff_head srej_queue; | 361 | struct sk_buff_head srej_queue; |
362 | struct sk_buff_head busy_queue; | ||
363 | struct work_struct busy_work; | ||
352 | struct srej_list srej_l; | 364 | struct srej_list srej_l; |
353 | struct l2cap_conn *conn; | 365 | struct l2cap_conn *conn; |
354 | struct sock *next_c; | 366 | struct sock *next_c; |
@@ -367,19 +379,24 @@ struct l2cap_pinfo { | |||
367 | #define L2CAP_CONF_MAX_CONF_REQ 2 | 379 | #define L2CAP_CONF_MAX_CONF_REQ 2 |
368 | #define L2CAP_CONF_MAX_CONF_RSP 2 | 380 | #define L2CAP_CONF_MAX_CONF_RSP 2 |
369 | 381 | ||
370 | #define L2CAP_CONN_SAR_SDU 0x01 | 382 | #define L2CAP_CONN_SAR_SDU 0x0001 |
371 | #define L2CAP_CONN_SREJ_SENT 0x02 | 383 | #define L2CAP_CONN_SREJ_SENT 0x0002 |
372 | #define L2CAP_CONN_WAIT_F 0x04 | 384 | #define L2CAP_CONN_WAIT_F 0x0004 |
373 | #define L2CAP_CONN_SREJ_ACT 0x08 | 385 | #define L2CAP_CONN_SREJ_ACT 0x0008 |
374 | #define L2CAP_CONN_SEND_PBIT 0x10 | 386 | #define L2CAP_CONN_SEND_PBIT 0x0010 |
375 | #define L2CAP_CONN_REMOTE_BUSY 0x20 | 387 | #define L2CAP_CONN_REMOTE_BUSY 0x0020 |
376 | #define L2CAP_CONN_LOCAL_BUSY 0x40 | 388 | #define L2CAP_CONN_LOCAL_BUSY 0x0040 |
377 | #define L2CAP_CONN_REJ_ACT 0x80 | 389 | #define L2CAP_CONN_REJ_ACT 0x0080 |
390 | #define L2CAP_CONN_SEND_FBIT 0x0100 | ||
391 | #define L2CAP_CONN_RNR_SENT 0x0200 | ||
392 | #define L2CAP_CONN_SAR_RETRY 0x0400 | ||
378 | 393 | ||
379 | #define __mod_retrans_timer() mod_timer(&l2cap_pi(sk)->retrans_timer, \ | 394 | #define __mod_retrans_timer() mod_timer(&l2cap_pi(sk)->retrans_timer, \ |
380 | jiffies + msecs_to_jiffies(L2CAP_DEFAULT_RETRANS_TO)); | 395 | jiffies + msecs_to_jiffies(L2CAP_DEFAULT_RETRANS_TO)); |
381 | #define __mod_monitor_timer() mod_timer(&l2cap_pi(sk)->monitor_timer, \ | 396 | #define __mod_monitor_timer() mod_timer(&l2cap_pi(sk)->monitor_timer, \ |
382 | jiffies + msecs_to_jiffies(L2CAP_DEFAULT_MONITOR_TO)); | 397 | jiffies + msecs_to_jiffies(L2CAP_DEFAULT_MONITOR_TO)); |
398 | #define __mod_ack_timer() mod_timer(&l2cap_pi(sk)->ack_timer, \ | ||
399 | jiffies + msecs_to_jiffies(L2CAP_DEFAULT_ACK_TO)); | ||
383 | 400 | ||
384 | static inline int l2cap_tx_window_full(struct sock *sk) | 401 | static inline int l2cap_tx_window_full(struct sock *sk) |
385 | { | 402 | { |