Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified uspace/drv/usbkbd/kbddev.c

    r7f2e33a re4153ea  
    265265static void usb_kbd_set_led(usb_kbd_t *kbd_dev)
    266266{
    267         if (kbd_dev->output_size == 0) {
    268                 return;
    269         }
    270        
    271267        unsigned i = 0;
    272268       
     
    292288       
    293289        int rc = usb_hid_report_output_translate(kbd_dev->parser,
    294             kbd_dev->led_path,
    295             USB_HID_PATH_COMPARE_END | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY,
    296             kbd_dev->output_buffer,
     290            kbd_dev->led_path, USB_HID_PATH_COMPARE_END, kbd_dev->output_buffer,
    297291            kbd_dev->output_size, kbd_dev->led_data, kbd_dev->led_output_size);
    298292       
     
    545539 *                  according to HID Usage Tables.
    546540 * @param count Number of key codes in report (size of the report).
    547  * @param report_id
     541 * @param modifiers Bitmap of modifiers (Ctrl, Alt, Shift, GUI).
    548542 * @param arg User-specified argument. Expects pointer to the keyboard device
    549543 *            structure representing the keyboard.
     
    552546 */
    553547static void usb_kbd_process_keycodes(const uint8_t *key_codes, size_t count,
    554     uint8_t report_id, void *arg)
     548    uint8_t modifiers, void *arg)
    555549{
    556550        if (arg == NULL) {
     
    563557        assert(kbd_dev != NULL);
    564558
    565         usb_log_debug("Got keys from parser (report id: %u): %s\n",
    566             report_id, usb_debug_str_buffer(key_codes, count, 0));
     559        usb_log_debug("Got keys from parser: %s\n",
     560            usb_debug_str_buffer(key_codes, count, 0));
    567561       
    568562        if (count != kbd_dev->key_count) {
     
    614608        usb_hid_report_path_t *path = usb_hid_report_path();
    615609        usb_hid_report_path_append_item(path, USB_HIDUT_PAGE_KEYBOARD, 0);
    616         usb_hid_report_path_set_report_id(path, 0);
    617610       
    618611        int rc = usb_hid_parse_report(kbd_dev->parser, buffer,
    619             actual_size, path,
    620             USB_HID_PATH_COMPARE_END | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY,
    621             callbacks, kbd_dev);
     612            actual_size, path, USB_HID_PATH_COMPARE_STRICT, callbacks, kbd_dev);
    622613
    623614        usb_hid_report_path_free (path);
     
    767758        usb_hid_report_path_t *path = usb_hid_report_path();
    768759        usb_hid_report_path_append_item(path, USB_HIDUT_PAGE_KEYBOARD, 0);
    769        
    770         usb_hid_report_path_set_report_id(path, 0);
    771        
    772760        kbd_dev->key_count = usb_hid_report_input_length(
    773             kbd_dev->parser, path,
    774             USB_HID_PATH_COMPARE_END | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY);
     761            kbd_dev->parser, path, USB_HID_PATH_COMPARE_STRICT);
    775762        usb_hid_report_path_free (path);
    776763       
     
    790777        kbd_dev->output_buffer = usb_hid_report_output(kbd_dev->parser,
    791778            &kbd_dev->output_size);
    792         if (kbd_dev->output_buffer == NULL && kbd_dev->output_size != 0) {
     779        if (kbd_dev->output_buffer == NULL) {
    793780                usb_log_warning("Error creating output report buffer.\n");
    794781                free(kbd_dev->keys);
     
    803790       
    804791        kbd_dev->led_output_size = usb_hid_report_output_size(kbd_dev->parser,
    805             kbd_dev->led_path,
    806             USB_HID_PATH_COMPARE_END | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY);
     792            kbd_dev->led_path, USB_HID_PATH_COMPARE_END);
    807793       
    808794        usb_log_debug("Output report size (in items): %zu\n",
Note: See TracChangeset for help on using the changeset viewer.