usb/net: rndis: break out <linux/rndis.h> defines

As a first step to consolidate the RNDIS implementations, break out
a common file with all the #defines and move it to <linux/rndis.h>.

This also deletes the immediate duplicated defines in the
<linux/rndis.h> file that yields a lot of compilation warnings.

Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Linus Walleij 2012-05-11 22:15:50 +00:00 committed by David S. Miller
parent 7390e8b0de
commit 7591157e18
6 changed files with 565 additions and 613 deletions

View file

@ -20,6 +20,8 @@
#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
@ -49,47 +51,6 @@ struct rndis_msg_hdr {
*/
#define RNDIS_CONTROL_TIMEOUT_MS (5 * 1000)
#define RNDIS_MSG_COMPLETION 0x80000000
/* codes for "msg_type" field of rndis messages;
* only the data channel uses packet messages (maybe batched);
* everything else goes on the control channel.
*/
#define RNDIS_MSG_PACKET 0x00000001 /* 1-N packets */
#define RNDIS_MSG_INIT 0x00000002
#define RNDIS_MSG_INIT_C (RNDIS_MSG_INIT|RNDIS_MSG_COMPLETION)
#define RNDIS_MSG_HALT 0x00000003
#define RNDIS_MSG_QUERY 0x00000004
#define RNDIS_MSG_QUERY_C (RNDIS_MSG_QUERY|RNDIS_MSG_COMPLETION)
#define RNDIS_MSG_SET 0x00000005
#define RNDIS_MSG_SET_C (RNDIS_MSG_SET|RNDIS_MSG_COMPLETION)
#define RNDIS_MSG_RESET 0x00000006
#define RNDIS_MSG_RESET_C (RNDIS_MSG_RESET|RNDIS_MSG_COMPLETION)
#define RNDIS_MSG_INDICATE 0x00000007
#define RNDIS_MSG_KEEPALIVE 0x00000008
#define RNDIS_MSG_KEEPALIVE_C (RNDIS_MSG_KEEPALIVE|RNDIS_MSG_COMPLETION)
/* codes for "status" field of completion messages */
#define RNDIS_STATUS_SUCCESS 0x00000000
#define RNDIS_STATUS_FAILURE 0xc0000001
#define RNDIS_STATUS_INVALID_DATA 0xc0010015
#define RNDIS_STATUS_NOT_SUPPORTED 0xc00000bb
#define RNDIS_STATUS_MEDIA_CONNECT 0x4001000b
#define RNDIS_STATUS_MEDIA_DISCONNECT 0x4001000c
#define RNDIS_STATUS_MEDIA_SPECIFIC_INDICATION 0x40010012
/* codes for OID_GEN_PHYSICAL_MEDIUM */
#define RNDIS_PHYSICAL_MEDIUM_UNSPECIFIED 0x00000000
#define RNDIS_PHYSICAL_MEDIUM_WIRELESS_LAN 0x00000001
#define RNDIS_PHYSICAL_MEDIUM_CABLE_MODEM 0x00000002
#define RNDIS_PHYSICAL_MEDIUM_PHONE_LINE 0x00000003
#define RNDIS_PHYSICAL_MEDIUM_POWER_LINE 0x00000004
#define RNDIS_PHYSICAL_MEDIUM_DSL 0x00000005
#define RNDIS_PHYSICAL_MEDIUM_FIBRE_CHANNEL 0x00000006
#define RNDIS_PHYSICAL_MEDIUM_1394 0x00000007
#define RNDIS_PHYSICAL_MEDIUM_WIRELESS_WAN 0x00000008
#define RNDIS_PHYSICAL_MEDIUM_MAX 0x00000009
struct rndis_data_hdr {
__le32 msg_type; /* RNDIS_MSG_PACKET */
__le32 msg_len; /* rndis_data_hdr + data_len + pad */
@ -222,29 +183,6 @@ struct rndis_keepalive_c { /* IN (optionally OUT) */
__le32 status;
} __attribute__ ((packed));
/* NOTE: about 30 OIDs are "mandatory" for peripherals to support ... and
* there are gobs more that may optionally be supported. We'll avoid as much
* of that mess as possible.
*/
#define OID_802_3_PERMANENT_ADDRESS 0x01010101
#define OID_GEN_MAXIMUM_FRAME_SIZE 0x00010106
#define OID_GEN_CURRENT_PACKET_FILTER 0x0001010e
#define OID_GEN_PHYSICAL_MEDIUM 0x00010202
/* packet filter bits used by OID_GEN_CURRENT_PACKET_FILTER */
#define RNDIS_PACKET_TYPE_DIRECTED 0x00000001
#define RNDIS_PACKET_TYPE_MULTICAST 0x00000002
#define RNDIS_PACKET_TYPE_ALL_MULTICAST 0x00000004
#define RNDIS_PACKET_TYPE_BROADCAST 0x00000008
#define RNDIS_PACKET_TYPE_SOURCE_ROUTING 0x00000010
#define RNDIS_PACKET_TYPE_PROMISCUOUS 0x00000020
#define RNDIS_PACKET_TYPE_SMT 0x00000040
#define RNDIS_PACKET_TYPE_ALL_LOCAL 0x00000080
#define RNDIS_PACKET_TYPE_GROUP 0x00001000
#define RNDIS_PACKET_TYPE_ALL_FUNCTIONAL 0x00002000
#define RNDIS_PACKET_TYPE_FUNCTIONAL 0x00004000
#define RNDIS_PACKET_TYPE_MAC_FRAME 0x00008000
/* default filter used with RNDIS devices */
#define RNDIS_DEFAULT_FILTER ( \
RNDIS_PACKET_TYPE_DIRECTED | \