Changeset 90d7033 in mainline
- Timestamp:
- 2011-10-31T11:04:57Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 59c163c
- Parents:
- 10059a68
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbdev/src/hub.c
r10059a68 r90d7033 171 171 * 172 172 * @param[in] parent Parent device (i.e. the hub device). 173 * @param[in] connection Connection to host controller. 173 * @param[in] connection Connection to host controller. Must be non-null. 174 174 * @param[in] dev_speed New device speed. 175 175 * @param[in] enable_port Function for enabling signaling through the port the … … 181 181 * as @c driver_data. 182 182 * @param[out] new_fun Storage where pointer to allocated child function 183 * will be written. 183 * will be written. Must be non-null. 184 184 * @return Error code. 185 * @retval EINVAL Either connection or new_fun is a NULL pointer. 185 186 * @retval ENOENT Connection to HC not opened. 186 187 * @retval EADDRNOTAVAIL Failed retrieving free address from host controller. … … 195 196 ddf_dev_ops_t *dev_ops, void *new_dev_data, ddf_fun_t **new_fun) 196 197 { 197 assert(connection != NULL); 198 if (new_fun == NULL || connection == NULL) 199 return EINVAL; 200 198 201 // FIXME: this is awful, we are accessing directly the structure. 202 // TODO: Why not use provided connection? 199 203 usb_hc_connection_t hc_conn = { 200 204 .hc_handle = connection->hc_handle, … … 321 325 parent, dev_ops, new_dev_data, &child_fun); 322 326 if (rc != EOK) { 323 rc = ESTALL;324 327 goto leave_release_free_address; 325 328 } … … 328 331 * And now inform the host controller about the handle. 329 332 */ 330 usb_hub_attached_device_t new_device = {333 const usb_hub_attached_device_t new_device = { 331 334 .address = dev_addr, 332 335 .fun = child_fun, … … 334 337 rc = usb_hc_register_device(&hc_conn, &new_device); 335 338 if (rc != EOK) { 339 /* The child function is already created. */ 340 child_fun->driver_data = NULL; 341 ddf_fun_destroy(child_fun); 336 342 rc = EDESTADDRREQ; 337 343 goto leave_release_free_address; 338 344 } 339 340 345 341 346 /*
Note:
See TracChangeset
for help on using the changeset viewer.