Changes in uspace/srv/hid/input/input.c [a2afd8f:dd8ab1c] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/input/input.c
ra2afd8f rdd8ab1c 37 37 */ 38 38 39 #include <adt/fifo.h> 39 40 #include <adt/list.h> 40 #include <stdbool.h> 41 #include <async.h> 42 #include <config.h> 43 #include <errno.h> 44 #include <fibril.h> 41 45 #include <fibril_synch.h> 46 #include <io/chardev.h> 47 #include <io/console.h> 48 #include <io/keycode.h> 42 49 #include <ipc/services.h> 43 50 #include <ipc/input.h> 44 #include <config.h> 51 #include <loc.h> 52 #include <ns.h> 53 #include <stdbool.h> 45 54 #include <stdio.h> 46 55 #include <stdlib.h> 47 #include <ns.h>48 #include <async.h>49 #include <errno.h>50 #include <adt/fifo.h>51 #include <io/console.h>52 #include <io/keycode.h>53 #include <loc.h>54 56 #include <str_error.h> 55 #include <char_dev_iface.h> 56 #include <fibril.h> 57 #include "layout.h" 57 58 #include "input.h" 58 59 #include "kbd.h" 59 60 #include "kbd_port.h" 60 61 #include "kbd_ctl.h" 62 #include "layout.h" 61 63 #include "mouse.h" 62 64 #include "mouse_proto.h" 63 65 #include "serial.h" 64 #include "input.h"65 66 66 67 #define NUM_LAYOUTS 4 … … 364 365 } 365 366 366 static void kconsole_event_handler(ipc_callid_t callid, ipc_call_t *call, 367 void *arg) 367 static void kconsole_event_handler(ipc_call_t *call, void *arg) 368 368 { 369 369 if (IPC_GET_ARG1(*call)) { … … 536 536 while (true) { 537 537 uint8_t data; 538 539 char_dev_read(sdev->sess, &data, sizeof(data)); 538 size_t nread; 539 540 chardev_read(sdev->chardev, &data, sizeof(data), &nread); 541 /* XXX Handle error */ 540 542 kbd_push_data(sdev->kdev, data); 541 543 } … … 552 554 { 553 555 bool match = false; 556 int rc; 554 557 555 558 serial_dev_t *sdev = serial_dev_new(); … … 559 562 sdev->kdev->svc_id = service_id; 560 563 561 intrc = loc_service_get_name(service_id, &sdev->kdev->svc_name);564 rc = loc_service_get_name(service_id, &sdev->kdev->svc_name); 562 565 if (rc != EOK) 563 566 goto fail; … … 582 585 sdev->sess = loc_service_connect(service_id, INTERFACE_DDF, 583 586 IPC_FLAG_BLOCKING); 587 588 rc = chardev_open(sdev->sess, &sdev->chardev); 589 if (rc != EOK) { 590 async_hangup(sdev->sess); 591 sdev->sess = NULL; 592 list_remove(&sdev->link); 593 goto fail; 594 } 584 595 585 596 fid_t fid = fibril_create(serial_consumer, sdev); … … 816 827 int rc = loc_register_cat_change_cb(cat_change_cb); 817 828 if (rc != EOK) { 818 printf("%s: Failed registering callback for device discovery ."819 " (%d)\n", NAME, rc);829 printf("%s: Failed registering callback for device discovery: " 830 "%s\n", NAME, str_error(rc)); 820 831 return rc; 821 832 }
Note:
See TracChangeset
for help on using the changeset viewer.