summaryrefslogtreecommitdiffstats
path: root/src/dbus-hci.c
diff options
context:
space:
mode:
authorAlok Barsode <alok.barsode@azingo.com>2008-09-03 13:31:51 +0530
committerAlok Barsode <alok.barsode@azingo.com>2008-09-03 13:31:51 +0530
commitf4b3a12b9a7449ab98e4d2a40c6e541d1bece92e (patch)
tree09cfe3a025d04af195f063e6a90dd2f63c85866c /src/dbus-hci.c
parentbcb5f7e4d5e570c1acfd5364547d36e970408394 (diff)
Adding adapter_free_bonding_request.
Diffstat (limited to 'src/dbus-hci.c')
-rw-r--r--src/dbus-hci.c49
1 files changed, 2 insertions, 47 deletions
diff --git a/src/dbus-hci.c b/src/dbus-hci.c
index 95bbc38c..703b2f41 100644
--- a/src/dbus-hci.c
+++ b/src/dbus-hci.c
@@ -60,37 +60,6 @@
static DBusConnection *connection = NULL;
-void bonding_request_free(struct bonding_request_info *bonding)
-{
- struct btd_device *device;
- char address[18];
- struct agent *agent;
-
- if (!bonding)
- return;
-
- if (bonding->msg)
- dbus_message_unref(bonding->msg);
-
- if (bonding->conn)
- dbus_connection_unref(bonding->conn);
-
- if (bonding->io)
- g_io_channel_unref(bonding->io);
-
- ba2str(&bonding->bdaddr, address);
-
- device = adapter_find_device(bonding->adapter, address);
- agent = device_get_agent(device);
-
- if (device && agent) {
- agent_destroy(agent, FALSE);
- device_set_agent(device, NULL);
- }
-
- g_free(bonding);
-}
-
DBusMessage *new_authentication_return(DBusMessage *msg, uint8_t status)
{
switch (status) {
@@ -621,13 +590,7 @@ proceed:
}
cleanup:
- g_dbus_remove_watch(connection, adapter->bonding->listener_id);
-
- if (adapter->bonding->io_id)
- g_source_remove(adapter->bonding->io_id);
- g_io_channel_close(adapter->bonding->io);
- bonding_request_free(adapter->bonding);
- adapter->bonding = NULL;
+ adapter_free_bonding_request(adapter);
}
void hcid_dbus_inquiry_start(bdaddr_t *local)
@@ -1156,15 +1119,7 @@ void hcid_dbus_disconn_complete(bdaddr_t *local, uint8_t status,
dbus_connection_send(connection, reply, NULL);
dbus_message_unref(reply);
}
-
- g_dbus_remove_watch(adapter->bonding->conn,
- adapter->bonding->listener_id);
-
- if (adapter->bonding->io_id)
- g_source_remove(adapter->bonding->io_id);
- g_io_channel_close(adapter->bonding->io);
- bonding_request_free(adapter->bonding);
- adapter->bonding = NULL;
+ adapter_free_bonding_request(adapter);
}
adapter_remove_active_conn(adapter, dev);