Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/usbhid/kbd/kbddev.c

    r3a6e423 r252cf2a  
    313313        usb_hid_report_field_t *field = usb_hid_report_get_sibling(
    314314            hid_dev->report, NULL, kbd_dev->led_path,
    315             USB_HID_PATH_COMPARE_END | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY,
     315            USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY | USB_HID_PATH_COMPARE_END,
    316316            USB_HID_REPORT_TYPE_OUTPUT);
    317317       
    318         while (field != NULL) {         
    319                
     318        while (field != NULL) {
     319
    320320                if ((field->usage == USB_HID_LED_NUM_LOCK)
    321321                    && (kbd_dev->mods & KM_NUM_LOCK)){
     
    334334               
    335335                field = usb_hid_report_get_sibling(hid_dev->report, field,
    336                     kbd_dev->led_path, 
    337                 USB_HID_PATH_COMPARE_END | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY,
    338                         USB_HID_REPORT_TYPE_OUTPUT);
     336                    kbd_dev->led_path, USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY
     337                    | USB_HID_PATH_COMPARE_END, USB_HID_REPORT_TYPE_OUTPUT);
    339338        }
    340339       
     
    678677//          callbacks, kbd_dev);
    679678        usb_hid_report_path_t *path = usb_hid_report_path();
    680         usb_hid_report_path_append_item(path, USB_HIDUT_PAGE_KEYBOARD, 0);
     679        usb_hid_report_path_append_item(path, USB_HIDUT_PAGE_GENERIC_DESKTOP, 6);
    681680        //usb_hid_report_path_set_report_id(path, 0);
    682681
     
    696695        usb_hid_report_field_t *field = usb_hid_report_get_sibling(
    697696            hid_dev->report, NULL, path,
    698             USB_HID_PATH_COMPARE_END | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY,
     697            USB_HID_PATH_COMPARE_BEGIN,
    699698            USB_HID_REPORT_TYPE_INPUT);
    700699        unsigned i = 0;
    701        
     700
    702701        while (field != NULL) {
    703                 usb_log_debug2("FIELD (%p) - VALUE(%d) USAGE(%u)\n",
    704                     field, field->value, field->usage);
     702                //usb_log_debug2("FIELD (%p) - VALUE(%d) USAGE(%u)\n",
     703                //    field, field->value, field->usage);
    705704               
    706705                assert(i < kbd_dev->key_count);
     
    717716                 *       two parts of the Report somehow.
    718717                 */
     718                usb_log_debug("value(%x), usage(%x)\n", field->value, field->usage);
    719719                if (field->value != 0) {
    720                         kbd_dev->keys[i] = field->usage;
     720                        //kbd_dev->keys[i] = field->usage;
    721721                }
    722722                else {
    723                         kbd_dev->keys[i] = 0;
     723                        //kbd_dev->keys[i] = 0;
    724724                }
    725                 usb_log_debug2("Saved %u. key usage %d\n", i, kbd_dev->keys[i]);
     725                //usb_log_debug2("Saved %u. key usage %d\n", i, kbd_dev->keys[i]);
    726726               
    727727                ++i;
    728728                field = usb_hid_report_get_sibling(hid_dev->report, field, path,
    729                     USB_HID_PATH_COMPARE_END
    730                     | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY,
     729                    USB_HID_PATH_COMPARE_BEGIN,
    731730                    USB_HID_REPORT_TYPE_INPUT);
     731                usb_log_debug("field -- %p\n", field);
    732732        }
    733733       
     
    861861         * TODO: make more general
    862862         */
    863         usb_hid_report_path_t *path = usb_hid_report_path();
    864         usb_hid_report_path_append_item(path, USB_HIDUT_PAGE_KEYBOARD, 0);
    865        
    866         usb_hid_report_path_set_report_id(path, 0);
    867        
    868863        kbd_dev->key_count = usb_hid_report_size(
    869             hid_dev->report, 0, USB_HID_REPORT_TYPE_INPUT);
    870         usb_hid_report_path_free(path);
    871        
    872         usb_log_debug("Size of the input report: %zu\n", kbd_dev->key_count);
    873        
     864            hid_dev->report, 0, USB_HID_REPORT_TYPE_INPUT);
     865       
     866        usb_log_debug("Size of the input report: %zu\n", kbd_dev->key_count);   
    874867        kbd_dev->keys = (int32_t *)calloc(kbd_dev->key_count, sizeof(int32_t));
    875868       
     
    908901            kbd_dev->led_path, USB_HIDUT_PAGE_LED, 0);
    909902       
    910         kbd_dev->led_output_size = usb_hid_report_size(hid_dev->report,
    911             0, USB_HID_REPORT_TYPE_OUTPUT);
     903        kbd_dev->led_output_size = usb_hid_report_size(hid_dev->report, 0,
     904            USB_HID_REPORT_TYPE_OUTPUT);
    912905       
    913906        usb_log_debug("Output report size (in items): %zu\n",
     
    987980                return rc;
    988981        }
    989        
     982
    990983        return EOK;
    991984}
Note: See TracChangeset for help on using the changeset viewer.