Ignore:
File:
1 edited

Legend:

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

    ra1732929 rfeeac0d  
    3636#include <stdio.h>
    3737#include <str_error.h>
    38 #include <usb/debug.h>
    3938#include <usb/classes/classes.h>
    4039#include <usb/dev/request.h>
     
    5150
    5251typedef struct {
    53         usb_device_t *usb_dev;
     52        usbinfo_device_t *dev;
    5453        hid_dump_type_t dump_type;
    5554        usb_standard_interface_descriptor_t *last_iface;
     
    141140            raw_report, report_size, &actual_report_size);
    142141        if (rc != EOK) {
    143                 usb_log_error("Failed to retrieve HID report descriptor: %s.",
     142                usb_log_error("Failed to retrieve HID report descriptor: %s.\n",
    144143                    str_error(rc));
    145144                free(raw_report);
     
    150149        rc = usb_hid_parse_report_descriptor(&report, raw_report, report_size);
    151150        if (rc != EOK) {
    152                 usb_log_error("Failed to part report descriptor: %s.",
     151                usb_log_error("Failed to part report descriptor: %s.\n",
    153152                    str_error(rc));
    154153        }
     
    212211
    213212        retrieve_and_dump_hid_report(context->dump_type,
    214             usb_device_get_default_pipe(context->usb_dev),
    215             context->last_iface->interface_number, report_size);
    216 }
    217 
    218 
    219 void dump_hidreport_raw(usb_device_t *usb_dev)
     213            &context->dev->ctrl_pipe, context->last_iface->interface_number,
     214            report_size);
     215}
     216
     217
     218void dump_hidreport_raw(usbinfo_device_t *dev)
    220219{
    221220        descriptor_walk_context_t context = {
    222                 .usb_dev = usb_dev,
     221                .dev = dev,
    223222                .dump_type = HID_DUMP_RAW,
    224223                .last_iface = NULL
    225224        };
    226225
    227         usb_dp_walk_simple(
    228             usb_device_descriptors(usb_dev)->full_config,
    229             usb_device_descriptors(usb_dev)->full_config_size,
     226        usb_dp_walk_simple(dev->full_configuration_descriptor,
     227            dev->full_configuration_descriptor_size,
    230228            usb_dp_standard_descriptor_nesting,
    231229            descriptor_walk_callback, &context);
    232230}
    233231
    234 void dump_hidreport_usages(usb_device_t *usb_dev)
     232void dump_hidreport_usages(usbinfo_device_t *dev)
    235233{
    236234        descriptor_walk_context_t context = {
    237                 .usb_dev = usb_dev,
     235                .dev = dev,
    238236                .dump_type = HID_DUMP_USAGES,
    239237                .last_iface = NULL
    240238        };
    241239
    242         usb_dp_walk_simple(
    243             usb_device_descriptors(usb_dev)->full_config,
    244             usb_device_descriptors(usb_dev)->full_config_size,
     240        usb_dp_walk_simple(dev->full_configuration_descriptor,
     241            dev->full_configuration_descriptor_size,
    245242            usb_dp_standard_descriptor_nesting,
    246243            descriptor_walk_callback, &context);
Note: See TracChangeset for help on using the changeset viewer.