USB

USB support for HelenOS. More...


Files

file  pci_dev_iface.h
 PCI device interface definition.
file  usb_iface.h
 USB interface definition.
file  usbhc_iface.h
 USB host controller interface definition.

Modules

 Base USB library
 Common definitions for any driver or application dealing with USB.
 USB library for device drivers
 Library for writing drivers of endpoint devices (functions).
 USB library for host controller drivers
 Library for writing host controller drivers.
 USB library for HID devices
 Library for writing USB HID drivers.
 USB virtualization
 Support for virtual USB devices.
 USB info application
 Application for querying USB devices.
 HelenOS version of lsusb command
 Application for listing USB host controllers.
 USB multi interface device driver
 USB multi interface device driver.
 USB hub driver
 USB hub driver.
 USB HID driver
 USB driver for HID devices.
 USB mouse driver
 USB driver for mouse with boot protocol.
 USB mass storage driver
 USB driver for mass storage devices (bulk-only protocol).
 UHCI driver
 Drivers for USB UHCI host controller and root hub.
 OHCI driver
 Driver for OHCI host controller.
 EHCI driver
 Driver for EHCI host controller.
 USB fallback driver
 Fallback driver for any USB device.

Data Structures

struct  pci_dev_iface_t
 PCI device communication interface. More...
struct  usb_iface_t
 USB device communication interface. More...
struct  usbhc_iface_t
 USB host controller communication interface. More...

Typedefs

typedef void(*) usbhc_iface_transfer_in_callback_t (ddf_fun_t *, int, size_t, void *)
 Callback for incoming transfer.
typedef int(*) usbhc_iface_transfer_in_t (ddf_fun_t *, usb_target_t, void *, size_t, usbhc_iface_transfer_in_callback_t, void *)
 In transfer processing function prototype.
typedef void(*) usbhc_iface_transfer_out_callback_t (ddf_fun_t *, int, void *)
 Callback for outgoing transfer.
typedef int(*) usbhc_iface_transfer_out_t (ddf_fun_t *, usb_target_t, void *, size_t, usbhc_iface_transfer_out_callback_t, void *)
 Out transfer processing function prototype.
typedef usbhc_iface_transfer_out_t usbhc_iface_transfer_setup_t
 Setup transfer processing function prototype.

Enumerations

enum  pci_dev_iface_funcs_t
enum  usb_iface_funcs_t { IPC_M_USB_GET_ADDRESS, IPC_M_USB_GET_INTERFACE, IPC_M_USB_GET_HOST_CONTROLLER_HANDLE }
enum  usbhc_iface_funcs_t {
  IPC_M_USBHC_REQUEST_ADDRESS, IPC_M_USBHC_BIND_ADDRESS, IPC_M_USBHC_GET_HANDLE_BY_ADDRESS, IPC_M_USBHC_RELEASE_ADDRESS,
  IPC_M_USBHC_INTERRUPT_OUT, IPC_M_USBHC_INTERRUPT_IN, IPC_M_USBHC_BULK_OUT, IPC_M_USBHC_BULK_IN,
  IPC_M_USBHC_CONTROL_WRITE, IPC_M_USBHC_CONTROL_READ, IPC_M_USBHC_REGISTER_ENDPOINT, IPC_M_USBHC_UNREGISTER_ENDPOINT
}
 IPC methods for communication with HC through DDF interface. More...

Detailed Description

USB support for HelenOS.


Typedef Documentation

typedef usbhc_iface_transfer_out_t usbhc_iface_transfer_setup_t

Setup transfer processing function prototype.

Definition at line 205 of file usbhc_iface.h.


Enumeration Type Documentation

enum usb_iface_funcs_t

Enumerator:
IPC_M_USB_GET_ADDRESS  Tell USB address assigned to device.

Parameters:

  • devman handle id Answer:
  • EINVAL - unknown handle or handle not managed by this driver
  • ENOTSUP - operation not supported (shall not happen)
  • arbitrary error code if returned by remote implementation
  • EOK - handle found, first parameter contains the USB address

The handle must be the one used for binding USB address with it (IPC_M_USBHC_BIND_ADDRESS), otherwise the host controller (that this request would eventually reach) would not be able to find it. The problem is that this handle is actually assigned to the function inside driver of the parent device (usually hub driver). To bypass this problem, the initial caller specify handle as zero and the first parent assigns the actual value. See usb_iface_get_address_hub_child_impl() implementation that could be assigned to device ops of a child device of in a hub driver. For example, the USB multi interface device driver (MID) passes this initial zero without any modification because the handle must be resolved by its parent.

IPC_M_USB_GET_INTERFACE  Tell interface number given device can use.

Parameters

  • devman handle id of the device Answer:
  • ENOTSUP - operation not supported (can also mean any interface)
  • EOK - operation okay, first parameter contains interface number
IPC_M_USB_GET_HOST_CONTROLLER_HANDLE  Tell devman handle of device host controller.

Parameters:

  • none Answer:
  • EOK - request processed without errors
  • ENOTSUP - this indicates invalid USB driver Parameters of the answer:
  • devman handle of HC caller is physically connected to

Definition at line 42 of file usb_iface.h.

enum usbhc_iface_funcs_t

IPC methods for communication with HC through DDF interface.

Notes for async methods:

Methods for sending data to device (OUT transactions)

Methods for retrieving data from device (IN transactions)

Some special methods (NO-DATA transactions) do not send any data. These might behave as both OUT or IN transactions because communication parts where actual buffers are exchanged are omitted.

For all these methods, wrap functions exists. Important rule: functions for IN transactions have (as parameters) buffers where retrieved data will be stored. These buffers must be already allocated and shall not be touch until the transaction is completed (e.g. not before calling usb_wait_for() with appropriate handle). OUT transactions buffers can be freed immediately after call is dispatched (i.e. after return from wrapping function).

Enumerator:
IPC_M_USBHC_REQUEST_ADDRESS  Asks for address assignment by host controller.

Answer:

  • ELIMIT - host controller run out of address
  • EOK - address assigned Answer arguments:
  • assigned address

The address must be released by via IPC_M_USBHC_RELEASE_ADDRESS.

IPC_M_USBHC_BIND_ADDRESS  Bind USB address with devman handle.

Parameters:

  • USB address
  • devman handle Answer:
  • EOK - address binded
  • ENOENT - address is not in use
IPC_M_USBHC_GET_HANDLE_BY_ADDRESS  Get handle binded with given USB address.

Parameters

  • USB address Answer:
  • EOK - address binded, first parameter is the devman handle
  • ENOENT - address is not in use at the moment
IPC_M_USBHC_RELEASE_ADDRESS  Release address in use.

Arguments:

  • address to be released Answer:
  • ENOENT - address not in use
  • EPERM - trying to release default USB address
IPC_M_USBHC_INTERRUPT_OUT  Send interrupt data to device.

See explanation at usb_iface_funcs_t (OUT transaction).

IPC_M_USBHC_INTERRUPT_IN  Get interrupt data from device.

See explanation at usb_iface_funcs_t (IN transaction).

IPC_M_USBHC_BULK_OUT  Send bulk data to device.

See explanation at usb_iface_funcs_t (OUT transaction).

IPC_M_USBHC_BULK_IN  Get bulk data from device.

See explanation at usb_iface_funcs_t (IN transaction).

IPC_M_USBHC_CONTROL_WRITE  Issue control WRITE transfer.

See explanation at usb_iface_funcs_t (OUT transaction) for call parameters. This call is immediately followed by two IPC data writes from the caller (setup packet and actual data).

IPC_M_USBHC_CONTROL_READ  Issue control READ transfer.

See explanation at usb_iface_funcs_t (IN transaction) for call parameters. This call is immediately followed by IPC data write from the caller (setup packet) and IPC data read (buffer that was read).

IPC_M_USBHC_REGISTER_ENDPOINT  Register endpoint attributes at host controller.

This is used to reserve portion of USB bandwidth. When speed is invalid, speed of the device is used. Parameters:

  • USB address + endpoint number
    • packed as ADDR << 16 + EP
  • speed + transfer type + direction
    • packed as ( SPEED << 8 + TYPE ) << 8 + DIR
  • maximum packet size + interval (in milliseconds)
    • packed as MPS << 16 + INT Answer:
  • EOK - reservation successful
  • ELIMIT - not enough bandwidth to satisfy the request
IPC_M_USBHC_UNREGISTER_ENDPOINT  Revert endpoint registration.

Parameters:

  • USB address
  • endpoint number
  • data direction Answer:
  • EOK - endpoint unregistered
  • ENOENT - unknown endpoint

Definition at line 85 of file usbhc_iface.h.


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