Changes in uspace/drv/hid/ps2mouse/ps2mouse.c [c657bd7:b7fd2a0] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/hid/ps2mouse/ps2mouse.c
rc657bd7 rb7fd2a0 36 36 #include <stdbool.h> 37 37 #include <errno.h> 38 #include <str_error.h> 38 39 #include <ddf/log.h> 39 40 #include <io/keycode.h> … … 76 77 uint8_t data = 0; \ 77 78 size_t nread; \ 78 const int rc = chardev_read((mouse)->chardev, &data, 1, &nread); \79 const errno_t rc = chardev_read((mouse)->chardev, &data, 1, &nread); \ 79 80 if (rc != EOK) { \ 80 ddf_msg(LVL_ERROR, "Failed reading byte: % d", rc);\81 ddf_msg(LVL_ERROR, "Failed reading byte: %s", str_error_name(rc));\ 81 82 return rc; \ 82 83 } \ … … 93 94 uint8_t data = (value); \ 94 95 size_t nwr; \ 95 const int rc = chardev_write((mouse)->chardev, &data, 1, &nwr); \96 const errno_t rc = chardev_write((mouse)->chardev, &data, 1, &nwr); \ 96 97 if (rc != EOK) { \ 97 ddf_msg(LVL_ERROR, "Failed writing byte: % d", rc); \98 ddf_msg(LVL_ERROR, "Failed writing byte: %s", str_error_name(rc)); \ 98 99 return rc; \ 99 100 } \ 100 101 } while (0) 101 102 102 static int polling_ps2(void *);103 static int polling_intellimouse(void *);104 static int probe_intellimouse(ps2_mouse_t *, bool);103 static errno_t polling_ps2(void *); 104 static errno_t polling_intellimouse(void *); 105 static errno_t probe_intellimouse(ps2_mouse_t *, bool); 105 106 static void default_connection_handler(ddf_fun_t *, ipc_callid_t, ipc_call_t *); 106 107 … … 119 120 * @return EOK on success or non-zero error code 120 121 */ 121 int ps2_mouse_init(ps2_mouse_t *mouse, ddf_dev_t *dev)122 errno_t ps2_mouse_init(ps2_mouse_t *mouse, ddf_dev_t *dev) 122 123 { 123 124 async_sess_t *parent_sess; 124 125 bool bound = false; 125 int rc;126 errno_t rc; 126 127 127 128 mouse->client_sess = NULL; … … 164 165 165 166 /* Probe IntelliMouse extensions. */ 166 int (*polling_f)(void*) = polling_ps2;167 errno_t (*polling_f)(void*) = polling_ps2; 167 168 if (probe_intellimouse(mouse, false) == EOK) { 168 169 ddf_msg(LVL_NOTE, "Enabled IntelliMouse extensions"); … … 222 223 * @return EOK on success or non-zero error code 223 224 */ 224 static int ps2_mouse_read_packet(ps2_mouse_t *mouse, void *pbuf, size_t psize)225 { 226 int rc;225 static errno_t ps2_mouse_read_packet(ps2_mouse_t *mouse, void *pbuf, size_t psize) 226 { 227 errno_t rc; 227 228 size_t pos; 228 229 size_t nread; … … 247 248 * @return Never. 248 249 */ 249 int polling_ps2(void *arg)250 errno_t polling_ps2(void *arg) 250 251 { 251 252 ps2_mouse_t *mouse = (ps2_mouse_t *) arg; 252 int rc;253 errno_t rc; 253 254 254 255 bool buttons[PS2_BUTTON_COUNT] = {}; … … 299 300 * @return Never. 300 301 */ 301 static int polling_intellimouse(void *arg)302 static errno_t polling_intellimouse(void *arg) 302 303 { 303 304 ps2_mouse_t *mouse = (ps2_mouse_t *) arg; 304 int rc;305 errno_t rc; 305 306 306 307 bool buttons[INTELLIMOUSE_BUTTON_COUNT] = {}; … … 372 373 * See http://www.computer-engineering.org/ps2mouse/ for details. 373 374 */ 374 static int probe_intellimouse(ps2_mouse_t *mouse, bool buttons)375 static errno_t probe_intellimouse(ps2_mouse_t *mouse, bool buttons) 375 376 { 376 377 MOUSE_WRITE_BYTE(mouse, PS2_MOUSE_SET_SAMPLE_RATE);
Note:
See TracChangeset
for help on using the changeset viewer.