Changeset View
Changeset View
Standalone View
Standalone View
usr.sbin/bhyve/usb_mouse.c
Show First 20 Lines • Show All 235 Lines • ▼ Show 20 Lines | .usbssd = { | ||||
.wU2DevExitLat = { 0x20, 0x00 }, | .wU2DevExitLat = { 0x20, 0x00 }, | ||||
} | } | ||||
}; | }; | ||||
struct umouse_softc { | struct umouse_softc { | ||||
struct usb_hci *hci; | struct usb_hci *hci; | ||||
char *opt; | |||||
struct umouse_report um_report; | struct umouse_report um_report; | ||||
int newdata; | int newdata; | ||||
struct { | struct { | ||||
uint8_t idle; | uint8_t idle; | ||||
uint8_t protocol; | uint8_t protocol; | ||||
uint8_t feature; | uint8_t feature; | ||||
} hid; | } hid; | ||||
Show All 40 Lines | umouse_event(uint8_t button, int x, int y, void *arg) | ||||
pthread_mutex_unlock(&sc->mtx); | pthread_mutex_unlock(&sc->mtx); | ||||
pthread_mutex_lock(&sc->ev_mtx); | pthread_mutex_lock(&sc->ev_mtx); | ||||
sc->hci->hci_intr(sc->hci, UE_DIR_IN | UMOUSE_INTR_ENDPT); | sc->hci->hci_intr(sc->hci, UE_DIR_IN | UMOUSE_INTR_ENDPT); | ||||
pthread_mutex_unlock(&sc->ev_mtx); | pthread_mutex_unlock(&sc->ev_mtx); | ||||
} | } | ||||
static void * | static void * | ||||
umouse_init(struct usb_hci *hci, char *opt) | umouse_init(struct usb_hci *hci, nvlist_t *nvl) | ||||
{ | { | ||||
struct umouse_softc *sc; | struct umouse_softc *sc; | ||||
sc = calloc(1, sizeof(struct umouse_softc)); | sc = calloc(1, sizeof(struct umouse_softc)); | ||||
sc->hci = hci; | sc->hci = hci; | ||||
sc->hid.protocol = 1; /* REPORT protocol */ | sc->hid.protocol = 1; /* REPORT protocol */ | ||||
sc->opt = strdup(opt); | |||||
pthread_mutex_init(&sc->mtx, NULL); | pthread_mutex_init(&sc->mtx, NULL); | ||||
pthread_mutex_init(&sc->ev_mtx, NULL); | pthread_mutex_init(&sc->ev_mtx, NULL); | ||||
console_ptr_register(umouse_event, sc, 10); | console_ptr_register(umouse_event, sc, 10); | ||||
return (sc); | return (sc); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 513 Lines • Show Last 20 Lines |