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

// SPDX-License-Identifier: GPL-2.0+
/*
 * storage_common.c -- Common definitions for mass storage functionality
 *
 * Copyright (C) 2003-2008 Alan Stern
 * Copyeight (C) 2009 Samsung Electronics
 * Author: Michal Nazarewicz ([email protected])
 */

/*
 * This file requires the following identifiers used in USB strings to
 * be defined (each of type pointer to char):
 *  - fsg_string_interface    -- name of the interface
 */

/*
 * When USB_GADGET_DEBUG_FILES is defined the module param num_buffers
 * sets the number of pipeline buffers (length of the fsg_buffhd array).
 * The valid range of num_buffers is: num >= 2 && num <= 4.
 */

#include <linux/module.h>
#include <linux/blkdev.h>
#include <linux/file.h>
#include <linux/fs.h>
#include <linux/kstrtox.h>
#include <linux/usb/composite.h>

#include "storage_common.h"

/* There is only one interface. */

struct usb_interface_descriptor fsg_intf_desc =;
EXPORT_SYMBOL_GPL();

/*
 * Three full-speed endpoint descriptors: bulk-in, bulk-out, and
 * interrupt-in.
 */

struct usb_endpoint_descriptor fsg_fs_bulk_in_desc =;
EXPORT_SYMBOL_GPL();

struct usb_endpoint_descriptor fsg_fs_bulk_out_desc =;
EXPORT_SYMBOL_GPL();

struct usb_descriptor_header *fsg_fs_function[] =;
EXPORT_SYMBOL_GPL();


/*
 * USB 2.0 devices need to expose both high speed and full speed
 * descriptors, unless they only run at full speed.
 *
 * That means alternate endpoint descriptors (bigger packets).
 */
struct usb_endpoint_descriptor fsg_hs_bulk_in_desc =;
EXPORT_SYMBOL_GPL();

struct usb_endpoint_descriptor fsg_hs_bulk_out_desc =;
EXPORT_SYMBOL_GPL();


struct usb_descriptor_header *fsg_hs_function[] =;
EXPORT_SYMBOL_GPL();

struct usb_endpoint_descriptor fsg_ss_bulk_in_desc =;
EXPORT_SYMBOL_GPL();

struct usb_ss_ep_comp_descriptor fsg_ss_bulk_in_comp_desc =;
EXPORT_SYMBOL_GPL();

struct usb_endpoint_descriptor fsg_ss_bulk_out_desc =;
EXPORT_SYMBOL_GPL();

struct usb_ss_ep_comp_descriptor fsg_ss_bulk_out_comp_desc =;
EXPORT_SYMBOL_GPL();

struct usb_descriptor_header *fsg_ss_function[] =;
EXPORT_SYMBOL_GPL();


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

/*
 * If the next two routines are called while the gadget is registered,
 * the caller must own fsg->filesem for writing.
 */

void fsg_lun_close(struct fsg_lun *curlun)
{}
EXPORT_SYMBOL_GPL();

int fsg_lun_open(struct fsg_lun *curlun, const char *filename)
{}
EXPORT_SYMBOL_GPL();


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

/*
 * Sync the file data, don't bother with the metadata.
 * This code was copied from fs/buffer.c:sys_fdatasync().
 */
int fsg_lun_fsync_sub(struct fsg_lun *curlun)
{}
EXPORT_SYMBOL_GPL();

void store_cdrom_address(u8 *dest, int msf, u32 addr)
{}
EXPORT_SYMBOL_GPL();

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


ssize_t fsg_show_ro(struct fsg_lun *curlun, char *buf)
{}
EXPORT_SYMBOL_GPL();

ssize_t fsg_show_nofua(struct fsg_lun *curlun, char *buf)
{}
EXPORT_SYMBOL_GPL();

ssize_t fsg_show_file(struct fsg_lun *curlun, struct rw_semaphore *filesem,
		      char *buf)
{}
EXPORT_SYMBOL_GPL();

ssize_t fsg_show_cdrom(struct fsg_lun *curlun, char *buf)
{}
EXPORT_SYMBOL_GPL();

ssize_t fsg_show_removable(struct fsg_lun *curlun, char *buf)
{}
EXPORT_SYMBOL_GPL();

ssize_t fsg_show_inquiry_string(struct fsg_lun *curlun, char *buf)
{}
EXPORT_SYMBOL_GPL();

/*
 * The caller must hold fsg->filesem for reading when calling this function.
 */
static ssize_t _fsg_store_ro(struct fsg_lun *curlun, bool ro)
{}

ssize_t fsg_store_ro(struct fsg_lun *curlun, struct rw_semaphore *filesem,
		     const char *buf, size_t count)
{}
EXPORT_SYMBOL_GPL();

ssize_t fsg_store_nofua(struct fsg_lun *curlun, const char *buf, size_t count)
{}
EXPORT_SYMBOL_GPL();

ssize_t fsg_store_file(struct fsg_lun *curlun, struct rw_semaphore *filesem,
		       const char *buf, size_t count)
{}
EXPORT_SYMBOL_GPL();

ssize_t fsg_store_cdrom(struct fsg_lun *curlun, struct rw_semaphore *filesem,
			const char *buf, size_t count)
{}
EXPORT_SYMBOL_GPL();

ssize_t fsg_store_removable(struct fsg_lun *curlun, const char *buf,
			    size_t count)
{}
EXPORT_SYMBOL_GPL();

ssize_t fsg_store_inquiry_string(struct fsg_lun *curlun, const char *buf,
				 size_t count)
{}
EXPORT_SYMBOL_GPL();

ssize_t fsg_store_forced_eject(struct fsg_lun *curlun, struct rw_semaphore *filesem,
			       const char *buf, size_t count)
{}
EXPORT_SYMBOL_GPL();

MODULE_DESCRIPTION();
MODULE_LICENSE();