Changeset 3538b0e in mainline for uspace/lib/usbdev/src/hub.c
- Timestamp:
- 2011-12-12T13:28:51Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 30ec5ea
- Parents:
- c804484
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbdev/src/hub.c
rc804484 r3538b0e 230 230 /* Initialize connection to device. */ 231 231 usb_device_connection_t dev_conn; 232 rc = usb_device_connection_initialize _on_default_address(233 &dev_conn, hc_conn );232 rc = usb_device_connection_initialize( 233 &dev_conn, hc_conn, USB_ADDRESS_DEFAULT); 234 234 if (rc != EOK) { 235 235 rc = ENOTCONN; … … 237 237 } 238 238 239 /* Initialize control pipe on default address. Don't register yet. */ 240 usb_pipe_t ctrl_pipe; 241 rc = usb_pipe_initialize_default_control(&ctrl_pipe, &dev_conn); 242 if (rc != EOK) { 243 rc = ENOTCONN; 244 goto leave_release_free_address; 245 } 246 239 247 /* 240 * We will not register control pipe on default address.241 * Th e registration might fail. That means that someone else already242 * registered that endpoint.We will simply wait and try again.248 * The default address request might fail. 249 * That means that someone else is already using that address. 250 * We will simply wait and try again. 243 251 * (Someone else already wants to add a new device.) 244 252 */ 245 usb_pipe_t ctrl_pipe;246 rc = usb_pipe_initialize_default_control(&ctrl_pipe, &dev_conn);247 if (rc != EOK) {248 rc = ENOTCONN;249 goto leave_release_free_address;250 }251 252 253 do { 253 254 rc = usb_hc_request_address(hc_conn, USB_ADDRESS_DEFAULT, … … 262 263 } 263 264 264 /* Register control pipe on default address. */265 /* Register control pipe on default address. 0 means no interval. */ 265 266 rc = usb_pipe_register(&ctrl_pipe, 0); 266 267 if (rc != EOK) { … … 270 271 271 272 struct timeval end_time; 272 273 273 rc = gettimeofday(&end_time, NULL); 274 274 if (rc != EOK) { … … 353 353 */ 354 354 leave_release_default_address: 355 usb_hc_unregister_device(hc_conn, USB_ADDRESS_DEFAULT); 355 if (usb_hc_unregister_device(hc_conn, USB_ADDRESS_DEFAULT) != EOK) 356 usb_log_warning("%s: Failed to unregister defaut device.\n", 357 __FUNCTION__); 356 358 357 359 leave_release_free_address:
Note:
See TracChangeset
for help on using the changeset viewer.