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/hid/hid.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.
Data Structures | |
struct | ucycom_softc |
Macros | |
#define | USB_DEBUG_VAR usb_debug |
#define | UCYCOM_MAX_IOLEN (1024 + 2) /* bytes */ |
#define | UCYCOM_IFACE_INDEX 0 |
#define | MODEL_CY7C63743 0x63743 |
#define | MODEL_CY7C64013 0x64013 |
#define | UCYCOM_CFG_RESET 0x80 |
#define | UCYCOM_CFG_PARODD 0x20 |
#define | UCYCOM_CFG_PAREN 0x10 |
#define | UCYCOM_CFG_STOPB 0x08 |
#define | UCYCOM_CFG_DATAB 0x03 |
#define | UCYCOM_DEFAULT_RATE 4800 |
#define | UCYCOM_DEFAULT_CFG 0x03 /* N-8-1 */ |
Enumerations | |
enum | { UCYCOM_CTRL_RD , UCYCOM_INTR_RD , UCYCOM_N_TRANSFER } |
Functions | |
__FBSDID ("$FreeBSD$") | |
static void | ucycom_free_softc (struct ucycom_softc *) |
static void | ucycom_free (struct ucom_softc *) |
static void | ucycom_cfg_open (struct ucom_softc *) |
static void | ucycom_start_read (struct ucom_softc *) |
static void | ucycom_stop_read (struct ucom_softc *) |
static void | ucycom_start_write (struct ucom_softc *) |
static void | ucycom_stop_write (struct ucom_softc *) |
static void | ucycom_cfg_write (struct ucycom_softc *, uint32_t, uint8_t) |
static int | ucycom_pre_param (struct ucom_softc *, struct termios *) |
static void | ucycom_cfg_param (struct ucom_softc *, struct termios *) |
static void | ucycom_poll (struct ucom_softc *ucom) |
DRIVER_MODULE (ucycom, uhub, ucycom_driver, ucycom_devclass, NULL, 0) | |
MODULE_DEPEND (ucycom, ucom, 1, 1, 1) | |
MODULE_DEPEND (ucycom, usb, 1, 1, 1) | |
MODULE_DEPEND (ucycom, hid, 1, 1, 1) | |
MODULE_VERSION (ucycom, 1) | |
USB_PNP_HOST_INFO (ucycom_devs) | |
static int | ucycom_probe (device_t dev) |
static int | ucycom_attach (device_t dev) |
static int | ucycom_detach (device_t dev) |
UCOM_UNLOAD_DRAIN (ucycom) | |
static void | ucycom_ctrl_write_callback (struct usb_xfer *xfer, usb_error_t error) |
static void | ucycom_intr_read_callback (struct usb_xfer *xfer, usb_error_t error) |
Variables | |
static device_probe_t | ucycom_probe |
static device_attach_t | ucycom_attach |
static device_detach_t | ucycom_detach |
static usb_callback_t | ucycom_ctrl_write_callback |
static usb_callback_t | ucycom_intr_read_callback |
static const struct usb_config | ucycom_config [UCYCOM_N_TRANSFER] |
static const struct ucom_callback | ucycom_callback |
static device_method_t | ucycom_methods [] |
static devclass_t | ucycom_devclass |
static driver_t | ucycom_driver |
static const STRUCT_USB_HOST_ID | ucycom_devs [] |
anonymous enum |
__FBSDID | ( | "$FreeBSD$" | ) |
DRIVER_MODULE | ( | ucycom | , |
uhub | , | ||
ucycom_driver | , | ||
ucycom_devclass | , | ||
NULL | , | ||
0 | |||
) |
MODULE_DEPEND | ( | ucycom | , |
hid | , | ||
1 | , | ||
1 | , | ||
1 | |||
) |
MODULE_DEPEND | ( | ucycom | , |
ucom | , | ||
1 | , | ||
1 | , | ||
1 | |||
) |
MODULE_DEPEND | ( | ucycom | , |
usb | , | ||
1 | , | ||
1 | , | ||
1 | |||
) |
MODULE_VERSION | ( | ucycom | , |
1 | |||
) |
UCOM_UNLOAD_DRAIN | ( | ucycom | ) |
|
static |
Definition at line 215 of file ucycom.c.
References usbd_lookup_info::bIfaceNum, dev, usb_attach_arg::device, device_set_usb_desc(), DPRINTF, error, usb_attach_arg::info, ucycom_softc::sc_fid, ucycom_softc::sc_flen, ucycom_softc::sc_iface_no, ucycom_softc::sc_iid, ucycom_softc::sc_ilen, ucycom_softc::sc_model, ucycom_softc::sc_mtx, ucycom_softc::sc_oid, ucycom_softc::sc_olen, ucycom_softc::sc_super_ucom, ucycom_softc::sc_ucom, ucycom_softc::sc_udev, ucycom_softc::sc_xfer, ucom_attach(), ucom_ref(), ucom_set_pnpinfo_usb(), ucycom_callback, ucycom_config, ucycom_detach, UCYCOM_IFACE_INDEX, UCYCOM_MAX_IOLEN, UCYCOM_N_TRANSFER, USB_GET_DRIVER_INFO, usbd_errstr(), usbd_req_get_hid_desc(), and usbd_transfer_setup().
|
static |
Definition at line 331 of file ucycom.c.
References ucom_softc::sc_parent, ucycom_cfg_write(), UCYCOM_DEFAULT_CFG, and UCYCOM_DEFAULT_RATE.
|
static |
Definition at line 505 of file ucycom.c.
References DPRINTF, ucycom_softc::sc_cfg, ucom_softc::sc_parent, UCYCOM_CFG_PAREN, UCYCOM_CFG_PARODD, UCYCOM_CFG_STOPB, and ucycom_cfg_write().
|
static |
Definition at line 443 of file ucycom.c.
References len, req, ucycom_softc::sc_cfg, ucycom_softc::sc_fid, ucycom_softc::sc_flen, ucycom_softc::sc_iface_no, ucycom_softc::sc_temp_cfg, ucycom_softc::sc_ucom, ucycom_softc::sc_udev, ucom_cfg_do_request, UHID_FEATURE_REPORT, UR_SET_REPORT, usbd_errstr(), USETW, USETW2, and UT_WRITE_CLASS_INTERFACE.
Referenced by ucycom_cfg_open(), and ucycom_cfg_param().
|
static |
Definition at line 372 of file ucycom.c.
References data, DPRINTF, error, MODEL_CY7C63743, MODEL_CY7C64013, offset, req, ucycom_softc::sc_iface_no, ucycom_softc::sc_model, ucycom_softc::sc_oid, ucycom_softc::sc_olen, ucycom_softc::sc_ucom, ucom_get_data(), UHID_OUTPUT_REPORT, UR_SET_REPORT, USB_ERR_CANCELLED, USB_GET_STATE, USB_ST_SETUP, USB_ST_TRANSFERRED, usbd_copy_in(), usbd_errstr(), usbd_transfer_submit(), usbd_xfer_get_frame(), usbd_xfer_set_frame_len(), usbd_xfer_set_frames(), usbd_xfer_softc(), USETW, USETW2, and UT_WRITE_CLASS_INTERFACE.
|
static |
Definition at line 299 of file ucycom.c.
References dev, ucycom_softc::sc_super_ucom, ucycom_softc::sc_ucom, ucycom_softc::sc_xfer, ucom_detach(), ucycom_free_softc(), UCYCOM_N_TRANSFER, and usbd_transfer_unsetup().
|
static |
Definition at line 325 of file ucycom.c.
References ucom_softc::sc_parent, and ucycom_free_softc().
|
static |
Definition at line 316 of file ucycom.c.
References ucycom_softc::sc_mtx, ucycom_softc::sc_super_ucom, and ucom_unref().
Referenced by ucycom_detach(), and ucycom_free().
|
static |
Definition at line 540 of file ucycom.c.
References error, len, MODEL_CY7C63743, MODEL_CY7C64013, offset, ucycom_softc::sc_ilen, ucycom_softc::sc_ist, ucycom_softc::sc_model, ucycom_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_set_frame_len(), usbd_xfer_set_stall(), usbd_xfer_softc(), and usbd_xfer_status().
|
static |
Definition at line 610 of file ucycom.c.
References ucom_softc::sc_parent, ucycom_softc::sc_xfer, UCYCOM_N_TRANSFER, and usbd_transfer_poll().
|
static |
|
static |
Definition at line 198 of file ucycom.c.
References usbd_lookup_info::bConfigIndex, usbd_lookup_info::bIfaceIndex, dev, usb_attach_arg::info, ucycom_devs, UCYCOM_IFACE_INDEX, usb_attach_arg::usb_mode, USB_MODE_HOST, and usbd_lookup_id_by_uaa().
|
static |
Definition at line 340 of file ucycom.c.
References ucom_softc::sc_parent, ucycom_softc::sc_xfer, UCYCOM_INTR_RD, and usbd_transfer_start().
|
static |
Definition at line 356 of file ucycom.c.
References ucom_softc::sc_parent, ucycom_softc::sc_xfer, UCYCOM_CTRL_RD, and usbd_transfer_start().
|
static |
Definition at line 348 of file ucycom.c.
References ucom_softc::sc_parent, ucycom_softc::sc_xfer, UCYCOM_INTR_RD, and usbd_transfer_stop().
|
static |
Definition at line 364 of file ucycom.c.
References ucom_softc::sc_parent, ucycom_softc::sc_xfer, UCYCOM_CTRL_RD, and usbd_transfer_stop().
USB_PNP_HOST_INFO | ( | ucycom_devs | ) |
|
static |
Definition at line 153 of file ucycom.c.
Referenced by ucycom_attach().
|
static |
Definition at line 133 of file ucycom.c.
Referenced by ucycom_attach().
|
static |
|
static |
Definition at line 116 of file ucycom.c.
Referenced by ucycom_attach().
|
static |
Definition at line 183 of file ucycom.c.
Referenced by ucycom_probe().
|
static |
|
static |
|
static |