#include <sys/cdefs.h>
#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.
|
| __FBSDID ("$FreeBSD$") |
|
static void | ubser_free_softc (struct ubser_softc *) |
|
static void | ubser_free (struct ucom_softc *) |
|
static int | ubser_pre_param (struct ucom_softc *, struct termios *) |
|
static void | ubser_cfg_set_break (struct ucom_softc *, uint8_t) |
|
static void | ubser_cfg_get_status (struct ucom_softc *, uint8_t *, uint8_t *) |
|
static void | ubser_start_read (struct ucom_softc *) |
|
static void | ubser_stop_read (struct ucom_softc *) |
|
static void | ubser_start_write (struct ucom_softc *) |
|
static void | ubser_stop_write (struct ucom_softc *) |
|
static void | ubser_poll (struct ucom_softc *ucom) |
|
| DRIVER_MODULE (ubser, uhub, ubser_driver, ubser_devclass, NULL, 0) |
|
| MODULE_DEPEND (ubser, ucom, 1, 1, 1) |
|
| MODULE_DEPEND (ubser, usb, 1, 1, 1) |
|
| MODULE_VERSION (ubser, 1) |
|
static int | ubser_probe (device_t dev) |
|
static int | ubser_attach (device_t dev) |
|
static int | ubser_detach (device_t dev) |
|
| UCOM_UNLOAD_DRAIN (ubser) |
|
static __inline void | ubser_inc_tx_unit (struct ubser_softc *sc) |
|
static void | ubser_write_callback (struct usb_xfer *xfer, usb_error_t error) |
|
static void | ubser_read_callback (struct usb_xfer *xfer, usb_error_t error) |
|
◆ UBSER_UNIT_MAX
#define UBSER_UNIT_MAX 32 |
◆ USB_DEBUG_VAR
#define USB_DEBUG_VAR ubser_debug |
◆ VENDOR_CLEAR_BREAK
#define VENDOR_CLEAR_BREAK 0x03 |
◆ VENDOR_GET_NUMSER
#define VENDOR_GET_NUMSER 0x01 |
◆ VENDOR_SET_BREAK
#define VENDOR_SET_BREAK 0x02 |
◆ anonymous enum
Enumerator |
---|
UBSER_BULK_DT_WR | |
UBSER_BULK_DT_RD | |
UBSER_N_TRANSFER | |
Definition at line 120 of file ubser.c.
◆ __FBSDID()
◆ DRIVER_MODULE()
◆ MODULE_DEPEND() [1/2]
MODULE_DEPEND |
( |
ubser |
, |
|
|
ucom |
, |
|
|
1 |
, |
|
|
1 |
, |
|
|
1 |
|
|
) |
| |
◆ MODULE_DEPEND() [2/2]
MODULE_DEPEND |
( |
ubser |
, |
|
|
usb |
, |
|
|
1 |
, |
|
|
1 |
, |
|
|
1 |
|
|
) |
| |
◆ MODULE_VERSION()
MODULE_VERSION |
( |
ubser |
, |
|
|
1 |
|
|
) |
| |
◆ ubser_attach()
static int ubser_attach |
( |
device_t |
dev | ) |
|
|
static |
Definition at line 233 of file ubser.c.
References usbd_lookup_info::bIfaceIndex, usbd_lookup_info::bIfaceNum, dev, usb_attach_arg::device, device_set_usb_desc(), error, usb_attach_arg::info, n, req, ubser_softc::sc_iface_index, ubser_softc::sc_iface_no, ubser_softc::sc_mtx, ubser_softc::sc_numser, ucom_softc::sc_portno, ubser_softc::sc_super_ucom, ubser_softc::sc_tx_size, ubser_softc::sc_ucom, ubser_softc::sc_udev, ubser_softc::sc_xfer, UBSER_BULK_DT_RD, UBSER_BULK_DT_WR, ubser_callback, ubser_config, ubser_detach, UBSER_N_TRANSFER, UBSER_UNIT_MAX, ucom_attach(), ucom_ref(), ucom_set_pnpinfo_usb(), USB_DEFAULT_TIMEOUT, usbd_do_request_flags(), usbd_errstr(), usbd_transfer_setup(), usbd_transfer_start(), usbd_xfer_max_len(), usbd_xfer_set_stall(), USETW, UT_READ_VENDOR_INTERFACE, and VENDOR_GET_NUMSER.
◆ ubser_cfg_get_status()
static void ubser_cfg_get_status |
( |
struct ucom_softc * |
ucom, |
|
|
uint8_t * |
lsr, |
|
|
uint8_t * |
msr |
|
) |
| |
|
static |
◆ ubser_cfg_set_break()
static void ubser_cfg_set_break |
( |
struct ucom_softc * |
ucom, |
|
|
uint8_t |
onoff |
|
) |
| |
|
static |
◆ ubser_detach()
static int ubser_detach |
( |
device_t |
dev | ) |
|
|
static |
◆ ubser_free()
static void ubser_free |
( |
struct ucom_softc * |
ucom | ) |
|
|
static |
◆ ubser_free_softc()
static void ubser_free_softc |
( |
struct ubser_softc * |
sc | ) |
|
|
static |
◆ ubser_inc_tx_unit()
static __inline void ubser_inc_tx_unit |
( |
struct ubser_softc * |
sc | ) |
|
|
static |
◆ ubser_poll()
static void ubser_poll |
( |
struct ucom_softc * |
ucom | ) |
|
|
static |
◆ ubser_pre_param()
static int ubser_pre_param |
( |
struct ucom_softc * |
ucom, |
|
|
struct termios * |
t |
|
) |
| |
|
static |
◆ ubser_probe()
static int ubser_probe |
( |
device_t |
dev | ) |
|
|
static |
◆ ubser_read_callback()
Definition at line 446 of file ubser.c.
References DPRINTF, error, ubser_softc::sc_numser, ubser_softc::sc_ucom, ucom_put_data(), USB_ERR_CANCELLED, USB_GET_STATE, USB_ST_SETUP, USB_ST_TRANSFERRED, usbd_copy_out(), 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().
◆ ubser_start_read()
static void ubser_start_read |
( |
struct ucom_softc * |
ucom | ) |
|
|
static |
◆ ubser_start_write()
static void ubser_start_write |
( |
struct ucom_softc * |
ucom | ) |
|
|
static |
◆ ubser_stop_read()
static void ubser_stop_read |
( |
struct ucom_softc * |
ucom | ) |
|
|
static |
◆ ubser_stop_write()
static void ubser_stop_write |
( |
struct ucom_softc * |
ucom | ) |
|
|
static |
◆ ubser_write_callback()
Definition at line 401 of file ubser.c.
References error, ubser_softc::sc_curr_tx_unit, ubser_softc::sc_tx_size, ubser_softc::sc_ucom, ubser_inc_tx_unit(), ucom_get_data(), USB_ERR_CANCELLED, USB_GET_STATE, USB_ST_SETUP, USB_ST_TRANSFERRED, usbd_copy_in(), usbd_transfer_submit(), usbd_xfer_get_frame(), usbd_xfer_set_frame_len(), usbd_xfer_set_stall(), and usbd_xfer_softc().
◆ UCOM_UNLOAD_DRAIN()
UCOM_UNLOAD_DRAIN |
( |
ubser |
| ) |
|
◆ ubser_attach
device_attach_t ubser_attach |
|
static |
◆ ubser_callback
Initial value:= {
}
static void ubser_stop_read(struct ucom_softc *)
static void ubser_cfg_set_break(struct ucom_softc *, uint8_t)
static void ubser_free(struct ucom_softc *)
static void ubser_start_write(struct ucom_softc *)
static int ubser_pre_param(struct ucom_softc *, struct termios *)
static void ubser_stop_write(struct ucom_softc *)
static void ubser_cfg_get_status(struct ucom_softc *, uint8_t *, uint8_t *)
static void ubser_start_read(struct ucom_softc *)
static void ubser_poll(struct ucom_softc *ucom)
Definition at line 183 of file ubser.c.
Referenced by ubser_attach().
◆ ubser_config
Initial value:= {
.bufsize = 0,
.flags = {.pipe_bof = 1,.force_short_xfer = 1,},
},
.bufsize = 0,
.flags = {.pipe_bof = 1,.short_xfer_ok = 1,},
},
}
static usb_callback_t ubser_write_callback
static usb_callback_t ubser_read_callback
Definition at line 163 of file ubser.c.
Referenced by ubser_attach().
◆ ubser_detach
device_detach_t ubser_detach |
|
static |
◆ ubser_devclass
devclass_t ubser_devclass |
|
static |
◆ ubser_driver
Initial value:= {
.name = "ubser",
}
static device_method_t ubser_methods[]
Definition at line 204 of file ubser.c.
◆ ubser_methods
device_method_t ubser_methods[] |
|
static |
Initial value:= {
DEVMETHOD_END
}
static device_probe_t ubser_probe
static device_attach_t ubser_attach
static device_detach_t ubser_detach
Definition at line 195 of file ubser.c.
◆ ubser_probe
device_probe_t ubser_probe |
|
static |
◆ ubser_read_callback
◆ ubser_write_callback