43#ifdef USB_GLOBAL_INCLUDE_FILE
44#include USB_GLOBAL_INCLUDE_FILE
46#include <sys/stdint.h>
47#include <sys/stddef.h>
52#include <sys/kernel.h>
54#include <sys/module.h>
57#include <sys/condvar.h>
58#include <sys/sysctl.h>
60#include <sys/unistd.h>
61#include <sys/callout.h>
62#include <sys/malloc.h>
75#define MODEM_IFACE_0 0
76#define MODEM_IFACE_1 1
91#define SERIALNET_DEFAULT_VENDOR_ID USB_TEMPLATE_VENDOR
92#define SERIALNET_DEFAULT_PRODUCT_ID 0x05dc
93#define SERIALNET_DEFAULT_MODEM "Virtual serial port"
94#define SERIALNET_DEFAULT_ETH_MAC "2A02030405060789AB"
95#define SERIALNET_DEFAULT_ETH_CONTROL "USB Ethernet Comm Interface"
96#define SERIALNET_DEFAULT_ETH_DATA "USB Ethernet Data Interface"
97#define SERIALNET_DEFAULT_CONFIGURATION "Default configuration"
98#define SERIALNET_DEFAULT_MANUFACTURER USB_TEMPLATE_MANUFACTURER
99#define SERIALNET_DEFAULT_PRODUCT "Serial/Ethernet device"
106#define SERIALNET_DEFAULT_SERIAL_NUMBER "FreeBSD1"
145 .wMaxSegmentSize = {0xEA, 0x05},
146 .wNumberMCFilters = {0, 0},
147 .bNumberPowerFilters = 0,
169#ifdef USB_HIP_IN_EP_0
170 .bEndpointAddress = USB_HIP_IN_EP_0,
179#ifdef USB_HIP_OUT_EP_0
180 .bEndpointAddress = USB_HIP_OUT_EP_0,
217 .bInterfaceProtocol = 0,
225 .bInterfaceProtocol = 0,
279 0x05, 0x24, 0x00, 0x10, 0x01
291 0x04, 0x24, 0x02, 0x07
315 .bInterfaceProtocol = 0,
346 .bDeviceSubClass = 0,
347 .bDeviceProtocol = 0,
375 if (string_index == 0) {
378 if (lang_id != 0x0409) {
382 return (ptr[string_index]);
390 struct sysctl_oid *parent;
414 SYSCTL_STATIC_CHILDREN(_hw_usb_templates), OID_AUTO,
415 parent_name, CTLFLAG_RW | CTLFLAG_MPSAFE,
416 0,
"USB CDC Serial/Ethernet device side template");
418 "vendor_id", CTLFLAG_RWTUN,
421 "product_id", CTLFLAG_RWTUN,
424 "eth_mac", CTLTYPE_STRING | CTLFLAG_RWTUN | CTLFLAG_MPSAFE,
426 "A",
"Ethernet MAC address string");
429 "modem", CTLTYPE_STRING | CTLFLAG_RWTUN | CTLFLAG_MPSAFE,
431 "A",
"Modem interface string");
433 "eth_control", CTLTYPE_STRING | CTLFLAG_RWTUN | CTLFLAG_MPSAFE,
435 "A",
"Ethernet control interface string");
437 "eth_data", CTLTYPE_STRING | CTLFLAG_RWTUN | CTLFLAG_MPSAFE,
439 "A",
"Ethernet data interface string");
441 "configuration", CTLTYPE_STRING | CTLFLAG_RWTUN | CTLFLAG_MPSAFE,
443 "A",
"Configuration string");
446 "manufacturer", CTLTYPE_STRING | CTLFLAG_RWTUN | CTLFLAG_MPSAFE,
448 "A",
"Manufacturer string");
450 "product", CTLTYPE_STRING | CTLFLAG_RWTUN | CTLFLAG_MPSAFE,
452 "A",
"Product string");
454 "serial_number", CTLTYPE_STRING | CTLFLAG_RWTUN | CTLFLAG_MPSAFE,
456 "A",
"Serial number string");
uDWord bmEthernetStatistics
const struct usb_temp_interface_desc ** ppIfaceDesc
usb_temp_get_string_desc_t * getStringDesc
const struct usb_temp_packet_size * pPacketSize
const struct usb_temp_endpoint_desc ** ppEndpoints
uint8_t bInterval[USB_SPEED_MAX]
uint16_t mps[USB_SPEED_MAX]
#define UISUBCLASS_ABSTRACT_CONTROL_MODEL
#define UDESC_CS_INTERFACE
#define UISUBCLASS_ETHERNET_NETWORKING_CONTROL_MODEL
#define UDCLASS_IN_INTERFACE
#define UDESCSUB_CDC_UNION
#define UDESCSUB_CDC_HEADER
const struct usb_string_lang usb_string_lang_en
int usb_temp_sysctl(SYSCTL_HANDLER_ARGS)
const void *() usb_temp_get_string_desc_t(uint16_t lang_id, uint8_t string_index)
static struct usb_string_descriptor serialnet_eth_mac
static const struct usb_temp_interface_desc eth_control_interface
SYSINIT(serialnet_init, SI_SUB_LOCK, SI_ORDER_FIRST, serialnet_init, NULL)
static const struct usb_temp_interface_desc modem_iface_1
static struct usb_string_descriptor serialnet_eth_data
#define SERIALNET_DEFAULT_VENDOR_ID
static const struct usb_temp_config_desc serialnet_config_desc
static const struct usb_temp_interface_desc eth_data_null_interface
#define SERIALNET_DEFAULT_ETH_MAC
static const uint8_t modem_raw_desc_0[]
static const struct usb_cdc_ethernet_descriptor eth_enf_desc
static void serialnet_uninit(void *arg __unused)
static const struct usb_temp_packet_size bulk_mps
#define SERIALNET_DEFAULT_MANUFACTURER
static const struct usb_temp_interval modem_intr_interval
#define SERIALNET_DEFAULT_ETH_CONTROL
static struct sysctl_ctx_list serialnet_ctx_list
SYSUNINIT(serialnet_uninit, SI_SUB_LOCK, SI_ORDER_FIRST, serialnet_uninit, NULL)
@ SERIALNET_SERIAL_NUMBER_INDEX
@ SERIALNET_CONFIGURATION_INDEX
@ SERIALNET_ETH_DATA_INDEX
@ SERIALNET_PRODUCT_INDEX
@ SERIALNET_MANUFACTURER_INDEX
@ SERIALNET_ETH_MAC_INDEX
@ SERIALNET_ETH_CONTROL_INDEX
#define SERIALNET_DEFAULT_SERIAL_NUMBER
#define SERIALNET_DEFAULT_MODEM
struct usb_temp_device_desc usb_template_serialnet
static struct usb_string_descriptor serialnet_manufacturer
static struct usb_string_descriptor serialnet_serial_number
static const struct usb_cdc_union_descriptor eth_union_desc
static const struct usb_temp_packet_size modem_intr_mps
static const struct usb_temp_endpoint_desc * eth_intr_endpoints[]
static struct usb_string_descriptor serialnet_product
static const struct usb_temp_endpoint_desc bulk_out_ep
static const struct usb_temp_packet_size modem_bulk_mps
#define SERIALNET_DEFAULT_CONFIGURATION
static const struct usb_temp_endpoint_desc bulk_in_ep
static void serialnet_init(void *arg __unused)
static const struct usb_temp_packet_size intr_mps
static const void * eth_control_if_desc[]
static const uint8_t modem_raw_desc_1[]
static struct usb_string_descriptor serialnet_eth_control
static struct usb_string_descriptor serialnet_configuration
static struct usb_string_descriptor serialnet_modem
static const struct usb_temp_endpoint_desc modem_ep_0
static const uint8_t modem_raw_desc_3[]
static const struct usb_temp_endpoint_desc intr_in_ep
static const struct usb_temp_config_desc * serialnet_configs[]
static const struct usb_temp_endpoint_desc * eth_data_endpoints[]
static const struct usb_temp_endpoint_desc * modem_iface_0_ep[]
#define SERIALNET_DEFAULT_PRODUCT_ID
static const struct usb_temp_endpoint_desc * modem_iface_1_ep[]
static usb_temp_get_string_desc_t serialnet_get_string_desc
#define SERIALNET_DEFAULT_ETH_DATA
static const void * modem_iface_0_desc[]
static const struct usb_temp_interface_desc * serialnet_interfaces[]
#define SERIALNET_DEFAULT_PRODUCT
static const struct usb_temp_endpoint_desc modem_ep_1
static const struct usb_temp_interface_desc modem_iface_0
static const struct usb_cdc_header_descriptor eth_header_desc
static const uint8_t modem_raw_desc_2[]
static const struct usb_temp_interface_desc eth_data_interface
static const struct usb_temp_endpoint_desc modem_ep_2
uint8_t usb_make_str_desc(void *ptr, uint16_t max_len, const char *s)