Bluetooth: Optimize connection parameter lookup for LE connections
authorJohan Hedberg <johan.hedberg@intel.com>
Fri, 15 Aug 2014 18:06:56 +0000 (21:06 +0300)
committerMarcel Holtmann <marcel@holtmann.org>
Mon, 8 Sep 2014 17:07:52 +0000 (19:07 +0200)
When we get an LE connection complete event there's really no reason to
look through the entire connection parameter list as the entry should be
present in the hdev->pend_le_conns list too. This patch changes the
lookup code to do a more restricted lookup only in the pend_le_conns
list.

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

index e8f35a90add589e5338a642d0373f8c8b120e1d0..d2ee162ecddb8e386b57bbdcbac62635b8903a82 100644 (file)
@@ -4225,7 +4225,8 @@ static void hci_le_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *skb)
 
        hci_proto_connect_cfm(conn, ev->status);
 
-       params = hci_conn_params_lookup(hdev, &conn->dst, conn->dst_type);
+       params = hci_pend_le_action_lookup(&hdev->pend_le_conns, &conn->dst,
+                                          conn->dst_type);
        if (params) {
                list_del_init(&params->action);
                if (params->conn) {