aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/l2cap_core.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/bluetooth/l2cap_core.c')
-rw-r--r--net/bluetooth/l2cap_core.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index 61af06d35335..4b6d11c199b5 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -1394,7 +1394,8 @@ static struct l2cap_chan *l2cap_global_chan_by_psm(int state, __le16 psm,
1394 return c1; 1394 return c1;
1395} 1395}
1396 1396
1397int l2cap_chan_connect(struct l2cap_chan *chan, __le16 psm, u16 cid, bdaddr_t *dst) 1397int l2cap_chan_connect(struct l2cap_chan *chan, __le16 psm, u16 cid,
1398 bdaddr_t *dst, u8 dst_type)
1398{ 1399{
1399 struct sock *sk = chan->sk; 1400 struct sock *sk = chan->sk;
1400 bdaddr_t *src = &bt_sk(sk)->src; 1401 bdaddr_t *src = &bt_sk(sk)->src;
@@ -1404,8 +1405,8 @@ int l2cap_chan_connect(struct l2cap_chan *chan, __le16 psm, u16 cid, bdaddr_t *d
1404 __u8 auth_type; 1405 __u8 auth_type;
1405 int err; 1406 int err;
1406 1407
1407 BT_DBG("%s -> %s psm 0x%2.2x", batostr(src), batostr(dst), 1408 BT_DBG("%s -> %s (type %u) psm 0x%2.2x", batostr(src), batostr(dst),
1408 __le16_to_cpu(chan->psm)); 1409 dst_type, __le16_to_cpu(chan->psm));
1409 1410
1410 hdev = hci_get_route(dst, src); 1411 hdev = hci_get_route(dst, src);
1411 if (!hdev) 1412 if (!hdev)
@@ -1479,10 +1480,10 @@ int l2cap_chan_connect(struct l2cap_chan *chan, __le16 psm, u16 cid, bdaddr_t *d
1479 auth_type = l2cap_get_auth_type(chan); 1480 auth_type = l2cap_get_auth_type(chan);
1480 1481
1481 if (chan->dcid == L2CAP_CID_LE_DATA) 1482 if (chan->dcid == L2CAP_CID_LE_DATA)
1482 hcon = hci_connect(hdev, LE_LINK, dst, BDADDR_LE_RANDOM, 1483 hcon = hci_connect(hdev, LE_LINK, dst, dst_type,
1483 chan->sec_level, auth_type); 1484 chan->sec_level, auth_type);
1484 else 1485 else
1485 hcon = hci_connect(hdev, ACL_LINK, dst, BDADDR_BREDR, 1486 hcon = hci_connect(hdev, ACL_LINK, dst, dst_type,
1486 chan->sec_level, auth_type); 1487 chan->sec_level, auth_type);
1487 1488
1488 if (IS_ERR(hcon)) { 1489 if (IS_ERR(hcon)) {