Changes in / [7205209:b23e9cc] in mainline


Ignore:
Location:
uspace
Files:
4 edited

Legend:

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

    r7205209 rb23e9cc  
    4040#include "usbinfo.h"
    4141
    42 usbinfo_device_t *prepare_device(devman_handle_t hc_handle,
    43     usb_address_t dev_addr)
     42usbinfo_device_t *prepare_device(const char *name,
     43    devman_handle_t hc_handle, usb_address_t dev_addr)
    4444{
    4545        usbinfo_device_t *dev = malloc(sizeof(usbinfo_device_t));
     
    5555        if (rc != EOK) {
    5656                fprintf(stderr,
    57                     NAME ": failed to create connection to the device: %s.\n",
    58                     str_error(rc));
     57                    NAME ": failed to create connection to device %s: %s.\n",
     58                    name, str_error(rc));
    5959                goto leave;
    6060        }
     
    6464        if (rc != EOK) {
    6565                fprintf(stderr,
    66                     NAME ": failed to create default control pipe: %s.\n",
    67                     str_error(rc));
     66                    NAME ": failed to create default control pipe to %s: %s.\n",
     67                    name, str_error(rc));
    6868                goto leave;
    6969        }
     
    7171        rc = usb_pipe_probe_default_control(&dev->ctrl_pipe);
    7272        if (rc != EOK) {
    73                 fprintf(stderr,
    74                     NAME ": probing default control pipe failed: %s.\n",
    75                     str_error(rc));
     73                if (rc == ENOENT) {
     74                        fprintf(stderr, NAME ": " \
     75                            "device %s not present or malfunctioning.\n",
     76                            name);
     77                } else {
     78                        fprintf(stderr, NAME ": " \
     79                            "probing default control pipe of %s failed: %s.\n",
     80                            name, str_error(rc));
     81                }
    7682                goto leave;
    7783        }
     
    8490        if (rc != EOK) {
    8591                fprintf(stderr,
    86                     NAME ": failed to retrieve device descriptor: %s.\n",
    87                     str_error(rc));
     92                    NAME ": failed to retrieve device descriptor of %s: %s.\n",
     93                    name, str_error(rc));
    8894                goto leave;
    8995        }
     
    9399            &dev->full_configuration_descriptor_size);
    94100        if (rc != EOK) {
    95                 fprintf(stderr,
    96                     NAME ": failed to retrieve configuration descriptor: %s.\n",
    97                     str_error(rc));
     101                fprintf(stderr, NAME ": " \
     102                    "failed to retrieve configuration descriptor of %s: %s.\n",
     103                    name, str_error(rc));
    98104                goto leave;
    99105        }
  • uspace/app/usbinfo/main.c

    r7205209 rb23e9cc  
    308308                }
    309309
    310                 usbinfo_device_t *dev = prepare_device(hc_handle, dev_addr);
     310                usbinfo_device_t *dev = prepare_device(devpath,
     311                    hc_handle, dev_addr);
    311312                if (dev == NULL) {
    312313                        continue;
  • uspace/app/usbinfo/usbinfo.h

    r7205209 rb23e9cc  
    7171}
    7272
    73 usbinfo_device_t *prepare_device(devman_handle_t, usb_address_t);
     73usbinfo_device_t *prepare_device(const char *, devman_handle_t, usb_address_t);
    7474void destroy_device(usbinfo_device_t *);
    7575
  • uspace/lib/drv/generic/remote_usbhc.c

    r7205209 rb23e9cc  
    302302        async_transaction_t *trans = async_transaction_create(callid);
    303303        if (trans == NULL) {
     304                async_answer_0(data_callid, ENOMEM);
    304305                async_answer_0(callid, ENOMEM);
    305306                return;
     
    314315
    315316        if (rc != EOK) {
     317                async_answer_0(data_callid, rc);
    316318                async_answer_0(callid, rc);
    317319                async_transaction_destroy(trans);
     
    460462        async_transaction_t *trans = async_transaction_create(callid);
    461463        if (trans == NULL) {
     464                async_answer_0(data_callid, ENOMEM);
    462465                async_answer_0(callid, ENOMEM);
    463466                free(setup_packet);
     
    469472        trans->buffer = malloc(data_len);
    470473        if (trans->buffer == NULL) {
     474                async_answer_0(data_callid, ENOMEM);
    471475                async_answer_0(callid, ENOMEM);
    472476                async_transaction_destroy(trans);
     
    480484
    481485        if (rc != EOK) {
     486                async_answer_0(data_callid, rc);
    482487                async_answer_0(callid, rc);
    483488                async_transaction_destroy(trans);
Note: See TracChangeset for help on using the changeset viewer.