summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2009-01-13 19:36:56 +0200
committerJohan Hedberg <johan.hedberg@nokia.com>2009-01-13 19:37:41 +0200
commit58c15493922277539cca11e8b55776c5d0fbccba (patch)
tree0bd713ca9693096cb8e257dcc58d0b523067fd0e
parent7b5212174affc3834d32b68b07370810f9592cb1 (diff)
Don't remove linkkeys upon adapter removal
-rw-r--r--src/adapter.c4
-rw-r--r--src/device.c5
-rw-r--r--src/device.h3
3 files changed, 7 insertions, 5 deletions
diff --git a/src/adapter.c b/src/adapter.c
index f3a304c7..131471d2 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -971,7 +971,7 @@ void adapter_remove_device(DBusConnection *conn, struct btd_adapter *adapter,
device_set_agent(device, NULL);
}
- device_remove(device, conn);
+ device_remove(device, conn, TRUE);
}
struct btd_device *adapter_get_device(DBusConnection *conn,
@@ -2352,7 +2352,7 @@ void adapter_remove(struct btd_adapter *adapter)
unload_drivers(adapter);
for (l = adapter->devices; l; l = l->next)
- device_remove(l->data, connection);
+ device_remove(l->data, connection, FALSE);
g_slist_free(adapter->devices);
/* Return adapter to down state if it was not up on init */
diff --git a/src/device.c b/src/device.c
index b920d5a2..02077f94 100644
--- a/src/device.c
+++ b/src/device.c
@@ -694,7 +694,8 @@ static void device_remove_bonding(struct btd_device *device, DBusConnection *con
"Paired", DBUS_TYPE_BOOLEAN, &paired);
}
-void device_remove(struct btd_device *device, DBusConnection *conn)
+void device_remove(struct btd_device *device, DBusConnection *conn,
+ gboolean remove_bonding)
{
GSList *list;
struct btd_device_driver *driver;
@@ -705,7 +706,7 @@ void device_remove(struct btd_device *device, DBusConnection *conn)
if (device->bonding)
device_cancel_bonding(device, HCI_OE_USER_ENDED_CONNECTION);
- if (!device->temporary)
+ if (!device->temporary && remove_bonding)
device_remove_bonding(device, conn);
for (list = device->drivers; list; list = list->next) {
diff --git a/src/device.h b/src/device.h
index bc28755f..75119e12 100644
--- a/src/device.h
+++ b/src/device.h
@@ -36,7 +36,8 @@ typedef enum {
struct btd_device *device_create(DBusConnection *conn, struct btd_adapter *adapter,
const gchar *address);
-void device_remove(struct btd_device *device, DBusConnection *conn);
+void device_remove(struct btd_device *device, DBusConnection *conn,
+ gboolean remove_bonding);
gint device_address_cmp(struct btd_device *device, const gchar *address);
int device_browse(struct btd_device *device, DBusConnection *conn,
DBusMessage *msg, uuid_t *search, gboolean reverse);