Changes in uspace/drv/usbmouse/mouse.c [019cff6:21bb58d] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/usbmouse/mouse.c
r019cff6 r21bb58d 37 37 #include <usb/debug.h> 38 38 #include <errno.h> 39 #include <str_error.h>40 39 #include <ipc/mouse.h> 41 40 … … 65 64 66 65 size_t actual_size; 67 int rc;68 66 69 /* 70 * Error checking note: 71 * - failure when starting a session is considered 72 * temporary (e.g. out of phones, next try might succeed) 73 * - failure of transfer considered fatal (probably the 74 * device was unplugged) 75 * - session closing not checked (shall not fail anyway) 76 */ 67 /* FIXME: check for errors. */ 68 usb_endpoint_pipe_start_session(&mouse->poll_pipe); 77 69 78 rc = usb_endpoint_pipe_start_session(&mouse->poll_pipe); 79 if (rc != EOK) { 80 usb_log_warning("Failed to start session, will try again: %s.\n", 81 str_error(rc)); 82 continue; 83 } 84 85 rc = usb_endpoint_pipe_read(&mouse->poll_pipe, 70 usb_endpoint_pipe_read(&mouse->poll_pipe, 86 71 buffer, buffer_size, &actual_size); 87 72 88 73 usb_endpoint_pipe_end_session(&mouse->poll_pipe); 89 90 if (rc != EOK) {91 usb_log_error("Failed reading mouse input: %s.\n",92 str_error(rc));93 break;94 }95 96 usb_log_debug2("got buffer: %s.\n",97 usb_debug_str_buffer(buffer, buffer_size, 0));98 74 99 75 uint8_t butt = buffer[0]; … … 139 115 } 140 116 141 /*142 * Device was probably unplugged.143 * Hang-up the phone to the console.144 * FIXME: release allocated memory.145 */146 async_hangup(mouse->console_phone);147 mouse->console_phone = -1;148 149 usb_log_error("Mouse polling fibril terminated.\n");150 151 117 return EOK; 152 118 }
Note:
See TracChangeset
for help on using the changeset viewer.