FreeBSD kernel usb device Code
|
#include <sys/cdefs.h>
#include <sys/gsb_crc32.h>
#include <sys/eventhandler.h>
#include <sys/stdint.h>
#include <sys/stddef.h>
#include <sys/queue.h>
#include <sys/systm.h>
#include <sys/socket.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 <net/if.h>
#include <net/if_var.h>
#include <dev/usb/usb.h>
#include <dev/usb/usbdi.h>
#include <dev/usb/usbdi_util.h>
#include <dev/usb/usb_cdc.h>
#include "usbdevs.h"
#include <dev/usb/usb_debug.h>
#include <dev/usb/usb_process.h>
#include <dev/usb/usb_msctest.h>
#include "usb_if.h"
#include <dev/usb/net/usb_ethernet.h>
#include <dev/usb/net/if_cdcereg.h>
Go to the source code of this file.
Macros | |
#define | USB_DEBUG_VAR cdce_debug |
#define | cdce_debug 0 |
Functions | |
__FBSDID ("$FreeBSD$") | |
static int | cdce_attach_post_sub (struct usb_ether *) |
static int | cdce_ioctl (struct ifnet *, u_long, caddr_t) |
static int | cdce_media_change_cb (struct ifnet *) |
static void | cdce_media_status_cb (struct ifnet *, struct ifmediareq *) |
static uint32_t | cdce_m_crc32 (struct mbuf *, uint32_t, uint32_t) |
static void | cdce_set_filter (struct usb_ether *) |
static int | cdce_driver_loaded (struct module *, int, void *) |
DRIVER_MODULE (cdce, uhub, cdce_driver, cdce_devclass, cdce_driver_loaded, 0) | |
MODULE_VERSION (cdce, 1) | |
MODULE_DEPEND (cdce, uether, 1, 1, 1) | |
MODULE_DEPEND (cdce, usb, 1, 1, 1) | |
MODULE_DEPEND (cdce, ether, 1, 1, 1) | |
USB_PNP_DEVICE_INFO (cdce_switch_devs) | |
USB_PNP_HOST_INFO (cdce_host_devs) | |
USB_PNP_DUAL_INFO (cdce_dual_devs) | |
static void | cdce_test_autoinst (void *arg, struct usb_device *udev, struct usb_attach_arg *uaa) |
static int | cdce_probe (device_t dev) |
static void | cdce_attach_post (struct usb_ether *ue) |
static int | cdce_attach (device_t dev) |
static int | cdce_detach (device_t dev) |
static void | cdce_start (struct usb_ether *ue) |
static void | cdce_free_queue (struct mbuf **ppm, uint8_t n) |
static void | cdce_bulk_write_callback (struct usb_xfer *xfer, usb_error_t error) |
static int32_t | cdce_m_crc32_cb (void *arg, void *src, uint32_t count) |
static void | cdce_init (struct usb_ether *ue) |
static void | cdce_stop (struct usb_ether *ue) |
static void | cdce_setmulti (struct usb_ether *ue) |
static void | cdce_setpromisc (struct usb_ether *ue) |
static int | cdce_suspend (device_t dev) |
static int | cdce_resume (device_t dev) |
static void | cdce_bulk_read_callback (struct usb_xfer *xfer, usb_error_t error) |
static void | cdce_intr_read_callback (struct usb_xfer *xfer, usb_error_t error) |
static void | cdce_intr_write_callback (struct usb_xfer *xfer, usb_error_t error) |
static int | cdce_handle_request (device_t dev, const void *preq, void **pptr, uint16_t *plen, uint16_t offset, uint8_t *pstate) |
#define USB_DEBUG_VAR cdce_debug |
__FBSDID | ( | "$FreeBSD$" | ) |
|
static |
Definition at line 605 of file if_cdce.c.
References usbd_lookup_info::bIfaceIndex, usb_cdc_union_descriptor::bLength, usb_cdc_ethernet_descriptor::bLength, usb_cdc_union_descriptor::bSlaveInterface, cdce_config, cdce_detach, CDCE_FLAG_NO_UNION, CDCE_FLAG_VLAN, CDCE_N_TRANSFER, cdce_ue_methods, dev, usb_attach_arg::device, device_set_usb_desc(), DPRINTF, error, id, usb_cdc_ethernet_descriptor::iMacAddress, usb_attach_arg::info, cdce_softc::sc_flags, cdce_softc::sc_ifaces_index, cdce_softc::sc_mtx, cdce_softc::sc_ue, cdce_softc::sc_xfer, UDESC_CS_INTERFACE, UDESCSUB_CDC_ENF, UDESCSUB_CDC_UNION, usb_ether::ue_dev, usb_ether::ue_eaddr, usb_ether::ue_methods, usb_ether::ue_mtx, usb_ether::ue_sc, usb_ether::ue_udev, uether_ifattach(), UGETW, USB_ERR_INVAL, USB_GET_DRIVER_INFO, usb_attach_arg::usb_mode, USB_MODE_DEVICE, usbd_find_descriptor(), usbd_get_iface(), usbd_get_interface_descriptor(), usbd_req_get_string_any(), usbd_set_alt_interface_index(), usbd_set_parent_iface(), usbd_transfer_setup(), and usb_cdc_ethernet_descriptor::wMaxSegmentSize.
|
static |
|
static |
Definition at line 572 of file if_cdce.c.
References CDCE_FLAG_VLAN, cdce_ioctl(), CDCE_LOCK, cdce_media_change_cb(), cdce_media_status_cb(), cdce_set_filter(), CDCE_UNLOCK, cdce_softc::sc_flags, cdce_softc::sc_media, uether_getifp(), uether_getsc(), uether_init(), and uether_start().
|
static |
Definition at line 1086 of file if_cdce.c.
References CDCE_FLAG_ZAURUS, CDCE_FRAMES_MAX, cdce_free_queue(), DPRINTF, error, len, cdce_softc::sc_flags, cdce_softc::sc_rx_buf, cdce_softc::sc_ue, usb_ether::ue_udev, uether_newbuf(), uether_rxflush(), uether_rxmbuf(), USB_ERR_CANCELLED, USB_GET_STATE, USB_MODE_HOST, USB_ST_SETUP, USB_ST_TRANSFERRED, usbd_errstr(), usbd_get_mode(), usbd_transfer_submit(), usbd_xfer_frame_len(), usbd_xfer_set_frame_data(), usbd_xfer_set_frames(), usbd_xfer_set_stall(), usbd_xfer_softc(), and usbd_xfer_status().
|
static |
Definition at line 867 of file if_cdce.c.
References CDCE_FLAG_ZAURUS, CDCE_FRAMES_MAX, cdce_free_queue(), cdce_m_crc32(), error, cdce_softc::sc_flags, cdce_softc::sc_tx_buf, cdce_softc::sc_ue, usb_ether::ue_udev, uether_getifp(), USB_ERR_CANCELLED, USB_GET_STATE, USB_MODE_HOST, USB_ST_SETUP, USB_ST_TRANSFERRED, usbd_errstr(), usbd_get_mode(), usbd_transfer_submit(), usbd_xfer_set_frame_data(), usbd_xfer_set_frames(), usbd_xfer_set_stall(), usbd_xfer_softc(), and usbd_xfer_status().
|
static |
Definition at line 784 of file if_cdce.c.
References CDCE_N_TRANSFER, dev, cdce_softc::sc_media, cdce_softc::sc_mtx, cdce_softc::sc_ue, cdce_softc::sc_xfer, uether_ifdetach(), and usbd_transfer_unsetup().
|
static |
Definition at line 536 of file if_cdce.c.
References cdce_etag, and cdce_test_autoinst().
|
static |
Definition at line 835 of file if_cdce.c.
References n.
Referenced by cdce_bulk_read_callback(), and cdce_bulk_write_callback().
|
static |
Definition at line 1337 of file if_cdce.c.
References CDCE_INTR_TX, CDCE_NOTIFY_SPEED_CHANGE, dev, pstate, req, cdce_softc::sc_mtx, cdce_softc::sc_notify_state, cdce_softc::sc_xfer, UCDC_NCM_SET_ETHERNET_PACKET_FILTER, usbd_transfer_start(), and UT_WRITE_CLASS_INTERFACE.
|
static |
Definition at line 983 of file if_cdce.c.
References CDCE_BULK_TX, CDCE_INTR_RX, CDCE_INTR_TX, CDCE_LOCK_ASSERT, cdce_start, cdce_softc::sc_ue, cdce_softc::sc_xfer, usb_ether::ue_udev, uether_getifp(), uether_getsc(), USB_MODE_HOST, usbd_get_mode(), usbd_transfer_start(), and usbd_xfer_set_stall().
|
static |
Definition at line 1166 of file if_cdce.c.
References usb_cdc_notification::bmRequestType, usb_cdc_notification::bNotification, CDCE_IND_SIZE_MAX, usb_cdc_notification::data, DPRINTF, error, cdce_softc::sc_ue, UCDC_N_CONNECTION_SPEED_CHANGE, UCDC_N_NETWORK_CONNECTION, UCDC_NOTIFICATION_LENGTH, usb_ether::ue_udev, uether_getifp(), UGETDW, UGETW, USB_DEBUG_VAR, USB_ERR_CANCELLED, USB_GET_STATE, USB_MODE_HOST, USB_ST_SETUP, USB_ST_TRANSFERRED, usbd_copy_out(), usbd_get_mode(), usbd_transfer_submit(), usbd_xfer_get_frame(), usbd_xfer_max_len(), usbd_xfer_set_frame_len(), usbd_xfer_set_stall(), usbd_xfer_softc(), usbd_xfer_status(), usb_cdc_notification::wLength, and usb_cdc_notification::wValue.
|
static |
Definition at line 1251 of file if_cdce.c.
References CDCE_NOTIFY_DONE, CDCE_NOTIFY_NETWORK_CONNECTION, CDCE_NOTIFY_SPEED_CHANGE, DPRINTF, error, req, cdce_softc::sc_ifaces_index, cdce_softc::sc_notify_state, cdce_softc::sc_ue, UCDC_N_CONNECTION_SPEED_CHANGE, UCDC_N_NETWORK_CONNECTION, UCDC_NOTIFICATION, usb_ether::ue_udev, USB_ERR_CANCELLED, USB_GET_STATE, USB_MODE_HOST, USB_SPEED_FULL, USB_ST_SETUP, USB_ST_TRANSFERRED, usbd_copy_in(), usbd_get_mode(), usbd_get_speed(), usbd_transfer_submit(), usbd_xfer_get_frame(), usbd_xfer_set_frame_len(), usbd_xfer_set_frames(), usbd_xfer_set_stall(), usbd_xfer_softc(), usbd_xfer_status(), USETDW, and USETW.
|
static |
Definition at line 812 of file if_cdce.c.
References data, error, cdce_softc::sc_media, uether_getsc(), and uether_ioctl().
Referenced by cdce_attach_post_sub().
|
static |
Definition at line 974 of file if_cdce.c.
References cdce_m_crc32_cb().
Referenced by cdce_bulk_write_callback().
|
static |
Definition at line 965 of file if_cdce.c.
References count.
Referenced by cdce_m_crc32().
|
static |
Definition at line 847 of file if_cdce.c.
Referenced by cdce_attach_post_sub().
|
static |
Definition at line 854 of file if_cdce.c.
Referenced by cdce_attach_post_sub().
|
static |
Definition at line 553 of file if_cdce.c.
References cdce_dual_devs, cdce_host_devs, dev, error, and usbd_lookup_id_by_uaa().
|
static |
|
static |
Definition at line 1043 of file if_cdce.c.
References CDC_PACKET_TYPE_ALL_MULTICAST, CDC_PACKET_TYPE_BROADCAST, CDC_PACKET_TYPE_DIRECTED, CDC_PACKET_TYPE_PROMISC, CDC_SET_ETHERNET_PACKET_FILTER, req, cdce_softc::sc_ifaces_index, cdce_softc::sc_mtx, cdce_softc::sc_ue, usb_ether::ue_udev, uether_getifp(), uether_getsc(), usbd_do_request, USETW, UT_CLASS, UT_INTERFACE, and value.
Referenced by cdce_attach_post_sub(), cdce_setmulti(), and cdce_setpromisc().
|
static |
Definition at line 1029 of file if_cdce.c.
References cdce_set_filter().
|
static |
Definition at line 1036 of file if_cdce.c.
References cdce_set_filter().
|
static |
Definition at line 800 of file if_cdce.c.
References CDCE_BULK_RX, CDCE_BULK_TX, cdce_softc::sc_xfer, uether_getsc(), and usbd_transfer_start().
|
static |
Definition at line 1010 of file if_cdce.c.
References CDCE_BULK_RX, CDCE_BULK_TX, CDCE_INTR_RX, CDCE_INTR_TX, CDCE_LOCK_ASSERT, cdce_softc::sc_xfer, uether_getifp(), uether_getsc(), and usbd_transfer_stop().
|
static |
|
static |
Definition at line 511 of file if_cdce.c.
References cdce_switch_devs, usb_attach_arg::dev_state, id, usb_interface::idesc, UAA_DEV_EJECTING, UAA_DEV_READY, UICLASS_MASS, USB_GET_DRIVER_INFO, usb_msc_eject(), usbd_get_iface(), and usbd_lookup_id_by_uaa().
Referenced by cdce_driver_loaded().
DRIVER_MODULE | ( | cdce | , |
uhub | , | ||
cdce_driver | , | ||
cdce_devclass | , | ||
cdce_driver_loaded | , | ||
0 | |||
) |
MODULE_DEPEND | ( | cdce | , |
ether | , | ||
1 | , | ||
1 | , | ||
1 | |||
) |
MODULE_DEPEND | ( | cdce | , |
uether | , | ||
1 | , | ||
1 | , | ||
1 | |||
) |
MODULE_DEPEND | ( | cdce | , |
usb | , | ||
1 | , | ||
1 | , | ||
1 | |||
) |
MODULE_VERSION | ( | cdce | , |
1 | |||
) |
USB_PNP_DEVICE_INFO | ( | cdce_switch_devs | ) |
USB_PNP_DUAL_INFO | ( | cdce_dual_devs | ) |
USB_PNP_HOST_INFO | ( | cdce_host_devs | ) |
|
static |
|
static |
|
static |
|
static |
Definition at line 136 of file if_cdce.c.
Referenced by cdce_attach().
|
static |
Definition at line 93 of file if_cdce.c.
Referenced by cdce_attach().
|
static |
|
static |
Definition at line 300 of file if_cdce.c.
Referenced by cdce_probe().
|
static |
Definition at line 263 of file if_cdce.c.
Referenced by cdce_driver_loaded().
|
static |
Definition at line 271 of file if_cdce.c.
Referenced by cdce_probe().
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Definition at line 111 of file if_cdce.c.
Referenced by cdce_init().
|
static |
|
static |
Definition at line 267 of file if_cdce.c.
Referenced by cdce_test_autoinst().
|
static |
Definition at line 315 of file if_cdce.c.
Referenced by cdce_attach().