Ignore:
File:
1 edited

Legend:

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

    r4e8e1f5 ra12917e  
    3939#include <usb/usbdrv.h>
    4040#include <usb/pipes.h>
    41 #include <usb/recognise.h>
    4241#include <usb/request.h>
    4342#include "usbinfo.h"
     
    4847        usb_device_connection_t wire;
    4948        usb_endpoint_pipe_t ctrl_pipe;
     49        ctrl_pipe.hc_phone = -1;
     50
     51        int hc_phone = devman_device_connect(hc_handle, 0);
     52        if (hc_phone < 0) {
     53                fprintf(stderr,
     54                    NAME ": failed to connect to host controller (%zu): %s.\n",
     55                        (size_t) hc_handle, str_error(hc_phone));
     56                return hc_phone;
     57        }
     58
     59        /*
     60         * Dump information about possible match ids.
     61         */
     62        match_id_list_t match_id_list;
     63        init_match_ids(&match_id_list);
     64        rc = usb_drv_create_device_match_ids(hc_phone, &match_id_list, address);
     65        if (rc != EOK) {
     66                fprintf(stderr,
     67                    NAME ": failed to fetch match ids of the device: %s.\n",
     68                    str_error(rc));
     69                goto leave;
     70        }
     71        dump_match_ids(&match_id_list);
    5072
    5173        /*
     
    7395                goto leave;
    7496        }
    75 
    76         /*
    77          * Dump information about possible match ids.
    78          */
    79         match_id_list_t match_id_list;
    80         init_match_ids(&match_id_list);
    81         rc = usb_device_create_match_ids(&ctrl_pipe, &match_id_list);
    82         if (rc != EOK) {
    83                 fprintf(stderr,
    84                     NAME ": failed to fetch match ids of the device: %s.\n",
    85                     str_error(rc));
    86                 goto leave;
    87         }
    88         dump_match_ids(&match_id_list);
    8997
    9098        /*
     
    133141leave:
    134142        /* Ignoring errors here. */
     143        ipc_hangup(hc_phone);
    135144        usb_endpoint_pipe_end_session(&ctrl_pipe);
    136145
Note: See TracChangeset for help on using the changeset viewer.