Drvusbohcihc


Files

file  hc.c
 OHCI Host controller driver routines.
file  ohci_regs.h
 OHCI host controller register structure.

Data Structures

struct  ohci_regs
 OHCI memory mapped registers structure. More...

Defines

#define OHCI_USED_INTERRUPTS   (I_SO | I_WDH | I_UE | I_RHSC)

Typedefs

typedef ohci_regs ohci_regs_t
 OHCI memory mapped registers structure.

Functions

int hc_add_endpoint (hc_t *instance, usb_address_t address, usb_endpoint_t endpoint, usb_speed_t speed, usb_transfer_type_t type, usb_direction_t direction, size_t mps, size_t size, unsigned interval)
 Create end register endpoint structures.
static void hc_gain_control (hc_t *instance)
 Turn off any (BIOS)driver that might be in control of the device.
endpoint_thc_get_endpoint (hc_t *instance, usb_address_t address, usb_endpoint_t endpoint, usb_direction_t direction, size_t *bw)
 Get access to endpoint structures.
int hc_init (hc_t *instance, uintptr_t regs, size_t reg_size, bool interrupts)
 Initialize OHCI hc driver structure.
static int hc_init_memory (hc_t *instance)
 Initialize memory structures used by the OHCI hcd.
static int hc_init_transfer_lists (hc_t *instance)
 Initialize schedule queues.
void hc_interrupt (hc_t *instance, uint32_t status)
 Interrupt handling routine.
int hc_register_hub (hc_t *instance, ddf_fun_t *hub_fun)
 Announce OHCI root hub to the DDF.
int hc_remove_endpoint (hc_t *instance, usb_address_t address, usb_endpoint_t endpoint, usb_direction_t direction)
 Dequeue and delete endpoint structures.
int hc_schedule (hc_t *instance, usb_transfer_batch_t *batch)
 Add USB transfer to the schedule.
void hc_start_hw (hc_t *instance)
 OHCI hw initialization routine.
static int interrupt_emulator (hc_t *instance)
 Check status register regularly.

Function Documentation

int hc_add_endpoint ( hc_t instance,
usb_address_t  address,
usb_endpoint_t  endpoint,
usb_speed_t  speed,
usb_transfer_type_t  type,
usb_direction_t  direction,
size_t  mps,
size_t  size,
unsigned  interval 
)

Create end register endpoint structures.

Parameters:
[in] instance OHCI driver structure.
[in] address USB address of the device.
[in] endpoint USB endpoint number.
[in] speed Communication speeed of the device.
[in] type Endpoint's transfer type.
[in] direction Endpoint's direction.
[in] mps Maximum packet size the endpoint accepts.
[in] size Maximum allowed buffer size.
[in] interval Time between transfers(interrupt transfers only).
Returns:
Error code

Definition at line 165 of file hc.c.

void hc_gain_control ( hc_t instance  )  [static]

Turn off any (BIOS)driver that might be in control of the device.

Parameters:
[in] instance OHCI hc driver structure.

Definition at line 402 of file hc.c.

endpoint_t* hc_get_endpoint ( hc_t instance,
usb_address_t  address,
usb_endpoint_t  endpoint,
usb_direction_t  direction,
size_t bw 
)

Get access to endpoint structures.

Parameters:
[in] instance OHCI hc driver structure.
[in] address USB address of the device.
[in] endpoint USB endpoint number.
[in] direction Direction of the endpoint.
[out] bw Reserved bandwidth.
Returns:
Error code

Definition at line 289 of file hc.c.

int hc_init ( hc_t instance,
uintptr_t  regs,
size_t  reg_size,
bool  interrupts 
)

Initialize OHCI hc driver structure.

Parameters:
[in] instance Memory place for the structure.
[in] regs Address of the memory mapped I/O registers.
[in] reg_size Size of the memory mapped area.
[in] interrupts True if w interrupts should be used
Returns:
Error code

Definition at line 111 of file hc.c.

int hc_init_memory ( hc_t instance  )  [static]

Initialize memory structures used by the OHCI hcd.

Parameters:
[in] instance OHCI hc driver structure.
Returns:
Error code.

Definition at line 561 of file hc.c.

int hc_init_transfer_lists ( hc_t instance  )  [static]

Initialize schedule queues.

Parameters:
[in] instance OHCI hc driver structure
Returns:
Error code

Definition at line 527 of file hc.c.

void hc_interrupt ( hc_t instance,
uint32_t  status 
)

Interrupt handling routine.

Parameters:
[in] instance OHCI hc driver structure.
[in] status Value of the status register at the time of interrupt.

Definition at line 342 of file hc.c.

int hc_register_hub ( hc_t instance,
ddf_fun_t hub_fun 
)

Announce OHCI root hub to the DDF.

Parameters:
[in] instance OHCI driver intance
[in] hub_fun DDF fuction representing OHCI root hub
Returns:
Error code

Definition at line 59 of file hc.c.

int hc_remove_endpoint ( hc_t instance,
usb_address_t  address,
usb_endpoint_t  endpoint,
usb_direction_t  direction 
)

Dequeue and delete endpoint structures.

Parameters:
[in] instance OHCI hc driver structure.
[in] address USB address of the device.
[in] endpoint USB endpoint number.
[in] direction Direction of the endpoint.
Returns:
Error code

Definition at line 230 of file hc.c.

int hc_schedule ( hc_t instance,
usb_transfer_batch_t batch 
)

Add USB transfer to the schedule.

Parameters:
[in] instance OHCI hc driver structure.
[in] batch Batch representing the transfer.
Returns:
Error code.

Definition at line 306 of file hc.c.

void hc_start_hw ( hc_t instance  ) 

OHCI hw initialization routine.

Parameters:
[in] instance OHCI hc driver structure.

Definition at line 455 of file hc.c.

int interrupt_emulator ( hc_t instance  )  [static]

Check status register regularly.

Parameters:
[in] instance OHCI hc driver structure.
Returns:
Error code

Definition at line 385 of file hc.c.


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