1 // SPDX-License-Identifier: GPL-2.0
3 * RNDIS Definitions for Remote NDIS
5 * Authors: Benedikt Spranger, Pengutronix
6 * Robert Schwebel, Pengutronix
8 * This software was originally developed in conformance with
9 * Microsoft's Remote NDIS Specification License Agreement.
12 #ifndef _LINUX_RNDIS_H
13 #define _LINUX_RNDIS_H
15 #include <linux/rndis.h>
19 #define RNDIS_MAXIMUM_FRAME_SIZE 1518
20 #define RNDIS_MAX_TOTAL_SIZE 1558
22 typedef struct rndis_init_msg_type
{
28 __le32 MaxTransferSize
;
29 } rndis_init_msg_type
;
31 typedef struct rndis_init_cmplt_type
{
40 __le32 MaxPacketsPerTransfer
;
41 __le32 MaxTransferSize
;
42 __le32 PacketAlignmentFactor
;
45 } rndis_init_cmplt_type
;
47 typedef struct rndis_halt_msg_type
{
51 } rndis_halt_msg_type
;
53 typedef struct rndis_query_msg_type
{
58 __le32 InformationBufferLength
;
59 __le32 InformationBufferOffset
;
60 __le32 DeviceVcHandle
;
61 } rndis_query_msg_type
;
63 typedef struct rndis_query_cmplt_type
{
68 __le32 InformationBufferLength
;
69 __le32 InformationBufferOffset
;
70 } rndis_query_cmplt_type
;
72 typedef struct rndis_set_msg_type
{
77 __le32 InformationBufferLength
;
78 __le32 InformationBufferOffset
;
79 __le32 DeviceVcHandle
;
82 typedef struct rndis_set_cmplt_type
{
87 } rndis_set_cmplt_type
;
89 typedef struct rndis_reset_msg_type
{
93 } rndis_reset_msg_type
;
95 typedef struct rndis_reset_cmplt_type
{
99 __le32 AddressingReset
;
100 } rndis_reset_cmplt_type
;
102 typedef struct rndis_indicate_status_msg_type
{
104 __le32 MessageLength
;
106 __le32 StatusBufferLength
;
107 __le32 StatusBufferOffset
;
108 } rndis_indicate_status_msg_type
;
110 typedef struct rndis_keepalive_msg_type
{
112 __le32 MessageLength
;
114 } rndis_keepalive_msg_type
;
116 typedef struct rndis_keepalive_cmplt_type
{
118 __le32 MessageLength
;
121 } rndis_keepalive_cmplt_type
;
123 struct rndis_packet_msg_type
{
125 __le32 MessageLength
;
128 __le32 OOBDataOffset
;
129 __le32 OOBDataLength
;
130 __le32 NumOOBDataElements
;
131 __le32 PerPacketInfoOffset
;
132 __le32 PerPacketInfoLength
;
135 } __attribute__ ((packed
));
137 struct rndis_config_parameter
{
138 __le32 ParameterNameOffset
;
139 __le32 ParameterNameLength
;
140 __le32 ParameterType
;
141 __le32 ParameterValueOffset
;
142 __le32 ParameterValueLength
;
145 /* implementation specific */
149 RNDIS_DATA_INITIALIZED
,
152 typedef struct rndis_resp_t
{
153 struct list_head list
;
159 typedef struct rndis_params
{
163 enum rndis_state state
;
170 struct net_device
*dev
;
173 const char *vendorDescr
;
174 void (*resp_avail
)(void *v
);
176 struct list_head resp_queue
;
179 /* RNDIS Message parser and other useless functions */
180 int rndis_msg_parser(struct rndis_params
*params
, u8
*buf
);
181 struct rndis_params
*rndis_register(void (*resp_avail
)(void *v
), void *v
);
182 void rndis_deregister(struct rndis_params
*params
);
183 int rndis_set_param_dev(struct rndis_params
*params
, struct net_device
*dev
,
185 int rndis_set_param_vendor(struct rndis_params
*params
, u32 vendorID
,
186 const char *vendorDescr
);
187 int rndis_set_param_medium(struct rndis_params
*params
, u32 medium
,
189 void rndis_add_hdr(struct sk_buff
*skb
);
190 int rndis_rm_hdr(struct gether
*port
, struct sk_buff
*skb
,
191 struct sk_buff_head
*list
);
192 u8
*rndis_get_next_response(struct rndis_params
*params
, u32
*length
);
193 void rndis_free_response(struct rndis_params
*params
, u8
*buf
);
195 void rndis_uninit(struct rndis_params
*params
);
196 int rndis_signal_connect(struct rndis_params
*params
);
197 int rndis_signal_disconnect(struct rndis_params
*params
);
198 int rndis_state(struct rndis_params
*params
);
199 extern void rndis_set_host_mac(struct rndis_params
*params
, const u8
*addr
);
201 #endif /* _LINUX_RNDIS_H */