• Home
  • Raw
  • Download

Lines Matching refs:idev

78 	struct input_device	*idev;  member
98 struct input_device *idev = list->data; in find_device_by_path() local
100 if (!strcmp(idev->path, path)) in find_device_by_path()
101 return idev; in find_device_by_path()
145 static void input_device_free(struct input_device *idev) in input_device_free() argument
147 if (idev->dc_id) in input_device_free()
148 device_remove_disconnect_watch(idev->device, idev->dc_id); in input_device_free()
150 dbus_connection_unref(idev->conn); in input_device_free()
151 btd_device_unref(idev->device); in input_device_free()
152 g_free(idev->name); in input_device_free()
153 g_free(idev->path); in input_device_free()
154 g_free(idev); in input_device_free()
320 struct input_device *idev = iconn->idev; in rfcomm_connect_cb() local
335 fake->uinput = uinput_create(idev->name); in rfcomm_connect_cb()
350 g_dbus_send_message(idev->conn, reply); in rfcomm_connect_cb()
358 g_dbus_send_message(idev->conn, reply); in rfcomm_connect_cb()
365 struct input_device *idev = iconn->idev; in rfcomm_connect() local
370 BT_IO_OPT_SOURCE_BDADDR, &idev->src, in rfcomm_connect()
371 BT_IO_OPT_DEST_BDADDR, &idev->dst, in rfcomm_connect()
385 struct input_device *idev = iconn->idev; in intr_watch_cb() local
394 emit_property_changed(idev->conn, idev->path, INPUT_DEVICE_INTERFACE, in intr_watch_cb()
397 device_remove_disconnect_watch(idev->device, idev->dc_id); in intr_watch_cb()
398 idev->dc_id = 0; in intr_watch_cb()
572 static int hidp_add_connection(const struct input_device *idev, in hidp_add_connection() argument
588 ba2str(&idev->src, src_addr); in hidp_add_connection()
589 ba2str(&idev->dst, dst_addr); in hidp_add_connection()
591 rec = fetch_record(src_addr, dst_addr, idev->handle); in hidp_add_connection()
611 fake->idev = idev; in hidp_add_connection()
620 if (idev->name) in hidp_add_connection()
621 strncpy(req->name, idev->name, sizeof(req->name) - 1); in hidp_add_connection()
625 struct btd_adapter *adapter = device_get_adapter(idev->device); in hidp_add_connection()
627 err = btd_adapter_encrypt_link(adapter, (bdaddr_t *) &idev->dst, in hidp_add_connection()
649 struct input_device *idev = iconn->idev; in is_connected() local
664 bacpy(&ci.bdaddr, &idev->dst); in is_connected()
680 struct input_device *idev = iconn->idev; in connection_disconnect() local
707 bacpy(&ci.bdaddr, &idev->dst); in connection_disconnect()
715 bacpy(&req.bdaddr, &idev->dst); in connection_disconnect()
735 static int disconnect(struct input_device *idev, uint32_t flags) in disconnect() argument
740 for (l = idev->connections; l; l = l->next) { in disconnect()
756 struct input_device *idev = user_data; in disconnect_cb() local
759 info("Input: disconnect %s", idev->path); in disconnect_cb()
763 disconnect(idev, flags); in disconnect_cb()
766 static int input_device_connected(struct input_device *idev, in input_device_connected() argument
775 err = hidp_add_connection(idev, iconn); in input_device_connected()
787 emit_property_changed(idev->conn, idev->path, INPUT_DEVICE_INTERFACE, in input_device_connected()
790 idev->dc_id = device_add_disconnect_watch(idev->device, disconnect_cb, in input_device_connected()
791 idev, NULL); in input_device_connected()
800 struct input_device *idev = iconn->idev; in interrupt_connect_cb() local
810 err = input_device_connected(idev, iconn); in interrupt_connect_cb()
817 g_dbus_send_reply(idev->conn, iconn->pending_connect, DBUS_TYPE_INVALID); in interrupt_connect_cb()
827 g_dbus_send_message(idev->conn, reply); in interrupt_connect_cb()
848 struct input_device *idev = iconn->idev; in control_connect_cb() local
863 BT_IO_OPT_SOURCE_BDADDR, &idev->src, in control_connect_cb()
864 BT_IO_OPT_DEST_BDADDR, &idev->dst, in control_connect_cb()
884 g_dbus_send_message(idev->conn, reply); in control_connect_cb()
915 struct input_device *idev = data; in input_device_connect() local
921 iconn = find_connection(idev->connections, "HID"); in input_device_connect()
944 BT_IO_OPT_SOURCE_BDADDR, &idev->src, in input_device_connect()
945 BT_IO_OPT_DEST_BDADDR, &idev->dst, in input_device_connect()
967 struct input_device *idev = data; in input_device_disconnect() local
970 err = disconnect(idev, 0); in input_device_disconnect()
979 struct input_device *idev = data; in device_unregister() local
982 idev->path); in device_unregister()
984 devices = g_slist_remove(devices, idev); in device_unregister()
985 input_device_free(idev); in device_unregister()
998 struct input_device *idev = data; in input_device_get_properties() local
1016 connected = !!g_slist_find_custom(idev->connections, NULL, in input_device_get_properties()
1043 struct input_device *idev; in input_device_new() local
1046 idev = g_new0(struct input_device, 1); in input_device_new()
1047 bacpy(&idev->src, src); in input_device_new()
1048 bacpy(&idev->dst, dst); in input_device_new()
1049 idev->device = btd_device_ref(device); in input_device_new()
1050 idev->path = g_strdup(path); in input_device_new()
1051 idev->conn = dbus_connection_ref(conn); in input_device_new()
1052 idev->handle = handle; in input_device_new()
1057 idev->name = g_strdup(name); in input_device_new()
1059 if (g_dbus_register_interface(conn, idev->path, INPUT_DEVICE_INTERFACE, in input_device_new()
1061 idev, device_unregister) == FALSE) { in input_device_new()
1064 input_device_free(idev); in input_device_new()
1069 INPUT_DEVICE_INTERFACE, idev->path); in input_device_new()
1071 return idev; in input_device_new()
1074 static struct input_conn *input_conn_new(struct input_device *idev, in input_conn_new() argument
1084 iconn->idev = idev; in input_conn_new()
1094 struct input_device *idev; in input_device_register() local
1097 idev = find_device_by_path(devices, path); in input_device_register()
1098 if (!idev) { in input_device_register()
1099 idev = input_device_new(conn, device, path, src, dst, handle); in input_device_register()
1100 if (!idev) in input_device_register()
1102 devices = g_slist_append(devices, idev); in input_device_register()
1105 iconn = input_conn_new(idev, uuid, "hid", timeout); in input_device_register()
1109 idev->connections = g_slist_append(idev->connections, iconn); in input_device_register()
1118 struct input_device *idev; in fake_input_register() local
1121 idev = find_device_by_path(devices, path); in fake_input_register()
1122 if (!idev) { in fake_input_register()
1123 idev = input_device_new(conn, device, path, src, dst, 0); in fake_input_register()
1124 if (!idev) in fake_input_register()
1126 devices = g_slist_append(devices, idev); in fake_input_register()
1129 iconn = input_conn_new(idev, uuid, "hsp", 0); in fake_input_register()
1138 idev->connections = g_slist_append(idev->connections, iconn); in fake_input_register()
1149 struct input_device *idev = list->data; in find_device() local
1151 if (!bacmp(&idev->src, src) && !bacmp(&idev->dst, dst)) in find_device()
1152 return idev; in find_device()
1160 struct input_device *idev; in input_device_unregister() local
1163 idev = find_device_by_path(devices, path); in input_device_unregister()
1164 if (idev == NULL) in input_device_unregister()
1167 iconn = find_connection(idev->connections, uuid); in input_device_unregister()
1176 idev->connections = g_slist_remove(idev->connections, iconn); in input_device_unregister()
1178 if (idev->connections) in input_device_unregister()
1181 g_dbus_unregister_interface(idev->conn, path, INPUT_DEVICE_INTERFACE); in input_device_unregister()
1186 static int input_device_connadd(struct input_device *idev, in input_device_connadd() argument
1191 err = input_device_connected(idev, iconn); in input_device_connadd()
1215 struct input_device *idev = find_device(src, dst); in input_device_set_channel() local
1218 if (!idev) in input_device_set_channel()
1221 iconn = find_connection(idev->connections, "hid"); in input_device_set_channel()
1239 input_device_connadd(idev, iconn); in input_device_set_channel()
1246 struct input_device *idev = find_device(src, dst); in input_device_close_channels() local
1249 if (!idev) in input_device_close_channels()
1252 iconn = find_connection(idev->connections, "hid"); in input_device_close_channels()