#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 <dev/usb/usbhid.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 | uark_free_softc (struct uark_softc *) |
|
static void | uark_free (struct ucom_softc *) |
|
static void | uark_start_read (struct ucom_softc *) |
|
static void | uark_stop_read (struct ucom_softc *) |
|
static void | uark_start_write (struct ucom_softc *) |
|
static void | uark_stop_write (struct ucom_softc *) |
|
static int | uark_pre_param (struct ucom_softc *, struct termios *) |
|
static void | uark_cfg_param (struct ucom_softc *, struct termios *) |
|
static void | uark_cfg_get_status (struct ucom_softc *, uint8_t *, uint8_t *) |
|
static void | uark_cfg_set_break (struct ucom_softc *, uint8_t) |
|
static void | uark_cfg_write (struct uark_softc *, uint16_t, uint16_t) |
|
static void | uark_poll (struct ucom_softc *ucom) |
|
| DRIVER_MODULE (uark, uhub, uark_driver, uark_devclass, NULL, 0) |
|
| MODULE_DEPEND (uark, ucom, 1, 1, 1) |
|
| MODULE_DEPEND (uark, usb, 1, 1, 1) |
|
| MODULE_VERSION (uark, 1) |
|
| USB_PNP_HOST_INFO (uark_devs) |
|
static int | uark_probe (device_t dev) |
|
static int | uark_attach (device_t dev) |
|
static int | uark_detach (device_t dev) |
|
| UCOM_UNLOAD_DRAIN (uark) |
|
static void | uark_bulk_write_callback (struct usb_xfer *xfer, usb_error_t error) |
|
static void | uark_bulk_read_callback (struct usb_xfer *xfer, usb_error_t error) |
|
◆ UARK_BAUD_REF
#define UARK_BAUD_REF 3000000 |
◆ UARK_BUF_SIZE
#define UARK_BUF_SIZE 1024 /* bytes */ |
◆ UARK_CONFIG_INDEX
#define UARK_CONFIG_INDEX 0 |
◆ UARK_IFACE_INDEX
#define UARK_IFACE_INDEX 0 |
◆ UARK_PARITY_EVEN
#define UARK_PARITY_EVEN 0x18 |
◆ UARK_PARITY_NONE
#define UARK_PARITY_NONE 0x00 |
◆ UARK_PARITY_ODD
#define UARK_PARITY_ODD 0x08 |
◆ UARK_READ
◆ UARK_REQUEST
#define UARK_REQUEST 0xfe |
◆ UARK_SET_DATA_BITS
#define UARK_SET_DATA_BITS |
( |
|
x | ) |
((x) - 5) |
◆ UARK_STOP_BITS_1
#define UARK_STOP_BITS_1 0x00 |
◆ UARK_STOP_BITS_2
#define UARK_STOP_BITS_2 0x04 |
◆ UARK_WRITE
◆ USB_DEBUG_VAR
◆ anonymous enum
Enumerator |
---|
UARK_BULK_DT_WR | |
UARK_BULK_DT_RD | |
UARK_N_TRANSFER | |
Definition at line 78 of file uark.c.
◆ DRIVER_MODULE()
◆ MODULE_DEPEND() [1/2]
MODULE_DEPEND |
( |
uark |
, |
|
|
ucom |
, |
|
|
1 |
, |
|
|
1 |
, |
|
|
1 |
|
|
) |
| |
◆ MODULE_DEPEND() [2/2]
MODULE_DEPEND |
( |
uark |
, |
|
|
usb |
, |
|
|
1 |
, |
|
|
1 |
, |
|
|
1 |
|
|
) |
| |
◆ MODULE_VERSION()
MODULE_VERSION |
( |
uark |
, |
|
|
1 |
|
|
) |
| |
◆ uark_attach()
static int uark_attach |
( |
device_t |
dev | ) |
|
|
static |
Definition at line 197 of file uark.c.
References dev, usb_attach_arg::device, device_set_usb_desc(), DPRINTF, error, uark_softc::sc_mtx, uark_softc::sc_super_ucom, uark_softc::sc_ucom, uark_softc::sc_udev, uark_softc::sc_xfer, UARK_BULK_DT_RD, UARK_BULK_DT_WR, uark_callback, uark_detach, UARK_IFACE_INDEX, UARK_N_TRANSFER, uark_xfer_config, ucom_attach(), ucom_ref(), ucom_set_pnpinfo_usb(), usbd_transfer_setup(), and usbd_xfer_set_stall().
◆ uark_bulk_read_callback()
Definition at line 303 of file uark.c.
References error, uark_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().
◆ uark_bulk_write_callback()
Definition at line 274 of file uark.c.
References error, uark_softc::sc_ucom, UARK_BUF_SIZE, 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_stall(), and usbd_xfer_softc().
◆ uark_cfg_get_status()
static void uark_cfg_get_status |
( |
struct ucom_softc * |
ucom, |
|
|
uint8_t * |
lsr, |
|
|
uint8_t * |
msr |
|
) |
| |
|
static |
◆ uark_cfg_param()
static void uark_cfg_param |
( |
struct ucom_softc * |
ucom, |
|
|
struct termios * |
t |
|
) |
| |
|
static |
◆ uark_cfg_set_break()
static void uark_cfg_set_break |
( |
struct ucom_softc * |
ucom, |
|
|
uint8_t |
onoff |
|
) |
| |
|
static |
◆ uark_cfg_write()
static void uark_cfg_write |
( |
struct uark_softc * |
sc, |
|
|
uint16_t |
index, |
|
|
uint16_t |
value |
|
) |
| |
|
static |
Definition at line 443 of file uark.c.
References index, req, uark_softc::sc_ucom, uark_softc::sc_udev, UARK_REQUEST, UARK_WRITE, ucom_cfg_do_request, usbd_errstr(), USETW, and value.
Referenced by uark_cfg_param(), and uark_cfg_set_break().
◆ uark_detach()
static int uark_detach |
( |
device_t |
dev | ) |
|
|
static |
◆ uark_free()
◆ uark_free_softc()
static void uark_free_softc |
( |
struct uark_softc * |
sc | ) |
|
|
static |
◆ uark_poll()
◆ uark_pre_param()
static int uark_pre_param |
( |
struct ucom_softc * |
ucom, |
|
|
struct termios * |
t |
|
) |
| |
|
static |
◆ uark_probe()
static int uark_probe |
( |
device_t |
dev | ) |
|
|
static |
◆ uark_start_read()
static void uark_start_read |
( |
struct ucom_softc * |
ucom | ) |
|
|
static |
◆ uark_start_write()
static void uark_start_write |
( |
struct ucom_softc * |
ucom | ) |
|
|
static |
◆ uark_stop_read()
static void uark_stop_read |
( |
struct ucom_softc * |
ucom | ) |
|
|
static |
◆ uark_stop_write()
static void uark_stop_write |
( |
struct ucom_softc * |
ucom | ) |
|
|
static |
◆ UCOM_UNLOAD_DRAIN()
UCOM_UNLOAD_DRAIN |
( |
uark |
| ) |
|
◆ USB_PNP_HOST_INFO()
◆ uark_attach
device_attach_t uark_attach |
|
static |
◆ uark_bulk_read_callback
◆ uark_bulk_write_callback
◆ uark_callback
Initial value:= {
}
static void uark_cfg_param(struct ucom_softc *, struct termios *)
static void uark_stop_write(struct ucom_softc *)
static void uark_start_read(struct ucom_softc *)
static void uark_start_write(struct ucom_softc *)
static void uark_free(struct ucom_softc *)
static void uark_poll(struct ucom_softc *ucom)
static void uark_cfg_get_status(struct ucom_softc *, uint8_t *, uint8_t *)
static void uark_cfg_set_break(struct ucom_softc *, uint8_t)
static int uark_pre_param(struct ucom_softc *, struct termios *)
static void uark_stop_read(struct ucom_softc *)
Definition at line 140 of file uark.c.
Referenced by uark_attach().
◆ uark_detach
device_detach_t uark_detach |
|
static |
◆ uark_devclass
◆ uark_devs
Initial value:= {
{
USB_VPI(USB_VENDOR_ARKMICRO, USB_PRODUCT_ARKMICRO_ARK3116, 0)},
}
#define USB_VPI(vend, prod, info)
Definition at line 169 of file uark.c.
Referenced by uark_probe().
◆ uark_driver
Initial value:= {
.name = "uark",
}
static device_method_t uark_methods[]
Definition at line 163 of file uark.c.
◆ uark_methods
device_method_t uark_methods[] |
|
static |
Initial value:= {
DEVMETHOD_END
}
static device_detach_t uark_detach
static device_probe_t uark_probe
static device_attach_t uark_attach
Definition at line 153 of file uark.c.
◆ uark_probe
device_probe_t uark_probe |
|
static |
◆ uark_xfer_config
Initial value:= {
.flags = {.pipe_bof = 1,.force_short_xfer = 1,},
},
.flags = {.pipe_bof = 1,.short_xfer_ok = 1,},
},
}
static usb_callback_t uark_bulk_write_callback
static usb_callback_t uark_bulk_read_callback
Definition at line 120 of file uark.c.
Referenced by uark_attach().