Changeset d59d0bb in mainline for uspace/drv


Ignore:
Timestamp:
2011-05-12T09:16:30Z (14 years ago)
Author:
Lubos Slovak <lubos.slovak@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
97cb542
Parents:
9e195e2c (diff), 9be8669 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merged changes to HID parser from maklf

Location:
uspace/drv/usbhid
Files:
3 edited

Legend:

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

    r9e195e2c rd59d0bb  
    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/multimedia/multimedia.c

    r9e195e2c rd59d0bb  
    252252        usb_hid_report_path_set_report_id(path, 1);
    253253       
    254         multim_dev->key_count = usb_hid_report_input_length(
    255             hid_dev->report, path,
    256             USB_HID_PATH_COMPARE_END | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY);
     254        multim_dev->key_count = usb_hid_report_size(
     255            hid_dev->report, 0, USB_HID_REPORT_TYPE_INPUT);
     256
    257257        usb_hid_report_path_free(path);
    258258       
     
    347347            USB_HID_REPORT_TYPE_INPUT);
    348348       
    349         unsigned int key;
     349//      unsigned int key;
    350350       
    351351        /*! @todo Is this iterating OK if done multiple times?
     
    353353         */
    354354        while (field != NULL) {
    355                 usb_log_debug(NAME " KEY VALUE(%X) USAGE(%X)\n", field->value,
    356                     field->usage);
    357                
    358                 key = usb_multimedia_map_usage(field->usage);
    359                 const char *key_str = usb_multimedia_usage_to_str(field->usage);
    360                 usb_log_info("Pressed key: %s\n", key_str);
    361                 usb_multimedia_push_ev(hid_dev, KEY_PRESS, key);
     355                if(field->value != 0) {
     356                        usb_log_debug(NAME " KEY VALUE(%X) USAGE(%X)\n", field->value,
     357                            field->usage);
     358                        key = usb_multimedia_map_usage(field->usage);
     359                        const char *key_str =
     360                            usb_multimedia_usage_to_str(field->usage);
     361                        usb_log_info("Pressed key: %s\n", key_str);
     362                        usb_multimedia_push_ev(hid_dev, KEY_PRESS, key);
     363                }
    362364               
    363365                field = usb_hid_report_get_sibling(
  • uspace/drv/usbhid/usbhid.c

    r9e195e2c rd59d0bb  
    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       
Note: See TracChangeset for help on using the changeset viewer.