2 * RNDIS Definitions for Remote NDIS
4 * Authors: Benedikt Spranger, Pengutronix
5 * Robert Schwebel, Pengutronix
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * version 2, as published by the Free Software Foundation.
11 * This software was originally developed in conformance with
12 * Microsoft's Remote NDIS Specification License Agreement.
15 #ifndef _LINUX_RNDIS_H
16 #define _LINUX_RNDIS_H
18 #include <linux/rndis.h>
21 #define RNDIS_MAXIMUM_FRAME_SIZE 1518
22 #define RNDIS_MAX_TOTAL_SIZE 1558
24 typedef struct rndis_init_msg_type
31 __le32 MaxTransferSize
;
32 } rndis_init_msg_type
;
34 typedef struct rndis_init_cmplt_type
44 __le32 MaxPacketsPerTransfer
;
45 __le32 MaxTransferSize
;
46 __le32 PacketAlignmentFactor
;
49 } rndis_init_cmplt_type
;
51 typedef struct rndis_halt_msg_type
56 } rndis_halt_msg_type
;
58 typedef struct rndis_query_msg_type
64 __le32 InformationBufferLength
;
65 __le32 InformationBufferOffset
;
66 __le32 DeviceVcHandle
;
67 } rndis_query_msg_type
;
69 typedef struct rndis_query_cmplt_type
75 __le32 InformationBufferLength
;
76 __le32 InformationBufferOffset
;
77 } rndis_query_cmplt_type
;
79 typedef struct rndis_set_msg_type
85 __le32 InformationBufferLength
;
86 __le32 InformationBufferOffset
;
87 __le32 DeviceVcHandle
;
90 typedef struct rndis_set_cmplt_type
96 } rndis_set_cmplt_type
;
98 typedef struct rndis_reset_msg_type
101 __le32 MessageLength
;
103 } rndis_reset_msg_type
;
105 typedef struct rndis_reset_cmplt_type
108 __le32 MessageLength
;
110 __le32 AddressingReset
;
111 } rndis_reset_cmplt_type
;
113 typedef struct rndis_indicate_status_msg_type
116 __le32 MessageLength
;
118 __le32 StatusBufferLength
;
119 __le32 StatusBufferOffset
;
120 } rndis_indicate_status_msg_type
;
122 typedef struct rndis_keepalive_msg_type
125 __le32 MessageLength
;
127 } rndis_keepalive_msg_type
;
129 typedef struct rndis_keepalive_cmplt_type
132 __le32 MessageLength
;
135 } rndis_keepalive_cmplt_type
;
137 struct rndis_packet_msg_type
140 __le32 MessageLength
;
143 __le32 OOBDataOffset
;
144 __le32 OOBDataLength
;
145 __le32 NumOOBDataElements
;
146 __le32 PerPacketInfoOffset
;
147 __le32 PerPacketInfoLength
;
150 } __attribute__ ((packed
));
152 struct rndis_config_parameter
154 __le32 ParameterNameOffset
;
155 __le32 ParameterNameLength
;
156 __le32 ParameterType
;
157 __le32 ParameterValueOffset
;
158 __le32 ParameterValueLength
;
161 /* implementation specific */
166 RNDIS_DATA_INITIALIZED
,
169 typedef struct rndis_resp_t
171 struct list_head list
;
177 typedef struct rndis_params
182 enum rndis_state state
;
189 struct net_device
*dev
;
192 const char *vendorDescr
;
193 void (*resp_avail
)(void *v
);
195 struct list_head resp_queue
;
198 /* RNDIS Message parser and other useless functions */
199 int rndis_msg_parser (u8 configNr
, u8
*buf
);
200 int rndis_register(void (*resp_avail
)(void *v
), void *v
);
201 void rndis_deregister (int configNr
);
202 int rndis_set_param_dev (u8 configNr
, struct net_device
*dev
,
204 int rndis_set_param_vendor (u8 configNr
, u32 vendorID
,
205 const char *vendorDescr
);
206 int rndis_set_param_medium (u8 configNr
, u32 medium
, u32 speed
);
207 void rndis_add_hdr (struct sk_buff
*skb
);
208 int rndis_rm_hdr(struct gether
*port
, struct sk_buff
*skb
,
209 struct sk_buff_head
*list
);
210 u8
*rndis_get_next_response (int configNr
, u32
*length
);
211 void rndis_free_response (int configNr
, u8
*buf
);
213 void rndis_uninit (int configNr
);
214 int rndis_signal_connect (int configNr
);
215 int rndis_signal_disconnect (int configNr
);
216 int rndis_state (int configNr
);
217 extern void rndis_set_host_mac (int configNr
, const u8
*addr
);
219 int rndis_init(void);
220 void rndis_exit (void);
222 #endif /* _LINUX_RNDIS_H */