diff options
| author | Linus Walleij <linus.walleij@linaro.org> | 2012-05-11 18:15:50 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2012-05-12 15:02:22 -0400 |
| commit | 7591157e1848b5db900b34016e2a2182329a93bb (patch) | |
| tree | 47b1a5cfd7f4f1162831638d5be4514b3b8bc74b /include/linux/usb | |
| parent | 7390e8b0dee778b0a964337558990a91094e679a (diff) | |
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>
Diffstat (limited to 'include/linux/usb')
| -rw-r--r-- | include/linux/usb/rndis_host.h | 66 |
1 files changed, 2 insertions, 64 deletions
diff --git a/include/linux/usb/rndis_host.h b/include/linux/usb/rndis_host.h index 9a005b627eb2..d44ef85db177 100644 --- a/include/linux/usb/rndis_host.h +++ b/include/linux/usb/rndis_host.h | |||
| @@ -20,6 +20,8 @@ | |||
| 20 | #ifndef __LINUX_USB_RNDIS_HOST_H | 20 | #ifndef __LINUX_USB_RNDIS_HOST_H |
| 21 | #define __LINUX_USB_RNDIS_HOST_H | 21 | #define __LINUX_USB_RNDIS_HOST_H |
| 22 | 22 | ||
| 23 | #include <linux/rndis.h> | ||
| 24 | |||
| 23 | /* | 25 | /* |
| 24 | * CONTROL uses CDC "encapsulated commands" with funky notifications. | 26 | * CONTROL uses CDC "encapsulated commands" with funky notifications. |
| 25 | * - control-out: SEND_ENCAPSULATED | 27 | * - control-out: SEND_ENCAPSULATED |
| @@ -49,47 +51,6 @@ struct rndis_msg_hdr { | |||
| 49 | */ | 51 | */ |
| 50 | #define RNDIS_CONTROL_TIMEOUT_MS (5 * 1000) | 52 | #define RNDIS_CONTROL_TIMEOUT_MS (5 * 1000) |
| 51 | 53 | ||
| 52 | #define RNDIS_MSG_COMPLETION 0x80000000 | ||
| 53 | |||
| 54 | /* codes for "msg_type" field of rndis messages; | ||
| 55 | * only the data channel uses packet messages (maybe batched); | ||
| 56 | * everything else goes on the control channel. | ||
| 57 | */ | ||
| 58 | #define RNDIS_MSG_PACKET 0x00000001 /* 1-N packets */ | ||
| 59 | #define RNDIS_MSG_INIT 0x00000002 | ||
| 60 | #define RNDIS_MSG_INIT_C (RNDIS_MSG_INIT|RNDIS_MSG_COMPLETION) | ||
| 61 | #define RNDIS_MSG_HALT 0x00000003 | ||
| 62 | #define RNDIS_MSG_QUERY 0x00000004 | ||
| 63 | #define RNDIS_MSG_QUERY_C (RNDIS_MSG_QUERY|RNDIS_MSG_COMPLETION) | ||
| 64 | #define RNDIS_MSG_SET 0x00000005 | ||
| 65 | #define RNDIS_MSG_SET_C (RNDIS_MSG_SET|RNDIS_MSG_COMPLETION) | ||
| 66 | #define RNDIS_MSG_RESET 0x00000006 | ||
| 67 | #define RNDIS_MSG_RESET_C (RNDIS_MSG_RESET|RNDIS_MSG_COMPLETION) | ||
| 68 | #define RNDIS_MSG_INDICATE 0x00000007 | ||
| 69 | #define RNDIS_MSG_KEEPALIVE 0x00000008 | ||
| 70 | #define RNDIS_MSG_KEEPALIVE_C (RNDIS_MSG_KEEPALIVE|RNDIS_MSG_COMPLETION) | ||
| 71 | |||
| 72 | /* codes for "status" field of completion messages */ | ||
| 73 | #define RNDIS_STATUS_SUCCESS 0x00000000 | ||
| 74 | #define RNDIS_STATUS_FAILURE 0xc0000001 | ||
| 75 | #define RNDIS_STATUS_INVALID_DATA 0xc0010015 | ||
| 76 | #define RNDIS_STATUS_NOT_SUPPORTED 0xc00000bb | ||
| 77 | #define RNDIS_STATUS_MEDIA_CONNECT 0x4001000b | ||
| 78 | #define RNDIS_STATUS_MEDIA_DISCONNECT 0x4001000c | ||
| 79 | #define RNDIS_STATUS_MEDIA_SPECIFIC_INDICATION 0x40010012 | ||
| 80 | |||
| 81 | /* codes for OID_GEN_PHYSICAL_MEDIUM */ | ||
| 82 | #define RNDIS_PHYSICAL_MEDIUM_UNSPECIFIED 0x00000000 | ||
| 83 | #define RNDIS_PHYSICAL_MEDIUM_WIRELESS_LAN 0x00000001 | ||
| 84 | #define RNDIS_PHYSICAL_MEDIUM_CABLE_MODEM 0x00000002 | ||
| 85 | #define RNDIS_PHYSICAL_MEDIUM_PHONE_LINE 0x00000003 | ||
| 86 | #define RNDIS_PHYSICAL_MEDIUM_POWER_LINE 0x00000004 | ||
| 87 | #define RNDIS_PHYSICAL_MEDIUM_DSL 0x00000005 | ||
| 88 | #define RNDIS_PHYSICAL_MEDIUM_FIBRE_CHANNEL 0x00000006 | ||
| 89 | #define RNDIS_PHYSICAL_MEDIUM_1394 0x00000007 | ||
| 90 | #define RNDIS_PHYSICAL_MEDIUM_WIRELESS_WAN 0x00000008 | ||
| 91 | #define RNDIS_PHYSICAL_MEDIUM_MAX 0x00000009 | ||
| 92 | |||
| 93 | struct rndis_data_hdr { | 54 | struct rndis_data_hdr { |
| 94 | __le32 msg_type; /* RNDIS_MSG_PACKET */ | 55 | __le32 msg_type; /* RNDIS_MSG_PACKET */ |
| 95 | __le32 msg_len; /* rndis_data_hdr + data_len + pad */ | 56 | __le32 msg_len; /* rndis_data_hdr + data_len + pad */ |
| @@ -222,29 +183,6 @@ struct rndis_keepalive_c { /* IN (optionally OUT) */ | |||
| 222 | __le32 status; | 183 | __le32 status; |
| 223 | } __attribute__ ((packed)); | 184 | } __attribute__ ((packed)); |
| 224 | 185 | ||
| 225 | /* NOTE: about 30 OIDs are "mandatory" for peripherals to support ... and | ||
| 226 | * there are gobs more that may optionally be supported. We'll avoid as much | ||
| 227 | * of that mess as possible. | ||
| 228 | */ | ||
| 229 | #define OID_802_3_PERMANENT_ADDRESS 0x01010101 | ||
| 230 | #define OID_GEN_MAXIMUM_FRAME_SIZE 0x00010106 | ||
| 231 | #define OID_GEN_CURRENT_PACKET_FILTER 0x0001010e | ||
| 232 | #define OID_GEN_PHYSICAL_MEDIUM 0x00010202 | ||
| 233 | |||
| 234 | /* packet filter bits used by OID_GEN_CURRENT_PACKET_FILTER */ | ||
| 235 | #define RNDIS_PACKET_TYPE_DIRECTED 0x00000001 | ||
| 236 | #define RNDIS_PACKET_TYPE_MULTICAST 0x00000002 | ||
| 237 | #define RNDIS_PACKET_TYPE_ALL_MULTICAST 0x00000004 | ||
| 238 | #define RNDIS_PACKET_TYPE_BROADCAST 0x00000008 | ||
| 239 | #define RNDIS_PACKET_TYPE_SOURCE_ROUTING 0x00000010 | ||
| 240 | #define RNDIS_PACKET_TYPE_PROMISCUOUS 0x00000020 | ||
| 241 | #define RNDIS_PACKET_TYPE_SMT 0x00000040 | ||
| 242 | #define RNDIS_PACKET_TYPE_ALL_LOCAL 0x00000080 | ||
| 243 | #define RNDIS_PACKET_TYPE_GROUP 0x00001000 | ||
| 244 | #define RNDIS_PACKET_TYPE_ALL_FUNCTIONAL 0x00002000 | ||
| 245 | #define RNDIS_PACKET_TYPE_FUNCTIONAL 0x00004000 | ||
| 246 | #define RNDIS_PACKET_TYPE_MAC_FRAME 0x00008000 | ||
| 247 | |||
| 248 | /* default filter used with RNDIS devices */ | 186 | /* default filter used with RNDIS devices */ |
| 249 | #define RNDIS_DEFAULT_FILTER ( \ | 187 | #define RNDIS_DEFAULT_FILTER ( \ |
| 250 | RNDIS_PACKET_TYPE_DIRECTED | \ | 188 | RNDIS_PACKET_TYPE_DIRECTED | \ |
