hub.c File Reference

Representation of an USB hub (implementation). More...

#include <usb/classes/classes.h>
#include <usbvirt/device.h>
#include <errno.h>
#include <str_error.h>
#include <assert.h>
#include <stdlib.h>
#include <ddf/driver.h>
#include <usb/debug.h>
#include "hub.h"

Go to the source code of this file.

Data Structures

struct  delay_port_state_change
 Structure for automatic (delayed) port state change. More...

Defines

#define MAKE_BYTE(b0, b1, b2, b3, b4, b5, b6, b7)
 Produce a byte from bit values.

Functions

static void clear_port_status_change (hub_port_t *port, uint16_t change)
 Clears a port status change on a port.
static hub_port_tget_hub_port (hub_t *hub, size_t port)
 Find a port in a hub.
void hub_acquire (hub_t *hub)
 Acquire exclusive access to the hub.
void hub_clear_port_status_change (hub_t *hub, size_t port_index, hub_status_change_t change)
 Clear port status change bit.
size_t hub_connect_device (hub_t *hub, void *device)
 Connect a device to the hub.
int hub_disconnect_device (hub_t *hub, void *device)
 Disconnects a device from a hub.
size_t hub_find_device (hub_t *hub, void *device)
 Find port device is connected to.
hub_port_state_t hub_get_port_state (hub_t *hub, size_t port_index)
 Get port state.
uint32_t hub_get_port_status (hub_t *hub, size_t port_index)
 Get port status bits.
uint16_t hub_get_port_status_change (hub_t *hub, size_t port_index)
 Get port status change bits.
uint8_t hub_get_status_change_bitmap (hub_t *hub)
 Create hub status change bitmap.
void hub_init (hub_t *hub)
 Initialize the hub.
static void hub_init_port (hub_port_t *port, hub_t *hub, size_t index)
 Initialize single hub port.
char hub_port_state_to_char (hub_port_state_t state)
 Convert hub port state to a char.
void hub_release (hub_t *hub)
 Give up exclusive access to the hub.
void hub_set_port_state (hub_t *hub, size_t port_index, hub_port_state_t state)
 Change port state.
void hub_set_port_state_all (hub_t *hub, hub_port_state_t state)
 Change state of all ports.
static void set_port_state_delayed (hub_t *hub, size_t port_index, suseconds_t delay_time_ms, hub_port_state_t old_state, hub_port_state_t new_state)
 Change port state with a delay.
static int set_port_state_delayed_fibril (void *arg)
 Fibril responsible for delayed port state change.
static void set_port_status_change (hub_port_t *port, hub_status_change_t change)
 Adds a port status change to a port.


Detailed Description

Representation of an USB hub (implementation).

Definition in file hub.c.


Generated on Thu Jun 2 07:45:52 2011 for HelenOS/USB by  doxygen 1.4.7