#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/socket.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 "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_iphethvar.h>
Go to the source code of this file.
|
| __FBSDID ("$FreeBSD$") |
|
| DRIVER_MODULE (ipheth, uhub, ipheth_driver, ipheth_devclass, NULL, 0) |
|
| MODULE_VERSION (ipheth, 1) |
|
| MODULE_DEPEND (ipheth, uether, 1, 1, 1) |
|
| MODULE_DEPEND (ipheth, usb, 1, 1, 1) |
|
| MODULE_DEPEND (ipheth, ether, 1, 1, 1) |
|
| USB_PNP_HOST_INFO (ipheth_devs) |
|
static int | ipheth_get_mac_addr (struct ipheth_softc *sc) |
|
static int | ipheth_probe (device_t dev) |
|
static int | ipheth_attach (device_t dev) |
|
static int | ipheth_detach (device_t dev) |
|
static void | ipheth_start (struct usb_ether *ue) |
|
static void | ipheth_stop (struct usb_ether *ue) |
|
static void | ipheth_tick (struct usb_ether *ue) |
|
static void | ipheth_attach_post (struct usb_ether *ue) |
|
static void | ipheth_init (struct usb_ether *ue) |
|
static void | ipheth_setmulti (struct usb_ether *ue) |
|
static void | ipheth_setpromisc (struct usb_ether *ue) |
|
static void | ipheth_free_queue (struct mbuf **ppm, uint8_t n) |
|
static void | ipheth_bulk_write_callback (struct usb_xfer *xfer, usb_error_t error) |
|
static void | ipheth_bulk_read_callback (struct usb_xfer *xfer, usb_error_t error) |
|
◆ IPHETH_ID
#define IPHETH_ID |
( |
|
v, |
|
|
|
p, |
|
|
|
c, |
|
|
|
sc, |
|
|
|
pt |
|
) |
| |
Value:
USB_IFACE_PROTOCOL(pt)
#define USB_IFACE_SUBCLASS(isc)
#define USB_PRODUCT(prod)
Definition at line 182 of file if_ipheth.c.
◆ USB_DEBUG_VAR
#define USB_DEBUG_VAR ipheth_debug |
◆ __FBSDID()
◆ DRIVER_MODULE()
◆ ipheth_attach()
static int ipheth_attach |
( |
device_t |
dev | ) |
|
|
static |
Definition at line 224 of file if_ipheth.c.
References usbd_lookup_info::bIfaceIndex, dev, usb_attach_arg::device, device_set_usb_desc(), error, usb_attach_arg::info, IPHETH_ALT_INTFNUM, ipheth_config, ipheth_detach, ipheth_get_mac_addr(), IPHETH_N_TRANSFER, ipheth_ue_methods, ipheth_softc::sc_iface_no, ipheth_softc::sc_mtx, ipheth_softc::sc_ue, ipheth_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(), usbd_set_alt_interface_index(), and usbd_transfer_setup().
◆ ipheth_attach_post()
static void ipheth_attach_post |
( |
struct usb_ether * |
ue | ) |
|
|
static |
◆ ipheth_bulk_read_callback()
Definition at line 472 of file if_ipheth.c.
References DPRINTF, error, ipheth_free_queue(), IPHETH_RX_ADJ, IPHETH_RX_FRAMES_MAX, len, ipheth_softc::sc_rx_buf, ipheth_softc::sc_ue, uether_newbuf(), uether_rxflush(), uether_rxmbuf(), USB_ERR_CANCELLED, USB_GET_STATE, USB_ST_SETUP, USB_ST_TRANSFERRED, usbd_errstr(), 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().
◆ ipheth_bulk_write_callback()
Definition at line 387 of file if_ipheth.c.
References error, IPHETH_BUF_SIZE, ipheth_free_queue(), IPHETH_TX_FRAMES_MAX, ipheth_softc::sc_tx_buf, ipheth_softc::sc_ue, uether_getifp(), USB_ERR_CANCELLED, USB_GET_STATE, USB_ST_SETUP, USB_ST_TRANSFERRED, usbd_errstr(), usbd_frame_zero(), 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(), usbd_xfer_softc(), and usbd_xfer_status().
◆ ipheth_detach()
static int ipheth_detach |
( |
device_t |
dev | ) |
|
|
static |
◆ ipheth_free_queue()
static void ipheth_free_queue |
( |
struct mbuf ** |
ppm, |
|
|
uint8_t |
n |
|
) |
| |
|
static |
◆ ipheth_get_mac_addr()
◆ ipheth_init()
static void ipheth_init |
( |
struct usb_ether * |
ue | ) |
|
|
static |
◆ ipheth_probe()
static int ipheth_probe |
( |
device_t |
dev | ) |
|
|
static |
◆ ipheth_setmulti()
static void ipheth_setmulti |
( |
struct usb_ether * |
ue | ) |
|
|
static |
◆ ipheth_setpromisc()
static void ipheth_setpromisc |
( |
struct usb_ether * |
ue | ) |
|
|
static |
◆ ipheth_start()
static void ipheth_start |
( |
struct usb_ether * |
ue | ) |
|
|
static |
◆ ipheth_stop()
static void ipheth_stop |
( |
struct usb_ether * |
ue | ) |
|
|
static |
◆ ipheth_tick()
static void ipheth_tick |
( |
struct usb_ether * |
ue | ) |
|
|
static |
Definition at line 314 of file if_ipheth.c.
References error, IPHETH_CARRIER_ON, IPHETH_CMD_CARRIER_CHECK, IPHETH_CTRL_BUF_SIZE, IPHETH_CTRL_TIMEOUT, req, ipheth_softc::sc_carrier_on, ipheth_softc::sc_data, ipheth_softc::sc_iface_no, uether_do_request, uether_getsc(), and UT_READ_VENDOR_DEVICE.
◆ MODULE_DEPEND() [1/3]
MODULE_DEPEND |
( |
ipheth |
, |
|
|
ether |
, |
|
|
1 |
, |
|
|
1 |
, |
|
|
1 |
|
|
) |
| |
◆ MODULE_DEPEND() [2/3]
MODULE_DEPEND |
( |
ipheth |
, |
|
|
uether |
, |
|
|
1 |
, |
|
|
1 |
, |
|
|
1 |
|
|
) |
| |
◆ MODULE_DEPEND() [3/3]
MODULE_DEPEND |
( |
ipheth |
, |
|
|
usb |
, |
|
|
1 |
, |
|
|
1 |
, |
|
|
1 |
|
|
) |
| |
◆ MODULE_VERSION()
MODULE_VERSION |
( |
ipheth |
, |
|
|
1 |
|
|
) |
| |
◆ USB_PNP_HOST_INFO()
◆ ipheth_attach
device_attach_t ipheth_attach |
|
static |
◆ ipheth_attach_post
◆ ipheth_bulk_read_callback
◆ ipheth_bulk_write_callback
◆ ipheth_config
Initial value:= {
.flags = {.short_frames_ok = 1,.short_xfer_ok = 1,.ext_buffer = 1,},
.timeout = 0,
},
.flags = {.force_short_xfer = 1,},
},
}
static usb_callback_t ipheth_bulk_write_callback
static usb_callback_t ipheth_bulk_read_callback
#define IPHETH_TX_FRAMES_MAX
#define IPHETH_TX_TIMEOUT
#define IPHETH_RX_FRAMES_MAX
Definition at line 95 of file if_ipheth.c.
Referenced by ipheth_attach().
◆ ipheth_detach
device_detach_t ipheth_detach |
|
static |
◆ ipheth_devclass
devclass_t ipheth_devclass |
|
static |
◆ ipheth_devs
Initial value:= {
}
#define IPHETH_USBINTF_CLASS
#define IPHETH_USBINTF_PROTO
#define IPHETH_USBINTF_SUBCLASS
#define USB_IFACE_CLASS(ic)
#define USB_IFACE_PROTOCOL(ip)
Definition at line 136 of file if_ipheth.c.
Referenced by ipheth_probe().
◆ ipheth_driver
Initial value:= {
.name = "ipheth",
}
static device_method_t ipheth_methods[]
Definition at line 128 of file if_ipheth.c.
◆ ipheth_init
◆ ipheth_methods
device_method_t ipheth_methods[] |
|
static |
Initial value:= {
DEVMETHOD_END
}
static device_probe_t ipheth_probe
static device_attach_t ipheth_attach
static device_detach_t ipheth_detach
Definition at line 119 of file if_ipheth.c.
◆ ipheth_probe
device_probe_t ipheth_probe |
|
static |
◆ ipheth_setmulti
◆ ipheth_setpromisc
◆ ipheth_start
◆ ipheth_stop
◆ ipheth_tick
◆ ipheth_ue_methods
Initial value:= {
}
static uether_fn_t ipheth_init
static uether_fn_t ipheth_start
static uether_fn_t ipheth_attach_post
static uether_fn_t ipheth_tick
static uether_fn_t ipheth_setmulti
static uether_fn_t ipheth_setpromisc
static uether_fn_t ipheth_stop
Definition at line 172 of file if_ipheth.c.
Referenced by ipheth_attach().