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>
22 #define RNDIS_MAXIMUM_FRAME_SIZE 1518
23 #define RNDIS_MAX_TOTAL_SIZE 1558
25 typedef struct rndis_init_msg_type
32 __le32 MaxTransferSize
;
33 } rndis_init_msg_type
;
35 typedef struct rndis_init_cmplt_type
45 __le32 MaxPacketsPerTransfer
;
46 __le32 MaxTransferSize
;
47 __le32 PacketAlignmentFactor
;
50 } rndis_init_cmplt_type
;
52 typedef struct rndis_halt_msg_type
57 } rndis_halt_msg_type
;
59 typedef struct rndis_query_msg_type
65 __le32 InformationBufferLength
;
66 __le32 InformationBufferOffset
;
67 __le32 DeviceVcHandle
;
68 } rndis_query_msg_type
;
70 typedef struct rndis_query_cmplt_type
76 __le32 InformationBufferLength
;
77 __le32 InformationBufferOffset
;
78 } rndis_query_cmplt_type
;
80 typedef struct rndis_set_msg_type
86 __le32 InformationBufferLength
;
87 __le32 InformationBufferOffset
;
88 __le32 DeviceVcHandle
;
91 typedef struct rndis_set_cmplt_type
97 } rndis_set_cmplt_type
;
99 typedef struct rndis_reset_msg_type
102 __le32 MessageLength
;
104 } rndis_reset_msg_type
;
106 typedef struct rndis_reset_cmplt_type
109 __le32 MessageLength
;
111 __le32 AddressingReset
;
112 } rndis_reset_cmplt_type
;
114 typedef struct rndis_indicate_status_msg_type
117 __le32 MessageLength
;
119 __le32 StatusBufferLength
;
120 __le32 StatusBufferOffset
;
121 } rndis_indicate_status_msg_type
;
123 typedef struct rndis_keepalive_msg_type
126 __le32 MessageLength
;
128 } rndis_keepalive_msg_type
;
130 typedef struct rndis_keepalive_cmplt_type
133 __le32 MessageLength
;
136 } rndis_keepalive_cmplt_type
;
138 struct rndis_packet_msg_type
141 __le32 MessageLength
;
144 __le32 OOBDataOffset
;
145 __le32 OOBDataLength
;
146 __le32 NumOOBDataElements
;
147 __le32 PerPacketInfoOffset
;
148 __le32 PerPacketInfoLength
;
151 } __attribute__ ((packed
));
153 struct rndis_config_parameter
155 __le32 ParameterNameOffset
;
156 __le32 ParameterNameLength
;
157 __le32 ParameterType
;
158 __le32 ParameterValueOffset
;
159 __le32 ParameterValueLength
;
162 /* implementation specific */
167 RNDIS_DATA_INITIALIZED
,
170 typedef struct rndis_resp_t
172 struct list_head list
;
178 typedef struct rndis_params
183 enum rndis_state state
;
190 struct net_device
*dev
;
193 const char *vendorDescr
;
194 void (*resp_avail
)(void *v
);
196 struct list_head resp_queue
;
199 /* RNDIS Message parser and other useless functions */
200 int rndis_msg_parser(struct rndis_params
*params
, u8
*buf
);
201 struct rndis_params
*rndis_register(void (*resp_avail
)(void *v
), void *v
);
202 void rndis_deregister(struct rndis_params
*params
);
203 int rndis_set_param_dev(struct rndis_params
*params
, struct net_device
*dev
,
205 int rndis_set_param_vendor(struct rndis_params
*params
, u32 vendorID
,
206 const char *vendorDescr
);
207 int rndis_set_param_medium(struct rndis_params
*params
, u32 medium
,
209 void rndis_add_hdr(struct sk_buff
*skb
);
210 int rndis_rm_hdr(struct gether
*port
, struct sk_buff
*skb
,
211 struct sk_buff_head
*list
);
212 u8
*rndis_get_next_response(struct rndis_params
*params
, u32
*length
);
213 void rndis_free_response(struct rndis_params
*params
, u8
*buf
);
215 void rndis_uninit(struct rndis_params
*params
);
216 int rndis_signal_connect(struct rndis_params
*params
);
217 int rndis_signal_disconnect(struct rndis_params
*params
);
218 int rndis_state(struct rndis_params
*params
);
219 extern void rndis_set_host_mac(struct rndis_params
*params
, const u8
*addr
);
221 #endif /* _LINUX_RNDIS_H */