49 #define RNDIS_MAJOR_VERSION 1
50 #define RNDIS_MINOR_VERSION 0
52 #define RNDIS_STATUS_SUCCESS 0X00000000
53 #define RNDIS_STATUS_FAILURE 0XC0000001
54 #define RNDIS_STATUS_INVALID_DATA 0XC0010015
55 #define RNDIS_STATUS_NOT_SUPPORTED 0XC00000BB
56 #define RNDIS_STATUS_MEDIA_CONNECT 0X4001000B
57 #define RNDIS_STATUS_MEDIA_DISCONNECT 0X4001000C
61 #define REMOTE_NDIS_PACKET_MSG 0x00000001
62 #define REMOTE_NDIS_INITIALIZE_MSG 0X00000002
63 #define REMOTE_NDIS_HALT_MSG 0X00000003
64 #define REMOTE_NDIS_QUERY_MSG 0X00000004
65 #define REMOTE_NDIS_SET_MSG 0X00000005
66 #define REMOTE_NDIS_RESET_MSG 0X00000006
67 #define REMOTE_NDIS_INDICATE_STATUS_MSG 0X00000007
68 #define REMOTE_NDIS_KEEPALIVE_MSG 0X00000008
69 #define REMOTE_NDIS_INITIALIZE_CMPLT 0X80000002
70 #define REMOTE_NDIS_QUERY_CMPLT 0X80000004
71 #define REMOTE_NDIS_SET_CMPLT 0X80000005
72 #define REMOTE_NDIS_RESET_CMPLT 0X80000006
73 #define REMOTE_NDIS_KEEPALIVE_CMPLT 0X80000008
75 typedef uint32_t rndis_MessageType_t;
76 typedef uint32_t rndis_MessageLength_t;
77 typedef uint32_t rndis_RequestId_t;
78 typedef uint32_t rndis_MajorVersion_t;
79 typedef uint32_t rndis_MinorVersion_t;
80 typedef uint32_t rndis_MaxTransferSize_t;
81 typedef uint32_t rndis_Status_t;
85 #define RNDIS_DF_CONNECTIONLESS 0x00000001
86 #define RNDIS_DF_CONNECTION_ORIENTED 0x00000002
87 typedef uint32_t rndis_DeviceFlags_t;
90 #define RNDIS_MEDIUM_802_3 0x00000000
91 typedef uint32_t rndis_Medium_t;
94 typedef uint32_t rndis_MaxPacketsPerTransfer_t;
95 typedef uint32_t rndis_PacketAlignmentFactor_t;
96 typedef uint32_t rndis_AfListOffset_t;
97 typedef uint32_t rndis_AfListSize_t;
101 rndis_MessageType_t MessageType;
102 rndis_MessageLength_t MessageLength;
103 } rndis_generic_msg_t;
108 rndis_MessageType_t MessageType;
109 rndis_MessageLength_t MessageLength;
110 rndis_RequestId_t RequestId;
111 rndis_MajorVersion_t MajorVersion;
112 rndis_MinorVersion_t MinorVersion;
113 rndis_MaxTransferSize_t MaxTransferSize;
114 } rndis_initialize_msg_t;
118 rndis_MessageType_t MessageType;
119 rndis_MessageLength_t MessageLength;
120 rndis_RequestId_t RequestId;
121 rndis_Status_t Status;
122 rndis_MajorVersion_t MajorVersion;
123 rndis_MinorVersion_t MinorVersion;
124 rndis_DeviceFlags_t DeviceFlags;
125 rndis_Medium_t Medium;
126 rndis_MaxPacketsPerTransfer_t MaxPacketsPerTransfer;
127 rndis_MaxTransferSize_t MaxTransferSize;
128 rndis_PacketAlignmentFactor_t PacketAlignmentFactor;
129 rndis_AfListOffset_t AfListOffset;
130 rndis_AfListSize_t AfListSize;
131 } rndis_initialize_cmplt_t;
136 rndis_MessageType_t MessageType;
137 rndis_MessageLength_t MessageLength;
138 rndis_RequestId_t RequestId;
141 typedef uint32_t rndis_Oid_t;
142 typedef uint32_t rndis_InformationBufferLength_t;
143 typedef uint32_t rndis_InformationBufferOffset_t;
144 typedef uint32_t rndis_DeviceVcHandle_t;
148 rndis_MessageType_t MessageType;
149 rndis_MessageLength_t MessageLength;
150 rndis_RequestId_t RequestId;
152 rndis_InformationBufferLength_t InformationBufferLength;
153 rndis_InformationBufferOffset_t InformationBufferOffset;
154 rndis_DeviceVcHandle_t DeviceVcHandle;
160 rndis_MessageType_t MessageType;
161 rndis_MessageLength_t MessageLength;
162 rndis_RequestId_t RequestId;
163 rndis_Status_t Status;
164 rndis_InformationBufferLength_t InformationBufferLength;
165 rndis_InformationBufferOffset_t InformationBufferOffset;
166 } rndis_query_cmplt_t;
170 rndis_MessageType_t MessageType;
171 rndis_MessageLength_t MessageLength;
172 rndis_RequestId_t RequestId;
174 rndis_InformationBufferLength_t InformationBufferLength;
175 rndis_InformationBufferOffset_t InformationBufferOffset;
176 rndis_DeviceVcHandle_t DeviceVcHandle;
181 rndis_MessageType_t MessageType;
182 rndis_MessageLength_t MessageLength;
183 rndis_RequestId_t RequestId;
184 rndis_Status_t Status;
188 typedef uint32_t rndis_ParameterNameOffset_t;
189 typedef uint32_t rndis_ParameterNameLength_t;
190 typedef uint32_t rndis_ParameterType_t;
191 typedef uint32_t rndis_ParameterValueOffset_t;
192 typedef uint32_t rndis_ParameterValueLength_t;
194 #define PARAMETER_TYPE_STRING 2
195 #define PARAMETER_TYPE_NUMERICAL 0
198 rndis_ParameterNameOffset_t ParameterNameOffset;
199 rndis_ParameterNameLength_t ParameterNameLength;
200 rndis_ParameterType_t ParameterType;
201 rndis_ParameterValueOffset_t ParameterValueOffset;
202 rndis_ParameterValueLength_t ParameterValueLength;
203 }rndis_config_parameter_t;
205 typedef uint32_t rndis_Reserved_t;
209 rndis_MessageType_t MessageType;
210 rndis_MessageLength_t MessageLength;
211 rndis_Reserved_t Reserved;
214 typedef uint32_t rndis_AddressingReset_t;
218 rndis_MessageType_t MessageType;
219 rndis_MessageLength_t MessageLength;
220 rndis_Status_t Status;
221 rndis_AddressingReset_t AddressingReset;
222 } rndis_reset_cmplt_t;
226 rndis_MessageType_t MessageType;
227 rndis_MessageLength_t MessageLength;
228 rndis_Status_t Status;
229 rndis_Status_t StatusBufferLength;
230 rndis_Status_t StatusBufferOffset;
231 } rndis_indicate_status_t;
233 typedef uint32_t rndis_DiagStatus_t;
234 typedef uint32_t rndis_ErrorOffset_t;
237 rndis_DiagStatus_t DiagStatus;
238 rndis_ErrorOffset_t ErrorOffset;
239 }rndis_diagnostic_info_t;
243 rndis_MessageType_t MessageType;
244 rndis_MessageLength_t MessageLength;
245 rndis_RequestId_t RequestId;
246 }rndis_keepalive_msg_t;
250 rndis_MessageType_t MessageType;
251 rndis_MessageLength_t MessageLength;
252 rndis_RequestId_t RequestId;
253 rndis_Status_t Status;
254 }rndis_keepalive_cmplt_t;
258 typedef uint32_t rndis_DataOffset_t;
259 typedef uint32_t rndis_DataLength_t;
260 typedef uint32_t rndis_OOBDataOffset_t;
261 typedef uint32_t rndis_OOBDataLength_t;
262 typedef uint32_t rndis_NumOOBDataElements_t;
263 typedef uint32_t rndis_PerPacketInfoOffset_t;
264 typedef uint32_t rndis_PerPacketInfoLength_t;
267 rndis_MessageType_t MessageType;
268 rndis_MessageLength_t MessageLength;
269 rndis_DataOffset_t DataOffset;
270 rndis_DataLength_t DataLength;
271 rndis_OOBDataOffset_t OOBDataOffset;
272 rndis_OOBDataLength_t OOBDataLength;
273 rndis_NumOOBDataElements_t NumOOBDataElements;
274 rndis_PerPacketInfoOffset_t PerPacketInfoOffset;
275 rndis_PerPacketInfoLength_t PerPacketInfoLength;
276 rndis_DeviceVcHandle_t DeviceVcHandle;
277 rndis_Reserved_t Reserved;
278 }rndis_data_packet_t;
280 typedef uint32_t rndis_ClassInformationOffset_t;
281 typedef uint32_t rndis_Size_t;
282 typedef uint32_t rndis_Type_t;
287 rndis_ClassInformationOffset_t ClassInformationType;
295 typedef enum rnids_state_e {
298 rndis_data_initialized
308 extern usb_eth_stat_t usb_eth_stat;
310 extern rndis_state_t rndis_state;
312 extern uint8_t schedule_interrupt;
320 uint8_t rndis_process(
void);
321 uint8_t
rndis_send(uint8_t * senddata, uint16_t sendlen, uint8_t led);
322 extern void rndis_configure_endpoints();