Changeset 70e5ad5 in mainline for uspace/drv/vhc/hub/hub.c
- Timestamp:
- 2010-12-16T11:12:31Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 11658b64, 5863a95
- Parents:
- cea3fca
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/vhc/hub/hub.c
rcea3fca r70e5ad5 31 31 */ 32 32 /** @file 33 * @brief Virtual USB hub.33 * @brief Representation of an USB hub (implementation). 34 34 */ 35 35 #include <usb/classes/classes.h> … … 338 338 } 339 339 340 /** Create hub status change bitmap. 341 * 342 * @warning This function assumes that the whole bitmap fits into 8 bits. 343 * 344 * @param hub Hub in question. 345 * @return Hub status change bitmap. 346 */ 340 347 uint8_t hub_get_status_change_bitmap(hub_t *hub) 341 348 { … … 361 368 */ 362 369 370 /** Find a port in a hub. 371 * 372 * @param hub Hub in question. 373 * @param port Port index (zero based). 374 * @return Port structure. 375 * @retval NULL Invalid port index. 376 */ 363 377 static hub_port_t *get_hub_port(hub_t *hub, size_t port) 364 378 { … … 370 384 } 371 385 386 /** Adds a port status change to a port. 387 * 388 * @param port The port with status change. 389 * @param change Change to be added to the status. 390 */ 372 391 static void set_port_status_change(hub_port_t *port, 373 392 hub_status_change_t change) … … 377 396 } 378 397 398 /** Clears a port status change on a port. 399 * 400 * @param port The port with status change. 401 * @param change Change to be removed from the status. 402 */ 379 403 static void clear_port_status_change(hub_port_t *port, 380 404 uint16_t change) … … 384 408 } 385 409 410 /** Structure for automatic (delayed) port state change. */ 386 411 struct delay_port_state_change { 412 /** Delay in microseconds. */ 387 413 suseconds_t delay; 414 /** Old state of the port. */ 388 415 hub_port_state_t old_state; 416 /** New state of the port. */ 389 417 hub_port_state_t new_state; 418 /** Port index (zero based). */ 390 419 size_t port; 420 /** Hub. */ 391 421 hub_t *hub; 392 422 }; 393 423 424 /** Fibril responsible for delayed port state change. 425 * 426 * @param arg Pointer to delay_port_state_change. 427 * @return Always EOK. 428 */ 394 429 static int set_port_state_delayed_fibril(void *arg) 395 430 { … … 416 451 } 417 452 453 /** Change port state with a delay. 454 * 455 * @warning If the port state changes during the waiting phase, the state 456 * is not changed. 457 * 458 * @param hub Hub in question. 459 * @param port_index Port index (zero based). 460 * @param delay_time_ms Delay time in miliseconds. 461 * @param old_state Old (current) state of the port. 462 * @param new_state New state of the port. 463 */ 418 464 static void set_port_state_delayed(hub_t *hub, size_t port_index, 419 465 suseconds_t delay_time_ms,
Note:
See TracChangeset
for help on using the changeset viewer.