Changeset e1dbcbc in mainline for uspace/lib/usb/src/hidreport.c


Ignore:
Timestamp:
2011-04-29T13:43:01Z (13 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a81a1d09
Parents:
380e0364 (diff), f19f1b7 (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:

Merge development/ changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usb/src/hidreport.c

    r380e0364 re1dbcbc  
    109109       
    110110        if (*d != sizeof(usb_standard_hid_descriptor_t)) {
    111                 usb_log_error("HID descriptor hass wrong size (%u, expected %u"
     111                usb_log_error("HID descriptor has wrong size (%u, expected %zu"
    112112                    ")\n", *d, sizeof(usb_standard_hid_descriptor_t));
    113113                return EINVAL;
     
    119119        uint16_t length =  hid_desc->report_desc_info.length;
    120120        size_t actual_size = 0;
    121        
    122         /*
    123          * Start session for the control transfer.
    124          */
    125         int sess_rc = usb_pipe_start_session(&dev->ctrl_pipe);
    126         if (sess_rc != EOK) {
    127                 usb_log_warning("Failed to start a session: %s.\n",
    128                     str_error(sess_rc));
    129                 return sess_rc;
    130         }
    131121
    132122        /*
     
    159149                free(*report_desc);
    160150                *report_desc = NULL;
    161                 usb_log_error("Report descriptor has wrong size (%u, expected "
     151                usb_log_error("Report descriptor has wrong size (%zu, expected "
    162152                    "%u)\n", actual_size, length);
    163153                return EINVAL;
    164154        }
    165155       
    166         /*
    167          * End session for the control transfer.
    168          */
    169         sess_rc = usb_pipe_end_session(&dev->ctrl_pipe);
    170         if (sess_rc != EOK) {
    171                 usb_log_warning("Failed to end a session: %s.\n",
    172                     str_error(sess_rc));
    173                 free(*report_desc);
    174                 *report_desc = NULL;
    175                 return sess_rc;
    176         }
    177        
    178156        *size = length;
    179157       
     
    186164
    187165int usb_hid_process_report_descriptor(usb_device_t *dev,
    188     usb_hid_report_parser_t *parser)
     166    usb_hid_report_t *report)
    189167{
    190         if (dev == NULL || parser == NULL) {
     168        if (dev == NULL || report == NULL) {
    191169                usb_log_error("Failed to process Report descriptor: wrong "
    192170                    "parameters given.\n");
     
    211189        assert(report_desc != NULL);
    212190       
    213         rc = usb_hid_parse_report_descriptor(parser, report_desc, report_size);
     191        rc = usb_hid_parse_report_descriptor(report, report_desc, report_size);
    214192        if (rc != EOK) {
    215193                usb_log_error("Problem parsing Report descriptor: %s.\n",
     
    219197        }
    220198       
    221         usb_hid_descriptor_print(parser);
     199        usb_hid_descriptor_print(report);
    222200        free(report_desc);
    223201       
Note: See TracChangeset for help on using the changeset viewer.