]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
Bluetooth: Remove auth_type parameter from hci_connect_le()
authorJohan Hedberg <johan.hedberg@intel.com>
Mon, 7 Jul 2014 12:02:27 +0000 (15:02 +0300)
committerMarcel Holtmann <marcel@holtmann.org>
Mon, 7 Jul 2014 13:18:07 +0000 (15:18 +0200)
The auth_type value which gets assigned to hci_conn->auth_type is
something that's only used for BR/EDR connections and is of no value for
LE connections. It makes therefore little sense to pass it to the
hci_connect_le() function. This patch removes the parameter from the
function.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
include/net/bluetooth/hci_core.h
net/bluetooth/hci_conn.c
net/bluetooth/hci_event.c
net/bluetooth/l2cap_core.c
net/bluetooth/mgmt.c

index 06039aae301068b117d01bc8098cd44f0db5e6c6..8752ac674db19a17c6604045568af906f6bd785b 100644 (file)
@@ -704,8 +704,7 @@ void hci_chan_list_flush(struct hci_conn *conn);
 struct hci_chan *hci_chan_lookup_handle(struct hci_dev *hdev, __u16 handle);
 
 struct hci_conn *hci_connect_le(struct hci_dev *hdev, bdaddr_t *dst,
-                               u8 dst_type, u8 sec_level, u8 auth_type,
-                               u16 conn_timeout);
+                               u8 dst_type, u8 sec_level, u16 conn_timeout);
 struct hci_conn *hci_connect_acl(struct hci_dev *hdev, bdaddr_t *dst,
                                 u8 sec_level, u8 auth_type);
 struct hci_conn *hci_connect_sco(struct hci_dev *hdev, int type, bdaddr_t *dst,
index faa032fcdaeeddecd525aada3bc044e8ba33a75b..9323044f01cd8b60e0fce783da8cfcf7a0dfcb0a 100644 (file)
@@ -700,8 +700,7 @@ static void hci_req_directed_advertising(struct hci_request *req,
 }
 
 struct hci_conn *hci_connect_le(struct hci_dev *hdev, bdaddr_t *dst,
-                               u8 dst_type, u8 sec_level, u8 auth_type,
-                               u16 conn_timeout)
+                               u8 dst_type, u8 sec_level, u16 conn_timeout)
 {
        struct hci_conn_params *params;
        struct hci_conn *conn;
@@ -721,7 +720,6 @@ struct hci_conn *hci_connect_le(struct hci_dev *hdev, bdaddr_t *dst,
        conn = hci_conn_hash_lookup_ba(hdev, LE_LINK, dst);
        if (conn) {
                conn->pending_sec_level = sec_level;
-               conn->auth_type = auth_type;
                goto done;
        }
 
@@ -758,7 +756,6 @@ struct hci_conn *hci_connect_le(struct hci_dev *hdev, bdaddr_t *dst,
        conn->dst_type = dst_type;
        conn->sec_level = BT_SECURITY_LOW;
        conn->pending_sec_level = sec_level;
-       conn->auth_type = auth_type;
        conn->conn_timeout = conn_timeout;
 
        hci_req_init(&req, hdev);
index 84f4659f136e3cd3c46eee4c32ae4905e2cc21e9..ad39d9ad6fbc1f03f1f4751748dbcd5852ee9905 100644 (file)
@@ -4254,7 +4254,7 @@ static void check_pending_le_conn(struct hci_dev *hdev, bdaddr_t *addr,
 
 connect:
        conn = hci_connect_le(hdev, addr, addr_type, BT_SECURITY_LOW,
-                             HCI_AT_NO_BONDING, HCI_LE_AUTOCONN_TIMEOUT);
+                             HCI_LE_AUTOCONN_TIMEOUT);
        if (!IS_ERR(conn))
                return;
 
index a219276d9f92ef1bdf19d608b4facd6af26cdc1d..3daab4588522e1b503b88e9fe8aac7ba5d86e3a0 100644 (file)
@@ -7048,7 +7048,6 @@ int l2cap_chan_connect(struct l2cap_chan *chan, __le16 psm, u16 cid,
        struct l2cap_conn *conn;
        struct hci_conn *hcon;
        struct hci_dev *hdev;
-       __u8 auth_type;
        int err;
 
        BT_DBG("%pMR -> %pMR (type %u) psm 0x%2.2x", &chan->src, dst,
@@ -7124,8 +7123,6 @@ int l2cap_chan_connect(struct l2cap_chan *chan, __le16 psm, u16 cid,
        chan->psm = psm;
        chan->dcid = cid;
 
-       auth_type = l2cap_get_auth_type(chan);
-
        if (bdaddr_type_is_le(dst_type)) {
                /* Convert from L2CAP channel address type to HCI address type
                 */
@@ -7135,8 +7132,9 @@ int l2cap_chan_connect(struct l2cap_chan *chan, __le16 psm, u16 cid,
                        dst_type = ADDR_LE_DEV_RANDOM;
 
                hcon = hci_connect_le(hdev, dst, dst_type, chan->sec_level,
-                                     auth_type, HCI_LE_CONN_TIMEOUT);
+                                     HCI_LE_CONN_TIMEOUT);
        } else {
+               u8 auth_type = l2cap_get_auth_type(chan);
                hcon = hci_connect_acl(hdev, dst, chan->sec_level, auth_type);
        }
 
index ef675acbcfcea76b4b208fd337f1e4178c895728..e7047de1ba11e4b198fa4de6a22c97c560427849 100644 (file)
@@ -3118,8 +3118,7 @@ static int pair_device(struct sock *sk, struct hci_dev *hdev, void *data,
                hci_conn_params_add(hdev, &cp->addr.bdaddr, addr_type);
 
                conn = hci_connect_le(hdev, &cp->addr.bdaddr, addr_type,
-                                     sec_level, auth_type,
-                                     HCI_LE_CONN_TIMEOUT);
+                                     sec_level, HCI_LE_CONN_TIMEOUT);
        }
 
        if (IS_ERR(conn)) {