Changeset 5050d9e in mainline
- Timestamp:
- 2011-03-08T20:29:51Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 32bfb96
- Parents:
- 021351c
- Location:
- uspace/drv/usbhid
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/usbhid/hiddev.c
r021351c r5050d9e 135 135 } 136 136 137 hid_dev->report_desc_size = length; 138 137 139 usb_log_debug("Done.\n"); 138 140 … … 219 221 220 222 if (rc != EOK) { 221 usb_log_warning("Problem with parsing Report descriptor: %s.\n", 223 usb_log_warning("Problem with getting Report descriptor: %s.\n", 224 str_error(rc)); 225 return rc; 226 } 227 228 rc = usb_hid_parse_report_descriptor(hid_dev->parser, 229 hid_dev->report_desc, hid_dev->report_desc_size); 230 if (rc != EOK) { 231 usb_log_warning("Problem parsing Report descriptor: %s.\n", 222 232 str_error(rc)); 223 233 return rc; … … 243 253 memset(dev, 0, sizeof(usbhid_dev_t)); 244 254 255 dev->parser = (usb_hid_report_parser_t *)(malloc(sizeof( 256 usb_hid_report_parser_t))); 257 if (dev->parser == NULL) { 258 usb_log_fatal("No memory!\n"); 259 free(dev); 260 return NULL; 261 } 262 245 263 dev->initialized = 0; 246 264 … … 319 337 return rc; 320 338 } 339 340 /* 341 * Initialize the report parser. 342 */ 343 rc = usb_hid_parser_init(hid_dev->parser); 344 if (rc != EOK) { 345 usb_log_error("Failed to initialize report parser.\n"); 346 return rc; 347 } 321 348 322 349 /* -
uspace/drv/usbhid/hiddev.h
r021351c r5050d9e 62 62 63 63 uint8_t *report_desc; 64 size_t report_desc_size; 64 65 usb_hid_report_parser_t *parser; 65 66 -
uspace/drv/usbhid/kbddev.c
r021351c r5050d9e 496 496 } 497 497 498 usb_hid_free_report_parser((*kbd_dev)->parser); 499 498 500 free(*kbd_dev); 499 501 *kbd_dev = NULL; -
uspace/drv/usbhid/kbddev.h
r021351c r5050d9e 40 40 41 41 #include <usb/classes/hid.h> 42 #include <usb/classes/hidparser.h> 42 43 #include <ddf/driver.h> 43 44 #include <usb/pipes.h> … … 62 63 int console_phone; 63 64 65 usb_hid_report_parser_t *parser; 66 64 67 int initialized; 65 68 } usbhid_kbd_t;
Note:
See TracChangeset
for help on using the changeset viewer.