31#include <sys/stdint.h>
32#include <sys/stddef.h>
37#include <sys/kernel.h>
39#include <sys/module.h>
42#include <sys/condvar.h>
43#include <sys/sysctl.h>
45#include <sys/unistd.h>
46#include <sys/callout.h>
47#include <sys/malloc.h>
57#define USB_DEBUG_VAR usb_debug
70#define ULED_ENABLED 0x01
73#define ULED_FLAG_BLINK1 0x0001
77static uint8_t
blink1[] = { 0x1,
'v', 0, 0, 0, 0, 0, 0 };
78static uint8_t
dl100b[] = { 0x1f, 0x2, 0, 0x5f, 0, 0, 0x1a, 0x3 };
93 .basename[0] =
"uled",
97 uint16_t, uint16_t,
void *, uint16_t);
117#define ULED_DEV(v,p,i) { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, i) }
133 uaa = device_get_ivars(
dev);
150 uaa = device_get_ivars(
dev);
151 sc = device_get_softc(
dev);
152 unit = device_get_unit(
dev);
156 mtx_init(&sc->
sc_mtx,
"uled lock", NULL, MTX_DEF | MTX_RECURSE);
182 sc = device_get_softc(
dev);
190 uint16_t value, uint16_t index,
void *buf, uint16_t buflen)
194 req.bmRequestType = rt;
195 req.bRequest = reqno;
215 0x200, 0, cmdbuf,
sizeof(cmdbuf));
223 if (fflags & FREAD) {
239 if (fflags & FREAD) {
275 buf[3] = color.
green;
277 buf[5] = buf[6] = buf[7] = 0;
280 buf[1] = color.
green;
282 buf[3] = buf[4] = buf[5] = 0;
struct usb_fifo_sc sc_fifo
struct uled_color sc_color
struct usb_device * sc_udev
enum usb_hc_mode usb_mode
struct usbd_lookup_info info
struct usb_device * device
static device_attach_t uled_attach
MODULE_DEPEND(uled, usb, 1, 1, 1)
static int uled_enable(struct uled_softc *)
static device_method_t uled_methods[]
static device_probe_t uled_probe
DRIVER_MODULE(uled, uhub, uled_driver, uled_devclass, NULL, NULL)
USB_PNP_HOST_INFO(uled_devs)
static usb_fifo_open_t uled_open
static usb_fifo_close_t uled_close
static usb_fifo_ioctl_t uled_ioctl
static devclass_t uled_devclass
static struct usb_fifo_methods uled_fifo_methods
static driver_t uled_driver
static device_detach_t uled_detach
#define ULED_DEV(v, p, i)
static usb_error_t uled_ctrl_msg(struct uled_softc *, uint8_t, uint8_t, uint16_t, uint16_t, void *, uint16_t)
static const STRUCT_USB_HOST_ID uled_devs[]
#define UT_WRITE_CLASS_INTERFACE
int usbd_lookup_id_by_uaa(const struct usb_device_id *id, usb_size_t sizeof_id, struct usb_attach_arg *uaa)
usb_error_t usbd_do_request_flags(struct usb_device *udev, struct mtx *mtx, struct usb_device_request *req, void *data, uint16_t flags, uint16_t *actlen, usb_timeout_t timeout)
void device_set_usb_desc(device_t dev)
int() usb_fifo_ioctl_t(struct usb_fifo *fifo, u_long cmd, void *addr, int fflags)
void * usb_fifo_softc(struct usb_fifo *fifo)
void() usb_fifo_close_t(struct usb_fifo *fifo, int fflags)
void usb_fifo_detach(struct usb_fifo_sc *f_sc)
int usb_fifo_attach(struct usb_device *udev, void *priv_sc, struct mtx *priv_mtx, struct usb_fifo_methods *pm, struct usb_fifo_sc *f_sc, uint16_t unit, int16_t subunit, uint8_t iface_index, uid_t uid, gid_t gid, int mode)
int() usb_fifo_open_t(struct usb_fifo *fifo, int fflags)
#define STRUCT_USB_HOST_ID
#define USB_GET_DRIVER_INFO(did)