Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/usbinfo/hid.c

    rfeeac0d ra1732929  
    3636#include <stdio.h>
    3737#include <str_error.h>
     38#include <usb/debug.h>
    3839#include <usb/classes/classes.h>
    3940#include <usb/dev/request.h>
     
    5051
    5152typedef struct {
    52         usbinfo_device_t *dev;
     53        usb_device_t *usb_dev;
    5354        hid_dump_type_t dump_type;
    5455        usb_standard_interface_descriptor_t *last_iface;
     
    140141            raw_report, report_size, &actual_report_size);
    141142        if (rc != EOK) {
    142                 usb_log_error("Failed to retrieve HID report descriptor: %s.\n",
     143                usb_log_error("Failed to retrieve HID report descriptor: %s.",
    143144                    str_error(rc));
    144145                free(raw_report);
     
    149150        rc = usb_hid_parse_report_descriptor(&report, raw_report, report_size);
    150151        if (rc != EOK) {
    151                 usb_log_error("Failed to part report descriptor: %s.\n",
     152                usb_log_error("Failed to part report descriptor: %s.",
    152153                    str_error(rc));
    153154        }
     
    211212
    212213        retrieve_and_dump_hid_report(context->dump_type,
    213             &context->dev->ctrl_pipe, context->last_iface->interface_number,
    214             report_size);
    215 }
    216 
    217 
    218 void dump_hidreport_raw(usbinfo_device_t *dev)
     214            usb_device_get_default_pipe(context->usb_dev),
     215            context->last_iface->interface_number, report_size);
     216}
     217
     218
     219void dump_hidreport_raw(usb_device_t *usb_dev)
    219220{
    220221        descriptor_walk_context_t context = {
    221                 .dev = dev,
     222                .usb_dev = usb_dev,
    222223                .dump_type = HID_DUMP_RAW,
    223224                .last_iface = NULL
    224225        };
    225226
    226         usb_dp_walk_simple(dev->full_configuration_descriptor,
    227             dev->full_configuration_descriptor_size,
     227        usb_dp_walk_simple(
     228            usb_device_descriptors(usb_dev)->full_config,
     229            usb_device_descriptors(usb_dev)->full_config_size,
    228230            usb_dp_standard_descriptor_nesting,
    229231            descriptor_walk_callback, &context);
    230232}
    231233
    232 void dump_hidreport_usages(usbinfo_device_t *dev)
     234void dump_hidreport_usages(usb_device_t *usb_dev)
    233235{
    234236        descriptor_walk_context_t context = {
    235                 .dev = dev,
     237                .usb_dev = usb_dev,
    236238                .dump_type = HID_DUMP_USAGES,
    237239                .last_iface = NULL
    238240        };
    239241
    240         usb_dp_walk_simple(dev->full_configuration_descriptor,
    241             dev->full_configuration_descriptor_size,
     242        usb_dp_walk_simple(
     243            usb_device_descriptors(usb_dev)->full_config,
     244            usb_device_descriptors(usb_dev)->full_config_size,
    242245            usb_dp_standard_descriptor_nesting,
    243246            descriptor_walk_callback, &context);
Note: See TracChangeset for help on using the changeset viewer.