Changes in / [f55ded3:7aaf403e] in mainline


Ignore:
Location:
uspace
Files:
7 edited

Legend:

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

    rf55ded3 r7aaf403e  
    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_USAGE_PAGE_ONLY | USB_HID_PATH_COMPARE_END,
     315            USB_HID_PATH_COMPARE_END | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY,
    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, USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY
    337                     | USB_HID_PATH_COMPARE_END, USB_HID_REPORT_TYPE_OUTPUT);
     336                    kbd_dev->led_path, 
     337                USB_HID_PATH_COMPARE_END | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY,
     338                        USB_HID_REPORT_TYPE_OUTPUT);
    338339        }
    339340       
     
    677678//          callbacks, kbd_dev);
    678679        usb_hid_report_path_t *path = usb_hid_report_path();
    679         usb_hid_report_path_append_item(path, USB_HIDUT_PAGE_GENERIC_DESKTOP, 6);
     680        usb_hid_report_path_append_item(path, USB_HIDUT_PAGE_KEYBOARD, 0);
    680681        //usb_hid_report_path_set_report_id(path, 0);
    681682
     
    695696        usb_hid_report_field_t *field = usb_hid_report_get_sibling(
    696697            hid_dev->report, NULL, path,
    697             USB_HID_PATH_COMPARE_BEGIN,
     698            USB_HID_PATH_COMPARE_END | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY,
    698699            USB_HID_REPORT_TYPE_INPUT);
    699700        unsigned i = 0;
    700 
     701       
    701702        while (field != NULL) {
    702                 //usb_log_debug2("FIELD (%p) - VALUE(%d) USAGE(%u)\n",
    703                 //    field, field->value, field->usage);
     703                usb_log_debug2("FIELD (%p) - VALUE(%d) USAGE(%u)\n",
     704                    field, field->value, field->usage);
    704705               
    705706                assert(i < kbd_dev->key_count);
     
    716717                 *       two parts of the Report somehow.
    717718                 */
    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_BEGIN,
     729                    USB_HID_PATH_COMPARE_END
     730                    | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY,
    730731                    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       
    863868        kbd_dev->key_count = usb_hid_report_size(
    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);   
     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       
    867874        kbd_dev->keys = (int32_t *)calloc(kbd_dev->key_count, sizeof(int32_t));
    868875       
     
    901908            kbd_dev->led_path, USB_HIDUT_PAGE_LED, 0);
    902909       
    903         kbd_dev->led_output_size = usb_hid_report_size(hid_dev->report, 0,
    904             USB_HID_REPORT_TYPE_OUTPUT);
     910        kbd_dev->led_output_size = usb_hid_report_size(hid_dev->report,
     911            0, USB_HID_REPORT_TYPE_OUTPUT);
    905912       
    906913        usb_log_debug("Output report size (in items): %zu\n",
     
    980987                return rc;
    981988        }
    982 
     989       
    983990        return EOK;
    984991}
  • uspace/drv/usbhid/lgtch-ultrax/lgtch-ultrax.c

    rf55ded3 r7aaf403e  
    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
     
    301300        usb_hid_report_path_set_report_id(path, 1);
    302301       
    303         lgtch_dev->key_count = usb_hid_report_size(hid_dev->report, 1,
    304                 USB_HID_REPORT_TYPE_INPUT);
    305        
     302        lgtch_dev->key_count = usb_hid_report_size(
     303            hid_dev->report, 0, USB_HID_REPORT_TYPE_INPUT);
    306304        usb_hid_report_path_free(path);
    307305       
     
    397395
    398396        usb_hid_report_field_t *field = usb_hid_report_get_sibling(
    399             hid_dev->report, NULL, path, USB_HID_PATH_COMPARE_BEGIN
     397            hid_dev->report, NULL, path, USB_HID_PATH_COMPARE_END
    400398            | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY,
    401399            USB_HID_REPORT_TYPE_INPUT);
     
    407405         */
    408406        while (field != NULL) {
    409                 usb_log_debug("\n");
    410                 usb_log_debug(NAME " KEY VALUE(%X) USAGE(%X)\n", field->value,
    411                     field->usage);
     407                if(field->value != 0) {
     408                        usb_log_debug(NAME " KEY VALUE(%X) USAGE(%X)\n", field->value,
     409                            field->usage);
    412410               
    413 //              key = usb_lgtch_map_usage(field->usage);
    414 //              usb_lgtch_push_ev(hid_dev, KEY_PRESS, key);
     411                        //key = usb_lgtch_map_usage(field->usage);
     412                        usb_lgtch_push_ev(hid_dev, KEY_PRESS, field->usage);
     413                }
    415414               
    416415                field = usb_hid_report_get_sibling(
    417                     hid_dev->report, field, path, USB_HID_PATH_COMPARE_BEGIN
     416                    hid_dev->report, field, path, USB_HID_PATH_COMPARE_END
    418417                    | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY,
    419418                    USB_HID_REPORT_TYPE_INPUT);
  • uspace/drv/usbhid/subdrivers.c

    rf55ded3 r7aaf403e  
    4242
    4343static usb_hid_subdriver_usage_t path_kbd[] = {
    44         {USB_HIDUT_PAGE_GENERIC_DESKTOP, 6},
     44        {USB_HIDUT_PAGE_GENERIC_DESKTOP, USB_HIDUT_USAGE_GENERIC_DESKTOP_KEYBOARD},
    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_MOUSE},
    5050        {0, 0}
    5151};
     
    5959        {
    6060                path_kbd,
    61                 -1,
    62                 USB_HID_PATH_COMPARE_BEGIN ,
     61                0,
     62                USB_HID_PATH_COMPARE_BEGIN,
    6363                -1,
    6464                -1,
     
    7474                lgtch_path,
    7575                1,
    76                 USB_HID_PATH_COMPARE_BEGIN,
     76                USB_HID_PATH_COMPARE_BEGIN
     77                | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY,         
    7778                0x046d,
    7879                0xc30e,
     
    8687        {
    8788                path_mouse2,
    88                 -1,
     89                0,
    8990                USB_HID_PATH_COMPARE_BEGIN,
    9091                -1,
  • uspace/drv/usbhid/usbhid.c

    rf55ded3 r7aaf403e  
    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,
    207             USB_HID_REPORT_TYPE_INPUT);
     205//      size_t size = usb_hid_report_size(hid_dev->report, 0,
     206//          USB_HID_REPORT_TYPE_INPUT);
     207        size_t size = 0;
     208        usb_hid_report_field_t *field = usb_hid_report_get_sibling (hid_dev->report,
     209                NULL, usage_path, mapping->compare, USB_HID_REPORT_TYPE_INPUT);
     210        while(field != NULL) {
     211                size++;
     212                field = usb_hid_report_get_sibling (hid_dev->report,
     213                                        field, usage_path, mapping->compare,
     214                            USB_HID_REPORT_TYPE_INPUT);
     215        }
     216       
    208217        usb_log_debug("Size of the input report: %zuB\n", size);
    209 
    210218        usb_hid_report_path_free(usage_path);
    211219       
  • uspace/drv/usbkbd/kbddev.c

    rf55ded3 r7aaf403e  
    803803        usb_hid_report_path_set_report_id(kbd_dev->led_path, 0x00);
    804804       
    805         kbd_dev->led_output_size = usb_hid_report_size(kbd_dev->parser, 0,
    806             USB_HID_REPORT_TYPE_OUTPUT);
     805        kbd_dev->led_output_size = usb_hid_report_size(kbd_dev->parser,
     806            0,
     807            USB_HID_REPORT_TYPE_INPUT);
    807808       
    808809        usb_log_debug("Output report size (in items): %zu\n",
  • uspace/lib/usb/src/hiddescriptor.c

    rf55ded3 r7aaf403e  
    155155                }
    156156                else {
     157
    157158                        /* Fill the correct Usage and Usage Page */
    158159                        int32_t usage;
     
    462463                       
    463464                case USB_HID_REPORT_TAG_COLLECTION:
     465
    464466                        // store collection atributes
    465467                        path_item = list_get_instance(usage_path->head.prev, usb_hid_report_usage_path_t, link);
  • uspace/lib/usb/src/hidparser.c

    rf55ded3 r7aaf403e  
    333333                report_item = list_get_instance(item, usb_hid_report_field_t, link);
    334334
     335                usb_log_debug("OUTPUT ITEM usage(%x), value(%x)\n", report_item->usage, report_item->value);
     336               
    335337                        if(USB_HID_ITEM_FLAG_VARIABLE(report_item->item_flags) == 0) {
    336338                                       
Note: See TracChangeset for help on using the changeset viewer.