#include <sys/stdint.h>
#include <sys/stddef.h>
#include <sys/param.h>
#include <sys/queue.h>
#include <sys/types.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/bus.h>
#include <sys/module.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/condvar.h>
#include <sys/sysctl.h>
#include <sys/sx.h>
#include <sys/unistd.h>
#include <sys/callout.h>
#include <sys/malloc.h>
#include <sys/priv.h>
#include <dev/usb/usb.h>
#include <dev/usb/usbdi.h>
#include <dev/usb/usbdi_util.h>
#include "usbdevs.h"
#include <dev/usb/usb_debug.h>
#include <dev/usb/usb_process.h>
#include <dev/usb/serial/usb_serial.h>
Go to the source code of this file.
|
static void | uvisor_free_softc (struct uvisor_softc *) |
|
static usb_error_t | uvisor_init (struct uvisor_softc *, struct usb_device *, struct usb_config *) |
|
static void | uvisor_free (struct ucom_softc *) |
|
static void | uvisor_cfg_open (struct ucom_softc *) |
|
static void | uvisor_cfg_close (struct ucom_softc *) |
|
static void | uvisor_start_read (struct ucom_softc *) |
|
static void | uvisor_stop_read (struct ucom_softc *) |
|
static void | uvisor_start_write (struct ucom_softc *) |
|
static void | uvisor_stop_write (struct ucom_softc *) |
|
| DRIVER_MODULE (uvisor, uhub, uvisor_driver, uvisor_devclass, NULL, 0) |
|
| MODULE_DEPEND (uvisor, ucom, 1, 1, 1) |
|
| MODULE_DEPEND (uvisor, usb, 1, 1, 1) |
|
| MODULE_VERSION (uvisor, 1) |
|
| USB_PNP_HOST_INFO (uvisor_devs) |
|
static int | uvisor_probe (device_t dev) |
|
static int | uvisor_attach (device_t dev) |
|
static int | uvisor_detach (device_t dev) |
|
| UCOM_UNLOAD_DRAIN (uvisor) |
|
static void | uvisor_write_callback (struct usb_xfer *xfer, usb_error_t error) |
|
static void | uvisor_read_callback (struct usb_xfer *xfer, usb_error_t error) |
|
◆ USB_DEBUG_VAR
#define USB_DEBUG_VAR uvisor_debug |
◆ UVISOR_CLOSE_NOTIFICATION
#define UVISOR_CLOSE_NOTIFICATION 0x02 |
◆ UVISOR_CONFIG_INDEX
#define UVISOR_CONFIG_INDEX 0 |
◆ UVISOR_CONNECTION_INFO_SIZE
#define UVISOR_CONNECTION_INFO_SIZE 18 |
◆ UVISOR_DEV
#define UVISOR_DEV |
( |
|
v, |
|
|
|
p, |
|
|
|
i |
|
) |
| { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, i) } |
◆ UVISOR_ENDPOINT_1
#define UVISOR_ENDPOINT_1 0x01 |
◆ UVISOR_ENDPOINT_2
#define UVISOR_ENDPOINT_2 0x02 |
◆ UVISOR_FLAG_PALM35
#define UVISOR_FLAG_PALM35 0x0004 |
◆ UVISOR_FLAG_PALM4
#define UVISOR_FLAG_PALM4 0x0001 |
◆ UVISOR_FLAG_SEND_NOTIFY
#define UVISOR_FLAG_SEND_NOTIFY 0x0008 |
◆ UVISOR_FLAG_VISOR
#define UVISOR_FLAG_VISOR 0x0002 |
◆ UVISOR_FUNCTION_CONSOLE
#define UVISOR_FUNCTION_CONSOLE 0x03 |
◆ UVISOR_FUNCTION_DEBUGGER
#define UVISOR_FUNCTION_DEBUGGER 0x01 |
◆ UVISOR_FUNCTION_GENERIC
#define UVISOR_FUNCTION_GENERIC 0x00 |
◆ UVISOR_FUNCTION_HOTSYNC
#define UVISOR_FUNCTION_HOTSYNC 0x02 |
◆ UVISOR_FUNCTION_REMOTE_FILE_SYS
#define UVISOR_FUNCTION_REMOTE_FILE_SYS 0x04 |
◆ UVISOR_GET_CONNECTION_INFORMATION
#define UVISOR_GET_CONNECTION_INFORMATION 0x03 |
◆ UVISOR_GET_PALM_INFORMATION
#define UVISOR_GET_PALM_INFORMATION 0x04 |
◆ UVISOR_GET_PALM_INFORMATION_LEN
#define UVISOR_GET_PALM_INFORMATION_LEN 0x44 |
◆ UVISOR_IFACE_INDEX
#define UVISOR_IFACE_INDEX 0 |
◆ UVISOR_MAX_CONN
#define UVISOR_MAX_CONN 8 |
◆ UVISOR_REQUEST_BYTES_AVAILABLE
#define UVISOR_REQUEST_BYTES_AVAILABLE 0x01 |
◆ UVISORIBUFSIZE
#define UVISORIBUFSIZE 0 /* Use wMaxPacketSize */ |
◆ UVISOROBUFSIZE
#define UVISOROBUFSIZE 32 /* bytes */ |
◆ UVISOROFRAMES
#define UVISOROFRAMES 32 /* units */ |
◆ anonymous enum
Enumerator |
---|
UVISOR_BULK_DT_WR | |
UVISOR_BULK_DT_RD | |
UVISOR_N_TRANSFER | |
Definition at line 166 of file uvisor.c.
◆ DRIVER_MODULE()
◆ MODULE_DEPEND() [1/2]
MODULE_DEPEND |
( |
uvisor |
, |
|
|
ucom |
, |
|
|
1 |
, |
|
|
1 |
, |
|
|
1 |
|
|
) |
| |
◆ MODULE_DEPEND() [2/2]
MODULE_DEPEND |
( |
uvisor |
, |
|
|
usb |
, |
|
|
1 |
, |
|
|
1 |
, |
|
|
1 |
|
|
) |
| |
◆ MODULE_VERSION()
MODULE_VERSION |
( |
uvisor |
, |
|
|
1 |
|
|
) |
| |
◆ UCOM_UNLOAD_DRAIN()
UCOM_UNLOAD_DRAIN |
( |
uvisor |
| ) |
|
◆ USB_PNP_HOST_INFO()
◆ uvisor_attach()
static int uvisor_attach |
( |
device_t |
dev | ) |
|
|
static |
Definition at line 312 of file uvisor.c.
References usbd_lookup_info::bIfaceNum, dev, usb_attach_arg::device, device_set_usb_desc(), DPRINTF, error, usb_attach_arg::info, uvisor_softc::sc_flag, uvisor_softc::sc_iface_index, uvisor_softc::sc_iface_no, uvisor_softc::sc_mtx, uvisor_softc::sc_super_ucom, uvisor_softc::sc_ucom, uvisor_softc::sc_udev, uvisor_softc::sc_xfer, ucom_attach(), ucom_ref(), ucom_set_pnpinfo_usb(), USB_GET_DRIVER_INFO, usbd_errstr(), usbd_transfer_setup(), uvisor_callback, uvisor_config, uvisor_detach, UVISOR_IFACE_INDEX, uvisor_init(), and UVISOR_N_TRANSFER.
◆ uvisor_cfg_close()
static void uvisor_cfg_close |
( |
struct ucom_softc * |
ucom | ) |
|
|
static |
◆ uvisor_cfg_open()
static void uvisor_cfg_open |
( |
struct ucom_softc * |
ucom | ) |
|
|
static |
◆ uvisor_detach()
static int uvisor_detach |
( |
device_t |
dev | ) |
|
|
static |
◆ uvisor_free()
static void uvisor_free |
( |
struct ucom_softc * |
ucom | ) |
|
|
static |
◆ uvisor_free_softc()
◆ uvisor_init()
Definition at line 401 of file uvisor.c.
References config, uvisor_connection_info::connections, uvisor_palm_connection_info::connections, desc, DPRINTF, uvisor_palm_connection_info::end_point_info, uvisor_palm_connection_info::endpoint_numbers_different, uvisor_connection_info::num_ports, uvisor_connection_info::port, uvisor_palm_connection_info::port, uvisor_connection_info::port_function_id, req, uvisor_softc::sc_flag, UGETW, UR_GET_CONFIG, UR_GET_INTERFACE, USB_DEFAULT_TIMEOUT, USB_ERR_INVAL, USB_SHORT_XFER_OK, usbd_do_request, usbd_do_request_flags(), USETW, UT_READ, UT_READ_DEVICE, UT_READ_VENDOR_ENDPOINT, UVISOR_CONNECTION_INFO_SIZE, UVISOR_FLAG_PALM35, UVISOR_FLAG_PALM4, UVISOR_FLAG_VISOR, UVISOR_FUNCTION_DEBUGGER, UVISOR_FUNCTION_GENERIC, UVISOR_FUNCTION_HOTSYNC, UVISOR_FUNCTION_REMOTE_FILE_SYS, UVISOR_GET_CONNECTION_INFORMATION, UVISOR_GET_PALM_INFORMATION, UVISOR_GET_PALM_INFORMATION_LEN, UVISOR_MAX_CONN, and UVISOR_REQUEST_BYTES_AVAILABLE.
Referenced by uvisor_attach().
◆ uvisor_probe()
static int uvisor_probe |
( |
device_t |
dev | ) |
|
|
static |
◆ uvisor_read_callback()
Definition at line 651 of file uvisor.c.
References error, uvisor_softc::sc_ucom, ucom_put_data(), USB_ERR_CANCELLED, USB_GET_STATE, USB_ST_SETUP, USB_ST_TRANSFERRED, usbd_transfer_submit(), usbd_xfer_get_frame(), usbd_xfer_max_len(), usbd_xfer_set_frame_len(), usbd_xfer_set_stall(), usbd_xfer_softc(), and usbd_xfer_status().
◆ uvisor_start_read()
static void uvisor_start_read |
( |
struct ucom_softc * |
ucom | ) |
|
|
static |
◆ uvisor_start_write()
static void uvisor_start_write |
( |
struct ucom_softc * |
ucom | ) |
|
|
static |
◆ uvisor_stop_read()
static void uvisor_stop_read |
( |
struct ucom_softc * |
ucom | ) |
|
|
static |
◆ uvisor_stop_write()
static void uvisor_stop_write |
( |
struct ucom_softc * |
ucom | ) |
|
|
static |
◆ uvisor_write_callback()
Definition at line 610 of file uvisor.c.
References error, uvisor_softc::sc_ucom, ucom_get_data(), USB_ERR_CANCELLED, USB_GET_STATE, USB_ST_SETUP, USB_ST_TRANSFERRED, usbd_transfer_submit(), usbd_xfer_get_frame(), usbd_xfer_set_frame_len(), usbd_xfer_set_frame_offset(), usbd_xfer_set_frames(), usbd_xfer_set_stall(), usbd_xfer_softc(), UVISOROBUFSIZE, and UVISOROFRAMES.
◆ __packed
◆ uvisor_attach
device_attach_t uvisor_attach |
|
static |
◆ uvisor_callback
Initial value:= {
}
static void uvisor_cfg_open(struct ucom_softc *)
static void uvisor_stop_read(struct ucom_softc *)
static void uvisor_start_write(struct ucom_softc *)
static void uvisor_stop_write(struct ucom_softc *)
static void uvisor_cfg_close(struct ucom_softc *)
static void uvisor_free(struct ucom_softc *)
static void uvisor_start_read(struct ucom_softc *)
Definition at line 231 of file uvisor.c.
Referenced by uvisor_attach().
◆ uvisor_config
Initial value:= {
.flags = {.pipe_bof = 1,.force_short_xfer = 1,},
},
.flags = {.pipe_bof = 1,.short_xfer_ok = 1,},
},
}
static usb_callback_t uvisor_read_callback
static usb_callback_t uvisor_write_callback
Definition at line 210 of file uvisor.c.
Referenced by uvisor_attach().
◆ uvisor_detach
device_detach_t uvisor_detach |
|
static |
◆ uvisor_devclass
devclass_t uvisor_devclass |
|
static |
◆ uvisor_devs
◆ uvisor_driver
Initial value:= {
.name = "uvisor",
}
static device_method_t uvisor_methods[]
Definition at line 250 of file uvisor.c.
◆ uvisor_methods
device_method_t uvisor_methods[] |
|
static |
Initial value:= {
DEVMETHOD_END
}
static device_attach_t uvisor_attach
static device_detach_t uvisor_detach
static device_probe_t uvisor_probe
Definition at line 241 of file uvisor.c.
◆ uvisor_probe
device_probe_t uvisor_probe |
|
static |
◆ uvisor_read_callback
◆ uvisor_write_callback