linux/include/linux/usb/rndis_host.h

// SPDX-License-Identifier: GPL-2.0+
/*
 * Host Side support for RNDIS Networking Links
 * Copyright (C) 2005 by David Brownell
 */

#ifndef	__LINUX_USB_RNDIS_HOST_H
#define __LINUX_USB_RNDIS_HOST_H

#include <linux/rndis.h>

/*
 * CONTROL uses CDC "encapsulated commands" with funky notifications.
 *  - control-out:  SEND_ENCAPSULATED
 *  - interrupt-in:  RESPONSE_AVAILABLE
 *  - control-in:  GET_ENCAPSULATED
 *
 * We'll try to ignore the RESPONSE_AVAILABLE notifications.
 *
 * REVISIT some RNDIS implementations seem to have curious issues still
 * to be resolved.
 */
struct rndis_msg_hdr {} __attribute__ ((packed));

/* MS-Windows uses this strange size, but RNDIS spec says 1024 minimum */
#define CONTROL_BUFFER_SIZE

/* RNDIS defines an (absurdly huge) 10 second control timeout,
 * but ActiveSync seems to use a more usual 5 second timeout
 * (which matches the USB 2.0 spec).
 */
#define RNDIS_CONTROL_TIMEOUT_MS

struct rndis_data_hdr {} __attribute__ ((packed));

struct rndis_init {} __attribute__ ((packed));

struct rndis_init_c {} __attribute__ ((packed));

struct rndis_halt {} __attribute__ ((packed));

struct rndis_query {} __attribute__ ((packed));

struct rndis_query_c {} __attribute__ ((packed));

struct rndis_set {} __attribute__ ((packed));

struct rndis_set_c {} __attribute__ ((packed));

struct rndis_reset {} __attribute__ ((packed));

struct rndis_reset_c {} __attribute__ ((packed));

struct rndis_indicate {} __attribute__ ((packed));

struct rndis_keepalive {} __attribute__ ((packed));

struct rndis_keepalive_c {} __attribute__ ((packed));

/* default filter used with RNDIS devices */
#define RNDIS_DEFAULT_FILTER

/* Flags to require specific physical medium type for generic_rndis_bind() */
#define FLAG_RNDIS_PHYM_NOT_WIRELESS
#define FLAG_RNDIS_PHYM_WIRELESS

/* Flags for driver_info::data */
#define RNDIS_DRIVER_DATA_POLL_STATUS
#define RNDIS_DRIVER_DATA_DST_MAC_FIXUP

extern void rndis_status(struct usbnet *dev, struct urb *urb);
extern int
rndis_command(struct usbnet *dev, struct rndis_msg_hdr *buf, int buflen);
extern int
generic_rndis_bind(struct usbnet *dev, struct usb_interface *intf, int flags);
extern void rndis_unbind(struct usbnet *dev, struct usb_interface *intf);
extern int rndis_rx_fixup(struct usbnet *dev, struct sk_buff *skb);
extern struct sk_buff *
rndis_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags);

#endif	/* __LINUX_USB_RNDIS_HOST_H */