Changeset eb393ad in mainline for uspace/drv
- Timestamp:
- 2011-04-21T20:57:21Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6513110
- Parents:
- 36f737a (diff), c7c0984a (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - Location:
- uspace/drv
- Files:
-
- 3 edited
-
usbhid/kbd/kbddev.c (modified) (2 diffs)
-
usbhid/lgtch-ultrax/lgtch-ultrax.c (modified) (1 diff)
-
usbkbd/kbddev.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/usbhid/kbd/kbddev.c
r36f737a reb393ad 299 299 return; 300 300 } 301 302 unsigned i = 0; 303 301 304 302 /* Reset the LED data. */ 305 303 memset(kbd_dev->led_data, 0, kbd_dev->led_output_size * sizeof(int32_t)); 306 307 if ((kbd_dev->mods & KM_NUM_LOCK) && (i < kbd_dev->led_output_size)) { 308 kbd_dev->led_data[i++] = USB_HID_LED_NUM_LOCK; 309 } 310 311 if ((kbd_dev->mods & KM_CAPS_LOCK) && (i < kbd_dev->led_output_size)) { 312 kbd_dev->led_data[i++] = USB_HID_LED_CAPS_LOCK; 313 } 314 315 if ((kbd_dev->mods & KM_SCROLL_LOCK) 316 && (i < kbd_dev->led_output_size)) { 317 kbd_dev->led_data[i++] = USB_HID_LED_SCROLL_LOCK; 318 } 319 320 // TODO: COMPOSE and KANA 321 322 usb_log_debug("Creating output report: "); 323 for (i = 0; i < kbd_dev->led_output_size; ++i) { 324 usb_log_debug("%d ", kbd_dev->led_data[i]); 325 } 326 usb_log_debug("\n"); 327 328 usb_hid_report_output_set_data(hid_dev->report, kbd_dev->led_path, 329 USB_HID_PATH_COMPARE_END | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY, 330 kbd_dev->led_data, kbd_dev->led_output_size); 331 int rc = usb_hid_report_output_translate(hid_dev->report, 0, 304 usb_log_debug("Creating output report:\n"); 305 306 usb_hid_report_field_t *field = usb_hid_report_get_sibling (hid_dev->parser, NULL, 307 kbd_dev->led_path, 308 USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY | USB_HID_PATH_COMPARE_END, 309 USB_HID_REPORT_TYPE_OUTPUT); 310 while(field != NULL) { 311 312 if((field->usage == USB_HID_LED_NUM_LOCK) && (kbd_dev->mods & KM_NUM_LOCK)){ 313 field->value = 1; 314 } 315 316 if((field->usage == USB_HID_LED_CAPS_LOCK) && (kbd_dev->mods & KM_CAPS_LOCK)){ 317 field->value = 1; 318 } 319 320 if((field->usage == USB_HID_LED_SCROLL_LOCK) && (kbd_dev->mods & KM_SCROLL_LOCK)){ 321 field->value = 1; 322 } 323 324 field = usb_hid_report_get_sibling (hid_dev->parser, field, 325 kbd_dev->led_path, 326 USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY | USB_HID_PATH_COMPARE_END, 327 USB_HID_REPORT_TYPE_OUTPUT); 328 } 329 330 int rc = usb_hid_report_output_translate(hid_dev->parser, 0, 332 331 kbd_dev->output_buffer, kbd_dev->output_size); 333 332 … … 671 670 usb_hid_report_path_append_item(path, USB_HIDUT_PAGE_KEYBOARD, 0); 672 671 //usb_hid_report_path_set_report_id(path, 0); 673 674 int rc = usb_hid_parse_report(hid_dev->report, buffer, actual_size); 672 673 uint8_t report_id; 674 int rc = usb_hid_parse_report(hid_dev->parser, buffer, actual_size, &report_id); 675 usb_hid_report_path_set_report_id (path, report_id); 676 usb_hid_report_field_t *field = usb_hid_report_get_sibling(hid_dev->parser, 677 NULL, path, USB_HID_PATH_COMPARE_END | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY, 678 USB_HID_REPORT_TYPE_INPUT); 679 680 usb_hid_report_path_free(path); 675 681 676 682 if (rc != EOK) { -
uspace/drv/usbhid/lgtch-ultrax/lgtch-ultrax.c
r36f737a reb393ad 81 81 usb_hid_report_path_t *path = usb_hid_report_path(); 82 82 usb_hid_report_path_append_item(path, 0xc, 0); 83 usb_hid_report_path_set_report_id(path, 0); 84 85 int rc = usb_hid_parse_report(hid_dev->report, buffer, buffer_size); 83 84 uint8_t report_id; 85 int rc = usb_hid_parse_report(hid_dev->parser, buffer, buffer_size, &report_id); 86 usb_hid_report_path_set_report_id(path, report_id); 86 87 87 88 usb_hid_report_field_t *field = usb_hid_report_get_sibling(hid_dev->report, NULL, path, USB_HID_PATH_COMPARE_END , USB_HID_REPORT_TYPE_INPUT); -
uspace/drv/usbkbd/kbddev.c
r36f737a reb393ad 618 618 usb_hid_report_path_append_item(path, USB_HIDUT_PAGE_KEYBOARD, 0); 619 619 620 int rc = usb_hid_parse_report(kbd_dev->parser, buffer, actual_size); 620 uint8_t report_id; 621 int rc = usb_hid_parse_report(kbd_dev->parser, buffer, actual_size, &report_id); 621 622 usb_hid_descriptor_print (kbd_dev->parser); 622 623
Note:
See TracChangeset
for help on using the changeset viewer.
