1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 #ifndef __LINUX_USB_RNDIS_HOST_H
22 #define __LINUX_USB_RNDIS_HOST_H
23
24 #include <linux/rndis.h>
25
26
27
28
29
30
31
32
33
34
35
36
37 struct rndis_msg_hdr {
38 __le32 msg_type;
39 __le32 msg_len;
40
41 __le32 request_id;
42 __le32 status;
43
44 } __attribute__ ((packed));
45
46
47 #define CONTROL_BUFFER_SIZE 1025
48
49
50
51
52
53 #define RNDIS_CONTROL_TIMEOUT_MS (5 * 1000)
54
55 struct rndis_data_hdr {
56 __le32 msg_type;
57 __le32 msg_len;
58 __le32 data_offset;
59 __le32 data_len;
60
61 __le32 oob_data_offset;
62 __le32 oob_data_len;
63 __le32 num_oob;
64 __le32 packet_data_offset;
65
66 __le32 packet_data_len;
67 __le32 vc_handle;
68 __le32 reserved;
69 } __attribute__ ((packed));
70
71 struct rndis_init {
72
73 __le32 msg_type;
74 __le32 msg_len;
75 __le32 request_id;
76 __le32 major_version;
77 __le32 minor_version;
78 __le32 max_transfer_size;
79 } __attribute__ ((packed));
80
81 struct rndis_init_c {
82
83 __le32 msg_type;
84 __le32 msg_len;
85 __le32 request_id;
86 __le32 status;
87 __le32 major_version;
88 __le32 minor_version;
89 __le32 device_flags;
90 __le32 medium;
91 __le32 max_packets_per_message;
92 __le32 max_transfer_size;
93 __le32 packet_alignment;
94 __le32 af_list_offset;
95 __le32 af_list_size;
96 } __attribute__ ((packed));
97
98 struct rndis_halt {
99
100 __le32 msg_type;
101 __le32 msg_len;
102 __le32 request_id;
103 } __attribute__ ((packed));
104
105 struct rndis_query {
106
107 __le32 msg_type;
108 __le32 msg_len;
109 __le32 request_id;
110 __le32 oid;
111 __le32 len;
112 __le32 offset;
113 __le32 handle;
114 } __attribute__ ((packed));
115
116 struct rndis_query_c {
117
118 __le32 msg_type;
119 __le32 msg_len;
120 __le32 request_id;
121 __le32 status;
122 __le32 len;
123 __le32 offset;
124 } __attribute__ ((packed));
125
126 struct rndis_set {
127
128 __le32 msg_type;
129 __le32 msg_len;
130 __le32 request_id;
131 __le32 oid;
132 __le32 len;
133 __le32 offset;
134 __le32 handle;
135 } __attribute__ ((packed));
136
137 struct rndis_set_c {
138
139 __le32 msg_type;
140 __le32 msg_len;
141 __le32 request_id;
142 __le32 status;
143 } __attribute__ ((packed));
144
145 struct rndis_reset {
146
147 __le32 msg_type;
148 __le32 msg_len;
149 __le32 reserved;
150 } __attribute__ ((packed));
151
152 struct rndis_reset_c {
153
154 __le32 msg_type;
155 __le32 msg_len;
156 __le32 status;
157 __le32 addressing_lost;
158 } __attribute__ ((packed));
159
160 struct rndis_indicate {
161
162 __le32 msg_type;
163 __le32 msg_len;
164 __le32 status;
165 __le32 length;
166 __le32 offset;
167 __le32 diag_status;
168 __le32 error_offset;
169 __le32 message;
170 } __attribute__ ((packed));
171
172 struct rndis_keepalive {
173
174 __le32 msg_type;
175 __le32 msg_len;
176 __le32 request_id;
177 } __attribute__ ((packed));
178
179 struct rndis_keepalive_c {
180
181 __le32 msg_type;
182 __le32 msg_len;
183 __le32 request_id;
184 __le32 status;
185 } __attribute__ ((packed));
186
187
188 #define RNDIS_DEFAULT_FILTER ( \
189 RNDIS_PACKET_TYPE_DIRECTED | \
190 RNDIS_PACKET_TYPE_BROADCAST | \
191 RNDIS_PACKET_TYPE_ALL_MULTICAST | \
192 RNDIS_PACKET_TYPE_PROMISCUOUS)
193
194
195 #define FLAG_RNDIS_PHYM_NOT_WIRELESS 0x0001
196 #define FLAG_RNDIS_PHYM_WIRELESS 0x0002
197
198
199 #define RNDIS_DRIVER_DATA_POLL_STATUS 1
200
201 extern void rndis_status(struct usbnet *dev, struct urb *urb);
202 extern int
203 rndis_command(struct usbnet *dev, struct rndis_msg_hdr *buf, int buflen);
204 extern int
205 generic_rndis_bind(struct usbnet *dev, struct usb_interface *intf, int flags);
206 extern void rndis_unbind(struct usbnet *dev, struct usb_interface *intf);
207 extern int rndis_rx_fixup(struct usbnet *dev, struct sk_buff *skb);
208 extern struct sk_buff *
209 rndis_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags);
210
211 #endif