summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2008-06-08 20:49:54 +0000
committerMarcel Holtmann <marcel@holtmann.org>2008-06-08 20:49:54 +0000
commit32033cb14df0294a742e9e8c6b5ffa8aa26c2cc1 (patch)
treec2570aca66ea0a86383296fca81237cdcebb0045
parent6061f1a889c90d4d408ca12b63b2db6235c73bae (diff)
Make sure to probe drivers on startup
-rw-r--r--hcid/dbus-hci.c1
-rw-r--r--hcid/device.c7
-rw-r--r--hcid/device.h1
3 files changed, 5 insertions, 4 deletions
diff --git a/hcid/dbus-hci.c b/hcid/dbus-hci.c
index c0af3124..a15be13a 100644
--- a/hcid/dbus-hci.c
+++ b/hcid/dbus-hci.c
@@ -678,6 +678,7 @@ static void create_stored_device_from_profiles(char *key, char *value,
if (device) {
device->temporary = FALSE;
adapter->devices = g_slist_append(adapter->devices, device);
+ device_probe_drivers(device);
}
}
diff --git a/hcid/device.c b/hcid/device.c
index 7213cbf2..3264a8f6 100644
--- a/hcid/device.c
+++ b/hcid/device.c
@@ -1112,7 +1112,7 @@ gint device_address_cmp(struct device *device, const gchar *address)
return strcasecmp(device->address, address);
}
-static void probe_matching_drivers(struct device *device)
+void device_probe_drivers(struct device *device)
{
GSList *list;
const char **uuid;
@@ -1136,7 +1136,6 @@ static void probe_matching_drivers(struct device *device)
if (do_probe == TRUE && !g_slist_find_custom(device->drivers,
driver->name, (GCompareFunc) strcmp)) {
-
err = driver->probe(device->path);
if (err < 0)
error("probe failed for driver %s",
@@ -1219,8 +1218,8 @@ static void browse_cb(sdp_list_t *recs, int err, gpointer user_data)
return;
}
-probe:
- probe_matching_drivers(device);
+probe:
+ device_probe_drivers(device);
proceed:
g_dbus_emit_signal(req->conn, dbus_message_get_path(req->msg),
diff --git a/hcid/device.h b/hcid/device.h
index 2dd7e6c7..38ad8030 100644
--- a/hcid/device.h
+++ b/hcid/device.h
@@ -40,6 +40,7 @@ void device_remove(DBusConnection *conn, struct device *device);
gint device_address_cmp(struct device *device, const gchar *address);
int device_browse(struct device *device, DBusConnection *conn,
DBusMessage *msg);
+void device_probe_drivers(struct device *device);
#define BTD_UUIDS(args...) ((const char *[]) { args, NULL } )