Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 66ee26a in mainline


Ignore:
Timestamp:
2011-12-14T21:57:55Z (10 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master
Children:
da2f1c9e
Parents:
64e3dad
Message:

libusbdev: Remove wrapper.

File:
1 edited

Legend:

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

    r64e3dad r66ee26a  
    5757static const usb_driver_t *driver = NULL;
    5858
    59 
    6059/** Main routine of USB device driver.
    6160 *
     
    7675        return ddf_driver_main(&generic_driver);
    7776}
    78 
     77/*----------------------------------------------------------------------------*/
    7978/** Count number of pipes the driver expects.
    8079 *
     
    8887        for (count = 0; endpoints != NULL && endpoints[count] != NULL; ++count);
    8988        return count;
    90 }
    91 
    92 /** Initialize endpoint pipes, excluding default control one.
    93  *
    94  * @param drv The device driver.
    95  * @param dev Device to be initialized.
    96  * @return Error code.
    97  */
    98 static int initialize_other_pipes(const usb_endpoint_description_t **endpoints,
    99     usb_device_t *dev, int alternate_setting)
    100 {
    101         assert(dev);
    102 
    103         usb_endpoint_mapping_t *pipes = NULL;
    104         size_t pipes_count = 0;
    105 
    106         const int rc = usb_device_create_pipes(&dev->wire, endpoints,
    107             dev->descriptors.configuration, dev->descriptors.configuration_size,
    108             dev->interface_no, alternate_setting, &pipes, &pipes_count);
    109 
    110         if (rc == EOK) {
    111                 dev->pipes = pipes;
    112                 dev->pipes_count = pipes_count;
    113         }
    114 
    115         return rc;
    11689}
    11790/*----------------------------------------------------------------------------*/
     
    241214
    242215        /* Create new pipes. */
    243         rc = initialize_other_pipes(endpoints, dev, (int) alternate_setting);
     216        rc = usb_device_create_pipes(&dev->wire, endpoints,
     217            dev->descriptors.configuration, dev->descriptors.configuration_size,
     218            dev->interface_no, (int)alternate_setting,
     219            &dev->pipes, &dev->pipes_count);
    244220
    245221        return rc;
     
    487463            (rc == EOK) ? usb_dev->alternate_interfaces.current : 0;
    488464
    489         /* TODO Add comment here. */
    490         rc = initialize_other_pipes(endpoints, usb_dev, alternate_iface);
     465        /* Create and register other pipes than default control (EP 0) */
     466        rc = usb_device_create_pipes(&usb_dev->wire, endpoints,
     467            usb_dev->descriptors.configuration,
     468            usb_dev->descriptors.configuration_size,
     469            usb_dev->interface_no, (int)alternate_iface,
     470            &usb_dev->pipes, &usb_dev->pipes_count);
    491471        if (rc != EOK) {
    492472                usb_hc_connection_close(&usb_dev->hc_conn);
Note: See TracChangeset for help on using the changeset viewer.