FreeBSD kernel usb device Code
|
#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/bus.h>
#include <sys/condvar.h>
#include <sys/endian.h>
#include <sys/kernel.h>
#include <sys/lock.h>
#include <sys/module.h>
#include <sys/mutex.h>
#include <sys/socket.h>
#include <sys/sysctl.h>
#include <sys/unistd.h>
#include <net/if.h>
#include <net/if_var.h>
#include <net/if_media.h>
#include <dev/mii/mii.h>
#include <dev/mii/miivar.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/net/usb_ethernet.h>
#include <dev/usb/net/if_axgereg.h>
#include "miibus_if.h"
Go to the source code of this file.
Macros | |
#define | USB_DEBUG_VAR axge_debug |
#define | AXGE_DEV(v, p) { USB_VP(USB_VENDOR_##v, USB_PRODUCT_##v##_##p) } |
#define | AXGE_CSUM_FEATURES (CSUM_IP | CSUM_TCP | CSUM_UDP) |
Functions | |
__FBSDID ("$FreeBSD$") | |
static int | axge_read_mem (struct axge_softc *, uint8_t, uint16_t, uint16_t, void *, int) |
static void | axge_write_mem (struct axge_softc *, uint8_t, uint16_t, uint16_t, void *, int) |
static uint8_t | axge_read_cmd_1 (struct axge_softc *, uint8_t, uint16_t) |
static uint16_t | axge_read_cmd_2 (struct axge_softc *, uint8_t, uint16_t, uint16_t) |
static void | axge_write_cmd_1 (struct axge_softc *, uint8_t, uint16_t, uint8_t) |
static void | axge_write_cmd_2 (struct axge_softc *, uint8_t, uint16_t, uint16_t, uint16_t) |
static void | axge_chip_init (struct axge_softc *) |
static void | axge_reset (struct axge_softc *) |
static int | axge_attach_post_sub (struct usb_ether *) |
static int | axge_ifmedia_upd (struct ifnet *) |
static void | axge_ifmedia_sts (struct ifnet *, struct ifmediareq *) |
static int | axge_ioctl (struct ifnet *, u_long, caddr_t) |
static void | axge_rx_frame (struct usb_ether *, struct usb_page_cache *, int) |
static void | axge_rxeof (struct usb_ether *, struct usb_page_cache *, unsigned int, unsigned int, uint32_t) |
static void | axge_csum_cfg (struct usb_ether *) |
DRIVER_MODULE (axge, uhub, axge_driver, axge_devclass, NULL, NULL) | |
DRIVER_MODULE (miibus, axge, miibus_driver, miibus_devclass, NULL, NULL) | |
MODULE_DEPEND (axge, uether, 1, 1, 1) | |
MODULE_DEPEND (axge, usb, 1, 1, 1) | |
MODULE_DEPEND (axge, ether, 1, 1, 1) | |
MODULE_DEPEND (axge, miibus, 1, 1, 1) | |
MODULE_VERSION (axge, 1) | |
USB_PNP_HOST_INFO (axge_devs) | |
static int | axge_miibus_readreg (device_t dev, int phy, int reg) |
static int | axge_miibus_writereg (device_t dev, int phy, int reg, int val) |
static void | axge_miibus_statchg (device_t dev) |
static void | axge_attach_post (struct usb_ether *ue) |
static int | axge_probe (device_t dev) |
static int | axge_attach (device_t dev) |
static int | axge_detach (device_t dev) |
static void | axge_bulk_read_callback (struct usb_xfer *xfer, usb_error_t error) |
static void | axge_bulk_write_callback (struct usb_xfer *xfer, usb_error_t error) |
static void | axge_tick (struct usb_ether *ue) |
static u_int | axge_hash_maddr (void *arg, struct sockaddr_dl *sdl, u_int cnt) |
static void | axge_rxfilter (struct usb_ether *ue) |
static void | axge_start (struct usb_ether *ue) |
static void | axge_init (struct usb_ether *ue) |
static void | axge_stop (struct usb_ether *ue) |
Variables | |
static const STRUCT_USB_HOST_ID | axge_devs [] |
struct { | |
uint8_t ctrl | |
uint8_t timer_l | |
uint8_t timer_h | |
uint8_t size | |
uint8_t ifg | |
} | axge_bulk_size [] |
static device_probe_t | axge_probe |
static device_attach_t | axge_attach |
static device_detach_t | axge_detach |
static usb_callback_t | axge_bulk_read_callback |
static usb_callback_t | axge_bulk_write_callback |
static miibus_readreg_t | axge_miibus_readreg |
static miibus_writereg_t | axge_miibus_writereg |
static miibus_statchg_t | axge_miibus_statchg |
static uether_fn_t | axge_attach_post |
static uether_fn_t | axge_init |
static uether_fn_t | axge_stop |
static uether_fn_t | axge_start |
static uether_fn_t | axge_tick |
static uether_fn_t | axge_rxfilter |
static const struct usb_config | axge_config [AXGE_N_TRANSFER] |
static device_method_t | axge_methods [] |
static driver_t | axge_driver |
static devclass_t | axge_devclass |
static const struct usb_ether_methods | axge_ue_methods |
#define AXGE_CSUM_FEATURES (CSUM_IP | CSUM_TCP | CSUM_UDP) |
#define AXGE_DEV | ( | v, | |
p | |||
) | { USB_VP(USB_VENDOR_##v, USB_PRODUCT_##v##_##p) } |
__FBSDID | ( | "$FreeBSD$" | ) |
|
static |
Definition at line 544 of file if_axge.c.
References axge_config, axge_detach, AXGE_IFACE_IDX, AXGE_N_TRANSFER, axge_ue_methods, dev, usb_attach_arg::device, device_set_usb_desc(), error, axge_softc::sc_mtx, axge_softc::sc_ue, axge_softc::sc_xfer, usb_ether::ue_dev, usb_ether::ue_methods, usb_ether::ue_mtx, usb_ether::ue_sc, usb_ether::ue_udev, uether_ifattach(), and usbd_transfer_setup().
|
static |
Definition at line 440 of file if_axge.c.
References AXGE_ACCESS_MAC, axge_chip_init(), AXGE_NIDR, axge_read_mem(), usb_ether::ue_eaddr, and uether_getsc().
|
static |
Definition at line 453 of file if_axge.c.
References AXGE_CSUM_FEATURES, axge_ioctl(), AXGE_PHY_ADDR, error, usb_ether::ue_dev, usb_ether::ue_ifp, usb_ether::ue_methods, usb_ether_methods::ue_mii_sts, usb_ether::ue_miibus, uether_ifmedia_upd(), uether_init(), and uether_start().
|
static |
Definition at line 623 of file if_axge.c.
References axge_rx_frame(), error, axge_softc::sc_ue, uether_rxflush(), 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 657 of file if_axge.c.
References AXGE_CSUM_DISABLE, AXGE_CSUM_FEATURES, AXGE_FLAG_LINK, AXGE_N_FRAMES, AXGE_TXBYTES, error, axge_frame_txhdr::len, axge_frame_txhdr::mss, axge_softc::sc_flags, axge_softc::sc_ue, uether_getifp(), USB_ERR_CANCELLED, USB_GET_STATE, USB_ST_SETUP, USB_ST_TRANSFERRED, usbd_copy_in(), usbd_m_copy_in(), usbd_transfer_submit(), usbd_xfer_get_frame(), usbd_xfer_set_frame_len(), usbd_xfer_set_frame_offset(), usbd_xfer_set_frames(), usbd_xfer_set_stall(), and usbd_xfer_softc().
|
static |
Definition at line 408 of file if_axge.c.
References AXGE_ACCESS_MAC, AXGE_CLK_SELECT, AXGE_CLK_SELECT_ACS, AXGE_CLK_SELECT_BCS, AXGE_EPPRCR, axge_write_cmd_1(), axge_write_cmd_2(), EPPRCR_IPRL, axge_softc::sc_ue, and uether_pause().
Referenced by axge_attach_post(), and axge_reset().
|
static |
Definition at line 1047 of file if_axge.c.
References AXGE_ACCESS_MAC, AXGE_CRCR, AXGE_CTCR, AXGE_LOCK_ASSERT, axge_write_cmd_1(), CRCR_IP, CRCR_TCP, CRCR_UDP, CTCR_IP, CTCR_TCP, CTCR_UDP, uether_getifp(), and uether_getsc().
Referenced by axge_init().
|
static |
Definition at line 587 of file if_axge.c.
References AXGE_ACCESS_MAC, AXGE_CLK_SELECT, AXGE_EPPRCR, AXGE_LOCK, AXGE_N_TRANSFER, AXGE_RCR, axge_read_cmd_2(), axge_stop, AXGE_UNLOCK, axge_write_cmd_1(), axge_write_cmd_2(), dev, EPPRCR_BZ, EPPRCR_IPRL, axge_softc::sc_mtx, axge_softc::sc_ue, axge_softc::sc_xfer, usb_ether::ue_tq, uether_ifdetach(), usb_proc_drain(), usbd_transfer_unsetup(), and val.
|
static |
Definition at line 758 of file if_axge.c.
Referenced by axge_rxfilter().
|
static |
Definition at line 506 of file if_axge.c.
References AXGE_LOCK, AXGE_UNLOCK, and GET_MII.
|
static |
Definition at line 484 of file if_axge.c.
References AXGE_LOCK_ASSERT, error, and GET_MII.
Referenced by axge_init().
|
static |
Definition at line 821 of file if_axge.c.
References AXGE_ACCESS_MAC, AXGE_BULK_DT_WR, axge_csum_cfg(), axge_ifmedia_upd(), AXGE_LOCK_ASSERT, AXGE_MMSR, AXGE_MSR, AXGE_NIDR, AXGE_PWLHR, AXGE_PWLLR, axge_read_cmd_1(), axge_reset(), axge_rxfilter, axge_stop, axge_write_cmd_1(), axge_write_cmd_2(), axge_write_mem(), MSR_FD, MSR_GM, MSR_RE, MSR_RFC, MSR_TFC, axge_softc::sc_xfer, uether_getifp(), uether_getsc(), and usbd_xfer_set_stall().
|
static |
Definition at line 902 of file if_axge.c.
References AXGE_CSUM_FEATURES, AXGE_LOCK, AXGE_UNLOCK, data, error, uether_getsc(), uether_init(), and uether_ioctl().
Referenced by axge_attach_post_sub().
|
static |
Definition at line 290 of file if_axge.c.
References AXGE_ACCESS_PHY, AXGE_LOCK, axge_read_cmd_2(), AXGE_UNLOCK, dev, reg, axge_softc::sc_mtx, and val.
|
static |
Definition at line 329 of file if_axge.c.
References AXGE_ACCESS_MAC, axge_bulk_size, AXGE_FLAG_LINK, AXGE_LOCK, AXGE_MSR, AXGE_PLSR, axge_read_cmd_1(), AXGE_RX_BULKIN_QCTRL, AXGE_UNLOCK, axge_write_cmd_2(), axge_write_mem(), dev, GET_MII, MSR_EN_125MHZ, MSR_FD, MSR_GM, MSR_PS, MSR_RE, MSR_RFC, MSR_TFC, PLSR_USB_HS, PLSR_USB_SS, axge_softc::sc_flags, axge_softc::sc_mtx, axge_softc::sc_ue, uether_getifp(), and val.
|
static |
Definition at line 310 of file if_axge.c.
References AXGE_ACCESS_PHY, AXGE_LOCK, AXGE_UNLOCK, axge_write_cmd_2(), dev, reg, axge_softc::sc_mtx, and val.
|
static |
Definition at line 524 of file if_axge.c.
References AXGE_CONFIG_IDX, axge_devs, AXGE_IFACE_IDX, usbd_lookup_info::bConfigIndex, usbd_lookup_info::bIfaceIndex, dev, usb_attach_arg::info, usb_attach_arg::usb_mode, USB_MODE_HOST, and usbd_lookup_id_by_uaa().
|
static |
Definition at line 255 of file if_axge.c.
References axge_read_mem(), reg, and val.
Referenced by axge_init(), and axge_miibus_statchg().
|
static |
Definition at line 264 of file if_axge.c.
References axge_read_mem(), index, reg, UGETW, and val.
Referenced by axge_detach(), axge_miibus_readreg(), and axge_stop().
|
static |
Definition at line 219 of file if_axge.c.
References AXGE_LOCK_ASSERT, index, len, req, axge_softc::sc_ue, uether_do_request, USETW, UT_READ_VENDOR_DEVICE, and val.
Referenced by axge_attach_post(), axge_read_cmd_1(), and axge_read_cmd_2().
|
static |
Definition at line 420 of file if_axge.c.
References axge_chip_init(), usb_config_descriptor::bConfigurationValue, DPRINTF, axge_softc::sc_mtx, axge_softc::sc_ue, usb_ether::ue_udev, uether_pause(), usbd_get_config_descriptor(), and usbd_req_set_config().
Referenced by axge_init().
|
static |
Definition at line 945 of file if_axge.c.
References AXGE_RX_ERR, AXGE_RXBYTES, axge_rxeof(), DPRINTF, axge_frame_rxhdr::status, usb_ether::ue_ifp, and usbd_copy_out().
Referenced by axge_bulk_read_callback().
|
static |
Definition at line 1002 of file if_axge.c.
References AXGE_RX_L3_CSUM_ERR, AXGE_RX_L3_TYPE_IPV4, AXGE_RX_L3_TYPE_MASK, AXGE_RX_L4_CSUM_ERR, AXGE_RX_L4_TYPE_MASK, AXGE_RX_L4_TYPE_TCP, AXGE_RX_L4_TYPE_UDP, len, offset, status, usb_ether::ue_ifp, usb_ether::ue_rxq, and usbd_copy_out().
Referenced by axge_rx_frame().
|
static |
Definition at line 770 of file if_axge.c.
References AXGE_ACCESS_MAC, axge_hash_maddr(), AXGE_LOCK_ASSERT, AXGE_MFA, AXGE_RCR, axge_write_cmd_2(), axge_write_mem(), RCR_ACPT_ALL_MCAST, RCR_ACPT_BCAST, RCR_ACPT_MCAST, RCR_DROP_CRCERR, RCR_PROMISC, RCR_START, uether_getifp(), and uether_getsc().
|
static |
Definition at line 808 of file if_axge.c.
References AXGE_BULK_DT_RD, AXGE_BULK_DT_WR, axge_softc::sc_xfer, uether_getsc(), and usbd_transfer_start().
|
static |
Definition at line 875 of file if_axge.c.
References AXGE_ACCESS_MAC, AXGE_BULK_DT_RD, AXGE_BULK_DT_WR, AXGE_LOCK_ASSERT, AXGE_MSR, axge_read_cmd_2(), axge_write_cmd_2(), axge_softc::sc_flags, axge_softc::sc_xfer, uether_getifp(), uether_getsc(), usbd_transfer_stop(), and val.
|
static |
Definition at line 745 of file if_axge.c.
References AXGE_LOCK_ASSERT, GET_MII, and uether_getsc().
|
static |
Definition at line 274 of file if_axge.c.
References axge_write_mem(), reg, and val.
Referenced by axge_chip_init(), axge_csum_cfg(), axge_detach(), and axge_init().
|
static |
Definition at line 280 of file if_axge.c.
References axge_write_mem(), index, reg, USETW, and val.
Referenced by axge_chip_init(), axge_detach(), axge_init(), axge_miibus_statchg(), axge_miibus_writereg(), axge_rxfilter(), and axge_stop().
|
static |
Definition at line 236 of file if_axge.c.
References AXGE_LOCK_ASSERT, index, len, req, axge_softc::sc_ue, uether_do_request, USETW, UT_WRITE_VENDOR_DEVICE, and val.
Referenced by axge_init(), axge_miibus_statchg(), axge_rxfilter(), axge_write_cmd_1(), and axge_write_cmd_2().
DRIVER_MODULE | ( | axge | , |
uhub | , | ||
axge_driver | , | ||
axge_devclass | , | ||
NULL | , | ||
NULL | |||
) |
DRIVER_MODULE | ( | miibus | , |
axge | , | ||
miibus_driver | , | ||
miibus_devclass | , | ||
NULL | , | ||
NULL | |||
) |
MODULE_DEPEND | ( | axge | , |
ether | , | ||
1 | , | ||
1 | , | ||
1 | |||
) |
MODULE_DEPEND | ( | axge | , |
miibus | , | ||
1 | , | ||
1 | , | ||
1 | |||
) |
MODULE_DEPEND | ( | axge | , |
uether | , | ||
1 | , | ||
1 | , | ||
1 | |||
) |
MODULE_DEPEND | ( | axge | , |
usb | , | ||
1 | , | ||
1 | , | ||
1 | |||
) |
MODULE_VERSION | ( | axge | , |
1 | |||
) |
USB_PNP_HOST_INFO | ( | axge_devs | ) |
|
static |
|
static |
const struct { ... } axge_bulk_size[] |
Referenced by axge_miibus_statchg().
|
static |
|
static |
Definition at line 152 of file if_axge.c.
Referenced by axge_attach().
|
static |
Definition at line 102 of file if_axge.c.
Referenced by axge_attach().
|
static |
|
static |
|
static |
|
static |
|
static |
Definition at line 116 of file if_axge.c.
Referenced by axge_init().
|
static |
|
static |
Definition at line 113 of file if_axge.c.
Referenced by axge_detach(), and axge_init().
|
static |
|
static |
Definition at line 205 of file if_axge.c.
Referenced by axge_attach().
uint8_t size |
Definition at line 89 of file if_axge.c.
Referenced by imx_ehci_disable_oc(), lan78xx_set_rx_max_frame_length(), rsu_load_firmware(), rum_load_microcode(), run_bulk_tx_callbackN(), udl_buffer_alloc(), udl_buffer_free(), udl_fbmem_alloc(), uhid_fill_get_report(), uhid_fill_set_report(), uhid_ioctl(), uhid_snes_ioctl(), uhid_write_callback(), upgt_chksum_le(), upgt_crc32_le(), upgt_fw_copy(), usbd_alloc_config_desc(), usbd_req_get_report_descriptor(), usie_if_tx_callback(), and zyd_loadfirmware().