Changes in / [82e8861:dc4c19e] in mainline
- Location:
- uspace/drv/usbhid
- Files:
-
- 2 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/usbhid/Makefile
r82e8861 rdc4c19e 44 44 kbd/kbdrepeat.c \ 45 45 generic/hiddev.c \ 46 mouse/mousedev.c \ 46 47 $(STOLEN_LAYOUT_SOURCES) 47 48 -
uspace/drv/usbhid/generic/hiddev.c
r82e8861 rdc4c19e 57 57 size_t buffer_size, void *arg) 58 58 { 59 usb_log_debug("usb_hid_polling_callback()\n"); 59 usb_log_debug("usb_hid_polling_callback(%p, %p, %zu, %p)\n", 60 dev, buffer, buffer_size, arg); 60 61 usb_debug_str_buffer(buffer, buffer_size, 0); 61 62 return true; -
uspace/drv/usbhid/generic/hiddev.h
r82e8861 rdc4c19e 34 34 */ 35 35 36 #ifndef USB_HIDD _H_37 #define USB_HIDD _H_36 #ifndef USB_HIDDDEV_H_ 37 #define USB_HIDDDEV_H_ 38 38 39 39 #include <usb/devdrv.h> … … 47 47 size_t buffer_size, void *arg); 48 48 49 #endif // USB_HIDD _H_49 #endif // USB_HIDDDEV_H_ 50 50 51 51 /** -
uspace/drv/usbhid/kbd/kbddev.c
r82e8861 rdc4c19e 238 238 * @param icall Call data. 239 239 */ 240 void default_connection_handler(ddf_fun_t *fun,240 static void default_connection_handler(ddf_fun_t *fun, 241 241 ipc_callid_t icallid, ipc_call_t *icall) 242 242 { -
uspace/drv/usbhid/kbd/kbddev.h
r82e8861 rdc4c19e 65 65 */ 66 66 typedef struct usb_kbd_t { 67 /** Structure holding generic USB device information. */68 //usbhid_dev_t *hid_dev;69 //usb_device_t *usb_dev;70 71 67 /** Currently pressed keys (not translated to key codes). */ 72 68 uint8_t *keys; … … 91 87 fibril_mutex_t *repeat_mtx; 92 88 93 /** Report descriptor. */94 //uint8_t *report_desc;95 96 /** Report descriptor size. */97 //size_t report_desc_size;98 99 89 uint8_t *output_buffer; 100 90 … … 106 96 107 97 int32_t *led_data; 108 109 /** HID Report parser. */110 //usb_hid_report_parser_t *parser;111 98 112 99 /** State of the structure (for checking before use). … … 121 108 /*----------------------------------------------------------------------------*/ 122 109 123 //enum {124 // USB_KBD_POLL_EP_NO = 0,125 // USB_HID_POLL_EP_NO = 1,126 // USB_KBD_POLL_EP_COUNT = 2127 //};128 129 //usb_endpoint_description_t *usb_kbd_endpoints[USB_KBD_POLL_EP_COUNT + 1];130 131 //ddf_dev_ops_t keyboard_ops;132 133 110 usb_endpoint_description_t usb_hid_kbd_poll_endpoint_description; 134 111 … … 138 115 /*----------------------------------------------------------------------------*/ 139 116 140 //usb_kbd_t *usb_kbd_new(void);141 142 117 int usb_kbd_init(struct usb_hid_dev_t *hid_dev); 143 118 144 119 bool usb_kbd_polling_callback(usb_device_t *dev, uint8_t *buffer, 145 120 size_t buffer_size, void *arg); 146 147 //void usb_kbd_polling_ended_callback(usb_device_t *dev, bool reason,148 // void *arg);149 121 150 122 int usb_kbd_is_initialized(const usb_kbd_t *kbd_dev); … … 157 129 int type, unsigned int key); 158 130 159 160 131 void usb_kbd_deinit(struct usb_hid_dev_t *hid_dev); 161 132 -
uspace/drv/usbhid/usbhid.c
r82e8861 rdc4c19e 47 47 #include "kbd/kbddev.h" 48 48 #include "generic/hiddev.h" 49 50 /*----------------------------------------------------------------------------*/ 51 52 /** Mouse polling endpoint description for boot protocol class. */ 53 static usb_endpoint_description_t usb_hid_mouse_poll_endpoint_description = { 54 .transfer_type = USB_TRANSFER_INTERRUPT, 55 .direction = USB_DIRECTION_IN, 56 .interface_class = USB_CLASS_HID, 57 .interface_subclass = USB_HID_SUBCLASS_BOOT, 58 .interface_protocol = USB_HID_PROTOCOL_MOUSE, 59 .flags = 0 60 }; 49 #include "mouse/mousedev.h" 50 51 /*----------------------------------------------------------------------------*/ 61 52 62 53 /* Array of endpoints expected on the device, NULL terminated. */ … … 68 59 }; 69 60 70 static const char *HID_MOUSE_FUN_NAME = "mouse";71 static const char *HID_MOUSE_CLASS_NAME = "mouse";72 73 61 /*----------------------------------------------------------------------------*/ 74 62 … … 96 84 /*----------------------------------------------------------------------------*/ 97 85 98 static bool usb_dummy_polling_callback(usb_device_t *dev, uint8_t *buffer,99 size_t buffer_size, void *arg)100 {101 usb_log_debug("Dummy polling callback.\n");102 return false;103 }104 105 /*----------------------------------------------------------------------------*/106 107 86 static int usb_hid_check_pipes(usb_hid_dev_t *hid_dev, usb_device_t *dev) 108 87 { … … 125 104 126 105 // set the polling callback 127 hid_dev->poll_callback = usb_ dummy_polling_callback;106 hid_dev->poll_callback = usb_mouse_polling_callback; 128 107 129 108 } else if (dev->pipes[USB_HID_GENERIC_POLL_EP_NO].present) { … … 161 140 hid_dev->parser); 162 141 163 if (rc != EOK ) {142 if (rc != EOK || hid_dev->device_type == USB_HID_PROTOCOL_MOUSE) { 164 143 usb_log_warning("Could not process report descriptor.\n"); 165 144 166 145 if (hid_dev->device_type == USB_HID_PROTOCOL_KEYBOARD) { 167 146 usb_log_warning("Falling back to boot protocol.\n"); 168 169 147 rc = usb_kbd_set_boot_protocol(hid_dev); 170 171 148 } else if (hid_dev->device_type == USB_HID_PROTOCOL_MOUSE) { 172 usb_log_warning(" No boot protocol for mouse yet.\n");173 rc = ENOTSUP;149 usb_log_warning("Falling back to boot protocol.\n"); 150 rc = usb_mouse_set_boot_protocol(hid_dev); 174 151 } 175 152 } … … 222 199 break; 223 200 case USB_HID_PROTOCOL_MOUSE: 224 break; 225 default: 226 // usbhid_req_set_idle(&hid_dev->usb_dev->ctrl_pipe, 227 // hid_dev->usb_dev->interface_no, 0); 201 rc = usb_mouse_init(hid_dev); 202 if (rc != EOK) { 203 usb_log_warning("Failed to initialize Mouse structure." 204 "\n"); 205 } 206 break; 207 default: 228 208 break; 229 209 } … … 291 271 break; 292 272 case USB_HID_PROTOCOL_MOUSE: 273 usb_mouse_deinit(*hid_dev); 293 274 break; 294 275 default: -
uspace/drv/usbhid/usbhid.ma
r82e8861 rdc4c19e 1 1 100 usb&interface&class=HID&subclass=0x01&protocol=0x01 2 100 usb&interface&class=HID&subclass=0x01&protocol=0x022 1000 usb&interface&class=HID&subclass=0x01&protocol=0x02 3 3 100 usb&interface&class=HID
Note:
See TracChangeset
for help on using the changeset viewer.