Changes in / [f55ded3:1989cdf] in mainline


Ignore:
Location:
uspace/drv/usbhid
Files:
4 edited

Legend:

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

    rf55ded3 r1989cdf  
    677677//          callbacks, kbd_dev);
    678678        usb_hid_report_path_t *path = usb_hid_report_path();
    679         usb_hid_report_path_append_item(path, USB_HIDUT_PAGE_GENERIC_DESKTOP, 6);
     679        usb_hid_report_path_append_item(path, USB_HIDUT_PAGE_KEYBOARD, 0);
    680680        //usb_hid_report_path_set_report_id(path, 0);
    681681
     
    695695        usb_hid_report_field_t *field = usb_hid_report_get_sibling(
    696696            hid_dev->report, NULL, path,
    697             USB_HID_PATH_COMPARE_BEGIN,
     697            USB_HID_PATH_COMPARE_END | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY,
    698698            USB_HID_REPORT_TYPE_INPUT);
    699699        unsigned i = 0;
    700 
     700       
    701701        while (field != NULL) {
    702702                //usb_log_debug2("FIELD (%p) - VALUE(%d) USAGE(%u)\n",
     
    716716                 *       two parts of the Report somehow.
    717717                 */
    718                 usb_log_debug("value(%x), usage(%x)\n", field->value, field->usage);
    719718                if (field->value != 0) {
    720                         //kbd_dev->keys[i] = field->usage;
     719                        kbd_dev->keys[i] = field->usage;
    721720                }
    722721                else {
    723                         //kbd_dev->keys[i] = 0;
     722                        kbd_dev->keys[i] = 0;
    724723                }
    725                 //usb_log_debug2("Saved %u. key usage %d\n", i, kbd_dev->keys[i]);
     724                usb_log_debug2("Saved %u. key usage %d\n", i, kbd_dev->keys[i]);
    726725               
    727726                ++i;
    728727                field = usb_hid_report_get_sibling(hid_dev->report, field, path,
    729                     USB_HID_PATH_COMPARE_BEGIN,
     728                    USB_HID_PATH_COMPARE_END
     729                    | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY,
    730730                    USB_HID_REPORT_TYPE_INPUT);
    731                 usb_log_debug("field -- %p\n", field);
    732731        }
    733732       
     
    861860         * TODO: make more general
    862861         */
     862        usb_hid_report_path_t *path = usb_hid_report_path();
     863        usb_hid_report_path_append_item(path, USB_HIDUT_PAGE_KEYBOARD, 0);
     864       
     865        usb_hid_report_path_set_report_id(path, 0);
     866       
    863867        kbd_dev->key_count = usb_hid_report_size(
    864868            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);   
     869        usb_hid_report_path_free(path);
     870       
     871        usb_log_debug("Size of the input report: %zu\n", kbd_dev->key_count);
     872       
    867873        kbd_dev->keys = (int32_t *)calloc(kbd_dev->key_count, sizeof(int32_t));
    868874       
     
    980986                return rc;
    981987        }
    982 
     988       
    983989        return EOK;
    984990}
  • uspace/drv/usbhid/lgtch-ultrax/lgtch-ultrax.c

    rf55ded3 r1989cdf  
    180180 * @param key Key code of the key according to HID Usage Tables.
    181181 */
    182 /*
    183182static void usb_lgtch_push_ev(usb_hid_dev_t *hid_dev, int type,
    184183    unsigned int key)
     
    207206            ev.mods, ev.c);
    208207}
    209 */
     208
    210209/*----------------------------------------------------------------------------*/
    211210
     
    397396
    398397        usb_hid_report_field_t *field = usb_hid_report_get_sibling(
    399             hid_dev->report, NULL, path, USB_HID_PATH_COMPARE_BEGIN
     398            hid_dev->report, NULL, path, USB_HID_PATH_COMPARE_END
    400399            | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY,
    401400            USB_HID_REPORT_TYPE_INPUT);
    402401       
    403 //      unsigned int key;
     402        unsigned int key;
    404403       
    405404        /*! @todo Is this iterating OK if done multiple times?
     
    410409                usb_log_debug(NAME " KEY VALUE(%X) USAGE(%X)\n", field->value,
    411410                    field->usage);
    412                
    413 //              key = usb_lgtch_map_usage(field->usage);
    414 //              usb_lgtch_push_ev(hid_dev, KEY_PRESS, key);
     411
     412                key = field->usage;
     413                //key = usb_lgtch_map_usage(field->usage);
     414                usb_lgtch_push_ev(hid_dev, KEY_PRESS, key);
    415415               
    416416                field = usb_hid_report_get_sibling(
    417                     hid_dev->report, field, path, USB_HID_PATH_COMPARE_BEGIN
     417                    hid_dev->report, field, path, USB_HID_PATH_COMPARE_END
    418418                    | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY,
    419419                    USB_HID_REPORT_TYPE_INPUT);
  • uspace/drv/usbhid/subdrivers.c

    rf55ded3 r1989cdf  
    4242
    4343static usb_hid_subdriver_usage_t path_kbd[] = {
    44         {USB_HIDUT_PAGE_GENERIC_DESKTOP, 6},
     44        {USB_HIDUT_PAGE_KEYBOARD, 0},
    4545        {0, 0}
    4646};
    4747
    4848static usb_hid_subdriver_usage_t path_mouse2[] = {
    49         {USB_HIDUT_PAGE_GENERIC_DESKTOP, 2},
     49        {USB_HIDUT_PAGE_GENERIC_DESKTOP, USB_HIDUT_USAGE_GENERIC_DESKTOP_X},
    5050        {0, 0}
    5151};
     
    6060                path_kbd,
    6161                -1,
    62                 USB_HID_PATH_COMPARE_BEGIN ,
     62                USB_HID_PATH_COMPARE_END
     63                | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY,
    6364                -1,
    6465                -1,
     
    7475                lgtch_path,
    7576                1,
    76                 USB_HID_PATH_COMPARE_BEGIN,
     77                USB_HID_PATH_COMPARE_END
     78                | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY,
    7779                0x046d,
    7880                0xc30e,
     
    8789                path_mouse2,
    8890                -1,
    89                 USB_HID_PATH_COMPARE_BEGIN,
     91                USB_HID_PATH_COMPARE_END
     92                | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY,
    9093                -1,
    9194                -1,
  • uspace/drv/usbhid/usbhid.c

    rf55ded3 r1989cdf  
    199199                    mapping->report_id);
    200200        }
    201 
    202         uint8_t report_id = (mapping->report_id >= 0) ? mapping->report_id : 0;
     201       
    203202        assert(hid_dev->report != NULL);
    204203       
    205204        usb_log_debug("Compare flags: %d\n", mapping->compare);
    206         size_t size = usb_hid_report_size(hid_dev->report, report_id,
     205        size_t size = usb_hid_report_size(hid_dev->report, mapping->report_id,
    207206            USB_HID_REPORT_TYPE_INPUT);
    208207        usb_log_debug("Size of the input report: %zuB\n", size);
    209 
     208       
    210209        usb_hid_report_path_free(usage_path);
    211210       
Note: See TracChangeset for help on using the changeset viewer.