Lines Matching refs:device
83 struct serial_device *device; member
93 struct serial_device *device = l->data; in find_device() local
95 if (!strcmp(device->path, path)) in find_device()
96 return device; in find_device()
152 bt_cancel_discovery(&port->device->src, in port_release()
153 &port->device->dst); in port_release()
194 struct serial_device *device = port->device; in serial_port_free() local
196 if (device && port->listener_id > 0) in serial_port_free()
197 g_dbus_remove_watch(device->conn, port->listener_id); in serial_port_free()
205 static void serial_device_free(struct serial_device *device) in serial_device_free() argument
207 g_free(device->path); in serial_device_free()
208 if (device->conn) in serial_device_free()
209 dbus_connection_unref(device->conn); in serial_device_free()
210 g_free(device); in serial_device_free()
224 struct serial_device *device = data; in path_unregister() local
227 device->path); in path_unregister()
229 devices = g_slist_remove(devices, device); in path_unregister()
230 serial_device_free(device); in path_unregister()
261 struct serial_device *device = port->device; in open_notify() local
276 g_dbus_send_message(device->conn, reply); in open_notify()
324 struct serial_device *device = port->device; in rfcomm_connect_cb() local
342 bacpy(&req.src, &device->src); in rfcomm_connect_cb()
343 bacpy(&req.dst, &device->dst); in rfcomm_connect_cb()
375 g_dbus_send_message(device->conn, reply); in rfcomm_connect_cb()
376 g_dbus_remove_watch(device->conn, port->listener_id); in rfcomm_connect_cb()
383 struct serial_device *device = port->device; in get_record_cb() local
422 BT_IO_OPT_SOURCE_BDADDR, &device->src, in get_record_cb()
423 BT_IO_OPT_DEST_BDADDR, &device->dst, in get_record_cb()
436 g_dbus_remove_watch(device->conn, port->listener_id); in get_record_cb()
438 g_dbus_send_message(device->conn, reply); in get_record_cb()
443 struct serial_device *device = port->device; in connect_port() local
456 return bt_search_service(&device->src, &device->dst, &uuid, in connect_port()
462 BT_IO_OPT_SOURCE_BDADDR, &device->src, in connect_port()
463 BT_IO_OPT_DEST_BDADDR, &device->dst, in connect_port()
472 static struct serial_port *create_port(struct serial_device *device, in create_port() argument
480 port->device = device; in create_port()
484 device->ports = g_slist_append(device->ports, port); in create_port()
492 struct serial_device *device = user_data; in port_connect() local
501 port = find_port(device->ports, pattern); in port_connect()
510 port = create_port(device, NULL, channel); in port_connect()
539 struct serial_device *device = user_data; in port_disconnect() local
547 port = find_port(device->ports, dev); in port_disconnect()
577 struct serial_device *device; in create_serial_device() local
579 device = g_new0(struct serial_device, 1); in create_serial_device()
580 device->conn = dbus_connection_ref(conn); in create_serial_device()
581 bacpy(&device->dst, dst); in create_serial_device()
582 bacpy(&device->src, src); in create_serial_device()
583 device->path = g_strdup(path); in create_serial_device()
588 device, path_unregister)) { in create_serial_device()
591 serial_device_free(device); in create_serial_device()
598 return device; in create_serial_device()
604 struct serial_device *device; in port_register() local
607 device = find_device(devices, path); in port_register()
608 if (!device) { in port_register()
609 device = create_serial_device(conn, path, src, dst); in port_register()
610 if (!device) in port_register()
612 devices = g_slist_append(devices, device); in port_register()
615 if (find_port(device->ports, uuid)) in port_register()
621 port->device = device; in port_register()
625 device->ports = g_slist_append(device->ports, port); in port_register()
632 struct serial_device *device; in port_unregister() local
634 device = find_device(devices, path); in port_unregister()
635 if (!device) in port_unregister()
638 g_slist_foreach(device->ports, (GFunc) serial_port_free, NULL); in port_unregister()
639 g_slist_free(device->ports); in port_unregister()
641 g_dbus_unregister_interface(device->conn, path, SERIAL_PORT_INTERFACE); in port_unregister()