Changeset View
Changeset View
Standalone View
Standalone View
usr.sbin/bhyve/usb_emul.h
Show All 25 Lines | |||||
* SUCH DAMAGE. | * SUCH DAMAGE. | ||||
* | * | ||||
* $FreeBSD$ | * $FreeBSD$ | ||||
*/ | */ | ||||
#ifndef _USB_EMUL_H_ | #ifndef _USB_EMUL_H_ | ||||
#define _USB_EMUL_H_ | #define _USB_EMUL_H_ | ||||
#include <sys/nv.h> | |||||
#include <stdlib.h> | #include <stdlib.h> | ||||
#include <sys/linker_set.h> | #include <sys/linker_set.h> | ||||
#include <pthread.h> | #include <pthread.h> | ||||
#include "config.h" | |||||
#define USB_MAX_XFER_BLOCKS 8 | #define USB_MAX_XFER_BLOCKS 8 | ||||
#define USB_XFER_OUT 0 | #define USB_XFER_OUT 0 | ||||
#define USB_XFER_IN 1 | #define USB_XFER_IN 1 | ||||
struct usb_hci; | struct usb_hci; | ||||
struct usb_device_request; | struct usb_device_request; | ||||
struct usb_data_xfer; | struct usb_data_xfer; | ||||
struct vm_snapshot_meta; | struct vm_snapshot_meta; | ||||
/* Device emulation handlers */ | /* Device emulation handlers */ | ||||
struct usb_devemu { | struct usb_devemu { | ||||
char *ue_emu; /* name of device emulation */ | char *ue_emu; /* name of device emulation */ | ||||
int ue_usbver; /* usb version: 2 or 3 */ | int ue_usbver; /* usb version: 2 or 3 */ | ||||
int ue_usbspeed; /* usb device speed */ | int ue_usbspeed; /* usb device speed */ | ||||
/* instance creation */ | /* instance creation */ | ||||
void *(*ue_init)(struct usb_hci *hci, nvlist_t *nvl); | void *(*ue_init)(struct usb_hci *hci, config_node_t *node); | ||||
/* handlers */ | /* handlers */ | ||||
int (*ue_request)(void *sc, struct usb_data_xfer *xfer); | int (*ue_request)(void *sc, struct usb_data_xfer *xfer); | ||||
int (*ue_data)(void *sc, struct usb_data_xfer *xfer, int dir, | int (*ue_data)(void *sc, struct usb_data_xfer *xfer, int dir, | ||||
int epctx); | int epctx); | ||||
int (*ue_reset)(void *sc); | int (*ue_reset)(void *sc); | ||||
int (*ue_remove)(void *sc); | int (*ue_remove)(void *sc); | ||||
int (*ue_stop)(void *sc); | int (*ue_stop)(void *sc); | ||||
▲ Show 20 Lines • Show All 94 Lines • Show Last 20 Lines |