UHCI driver
[USB]

Drivers for USB UHCI host controller and root hub. More...


Files

file  malloc32.h
 UHCI driver.
file  root_hub.c
 UHCI driver.
file  root_hub.h
 UHCI driver.
file  uhci.c
 UHCI driver.
file  uhci.h
 UHCI driver main structure for both host controller and root-hub.

Modules

 UHCI root hub driver
 Driver for UHCI complaint root hub.
 UHCI host controller driver
 Driver for UHCI complaint USB host controller.

Data Structures

struct  rh
 ohci root hub representation More...
struct  uhci
 Structure representing both functions of UHCI hc, USB host controller and USB root hub. More...

Defines

#define UHCI_REQUIRED_PAGE_SIZE   4096
#define UHCI_STRCUTURES_ALIGNMENT   16

Typedefs

typedef rh rh_t
 DDF support structure for uhci-rhd driver, provides I/O resources.
typedef uhci uhci_t
 Structure representing both functions of UHCI hc, USB host controller and USB root hub.

Functions

static uintptr_t addr_to_phys (void *addr)
 Get physical address translation.
static uhci_tdev_to_uhci (const ddf_dev_t *dev)
int device_setup_uhci (ddf_dev_t *device)
 Initialize hc and rh DDF structures and their respective drivers.
static void free32 (void *addr)
 Physical mallocator simulator.
static void * get_page (void)
 Create 4KB page mapping.
static hw_resource_list_tget_resource_list (ddf_fun_t *fun)
 Get root hub hw resources (I/O registers).
static void irq_handler (ddf_dev_t *dev, ipc_callid_t iid, ipc_call_t *call)
 IRQ handling callback, forward status from call to diver structure.
static void * malloc32 (size_t size)
 Physical mallocator simulator.
int rh_init (rh_t *instance, ddf_fun_t *fun, uintptr_t reg_addr, size_t reg_size)
 Root hub initialization.
static int usb_iface_get_address (ddf_fun_t *fun, devman_handle_t handle, usb_address_t *address)
 Get address of the device identified by handle.
static int usb_iface_get_hc_handle (ddf_fun_t *fun, devman_handle_t *handle)
 Gets handle of the respective hc.

Variables

static ddf_dev_ops_t hc_ops
 Operations supported by the HC driver.
static hw_res_ops_t hw_res_iface
 Interface to provide the root hub driver with hw info.
static ddf_dev_ops_t rh_ops
 RH function support for uhci-rhd.
static usb_iface_t usb_iface
 USB interface implementation used by RH.

Detailed Description

Drivers for USB UHCI host controller and root hub.


Function Documentation

static uintptr_t addr_to_phys ( void *  addr  )  [inline, static]

Get physical address translation.

Parameters:
[in] addr Virtual address to translate
Returns:
Physical address if exists, NULL otherwise.

Definition at line 52 of file malloc32.h.

int device_setup_uhci ( ddf_dev_t device  ) 

Initialize hc and rh DDF structures and their respective drivers.

Parameters:
[in] device DDF instance of the device to use.
This function does all the preparatory work for hc and rh drivers:

Definition at line 173 of file uhci.c.

static void free32 ( void *  addr  )  [inline, static]

Physical mallocator simulator.

Parameters:
[in] addr Address of the place allocated by malloc32

Definition at line 89 of file malloc32.h.

static void* get_page ( void   )  [inline, static]

Create 4KB page mapping.

Returns:
Address of the mapped page, NULL on failure.

Definition at line 99 of file malloc32.h.

static hw_resource_list_t* get_resource_list ( ddf_fun_t fun  )  [static]

Get root hub hw resources (I/O registers).

Parameters:
[in] fun Root hub function.
Returns:
Pointer to the resource list used by the root hub.

Definition at line 143 of file uhci.c.

static void irq_handler ( ddf_dev_t dev,
ipc_callid_t  iid,
ipc_call_t call 
) [static]

IRQ handling callback, forward status from call to diver structure.

Parameters:
[in] dev DDF instance of the device to use.
[in] iid (Unused).
[in] call Pointer to the call from kernel.

Definition at line 76 of file uhci.c.

static void* malloc32 ( size_t  size  )  [inline, static]

Physical mallocator simulator.

Parameters:
[in] size Size of the required memory space
Returns:
Address of the alligned and big enough memory place, NULL on failure.

Definition at line 69 of file malloc32.h.

int rh_init ( rh_t instance,
ddf_fun_t fun,
uintptr_t  reg_addr,
size_t  reg_size 
)

Root hub initialization.

Parameters:
[in] instance RH structure to initialize
[in] fun DDF function representing UHCI root hub
[in] reg_addr Address of root hub status and control registers.
[in] reg_size Size of accessible address space.
Returns:
Error code.

Definition at line 50 of file root_hub.c.

static int usb_iface_get_address ( ddf_fun_t fun,
devman_handle_t  handle,
usb_address_t address 
) [static]

Get address of the device identified by handle.

Parameters:
[in] fun DDF instance of the function to use.
[in] handle DDF handle of the driver seeking its USB address.
[out] address Found address.

Definition at line 97 of file uhci.c.

static int usb_iface_get_hc_handle ( ddf_fun_t fun,
devman_handle_t handle 
) [static]

Gets handle of the respective hc.

Parameters:
[in] fun DDF function of uhci device.
[out] handle Host cotnroller handle.
Returns:
Error code.

Definition at line 121 of file uhci.c.


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