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