Lines Matching refs:fake
215 struct fake_input *fake = data; in ps3remote_event() local
249 if (write(fake->uinput, &event, sizeof(event)) != sizeof(event)) { in ps3remote_event()
258 if (write(fake->uinput, &event, sizeof(event)) != sizeof(event)) { in ps3remote_event()
266 ioctl(fake->uinput, UI_DEV_DESTROY); in ps3remote_event()
267 close(fake->uinput); in ps3remote_event()
268 fake->uinput = -1; in ps3remote_event()
269 g_io_channel_unref(fake->io); in ps3remote_event()
274 static int ps3remote_setup_uinput(struct fake_input *fake, in ps3remote_setup_uinput() argument
280 fake->uinput = open("/dev/input/uinput", O_RDWR); in ps3remote_setup_uinput()
281 if (fake->uinput < 0) { in ps3remote_setup_uinput()
282 fake->uinput = open("/dev/uinput", O_RDWR); in ps3remote_setup_uinput()
283 if (fake->uinput < 0) { in ps3remote_setup_uinput()
284 fake->uinput = open("/dev/misc/uinput", O_RDWR); in ps3remote_setup_uinput()
285 if (fake->uinput < 0) { in ps3remote_setup_uinput()
298 if (write(fake->uinput, &dev, sizeof(dev)) != sizeof(dev)) { in ps3remote_setup_uinput()
304 if (ioctl(fake->uinput, UI_SET_EVBIT, EV_KEY) < 0) { in ps3remote_setup_uinput()
312 if (ioctl(fake->uinput, UI_SET_KEYBIT, in ps3remote_setup_uinput()
320 if (ioctl(fake->uinput, UI_DEV_CREATE) < 0) { in ps3remote_setup_uinput()
328 close(fake->uinput); in ps3remote_setup_uinput()
332 static gboolean fake_hid_common_connect(struct fake_input *fake, GError **err) in fake_hid_common_connect() argument
337 static int fake_hid_common_disconnect(struct fake_input *fake) in fake_hid_common_disconnect() argument
373 int fake_hid_connadd(struct fake_input *fake, GIOChannel *intr_io, in fake_hid_connadd() argument
376 if (fake_hid->setup_uinput(fake, fake_hid)) { in fake_hid_connadd()
381 fake->io = g_io_channel_ref(intr_io); in fake_hid_connadd()
382 g_io_channel_set_close_on_unref(fake->io, TRUE); in fake_hid_connadd()
383 g_io_add_watch(fake->io, G_IO_IN | G_IO_ERR | G_IO_HUP | G_IO_NVAL, in fake_hid_connadd()
384 (GIOFunc) fake_hid->event, fake); in fake_hid_connadd()