FreeBSD kernel usb device Code
|
#include "opt_inet.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/mbuf.h>
#include <sys/socket.h>
#include <sys/sockio.h>
#include <sys/limits.h>
#include <net/if.h>
#include <net/if_arp.h>
#include <net/if_dl.h>
#include <net/if_media.h>
#include <net/if_types.h>
#include <net/bpf.h>
#include <net/ethernet.h>
Go to the source code of this file.
Data Structures | |
struct | usb_ether_methods |
struct | usb_ether_cfg_task |
struct | usb_ether |
Macros | |
#define | uether_do_request(ue, req, data, timo) usbd_do_request_proc((ue)->ue_udev,&(ue)->ue_tq,req,data,0,NULL,timo) |
Typedefs | |
typedef void() | uether_fn_t(struct usb_ether *) |
Functions | |
uint8_t | uether_pause (struct usb_ether *, unsigned int) |
struct ifnet * | uether_getifp (struct usb_ether *) |
struct mii_data * | uether_getmii (struct usb_ether *) |
void * | uether_getsc (struct usb_ether *) |
int | uether_ifattach (struct usb_ether *) |
void | uether_ifattach_wait (struct usb_ether *) |
void | uether_ifdetach (struct usb_ether *) |
int | uether_ifmedia_upd (struct ifnet *) |
void | uether_init (void *) |
int | uether_ioctl (struct ifnet *, u_long, caddr_t) |
struct mbuf * | uether_newbuf (void) |
int | uether_rxmbuf (struct usb_ether *, struct mbuf *, unsigned int) |
int | uether_rxbuf (struct usb_ether *, struct usb_page_cache *, unsigned int, unsigned int) |
void | uether_rxflush (struct usb_ether *) |
uint8_t | uether_is_gone (struct usb_ether *) |
void | uether_start (struct ifnet *) |
#define uether_do_request | ( | ue, | |
req, | |||
data, | |||
timo | |||
) | usbd_do_request_proc((ue)->ue_udev,&(ue)->ue_tq,req,data,0,NULL,timo) |
Definition at line 104 of file usb_ethernet.h.
typedef void() uether_fn_t(struct usb_ether *) |
Definition at line 55 of file usb_ethernet.h.
struct ifnet * uether_getifp | ( | struct usb_ether * | ue | ) |
Definition at line 136 of file usb_ethernet.c.
References usb_ether::ue_ifp.
Referenced by aue_bulk_read_callback(), aue_bulk_write_callback(), aue_init(), aue_intr_callback(), aue_setmulti(), aue_setpromisc(), aue_stop(), axe_bulk_write_callback(), axe_csum_cfg(), axe_init(), axe_miibus_statchg(), axe_setmulti(), axe_setpromisc(), axe_stop(), axge_bulk_write_callback(), axge_csum_cfg(), axge_init(), axge_miibus_statchg(), axge_rxfilter(), axge_stop(), cdce_attach_post_sub(), cdce_bulk_write_callback(), cdce_init(), cdce_intr_read_callback(), cdce_set_filter(), cdce_stop(), cdceem_bulk_write_callback(), cdceem_handle_data(), cdceem_init(), cdceem_send_data(), cdceem_stop(), cue_bulk_read_callback(), cue_bulk_write_callback(), cue_init(), cue_setmulti(), cue_setpromisc(), cue_stop(), cue_tick(), ipheth_bulk_write_callback(), ipheth_init(), kue_bulk_read_callback(), kue_bulk_write_callback(), kue_init(), kue_setmulti(), kue_setpromisc(), kue_stop(), lan78xx_miibus_statchg(), mos_bulk_read_callback(), mos_bulk_write_callback(), mos_init(), mos_intr_callback(), mos_setmulti(), mos_setpromisc(), mos_stop(), muge_bulk_read_callback(), muge_bulk_write_callback(), muge_init(), muge_sethwcsum(), muge_setmulti(), muge_setpromisc(), muge_stop(), rue_bulk_read_callback(), rue_bulk_write_callback(), rue_init(), rue_intr_callback(), rue_setmulti(), rue_setpromisc(), rue_stop(), smsc_bulk_read_callback(), smsc_bulk_write_callback(), smsc_init(), smsc_miibus_statchg(), smsc_sethwcsum(), smsc_setmulti(), smsc_setpromisc(), smsc_stop(), udav_bulk_read_callback(), udav_bulk_write_callback(), udav_init(), udav_setmulti(), udav_setpromisc(), udav_stop(), ure_bulk_read_callback(), ure_bulk_write_callback(), ure_init(), ure_link_state(), ure_miibus_statchg(), ure_rtl8153b_nic_reset(), ure_rxfilter(), ure_stop(), ure_tick(), urndis_bulk_read_callback(), urndis_bulk_write_callback(), urndis_init(), and urndis_stop().
struct mii_data * uether_getmii | ( | struct usb_ether * | ue | ) |
Definition at line 142 of file usb_ethernet.c.
References usb_ether::ue_miibus.
Referenced by lan78xx_miibus_statchg(), muge_ifmedia_sts(), muge_ifmedia_upd(), muge_tick(), smsc_ifmedia_sts(), smsc_ifmedia_upd(), smsc_miibus_statchg(), and smsc_tick().
void * uether_getsc | ( | struct usb_ether * | ue | ) |
Definition at line 148 of file usb_ethernet.c.
References usb_ether::ue_sc.
Referenced by aue_attach_post(), aue_init(), aue_setmulti(), aue_setpromisc(), aue_start(), aue_stop(), aue_tick(), axe_attach_post(), axe_attach_post_sub(), axe_csum_cfg(), axe_init(), axe_ioctl(), axe_rx_frame(), axe_setmulti(), axe_setpromisc(), axe_start(), axe_stop(), axe_tick(), axge_attach_post(), axge_csum_cfg(), axge_init(), axge_ioctl(), axge_rxfilter(), axge_start(), axge_stop(), axge_tick(), cdce_attach_post_sub(), cdce_init(), cdce_ioctl(), cdce_set_filter(), cdce_start(), cdce_stop(), cdceem_init(), cdceem_start(), cdceem_stop(), cue_attach_post(), cue_init(), cue_setmulti(), cue_setpromisc(), cue_start(), cue_stop(), cue_tick(), ipheth_init(), ipheth_start(), ipheth_stop(), ipheth_tick(), kue_attach_post(), kue_init(), kue_setmulti(), kue_setpromisc(), kue_start(), kue_stop(), mos_attach_post(), mos_init(), mos_setmulti(), mos_setpromisc(), mos_start(), mos_stop(), mos_tick(), muge_attach_post(), muge_attach_post_sub(), muge_init(), muge_ioctl(), muge_set_leds(), muge_set_mac_addr(), muge_setmulti(), muge_setpromisc(), muge_start(), muge_stop(), muge_tick(), rue_attach_post(), rue_init(), rue_setmulti(), rue_setpromisc(), rue_start(), rue_stop(), rue_tick(), smsc_attach_post(), smsc_attach_post_sub(), smsc_init(), smsc_ioctl(), smsc_setmulti(), smsc_setpromisc(), smsc_start(), smsc_stop(), smsc_tick(), udav_attach_post(), ure_attach_post(), ure_attach_post_sub(), ure_init(), ure_ioctl(), ure_rxfilter(), ure_start(), ure_stop(), ure_tick(), urndis_init(), urndis_start(), and urndis_stop().
int uether_ifattach | ( | struct usb_ether * | ue | ) |
Definition at line 164 of file usb_ethernet.c.
References error, usb_ether_cfg_task::hdr, ue_attach_post_task, usb_ether::ue_dev, UE_LOCK, usb_ether::ue_methods, usb_ether::ue_mtx, ue_queue_command(), usb_ether::ue_sync_task, usb_ether::ue_tq, usb_ether::ue_udev, UE_UNLOCK, USB_PRI_MED, and usb_proc_create().
Referenced by aue_attach(), axe_attach(), axge_attach(), cdce_attach(), cdceem_attach(), cue_attach(), ipheth_attach(), kue_attach(), mos_attach(), muge_attach(), rue_attach(), smsc_attach(), udav_attach(), ure_attach(), and urndis_attach().
void uether_ifattach_wait | ( | struct usb_ether * | ue | ) |
Definition at line 194 of file usb_ethernet.c.
References usb_ether_cfg_task::hdr, UE_LOCK, usb_ether::ue_sync_task, usb_ether::ue_tq, UE_UNLOCK, and usb_proc_mwait().
Referenced by muge_attach().
void uether_ifdetach | ( | struct usb_ether * | ue | ) |
Definition at line 302 of file usb_ethernet.c.
References usb_ether::ue_dev, usb_ether::ue_ifp, UE_LOCK, usb_ether::ue_miibus, usb_ether::ue_rxq, usb_ether::ue_sysctl_ctx, usb_ether::ue_tq, usb_ether::ue_unit, UE_UNLOCK, usb_ether::ue_watchdog, ueunit, usb_callout_drain, usb_proc_drain(), and usb_proc_free().
Referenced by aue_detach(), axe_detach(), axge_detach(), cdce_detach(), cdceem_detach(), cue_detach(), ipheth_detach(), kue_detach(), mos_detach(), muge_attach(), muge_detach(), rue_detach(), smsc_detach(), udav_detach(), ure_detach(), and urndis_detach().
int uether_ifmedia_upd | ( | struct ifnet * | ifp | ) |
Definition at line 450 of file usb_ethernet.c.
References ue_ifmedia_upd().
Referenced by axe_attach_post_sub(), axge_attach_post_sub(), muge_attach_post_sub(), smsc_attach_post_sub(), and ure_attach_post_sub().
void uether_init | ( | void * | arg | ) |
Definition at line 358 of file usb_ethernet.c.
References ue_init().
Referenced by axe_attach_post_sub(), axe_ioctl(), axge_attach_post_sub(), axge_ioctl(), cdce_attach_post_sub(), muge_attach_post_sub(), muge_ioctl(), smsc_attach_post_sub(), smsc_ioctl(), ure_attach_post_sub(), and ure_ioctl().
int uether_ioctl | ( | struct ifnet * | ifp, |
u_long | command, | ||
caddr_t | data | ||
) |
Definition at line 513 of file usb_ethernet.c.
References data, error, usb_ether_cfg_task::hdr, UE_LOCK, usb_ether::ue_miibus, usb_ether::ue_multi_task, ue_promisc_task, usb_ether::ue_promisc_task, ue_queue_command(), ue_setmulti_task, ue_start_task, ue_stop_task, usb_ether::ue_sync_task, and UE_UNLOCK.
Referenced by axe_ioctl(), axge_ioctl(), cdce_ioctl(), muge_ioctl(), smsc_ioctl(), ue_attach_post_task(), and ure_ioctl().
uint8_t uether_is_gone | ( | struct usb_ether * | ue | ) |
Definition at line 352 of file usb_ethernet.c.
References usb_ether::ue_tq, and usb_proc_is_gone().
struct mbuf * uether_newbuf | ( | void | ) |
Definition at line 584 of file usb_ethernet.c.
Referenced by cdce_bulk_read_callback(), cdceem_handle_data(), ipheth_bulk_read_callback(), muge_bulk_read_callback(), smsc_bulk_read_callback(), and uether_rxbuf().
uint8_t uether_pause | ( | struct usb_ether * | ue, |
unsigned int | _ticks | ||
) |
Definition at line 94 of file usb_ethernet.c.
References usb_ether::ue_mtx, usb_ether::ue_tq, usb_pause_mtx(), and usb_proc_is_gone().
Referenced by aue_eeprom_getword(), aue_miibus_readreg(), aue_miibus_writereg(), aue_reset(), axe_ax88178_init(), axe_ax88772_init(), axe_ax88772_phywake(), axe_reset(), axge_chip_init(), axge_reset(), cue_reset(), kue_reset(), lan78xx_eeprom_read_raw(), lan78xx_phy_init(), lan78xx_wait_for_bits(), muge_reset(), rue_reset(), smsc_eeprom_read(), smsc_phy_init(), smsc_reset(), smsc_wait_for_bits(), udav_reset(), ure_enable_aldps(), ure_init(), ure_phy_status(), ure_reset(), ure_rtl8152_nic_reset(), ure_rtl8153_init(), ure_rtl8153b_init(), and ure_rtl8153b_nic_reset().
int uether_rxbuf | ( | struct usb_ether * | ue, |
struct usb_page_cache * | pc, | ||
unsigned int | offset, | ||
unsigned int | len | ||
) |
Definition at line 616 of file usb_ethernet.c.
References len, offset, usb_ether::ue_ifp, UE_LOCK_ASSERT, usb_ether::ue_rxq, uether_newbuf(), and usbd_copy_out().
Referenced by aue_bulk_read_callback(), cue_bulk_read_callback(), kue_bulk_read_callback(), mos_bulk_read_callback(), rue_bulk_read_callback(), and udav_bulk_read_callback().
void uether_rxflush | ( | struct usb_ether * | ue | ) |
Definition at line 646 of file usb_ethernet.c.
References n, usb_ether::ue_ifp, UE_LOCK, UE_LOCK_ASSERT, usb_ether::ue_rxq, and UE_UNLOCK.
Referenced by aue_bulk_read_callback(), axe_bulk_read_callback(), axge_bulk_read_callback(), cdce_bulk_read_callback(), cdceem_bulk_read_callback(), cue_bulk_read_callback(), ipheth_bulk_read_callback(), kue_bulk_read_callback(), mos_bulk_read_callback(), muge_bulk_read_callback(), rue_bulk_read_callback(), smsc_bulk_read_callback(), udav_bulk_read_callback(), ure_bulk_read_callback(), and urndis_bulk_read_callback().
int uether_rxmbuf | ( | struct usb_ether * | ue, |
struct mbuf * | m, | ||
unsigned int | len | ||
) |
Definition at line 598 of file usb_ethernet.c.
References len, usb_ether::ue_ifp, UE_LOCK_ASSERT, and usb_ether::ue_rxq.
Referenced by cdce_bulk_read_callback(), cdceem_handle_data(), ipheth_bulk_read_callback(), muge_bulk_read_callback(), smsc_bulk_read_callback(), ure_bulk_read_callback(), and urndis_bulk_read_callback().
void uether_start | ( | struct ifnet * | ifp | ) |
Definition at line 410 of file usb_ethernet.c.
References ue_start().
Referenced by axe_attach_post_sub(), axge_attach_post_sub(), cdce_attach_post_sub(), muge_attach_post_sub(), smsc_attach_post_sub(), and ure_attach_post_sub().