Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/holtmann/bluet...
authorJohn W. Linville <linville@tuxdriver.com>
Tue, 10 Aug 2010 18:55:10 +0000 (14:55 -0400)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 10 Aug 2010 20:16:58 +0000 (16:16 -0400)
include/net/bluetooth/l2cap.h
net/bluetooth/l2cap.c

index 636724b203eef0f2c6fa519fe626df2a707029d3..6c241444f902800baf1c4cd16aa89d767d751065 100644 (file)
@@ -33,9 +33,9 @@
 #define L2CAP_DEFAULT_FLUSH_TO         0xffff
 #define L2CAP_DEFAULT_TX_WINDOW                63
 #define L2CAP_DEFAULT_MAX_TX           3
-#define L2CAP_DEFAULT_RETRANS_TO       1000    /* 1 second */
+#define L2CAP_DEFAULT_RETRANS_TO       2000    /* 2 seconds */
 #define L2CAP_DEFAULT_MONITOR_TO       12000   /* 12 seconds */
-#define L2CAP_DEFAULT_MAX_PDU_SIZE     672
+#define L2CAP_DEFAULT_MAX_PDU_SIZE     1009    /* Sized for 3-DH5 packet */
 #define L2CAP_DEFAULT_ACK_TO           200
 #define L2CAP_LOCAL_BUSY_TRIES         12
 
index 3e3cd9d4e52ce6147ed5b506a8d4cb3f6248d85e..fadf26b4ed7c432eba09800b4532683fc44cc02d 100644 (file)
@@ -2705,8 +2705,9 @@ done:
                case L2CAP_MODE_ERTM:
                        pi->remote_tx_win = rfc.txwin_size;
                        pi->remote_max_tx = rfc.max_transmit;
-                       if (rfc.max_pdu_size > pi->conn->mtu - 10)
-                               rfc.max_pdu_size = le16_to_cpu(pi->conn->mtu - 10);
+
+                       if (le16_to_cpu(rfc.max_pdu_size) > pi->conn->mtu - 10)
+                               rfc.max_pdu_size = cpu_to_le16(pi->conn->mtu - 10);
 
                        pi->remote_mps = le16_to_cpu(rfc.max_pdu_size);
 
@@ -2723,8 +2724,8 @@ done:
                        break;
 
                case L2CAP_MODE_STREAMING:
-                       if (rfc.max_pdu_size > pi->conn->mtu - 10)
-                               rfc.max_pdu_size = le16_to_cpu(pi->conn->mtu - 10);
+                       if (le16_to_cpu(rfc.max_pdu_size) > pi->conn->mtu - 10)
+                               rfc.max_pdu_size = cpu_to_le16(pi->conn->mtu - 10);
 
                        pi->remote_mps = le16_to_cpu(rfc.max_pdu_size);
 
@@ -2806,7 +2807,6 @@ static int l2cap_parse_conf_rsp(struct sock *sk, void *rsp, int len, void *data,
        if (*result == L2CAP_CONF_SUCCESS) {
                switch (rfc.mode) {
                case L2CAP_MODE_ERTM:
-                       pi->remote_tx_win   = rfc.txwin_size;
                        pi->retrans_timeout = le16_to_cpu(rfc.retrans_timeout);
                        pi->monitor_timeout = le16_to_cpu(rfc.monitor_timeout);
                        pi->mps    = le16_to_cpu(rfc.max_pdu_size);
@@ -2862,7 +2862,6 @@ static void l2cap_conf_rfc_get(struct sock *sk, void *rsp, int len)
 done:
        switch (rfc.mode) {
        case L2CAP_MODE_ERTM:
-               pi->remote_tx_win   = rfc.txwin_size;
                pi->retrans_timeout = le16_to_cpu(rfc.retrans_timeout);
                pi->monitor_timeout = le16_to_cpu(rfc.monitor_timeout);
                pi->mps    = le16_to_cpu(rfc.max_pdu_size);