FreeBSD kernel usb device Code
|
#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.
Data Structures | |
struct | umct_softc |
Macros | |
#define | USB_DEBUG_VAR usb_debug |
#define | UMCT_GET_MSR 2 /* Get Modem Status Register */ |
#define | UMCT_GET_MSR_SIZE 1 |
#define | UMCT_GET_LCR 6 /* Get Line Control Register */ |
#define | UMCT_GET_LCR_SIZE 1 |
#define | UMCT_SET_BAUD 5 /* Set the Baud Rate Divisor */ |
#define | UMCT_SET_BAUD_SIZE 4 |
#define | UMCT_SET_LCR 7 /* Set Line Control Register */ |
#define | UMCT_SET_LCR_SIZE 1 |
#define | UMCT_SET_MCR 10 /* Set Modem Control Register */ |
#define | UMCT_SET_MCR_SIZE 1 |
#define | UMCT_MSR_CTS_CHG 0x01 |
#define | UMCT_MSR_DSR_CHG 0x02 |
#define | UMCT_MSR_RI_CHG 0x04 |
#define | UMCT_MSR_CD_CHG 0x08 |
#define | UMCT_MSR_CTS 0x10 |
#define | UMCT_MSR_RTS 0x20 |
#define | UMCT_MSR_RI 0x40 |
#define | UMCT_MSR_CD 0x80 |
#define | UMCT_INTR_INTERVAL 100 |
#define | UMCT_IFACE_INDEX 0 |
#define | UMCT_CONFIG_INDEX 0 |
Enumerations | |
enum | { UMCT_BULK_DT_WR , UMCT_BULK_DT_RD , UMCT_INTR_DT_RD , UMCT_N_TRANSFER } |
Functions | |
__FBSDID ("$FreeBSD$") | |
static void | umct_free_softc (struct umct_softc *) |
static void | umct_cfg_do_request (struct umct_softc *sc, uint8_t request, uint16_t len, uint32_t value) |
static void | umct_free (struct ucom_softc *) |
static void | umct_cfg_get_status (struct ucom_softc *, uint8_t *, uint8_t *) |
static void | umct_cfg_set_break (struct ucom_softc *, uint8_t) |
static void | umct_cfg_set_dtr (struct ucom_softc *, uint8_t) |
static void | umct_cfg_set_rts (struct ucom_softc *, uint8_t) |
static uint8_t | umct_calc_baud (uint32_t) |
static int | umct_pre_param (struct ucom_softc *, struct termios *) |
static void | umct_cfg_param (struct ucom_softc *, struct termios *) |
static void | umct_start_read (struct ucom_softc *) |
static void | umct_stop_read (struct ucom_softc *) |
static void | umct_start_write (struct ucom_softc *) |
static void | umct_stop_write (struct ucom_softc *) |
static void | umct_poll (struct ucom_softc *ucom) |
DRIVER_MODULE (umct, uhub, umct_driver, umct_devclass, NULL, 0) | |
MODULE_DEPEND (umct, ucom, 1, 1, 1) | |
MODULE_DEPEND (umct, usb, 1, 1, 1) | |
MODULE_VERSION (umct, 1) | |
USB_PNP_HOST_INFO (umct_devs) | |
static int | umct_probe (device_t dev) |
static int | umct_attach (device_t dev) |
static int | umct_detach (device_t dev) |
UCOM_UNLOAD_DRAIN (umct) | |
static void | umct_intr_callback_sub (struct usb_xfer *xfer, usb_error_t error) |
static void | umct_read_callback (struct usb_xfer *xfer, usb_error_t error) |
static void | umct_intr_callback (struct usb_xfer *xfer, usb_error_t error) |
static void | umct_write_callback (struct usb_xfer *xfer, usb_error_t error) |
static void | umct_read_callback_sub (struct usb_xfer *xfer, usb_error_t error) |
Variables | |
static device_probe_t | umct_probe |
static device_attach_t | umct_attach |
static device_detach_t | umct_detach |
static usb_callback_t | umct_intr_callback |
static usb_callback_t | umct_intr_callback_sub |
static usb_callback_t | umct_read_callback |
static usb_callback_t | umct_read_callback_sub |
static usb_callback_t | umct_write_callback |
static const struct usb_config | umct_config [UMCT_N_TRANSFER] |
static const struct ucom_callback | umct_callback |
static const STRUCT_USB_HOST_ID | umct_devs [] |
static device_method_t | umct_methods [] |
static devclass_t | umct_devclass |
static driver_t | umct_driver |
anonymous enum |
__FBSDID | ( | "$FreeBSD$" | ) |
DRIVER_MODULE | ( | umct | , |
uhub | , | ||
umct_driver | , | ||
umct_devclass | , | ||
NULL | , | ||
0 | |||
) |
MODULE_DEPEND | ( | umct | , |
ucom | , | ||
1 | , | ||
1 | , | ||
1 | |||
) |
MODULE_DEPEND | ( | umct | , |
usb | , | ||
1 | , | ||
1 | , | ||
1 | |||
) |
MODULE_VERSION | ( | umct | , |
1 | |||
) |
UCOM_UNLOAD_DRAIN | ( | umct | ) |
|
static |
Definition at line 254 of file umct.c.
References usbd_lookup_info::bIfaceNum, dev, usb_attach_arg::device, device_set_usb_desc(), error, usbd_lookup_info::idProduct, usb_attach_arg::info, umct_softc::sc_iface_no, umct_softc::sc_mtx, umct_softc::sc_obufsize, umct_softc::sc_super_ucom, umct_softc::sc_swap_cb, umct_softc::sc_ucom, umct_softc::sc_udev, umct_softc::sc_unit, umct_softc::sc_xfer, ucom_attach(), ucom_ref(), ucom_set_pnpinfo_usb(), UMCT_BULK_DT_RD, UMCT_BULK_DT_WR, umct_callback, umct_config, umct_detach, UMCT_IFACE_INDEX, UMCT_INTR_DT_RD, UMCT_N_TRANSFER, usbd_transfer_setup(), usbd_xfer_max_framelen(), and usbd_xfer_max_len().
|
static |
Definition at line 478 of file umct.c.
Referenced by umct_cfg_param().
|
static |
Definition at line 351 of file umct.c.
References len, req, umct_softc::sc_iface_no, umct_softc::sc_ucom, umct_softc::sc_udev, ucom_cfg_do_request, usbd_errstr(), USETDW, USETW, UT_WRITE_VENDOR_DEVICE, and value.
Referenced by umct_cfg_param(), umct_cfg_set_break(), umct_cfg_set_dtr(), and umct_cfg_set_rts().
|
static |
Definition at line 430 of file umct.c.
References umct_softc::sc_lsr, umct_softc::sc_msr, and ucom_softc::sc_parent.
|
static |
Definition at line 515 of file umct.c.
References umct_softc::sc_lcr, ucom_softc::sc_parent, umct_calc_baud(), umct_cfg_do_request(), UMCT_SET_BAUD, UMCT_SET_BAUD_SIZE, UMCT_SET_LCR, UMCT_SET_LCR_SIZE, and value.
|
static |
Definition at line 439 of file umct.c.
References umct_softc::sc_lcr, ucom_softc::sc_parent, umct_cfg_do_request(), UMCT_SET_LCR, and UMCT_SET_LCR_SIZE.
|
static |
Definition at line 452 of file umct.c.
References umct_softc::sc_mcr, ucom_softc::sc_parent, umct_cfg_do_request(), UMCT_SET_MCR, and UMCT_SET_MCR_SIZE.
|
static |
Definition at line 465 of file umct.c.
References umct_softc::sc_mcr, ucom_softc::sc_parent, umct_cfg_do_request(), UMCT_SET_MCR, and UMCT_SET_MCR_SIZE.
|
static |
Definition at line 319 of file umct.c.
References dev, umct_softc::sc_super_ucom, umct_softc::sc_ucom, umct_softc::sc_xfer, ucom_detach(), umct_free_softc(), UMCT_N_TRANSFER, and usbd_transfer_unsetup().
|
static |
Definition at line 345 of file umct.c.
References ucom_softc::sc_parent, and umct_free_softc().
|
static |
Definition at line 336 of file umct.c.
References umct_softc::sc_mtx, umct_softc::sc_super_ucom, and ucom_unref().
Referenced by umct_detach(), and umct_free().
|
static |
Definition at line 607 of file umct.c.
References error, umct_softc::sc_swap_cb, umct_intr_callback_sub, umct_read_callback_sub, and usbd_xfer_softc().
|
static |
Definition at line 378 of file umct.c.
References DPRINTF, error, umct_softc::sc_lsr, umct_softc::sc_msr, umct_softc::sc_ucom, ucom_status_change(), UMCT_MSR_CD, UMCT_MSR_CTS, UMCT_MSR_RI, UMCT_MSR_RTS, 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().
|
static |
Definition at line 677 of file umct.c.
References ucom_softc::sc_parent, umct_softc::sc_xfer, UMCT_N_TRANSFER, and usbd_transfer_poll().
|
static |
|
static |
Definition at line 237 of file umct.c.
References usbd_lookup_info::bConfigIndex, usbd_lookup_info::bIfaceIndex, dev, usb_attach_arg::info, UMCT_CONFIG_INDEX, umct_devs, UMCT_IFACE_INDEX, usb_attach_arg::usb_mode, USB_MODE_HOST, and usbd_lookup_id_by_uaa().
|
static |
Definition at line 596 of file umct.c.
References error, umct_softc::sc_swap_cb, umct_intr_callback_sub, umct_read_callback_sub, and usbd_xfer_softc().
|
static |
Definition at line 647 of file umct.c.
References error, umct_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().
|
static |
Definition at line 556 of file umct.c.
References ucom_softc::sc_parent, umct_softc::sc_xfer, UMCT_BULK_DT_RD, UMCT_INTR_DT_RD, and usbd_transfer_start().
|
static |
Definition at line 580 of file umct.c.
References ucom_softc::sc_parent, umct_softc::sc_xfer, UMCT_BULK_DT_WR, and usbd_transfer_start().
|
static |
Definition at line 568 of file umct.c.
References ucom_softc::sc_parent, umct_softc::sc_xfer, UMCT_BULK_DT_RD, UMCT_INTR_DT_RD, and usbd_transfer_stop().
|
static |
Definition at line 588 of file umct.c.
References ucom_softc::sc_parent, umct_softc::sc_xfer, UMCT_BULK_DT_WR, and usbd_transfer_stop().
|
static |
Definition at line 618 of file umct.c.
References error, umct_softc::sc_obufsize, umct_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_stall(), and usbd_xfer_softc().
USB_PNP_HOST_INFO | ( | umct_devs | ) |
|
static |
Definition at line 192 of file umct.c.
Referenced by umct_attach().
|
static |
Definition at line 161 of file umct.c.
Referenced by umct_attach().
|
static |
Definition at line 135 of file umct.c.
Referenced by umct_attach().
|
static |
Definition at line 207 of file umct.c.
Referenced by umct_probe().
|
static |
|
static |
|
static |
Definition at line 139 of file umct.c.
Referenced by umct_intr_callback(), and umct_read_callback().
|
static |
|
static |
|
static |
Definition at line 141 of file umct.c.
Referenced by umct_intr_callback(), and umct_read_callback().
|
static |