linux/drivers/usb/gadget/function/f_eem.c

// SPDX-License-Identifier: GPL-2.0+
/*
 * f_eem.c -- USB CDC Ethernet (EEM) link function driver
 *
 * Copyright (C) 2003-2005,2008 David Brownell
 * Copyright (C) 2008 Nokia Corporation
 * Copyright (C) 2009 EF Johnson Technologies
 */

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/device.h>
#include <linux/etherdevice.h>
#include <linux/crc32.h>
#include <linux/slab.h>

#include "u_ether.h"
#include "u_ether_configfs.h"
#include "u_eem.h"

#define EEM_HLEN

/*
 * This function is a "CDC Ethernet Emulation Model" (CDC EEM)
 * Ethernet link.
 */

struct f_eem {};

struct in_context {};

static inline struct f_eem *func_to_eem(struct usb_function *f)
{}

/*-------------------------------------------------------------------------*/

/* interface descriptor: */

static struct usb_interface_descriptor eem_intf =;

/* full speed support: */

static struct usb_endpoint_descriptor eem_fs_in_desc =;

static struct usb_endpoint_descriptor eem_fs_out_desc =;

static struct usb_descriptor_header *eem_fs_function[] =;

/* high speed support: */

static struct usb_endpoint_descriptor eem_hs_in_desc =;

static struct usb_endpoint_descriptor eem_hs_out_desc =;

static struct usb_descriptor_header *eem_hs_function[] =;

/* super speed support: */

static struct usb_endpoint_descriptor eem_ss_in_desc =;

static struct usb_endpoint_descriptor eem_ss_out_desc =;

static struct usb_ss_ep_comp_descriptor eem_ss_bulk_comp_desc =;

static struct usb_descriptor_header *eem_ss_function[] =;

/* string descriptors: */

static struct usb_string eem_string_defs[] =;

static struct usb_gadget_strings eem_string_table =;

static struct usb_gadget_strings *eem_strings[] =;

/*-------------------------------------------------------------------------*/

static int eem_setup(struct usb_function *f, const struct usb_ctrlrequest *ctrl)
{}


static int eem_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
{}

static void eem_disable(struct usb_function *f)
{}

/*-------------------------------------------------------------------------*/

/* EEM function driver setup/binding */

static int eem_bind(struct usb_configuration *c, struct usb_function *f)
{}

static void eem_cmd_complete(struct usb_ep *ep, struct usb_request *req)
{}

/*
 * Add the EEM header and ethernet checksum.
 * We currently do not attempt to put multiple ethernet frames
 * into a single USB transfer
 */
static struct sk_buff *eem_wrap(struct gether *port, struct sk_buff *skb)
{}

/*
 * Remove the EEM header.  Note that there can be many EEM packets in a single
 * USB transfer, so we need to break them out and handle them independently.
 */
static int eem_unwrap(struct gether *port,
			struct sk_buff *skb,
			struct sk_buff_head *list)
{}

static inline struct f_eem_opts *to_f_eem_opts(struct config_item *item)
{}

/* f_eem_item_ops */
USB_ETHERNET_CONFIGFS_ITEM();

/* f_eem_opts_dev_addr */
USB_ETHERNET_CONFIGFS_ITEM_ATTR_DEV_ADDR();

/* f_eem_opts_host_addr */
USB_ETHERNET_CONFIGFS_ITEM_ATTR_HOST_ADDR();

/* f_eem_opts_qmult */
USB_ETHERNET_CONFIGFS_ITEM_ATTR_QMULT();

/* f_eem_opts_ifname */
USB_ETHERNET_CONFIGFS_ITEM_ATTR_IFNAME();

static struct configfs_attribute *eem_attrs[] =;

static const struct config_item_type eem_func_type =;

static void eem_free_inst(struct usb_function_instance *f)
{}

static struct usb_function_instance *eem_alloc_inst(void)
{}

static void eem_free(struct usb_function *f)
{}

static void eem_unbind(struct usb_configuration *c, struct usb_function *f)
{}

static struct usb_function *eem_alloc(struct usb_function_instance *fi)
{}

DECLARE_USB_FUNCTION_INIT(eem, eem_alloc_inst, eem_alloc);
MODULE_DESCRIPTION();
MODULE_LICENSE();
MODULE_AUTHOR();