#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/netdevice.h>
#include "u_serial.h"
#if defined USB_ETH_RNDIS
# undef USB_ETH_RNDIS
#endif
#ifdef CONFIG_USB_G_MULTI_RNDIS
#define USB_ETH_RNDIS …
#endif
#define DRIVER_DESC …
MODULE_DESCRIPTION(…);
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;
#include "f_mass_storage.h"
#include "u_ecm.h"
#ifdef USB_ETH_RNDIS
# include "u_rndis.h"
# include "rndis.h"
#endif
#include "u_ether.h"
USB_GADGET_COMPOSITE_OPTIONS(…);
USB_ETHERNET_MODULE_PARAMETERS(…);
#define MULTI_VENDOR_NUM …
#define MULTI_PRODUCT_NUM …
enum { … };
static struct usb_device_descriptor device_desc = …;
static const struct usb_descriptor_header *otg_desc[2];
enum { … };
static struct usb_string strings_dev[] = …;
static struct usb_gadget_strings *dev_strings[] = …;
static struct fsg_module_parameters fsg_mod_data = …;
#ifdef CONFIG_USB_GADGET_DEBUG_FILES
static unsigned int fsg_num_buffers = …;
#else
#define fsg_num_buffers …
#endif
FSG_MODULE_PARAMETERS(…);
static struct usb_function_instance *fi_acm;
static struct usb_function_instance *fi_msg;
#ifdef USB_ETH_RNDIS
static struct usb_function_instance *fi_rndis;
static struct usb_function *f_acm_rndis;
static struct usb_function *f_rndis;
static struct usb_function *f_msg_rndis;
static int rndis_do_config(struct usb_configuration *c)
{ … }
static int rndis_config_register(struct usb_composite_dev *cdev)
{ … }
#else
static int rndis_config_register(struct usb_composite_dev *cdev)
{
return 0;
}
#endif
#ifdef CONFIG_USB_G_MULTI_CDC
static struct usb_function_instance *fi_ecm;
static struct usb_function *f_acm_multi;
static struct usb_function *f_ecm;
static struct usb_function *f_msg_multi;
static int cdc_do_config(struct usb_configuration *c)
{ … }
static int cdc_config_register(struct usb_composite_dev *cdev)
{ … }
#else
static int cdc_config_register(struct usb_composite_dev *cdev)
{
return 0;
}
#endif
static int multi_bind(struct usb_composite_dev *cdev)
{ … }
static int multi_unbind(struct usb_composite_dev *cdev)
{ … }
static struct usb_composite_driver multi_driver = …;
module_usb_composite_driver(…);