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

// SPDX-License-Identifier: GPL-2.0
/*
 * RNDIS MSG parser
 *
 * Authors:	Benedikt Spranger, Pengutronix
 *		Robert Schwebel, Pengutronix
 *
 *		This software was originally developed in conformance with
 *		Microsoft's Remote NDIS Specification License Agreement.
 *
 * 03/12/2004 Kai-Uwe Bloem <[email protected]>
 *		Fixed message length bug in init_response
 *
 * 03/25/2004 Kai-Uwe Bloem <[email protected]>
 *		Fixed rndis_rm_hdr length bug.
 *
 * Copyright (C) 2004 by David Brownell
 *		updates to merge with Linux 2.6, better match RNDIS spec
 */

#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/idr.h>
#include <linux/list.h>
#include <linux/proc_fs.h>
#include <linux/slab.h>
#include <linux/seq_file.h>
#include <linux/netdevice.h>

#include <asm/io.h>
#include <asm/byteorder.h>
#include <linux/unaligned.h>

#include "u_rndis.h"

#undef	VERBOSE_DEBUG

#include "rndis.h"


/* The driver for your USB chip needs to support ep0 OUT to work with
 * RNDIS, plus all three CDC Ethernet endpoints (interrupt not optional).
 *
 * Windows hosts need an INF file like Documentation/usb/linux.inf
 * and will be happier if you provide the host_addr module parameter.
 */

#if 0
static int rndis_debug = 0;
module_param (rndis_debug, int, 0);
MODULE_PARM_DESC (rndis_debug, "enable debugging");
#else
#define rndis_debug
#endif

#ifdef CONFIG_USB_GADGET_DEBUG_FILES

#define NAME_TEMPLATE

#endif /* CONFIG_USB_GADGET_DEBUG_FILES */

static DEFINE_IDA(rndis_ida);

/* Driver Version */
static const __le32 rndis_driver_version =;

/* Function Prototypes */
static rndis_resp_t *rndis_add_response(struct rndis_params *params,
					u32 length);

#ifdef CONFIG_USB_GADGET_DEBUG_FILES

static const struct proc_ops rndis_proc_ops;

#endif /* CONFIG_USB_GADGET_DEBUG_FILES */

/* supported OIDs */
static const u32 oid_supported_list[] =;


/* NDIS Functions */
static int gen_ndis_query_resp(struct rndis_params *params, u32 OID, u8 *buf,
			       unsigned buf_len, rndis_resp_t *r)
{}

static int gen_ndis_set_resp(struct rndis_params *params, u32 OID,
			     u8 *buf, u32 buf_len, rndis_resp_t *r)
{}

/*
 * Response Functions
 */

static int rndis_init_response(struct rndis_params *params,
			       rndis_init_msg_type *buf)
{}

static int rndis_query_response(struct rndis_params *params,
				rndis_query_msg_type *buf)
{}

static int rndis_set_response(struct rndis_params *params,
			      rndis_set_msg_type *buf)
{}

static int rndis_reset_response(struct rndis_params *params,
				rndis_reset_msg_type *buf)
{}

static int rndis_keepalive_response(struct rndis_params *params,
				    rndis_keepalive_msg_type *buf)
{}


/*
 * Device to Host Comunication
 */
static int rndis_indicate_status_msg(struct rndis_params *params, u32 status)
{}

int rndis_signal_connect(struct rndis_params *params)
{}
EXPORT_SYMBOL_GPL();

int rndis_signal_disconnect(struct rndis_params *params)
{}
EXPORT_SYMBOL_GPL();

void rndis_uninit(struct rndis_params *params)
{}
EXPORT_SYMBOL_GPL();

void rndis_set_host_mac(struct rndis_params *params, const u8 *addr)
{}
EXPORT_SYMBOL_GPL();

/*
 * Message Parser
 */
int rndis_msg_parser(struct rndis_params *params, u8 *buf)
{}
EXPORT_SYMBOL_GPL();

static inline int rndis_get_nr(void)
{}

static inline void rndis_put_nr(int nr)
{}

struct rndis_params *rndis_register(void (*resp_avail)(void *v), void *v)
{}
EXPORT_SYMBOL_GPL();

void rndis_deregister(struct rndis_params *params)
{}
EXPORT_SYMBOL_GPL();
int rndis_set_param_dev(struct rndis_params *params, struct net_device *dev,
			u16 *cdc_filter)
{}
EXPORT_SYMBOL_GPL();

int rndis_set_param_vendor(struct rndis_params *params, u32 vendorID,
			   const char *vendorDescr)
{}
EXPORT_SYMBOL_GPL();

int rndis_set_param_medium(struct rndis_params *params, u32 medium, u32 speed)
{}
EXPORT_SYMBOL_GPL();

void rndis_add_hdr(struct sk_buff *skb)
{}
EXPORT_SYMBOL_GPL();

void rndis_free_response(struct rndis_params *params, u8 *buf)
{}
EXPORT_SYMBOL_GPL();

u8 *rndis_get_next_response(struct rndis_params *params, u32 *length)
{}
EXPORT_SYMBOL_GPL();

static rndis_resp_t *rndis_add_response(struct rndis_params *params, u32 length)
{}

int rndis_rm_hdr(struct gether *port,
			struct sk_buff *skb,
			struct sk_buff_head *list)
{}
EXPORT_SYMBOL_GPL();

#ifdef CONFIG_USB_GADGET_DEBUG_FILES

static int rndis_proc_show(struct seq_file *m, void *v)
{}

static ssize_t rndis_proc_write(struct file *file, const char __user *buffer,
				size_t count, loff_t *ppos)
{}

static int rndis_proc_open(struct inode *inode, struct file *file)
{}

static const struct proc_ops rndis_proc_ops =;

#define NAME_TEMPLATE

#endif /* CONFIG_USB_GADGET_DEBUG_FILES */