Changes in / [1989cdf:f55ded3] in mainline


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

Legend:

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

    r1989cdf rf55ded3  
    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_KEYBOARD, 0);
     679        usb_hid_report_path_append_item(path, USB_HIDUT_PAGE_GENERIC_DESKTOP, 6);
    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_END | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY,
     697            USB_HID_PATH_COMPARE_BEGIN,
    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);
    718719                if (field->value != 0) {
    719                         kbd_dev->keys[i] = field->usage;
     720                        //kbd_dev->keys[i] = field->usage;
    720721                }
    721722                else {
    722                         kbd_dev->keys[i] = 0;
     723                        //kbd_dev->keys[i] = 0;
    723724                }
    724                 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]);
    725726               
    726727                ++i;
    727728                field = usb_hid_report_get_sibling(hid_dev->report, field, path,
    728                     USB_HID_PATH_COMPARE_END
    729                     | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY,
     729                    USB_HID_PATH_COMPARE_BEGIN,
    730730                    USB_HID_REPORT_TYPE_INPUT);
     731                usb_log_debug("field -- %p\n", field);
    731732        }
    732733       
     
    860861         * TODO: make more general
    861862         */
    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        
    867863        kbd_dev->key_count = usb_hid_report_size(
    868864            hid_dev->report, 0, USB_HID_REPORT_TYPE_INPUT);
    869         usb_hid_report_path_free(path);
    870        
    871         usb_log_debug("Size of the input report: %zu\n", kbd_dev->key_count);
    872        
     865       
     866        usb_log_debug("Size of the input report: %zu\n", kbd_dev->key_count);   
    873867        kbd_dev->keys = (int32_t *)calloc(kbd_dev->key_count, sizeof(int32_t));
    874868       
     
    986980                return rc;
    987981        }
    988        
     982
    989983        return EOK;
    990984}
  • uspace/drv/usbhid/lgtch-ultrax/lgtch-ultrax.c

    r1989cdf rf55ded3  
    180180 * @param key Key code of the key according to HID Usage Tables.
    181181 */
     182/*
    182183static void usb_lgtch_push_ev(usb_hid_dev_t *hid_dev, int type,
    183184    unsigned int key)
     
    206207            ev.mods, ev.c);
    207208}
    208 
     209*/
    209210/*----------------------------------------------------------------------------*/
    210211
     
    396397
    397398        usb_hid_report_field_t *field = usb_hid_report_get_sibling(
    398             hid_dev->report, NULL, path, USB_HID_PATH_COMPARE_END
     399            hid_dev->report, NULL, path, USB_HID_PATH_COMPARE_BEGIN
    399400            | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY,
    400401            USB_HID_REPORT_TYPE_INPUT);
    401402       
    402         unsigned int key;
     403//      unsigned int key;
    403404       
    404405        /*! @todo Is this iterating OK if done multiple times?
     
    409410                usb_log_debug(NAME " KEY VALUE(%X) USAGE(%X)\n", field->value,
    410411                    field->usage);
    411 
    412                 key = field->usage;
    413                 //key = usb_lgtch_map_usage(field->usage);
    414                 usb_lgtch_push_ev(hid_dev, KEY_PRESS, key);
     412               
     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_END
     417                    hid_dev->report, field, path, USB_HID_PATH_COMPARE_BEGIN
    418418                    | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY,
    419419                    USB_HID_REPORT_TYPE_INPUT);
  • uspace/drv/usbhid/subdrivers.c

    r1989cdf rf55ded3  
    4242
    4343static usb_hid_subdriver_usage_t path_kbd[] = {
    44         {USB_HIDUT_PAGE_KEYBOARD, 0},
     44        {USB_HIDUT_PAGE_GENERIC_DESKTOP, 6},
    4545        {0, 0}
    4646};
    4747
    4848static usb_hid_subdriver_usage_t path_mouse2[] = {
    49         {USB_HIDUT_PAGE_GENERIC_DESKTOP, USB_HIDUT_USAGE_GENERIC_DESKTOP_X},
     49        {USB_HIDUT_PAGE_GENERIC_DESKTOP, 2},
    5050        {0, 0}
    5151};
     
    6060                path_kbd,
    6161                -1,
    62                 USB_HID_PATH_COMPARE_END
    63                 | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY,
     62                USB_HID_PATH_COMPARE_BEGIN ,
    6463                -1,
    6564                -1,
     
    7574                lgtch_path,
    7675                1,
    77                 USB_HID_PATH_COMPARE_END
    78                 | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY,
     76                USB_HID_PATH_COMPARE_BEGIN,
    7977                0x046d,
    8078                0xc30e,
     
    8987                path_mouse2,
    9088                -1,
    91                 USB_HID_PATH_COMPARE_END
    92                 | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY,
     89                USB_HID_PATH_COMPARE_BEGIN,
    9390                -1,
    9491                -1,
  • uspace/drv/usbhid/usbhid.c

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