Changeset a43f1d18 in mainline for uspace/app/usbinfo/dev.c


Ignore:
Timestamp:
2011-04-09T18:26:22Z (13 years ago)
Author:
Matus Dekanek <smekideki@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2ad98fd
Parents:
f35b294 (diff), 97e7e8a (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 with usb/development

File:
1 edited

Legend:

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

    rf35b294 ra43f1d18  
    5050
    5151        int rc;
     52        bool transfer_started = false;
    5253
    5354        rc = usb_device_connection_initialize(&dev->wire, hc_handle, dev_addr);
     
    7677        }
    7778
    78         rc = usb_pipe_start_session(&dev->ctrl_pipe);
     79        rc = usb_pipe_start_long_transfer(&dev->ctrl_pipe);
    7980        if (rc != EOK) {
    8081                fprintf(stderr,
    81                     NAME ": failed to start session on control pipe: %s.\n",
     82                    NAME ": failed to start transfer on control pipe: %s.\n",
    8283                    str_error(rc));
    8384                goto leave;
    8485        }
     86        transfer_started = true;
    8587
    8688        rc = usb_request_get_device_descriptor(&dev->ctrl_pipe,
     
    107109
    108110leave:
    109         if (usb_pipe_is_session_started(&dev->ctrl_pipe)) {
    110                 usb_pipe_end_session(&dev->ctrl_pipe);
     111        if (transfer_started) {
     112                usb_pipe_end_long_transfer(&dev->ctrl_pipe);
    111113        }
    112114
     
    118120void destroy_device(usbinfo_device_t *dev)
    119121{
    120         usb_pipe_end_session(&dev->ctrl_pipe);
     122        usb_pipe_end_long_transfer(&dev->ctrl_pipe);
    121123        free(dev);
    122124}
Note: See TracChangeset for help on using the changeset viewer.