From 9c2af7e86895a3a2e457deb72a539f98d725b297 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Thu, 12 Jun 2008 08:07:16 +0000 Subject: Rename pin_reqs o auth_reqs since it's tracking SSP too --- hcid/adapter.c | 20 ++++++++++---------- hcid/adapter.h | 2 +- hcid/dbus-hci.c | 38 +++++++++++++++++++------------------- hcid/dbus-hci.h | 2 +- 4 files changed, 31 insertions(+), 31 deletions(-) diff --git a/hcid/adapter.c b/hcid/adapter.c index b5e179b2..6b44ec48 100644 --- a/hcid/adapter.c +++ b/hcid/adapter.c @@ -2655,8 +2655,8 @@ static void create_bond_req_exit(void *user_data) &adapter->bonding->bdaddr); release_passkey_agents(adapter, &adapter->bonding->bdaddr); - l = g_slist_find_custom(adapter->pin_reqs, &adapter->bonding->bdaddr, - pin_req_cmp); + l = g_slist_find_custom(adapter->auth_reqs, &adapter->bonding->bdaddr, + auth_req_cmp); if (l) { struct pending_auth_info *p = l->data; @@ -2670,7 +2670,7 @@ static void create_bond_req_exit(void *user_data) } } - adapter->pin_reqs = g_slist_remove(adapter->pin_reqs, p); + adapter->auth_reqs = g_slist_remove(adapter->auth_reqs, p); g_free(p); } @@ -2705,7 +2705,7 @@ static DBusMessage *create_bonding(DBusConnection *conn, DBusMessage *msg, if (adapter->bonding) return in_progress(msg, "Bonding in progress"); - if (g_slist_find_custom(adapter->pin_reqs, &bdaddr, pin_req_cmp)) + if (g_slist_find_custom(adapter->auth_reqs, &bdaddr, auth_req_cmp)) return in_progress(msg, "Bonding in progress"); /* check if a link key already exists */ @@ -2799,11 +2799,11 @@ static DBusMessage *adapter_cancel_bonding(DBusConnection *conn, adapter->bonding->cancel = 1; - l = g_slist_find_custom(adapter->pin_reqs, &bdaddr, pin_req_cmp); + l = g_slist_find_custom(adapter->auth_reqs, &bdaddr, auth_req_cmp); if (l) { - struct pending_auth_info *pin_req = l->data; + struct pending_auth_info *auth_req = l->data; - if (pin_req->replied) { + if (auth_req->replied) { /* * If disconnect can't be applied and the PIN code * request was already replied it doesn't make sense @@ -2820,13 +2820,13 @@ static DBusMessage *adapter_cancel_bonding(DBusConnection *conn, return failed_strerror(msg, err); } - cancel_auth_request(dd, pin_req->type, &pin_req->bdaddr); + cancel_auth_request(dd, auth_req->type, &auth_req->bdaddr); hci_close_dev(dd); } - adapter->pin_reqs = g_slist_remove(adapter->pin_reqs, pin_req); - g_free(pin_req); + adapter->auth_reqs = g_slist_remove(adapter->auth_reqs, auth_req); + g_free(auth_req); } g_io_channel_close(adapter->bonding->io); diff --git a/hcid/adapter.h b/hcid/adapter.h index ef579832..d361192f 100644 --- a/hcid/adapter.h +++ b/hcid/adapter.h @@ -117,7 +117,7 @@ struct adapter { struct agent *agent; /* For the new API */ GSList *active_conn; struct bonding_request_info *bonding; - GSList *pin_reqs; + GSList *auth_reqs; struct pending_dc_info *pending_dc; GSList *devices; /* Devices structure pointers */ GSList *sessions; /* Request Mode sessions */ diff --git a/hcid/dbus-hci.c b/hcid/dbus-hci.c index 43d89313..05f0c1ae 100644 --- a/hcid/dbus-hci.c +++ b/hcid/dbus-hci.c @@ -460,11 +460,11 @@ int unregister_adapter_path(const char *path) adapter->oor_devices = NULL; } - if (adapter->pin_reqs) { - g_slist_foreach(adapter->pin_reqs, + if (adapter->auth_reqs) { + g_slist_foreach(adapter->auth_reqs, (GFunc) g_free, NULL); - g_slist_free(adapter->pin_reqs); - adapter->pin_reqs = NULL; + g_slist_free(adapter->auth_reqs); + adapter->auth_reqs = NULL; } if (adapter->active_conn) { @@ -798,10 +798,10 @@ int hcid_dbus_stop_device(uint16_t id) adapter->oor_devices = NULL; } - if (adapter->pin_reqs) { - g_slist_foreach(adapter->pin_reqs, (GFunc) g_free, NULL); - g_slist_free(adapter->pin_reqs); - adapter->pin_reqs = NULL; + if (adapter->auth_reqs) { + g_slist_foreach(adapter->auth_reqs, (GFunc) g_free, NULL); + g_slist_free(adapter->auth_reqs); + adapter->auth_reqs = NULL; } if (adapter->active_conn) { @@ -833,7 +833,7 @@ int hcid_dbus_stop_device(uint16_t id) return 0; } -int pin_req_cmp(const void *p1, const void *p2) +int auth_req_cmp(const void *p1, const void *p2) { const struct pending_auth_info *pb1 = p1; const bdaddr_t *bda = p2; @@ -858,7 +858,7 @@ void hcid_dbus_new_auth_request(bdaddr_t *sba, bdaddr_t *dba, auth_type_t type) bacpy(&info->bdaddr, dba); info->type = type; - adapter->pin_reqs = g_slist_append(adapter->pin_reqs, info); + adapter->auth_reqs = g_slist_append(adapter->auth_reqs, info); if (adapter->bonding && !bacmp(dba, &adapter->bonding->bdaddr)) adapter->bonding->auth_active = 1; @@ -1201,14 +1201,14 @@ void hcid_dbus_bonding_process_complete(bdaddr_t *local, bdaddr_t *peer, adapter->path, peer); } - l = g_slist_find_custom(adapter->pin_reqs, peer, pin_req_cmp); + l = g_slist_find_custom(adapter->auth_reqs, peer, auth_req_cmp); if (!l) { debug("hcid_dbus_bonding_process_complete: no pending PIN request"); goto proceed; } d = l->data; - adapter->pin_reqs = g_slist_remove(adapter->pin_reqs, l->data); + adapter->auth_reqs = g_slist_remove(adapter->auth_reqs, l->data); g_free(d); if (status) @@ -1995,10 +1995,10 @@ void hcid_dbus_conn_complete(bdaddr_t *local, uint8_t status, uint16_t handle, adapter->path, peer); release_passkey_agents(adapter, peer); - l = g_slist_find_custom(adapter->pin_reqs, peer, pin_req_cmp); + l = g_slist_find_custom(adapter->auth_reqs, peer, auth_req_cmp); if (l) { - struct pending_pin_req *p = l->data; - adapter->pin_reqs = g_slist_remove(adapter->pin_reqs, p); + struct pending_auth_req *p = l->data; + adapter->auth_reqs = g_slist_remove(adapter->auth_reqs, p); g_free(p); } @@ -2071,10 +2071,10 @@ void hcid_dbus_disconn_complete(bdaddr_t *local, uint8_t status, &dev->bdaddr); release_passkey_agents(adapter, &dev->bdaddr); - l = g_slist_find_custom(adapter->pin_reqs, &dev->bdaddr, pin_req_cmp); + l = g_slist_find_custom(adapter->auth_reqs, &dev->bdaddr, auth_req_cmp); if (l) { - struct pending_pin_req *p = l->data; - adapter->pin_reqs = g_slist_remove(adapter->pin_reqs, p); + struct pending_auth_req *p = l->data; + adapter->auth_reqs = g_slist_remove(adapter->auth_reqs, p); g_free(p); } @@ -2427,7 +2427,7 @@ void hcid_dbus_pin_code_reply(bdaddr_t *local, void *ptr) return; } - l = g_slist_find_custom(adapter->pin_reqs, &ret->bdaddr, pin_req_cmp); + l = g_slist_find_custom(adapter->auth_reqs, &ret->bdaddr, auth_req_cmp); if (l) { struct pending_auth_info *p = l->data; p->replied = 1; diff --git a/hcid/dbus-hci.h b/hcid/dbus-hci.h index 9f782fc8..1c5bca90 100644 --- a/hcid/dbus-hci.h +++ b/hcid/dbus-hci.h @@ -73,7 +73,7 @@ int cancel_periodic_discovery(struct adapter *adapter); int active_conn_find_by_bdaddr(const void *data, const void *user_data); void bonding_request_free(struct bonding_request_info *dev); -int pin_req_cmp(const void *p1, const void *p2); +int auth_req_cmp(const void *p1, const void *p2); int found_device_cmp(const struct remote_dev_info *d1, const struct remote_dev_info *d2); int found_device_add(GSList **list, bdaddr_t *bdaddr, int8_t rssi, -- cgit