Changeset 6513110 in mainline


Ignore:
Timestamp:
2011-04-21T21:01:58Z (13 years ago)
Author:
Lubos Slovak <lubos.slovak@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f240d30
Parents:
eb393ad
Message:

Fixes

Location:
uspace/drv/usbhid
Files:
2 edited

Legend:

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

    reb393ad r6513110  
    304304        usb_log_debug("Creating output report:\n");
    305305
    306         usb_hid_report_field_t *field = usb_hid_report_get_sibling (hid_dev->parser, NULL,
    307                 kbd_dev->led_path,
    308                                 USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY | USB_HID_PATH_COMPARE_END,
    309                                 USB_HID_REPORT_TYPE_OUTPUT);
    310         while(field != NULL) {
    311 
    312                 if((field->usage == USB_HID_LED_NUM_LOCK) && (kbd_dev->mods & KM_NUM_LOCK)){
     306        usb_hid_report_field_t *field = usb_hid_report_get_sibling(
     307            hid_dev->report, NULL, kbd_dev->led_path,
     308            USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY | USB_HID_PATH_COMPARE_END,
     309            USB_HID_REPORT_TYPE_OUTPUT);
     310       
     311        while (field != NULL) {
     312
     313                if ((field->usage == USB_HID_LED_NUM_LOCK)
     314                    && (kbd_dev->mods & KM_NUM_LOCK)){
    313315                        field->value = 1;
    314316                }
    315317
    316                 if((field->usage == USB_HID_LED_CAPS_LOCK) && (kbd_dev->mods & KM_CAPS_LOCK)){
     318                if ((field->usage == USB_HID_LED_CAPS_LOCK)
     319                    && (kbd_dev->mods & KM_CAPS_LOCK)){
    317320                        field->value = 1;
    318321                }
    319322
    320                 if((field->usage == USB_HID_LED_SCROLL_LOCK) && (kbd_dev->mods & KM_SCROLL_LOCK)){
     323                if ((field->usage == USB_HID_LED_SCROLL_LOCK)
     324                    && (kbd_dev->mods & KM_SCROLL_LOCK)){
    321325                        field->value = 1;
    322326                }
    323327               
    324                 field = usb_hid_report_get_sibling (hid_dev->parser, field,
    325                 kbd_dev->led_path,
    326                                 USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY | USB_HID_PATH_COMPARE_END,
    327                                 USB_HID_REPORT_TYPE_OUTPUT);
    328         }
    329                
    330         int rc = usb_hid_report_output_translate(hid_dev->parser, 0,
     328                field = usb_hid_report_get_sibling(hid_dev->report, field,
     329                    kbd_dev->led_path, USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY
     330                    | USB_HID_PATH_COMPARE_END, USB_HID_REPORT_TYPE_OUTPUT);
     331        }
     332       
     333        // TODO: what about the Report ID?
     334        int rc = usb_hid_report_output_translate(hid_dev->report, 0,
    331335            kbd_dev->output_buffer, kbd_dev->output_size);
    332336       
     
    336340                return;
    337341        }
    338        
    339         // TODO: output translating does not work!!
    340342       
    341343        usb_log_debug("Output report buffer: %s\n",
     
    672674
    673675        uint8_t report_id;
    674         int rc = usb_hid_parse_report(hid_dev->parser, buffer, actual_size, &report_id);       
     676        int rc = usb_hid_parse_report(hid_dev->report, buffer, actual_size,
     677            &report_id);
    675678        usb_hid_report_path_set_report_id (path, report_id);
    676         usb_hid_report_field_t *field = usb_hid_report_get_sibling(hid_dev->parser,
    677                             NULL, path, USB_HID_PATH_COMPARE_END | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY,
    678                                                 USB_HID_REPORT_TYPE_INPUT);
     679       
     680        usb_hid_report_field_t *field = usb_hid_report_get_sibling(
     681            hid_dev->report, NULL, path, USB_HID_PATH_COMPARE_END
     682            | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY, USB_HID_REPORT_TYPE_INPUT);
    679683
    680684        usb_hid_report_path_free(path);
     
    687691        // fill in the currently pressed keys
    688692       
    689         usb_hid_report_field_t *field = usb_hid_report_get_sibling(
    690             hid_dev->report, NULL, path, USB_HID_PATH_COMPARE_END
    691             | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY, USB_HID_REPORT_TYPE_INPUT);
     693        field = usb_hid_report_get_sibling(hid_dev->report, NULL, path,
     694            USB_HID_PATH_COMPARE_END | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY,
     695            USB_HID_REPORT_TYPE_INPUT);
    692696        unsigned i = 0;
    693697       
  • uspace/drv/usbhid/lgtch-ultrax/lgtch-ultrax.c

    reb393ad r6513110  
    8383
    8484        uint8_t report_id;
    85         int rc = usb_hid_parse_report(hid_dev->parser, buffer, buffer_size, &report_id);
     85       
     86        int rc = usb_hid_parse_report(hid_dev->report, buffer, buffer_size,
     87            &report_id);
    8688        usb_hid_report_path_set_report_id(path, report_id);
    8789
    88         usb_hid_report_field_t *field = usb_hid_report_get_sibling(hid_dev->report, NULL, path, USB_HID_PATH_COMPARE_END , USB_HID_REPORT_TYPE_INPUT);
    89         while(field != NULL) {
    90                 usb_log_debug("KEY VALUE(%X) USAGE(%X)\n", field->value, field->usage);
     90        usb_hid_report_field_t *field = usb_hid_report_get_sibling(
     91            hid_dev->report, NULL, path, USB_HID_PATH_COMPARE_END ,
     92            USB_HID_REPORT_TYPE_INPUT);
     93       
     94        while (field != NULL) {
     95                usb_log_debug("KEY VALUE(%X) USAGE(%X)\n", field->value,
     96                    field->usage);
    9197        }
    9298       
Note: See TracChangeset for help on using the changeset viewer.