]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - net/bluetooth/l2cap_core.c
Merge tag 'v3.9-rc3' into next
[karo-tx-linux.git] / net / bluetooth / l2cap_core.c
index 2c78208d793eb8db838cf85a480e029a4dc3567b..7c7e9321f1ea4263e0c51e792a14e0454d4a0e12 100644 (file)
@@ -1527,17 +1527,12 @@ static struct l2cap_conn *l2cap_conn_add(struct hci_conn *hcon, u8 status)
        BT_DBG("hcon %p conn %p hchan %p", hcon, conn, hchan);
 
        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;
@@ -3727,6 +3722,17 @@ sendresp:
 static int l2cap_connect_req(struct l2cap_conn *conn,
                             struct l2cap_cmd_hdr *cmd, u8 *data)
 {
+       struct hci_dev *hdev = conn->hcon->hdev;
+       struct hci_conn *hcon = conn->hcon;
+
+       hci_dev_lock(hdev);
+       if (test_bit(HCI_MGMT, &hdev->dev_flags) &&
+           !test_and_set_bit(HCI_CONN_MGMT_CONNECTED, &hcon->flags))
+               mgmt_device_connected(hdev, &hcon->dst, hcon->type,
+                                     hcon->dst_type, 0, NULL, 0,
+                                     hcon->dev_class);
+       hci_dev_unlock(hdev);
+
        l2cap_connect(conn, cmd, data, L2CAP_CONN_RSP, 0);
        return 0;
 }