Changeset cf2ccd4 in mainline for uspace/drv/usbhid


Ignore:
Timestamp:
2011-04-22T09:26:50Z (15 years ago)
Author:
Matej Klonfar <maklf@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7304663
Parents:
1553cbf (diff), 1775ebc (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:

new report structure and usbhid merge

Location:
uspace/drv/usbhid
Files:
9 edited

Legend:

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

    r1553cbf rcf2ccd4  
    9999        [0x30] = KC_RBRACKET,
    100100        [0x31] = KC_BACKSLASH,
    101         //[0x32] = KC_, // TODO: HASH??? maybe some as 0x31 - backslash
     101        //[0x32] = KC_, // TODO: HASH??? maybe same as 0x31 - backslash
     102        [0x32] = KC_BACKSLASH,
    102103        [0x33] = KC_SEMICOLON,
    103104        [0x34] = KC_QUOTE,  // same as APOSTROPHE? (')
  • uspace/drv/usbhid/kbd/kbddev.c

    r1553cbf rcf2ccd4  
    177177/*----------------------------------------------------------------------------*/
    178178
    179 static void usb_kbd_process_keycodes(const uint8_t *key_codes, size_t count,
    180     uint8_t report_id, void *arg);
    181 
    182 static const usb_hid_report_in_callbacks_t usb_kbd_parser_callbacks = {
    183         .keyboard = usb_kbd_process_keycodes
    184 };
     179//static void usb_kbd_process_keycodes(const uint8_t *key_codes, size_t count,
     180//    uint8_t report_id, void *arg);
     181
     182//static const usb_hid_report_in_callbacks_t usb_kbd_parser_callbacks = {
     183//      .keyboard = usb_kbd_process_keycodes
     184//};
    185185
    186186/*----------------------------------------------------------------------------*/
     
    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       
     
    488492 */
    489493static void usb_kbd_check_key_changes(usb_hid_dev_t *hid_dev,
    490     usb_kbd_t *kbd_dev, const uint8_t *key_codes, size_t count)
     494    usb_kbd_t *kbd_dev/*, const uint8_t *key_codes, size_t count*/)
    491495{
    492496        unsigned int key;
     
    502506         */
    503507        i = 0;
    504         while (i < count && key_codes[i] != ERROR_ROLLOVER) {
     508        while (i < kbd_dev->key_count && kbd_dev->keys[i] != ERROR_ROLLOVER) {
    505509                ++i;
    506510        }
    507         if (i != count) {
     511        if (i != kbd_dev->key_count) {
    508512                usb_log_debug("Phantom state occured.\n");
    509513                // phantom state, do nothing
    510514                return;
    511515        }
    512        
    513         /* TODO: quite dummy right now, think of better implementation */
    514         assert(count == kbd_dev->key_count);
    515516       
    516517        /*
    517518         * 1) Key releases
    518519         */
    519         for (j = 0; j < count; ++j) {
     520        for (j = 0; j < kbd_dev->key_count; ++j) {
    520521                // try to find the old key in the new key list
    521522                i = 0;
    522523                while (i < kbd_dev->key_count
    523                     && key_codes[i] != kbd_dev->keys[j]) {
     524                    && kbd_dev->keys[i] != kbd_dev->keys_old[j]) {
    524525                        ++i;
    525526                }
    526527               
    527                 if (i == count) {
     528                if (i == kbd_dev->key_count) {
    528529                        // not found, i.e. the key was released
    529                         key = usbhid_parse_scancode(kbd_dev->keys[j]);
     530                        key = usbhid_parse_scancode(kbd_dev->keys_old[j]);
    530531                        if (!usb_kbd_is_lock(key)) {
    531532                                usb_kbd_repeat_stop(kbd_dev, key);
     
    544545                // try to find the new key in the old key list
    545546                j = 0;
    546                 while (j < count && kbd_dev->keys[j] != key_codes[i]) {
     547                while (j < kbd_dev->key_count
     548                    && kbd_dev->keys_old[j] != kbd_dev->keys[i]) {
    547549                        ++j;
    548550                }
    549551               
    550                 if (j == count) {
     552                if (j == kbd_dev->key_count) {
    551553                        // not found, i.e. new key pressed
    552                         key = usbhid_parse_scancode(key_codes[i]);
     554                        key = usbhid_parse_scancode(kbd_dev->keys[i]);
    553555                        usb_log_debug2("Key pressed: %d (keycode: %d)\n", key,
    554                             key_codes[i]);
    555                         usb_kbd_push_ev(hid_dev, kbd_dev, KEY_PRESS,
    556                             key);
     556                            kbd_dev->keys[i]);
     557                        usb_kbd_push_ev(hid_dev, kbd_dev, KEY_PRESS, key);
    557558                        if (!usb_kbd_is_lock(key)) {
    558559                                usb_kbd_repeat_start(kbd_dev, key);
     
    563564        }
    564565       
    565         memcpy(kbd_dev->keys, key_codes, count);
    566 
    567         usb_log_debug("New stored keycodes: %s\n",
    568             usb_debug_str_buffer(kbd_dev->keys, kbd_dev->key_count, 0));
     566//      usb_log_debug("Old keys: ");
     567//      for (i = 0; i < kbd_dev->key_count; ++i) {
     568//              usb_log_debug("%d ", kbd_dev->keys_old[i]);
     569//      }
     570//      usb_log_debug("\n");
     571       
     572       
     573//      usb_log_debug("New keys: ");
     574//      for (i = 0; i < kbd_dev->key_count; ++i) {
     575//              usb_log_debug("%d ", kbd_dev->keys[i]);
     576//      }
     577//      usb_log_debug("\n");
     578       
     579        memcpy(kbd_dev->keys_old, kbd_dev->keys, kbd_dev->key_count * 4);
     580       
     581        usb_log_debug2("New stored keys: ");
     582        for (i = 0; i < kbd_dev->key_count; ++i) {
     583                usb_log_debug2("%d ", kbd_dev->keys_old[i]);
     584        }
     585        usb_log_debug2("\n");
    569586}
    570587
     
    588605 * @sa usb_kbd_check_key_changes(), usb_kbd_check_modifier_changes()
    589606 */
    590 static void usb_kbd_process_keycodes(const uint8_t *key_codes, size_t count,
    591     uint8_t report_id, void *arg)
    592 {
    593         if (arg == NULL) {
    594                 usb_log_warning("Missing argument in callback "
    595                     "usbhid_process_keycodes().\n");
    596                 return;
    597         }
    598        
    599         usb_hid_dev_t *hid_dev = (usb_hid_dev_t *)arg;
    600        
    601         if (hid_dev->data == NULL) {
    602                 usb_log_warning("Missing KBD device structure in callback.\n");
    603                 return;
    604         }
    605        
    606         usb_kbd_t *kbd_dev = (usb_kbd_t *)hid_dev->data;
    607 
    608         usb_log_debug("Got keys from parser (report id: %u): %s\n",
    609             report_id, usb_debug_str_buffer(key_codes, count, 0));
    610        
    611         if (count != kbd_dev->key_count) {
    612                 usb_log_warning("Number of received keycodes (%d) differs from"
    613                     " expected number (%d).\n", count, kbd_dev->key_count);
    614                 return;
    615         }
    616        
    617         ///usb_kbd_check_modifier_changes(kbd_dev, key_codes, count);
    618         usb_kbd_check_key_changes(hid_dev, kbd_dev, key_codes, count);
    619 }
     607//static void usb_kbd_process_keycodes(const uint8_t *key_codes, size_t count,
     608//    uint8_t report_id, void *arg)
     609//{
     610//      if (arg == NULL) {
     611//              usb_log_warning("Missing argument in callback "
     612//                  "usbhid_process_keycodes().\n");
     613//              return;
     614//      }
     615       
     616//      usb_hid_dev_t *hid_dev = (usb_hid_dev_t *)arg;
     617       
     618//      if (hid_dev->data == NULL) {
     619//              usb_log_warning("Missing KBD device structure in callback.\n");
     620//              return;
     621//      }
     622       
     623//      usb_kbd_t *kbd_dev = (usb_kbd_t *)hid_dev->data;
     624
     625//      usb_log_debug("Got keys from parser (report id: %u): %s\n",
     626//          report_id, usb_debug_str_buffer(key_codes, count, 0));
     627       
     628//      if (count != kbd_dev->key_count) {
     629//              usb_log_warning("Number of received keycodes (%zu) differs from"
     630//                  " expected (%zu).\n", count, kbd_dev->key_count);
     631//              return;
     632//      }
     633       
     634//      ///usb_kbd_check_modifier_changes(kbd_dev, key_codes, count);
     635//      usb_kbd_check_key_changes(hid_dev, kbd_dev, key_codes, count);
     636//}
    620637
    621638/*----------------------------------------------------------------------------*/
     
    641658                                 uint8_t *buffer, size_t actual_size)
    642659{
    643         assert(hid_dev->parser != NULL);
     660        assert(hid_dev->report != NULL);
     661        assert(hid_dev != NULL);
     662        assert(hid_dev->data != NULL);
     663       
     664        usb_kbd_t *kbd_dev = (usb_kbd_t *)hid_dev->data;
    644665
    645666        usb_log_debug("Calling usb_hid_parse_report() with "
     
    653674
    654675        uint8_t report_id;
    655         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);
     678       
     679        if (rc != EOK) {
     680                usb_log_warning("Error in usb_hid_parse_report():"
     681                    "%s\n", str_error(rc));
     682        }
     683       
    656684        usb_hid_report_path_set_report_id (path, report_id);
    657         usb_hid_report_field_t *field = usb_hid_report_get_sibling(hid_dev->parser,
    658                             NULL, path, USB_HID_PATH_COMPARE_END | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY,
    659                                                 USB_HID_REPORT_TYPE_INPUT);
    660 
    661         unsigned i=0;
    662         usb_kbd_t *kbd_dev = (usb_kbd_t *)hid_dev->data;
    663 
    664         memset(kbd_dev->keys, 0, kbd_dev->key_count);
    665         while(field != NULL) {
    666                 if((i < kbd_dev->key_count) && (field->value != 0)){
    667                         kbd_dev->keys[i++] = (uint8_t)field->usage;
    668                 }
    669                 field = usb_hid_report_get_sibling(hid_dev->parser, field, path,
    670                                                    USB_HID_PATH_COMPARE_END | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY,
    671                                                    USB_HID_REPORT_TYPE_INPUT);
    672         }
    673         usb_kbd_process_keycodes(kbd_dev->keys, kbd_dev->key_count, report_id, hid_dev);
     685       
     686        // fill in the currently pressed keys
     687       
     688        usb_hid_report_field_t *field = usb_hid_report_get_sibling(
     689            hid_dev->report, NULL, path,
     690            USB_HID_PATH_COMPARE_END | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY,
     691            USB_HID_REPORT_TYPE_INPUT);
     692        unsigned i = 0;
     693       
     694        while (field != NULL) {
     695                usb_log_debug2("FIELD (%p) - VALUE(%d) USAGE(%u)\n",
     696                    field, field->value, field->value);
     697               
     698                assert(i < kbd_dev->key_count);
     699//              if (i == kbd_dev->key_count) {
     700//                      break;
     701//              }
     702               
     703                // save the key usage
     704                /* TODO: maybe it's not good to save value, nor usage
     705                 *       as the value may be e.g. 1 for LEDs and usage may be
     706                 *       value of the LED. On the other hand, in case of normal
     707                 *       keys, the usage is more important and we must check
     708                 *       that. One possible solution: distinguish between those
     709                 *       two parts of the Report somehow.
     710                 */
     711                kbd_dev->keys[i] = field->value;
     712                usb_log_debug2("Saved %u. key usage %d\n", i, kbd_dev->keys[i]);
     713               
     714                ++i;
     715                field = usb_hid_report_get_sibling(hid_dev->report, field, path,
     716                    USB_HID_PATH_COMPARE_END
     717                    | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY,
     718                    USB_HID_REPORT_TYPE_INPUT);
     719        }
    674720       
    675721        usb_hid_report_path_free(path);
    676722       
    677         if (rc != EOK) {
    678                 usb_log_warning("Error in usb_hid_boot_keyboard_input_report():"
    679                     "%s\n", str_error(rc));
    680         }
     723        usb_kbd_check_key_changes(hid_dev, kbd_dev);
    681724}
    682725
     
    766809       
    767810        kbd_dev->key_count = usb_hid_report_input_length(
    768             hid_dev->parser, path,
     811            hid_dev->report, path,
    769812            USB_HID_PATH_COMPARE_END | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY);
    770813        usb_hid_report_path_free(path);
     
    772815        usb_log_debug("Size of the input report: %zu\n", kbd_dev->key_count);
    773816       
    774         kbd_dev->keys = (uint8_t *)calloc(kbd_dev->key_count, sizeof(uint8_t));
     817        kbd_dev->keys = (int32_t *)calloc(kbd_dev->key_count, sizeof(int32_t));
    775818       
    776819        if (kbd_dev->keys == NULL) {
     
    780823        }
    781824       
     825        kbd_dev->keys_old =
     826                (int32_t *)calloc(kbd_dev->key_count, sizeof(int32_t));
     827       
     828        if (kbd_dev->keys_old == NULL) {
     829                usb_log_fatal("No memory!\n");
     830                free(kbd_dev->keys);
     831                free(kbd_dev);
     832                return ENOMEM;
     833        }
     834       
    782835        /*
    783836         * Output report
    784837         */
    785838        kbd_dev->output_size = 0;
    786         kbd_dev->output_buffer = usb_hid_report_output(hid_dev->parser,
    787             &kbd_dev->output_size, 0x00);
     839        kbd_dev->output_buffer = usb_hid_report_output(hid_dev->report,
     840            &kbd_dev->output_size, 0);
    788841        if (kbd_dev->output_buffer == NULL) {
    789842                usb_log_warning("Error creating output report buffer.\n");
     
    798851            kbd_dev->led_path, USB_HIDUT_PAGE_LED, 0);
    799852       
    800         kbd_dev->led_output_size = usb_hid_report_output_size(hid_dev->parser,
     853        kbd_dev->led_output_size = usb_hid_report_output_size(hid_dev->report,
    801854            kbd_dev->led_path,
    802855            USB_HID_PATH_COMPARE_END | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY);
     
    9551008int usb_kbd_set_boot_protocol(usb_hid_dev_t *hid_dev)
    9561009{
    957         int rc = usb_hid_parse_report_descriptor(hid_dev->parser,
     1010        int rc = usb_hid_parse_report_descriptor(hid_dev->report,
    9581011            USB_KBD_BOOT_REPORT_DESCRIPTOR,
    9591012            USB_KBD_BOOT_REPORT_DESCRIPTOR_SIZE);
  • uspace/drv/usbhid/kbd/kbddev.h

    r1553cbf rcf2ccd4  
    6565 */
    6666typedef struct usb_kbd_t {
     67        /** Previously pressed keys (not translated to key codes). */
     68        int32_t *keys_old;
    6769        /** Currently pressed keys (not translated to key codes). */
    68         uint8_t *keys;
     70        int32_t *keys;
    6971        /** Count of stored keys (i.e. number of keys in the report). */
    7072        size_t key_count;
  • uspace/drv/usbhid/lgtch-ultrax/lgtch-ultrax.c

    r1553cbf rcf2ccd4  
    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->parser, 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(NAME " KEY VALUE(%X) USAGE(%X)\n", field->value,
     96                    field->usage);
    9197        }
    9298       
     
    95101       
    96102        if (rc != EOK) {
    97                 usb_log_warning("Error in usb_hid_boot_keyboard_input_report():"
     103                usb_log_warning(NAME "Error in usb_hid_boot_keyboard_input_report():"
    98104                    "%s\n", str_error(rc));
    99105        }
  • uspace/drv/usbhid/mouse/mousedev.c

    r1553cbf rcf2ccd4  
    296296int usb_mouse_set_boot_protocol(usb_hid_dev_t *hid_dev)
    297297{
    298         int rc = usb_hid_parse_report_descriptor(hid_dev->parser,
     298        int rc = usb_hid_parse_report_descriptor(hid_dev->report,
    299299            USB_MOUSE_BOOT_REPORT_DESCRIPTOR,
    300300            USB_MOUSE_BOOT_REPORT_DESCRIPTOR_SIZE);
  • uspace/drv/usbhid/subdrivers.c

    r1553cbf rcf2ccd4  
    5555                USB_HID_PATH_COMPARE_END
    5656                | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY,
    57                 0,
    58                 0,
     57                -1,
     58                -1,
    5959                {
    6060                        .init = usb_kbd_init,
     
    7979                }
    8080        },
    81         {NULL, -1, 0, 0, 0, {NULL, NULL, NULL, NULL}}
     81        {NULL, -1, 0, -1, -1, {NULL, NULL, NULL, NULL}}
    8282};
    8383
  • uspace/drv/usbhid/subdrivers.h

    r1553cbf rcf2ccd4  
    5656        int report_id;
    5757        int compare;
    58         uint16_t vendor_id;
    59         uint16_t product_id;
     58        int vendor_id;
     59        int product_id;
    6060        usb_hid_subdriver_t subdriver;
    6161} usb_hid_subdriver_mapping_t;
  • uspace/drv/usbhid/usbhid.c

    r1553cbf rcf2ccd4  
    158158    const usb_hid_subdriver_mapping_t *mapping)
    159159{
    160         return false;
     160        assert(hid_dev != NULL);
     161        assert(hid_dev->usb_dev != NULL);
     162       
     163        return (hid_dev->usb_dev->descriptors.device.vendor_id
     164            == mapping->vendor_id
     165            && hid_dev->usb_dev->descriptors.device.product_id
     166            == mapping->product_id);
    161167}
    162168
     
    192198        }
    193199       
    194         assert(hid_dev->parser != NULL);
     200        assert(hid_dev->report != NULL);
    195201       
    196202        usb_log_debug("Compare flags: %d\n", mapping->compare);
    197         size_t size = usb_hid_report_input_length(hid_dev->parser, usage_path,
     203        size_t size = usb_hid_report_input_length(hid_dev->report, usage_path,
    198204            mapping->compare);
    199         usb_log_debug("Size of the input report: %d\n", size);
     205        usb_log_debug("Size of the input report: %zuB\n", size);
    200206       
    201207        usb_hid_report_path_free(usage_path);
     
    251257        while (count < USB_HID_MAX_SUBDRIVERS &&
    252258            (mapping->usage_path != NULL
    253             || mapping->vendor_id != 0 || mapping->product_id != 0)) {
     259            || mapping->vendor_id >= 0 || mapping->product_id >= 0)) {
    254260                // check the vendor & product ID
    255                 if (mapping->vendor_id != 0 && mapping->product_id == 0) {
    256                         usb_log_warning("Missing Product ID for Vendor ID %u\n",
     261                if (mapping->vendor_id >= 0 && mapping->product_id < 0) {
     262                        usb_log_warning("Missing Product ID for Vendor ID %d\n",
    257263                            mapping->vendor_id);
    258264                        return EINVAL;
    259265                }
    260                 if (mapping->product_id != 0 && mapping->vendor_id == 0) {
    261                         usb_log_warning("Missing Vendor ID for Product ID %u\n",
     266                if (mapping->product_id >= 0 && mapping->vendor_id < 0) {
     267                        usb_log_warning("Missing Vendor ID for Product ID %d\n",
    262268                            mapping->product_id);
    263269                        return EINVAL;
     
    267273                matched = false;
    268274               
    269                 if (mapping->vendor_id != 0) {
    270                         assert(mapping->product_id != 0);
     275                if (mapping->vendor_id >= 0) {
     276                        assert(mapping->product_id >= 0);
    271277                        usb_log_debug("Comparing device against vendor ID %u"
    272278                            " and product ID %u.\n", mapping->vendor_id,
     
    341347        }
    342348       
    343         hid_dev->parser = (usb_hid_report_t *)(malloc(sizeof(
     349        hid_dev->report = (usb_hid_report_t *)(malloc(sizeof(
    344350            usb_hid_report_t)));
    345         if (hid_dev->parser == NULL) {
     351        if (hid_dev->report == NULL) {
    346352                usb_log_fatal("No memory!\n");
    347353                free(hid_dev);
     
    385391        /* Get the report descriptor and parse it. */
    386392        rc = usb_hid_process_report_descriptor(hid_dev->usb_dev,
    387             hid_dev->parser);
     393            hid_dev->report);
    388394       
    389395        bool fallback = false;
     
    583589
    584590        // destroy the parser
    585         if ((*hid_dev)->parser != NULL) {
    586                 usb_hid_free_report((*hid_dev)->parser);
     591        if ((*hid_dev)->report != NULL) {
     592                usb_hid_free_report((*hid_dev)->report);
    587593        }
    588594
  • uspace/drv/usbhid/usbhid.h

    r1553cbf rcf2ccd4  
    9191       
    9292        /** HID Report parser. */
    93         usb_hid_report_t *parser;
     93        usb_hid_report_t *report;
    9494       
    9595        /** Arbitrary data (e.g. a special structure for handling keyboard). */
Note: See TracChangeset for help on using the changeset viewer.