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

// SPDX-License-Identifier: GPL-2.0+
/*
 * f_obex.c -- USB CDC OBEX function driver
 *
 * Copyright (C) 2008 Nokia Corporation
 * Contact: Felipe Balbi <[email protected]>
 *
 * Based on f_acm.c by Al Borchers and David Brownell.
 */

/* #define VERBOSE_DEBUG */

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

#include "u_serial.h"


/*
 * This CDC OBEX function support just packages a TTY-ish byte stream.
 * A user mode server will put it into "raw" mode and handle all the
 * relevant protocol details ... this is just a kernel passthrough.
 * When possible, we prevent gadget enumeration until that server is
 * ready to handle the commands.
 */

struct f_obex {};

static inline struct f_obex *func_to_obex(struct usb_function *f)
{}

static inline struct f_obex *port_to_obex(struct gserial *p)
{}

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

#define OBEX_CTRL_IDX
#define OBEX_DATA_IDX

static struct usb_string obex_string_defs[] =;

static struct usb_gadget_strings obex_string_table =;

static struct usb_gadget_strings *obex_strings[] =;

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

static struct usb_interface_descriptor obex_control_intf =;

static struct usb_interface_descriptor obex_data_nop_intf =;

static struct usb_interface_descriptor obex_data_intf =;

static struct usb_cdc_header_desc obex_cdc_header_desc =;

static struct usb_cdc_union_desc obex_cdc_union_desc =;

static struct usb_cdc_obex_desc obex_desc =;

/* High-Speed Support */

static struct usb_endpoint_descriptor obex_hs_ep_out_desc =;

static struct usb_endpoint_descriptor obex_hs_ep_in_desc =;

static struct usb_descriptor_header *hs_function[] =;

/* Full-Speed Support */

static struct usb_endpoint_descriptor obex_fs_ep_in_desc =;

static struct usb_endpoint_descriptor obex_fs_ep_out_desc =;

static struct usb_descriptor_header *fs_function[] =;

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

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

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

static void obex_disable(struct usb_function *f)
{}

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

static void obex_connect(struct gserial *g)
{}

static void obex_disconnect(struct gserial *g)
{}

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

/* Some controllers can't support CDC OBEX ... */
static inline bool can_support_obex(struct usb_configuration *c)
{}

static int obex_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 obex_attr_release(struct config_item *item)
{}

static struct configfs_item_operations obex_item_ops =;

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

CONFIGFS_ATTR_RO();

static struct configfs_attribute *acm_attrs[] =;

static const struct config_item_type obex_func_type =;

static void obex_free_inst(struct usb_function_instance *f)
{}

static struct usb_function_instance *obex_alloc_inst(void)
{}

static void obex_free(struct usb_function *f)
{}

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

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

DECLARE_USB_FUNCTION_INIT(obex, obex_alloc_inst, obex_alloc);
MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();