Files | |
file | conn.h |
Connection handling of incoming calls. | |
file | conndev.c |
Connection handling of calls from virtual device (implementation). | |
file | connhost.c |
Host controller interface implementation. | |
file | hub.c |
Virtual USB hub. | |
file | hub.c |
Representation of an USB hub (implementation). | |
file | hub.h |
Virtual USB hub. | |
file | hub.h |
Representation of an USB hub. | |
file | main.c |
Virtual host controller. | |
file | vhcd.h |
Virtual USB host controller common definitions. | |
file | virthub.c |
file | virthub.h |
USB hub as a virtual USB device. | |
file | virthubops.c |
Virtual USB hub operations. | |
Data Structures | |
struct | delay_port_state_change |
Structure for automatic (delayed) port state change. More... | |
struct | hub |
Hub device type. More... | |
struct | hub_descriptor_t |
Hub descriptor. More... | |
struct | hub_port_t |
Hub port information. More... | |
struct | vhc_data_t |
struct | vhc_transfer_t |
struct | vhc_virtdev_t |
Defines | |
#define | BITS2BYTES(bits) (bits ? ((((bits)-1)>>3)+1) : 0) |
#define | CLASS_REQ(direction, recipient, req) |
Create a class request. | |
#define | CLASS_REQ_IN(recipient) |
IN class request. | |
#define | CLASS_REQ_OUT(recipient) |
OUT class request. | |
#define | DIR_IN USB_DIRECTION_IN |
Direction: in. | |
#define | DIR_OUT USB_DIRECTION_OUT |
Direction: out. | |
#define | GET_VHC_DATA(fun) ((vhc_data_t *)fun->dev->driver_data) |
#define | HUB_CONFIGURATION_ID 1 |
Configuration value for hub configuration. | |
#define | HUB_PORT_COUNT 2 |
#define | HUB_STATUS_CHANGE_PIPE 1 |
Endpoint number for status change pipe. | |
#define | MAKE_BYTE(b0, b1, b2, b3, b4, b5, b6, b7) |
Produce a byte from bit values. | |
#define | NAME "vhc" |
#define | PLUGGED_DEVICE_NAME_MAXLEN 256 |
#define | REC_DEVICE USB_REQUEST_RECIPIENT_DEVICE |
Recipient: device. | |
#define | REC_OTHER USB_REQUEST_RECIPIENT_OTHER |
Recipient: other. | |
#define | STD_REQ(direction, recipient, req) |
Create a standard request. | |
#define | UNSUPPORTED(methodname) |
#define | VHC_DATA(vhc, fun) vhc_data_t *vhc = GET_VHC_DATA(fun); assert(vhc->magic == 0xdeadbeef) |
Typedefs | |
typedef hub | hub_t |
Enumerations | |
enum | hub_port_state_t |
Hub port internal state. More... | |
enum | hub_status_change_t |
Hub status change mask bits. | |
Functions | |
static int | bind_address (ddf_fun_t *fun, usb_address_t address, devman_handle_t handle) |
Bind USB address with device devman handle. | |
static int | bulk_in (ddf_fun_t *fun, usb_target_t target, void *data, size_t size, usbhc_iface_transfer_in_callback_t callback, void *arg) |
Schedule bulk in transfer. | |
static int | bulk_out (ddf_fun_t *fun, usb_target_t target, void *data, size_t size, usbhc_iface_transfer_out_callback_t callback, void *arg) |
Schedule bulk out transfer. | |
static void | clear_port_status_change (hub_port_t *port, uint16_t change) |
Clears a port status change on a port. | |
static int | control_read (ddf_fun_t *fun, usb_target_t target, void *setup_packet, size_t setup_packet_size, void *data_buffer, size_t data_buffer_size, usbhc_iface_transfer_in_callback_t callback, void *arg) |
Schedule control read transfer. | |
static int | control_write (ddf_fun_t *fun, usb_target_t target, void *setup_packet, size_t setup_packet_size, void *data_buffer, size_t data_buffer_size, usbhc_iface_transfer_out_callback_t callback, void *arg) |
Schedule control write transfer. | |
static int | find_by_address (ddf_fun_t *fun, usb_address_t address, devman_handle_t *handle) |
Find device handle by address interface function. | |
static hub_port_t * | get_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. | |
static int | hub_register_in_devman_fibril (void *arg) |
Register root hub in devman. | |
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 int | interrupt_in (ddf_fun_t *fun, usb_target_t target, void *data, size_t size, usbhc_iface_transfer_in_callback_t callback, void *arg) |
Schedule interrupt in transfer. | |
static int | interrupt_out (ddf_fun_t *fun, usb_target_t target, void *data, size_t size, usbhc_iface_transfer_out_callback_t callback, void *arg) |
Schedule interrupt out transfer. | |
int | main (int argc, char *argv[]) |
Main entry point. | |
void | on_client_close (ddf_fun_t *fun) |
Callback when client disconnects. | |
static void | on_state_change (usbvirt_device_t *dev, usbvirt_device_state_t old_state, usbvirt_device_state_t new_state) |
Callback when device changes states. | |
static int | pretend_port_rest (int unused, void *unused2) |
static void | receive_device_name (int phone) |
Receive device name. | |
static int | register_endpoint (ddf_fun_t *fun, usb_address_t address, usb_speed_t speed, usb_endpoint_t endpoint, usb_transfer_type_t transfer_type, usb_direction_t direction, size_t max_packet_size, unsigned int interval) |
Register endpoint for bandwidth reservation. | |
static int | release_address (ddf_fun_t *fun, usb_address_t address) |
Release previously requested address. | |
static int | req_clear_hub_feature (usbvirt_device_t *dev, const usb_device_request_setup_packet_t *request, uint8_t *data, size_t *act_size) |
Handle ClearHubFeature request. | |
static int | req_clear_port_feature (usbvirt_device_t *dev, const usb_device_request_setup_packet_t *request, uint8_t *data, size_t *act_size) |
Handle ClearPortFeature request. | |
static int | req_get_bus_state (usbvirt_device_t *dev, const usb_device_request_setup_packet_t *request, uint8_t *data, size_t *act_size) |
Handle GetBusState request. | |
static int | req_get_descriptor (usbvirt_device_t *dev, const usb_device_request_setup_packet_t *request, uint8_t *data, size_t *act_size) |
Handle GetDescriptor request. | |
static int | req_get_hub_status (usbvirt_device_t *dev, const usb_device_request_setup_packet_t *request, uint8_t *data, size_t *act_size) |
Handle GetHubStatus request. | |
static int | req_get_port_status (usbvirt_device_t *dev, const usb_device_request_setup_packet_t *request, uint8_t *data, size_t *act_size) |
Handle GetPortStatus request. | |
static int | req_on_status_change_pipe (usbvirt_device_t *dev, usb_endpoint_t endpoint, usb_transfer_type_t tr_type, void *buffer, size_t buffer_size, size_t *actual_size) |
Callback for data request. | |
static int | req_set_hub_feature (usbvirt_device_t *dev, const usb_device_request_setup_packet_t *request, uint8_t *data, size_t *act_size) |
Handle SetHubFeature request. | |
static int | req_set_port_feature (usbvirt_device_t *dev, const usb_device_request_setup_packet_t *request, uint8_t *data, size_t *act_size) |
Handle SetPortFeature request. | |
static int | request_address (ddf_fun_t *fun, usb_speed_t speed, usb_address_t *address) |
Found free USB address. | |
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. | |
static int | tell_address (ddf_fun_t *fun, devman_handle_t handle, usb_address_t *address) |
static int | tell_address_rh (ddf_fun_t *root_hub_fun, devman_handle_t handle, usb_address_t *address) |
static int | unregister_endpoint (ddf_fun_t *fun, usb_address_t address, usb_endpoint_t endpoint, usb_direction_t direction) |
Unregister endpoint (free some bandwidth reservation). | |
static int | usb_iface_get_hc_handle_rh_impl (ddf_fun_t *root_hub_fun, devman_handle_t *handle) |
static int | vhc_add_device (ddf_dev_t *dev) |
vhc_transfer_t * | vhc_transfer_create (usb_address_t, usb_endpoint_t, usb_direction_t, usb_transfer_type_t, ddf_fun_t *, void *) |
int | vhc_transfer_queue_processor (void *arg) |
int | vhc_virtdev_add_transfer (vhc_data_t *, vhc_transfer_t *) |
int | vhc_virtdev_plug (vhc_data_t *, int, uintptr_t *) |
int | vhc_virtdev_plug_hub (vhc_data_t *, usbvirt_device_t *, uintptr_t *) |
int | vhc_virtdev_plug_local (vhc_data_t *, usbvirt_device_t *, uintptr_t *) |
void | vhc_virtdev_unplug (vhc_data_t *, uintptr_t) |
int | virthub_connect_device (usbvirt_device_t *dev, vhc_virtdev_t *conn) |
Connect a device to a virtual hub. | |
int | virthub_disconnect_device (usbvirt_device_t *dev, vhc_virtdev_t *conn) |
Disconnect a device from a virtual hub. | |
void | virthub_get_status (usbvirt_device_t *dev, char *status, size_t len) |
Format status of a virtual hub. | |
int | virthub_init (usbvirt_device_t *dev) |
Initializes virtual hub device. | |
bool | virthub_is_device_enabled (usbvirt_device_t *dev, vhc_virtdev_t *conn) |
Whether trafic is propagated to given device. | |
void | virtual_hub_device_init (ddf_fun_t *hc_dev) |
Variables | |
usbvirt_device_configuration_t | configuration |
Hub configuration. | |
usbvirt_descriptors_t | descriptors |
Hub standard descriptors. | |
usb_standard_endpoint_descriptor_t | endpoint_descriptor |
Endpoint descriptor. | |
static usbvirt_control_request_handler_t | endpoint_zero_handlers [] |
Hub operations on control endpoint zero. | |
static usbvirt_device_configuration_extras_t | extra_descriptors [] |
All hub configuration descriptors. | |
hub_descriptor_t | hub_descriptor |
Hub descriptor. | |
hub_descriptor_t | hub_descriptor |
Hub descriptor. | |
usbvirt_device_ops_t | hub_ops |
Hub operations. | |
usbvirt_device_ops_t | hub_ops |
Hub operations. | |
static fibril_local uintptr_t | plugged_device_handle = 0 |
static fibril_local char | plugged_device_name [PLUGGED_DEVICE_NAME_MAXLEN+1] = "<unknown>" |
static ddf_dev_ops_t | rh_ops |
usb_iface_t | rh_usb_iface |
usb_iface_t | rh_usb_iface |
usb_standard_configuration_descriptor_t | std_configuration_descriptor |
Standard configuration descriptor. | |
usb_standard_device_descriptor_t | std_device_descriptor |
Standard device descriptor. | |
usb_standard_interface_descriptor_t | std_interface_descriptor |
Standard interface descriptor. | |
static driver_t | vhc_driver |
static driver_ops_t | vhc_driver_ops |
usbhc_iface_t | vhc_iface |
usbhc_iface_t | vhc_iface |
static ddf_dev_ops_t | vhc_ops |
usb_iface_t | vhc_usb_iface |
usb_iface_t | vhc_usb_iface |
usbvirt_device_t | virtual_hub_device |
usbvirt_device_t | virtual_hub_device |
#define CLASS_REQ | ( | direction, | |||
recipient, | |||||
req | ) |
Value:
.req_direction = direction, \ .req_recipient = recipient, \ .req_type = USB_REQUEST_TYPE_CLASS, \ .request = req
direction | Request direction. | |
recipient | Request recipient. | |
req | Request code. |
Definition at line 367 of file virthubops.c.
#define STD_REQ | ( | direction, | |||
recipient, | |||||
req | ) |
Value:
.req_direction = direction, \ .req_recipient = recipient, \ .req_type = USB_REQUEST_TYPE_STANDARD, \ .request = req
direction | Request direction. | |
recipient | Request recipient. | |
req | Request code. |
Definition at line 379 of file virthubops.c.
enum hub_port_state_t |
static int bind_address | ( | ddf_fun_t * | fun, | |
usb_address_t | address, | |||
devman_handle_t | handle | |||
) | [static] |
Bind USB address with device devman handle.
[in] | fun | Device function the action was invoked on. |
[in] | address | USB address of the device. |
[in] | handle | Devman handle of the device. |
Definition at line 84 of file connhost.c.
static int bulk_in | ( | ddf_fun_t * | fun, | |
usb_target_t | target, | |||
void * | data, | |||
size_t | size, | |||
usbhc_iface_transfer_in_callback_t | callback, | |||
void * | arg | |||
) | [static] |
Schedule bulk in transfer.
The callback is supposed to be called once the transfer (on the wire) is complete regardless of the outcome. However, the callback could be called only when this function returns with success status (i.e. returns EOK).
[in] | fun | Device function the action was invoked on. |
[in] | target | Target pipe (address and endpoint number) specification. |
[in] | data | Buffer where to store the data (in USB endianess, allocated and deallocated by the caller). |
[in] | size | Size of the data buffer in bytes. |
[in] | callback | Callback to be issued once the transfer is complete. |
[in] | arg | Pass-through argument to the callback. |
Definition at line 316 of file connhost.c.
static int bulk_out | ( | ddf_fun_t * | fun, | |
usb_target_t | target, | |||
void * | data, | |||
size_t | size, | |||
usbhc_iface_transfer_out_callback_t | callback, | |||
void * | arg | |||
) | [static] |
Schedule bulk out transfer.
The callback is supposed to be called once the transfer (on the wire) is complete regardless of the outcome. However, the callback could be called only when this function returns with success status (i.e. returns EOK).
[in] | fun | Device function the action was invoked on. |
[in] | target | Target pipe (address and endpoint number) specification. |
[in] | data | Data to be sent (in USB endianess, allocated and deallocated by the caller). |
[in] | size | Size of the data buffer in bytes. |
[in] | callback | Callback to be issued once the transfer is complete. |
[in] | arg | Pass-through argument to the callback. |
Definition at line 291 of file connhost.c.
static void clear_port_status_change | ( | hub_port_t * | port, | |
uint16_t | change | |||
) | [static] |
static int control_read | ( | ddf_fun_t * | fun, | |
usb_target_t | target, | |||
void * | setup_packet, | |||
size_t | setup_packet_size, | |||
void * | data_buffer, | |||
size_t | data_buffer_size, | |||
usbhc_iface_transfer_in_callback_t | callback, | |||
void * | arg | |||
) | [static] |
Schedule control read transfer.
The callback is supposed to be called once the transfer (on the wire) is complete regardless of the outcome. However, the callback could be called only when this function returns with success status (i.e. returns EOK).
[in] | fun | Device function the action was invoked on. |
[in] | target | Target pipe (address and endpoint number) specification. |
[in] | setup_packet | Setup packet buffer (in USB endianess, allocated and deallocated by the caller). |
[in] | setup_packet_size | Size of setup_packet buffer in bytes. |
[in] | data_buffer | Buffer where to store the data (in USB endianess, allocated and deallocated by the caller). |
[in] | data_buffer_size | Size of data_buffer buffer in bytes. |
[in] | callback | Callback to be issued once the transfer is complete. |
[in] | arg | Pass-through argument to the callback. |
Definition at line 392 of file connhost.c.
static int control_write | ( | ddf_fun_t * | fun, | |
usb_target_t | target, | |||
void * | setup_packet, | |||
size_t | setup_packet_size, | |||
void * | data_buffer, | |||
size_t | data_buffer_size, | |||
usbhc_iface_transfer_out_callback_t | callback, | |||
void * | arg | |||
) | [static] |
Schedule control write transfer.
The callback is supposed to be called once the transfer (on the wire) is complete regardless of the outcome. However, the callback could be called only when this function returns with success status (i.e. returns EOK).
[in] | fun | Device function the action was invoked on. |
[in] | target | Target pipe (address and endpoint number) specification. |
[in] | setup_packet | Setup packet buffer (in USB endianess, allocated and deallocated by the caller). |
[in] | setup_packet_size | Size of setup_packet buffer in bytes. |
[in] | data_buffer | Data buffer (in USB endianess, allocated and deallocated by the caller). |
[in] | data_buffer_size | Size of data_buffer buffer in bytes. |
[in] | callback | Callback to be issued once the transfer is complete. |
[in] | arg | Pass-through argument to the callback. |
Definition at line 344 of file connhost.c.
static int find_by_address | ( | ddf_fun_t * | fun, | |
usb_address_t | address, | |||
devman_handle_t * | handle | |||
) | [static] |
Find device handle by address interface function.
[in] | fun | DDF function that was called. |
[in] | address | Address in question. |
[out] | handle | Where to store device handle if found. |
Definition at line 102 of file connhost.c.
static hub_port_t * get_hub_port | ( | hub_t * | hub, | |
size_t | port | |||
) | [static] |
void hub_acquire | ( | hub_t * | hub | ) |
void hub_clear_port_status_change | ( | hub_t * | hub, | |
size_t | port_index, | |||
hub_status_change_t | change | |||
) |
int hub_disconnect_device | ( | hub_t * | hub, | |
void * | device | |||
) |
hub_port_state_t hub_get_port_state | ( | hub_t * | hub, | |
size_t | port_index | |||
) |
uint8_t hub_get_status_change_bitmap | ( | hub_t * | hub | ) |
void hub_init | ( | hub_t * | hub | ) |
static void hub_init_port | ( | hub_port_t * | port, | |
hub_t * | hub, | |||
size_t | index | |||
) | [static] |
int hub_register_in_devman_fibril | ( | void * | arg | ) | [static] |
void hub_release | ( | hub_t * | hub | ) |
void hub_set_port_state | ( | hub_t * | hub, | |
size_t | port_index, | |||
hub_port_state_t | state | |||
) |
void hub_set_port_state_all | ( | hub_t * | hub, | |
hub_port_state_t | state | |||
) |
static int interrupt_in | ( | ddf_fun_t * | fun, | |
usb_target_t | target, | |||
void * | data, | |||
size_t | size, | |||
usbhc_iface_transfer_in_callback_t | callback, | |||
void * | arg | |||
) | [static] |
Schedule interrupt in transfer.
The callback is supposed to be called once the transfer (on the wire) is complete regardless of the outcome. However, the callback could be called only when this function returns with success status (i.e. returns EOK).
[in] | fun | Device function the action was invoked on. |
[in] | target | Target pipe (address and endpoint number) specification. |
[in] | data | Buffer where to store the data (in USB endianess, allocated and deallocated by the caller). |
[in] | size | Size of the data buffer in bytes. |
[in] | callback | Callback to be issued once the transfer is complete. |
[in] | arg | Pass-through argument to the callback. |
Definition at line 249 of file connhost.c.
static int interrupt_out | ( | ddf_fun_t * | fun, | |
usb_target_t | target, | |||
void * | data, | |||
size_t | size, | |||
usbhc_iface_transfer_out_callback_t | callback, | |||
void * | arg | |||
) | [static] |
Schedule interrupt out transfer.
The callback is supposed to be called once the transfer (on the wire) is complete regardless of the outcome. However, the callback could be called only when this function returns with success status (i.e. returns EOK).
[in] | fun | Device function the action was invoked on. |
[in] | target | Target pipe (address and endpoint number) specification. |
[in] | data | Data to be sent (in USB endianess, allocated and deallocated by the caller). |
[in] | size | Size of the data buffer in bytes. |
[in] | callback | Callback to be issued once the transfer is complete. |
[in] | arg | Pass-through argument to the callback. |
Definition at line 207 of file connhost.c.
int main | ( | int | argc, | |
char * | argv[] | |||
) |
void on_client_close | ( | ddf_fun_t * | fun | ) |
static void receive_device_name | ( | int | phone | ) | [static] |
static int register_endpoint | ( | ddf_fun_t * | fun, | |
usb_address_t | address, | |||
usb_speed_t | speed, | |||
usb_endpoint_t | endpoint, | |||
usb_transfer_type_t | transfer_type, | |||
usb_direction_t | direction, | |||
size_t | max_packet_size, | |||
unsigned int | interval | |||
) | [static] |
Register endpoint for bandwidth reservation.
[in] | fun | Device function the action was invoked on. |
[in] | address | USB address of the device. |
[in] | speed | Endpoint speed (invalid means to use device one). |
[in] | endpoint | Endpoint number. |
[in] | transfer_type | USB transfer type. |
[in] | direction | Endpoint data direction. |
[in] | max_packet_size | Max packet size of the endpoint. |
[in] | interval | Polling interval. |
Definition at line 138 of file connhost.c.
static int release_address | ( | ddf_fun_t * | fun, | |
usb_address_t | address | |||
) | [static] |
Release previously requested address.
[in] | fun | Device function the action was invoked on. |
[in] | address | USB address to be released. |
Definition at line 117 of file connhost.c.
static int req_clear_hub_feature | ( | usbvirt_device_t * | dev, | |
const usb_device_request_setup_packet_t * | request, | |||
uint8_t * | data, | |||
size_t * | act_size | |||
) | [static] |
Handle ClearHubFeature request.
dev | Virtual device representing the hub. | |
request | The SETUP packet of the control request. | |
data | Extra data (when DATA stage present). |
Definition at line 110 of file virthubops.c.
static int req_clear_port_feature | ( | usbvirt_device_t * | dev, | |
const usb_device_request_setup_packet_t * | request, | |||
uint8_t * | data, | |||
size_t * | act_size | |||
) | [static] |
Handle ClearPortFeature request.
dev | Virtual device representing the hub. | |
request | The SETUP packet of the control request. | |
data | Extra data (when DATA stage present). |
Definition at line 124 of file virthubops.c.
static int req_get_bus_state | ( | usbvirt_device_t * | dev, | |
const usb_device_request_setup_packet_t * | request, | |||
uint8_t * | data, | |||
size_t * | act_size | |||
) | [static] |
Handle GetBusState request.
dev | Virtual device representing the hub. | |
request | The SETUP packet of the control request. | |
data | Extra data (when DATA stage present). |
Definition at line 204 of file virthubops.c.
static int req_get_descriptor | ( | usbvirt_device_t * | dev, | |
const usb_device_request_setup_packet_t * | request, | |||
uint8_t * | data, | |||
size_t * | act_size | |||
) | [static] |
Handle GetDescriptor request.
dev | Virtual device representing the hub. | |
request | The SETUP packet of the control request. | |
data | Extra data (when DATA stage present). |
Definition at line 218 of file virthubops.c.
static int req_get_hub_status | ( | usbvirt_device_t * | dev, | |
const usb_device_request_setup_packet_t * | request, | |||
uint8_t * | data, | |||
size_t * | act_size | |||
) | [static] |
Handle GetHubStatus request.
dev | Virtual device representing the hub. | |
request | The SETUP packet of the control request. | |
data | Extra data (when DATA stage present). |
Definition at line 239 of file virthubops.c.
static int req_get_port_status | ( | usbvirt_device_t * | dev, | |
const usb_device_request_setup_packet_t * | request, | |||
uint8_t * | data, | |||
size_t * | act_size | |||
) | [static] |
Handle GetPortStatus request.
dev | Virtual device representing the hub. | |
request | The SETUP packet of the control request. | |
data | Extra data (when DATA stage present). |
Definition at line 258 of file virthubops.c.
static int req_set_hub_feature | ( | usbvirt_device_t * | dev, | |
const usb_device_request_setup_packet_t * | request, | |||
uint8_t * | data, | |||
size_t * | act_size | |||
) | [static] |
Handle SetHubFeature request.
dev | Virtual device representing the hub. | |
request | The SETUP packet of the control request. | |
data | Extra data (when DATA stage present). |
Definition at line 283 of file virthubops.c.
static int req_set_port_feature | ( | usbvirt_device_t * | dev, | |
const usb_device_request_setup_packet_t * | request, | |||
uint8_t * | data, | |||
size_t * | act_size | |||
) | [static] |
Handle SetPortFeature request.
dev | Virtual device representing the hub. | |
request | The SETUP packet of the control request. | |
data | Extra data (when DATA stage present). |
Definition at line 297 of file virthubops.c.
static int request_address | ( | ddf_fun_t * | fun, | |
usb_speed_t | speed, | |||
usb_address_t * | address | |||
) | [static] |
Found free USB address.
[in] | fun | Device function the action was invoked on. |
[in] | speed | Speed of the device that will get this address. |
[out] | address | Non-null pointer where to store the free address. |
Definition at line 59 of file connhost.c.
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 | |||
) | [static] |
Change port state with a delay.
hub | Hub in question. | |
port_index | Port index (zero based). | |
delay_time_ms | Delay time in miliseconds. | |
old_state | Old (current) state of the port. | |
new_state | New state of the port. |
static int set_port_state_delayed_fibril | ( | void * | arg | ) | [static] |
Fibril responsible for delayed port state change.
arg | Pointer to delay_port_state_change. |
static void set_port_status_change | ( | hub_port_t * | port, | |
hub_status_change_t | change | |||
) | [static] |
static int unregister_endpoint | ( | ddf_fun_t * | fun, | |
usb_address_t | address, | |||
usb_endpoint_t | endpoint, | |||
usb_direction_t | direction | |||
) | [static] |
Unregister endpoint (free some bandwidth reservation).
[in] | fun | Device function the action was invoked on. |
[in] | address | USB address of the device. |
[in] | endpoint | Endpoint number. |
[in] | direction | Endpoint data direction. |
Definition at line 174 of file connhost.c.
int virthub_connect_device | ( | usbvirt_device_t * | dev, | |
vhc_virtdev_t * | conn | |||
) |
int virthub_disconnect_device | ( | usbvirt_device_t * | dev, | |
vhc_virtdev_t * | conn | |||
) |
void virthub_get_status | ( | usbvirt_device_t * | dev, | |
char * | status, | |||
size_t | len | |||
) |
int virthub_init | ( | usbvirt_device_t * | dev | ) |
bool virthub_is_device_enabled | ( | usbvirt_device_t * | dev, | |
vhc_virtdev_t * | conn | |||
) |