#include <linux/slab.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/device.h>
#include <linux/etherdevice.h>
#include "u_ether.h"
#include "u_ether_configfs.h"
#include "u_ecm.h"
enum ecm_notify_state { … };
struct f_ecm { … };
static inline struct f_ecm *func_to_ecm(struct usb_function *f)
{ … }
#define ECM_STATUS_INTERVAL_MS …
#define ECM_STATUS_BYTECOUNT …
static struct usb_interface_assoc_descriptor
ecm_iad_descriptor = …;
static struct usb_interface_descriptor ecm_control_intf = …;
static struct usb_cdc_header_desc ecm_header_desc = …;
static struct usb_cdc_union_desc ecm_union_desc = …;
static struct usb_cdc_ether_desc ecm_desc = …;
static struct usb_interface_descriptor ecm_data_nop_intf = …;
static struct usb_interface_descriptor ecm_data_intf = …;
static struct usb_endpoint_descriptor fs_ecm_notify_desc = …;
static struct usb_endpoint_descriptor fs_ecm_in_desc = …;
static struct usb_endpoint_descriptor fs_ecm_out_desc = …;
static struct usb_descriptor_header *ecm_fs_function[] = …;
static struct usb_endpoint_descriptor hs_ecm_notify_desc = …;
static struct usb_endpoint_descriptor hs_ecm_in_desc = …;
static struct usb_endpoint_descriptor hs_ecm_out_desc = …;
static struct usb_descriptor_header *ecm_hs_function[] = …;
static struct usb_endpoint_descriptor ss_ecm_notify_desc = …;
static struct usb_ss_ep_comp_descriptor ss_ecm_intr_comp_desc = …;
static struct usb_endpoint_descriptor ss_ecm_in_desc = …;
static struct usb_endpoint_descriptor ss_ecm_out_desc = …;
static struct usb_ss_ep_comp_descriptor ss_ecm_bulk_comp_desc = …;
static struct usb_descriptor_header *ecm_ss_function[] = …;
static struct usb_string ecm_string_defs[] = …;
static struct usb_gadget_strings ecm_string_table = …;
static struct usb_gadget_strings *ecm_strings[] = …;
static void ecm_do_notify(struct f_ecm *ecm)
{ … }
static void ecm_notify(struct f_ecm *ecm)
{ … }
static void ecm_notify_complete(struct usb_ep *ep, struct usb_request *req)
{ … }
static int ecm_setup(struct usb_function *f, const struct usb_ctrlrequest *ctrl)
{ … }
static int ecm_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
{ … }
static int ecm_get_alt(struct usb_function *f, unsigned intf)
{ … }
static void ecm_disable(struct usb_function *f)
{ … }
static void ecm_open(struct gether *geth)
{ … }
static void ecm_close(struct gether *geth)
{ … }
static int
ecm_bind(struct usb_configuration *c, struct usb_function *f)
{ … }
static inline struct f_ecm_opts *to_f_ecm_opts(struct config_item *item)
{ … }
USB_ETHERNET_CONFIGFS_ITEM(…);
USB_ETHERNET_CONFIGFS_ITEM_ATTR_DEV_ADDR(…);
USB_ETHERNET_CONFIGFS_ITEM_ATTR_HOST_ADDR(…);
USB_ETHERNET_CONFIGFS_ITEM_ATTR_QMULT(…);
USB_ETHERNET_CONFIGFS_ITEM_ATTR_IFNAME(…);
static struct configfs_attribute *ecm_attrs[] = …;
static const struct config_item_type ecm_func_type = …;
static void ecm_free_inst(struct usb_function_instance *f)
{ … }
static struct usb_function_instance *ecm_alloc_inst(void)
{ … }
static void ecm_suspend(struct usb_function *f)
{ … }
static void ecm_resume(struct usb_function *f)
{ … }
static void ecm_free(struct usb_function *f)
{ … }
static void ecm_unbind(struct usb_configuration *c, struct usb_function *f)
{ … }
static struct usb_function *ecm_alloc(struct usb_function_instance *fi)
{ … }
DECLARE_USB_FUNCTION_INIT(ecm, ecm_alloc_inst, ecm_alloc);
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
MODULE_AUTHOR(…) …;