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

// SPDX-License-Identifier: GPL-2.0+
/*
 * f_serial.c - generic USB serial function driver
 *
 * Copyright (C) 2003 Al Borchers ([email protected])
 * Copyright (C) 2008 by David Brownell
 * Copyright (C) 2008 by Nokia Corporation
 */

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

#include "u_serial.h"


/*
 * This function packages a simple "generic serial" port with no real
 * control mechanisms, just raw data transfer over two bulk endpoints.
 *
 * Because it's not standardized, this isn't as interoperable as the
 * CDC ACM driver.  However, for many purposes it's just as functional
 * if you can arrange appropriate host side drivers.
 */

struct f_gser {};

static inline struct f_gser *func_to_gser(struct usb_function *f)
{}

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

/* interface descriptor: */

static struct usb_interface_descriptor gser_interface_desc =;

/* full speed support: */

static struct usb_endpoint_descriptor gser_fs_in_desc =;

static struct usb_endpoint_descriptor gser_fs_out_desc =;

static struct usb_descriptor_header *gser_fs_function[] =;

/* high speed support: */

static struct usb_endpoint_descriptor gser_hs_in_desc =;

static struct usb_endpoint_descriptor gser_hs_out_desc =;

static struct usb_descriptor_header *gser_hs_function[] =;

static struct usb_endpoint_descriptor gser_ss_in_desc =;

static struct usb_endpoint_descriptor gser_ss_out_desc =;

static struct usb_ss_ep_comp_descriptor gser_ss_bulk_comp_desc =;

static struct usb_descriptor_header *gser_ss_function[] =;

/* string descriptors: */

static struct usb_string gser_string_defs[] =;

static struct usb_gadget_strings gser_string_table =;

static struct usb_gadget_strings *gser_strings[] =;

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

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

static void gser_disable(struct usb_function *f)
{}

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

/* serial function driver setup/binding */

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

static inline struct f_serial_opts *to_f_serial_opts(struct config_item *item)
{}

static void serial_attr_release(struct config_item *item)
{}

static struct configfs_item_operations serial_item_ops =;

#ifdef CONFIG_U_SERIAL_CONSOLE

static ssize_t f_serial_console_store(struct config_item *item,
		const char *page, size_t count)
{}

static ssize_t f_serial_console_show(struct config_item *item, char *page)
{}

CONFIGFS_ATTR();

#endif /* CONFIG_U_SERIAL_CONSOLE */

static ssize_t f_serial_port_num_show(struct config_item *item, char *page)
{}

CONFIGFS_ATTR_RO();

static struct configfs_attribute *acm_attrs[] =;

static const struct config_item_type serial_func_type =;

static void gser_free_inst(struct usb_function_instance *f)
{}

static struct usb_function_instance *gser_alloc_inst(void)
{}

static void gser_free(struct usb_function *f)
{}

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

static void gser_resume(struct usb_function *f)
{}

static void gser_suspend(struct usb_function *f)
{}

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

DECLARE_USB_FUNCTION_INIT(gser, gser_alloc_inst, gser_alloc);
MODULE_DESCRIPTION();
MODULE_LICENSE();
MODULE_AUTHOR();
MODULE_AUTHOR();