Bluetooth: AMP: Use block_mtu for AMP controller
authorAndrei Emeltchenko <andrei.emeltchenko@intel.com>
Fri, 5 Oct 2012 13:56:57 +0000 (16:56 +0300)
committerGustavo Padovan <gustavo.padovan@collabora.co.uk>
Sun, 7 Oct 2012 22:22:23 +0000 (06:22 +0800)
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
net/bluetooth/l2cap_core.c

index b4e707bfc08df73ea53b466efde81c45cb8b7b88..d605bbfddec1ff985e38962036f00535a0504415 100644 (file)
@@ -1390,10 +1390,22 @@ static struct l2cap_conn *l2cap_conn_add(struct hci_conn *hcon, u8 status)
 
        BT_DBG("hcon %p conn %p hchan %p", hcon, conn, hchan);
 
-       if (hcon->hdev->le_mtu && hcon->type == LE_LINK)
-               conn->mtu = hcon->hdev->le_mtu;
-       else
+       switch (hcon->type) {
+       case AMP_LINK:
+               conn->mtu = hcon->hdev->block_mtu;
+               break;
+
+       case LE_LINK:
+               if (hcon->hdev->le_mtu) {
+                       conn->mtu = hcon->hdev->le_mtu;
+                       break;
+               }
+               /* fall through */
+
+       default:
                conn->mtu = hcon->hdev->acl_mtu;
+               break;
+       }
 
        conn->src = &hcon->hdev->bdaddr;
        conn->dst = &hcon->dst;