linux/drivers/usb/gadget/legacy/multi.c

// SPDX-License-Identifier: GPL-2.0+
/*
 * multi.c -- Multifunction Composite driver
 *
 * Copyright (C) 2008 David Brownell
 * Copyright (C) 2008 Nokia Corporation
 * Copyright (C) 2009 Samsung Electronics
 * Author: Michal Nazarewicz ([email protected])
 */


#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();

/***************************** Device Descriptor ****************************/

#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[] =;




/****************************** Configurations ******************************/

static struct fsg_module_parameters fsg_mod_data =;
#ifdef CONFIG_USB_GADGET_DEBUG_FILES

static unsigned int fsg_num_buffers =;

#else

/*
 * Number of buffers we will use.
 * 2 is usually enough for good buffering pipeline
 */
#define fsg_num_buffers

#endif /* CONFIG_USB_GADGET_DEBUG_FILES */

FSG_MODULE_PARAMETERS();

static struct usb_function_instance *fi_acm;
static struct usb_function_instance *fi_msg;

/********** RNDIS **********/

#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


/********** CDC ECM **********/

#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



/****************************** Gadget Bind ******************************/

static int multi_bind(struct usb_composite_dev *cdev)
{}

static int multi_unbind(struct usb_composite_dev *cdev)
{}


/****************************** Some noise ******************************/


static struct usb_composite_driver multi_driver =;

module_usb_composite_driver();