Bluetooth: Add hdev helper variable to hci_le_create_connection_cancel
The hci_le_create_connection_cancel() function needs to use the hdev pointer in many places so add a variable for it to avoid the need to dereference the hci_conn every time. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
This commit is contained in:
parent
ec182f0397
commit
b5c2b6214c
1 changed files with 7 additions and 6 deletions
|
@ -68,6 +68,7 @@ static void hci_le_create_connection_cancel(struct hci_conn *conn)
|
||||||
static void hci_connect_le_scan_cleanup(struct hci_conn *conn)
|
static void hci_connect_le_scan_cleanup(struct hci_conn *conn)
|
||||||
{
|
{
|
||||||
struct hci_conn_params *params;
|
struct hci_conn_params *params;
|
||||||
|
struct hci_dev *hdev = conn->hdev;
|
||||||
struct smp_irk *irk;
|
struct smp_irk *irk;
|
||||||
bdaddr_t *bdaddr;
|
bdaddr_t *bdaddr;
|
||||||
u8 bdaddr_type;
|
u8 bdaddr_type;
|
||||||
|
@ -76,13 +77,13 @@ static void hci_connect_le_scan_cleanup(struct hci_conn *conn)
|
||||||
bdaddr_type = conn->dst_type;
|
bdaddr_type = conn->dst_type;
|
||||||
|
|
||||||
/* Check if we need to convert to identity address */
|
/* Check if we need to convert to identity address */
|
||||||
irk = hci_get_irk(conn->hdev, bdaddr, bdaddr_type);
|
irk = hci_get_irk(hdev, bdaddr, bdaddr_type);
|
||||||
if (irk) {
|
if (irk) {
|
||||||
bdaddr = &irk->bdaddr;
|
bdaddr = &irk->bdaddr;
|
||||||
bdaddr_type = irk->addr_type;
|
bdaddr_type = irk->addr_type;
|
||||||
}
|
}
|
||||||
|
|
||||||
params = hci_explicit_connect_lookup(conn->hdev, bdaddr, bdaddr_type);
|
params = hci_explicit_connect_lookup(hdev, bdaddr, bdaddr_type);
|
||||||
if (!params)
|
if (!params)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -97,21 +98,21 @@ static void hci_connect_le_scan_cleanup(struct hci_conn *conn)
|
||||||
|
|
||||||
switch (params->auto_connect) {
|
switch (params->auto_connect) {
|
||||||
case HCI_AUTO_CONN_EXPLICIT:
|
case HCI_AUTO_CONN_EXPLICIT:
|
||||||
hci_conn_params_del(conn->hdev, bdaddr, bdaddr_type);
|
hci_conn_params_del(hdev, bdaddr, bdaddr_type);
|
||||||
/* return instead of break to avoid duplicate scan update */
|
/* return instead of break to avoid duplicate scan update */
|
||||||
return;
|
return;
|
||||||
case HCI_AUTO_CONN_DIRECT:
|
case HCI_AUTO_CONN_DIRECT:
|
||||||
case HCI_AUTO_CONN_ALWAYS:
|
case HCI_AUTO_CONN_ALWAYS:
|
||||||
list_add(¶ms->action, &conn->hdev->pend_le_conns);
|
list_add(¶ms->action, &hdev->pend_le_conns);
|
||||||
break;
|
break;
|
||||||
case HCI_AUTO_CONN_REPORT:
|
case HCI_AUTO_CONN_REPORT:
|
||||||
list_add(¶ms->action, &conn->hdev->pend_le_reports);
|
list_add(¶ms->action, &hdev->pend_le_reports);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
hci_update_background_scan(conn->hdev);
|
hci_update_background_scan(hdev);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void hci_conn_cleanup(struct hci_conn *conn)
|
static void hci_conn_cleanup(struct hci_conn *conn)
|
||||||
|
|
Loading…
Add table
Reference in a new issue