Changeset f126c87 in mainline for uspace/lib/usbdev/src/devdrv.c


Ignore:
Timestamp:
2016-09-01T16:46:27Z (8 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2a2fbc8
Parents:
9befb0d (diff), bdfdc51c (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 from mainline.

File:
1 edited

Legend:

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

    r9befb0d rf126c87  
    2727 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2828 */
     29
    2930/** @addtogroup libusbdev
    3031 * @{
     
    5556        /** Connection to device on USB bus */
    5657        usb_dev_session_t *bus_session;
     58       
    5759        /** devman handle */
    5860        devman_handle_t handle;
     61       
    5962        /** The default control pipe. */
    6063        usb_pipe_t ctrl_pipe;
    61 
     64       
    6265        /** Other endpoint pipes.
     66         *
    6367         * This is an array of other endpoint pipes in the same order as
    6468         * in usb_driver_t.
    6569         */
    6670        usb_endpoint_mapping_t *pipes;
     71       
    6772        /** Number of other endpoint pipes. */
    6873        size_t pipes_count;
     74       
    6975        /** Current interface.
     76         *
    7077         * Usually, drivers operate on single interface only.
    7178         * This item contains the value of the interface or -1 for any.
    7279         */
    7380        int interface_no;
     81       
    7482        /** Alternative interfaces. */
    7583        usb_alternate_interfaces_t alternate_interfaces;
     84       
    7685        /** Some useful descriptors for USB device. */
    7786        usb_device_descriptors_t descriptors;
     87       
    7888        /** Generic DDF device backing this one. DO NOT TOUCH! */
    7989        ddf_dev_t *ddf_dev;
     90       
    8091        /** Custom driver data.
     92         *
    8193         * Do not use the entry in generic device, that is already used
    8294         * by the framework.
    8395         */
    8496        void *driver_data;
    85 
    8697} usb_device_t;
    8798
     
    135146                return rc;
    136147        }
    137 
     148       
    138149        /* Change current alternative */
    139150        usb_dev->alternate_interfaces.current = alternate_setting;
     
    279290 *
    280291 * @param[in] usb_dev USB device.
     292 *
    281293 */
    282294void usb_device_destroy_pipes(usb_device_t *usb_dev)
     
    284296        assert(usb_dev);
    285297        assert(usb_dev->pipes || usb_dev->pipes_count == 0);
     298       
    286299        /* Destroy the pipes. */
    287300        for (size_t i = 0; i < usb_dev->pipes_count; ++i) {
     
    291304                        usb_pipe_unregister(&usb_dev->pipes[i].pipe);
    292305        }
     306       
    293307        free(usb_dev->pipes);
    294308        usb_dev->pipes = NULL;
     
    448462        assert(handle);
    449463        assert(iface_no);
     464       
    450465        async_exch_t *exch = async_exchange_begin(sess);
    451466        if (!exch)
    452467                return EPARTY;
     468       
    453469        int ret = usb_get_my_device_handle(exch, handle);
    454470        if (ret == EOK) {
     
    459475                }
    460476        }
     477       
    461478        async_exchange_end(exch);
    462479        return ret;
Note: See TracChangeset for help on using the changeset viewer.