Changeset 3a6e423 in mainline for uspace/drv


Ignore:
Timestamp:
2011-05-08T19:38:24Z (14 years ago)
Author:
Matej Klonfar <maklf@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7aaf403e
Parents:
7b6f116
Message:

Parsing of usages in case of array items repaired

Location:
uspace/drv
Files:
5 edited

Legend:

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

    r7b6f116 r3a6e423  
    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       
     
    865866        usb_hid_report_path_set_report_id(path, 0);
    866867       
    867         kbd_dev->key_count = usb_hid_report_input_length(
    868             hid_dev->report, path,
    869             USB_HID_PATH_COMPARE_END | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY);
     868        kbd_dev->key_count = usb_hid_report_size(
     869            hid_dev->report, 0, USB_HID_REPORT_TYPE_INPUT);
    870870        usb_hid_report_path_free(path);
    871871       
     
    908908            kbd_dev->led_path, USB_HIDUT_PAGE_LED, 0);
    909909       
    910         kbd_dev->led_output_size = usb_hid_report_output_size(hid_dev->report,
    911             kbd_dev->led_path,
    912             USB_HID_PATH_COMPARE_END | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY);
     910        kbd_dev->led_output_size = usb_hid_report_size(hid_dev->report,
     911            0, USB_HID_REPORT_TYPE_OUTPUT);
    913912       
    914913        usb_log_debug("Output report size (in items): %zu\n",
  • uspace/drv/usbhid/lgtch-ultrax/lgtch-ultrax.c

    r7b6f116 r3a6e423  
    300300        usb_hid_report_path_set_report_id(path, 1);
    301301       
    302         lgtch_dev->key_count = usb_hid_report_input_length(
    303             hid_dev->report, path,
    304             USB_HID_PATH_COMPARE_END | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY);
     302        lgtch_dev->key_count = usb_hid_report_size(
     303            hid_dev->report, 0, USB_HID_REPORT_TYPE_INPUT);
    305304        usb_hid_report_path_free(path);
    306305       
     
    400399            USB_HID_REPORT_TYPE_INPUT);
    401400       
    402         unsigned int key;
     401//      unsigned int key;
    403402       
    404403        /*! @todo Is this iterating OK if done multiple times?
     
    406405         */
    407406        while (field != NULL) {
    408                 usb_log_debug(NAME " KEY VALUE(%X) USAGE(%X)\n", field->value,
    409                     field->usage);
     407                if(field->value != 0) {
     408                        usb_log_debug(NAME " KEY VALUE(%X) USAGE(%X)\n", field->value,
     409                            field->usage);
    410410               
    411                 key = usb_lgtch_map_usage(field->usage);
    412                 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                }
    413414               
    414415                field = usb_hid_report_get_sibling(
  • uspace/drv/usbhid/subdrivers.c

    r7b6f116 r3a6e423  
    4242
    4343static usb_hid_subdriver_usage_t path_kbd[] = {
    44         {USB_HIDUT_PAGE_KEYBOARD, 0},
     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, USB_HIDUT_USAGE_GENERIC_DESKTOP_X},
     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_END
    63                 | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY,
     61                0,
     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
     77                | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY,         
    7978                0x046d,
    8079                0xc30e,
     
    8887        {
    8988                path_mouse2,
    90                 -1,
    91                 USB_HID_PATH_COMPARE_END
    92                 | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY,
     89                0,
     90                USB_HID_PATH_COMPARE_BEGIN,
    9391                -1,
    9492                -1,
  • uspace/drv/usbhid/usbhid.c

    r7b6f116 r3a6e423  
    203203       
    204204        usb_log_debug("Compare flags: %d\n", mapping->compare);
    205         size_t size = usb_hid_report_input_length(hid_dev->report, usage_path,
    206             mapping->compare);
     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       
    207217        usb_log_debug("Size of the input report: %zuB\n", size);
    208        
    209218        usb_hid_report_path_free(usage_path);
    210219       
  • uspace/drv/usbkbd/kbddev.c

    r7b6f116 r3a6e423  
    771771        usb_hid_report_path_set_report_id(path, 0);
    772772       
    773         kbd_dev->key_count = usb_hid_report_input_length(
    774             kbd_dev->parser, path, USB_HID_PATH_COMPARE_END);
     773        kbd_dev->key_count = usb_hid_report_size(
     774            kbd_dev->parser, 0, USB_HID_REPORT_TYPE_INPUT);
    775775        usb_hid_report_path_free (path);
    776776       
     
    803803        usb_hid_report_path_set_report_id(kbd_dev->led_path, 0x00);
    804804       
    805         kbd_dev->led_output_size = usb_hid_report_output_size(kbd_dev->parser,
    806             kbd_dev->led_path,
    807             USB_HID_PATH_COMPARE_END | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY);
     805        kbd_dev->led_output_size = usb_hid_report_size(kbd_dev->parser,
     806            0,
     807            USB_HID_REPORT_TYPE_INPUT);
    808808       
    809809        usb_log_debug("Output report size (in items): %zu\n",
Note: See TracChangeset for help on using the changeset viewer.