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


Ignore:
Timestamp:
2011-10-16T19:38:53Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
22ceff3a, e5291e0
Parents:
98fb010 (diff), 93d2684 (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:

Minor USB changes.

Add more const qualifiers where possible.
Do not limit the number possible usbhid subdrivers.
This should not break anything. If it does feel free to revert this merge.

File:
1 edited

Legend:

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

    r98fb010 r1f131fb9  
    8181 * @return Number of pipes (excluding default control pipe).
    8282 */
    83 static size_t count_other_pipes(usb_endpoint_description_t **endpoints)
     83static size_t count_other_pipes(const usb_endpoint_description_t **endpoints)
    8484{
    8585        size_t count = 0;
     
    101101 * @return Error code.
    102102 */
    103 static int initialize_other_pipes(usb_endpoint_description_t **endpoints,
     103static int initialize_other_pipes(const usb_endpoint_description_t **endpoints,
    104104    usb_device_t *dev, int alternate_setting)
    105105{
     
    154154        rc = driver->ops->device_add(dev);
    155155        if (rc != EOK)
    156                 usb_device_destroy(dev);
     156                usb_device_deinit(dev);
    157157        return rc;
    158158}
     
    191191        const int ret = driver->ops->device_gone(usb_dev);
    192192        if (ret == EOK)
    193                 usb_device_destroy(usb_dev);
     193                usb_device_deinit(usb_dev);
    194194
    195195        return ret;
     
    238238 */
    239239int usb_device_select_interface(usb_device_t *dev, uint8_t alternate_setting,
    240     usb_endpoint_description_t **endpoints)
     240    const usb_endpoint_description_t **endpoints)
    241241{
    242242        if (dev->interface_no < 0) {
     
    321321 */
    322322int usb_device_create_pipes(const ddf_dev_t *dev, usb_device_connection_t *wire,
    323     usb_endpoint_description_t **endpoints,
     323    const usb_endpoint_description_t **endpoints,
    324324    const uint8_t *config_descr, size_t config_descr_size,
    325325    int interface_no, int interface_setting,
     
    526526 */
    527527int usb_device_create(ddf_dev_t *ddf_dev,
    528     usb_endpoint_description_t **endpoints,
     528    const usb_endpoint_description_t **endpoints,
    529529    usb_device_t **dev_ptr, const char **errstr_ptr)
    530530{
     
    590590/** Destroy instance of a USB device.
    591591 *
    592  * @param dev Device to be destroyed.
    593  */
    594 void usb_device_destroy(usb_device_t *dev)
     592 * @param dev Device to be de-initialized.
     593 *
     594 * Does not free/destroy supplied pointer.
     595 */
     596void usb_device_deinit(usb_device_t *dev)
    595597{
    596598        if (dev == NULL) {
Note: See TracChangeset for help on using the changeset viewer.