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