Changeset 66ee26a in mainline
- Timestamp:
- 2011-12-14T21:57:55Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- da2f1c9e
- Parents:
- 64e3dad
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbdev/src/devdrv.c
r64e3dad r66ee26a 57 57 static const usb_driver_t *driver = NULL; 58 58 59 60 59 /** Main routine of USB device driver. 61 60 * … … 76 75 return ddf_driver_main(&generic_driver); 77 76 } 78 77 /*----------------------------------------------------------------------------*/ 79 78 /** Count number of pipes the driver expects. 80 79 * … … 88 87 for (count = 0; endpoints != NULL && endpoints[count] != NULL; ++count); 89 88 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;116 89 } 117 90 /*----------------------------------------------------------------------------*/ … … 241 214 242 215 /* 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); 244 220 245 221 return rc; … … 487 463 (rc == EOK) ? usb_dev->alternate_interfaces.current : 0; 488 464 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); 491 471 if (rc != EOK) { 492 472 usb_hc_connection_close(&usb_dev->hc_conn);
Note:
See TracChangeset
for help on using the changeset viewer.