diff options
Diffstat (limited to 'drivers/staging/hv/netvsc.h')
-rw-r--r-- | drivers/staging/hv/netvsc.h | 164 |
1 files changed, 82 insertions, 82 deletions
diff --git a/drivers/staging/hv/netvsc.h b/drivers/staging/hv/netvsc.h index c71dce5b3f7..932a77ccdc0 100644 --- a/drivers/staging/hv/netvsc.h +++ b/drivers/staging/hv/netvsc.h | |||
@@ -38,48 +38,48 @@ | |||
38 | #define NVSP_MAX_PROTOCOL_VERSION NVSP_PROTOCOL_VERSION_1 | 38 | #define NVSP_MAX_PROTOCOL_VERSION NVSP_PROTOCOL_VERSION_1 |
39 | 39 | ||
40 | enum { | 40 | enum { |
41 | NvspMessageTypeNone = 0, | 41 | NVSP_MSG_TYPE_NONE = 0, |
42 | 42 | ||
43 | /* Init Messages */ | 43 | /* Init Messages */ |
44 | NvspMessageTypeInit = 1, | 44 | NVSP_MSG_TYPE_INIT = 1, |
45 | NvspMessageTypeInitComplete = 2, | 45 | NVSP_MSG_TYPE_INIT_COMPLETE = 2, |
46 | 46 | ||
47 | NvspVersionMessageStart = 100, | 47 | NVSP_VERSION_MSG_START = 100, |
48 | 48 | ||
49 | /* Version 1 Messages */ | 49 | /* Version 1 Messages */ |
50 | NvspMessage1TypeSendNdisVersion = NvspVersionMessageStart, | 50 | NVSP_MSG1_TYPE_SEND_NDIS_VER = NVSP_VERSION_MSG_START, |
51 | 51 | ||
52 | NvspMessage1TypeSendReceiveBuffer, | 52 | NVSP_MSG1_TYPE_SEND_RECV_BUF, |
53 | NvspMessage1TypeSendReceiveBufferComplete, | 53 | NVSP_MSG1_TYPE_SEND_RECV_BUF_COMPLETE, |
54 | NvspMessage1TypeRevokeReceiveBuffer, | 54 | NVSP_MSG1_TYPE_REVOKE_RECV_BUF, |
55 | 55 | ||
56 | NvspMessage1TypeSendSendBuffer, | 56 | NVSP_MSG1_TYPE_SEND_SEND_BUF, |
57 | NvspMessage1TypeSendSendBufferComplete, | 57 | NVSP_MSG1_TYPE_SEND_SEND_BUF_COMPLETE, |
58 | NvspMessage1TypeRevokeSendBuffer, | 58 | NVSP_MSG1_TYPE_REVOKE_SEND_BUF, |
59 | 59 | ||
60 | NvspMessage1TypeSendRNDISPacket, | 60 | NVSP_MSG1_TYPE_SEND_RNDIS_PKT, |
61 | NvspMessage1TypeSendRNDISPacketComplete, | 61 | NVSP_MSG1_TYPE_SEND_RNDIS_PKT_COMPLETE, |
62 | 62 | ||
63 | /* | 63 | /* |
64 | * This should be set to the number of messages for the version with | 64 | * This should be set to the number of messages for the version with |
65 | * the maximum number of messages. | 65 | * the maximum number of messages. |
66 | */ | 66 | */ |
67 | NvspNumMessagePerVersion = 9, | 67 | NVSP_NUM_MSG_PER_VERSION = 9, |
68 | }; | 68 | }; |
69 | 69 | ||
70 | enum { | 70 | enum { |
71 | NvspStatusNone = 0, | 71 | NVSP_STAT_NONE = 0, |
72 | NvspStatusSuccess, | 72 | NVSP_STAT_SUCCESS, |
73 | NvspStatusFailure, | 73 | NVSP_STAT_FAIL, |
74 | NvspStatusProtocolVersionRangeTooNew, | 74 | NVSP_STAT_PROTOCOL_TOO_NEW, |
75 | NvspStatusProtocolVersionRangeTooOld, | 75 | NVSP_STAT_PROTOCOL_TOO_OLD, |
76 | NvspStatusInvalidRndisPacket, | 76 | NVSP_STAT_INVALID_RNDIS_PKT, |
77 | NvspStatusBusy, | 77 | NVSP_STAT_BUSY, |
78 | NvspStatusMax, | 78 | NVSP_STAT_MAX, |
79 | }; | 79 | }; |
80 | 80 | ||
81 | struct nvsp_message_header { | 81 | struct nvsp_message_header { |
82 | u32 MessageType; | 82 | u32 msg_type; |
83 | }; | 83 | }; |
84 | 84 | ||
85 | /* Init Messages */ | 85 | /* Init Messages */ |
@@ -90,8 +90,8 @@ struct nvsp_message_header { | |||
90 | * versioning (i.e. this message will be the same for ever). | 90 | * versioning (i.e. this message will be the same for ever). |
91 | */ | 91 | */ |
92 | struct nvsp_message_init { | 92 | struct nvsp_message_init { |
93 | u32 MinProtocolVersion; | 93 | u32 min_protocol_ver; |
94 | u32 MaxProtocolVersion; | 94 | u32 max_protocol_ver; |
95 | } __attribute__((packed)); | 95 | } __attribute__((packed)); |
96 | 96 | ||
97 | /* | 97 | /* |
@@ -100,14 +100,14 @@ struct nvsp_message_init { | |||
100 | * (i.e. this message will be the same for ever). | 100 | * (i.e. this message will be the same for ever). |
101 | */ | 101 | */ |
102 | struct nvsp_message_init_complete { | 102 | struct nvsp_message_init_complete { |
103 | u32 NegotiatedProtocolVersion; | 103 | u32 negotiated_protocol_ver; |
104 | u32 MaximumMdlChainLength; | 104 | u32 max_mdl_chain_len; |
105 | u32 Status; | 105 | u32 status; |
106 | } __attribute__((packed)); | 106 | } __attribute__((packed)); |
107 | 107 | ||
108 | union nvsp_message_init_uber { | 108 | union nvsp_message_init_uber { |
109 | struct nvsp_message_init Init; | 109 | struct nvsp_message_init init; |
110 | struct nvsp_message_init_complete InitComplete; | 110 | struct nvsp_message_init_complete init_complete; |
111 | } __attribute__((packed)); | 111 | } __attribute__((packed)); |
112 | 112 | ||
113 | /* Version 1 Messages */ | 113 | /* Version 1 Messages */ |
@@ -117,8 +117,8 @@ union nvsp_message_init_uber { | |||
117 | * can use this information when handling OIDs sent by the VSC. | 117 | * can use this information when handling OIDs sent by the VSC. |
118 | */ | 118 | */ |
119 | struct nvsp_1_message_send_ndis_version { | 119 | struct nvsp_1_message_send_ndis_version { |
120 | u32 NdisMajorVersion; | 120 | u32 ndis_major_ver; |
121 | u32 NdisMinorVersion; | 121 | u32 ndis_minor_ver; |
122 | } __attribute__((packed)); | 122 | } __attribute__((packed)); |
123 | 123 | ||
124 | /* | 124 | /* |
@@ -126,15 +126,15 @@ struct nvsp_1_message_send_ndis_version { | |||
126 | * can then use the receive buffer to send data to the VSC. | 126 | * can then use the receive buffer to send data to the VSC. |
127 | */ | 127 | */ |
128 | struct nvsp_1_message_send_receive_buffer { | 128 | struct nvsp_1_message_send_receive_buffer { |
129 | u32 GpadlHandle; | 129 | u32 gpadl_handle; |
130 | u16 Id; | 130 | u16 id; |
131 | } __attribute__((packed)); | 131 | } __attribute__((packed)); |
132 | 132 | ||
133 | struct nvsp_1_receive_buffer_section { | 133 | struct nvsp_1_receive_buffer_section { |
134 | u32 Offset; | 134 | u32 offset; |
135 | u32 SubAllocationSize; | 135 | u32 sub_alloc_size; |
136 | u32 NumSubAllocations; | 136 | u32 num_sub_allocs; |
137 | u32 EndOffset; | 137 | u32 end_offset; |
138 | } __attribute__((packed)); | 138 | } __attribute__((packed)); |
139 | 139 | ||
140 | /* | 140 | /* |
@@ -143,8 +143,8 @@ struct nvsp_1_receive_buffer_section { | |||
143 | * buffer. | 143 | * buffer. |
144 | */ | 144 | */ |
145 | struct nvsp_1_message_send_receive_buffer_complete { | 145 | struct nvsp_1_message_send_receive_buffer_complete { |
146 | u32 Status; | 146 | u32 status; |
147 | u32 NumSections; | 147 | u32 num_sections; |
148 | 148 | ||
149 | /* | 149 | /* |
150 | * The receive buffer is split into two parts, a large suballocation | 150 | * The receive buffer is split into two parts, a large suballocation |
@@ -165,7 +165,7 @@ struct nvsp_1_message_send_receive_buffer_complete { | |||
165 | * LargeOffset SmallOffset | 165 | * LargeOffset SmallOffset |
166 | */ | 166 | */ |
167 | 167 | ||
168 | struct nvsp_1_receive_buffer_section Sections[1]; | 168 | struct nvsp_1_receive_buffer_section sections[1]; |
169 | } __attribute__((packed)); | 169 | } __attribute__((packed)); |
170 | 170 | ||
171 | /* | 171 | /* |
@@ -174,7 +174,7 @@ struct nvsp_1_message_send_receive_buffer_complete { | |||
174 | * again. | 174 | * again. |
175 | */ | 175 | */ |
176 | struct nvsp_1_message_revoke_receive_buffer { | 176 | struct nvsp_1_message_revoke_receive_buffer { |
177 | u16 Id; | 177 | u16 id; |
178 | }; | 178 | }; |
179 | 179 | ||
180 | /* | 180 | /* |
@@ -182,8 +182,8 @@ struct nvsp_1_message_revoke_receive_buffer { | |||
182 | * can then use the send buffer to send data to the VSP. | 182 | * can then use the send buffer to send data to the VSP. |
183 | */ | 183 | */ |
184 | struct nvsp_1_message_send_send_buffer { | 184 | struct nvsp_1_message_send_send_buffer { |
185 | u32 GpadlHandle; | 185 | u32 gpadl_handle; |
186 | u16 Id; | 186 | u16 id; |
187 | } __attribute__((packed)); | 187 | } __attribute__((packed)); |
188 | 188 | ||
189 | /* | 189 | /* |
@@ -192,7 +192,7 @@ struct nvsp_1_message_send_send_buffer { | |||
192 | * buffer. | 192 | * buffer. |
193 | */ | 193 | */ |
194 | struct nvsp_1_message_send_send_buffer_complete { | 194 | struct nvsp_1_message_send_send_buffer_complete { |
195 | u32 Status; | 195 | u32 status; |
196 | 196 | ||
197 | /* | 197 | /* |
198 | * The VSC gets to choose the size of the send buffer and the VSP gets | 198 | * The VSC gets to choose the size of the send buffer and the VSP gets |
@@ -200,7 +200,7 @@ struct nvsp_1_message_send_send_buffer_complete { | |||
200 | * dynamic reconfigurations when the cost of GPA-direct buffers | 200 | * dynamic reconfigurations when the cost of GPA-direct buffers |
201 | * decreases. | 201 | * decreases. |
202 | */ | 202 | */ |
203 | u32 SectionSize; | 203 | u32 section_size; |
204 | } __attribute__((packed)); | 204 | } __attribute__((packed)); |
205 | 205 | ||
206 | /* | 206 | /* |
@@ -208,7 +208,7 @@ struct nvsp_1_message_send_send_buffer_complete { | |||
208 | * completes this transaction, the vsp should never use the send buffer again. | 208 | * completes this transaction, the vsp should never use the send buffer again. |
209 | */ | 209 | */ |
210 | struct nvsp_1_message_revoke_send_buffer { | 210 | struct nvsp_1_message_revoke_send_buffer { |
211 | u16 Id; | 211 | u16 id; |
212 | }; | 212 | }; |
213 | 213 | ||
214 | /* | 214 | /* |
@@ -221,7 +221,7 @@ struct nvsp_1_message_send_rndis_packet { | |||
221 | * channels of communication. However, the Network VSP only has one. | 221 | * channels of communication. However, the Network VSP only has one. |
222 | * Therefore, the channel travels with the RNDIS packet. | 222 | * Therefore, the channel travels with the RNDIS packet. |
223 | */ | 223 | */ |
224 | u32 ChannelType; | 224 | u32 channel_type; |
225 | 225 | ||
226 | /* | 226 | /* |
227 | * This field is used to send part or all of the data through a send | 227 | * This field is used to send part or all of the data through a send |
@@ -229,8 +229,8 @@ struct nvsp_1_message_send_rndis_packet { | |||
229 | * index is 0xFFFFFFFF, then the send buffer is not being used and all | 229 | * index is 0xFFFFFFFF, then the send buffer is not being used and all |
230 | * of the data was sent through other VMBus mechanisms. | 230 | * of the data was sent through other VMBus mechanisms. |
231 | */ | 231 | */ |
232 | u32 SendBufferSectionIndex; | 232 | u32 send_buf_section_index; |
233 | u32 SendBufferSectionSize; | 233 | u32 send_buf_section_size; |
234 | } __attribute__((packed)); | 234 | } __attribute__((packed)); |
235 | 235 | ||
236 | /* | 236 | /* |
@@ -239,35 +239,35 @@ struct nvsp_1_message_send_rndis_packet { | |||
239 | * message cannot use any resources associated with the original RNDIS packet. | 239 | * message cannot use any resources associated with the original RNDIS packet. |
240 | */ | 240 | */ |
241 | struct nvsp_1_message_send_rndis_packet_complete { | 241 | struct nvsp_1_message_send_rndis_packet_complete { |
242 | u32 Status; | 242 | u32 status; |
243 | }; | 243 | }; |
244 | 244 | ||
245 | union nvsp_1_message_uber { | 245 | union nvsp_1_message_uber { |
246 | struct nvsp_1_message_send_ndis_version SendNdisVersion; | 246 | struct nvsp_1_message_send_ndis_version send_ndis_ver; |
247 | 247 | ||
248 | struct nvsp_1_message_send_receive_buffer SendReceiveBuffer; | 248 | struct nvsp_1_message_send_receive_buffer send_recv_buf; |
249 | struct nvsp_1_message_send_receive_buffer_complete | 249 | struct nvsp_1_message_send_receive_buffer_complete |
250 | SendReceiveBufferComplete; | 250 | send_recv_buf_complete; |
251 | struct nvsp_1_message_revoke_receive_buffer RevokeReceiveBuffer; | 251 | struct nvsp_1_message_revoke_receive_buffer revoke_recv_buf; |
252 | 252 | ||
253 | struct nvsp_1_message_send_send_buffer SendSendBuffer; | 253 | struct nvsp_1_message_send_send_buffer send_send_buf; |
254 | struct nvsp_1_message_send_send_buffer_complete SendSendBufferComplete; | 254 | struct nvsp_1_message_send_send_buffer_complete send_send_buf_complete; |
255 | struct nvsp_1_message_revoke_send_buffer RevokeSendBuffer; | 255 | struct nvsp_1_message_revoke_send_buffer revoke_send_buf; |
256 | 256 | ||
257 | struct nvsp_1_message_send_rndis_packet SendRNDISPacket; | 257 | struct nvsp_1_message_send_rndis_packet send_rndis_pkt; |
258 | struct nvsp_1_message_send_rndis_packet_complete | 258 | struct nvsp_1_message_send_rndis_packet_complete |
259 | SendRNDISPacketComplete; | 259 | send_rndis_pkt_complete; |
260 | } __attribute__((packed)); | 260 | } __attribute__((packed)); |
261 | 261 | ||
262 | union nvsp_all_messages { | 262 | union nvsp_all_messages { |
263 | union nvsp_message_init_uber InitMessages; | 263 | union nvsp_message_init_uber init_msg; |
264 | union nvsp_1_message_uber Version1Messages; | 264 | union nvsp_1_message_uber v1_msg; |
265 | } __attribute__((packed)); | 265 | } __attribute__((packed)); |
266 | 266 | ||
267 | /* ALL Messages */ | 267 | /* ALL Messages */ |
268 | struct nvsp_message { | 268 | struct nvsp_message { |
269 | struct nvsp_message_header Header; | 269 | struct nvsp_message_header hdr; |
270 | union nvsp_all_messages Messages; | 270 | union nvsp_all_messages msg; |
271 | } __attribute__((packed)); | 271 | } __attribute__((packed)); |
272 | 272 | ||
273 | 273 | ||
@@ -293,39 +293,39 @@ struct nvsp_message { | |||
293 | 293 | ||
294 | /* Per netvsc channel-specific */ | 294 | /* Per netvsc channel-specific */ |
295 | struct netvsc_device { | 295 | struct netvsc_device { |
296 | struct hv_device *Device; | 296 | struct hv_device *dev; |
297 | 297 | ||
298 | atomic_t RefCount; | 298 | atomic_t refcnt; |
299 | atomic_t NumOutstandingSends; | 299 | atomic_t num_outstanding_sends; |
300 | /* | 300 | /* |
301 | * List of free preallocated hv_netvsc_packet to represent receive | 301 | * List of free preallocated hv_netvsc_packet to represent receive |
302 | * packet | 302 | * packet |
303 | */ | 303 | */ |
304 | struct list_head ReceivePacketList; | 304 | struct list_head recv_pkt_list; |
305 | spinlock_t receive_packet_list_lock; | 305 | spinlock_t recv_pkt_list_lock; |
306 | 306 | ||
307 | /* Send buffer allocated by us but manages by NetVSP */ | 307 | /* Send buffer allocated by us but manages by NetVSP */ |
308 | void *SendBuffer; | 308 | void *send_buf; |
309 | u32 SendBufferSize; | 309 | u32 send_buf_size; |
310 | u32 SendBufferGpadlHandle; | 310 | u32 send_buf_gpadl_handle; |
311 | u32 SendSectionSize; | 311 | u32 send_section_size; |
312 | 312 | ||
313 | /* Receive buffer allocated by us but manages by NetVSP */ | 313 | /* Receive buffer allocated by us but manages by NetVSP */ |
314 | void *ReceiveBuffer; | 314 | void *recv_buf; |
315 | u32 ReceiveBufferSize; | 315 | u32 recv_buf_size; |
316 | u32 ReceiveBufferGpadlHandle; | 316 | u32 recv_buf_gpadl_handle; |
317 | u32 ReceiveSectionCount; | 317 | u32 recv_section_cnt; |
318 | struct nvsp_1_receive_buffer_section *ReceiveSections; | 318 | struct nvsp_1_receive_buffer_section *recv_section; |
319 | 319 | ||
320 | /* Used for NetVSP initialization protocol */ | 320 | /* Used for NetVSP initialization protocol */ |
321 | struct osd_waitevent *ChannelInitEvent; | 321 | struct osd_waitevent *channel_init_event; |
322 | struct nvsp_message ChannelInitPacket; | 322 | struct nvsp_message channel_init_pkt; |
323 | 323 | ||
324 | struct nvsp_message RevokePacket; | 324 | struct nvsp_message revoke_packet; |
325 | /* unsigned char HwMacAddr[HW_MACADDR_LEN]; */ | 325 | /* unsigned char HwMacAddr[HW_MACADDR_LEN]; */ |
326 | 326 | ||
327 | /* Holds rndis device info */ | 327 | /* Holds rndis device info */ |
328 | void *Extension; | 328 | void *extension; |
329 | }; | 329 | }; |
330 | 330 | ||
331 | #endif /* _NETVSC_H_ */ | 331 | #endif /* _NETVSC_H_ */ |