diff options
author | Gustavo F. Padovan <padovan@profusion.mobi> | 2010-05-01 15:15:44 -0400 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2010-05-10 03:28:53 -0400 |
commit | 1890d36bb556a27684ad29654a9898ab9a5f57ee (patch) | |
tree | 9ff2c7d2f2e4288fa781f9f1802def01f7c530c9 /include/net/bluetooth/l2cap.h | |
parent | 9b53350d3cf5b330c3261d89b5e62a2dc25c5653 (diff) |
Bluetooth: Implement Local Busy Condition handling
Supports Local Busy condition handling through a waitqueue that wake ups
each 200ms and try to push the packets to the upper layer. If it can
push all the queue then it leaves the Local Busy state.
The patch modifies the behaviour of l2cap_ertm_reassembly_sdu() to
support retry of the push operation.
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'include/net/bluetooth/l2cap.h')
-rw-r--r-- | include/net/bluetooth/l2cap.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h index 8942c2ffc58b..d0185cc04c14 100644 --- a/include/net/bluetooth/l2cap.h +++ b/include/net/bluetooth/l2cap.h | |||
@@ -35,6 +35,7 @@ | |||
35 | #define L2CAP_DEFAULT_MONITOR_TO 12000 /* 12 seconds */ | 35 | #define L2CAP_DEFAULT_MONITOR_TO 12000 /* 12 seconds */ |
36 | #define L2CAP_DEFAULT_MAX_PDU_SIZE 672 | 36 | #define L2CAP_DEFAULT_MAX_PDU_SIZE 672 |
37 | #define L2CAP_DEFAULT_ACK_TO 200 | 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 */ |
@@ -294,6 +295,7 @@ struct l2cap_conn { | |||
294 | #define l2cap_pi(sk) ((struct l2cap_pinfo *) sk) | 295 | #define l2cap_pi(sk) ((struct l2cap_pinfo *) sk) |
295 | #define TX_QUEUE(sk) (&l2cap_pi(sk)->tx_queue) | 296 | #define TX_QUEUE(sk) (&l2cap_pi(sk)->tx_queue) |
296 | #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) | ||
297 | #define SREJ_LIST(sk) (&l2cap_pi(sk)->srej_l.list) | 299 | #define SREJ_LIST(sk) (&l2cap_pi(sk)->srej_l.list) |
298 | 300 | ||
299 | struct srej_list { | 301 | struct srej_list { |
@@ -356,6 +358,8 @@ struct l2cap_pinfo { | |||
356 | struct timer_list ack_timer; | 358 | struct timer_list ack_timer; |
357 | struct sk_buff_head tx_queue; | 359 | struct sk_buff_head tx_queue; |
358 | struct sk_buff_head srej_queue; | 360 | struct sk_buff_head srej_queue; |
361 | struct sk_buff_head busy_queue; | ||
362 | struct work_struct busy_work; | ||
359 | struct srej_list srej_l; | 363 | struct srej_list srej_l; |
360 | struct l2cap_conn *conn; | 364 | struct l2cap_conn *conn; |
361 | struct sock *next_c; | 365 | struct sock *next_c; |
@@ -383,6 +387,8 @@ struct l2cap_pinfo { | |||
383 | #define L2CAP_CONN_LOCAL_BUSY 0x0040 | 387 | #define L2CAP_CONN_LOCAL_BUSY 0x0040 |
384 | #define L2CAP_CONN_REJ_ACT 0x0080 | 388 | #define L2CAP_CONN_REJ_ACT 0x0080 |
385 | #define L2CAP_CONN_SEND_FBIT 0x0100 | 389 | #define L2CAP_CONN_SEND_FBIT 0x0100 |
390 | #define L2CAP_CONN_RNR_SENT 0x0200 | ||
391 | #define L2CAP_CONN_SAR_RETRY 0x0400 | ||
386 | 392 | ||
387 | #define __mod_retrans_timer() mod_timer(&l2cap_pi(sk)->retrans_timer, \ | 393 | #define __mod_retrans_timer() mod_timer(&l2cap_pi(sk)->retrans_timer, \ |
388 | jiffies + msecs_to_jiffies(L2CAP_DEFAULT_RETRANS_TO)); | 394 | jiffies + msecs_to_jiffies(L2CAP_DEFAULT_RETRANS_TO)); |