OSDN Git Service

Remove driver.c driver.h and remove workaround for to force a symbol resolution.
authorLuiz Augusto von Dentz <luiz.dentz@indt.org.br>
Mon, 18 Aug 2008 22:20:42 +0000 (19:20 -0300)
committerLuiz Augusto von Dentz <luiz.dentz@indt.org.br>
Mon, 18 Aug 2008 22:20:42 +0000 (19:20 -0300)
19 files changed:
audio/avdtp.c
audio/control.c
audio/manager.c
input/main.c
input/manager.c
input/server.c
network/manager.c
network/server.c
plugins/echo.c
serial/manager.c
src/Makefile.am
src/adapter.c
src/adapter.h
src/dbus-service.c [deleted file]
src/dbus-service.h [deleted file]
src/device.c
src/device.h
src/driver.c [deleted file]
src/driver.h [deleted file]

index bda21ac..c215ca2 100644 (file)
@@ -40,9 +40,9 @@
 #include <glib.h>
 #include <dbus/dbus.h>
 
-#include "dbus-service.h"
 #include "logging.h"
 
+#include "adapter.h"
 #include "device.h"
 #include "manager.h"
 #include "control.h"
@@ -2684,7 +2684,7 @@ static void auth_cb(DBusError *derr, void *user_data)
                error("Access denied: %s", derr->message);
                if (dbus_error_has_name(derr, DBUS_ERROR_NO_REPLY)) {
                        debug("Canceling authorization request");
-                       service_cancel_auth(&session->src, &session->dst);
+                       btd_cancel_authorization(&session->src, &session->dst);
                }
 
                connection_lost(session, -EACCES);
@@ -2757,8 +2757,9 @@ static void avdtp_server_cb(GIOChannel *chan, int err, const bdaddr_t *src,
                                        (GIOFunc) session_cb, session);
        g_io_channel_unref(chan);
 
-       if (service_req_auth(src, dst, ADVANCED_AUDIO_UUID, auth_cb,
-                       session) < 0) {
+       err = btd_request_authorization(src, dst, ADVANCED_AUDIO_UUID,
+                               auth_cb, session);
+       if (err < 0) {
                avdtp_unref(session);
                goto drop;
        }
index 2a5e5e2..8264606 100644 (file)
@@ -46,9 +46,9 @@
 #include <dbus/dbus.h>
 #include <gdbus.h>
 
-#include "dbus-service.h"
 #include "logging.h"
 #include "uinput.h"
+#include "adapter.h"
 #include "device.h"
 #include "manager.h"
 #include "avdtp.h"
@@ -629,7 +629,7 @@ static void auth_cb(DBusError *derr, void *user_data)
                error("Access denied: %s", derr->message);
                if (dbus_error_has_name(derr, DBUS_ERROR_NO_REPLY)) {
                        debug("Canceling authorization request");
-                       service_cancel_auth(&session->src, &session->dst);
+                       btd_cancel_authorization(&session->src, &session->dst);
                }
 
                avctp_unref(session);
@@ -687,7 +687,9 @@ static void avctp_server_cb(GIOChannel *chan, int err, const bdaddr_t *src,
        if (avdtp_is_connected(src, dst))
                goto proceed;
 
-       if (service_req_auth(src, dst, AVRCP_TARGET_UUID, auth_cb, session) < 0)
+       err = btd_request_authorization(src, dst, AVRCP_TARGET_UUID,
+                               auth_cb, session);
+       if (err < 0)
                goto drop;
 
        return;
index 6d17a5f..5a363f9 100644 (file)
@@ -51,9 +51,7 @@
 #include "glib-helper.h"
 #include "../src/adapter.h"
 #include "../src/device.h"
-#include "../src/driver.h"
 
-#include "dbus-service.h"
 #include "logging.h"
 #include "textfile.h"
 #include "ipc.h"
@@ -458,7 +456,7 @@ static void auth_cb(DBusError *derr, void *user_data)
                error("Access denied: %s", derr->message);
                if (dbus_error_has_name(derr, DBUS_ERROR_NO_REPLY)) {
                        debug("Canceling authorization request");
-                       service_cancel_auth(&device->src, &device->dst);
+                       btd_cancel_authorization(&device->src, &device->dst);
                }
 
                headset_set_state(device, HEADSET_STATE_DISCONNECTED);
@@ -512,8 +510,8 @@ static void ag_io_cb(GIOChannel *chan, int err, const bdaddr_t *src,
                goto drop;
        }
 
-       err = service_req_auth(&device->src, &device->dst, uuid, auth_cb,
-                               device);
+       err = btd_request_authorization(&device->src, &device->dst, uuid,
+                               auth_cb, device);
        if (err < 0) {
                debug("Authorization denied: %s", strerror(-err));
                headset_close_rfcomm(device);
index d70bf2a..d3d152e 100644 (file)
@@ -34,7 +34,6 @@
 
 #include "plugin.h"
 #include "logging.h"
-#include "dbus-service.h"
 #include "manager.h"
 
 static GKeyFile *load_config_file(const char *file)
index 4a461b4..b8f8b2d 100644 (file)
@@ -46,7 +46,6 @@
 #include "textfile.h"
 #include "../src/adapter.h"
 #include "../src/device.h"
-#include "../src/driver.h"
 
 #include "device.h"
 #include "server.h"
index 9267e4a..d8bd192 100644 (file)
 
 #include "logging.h"
 
+#include "adapter.h"
 #include "device.h"
 #include "server.h"
 #include "storage.h"
-#include "dbus-service.h"
 #include "glib-helper.h"
 
 static const char *HID_UUID = "00001124-0000-1000-8000-00805f9b34fb";
@@ -64,7 +64,7 @@ static void auth_callback(DBusError *derr, void *user_data)
        if (derr) {
                error("Access denied: %s", derr->message);
                if (dbus_error_has_name(derr, DBUS_ERROR_NO_REPLY))
-                       service_cancel_auth(&auth->src, &auth->dst);
+                       btd_cancel_authorization(&auth->src, &auth->dst);
 
                input_device_close_channels(&auth->src, &auth->dst);
        } else
@@ -81,7 +81,7 @@ static int authorize_device(const bdaddr_t *src, const bdaddr_t *dst)
        bacpy(&auth->src, src);
        bacpy(&auth->dst, dst);
 
-       return service_req_auth(src, dst, HID_UUID,
+       return btd_request_authorization(src, dst, HID_UUID,
                                auth_callback, auth);
 }
 
index c03b794..7cbf822 100644 (file)
@@ -47,7 +47,6 @@
 
 #include "adapter.h"
 #include "device.h"
-#include "driver.h"
 #include "error.h"
 #include "bridge.h"
 #include "manager.h"
index ec0c490..aafdd4f 100644 (file)
 #include <gdbus.h>
 
 #include "../src/dbus-common.h"
+#include "../src/adapter.h"
 
 #include "logging.h"
 #include "error.h"
 #include "textfile.h"
-#include "dbus-service.h"
 #include "sdpd.h"
 #include "glib-helper.h"
 
@@ -359,7 +359,7 @@ static void req_auth_cb(DBusError *derr, void *user_data)
                if (dbus_error_has_name(derr, DBUS_ERROR_NO_REPLY)) {
                        bdaddr_t dst;
                        str2ba(setup->address, &dst);
-                       service_cancel_auth(&na->src, &dst);
+                       btd_cancel_authorization(&na->src, &dst);
                }
                val = BNEP_CONN_NOT_ALLOWED;
                goto done;
@@ -387,7 +387,8 @@ static int authorize_connection(struct network_server *ns, const char *address)
        uuid = bnep_uuid(ns->id);
        str2ba(address, &dst);
 
-       ret_val = service_req_auth(&na->src, &dst, uuid, req_auth_cb, ns);
+       ret_val = btd_request_authorization(&na->src, &dst, uuid,
+                               req_auth_cb, ns);
 
        return ret_val;
 }
index 7a5ad8d..ead488e 100644 (file)
@@ -38,7 +38,6 @@
 
 #include "plugin.h"
 #include "adapter.h"
-#include "driver.h"
 #include "logging.h"
 
 static gboolean session_event(GIOChannel *chan,
index 05af27b..6bcb3dd 100644 (file)
@@ -54,7 +54,6 @@
 #include "../src/dbus-common.h"
 #include "adapter.h"
 #include "device.h"
-#include "driver.h"
 
 #include "logging.h"
 #include "textfile.h"
index 4b504ad..e44ae57 100644 (file)
@@ -21,8 +21,8 @@ bluetoothd_SOURCES = main.c hcid.h sdpd.h \
        manager.h manager.c error.h error.c \
        adapter.h adapter.c device.h device.c plugin.h plugin.c \
        dbus-common.c dbus-common.h dbus-hci.h dbus-hci.c \
-       dbus-database.c dbus-database.h dbus-service.c dbus-service.h \
-       telephony.h telephony.c agent.h agent.c driver.h driver.c
+       dbus-database.c dbus-database.h \
+       telephony.h telephony.c agent.h agent.c
 
 bluetoothd_LDADD = $(top_builddir)/common/libhelper.a \
        @GDBUS_LIBS@ @GMODULE_LIBS@ @GLIB_LIBS@ @DBUS_LIBS@ @BLUEZ_LIBS@
index 70adab2..e8e2771 100644 (file)
@@ -51,6 +51,7 @@
 #include "hcid.h"
 #include "sdpd.h"
 
+#include "manager.h"
 #include "adapter.h"
 #include "device.h"
 
@@ -63,7 +64,6 @@
 #include "glib-helper.h"
 #include "logging.h"
 #include "agent.h"
-#include "driver.h"
 
 #define NUM_ELEMENTS(table) (sizeof(table)/sizeof(const char *))
 
@@ -74,6 +74,7 @@
 #define IO_CAPABILITY_INVALID          0xFF
 
 static DBusConnection *connection = NULL;
+static GSList *adapter_drivers = NULL;
 
 struct record_list {
   sdp_list_t *recs;
@@ -88,6 +89,11 @@ struct mode_req {
        guint           id;             /* Listener id */
 };
 
+struct service_auth {
+       service_auth_cb cb;
+       void *user_data;
+};
+
 static inline DBusMessage *invalid_args(DBusMessage *msg)
 {
        return g_dbus_create_error(msg, ERROR_INTERFACE ".InvalidArguments",
@@ -2220,7 +2226,7 @@ static void load_drivers(struct adapter *adapter)
 {
        GSList *l;
 
-       for (l = btd_get_adapter_drivers(); l; l = l->next) {
+       for (l = adapter_drivers; l; l = l->next) {
                struct btd_adapter_driver *driver = l->data;
 
                if (driver->probe)
@@ -2436,7 +2442,7 @@ static void unload_drivers(struct adapter *adapter)
 {
        GSList *l;
 
-       for (l = btd_get_adapter_drivers(); l; l = l->next) {
+       for (l = adapter_drivers; l; l = l->next) {
                struct btd_adapter_driver *driver = l->data;
 
                if (driver->remove)
@@ -2757,3 +2763,110 @@ int adapter_get_state(struct adapter *adapter)
 {
        return adapter->state;
 }
+
+int btd_register_adapter_driver(struct btd_adapter_driver *driver)
+{
+       adapter_drivers = g_slist_append(adapter_drivers, driver);
+
+       return 0;
+}
+
+void btd_unregister_adapter_driver(struct btd_adapter_driver *driver)
+{
+       adapter_drivers = g_slist_remove(adapter_drivers, driver);
+}
+
+static void agent_auth_cb(struct agent *agent, DBusError *derr, void *user_data)
+{
+       struct service_auth *auth = user_data;
+
+       auth->cb(derr, auth->user_data);
+
+       g_free(auth);
+}
+
+int btd_request_authorization(const bdaddr_t *src, const bdaddr_t *dst,
+               const char *uuid, service_auth_cb cb, void *user_data)
+{
+       struct service_auth *auth;
+       struct adapter *adapter;
+       struct btd_device *device;
+       struct agent *agent;
+       char address[18];
+       gboolean trusted;
+       const gchar *dev_path;
+
+       if (src == NULL || dst == NULL)
+               return -EINVAL;
+
+       adapter = manager_find_adapter(src);
+       if (!adapter)
+               return -EPERM;
+
+       /* Device connected? */
+       if (!g_slist_find_custom(adapter->active_conn,
+                               dst, active_conn_find_by_bdaddr))
+               return -ENOTCONN;
+
+       ba2str(dst, address);
+       trusted = read_trust(src, address, GLOBAL_TRUST);
+
+       if (trusted) {
+               cb(NULL, user_data);
+               return 0;
+       }
+
+       device = adapter_find_device(adapter, address);
+       if (!device)
+               return -EPERM;
+
+       agent = device_get_agent(device);
+
+       if (!agent)
+               agent =  adapter->agent;
+
+       if (!agent)
+               return -EPERM;
+
+       auth = g_try_new0(struct service_auth, 1);
+       if (!auth)
+               return -ENOMEM;
+
+       auth->cb = cb;
+       auth->user_data = user_data;
+
+       dev_path = device_get_path(device);
+
+       return agent_authorize(agent, dev_path, uuid, agent_auth_cb, auth);
+}
+
+int btd_cancel_authorization(const bdaddr_t *src, const bdaddr_t *dst)
+{
+       struct adapter *adapter = manager_find_adapter(src);
+       struct btd_device *device;
+       struct agent *agent;
+       char address[18];
+
+       if (!adapter)
+               return -EPERM;
+
+       ba2str(dst, address);
+       device = adapter_find_device(adapter, address);
+       if (!device)
+               return -EPERM;
+
+       /*
+        * FIXME: Cancel fails if authorization is requested to adapter's
+        * agent and in the meanwhile CreatePairedDevice is called.
+        */
+
+       agent = device_get_agent(device);
+
+       if (!agent)
+               agent =  adapter->agent;
+
+       if (!agent)
+               return -EPERM;
+
+       return agent_cancel(agent);
+}
index 7ea6fb2..729ef68 100644 (file)
@@ -180,3 +180,17 @@ void adapter_set_mode(struct adapter *adapter, uint8_t mode);
 uint8_t adapter_get_mode(struct adapter *adapter);
 void adapter_set_state(struct adapter *adapter, int state);
 int adapter_get_state(struct adapter *adapter);
+
+struct btd_adapter_driver {
+       const char *name;
+       int (*probe) (struct adapter *adapter);
+       void (*remove) (struct adapter *adapter);
+};
+
+typedef void (*service_auth_cb) (DBusError *derr, void *user_data);
+
+int btd_register_adapter_driver(struct btd_adapter_driver *driver);
+void btd_unregister_adapter_driver(struct btd_adapter_driver *driver);
+int btd_request_authorization(const bdaddr_t *src, const bdaddr_t *dst,
+               const char *uuid, service_auth_cb cb, void *user_data);
+int btd_cancel_authorization(const bdaddr_t *src, const bdaddr_t *dst);
diff --git a/src/dbus-service.c b/src/dbus-service.c
deleted file mode 100644 (file)
index 6673575..0000000
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- *
- *  BlueZ - Bluetooth protocol stack for Linux
- *
- *  Copyright (C) 2006-2007  Nokia Corporation
- *  Copyright (C) 2004-2008  Marcel Holtmann <marcel@holtmann.org>
- *
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- *
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <errno.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <dirent.h>
-#include <signal.h>
-#include <ctype.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-
-#include <bluetooth/bluetooth.h>
-#include <bluetooth/hci.h>
-#include <bluetooth/hci_lib.h>
-#include <bluetooth/sdp.h>
-
-#include <glib.h>
-#include <dbus/dbus.h>
-#include <gdbus.h>
-
-#include "hcid.h"
-#include "dbus-common.h"
-#include "error.h"
-#include "manager.h"
-#include "adapter.h"
-#include "agent.h"
-#include "device.h"
-#include "dbus-service.h"
-#include "dbus-hci.h"
-
-struct service_auth {
-       service_auth_cb cb;
-       void *user_data;
-};
-
-static void agent_auth_cb(struct agent *agent, DBusError *derr, void *user_data)
-{
-       struct service_auth *auth = user_data;
-
-       auth->cb(derr, auth->user_data);
-
-       g_free(auth);
-}
-
-int service_req_auth(const bdaddr_t *src, const bdaddr_t *dst,
-               const char *uuid, service_auth_cb cb, void *user_data)
-{
-       struct service_auth *auth;
-       struct adapter *adapter;
-       struct btd_device *device;
-       struct agent *agent;
-       char address[18];
-       gboolean trusted;
-       const gchar *dev_path;
-
-       if (src == NULL || dst == NULL)
-               return -EINVAL;
-
-       adapter = manager_find_adapter(src);
-       if (!adapter)
-               return -EPERM;
-
-       /* Device connected? */
-       if (!g_slist_find_custom(adapter->active_conn,
-                               dst, active_conn_find_by_bdaddr))
-               return -ENOTCONN;
-
-       ba2str(dst, address);
-       trusted = read_trust(src, address, GLOBAL_TRUST);
-
-       if (trusted) {
-               cb(NULL, user_data);
-               return 0;
-       }
-
-       device = adapter_find_device(adapter, address);
-       if (!device)
-               return -EPERM;
-
-       agent = device_get_agent(device);
-
-       if (!agent)
-               agent =  adapter->agent;
-
-       if (!agent)
-               return -EPERM;
-
-       auth = g_try_new0(struct service_auth, 1);
-       if (!auth)
-               return -ENOMEM;
-
-       auth->cb = cb;
-       auth->user_data = user_data;
-
-       dev_path = device_get_path(device);
-
-       return agent_authorize(agent, dev_path, uuid, agent_auth_cb, auth);
-}
-
-int service_cancel_auth(const bdaddr_t *src, const bdaddr_t *dst)
-{
-       struct adapter *adapter = manager_find_adapter(src);
-       struct btd_device *device;
-       struct agent *agent;
-       char address[18];
-
-       if (!adapter)
-               return -EPERM;
-
-       ba2str(dst, address);
-       device = adapter_find_device(adapter, address);
-       if (!device)
-               return -EPERM;
-
-       /*
-        * FIXME: Cancel fails if authorization is requested to adapter's
-        * agent and in the meanwhile CreatePairedDevice is called.
-        */
-
-       agent = device_get_agent(device);
-
-       if (!agent)
-               agent =  adapter->agent;
-
-       if (!agent)
-               return -EPERM;
-
-       return agent_cancel(agent);
-}
diff --git a/src/dbus-service.h b/src/dbus-service.h
deleted file mode 100644 (file)
index 374f900..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- *
- *  BlueZ - Bluetooth protocol stack for Linux
- *
- *  Copyright (C) 2006-2007  Nokia Corporation
- *  Copyright (C) 2004-2008  Marcel Holtmann <marcel@holtmann.org>
- *
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- *
- */
-
-typedef void (*service_auth_cb) (DBusError *derr, void *user_data);
-int service_req_auth(const bdaddr_t *src, const bdaddr_t *dst,
-               const char *uuid, service_auth_cb cb, void *user_data);
-int service_cancel_auth(const bdaddr_t *src, const bdaddr_t *dst);
index b22695e..a8f40f8 100644 (file)
@@ -61,7 +61,6 @@
 #include "glib-helper.h"
 #include "agent.h"
 #include "sdp-xml.h"
-#include "driver.h"
 
 #define DEFAULT_XML_BUF_SIZE   1024
 #define DISCONNECT_TIMER       2
@@ -110,6 +109,8 @@ static uint16_t uuid_list[] = {
        0
 };
 
+static GSList *device_drivers = NULL;
+
 static void device_free(gpointer user_data)
 {
        struct btd_device *device = user_data;
@@ -618,13 +619,13 @@ sdp_record_t *get_record(sdp_list_t *recs, const char *uuid)
 
 void device_probe_drivers(struct btd_device *device, GSList *uuids, sdp_list_t *recs)
 {
-       GSList *list = btd_get_device_drivers();
+       GSList *list;
        const char **uuid;
        int err;
 
        debug("Probe drivers for %s", device->path);
 
-       for (; list; list = list->next) {
+       for (list = device_drivers; list; list = list->next) {
                struct btd_device_driver *driver = list->data;
                GSList *records = NULL;
 
@@ -1083,3 +1084,15 @@ uint8_t device_get_auth(struct btd_device *device)
 {
        return device->auth;
 }
+
+int btd_register_device_driver(struct btd_device_driver *driver)
+{
+       device_drivers = g_slist_append(device_drivers, driver);
+
+       return 0;
+}
+
+void btd_unregister_device_driver(struct btd_device_driver *driver)
+{
+       device_drivers = g_slist_remove(device_drivers, driver);
+}
index c29d670..bbb0846 100644 (file)
@@ -42,3 +42,15 @@ void device_set_temporary(struct btd_device *device, gboolean temporary);
 void device_set_cap(struct btd_device *device, uint8_t cap);
 void device_set_auth(struct btd_device *device, uint8_t auth);
 uint8_t device_get_auth(struct btd_device *device);
+
+#define BTD_UUIDS(args...) ((const char *[]) { args, NULL } )
+
+struct btd_device_driver {
+       const char *name;
+       const char **uuids;
+       int (*probe) (struct btd_device *device, GSList *records);
+       void (*remove) (struct btd_device *device);
+};
+
+int btd_register_device_driver(struct btd_device_driver *driver);
+void btd_unregister_device_driver(struct btd_device_driver *driver);
diff --git a/src/driver.c b/src/driver.c
deleted file mode 100644 (file)
index 5c47a25..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- *
- *  BlueZ - Bluetooth protocol stack for Linux
- *
- *  Copyright (C) 2006-2007  Nokia Corporation
- *  Copyright (C) 2004-2008  Marcel Holtmann <marcel@holtmann.org>
- *
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- *
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <bluetooth/bluetooth.h>
-
-#include <dbus/dbus.h>
-#include <glib.h>
-
-#include "logging.h"
-
-#include "driver.h"
-#include "dbus-service.h"
-
-static GSList *device_drivers = NULL;
-static GSList *adapter_drivers = NULL;
-
-int btd_register_device_driver(struct btd_device_driver *driver)
-{
-       const char **uuid;
-
-       /* FIXME: hack to make hci to resolve service_req_auth symbol*/
-       service_req_auth(NULL, NULL, NULL, NULL, NULL);
-       device_drivers = g_slist_append(device_drivers, driver);
-
-       for (uuid = driver->uuids; *uuid; uuid++) {
-               debug("name %s uuid %s", driver->name, *uuid);
-       }
-
-       return 0;
-}
-
-void btd_unregister_device_driver(struct btd_device_driver *driver)
-{
-       device_drivers = g_slist_remove(device_drivers, driver);
-}
-
-GSList *btd_get_device_drivers()
-{
-       return device_drivers;
-}
-
-int btd_register_adapter_driver(struct btd_adapter_driver *driver)
-{
-       adapter_drivers = g_slist_append(adapter_drivers, driver);
-
-       return 0;
-}
-
-void btd_unregister_adapter_driver(struct btd_adapter_driver *driver)
-{
-       adapter_drivers = g_slist_remove(adapter_drivers, driver);
-}
-
-GSList *btd_get_adapter_drivers()
-{
-       return adapter_drivers;
-}
diff --git a/src/driver.h b/src/driver.h
deleted file mode 100644 (file)
index e27c7de..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- *
- *  BlueZ - Bluetooth protocol stack for Linux
- *
- *  Copyright (C) 2006-2007  Nokia Corporation
- *  Copyright (C) 2004-2008  Marcel Holtmann <marcel@holtmann.org>
- *
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- *
- */
-
-#define BTD_UUIDS(args...) ((const char *[]) { args, NULL } )
-
-struct btd_device;
-
-struct btd_device_driver {
-       const char *name;
-       const char **uuids;
-       int (*probe) (struct btd_device *device, GSList *records);
-       void (*remove) (struct btd_device *device);
-};
-
-int btd_register_device_driver(struct btd_device_driver *driver);
-void btd_unregister_device_driver(struct btd_device_driver *driver);
-GSList *btd_get_device_drivers(void);
-
-struct adapter;
-
-struct btd_adapter_driver {
-       const char *name;
-       int (*probe) (struct adapter *adapter);
-       void (*remove) (struct adapter *adapter);
-};
-
-int btd_register_adapter_driver(struct btd_adapter_driver *driver);
-void btd_unregister_adapter_driver(struct btd_adapter_driver *driver);
-GSList *btd_get_adapter_drivers(void);