diff options
author | Gustavo F. Padovan <padovan@profusion.mobi> | 2010-05-01 15:15:36 -0400 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2010-05-10 03:28:46 -0400 |
commit | d1daa091e8612f3aab14d28b5836375fafe155e1 (patch) | |
tree | 5947832185fe76f7b6a0ff3471b36f16a86fc0e5 /net/bluetooth/l2cap.c | |
parent | 7dffe4210233a2860c3f41477c40b3252edf2b7d (diff) |
Bluetooth: Fix ACL MTU issue
ERTM and Streaming Modes was having problems when the ACL MTU is lower
than MPS. The 'minus 10' is to take in account the header and fcs
lenghts.
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 'net/bluetooth/l2cap.c')
-rw-r--r-- | net/bluetooth/l2cap.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c index 401011a53c73..99cf1772b481 100644 --- a/net/bluetooth/l2cap.c +++ b/net/bluetooth/l2cap.c | |||
@@ -2267,6 +2267,8 @@ done: | |||
2267 | rfc.retrans_timeout = 0; | 2267 | rfc.retrans_timeout = 0; |
2268 | rfc.monitor_timeout = 0; | 2268 | rfc.monitor_timeout = 0; |
2269 | rfc.max_pdu_size = cpu_to_le16(L2CAP_DEFAULT_MAX_PDU_SIZE); | 2269 | rfc.max_pdu_size = cpu_to_le16(L2CAP_DEFAULT_MAX_PDU_SIZE); |
2270 | if (L2CAP_DEFAULT_MAX_PDU_SIZE > pi->conn->mtu - 10) | ||
2271 | rfc.max_pdu_size = pi->conn->mtu - 10; | ||
2270 | 2272 | ||
2271 | l2cap_add_conf_opt(&ptr, L2CAP_CONF_RFC, | 2273 | l2cap_add_conf_opt(&ptr, L2CAP_CONF_RFC, |
2272 | sizeof(rfc), (unsigned long) &rfc); | 2274 | sizeof(rfc), (unsigned long) &rfc); |
@@ -2288,6 +2290,8 @@ done: | |||
2288 | rfc.retrans_timeout = 0; | 2290 | rfc.retrans_timeout = 0; |
2289 | rfc.monitor_timeout = 0; | 2291 | rfc.monitor_timeout = 0; |
2290 | rfc.max_pdu_size = cpu_to_le16(L2CAP_DEFAULT_MAX_PDU_SIZE); | 2292 | rfc.max_pdu_size = cpu_to_le16(L2CAP_DEFAULT_MAX_PDU_SIZE); |
2293 | if (L2CAP_DEFAULT_MAX_PDU_SIZE > pi->conn->mtu - 10) | ||
2294 | rfc.max_pdu_size = pi->conn->mtu - 10; | ||
2291 | 2295 | ||
2292 | l2cap_add_conf_opt(&ptr, L2CAP_CONF_RFC, | 2296 | l2cap_add_conf_opt(&ptr, L2CAP_CONF_RFC, |
2293 | sizeof(rfc), (unsigned long) &rfc); | 2297 | sizeof(rfc), (unsigned long) &rfc); |