Changeset 5410c04 in mainline for uspace/lib/usb/src/devdrv.c


Ignore:
Timestamp:
2011-04-09T16:11:41Z (13 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a9d67aa, c6394aa
Parents:
8e8b84f (diff), 7b715892 (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:

Automatic pipe sessions

It is no longer necessary to start sessions on USB pipes manually.
Actually, the original functions usb_pipe_start/end_session are now
deprecated.

For sporadic transfers, you do not need to care about sessions at all.
For longer transfers, you may hint the library about it by calling
usb_pipe_start_long_transfer.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usb/src/devdrv.c

    r8e8b84f r5410c04  
    239239
    240240        /*
    241          * For further actions, we need open session on default control pipe.
     241         * We will do some querying of the device, it is worth to prepare
     242         * the long transfer.
    242243         */
    243         rc = usb_pipe_start_session(&dev->ctrl_pipe);
    244         if (rc != EOK) {
    245                 usb_log_error("Failed to start an IPC session: %s.\n",
     244        rc = usb_pipe_start_long_transfer(&dev->ctrl_pipe);
     245        if (rc != EOK) {
     246                usb_log_error("Failed to start transfer: %s.\n",
    246247                    str_error(rc));
    247248                return rc;
     
    252253            &dev->descriptors.device);
    253254        if (rc != EOK) {
     255                usb_pipe_end_long_transfer(&dev->ctrl_pipe);
    254256                usb_log_error("Failed to retrieve device descriptor: %s.\n",
    255257                    str_error(rc));
     
    262264            &dev->descriptors.configuration_size);
    263265        if (rc != EOK) {
     266                usb_pipe_end_long_transfer(&dev->ctrl_pipe);
    264267                usb_log_error("Failed retrieving configuration descriptor: %s. %s\n",
    265268                    dev->ddf_dev->name, str_error(rc));
     
    271274        }
    272275
    273         /* No checking here. */
    274         usb_pipe_end_session(&dev->ctrl_pipe);
     276        usb_pipe_end_long_transfer(&dev->ctrl_pipe);
    275277
    276278        /* Rollback actions. */
Note: See TracChangeset for help on using the changeset viewer.