#include <errno.h>
#include <usb/classes/hub.h>
#include <usbvirt/device.h>
#include "virthub.h"
#include "hub.h"
Go to the source code of this file.
Defines | |
#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 | 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. | |
Functions | |
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 | 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. | |
Variables | |
static usbvirt_control_request_handler_t | endpoint_zero_handlers [] |
Hub operations on control endpoint zero. | |
usbvirt_device_ops_t | hub_ops |
Hub operations. |
Definition in file virthubops.c.