summaryrefslogtreecommitdiffstats
path: root/input
diff options
context:
space:
mode:
Diffstat (limited to 'input')
-rw-r--r--input/device.c23
-rw-r--r--input/device.h23
-rw-r--r--input/manager.c9
3 files changed, 27 insertions, 28 deletions
diff --git a/input/device.c b/input/device.c
index 8f255fd7..7e7325fb 100644
--- a/input/device.c
+++ b/input/device.c
@@ -61,29 +61,6 @@
#define UPDOWN_ENABLED 1
-struct fake_input {
- GIOChannel *io;
- int rfcomm; /* RFCOMM socket */
- int uinput; /* uinput socket */
- uint8_t ch; /* RFCOMM channel number */
-};
-
-struct pending_connect {
- DBusConnection *conn;
- DBusMessage *msg;
-};
-
-struct input_device {
- bdaddr_t src;
- bdaddr_t dst;
- char *name;
- uint8_t major;
- uint8_t minor;
- struct hidp_connadd_req hidp; /* FIXME: Use dynamic alloc? */
- struct fake_input *fake;
- struct pending_connect *pending_connect;
-};
-
static struct input_device *input_device_new(bdaddr_t *src, bdaddr_t *dst)
{
struct input_device *idev;
diff --git a/input/device.h b/input/device.h
index b51056e2..604d7b79 100644
--- a/input/device.h
+++ b/input/device.h
@@ -21,6 +21,29 @@
*
*/
+struct fake_input {
+ GIOChannel *io;
+ int rfcomm; /* RFCOMM socket */
+ int uinput; /* uinput socket */
+ uint8_t ch; /* RFCOMM channel number */
+};
+
+struct pending_connect {
+ DBusConnection *conn;
+ DBusMessage *msg;
+};
+
+struct input_device {
+ bdaddr_t src;
+ bdaddr_t dst;
+ char *name;
+ uint8_t major;
+ uint8_t minor;
+ struct hidp_connadd_req hidp; /* FIXME: Use dynamic alloc? */
+ struct fake_input *fake;
+ struct pending_connect *pending_connect;
+};
+
int input_device_register(DBusConnection *conn, bdaddr_t *src, bdaddr_t *dst,
struct hidp_connadd_req *hidp, const char **path);
int fake_input_register(DBusConnection *conn, bdaddr_t *src,
diff --git a/input/manager.c b/input/manager.c
index 143471bc..38020a22 100644
--- a/input/manager.c
+++ b/input/manager.c
@@ -103,7 +103,6 @@ static void pending_req_free(struct pending_req *pr)
g_free(pr);
}
-#if 0
static int path_bdaddr_cmp(const char *path, const bdaddr_t *bdaddr)
{
struct input_device *idev;
@@ -117,7 +116,7 @@ static int path_bdaddr_cmp(const char *path, const bdaddr_t *bdaddr)
return bacmp(&idev->dst, bdaddr);
}
-#endif
+
static int get_record(struct pending_req *pr, uint32_t handle,
DBusPendingCallNotifyFunction cb)
{
@@ -589,6 +588,7 @@ static DBusHandlerResult manager_create_device(DBusConnection *conn,
DBusError derr;
char adapter[18], adapter_path[32];
const char *addr;
+ GSList *l;
bdaddr_t dst;
uint32_t cls = 0;
int dev_id;
@@ -603,13 +603,12 @@ static DBusHandlerResult manager_create_device(DBusConnection *conn,
}
str2ba(addr, &dst);
-#if 0
- /* FIXME */
+
l = g_slist_find_custom(mgr->paths, &dst,
(GCompareFunc) path_bdaddr_cmp);
if (l)
return err_already_exists(conn, msg, "Input Already exists");
-#endif
+
/* FIXME: Move the following code to pending_req_new() */
ba2str(&mgr->src, adapter);
dev_id = hci_devid(adapter);