diff options
-rw-r--r-- | net/bluetooth/l2cap_core.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index 5941c65728b2..8e9e883874ce 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c | |||
@@ -49,6 +49,9 @@ static u8 l2cap_fixed_chan[8] = { L2CAP_FC_L2CAP | L2CAP_FC_CONNLESS, }; | |||
49 | static LIST_HEAD(chan_list); | 49 | static LIST_HEAD(chan_list); |
50 | static DEFINE_RWLOCK(chan_list_lock); | 50 | static DEFINE_RWLOCK(chan_list_lock); |
51 | 51 | ||
52 | static u16 le_max_credits = L2CAP_LE_MAX_CREDITS; | ||
53 | static u16 le_default_mps = L2CAP_LE_DEFAULT_MPS; | ||
54 | |||
52 | static struct sk_buff *l2cap_build_cmd(struct l2cap_conn *conn, | 55 | static struct sk_buff *l2cap_build_cmd(struct l2cap_conn *conn, |
53 | u8 code, u8 ident, u16 dlen, void *data); | 56 | u8 code, u8 ident, u16 dlen, void *data); |
54 | static void l2cap_send_cmd(struct l2cap_conn *conn, u8 ident, u8 code, u16 len, | 57 | static void l2cap_send_cmd(struct l2cap_conn *conn, u8 ident, u8 code, u16 len, |
@@ -501,7 +504,7 @@ void l2cap_le_flowctl_init(struct l2cap_chan *chan) | |||
501 | chan->omtu = L2CAP_LE_MIN_MTU; | 504 | chan->omtu = L2CAP_LE_MIN_MTU; |
502 | chan->mode = L2CAP_MODE_LE_FLOWCTL; | 505 | chan->mode = L2CAP_MODE_LE_FLOWCTL; |
503 | chan->tx_credits = 0; | 506 | chan->tx_credits = 0; |
504 | chan->rx_credits = L2CAP_LE_MAX_CREDITS; | 507 | chan->rx_credits = le_max_credits; |
505 | 508 | ||
506 | if (chan->imtu < L2CAP_LE_DEFAULT_MPS) | 509 | if (chan->imtu < L2CAP_LE_DEFAULT_MPS) |
507 | chan->mps = chan->imtu; | 510 | chan->mps = chan->imtu; |
@@ -1214,7 +1217,7 @@ static void l2cap_le_flowctl_start(struct l2cap_chan *chan) | |||
1214 | if (chan->imtu < L2CAP_LE_DEFAULT_MPS) | 1217 | if (chan->imtu < L2CAP_LE_DEFAULT_MPS) |
1215 | chan->mps = chan->imtu; | 1218 | chan->mps = chan->imtu; |
1216 | else | 1219 | else |
1217 | chan->mps = L2CAP_LE_DEFAULT_MPS; | 1220 | chan->mps = le_default_mps; |
1218 | 1221 | ||
1219 | skb_queue_head_init(&chan->tx_q); | 1222 | skb_queue_head_init(&chan->tx_q); |
1220 | 1223 | ||
@@ -6831,10 +6834,10 @@ static void l2cap_chan_le_send_credits(struct l2cap_chan *chan) | |||
6831 | /* We return more credits to the sender only after the amount of | 6834 | /* We return more credits to the sender only after the amount of |
6832 | * credits falls below half of the initial amount. | 6835 | * credits falls below half of the initial amount. |
6833 | */ | 6836 | */ |
6834 | if (chan->rx_credits >= (L2CAP_LE_MAX_CREDITS + 1) / 2) | 6837 | if (chan->rx_credits >= (le_max_credits + 1) / 2) |
6835 | return; | 6838 | return; |
6836 | 6839 | ||
6837 | return_credits = L2CAP_LE_MAX_CREDITS - chan->rx_credits; | 6840 | return_credits = le_max_credits - chan->rx_credits; |
6838 | 6841 | ||
6839 | BT_DBG("chan %p returning %u credits to sender", chan, return_credits); | 6842 | BT_DBG("chan %p returning %u credits to sender", chan, return_credits); |
6840 | 6843 | ||
@@ -7448,6 +7451,11 @@ int __init l2cap_init(void) | |||
7448 | l2cap_debugfs = debugfs_create_file("l2cap", 0444, bt_debugfs, | 7451 | l2cap_debugfs = debugfs_create_file("l2cap", 0444, bt_debugfs, |
7449 | NULL, &l2cap_debugfs_fops); | 7452 | NULL, &l2cap_debugfs_fops); |
7450 | 7453 | ||
7454 | debugfs_create_u16("l2cap_le_max_credits", 0466, bt_debugfs, | ||
7455 | &le_max_credits); | ||
7456 | debugfs_create_u16("l2cap_le_default_mps", 0466, bt_debugfs, | ||
7457 | &le_default_mps); | ||
7458 | |||
7451 | return 0; | 7459 | return 0; |
7452 | } | 7460 | } |
7453 | 7461 | ||