Commit | Line | Data |
---|---|---|
635d2b00 GKH |
1 | /***************************************************************************** |
2 | ||
95edd09e | 3 | (c) Cambridge Silicon Radio Limited 2012 |
635d2b00 GKH |
4 | All rights reserved and confidential information of CSR |
5 | ||
6 | Refer to LICENSE.txt included with this source for details | |
7 | on the license terms. | |
8 | ||
9 | *****************************************************************************/ | |
10 | ||
11 | /* Note: this is an auto-generated file. */ | |
4bcb20f8 | 12 | #include <linux/string.h> |
55a27055 | 13 | #include <linux/slab.h> |
635d2b00 | 14 | #include "csr_msgconv.h" |
635d2b00 GKH |
15 | #include "csr_wifi_router_ctrl_prim.h" |
16 | #include "csr_wifi_router_ctrl_serialize.h" | |
17 | ||
18 | void CsrWifiRouterCtrlPfree(void *ptr) | |
19 | { | |
55a27055 | 20 | kfree(ptr); |
635d2b00 GKH |
21 | } |
22 | ||
23 | ||
d4fda8db | 24 | size_t CsrWifiRouterCtrlConfigurePowerModeReqSizeof(void *msg) |
635d2b00 | 25 | { |
d4fda8db | 26 | size_t bufferSize = 2; |
635d2b00 GKH |
27 | |
28 | /* Calculate the Size of the Serialised Data. Could be more efficient (Try 8) */ | |
29 | bufferSize += 2; /* CsrWifiRouterCtrlRequestorInfo primitive->clientData */ | |
30 | bufferSize += 2; /* CsrWifiRouterCtrlLowPowerMode primitive->mode */ | |
5379b13d | 31 | bufferSize += 1; /* u8 primitive->wakeHost */ |
635d2b00 GKH |
32 | return bufferSize; |
33 | } | |
34 | ||
35 | ||
d4fda8db | 36 | u8* CsrWifiRouterCtrlConfigurePowerModeReqSer(u8 *ptr, size_t *len, void *msg) |
635d2b00 GKH |
37 | { |
38 | CsrWifiRouterCtrlConfigurePowerModeReq *primitive = (CsrWifiRouterCtrlConfigurePowerModeReq *)msg; | |
39 | *len = 0; | |
40 | CsrUint16Ser(ptr, len, primitive->common.type); | |
8c87f69a GKH |
41 | CsrUint16Ser(ptr, len, (u16) primitive->clientData); |
42 | CsrUint16Ser(ptr, len, (u16) primitive->mode); | |
7e6f5794 | 43 | CsrUint8Ser(ptr, len, (u8) primitive->wakeHost); |
635d2b00 GKH |
44 | return(ptr); |
45 | } | |
46 | ||
47 | ||
d4fda8db | 48 | void* CsrWifiRouterCtrlConfigurePowerModeReqDes(u8 *buffer, size_t length) |
635d2b00 | 49 | { |
786eeeb3 | 50 | CsrWifiRouterCtrlConfigurePowerModeReq *primitive = kmalloc(sizeof(CsrWifiRouterCtrlConfigurePowerModeReq), GFP_KERNEL); |
d4fda8db | 51 | size_t offset; |
635d2b00 GKH |
52 | offset = 0; |
53 | ||
54 | CsrUint16Des(&primitive->common.type, buffer, &offset); | |
8c87f69a GKH |
55 | CsrUint16Des((u16 *) &primitive->clientData, buffer, &offset); |
56 | CsrUint16Des((u16 *) &primitive->mode, buffer, &offset); | |
7e6f5794 | 57 | CsrUint8Des((u8 *) &primitive->wakeHost, buffer, &offset); |
635d2b00 GKH |
58 | |
59 | return primitive; | |
60 | } | |
61 | ||
62 | ||
d4fda8db | 63 | size_t CsrWifiRouterCtrlHipReqSizeof(void *msg) |
635d2b00 GKH |
64 | { |
65 | CsrWifiRouterCtrlHipReq *primitive = (CsrWifiRouterCtrlHipReq *) msg; | |
d4fda8db | 66 | size_t bufferSize = 2; |
635d2b00 GKH |
67 | |
68 | /* Calculate the Size of the Serialised Data. Could be more efficient (Try 12) */ | |
8c87f69a | 69 | bufferSize += 2; /* u16 primitive->mlmeCommandLength */ |
7e6f5794 | 70 | bufferSize += primitive->mlmeCommandLength; /* u8 primitive->mlmeCommand */ |
8c87f69a | 71 | bufferSize += 2; /* u16 primitive->dataRef1Length */ |
7e6f5794 | 72 | bufferSize += primitive->dataRef1Length; /* u8 primitive->dataRef1 */ |
8c87f69a | 73 | bufferSize += 2; /* u16 primitive->dataRef2Length */ |
7e6f5794 | 74 | bufferSize += primitive->dataRef2Length; /* u8 primitive->dataRef2 */ |
635d2b00 GKH |
75 | return bufferSize; |
76 | } | |
77 | ||
78 | ||
d4fda8db | 79 | u8* CsrWifiRouterCtrlHipReqSer(u8 *ptr, size_t *len, void *msg) |
635d2b00 GKH |
80 | { |
81 | CsrWifiRouterCtrlHipReq *primitive = (CsrWifiRouterCtrlHipReq *)msg; | |
82 | *len = 0; | |
83 | CsrUint16Ser(ptr, len, primitive->common.type); | |
8c87f69a | 84 | CsrUint16Ser(ptr, len, (u16) primitive->mlmeCommandLength); |
635d2b00 GKH |
85 | if (primitive->mlmeCommandLength) |
86 | { | |
8c87f69a | 87 | CsrMemCpySer(ptr, len, (const void *) primitive->mlmeCommand, ((u16) (primitive->mlmeCommandLength))); |
635d2b00 | 88 | } |
8c87f69a | 89 | CsrUint16Ser(ptr, len, (u16) primitive->dataRef1Length); |
635d2b00 GKH |
90 | if (primitive->dataRef1Length) |
91 | { | |
8c87f69a | 92 | CsrMemCpySer(ptr, len, (const void *) primitive->dataRef1, ((u16) (primitive->dataRef1Length))); |
635d2b00 | 93 | } |
8c87f69a | 94 | CsrUint16Ser(ptr, len, (u16) primitive->dataRef2Length); |
635d2b00 GKH |
95 | if (primitive->dataRef2Length) |
96 | { | |
8c87f69a | 97 | CsrMemCpySer(ptr, len, (const void *) primitive->dataRef2, ((u16) (primitive->dataRef2Length))); |
635d2b00 GKH |
98 | } |
99 | return(ptr); | |
100 | } | |
101 | ||
102 | ||
d4fda8db | 103 | void* CsrWifiRouterCtrlHipReqDes(u8 *buffer, size_t length) |
635d2b00 | 104 | { |
786eeeb3 | 105 | CsrWifiRouterCtrlHipReq *primitive = kmalloc(sizeof(CsrWifiRouterCtrlHipReq), GFP_KERNEL); |
d4fda8db | 106 | size_t offset; |
635d2b00 GKH |
107 | offset = 0; |
108 | ||
109 | CsrUint16Des(&primitive->common.type, buffer, &offset); | |
8c87f69a | 110 | CsrUint16Des((u16 *) &primitive->mlmeCommandLength, buffer, &offset); |
635d2b00 GKH |
111 | if (primitive->mlmeCommandLength) |
112 | { | |
786eeeb3 | 113 | primitive->mlmeCommand = kmalloc(primitive->mlmeCommandLength, GFP_KERNEL); |
8c87f69a | 114 | CsrMemCpyDes(primitive->mlmeCommand, buffer, &offset, ((u16) (primitive->mlmeCommandLength))); |
635d2b00 GKH |
115 | } |
116 | else | |
117 | { | |
118 | primitive->mlmeCommand = NULL; | |
119 | } | |
8c87f69a | 120 | CsrUint16Des((u16 *) &primitive->dataRef1Length, buffer, &offset); |
635d2b00 GKH |
121 | if (primitive->dataRef1Length) |
122 | { | |
786eeeb3 | 123 | primitive->dataRef1 = kmalloc(primitive->dataRef1Length, GFP_KERNEL); |
8c87f69a | 124 | CsrMemCpyDes(primitive->dataRef1, buffer, &offset, ((u16) (primitive->dataRef1Length))); |
635d2b00 GKH |
125 | } |
126 | else | |
127 | { | |
128 | primitive->dataRef1 = NULL; | |
129 | } | |
8c87f69a | 130 | CsrUint16Des((u16 *) &primitive->dataRef2Length, buffer, &offset); |
635d2b00 GKH |
131 | if (primitive->dataRef2Length) |
132 | { | |
786eeeb3 | 133 | primitive->dataRef2 = kmalloc(primitive->dataRef2Length, GFP_KERNEL); |
8c87f69a | 134 | CsrMemCpyDes(primitive->dataRef2, buffer, &offset, ((u16) (primitive->dataRef2Length))); |
635d2b00 GKH |
135 | } |
136 | else | |
137 | { | |
138 | primitive->dataRef2 = NULL; | |
139 | } | |
140 | ||
141 | return primitive; | |
142 | } | |
143 | ||
144 | ||
145 | void CsrWifiRouterCtrlHipReqSerFree(void *voidPrimitivePointer) | |
146 | { | |
147 | CsrWifiRouterCtrlHipReq *primitive = (CsrWifiRouterCtrlHipReq *) voidPrimitivePointer; | |
55a27055 GKH |
148 | kfree(primitive->mlmeCommand); |
149 | kfree(primitive->dataRef1); | |
150 | kfree(primitive->dataRef2); | |
151 | kfree(primitive); | |
635d2b00 GKH |
152 | } |
153 | ||
154 | ||
d4fda8db | 155 | size_t CsrWifiRouterCtrlMediaStatusReqSizeof(void *msg) |
635d2b00 | 156 | { |
d4fda8db | 157 | size_t bufferSize = 2; |
635d2b00 GKH |
158 | |
159 | /* Calculate the Size of the Serialised Data. Could be more efficient (Try 8) */ | |
8c87f69a | 160 | bufferSize += 2; /* u16 primitive->interfaceTag */ |
635d2b00 GKH |
161 | bufferSize += 2; /* CsrWifiRouterCtrlRequestorInfo primitive->clientData */ |
162 | bufferSize += 1; /* CsrWifiRouterCtrlMediaStatus primitive->mediaStatus */ | |
163 | return bufferSize; | |
164 | } | |
165 | ||
166 | ||
d4fda8db | 167 | u8* CsrWifiRouterCtrlMediaStatusReqSer(u8 *ptr, size_t *len, void *msg) |
635d2b00 GKH |
168 | { |
169 | CsrWifiRouterCtrlMediaStatusReq *primitive = (CsrWifiRouterCtrlMediaStatusReq *)msg; | |
170 | *len = 0; | |
171 | CsrUint16Ser(ptr, len, primitive->common.type); | |
8c87f69a GKH |
172 | CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag); |
173 | CsrUint16Ser(ptr, len, (u16) primitive->clientData); | |
7e6f5794 | 174 | CsrUint8Ser(ptr, len, (u8) primitive->mediaStatus); |
635d2b00 GKH |
175 | return(ptr); |
176 | } | |
177 | ||
178 | ||
d4fda8db | 179 | void* CsrWifiRouterCtrlMediaStatusReqDes(u8 *buffer, size_t length) |
635d2b00 | 180 | { |
786eeeb3 | 181 | CsrWifiRouterCtrlMediaStatusReq *primitive = kmalloc(sizeof(CsrWifiRouterCtrlMediaStatusReq), GFP_KERNEL); |
d4fda8db | 182 | size_t offset; |
635d2b00 GKH |
183 | offset = 0; |
184 | ||
185 | CsrUint16Des(&primitive->common.type, buffer, &offset); | |
8c87f69a GKH |
186 | CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset); |
187 | CsrUint16Des((u16 *) &primitive->clientData, buffer, &offset); | |
7e6f5794 | 188 | CsrUint8Des((u8 *) &primitive->mediaStatus, buffer, &offset); |
635d2b00 GKH |
189 | |
190 | return primitive; | |
191 | } | |
192 | ||
193 | ||
d4fda8db | 194 | size_t CsrWifiRouterCtrlMulticastAddressResSizeof(void *msg) |
635d2b00 GKH |
195 | { |
196 | CsrWifiRouterCtrlMulticastAddressRes *primitive = (CsrWifiRouterCtrlMulticastAddressRes *) msg; | |
d4fda8db | 197 | size_t bufferSize = 2; |
635d2b00 GKH |
198 | |
199 | /* Calculate the Size of the Serialised Data. Could be more efficient (Try 17) */ | |
8c87f69a | 200 | bufferSize += 2; /* u16 primitive->interfaceTag */ |
635d2b00 GKH |
201 | bufferSize += 2; /* CsrWifiRouterCtrlRequestorInfo primitive->clientData */ |
202 | bufferSize += 2; /* CsrResult primitive->status */ | |
203 | bufferSize += 1; /* CsrWifiRouterCtrlListAction primitive->action */ | |
7e6f5794 | 204 | bufferSize += 1; /* u8 primitive->getAddressesCount */ |
635d2b00 | 205 | { |
8c87f69a | 206 | u16 i1; |
635d2b00 GKH |
207 | for (i1 = 0; i1 < primitive->getAddressesCount; i1++) |
208 | { | |
7e6f5794 | 209 | bufferSize += 6; /* u8 primitive->getAddresses[i1].a[6] */ |
635d2b00 GKH |
210 | } |
211 | } | |
212 | return bufferSize; | |
213 | } | |
214 | ||
215 | ||
d4fda8db | 216 | u8* CsrWifiRouterCtrlMulticastAddressResSer(u8 *ptr, size_t *len, void *msg) |
635d2b00 GKH |
217 | { |
218 | CsrWifiRouterCtrlMulticastAddressRes *primitive = (CsrWifiRouterCtrlMulticastAddressRes *)msg; | |
219 | *len = 0; | |
220 | CsrUint16Ser(ptr, len, primitive->common.type); | |
8c87f69a GKH |
221 | CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag); |
222 | CsrUint16Ser(ptr, len, (u16) primitive->clientData); | |
223 | CsrUint16Ser(ptr, len, (u16) primitive->status); | |
7e6f5794 GKH |
224 | CsrUint8Ser(ptr, len, (u8) primitive->action); |
225 | CsrUint8Ser(ptr, len, (u8) primitive->getAddressesCount); | |
635d2b00 | 226 | { |
8c87f69a | 227 | u16 i1; |
635d2b00 GKH |
228 | for (i1 = 0; i1 < primitive->getAddressesCount; i1++) |
229 | { | |
8c87f69a | 230 | CsrMemCpySer(ptr, len, (const void *) primitive->getAddresses[i1].a, ((u16) (6))); |
635d2b00 GKH |
231 | } |
232 | } | |
233 | return(ptr); | |
234 | } | |
235 | ||
236 | ||
d4fda8db | 237 | void* CsrWifiRouterCtrlMulticastAddressResDes(u8 *buffer, size_t length) |
635d2b00 | 238 | { |
786eeeb3 | 239 | CsrWifiRouterCtrlMulticastAddressRes *primitive = kmalloc(sizeof(CsrWifiRouterCtrlMulticastAddressRes), GFP_KERNEL); |
d4fda8db | 240 | size_t offset; |
635d2b00 GKH |
241 | offset = 0; |
242 | ||
243 | CsrUint16Des(&primitive->common.type, buffer, &offset); | |
8c87f69a GKH |
244 | CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset); |
245 | CsrUint16Des((u16 *) &primitive->clientData, buffer, &offset); | |
246 | CsrUint16Des((u16 *) &primitive->status, buffer, &offset); | |
7e6f5794 GKH |
247 | CsrUint8Des((u8 *) &primitive->action, buffer, &offset); |
248 | CsrUint8Des((u8 *) &primitive->getAddressesCount, buffer, &offset); | |
635d2b00 GKH |
249 | primitive->getAddresses = NULL; |
250 | if (primitive->getAddressesCount) | |
251 | { | |
786eeeb3 | 252 | primitive->getAddresses = kmalloc(sizeof(CsrWifiMacAddress) * primitive->getAddressesCount, GFP_KERNEL); |
635d2b00 GKH |
253 | } |
254 | { | |
8c87f69a | 255 | u16 i1; |
635d2b00 GKH |
256 | for (i1 = 0; i1 < primitive->getAddressesCount; i1++) |
257 | { | |
8c87f69a | 258 | CsrMemCpyDes(primitive->getAddresses[i1].a, buffer, &offset, ((u16) (6))); |
635d2b00 GKH |
259 | } |
260 | } | |
261 | ||
262 | return primitive; | |
263 | } | |
264 | ||
265 | ||
266 | void CsrWifiRouterCtrlMulticastAddressResSerFree(void *voidPrimitivePointer) | |
267 | { | |
268 | CsrWifiRouterCtrlMulticastAddressRes *primitive = (CsrWifiRouterCtrlMulticastAddressRes *) voidPrimitivePointer; | |
55a27055 GKH |
269 | kfree(primitive->getAddresses); |
270 | kfree(primitive); | |
635d2b00 GKH |
271 | } |
272 | ||
273 | ||
d4fda8db | 274 | size_t CsrWifiRouterCtrlPortConfigureReqSizeof(void *msg) |
635d2b00 | 275 | { |
d4fda8db | 276 | size_t bufferSize = 2; |
635d2b00 GKH |
277 | |
278 | /* Calculate the Size of the Serialised Data. Could be more efficient (Try 18) */ | |
8c87f69a | 279 | bufferSize += 2; /* u16 primitive->interfaceTag */ |
635d2b00 GKH |
280 | bufferSize += 2; /* CsrWifiRouterCtrlRequestorInfo primitive->clientData */ |
281 | bufferSize += 2; /* CsrWifiRouterCtrlPortAction primitive->uncontrolledPortAction */ | |
282 | bufferSize += 2; /* CsrWifiRouterCtrlPortAction primitive->controlledPortAction */ | |
7e6f5794 | 283 | bufferSize += 6; /* u8 primitive->macAddress.a[6] */ |
5379b13d | 284 | bufferSize += 1; /* u8 primitive->setProtection */ |
635d2b00 GKH |
285 | return bufferSize; |
286 | } | |
287 | ||
288 | ||
d4fda8db | 289 | u8* CsrWifiRouterCtrlPortConfigureReqSer(u8 *ptr, size_t *len, void *msg) |
635d2b00 GKH |
290 | { |
291 | CsrWifiRouterCtrlPortConfigureReq *primitive = (CsrWifiRouterCtrlPortConfigureReq *)msg; | |
292 | *len = 0; | |
293 | CsrUint16Ser(ptr, len, primitive->common.type); | |
8c87f69a GKH |
294 | CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag); |
295 | CsrUint16Ser(ptr, len, (u16) primitive->clientData); | |
296 | CsrUint16Ser(ptr, len, (u16) primitive->uncontrolledPortAction); | |
297 | CsrUint16Ser(ptr, len, (u16) primitive->controlledPortAction); | |
298 | CsrMemCpySer(ptr, len, (const void *) primitive->macAddress.a, ((u16) (6))); | |
7e6f5794 | 299 | CsrUint8Ser(ptr, len, (u8) primitive->setProtection); |
635d2b00 GKH |
300 | return(ptr); |
301 | } | |
302 | ||
303 | ||
d4fda8db | 304 | void* CsrWifiRouterCtrlPortConfigureReqDes(u8 *buffer, size_t length) |
635d2b00 | 305 | { |
786eeeb3 | 306 | CsrWifiRouterCtrlPortConfigureReq *primitive = kmalloc(sizeof(CsrWifiRouterCtrlPortConfigureReq), GFP_KERNEL); |
d4fda8db | 307 | size_t offset; |
635d2b00 GKH |
308 | offset = 0; |
309 | ||
310 | CsrUint16Des(&primitive->common.type, buffer, &offset); | |
8c87f69a GKH |
311 | CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset); |
312 | CsrUint16Des((u16 *) &primitive->clientData, buffer, &offset); | |
313 | CsrUint16Des((u16 *) &primitive->uncontrolledPortAction, buffer, &offset); | |
314 | CsrUint16Des((u16 *) &primitive->controlledPortAction, buffer, &offset); | |
315 | CsrMemCpyDes(primitive->macAddress.a, buffer, &offset, ((u16) (6))); | |
7e6f5794 | 316 | CsrUint8Des((u8 *) &primitive->setProtection, buffer, &offset); |
635d2b00 GKH |
317 | |
318 | return primitive; | |
319 | } | |
320 | ||
321 | ||
d4fda8db | 322 | size_t CsrWifiRouterCtrlQosControlReqSizeof(void *msg) |
635d2b00 | 323 | { |
d4fda8db | 324 | size_t bufferSize = 2; |
635d2b00 GKH |
325 | |
326 | /* Calculate the Size of the Serialised Data. Could be more efficient (Try 10) */ | |
8c87f69a | 327 | bufferSize += 2; /* u16 primitive->interfaceTag */ |
635d2b00 GKH |
328 | bufferSize += 2; /* CsrWifiRouterCtrlRequestorInfo primitive->clientData */ |
329 | bufferSize += 2; /* CsrWifiRouterCtrlQoSControl primitive->control */ | |
330 | bufferSize += 1; /* CsrWifiRouterCtrlQueueConfigMask primitive->queueConfig */ | |
331 | return bufferSize; | |
332 | } | |
333 | ||
334 | ||
d4fda8db | 335 | u8* CsrWifiRouterCtrlQosControlReqSer(u8 *ptr, size_t *len, void *msg) |
635d2b00 GKH |
336 | { |
337 | CsrWifiRouterCtrlQosControlReq *primitive = (CsrWifiRouterCtrlQosControlReq *)msg; | |
338 | *len = 0; | |
339 | CsrUint16Ser(ptr, len, primitive->common.type); | |
8c87f69a GKH |
340 | CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag); |
341 | CsrUint16Ser(ptr, len, (u16) primitive->clientData); | |
342 | CsrUint16Ser(ptr, len, (u16) primitive->control); | |
7e6f5794 | 343 | CsrUint8Ser(ptr, len, (u8) primitive->queueConfig); |
635d2b00 GKH |
344 | return(ptr); |
345 | } | |
346 | ||
347 | ||
d4fda8db | 348 | void* CsrWifiRouterCtrlQosControlReqDes(u8 *buffer, size_t length) |
635d2b00 | 349 | { |
786eeeb3 | 350 | CsrWifiRouterCtrlQosControlReq *primitive = kmalloc(sizeof(CsrWifiRouterCtrlQosControlReq), GFP_KERNEL); |
d4fda8db | 351 | size_t offset; |
635d2b00 GKH |
352 | offset = 0; |
353 | ||
354 | CsrUint16Des(&primitive->common.type, buffer, &offset); | |
8c87f69a GKH |
355 | CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset); |
356 | CsrUint16Des((u16 *) &primitive->clientData, buffer, &offset); | |
357 | CsrUint16Des((u16 *) &primitive->control, buffer, &offset); | |
7e6f5794 | 358 | CsrUint8Des((u8 *) &primitive->queueConfig, buffer, &offset); |
635d2b00 GKH |
359 | |
360 | return primitive; | |
361 | } | |
362 | ||
363 | ||
d4fda8db | 364 | size_t CsrWifiRouterCtrlSuspendResSizeof(void *msg) |
635d2b00 | 365 | { |
d4fda8db | 366 | size_t bufferSize = 2; |
635d2b00 GKH |
367 | |
368 | /* Calculate the Size of the Serialised Data. Could be more efficient (Try 7) */ | |
369 | bufferSize += 2; /* CsrWifiRouterCtrlRequestorInfo primitive->clientData */ | |
370 | bufferSize += 2; /* CsrResult primitive->status */ | |
371 | return bufferSize; | |
372 | } | |
373 | ||
374 | ||
d4fda8db | 375 | u8* CsrWifiRouterCtrlSuspendResSer(u8 *ptr, size_t *len, void *msg) |
635d2b00 GKH |
376 | { |
377 | CsrWifiRouterCtrlSuspendRes *primitive = (CsrWifiRouterCtrlSuspendRes *)msg; | |
378 | *len = 0; | |
379 | CsrUint16Ser(ptr, len, primitive->common.type); | |
8c87f69a GKH |
380 | CsrUint16Ser(ptr, len, (u16) primitive->clientData); |
381 | CsrUint16Ser(ptr, len, (u16) primitive->status); | |
635d2b00 GKH |
382 | return(ptr); |
383 | } | |
384 | ||
385 | ||
d4fda8db | 386 | void* CsrWifiRouterCtrlSuspendResDes(u8 *buffer, size_t length) |
635d2b00 | 387 | { |
786eeeb3 | 388 | CsrWifiRouterCtrlSuspendRes *primitive = kmalloc(sizeof(CsrWifiRouterCtrlSuspendRes), GFP_KERNEL); |
d4fda8db | 389 | size_t offset; |
635d2b00 GKH |
390 | offset = 0; |
391 | ||
392 | CsrUint16Des(&primitive->common.type, buffer, &offset); | |
8c87f69a GKH |
393 | CsrUint16Des((u16 *) &primitive->clientData, buffer, &offset); |
394 | CsrUint16Des((u16 *) &primitive->status, buffer, &offset); | |
635d2b00 GKH |
395 | |
396 | return primitive; | |
397 | } | |
398 | ||
399 | ||
d4fda8db | 400 | size_t CsrWifiRouterCtrlTclasAddReqSizeof(void *msg) |
635d2b00 GKH |
401 | { |
402 | CsrWifiRouterCtrlTclasAddReq *primitive = (CsrWifiRouterCtrlTclasAddReq *) msg; | |
d4fda8db | 403 | size_t bufferSize = 2; |
635d2b00 GKH |
404 | |
405 | /* Calculate the Size of the Serialised Data. Could be more efficient (Try 10) */ | |
8c87f69a | 406 | bufferSize += 2; /* u16 primitive->interfaceTag */ |
635d2b00 | 407 | bufferSize += 2; /* CsrWifiRouterCtrlRequestorInfo primitive->clientData */ |
8c87f69a | 408 | bufferSize += 2; /* u16 primitive->tclasLength */ |
7e6f5794 | 409 | bufferSize += primitive->tclasLength; /* u8 primitive->tclas */ |
635d2b00 GKH |
410 | return bufferSize; |
411 | } | |
412 | ||
413 | ||
d4fda8db | 414 | u8* CsrWifiRouterCtrlTclasAddReqSer(u8 *ptr, size_t *len, void *msg) |
635d2b00 GKH |
415 | { |
416 | CsrWifiRouterCtrlTclasAddReq *primitive = (CsrWifiRouterCtrlTclasAddReq *)msg; | |
417 | *len = 0; | |
418 | CsrUint16Ser(ptr, len, primitive->common.type); | |
8c87f69a GKH |
419 | CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag); |
420 | CsrUint16Ser(ptr, len, (u16) primitive->clientData); | |
421 | CsrUint16Ser(ptr, len, (u16) primitive->tclasLength); | |
635d2b00 GKH |
422 | if (primitive->tclasLength) |
423 | { | |
8c87f69a | 424 | CsrMemCpySer(ptr, len, (const void *) primitive->tclas, ((u16) (primitive->tclasLength))); |
635d2b00 GKH |
425 | } |
426 | return(ptr); | |
427 | } | |
428 | ||
429 | ||
d4fda8db | 430 | void* CsrWifiRouterCtrlTclasAddReqDes(u8 *buffer, size_t length) |
635d2b00 | 431 | { |
786eeeb3 | 432 | CsrWifiRouterCtrlTclasAddReq *primitive = kmalloc(sizeof(CsrWifiRouterCtrlTclasAddReq), GFP_KERNEL); |
d4fda8db | 433 | size_t offset; |
635d2b00 GKH |
434 | offset = 0; |
435 | ||
436 | CsrUint16Des(&primitive->common.type, buffer, &offset); | |
8c87f69a GKH |
437 | CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset); |
438 | CsrUint16Des((u16 *) &primitive->clientData, buffer, &offset); | |
439 | CsrUint16Des((u16 *) &primitive->tclasLength, buffer, &offset); | |
635d2b00 GKH |
440 | if (primitive->tclasLength) |
441 | { | |
786eeeb3 | 442 | primitive->tclas = kmalloc(primitive->tclasLength, GFP_KERNEL); |
8c87f69a | 443 | CsrMemCpyDes(primitive->tclas, buffer, &offset, ((u16) (primitive->tclasLength))); |
635d2b00 GKH |
444 | } |
445 | else | |
446 | { | |
447 | primitive->tclas = NULL; | |
448 | } | |
449 | ||
450 | return primitive; | |
451 | } | |
452 | ||
453 | ||
454 | void CsrWifiRouterCtrlTclasAddReqSerFree(void *voidPrimitivePointer) | |
455 | { | |
456 | CsrWifiRouterCtrlTclasAddReq *primitive = (CsrWifiRouterCtrlTclasAddReq *) voidPrimitivePointer; | |
55a27055 GKH |
457 | kfree(primitive->tclas); |
458 | kfree(primitive); | |
635d2b00 GKH |
459 | } |
460 | ||
461 | ||
d4fda8db | 462 | size_t CsrWifiRouterCtrlResumeResSizeof(void *msg) |
635d2b00 | 463 | { |
d4fda8db | 464 | size_t bufferSize = 2; |
635d2b00 GKH |
465 | |
466 | /* Calculate the Size of the Serialised Data. Could be more efficient (Try 7) */ | |
467 | bufferSize += 2; /* CsrWifiRouterCtrlRequestorInfo primitive->clientData */ | |
468 | bufferSize += 2; /* CsrResult primitive->status */ | |
469 | return bufferSize; | |
470 | } | |
471 | ||
472 | ||
d4fda8db | 473 | u8* CsrWifiRouterCtrlResumeResSer(u8 *ptr, size_t *len, void *msg) |
635d2b00 GKH |
474 | { |
475 | CsrWifiRouterCtrlResumeRes *primitive = (CsrWifiRouterCtrlResumeRes *)msg; | |
476 | *len = 0; | |
477 | CsrUint16Ser(ptr, len, primitive->common.type); | |
8c87f69a GKH |
478 | CsrUint16Ser(ptr, len, (u16) primitive->clientData); |
479 | CsrUint16Ser(ptr, len, (u16) primitive->status); | |
635d2b00 GKH |
480 | return(ptr); |
481 | } | |
482 | ||
483 | ||
d4fda8db | 484 | void* CsrWifiRouterCtrlResumeResDes(u8 *buffer, size_t length) |
635d2b00 | 485 | { |
786eeeb3 | 486 | CsrWifiRouterCtrlResumeRes *primitive = kmalloc(sizeof(CsrWifiRouterCtrlResumeRes), GFP_KERNEL); |
d4fda8db | 487 | size_t offset; |
635d2b00 GKH |
488 | offset = 0; |
489 | ||
490 | CsrUint16Des(&primitive->common.type, buffer, &offset); | |
8c87f69a GKH |
491 | CsrUint16Des((u16 *) &primitive->clientData, buffer, &offset); |
492 | CsrUint16Des((u16 *) &primitive->status, buffer, &offset); | |
635d2b00 GKH |
493 | |
494 | return primitive; | |
495 | } | |
496 | ||
497 | ||
d4fda8db | 498 | size_t CsrWifiRouterCtrlTclasDelReqSizeof(void *msg) |
635d2b00 GKH |
499 | { |
500 | CsrWifiRouterCtrlTclasDelReq *primitive = (CsrWifiRouterCtrlTclasDelReq *) msg; | |
d4fda8db | 501 | size_t bufferSize = 2; |
635d2b00 GKH |
502 | |
503 | /* Calculate the Size of the Serialised Data. Could be more efficient (Try 10) */ | |
8c87f69a | 504 | bufferSize += 2; /* u16 primitive->interfaceTag */ |
635d2b00 | 505 | bufferSize += 2; /* CsrWifiRouterCtrlRequestorInfo primitive->clientData */ |
8c87f69a | 506 | bufferSize += 2; /* u16 primitive->tclasLength */ |
7e6f5794 | 507 | bufferSize += primitive->tclasLength; /* u8 primitive->tclas */ |
635d2b00 GKH |
508 | return bufferSize; |
509 | } | |
510 | ||
511 | ||
d4fda8db | 512 | u8* CsrWifiRouterCtrlTclasDelReqSer(u8 *ptr, size_t *len, void *msg) |
635d2b00 GKH |
513 | { |
514 | CsrWifiRouterCtrlTclasDelReq *primitive = (CsrWifiRouterCtrlTclasDelReq *)msg; | |
515 | *len = 0; | |
516 | CsrUint16Ser(ptr, len, primitive->common.type); | |
8c87f69a GKH |
517 | CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag); |
518 | CsrUint16Ser(ptr, len, (u16) primitive->clientData); | |
519 | CsrUint16Ser(ptr, len, (u16) primitive->tclasLength); | |
635d2b00 GKH |
520 | if (primitive->tclasLength) |
521 | { | |
8c87f69a | 522 | CsrMemCpySer(ptr, len, (const void *) primitive->tclas, ((u16) (primitive->tclasLength))); |
635d2b00 GKH |
523 | } |
524 | return(ptr); | |
525 | } | |
526 | ||
527 | ||
d4fda8db | 528 | void* CsrWifiRouterCtrlTclasDelReqDes(u8 *buffer, size_t length) |
635d2b00 | 529 | { |
786eeeb3 | 530 | CsrWifiRouterCtrlTclasDelReq *primitive = kmalloc(sizeof(CsrWifiRouterCtrlTclasDelReq), GFP_KERNEL); |
d4fda8db | 531 | size_t offset; |
635d2b00 GKH |
532 | offset = 0; |
533 | ||
534 | CsrUint16Des(&primitive->common.type, buffer, &offset); | |
8c87f69a GKH |
535 | CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset); |
536 | CsrUint16Des((u16 *) &primitive->clientData, buffer, &offset); | |
537 | CsrUint16Des((u16 *) &primitive->tclasLength, buffer, &offset); | |
635d2b00 GKH |
538 | if (primitive->tclasLength) |
539 | { | |
786eeeb3 | 540 | primitive->tclas = kmalloc(primitive->tclasLength, GFP_KERNEL); |
8c87f69a | 541 | CsrMemCpyDes(primitive->tclas, buffer, &offset, ((u16) (primitive->tclasLength))); |
635d2b00 GKH |
542 | } |
543 | else | |
544 | { | |
545 | primitive->tclas = NULL; | |
546 | } | |
547 | ||
548 | return primitive; | |
549 | } | |
550 | ||
551 | ||
552 | void CsrWifiRouterCtrlTclasDelReqSerFree(void *voidPrimitivePointer) | |
553 | { | |
554 | CsrWifiRouterCtrlTclasDelReq *primitive = (CsrWifiRouterCtrlTclasDelReq *) voidPrimitivePointer; | |
55a27055 GKH |
555 | kfree(primitive->tclas); |
556 | kfree(primitive); | |
635d2b00 GKH |
557 | } |
558 | ||
559 | ||
d4fda8db | 560 | size_t CsrWifiRouterCtrlTrafficClassificationReqSizeof(void *msg) |
635d2b00 | 561 | { |
d4fda8db | 562 | size_t bufferSize = 2; |
635d2b00 GKH |
563 | |
564 | /* Calculate the Size of the Serialised Data. Could be more efficient (Try 10) */ | |
8c87f69a | 565 | bufferSize += 2; /* u16 primitive->interfaceTag */ |
635d2b00 GKH |
566 | bufferSize += 2; /* CsrWifiRouterCtrlRequestorInfo primitive->clientData */ |
567 | bufferSize += 1; /* CsrWifiRouterCtrlTrafficType primitive->trafficType */ | |
8c87f69a | 568 | bufferSize += 2; /* u16 primitive->period */ |
635d2b00 GKH |
569 | return bufferSize; |
570 | } | |
571 | ||
572 | ||
d4fda8db | 573 | u8* CsrWifiRouterCtrlTrafficClassificationReqSer(u8 *ptr, size_t *len, void *msg) |
635d2b00 GKH |
574 | { |
575 | CsrWifiRouterCtrlTrafficClassificationReq *primitive = (CsrWifiRouterCtrlTrafficClassificationReq *)msg; | |
576 | *len = 0; | |
577 | CsrUint16Ser(ptr, len, primitive->common.type); | |
8c87f69a GKH |
578 | CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag); |
579 | CsrUint16Ser(ptr, len, (u16) primitive->clientData); | |
7e6f5794 | 580 | CsrUint8Ser(ptr, len, (u8) primitive->trafficType); |
8c87f69a | 581 | CsrUint16Ser(ptr, len, (u16) primitive->period); |
635d2b00 GKH |
582 | return(ptr); |
583 | } | |
584 | ||
585 | ||
d4fda8db | 586 | void* CsrWifiRouterCtrlTrafficClassificationReqDes(u8 *buffer, size_t length) |
635d2b00 | 587 | { |
786eeeb3 | 588 | CsrWifiRouterCtrlTrafficClassificationReq *primitive = kmalloc(sizeof(CsrWifiRouterCtrlTrafficClassificationReq), GFP_KERNEL); |
d4fda8db | 589 | size_t offset; |
635d2b00 GKH |
590 | offset = 0; |
591 | ||
592 | CsrUint16Des(&primitive->common.type, buffer, &offset); | |
8c87f69a GKH |
593 | CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset); |
594 | CsrUint16Des((u16 *) &primitive->clientData, buffer, &offset); | |
7e6f5794 | 595 | CsrUint8Des((u8 *) &primitive->trafficType, buffer, &offset); |
8c87f69a | 596 | CsrUint16Des((u16 *) &primitive->period, buffer, &offset); |
635d2b00 GKH |
597 | |
598 | return primitive; | |
599 | } | |
600 | ||
601 | ||
d4fda8db | 602 | size_t CsrWifiRouterCtrlTrafficConfigReqSizeof(void *msg) |
635d2b00 | 603 | { |
d4fda8db | 604 | size_t bufferSize = 2; |
635d2b00 GKH |
605 | |
606 | /* Calculate the Size of the Serialised Data. Could be more efficient (Try 24) */ | |
8c87f69a | 607 | bufferSize += 2; /* u16 primitive->interfaceTag */ |
635d2b00 GKH |
608 | bufferSize += 2; /* CsrWifiRouterCtrlRequestorInfo primitive->clientData */ |
609 | bufferSize += 2; /* CsrWifiRouterCtrlTrafficConfigType primitive->trafficConfigType */ | |
8c87f69a | 610 | bufferSize += 2; /* u16 primitive->config.packetFilter */ |
26a6b2e1 | 611 | bufferSize += 4; /* u32 primitive->config.customFilter.etherType */ |
7e6f5794 | 612 | bufferSize += 1; /* u8 primitive->config.customFilter.ipType */ |
26a6b2e1 GKH |
613 | bufferSize += 4; /* u32 primitive->config.customFilter.udpSourcePort */ |
614 | bufferSize += 4; /* u32 primitive->config.customFilter.udpDestPort */ | |
635d2b00 GKH |
615 | return bufferSize; |
616 | } | |
617 | ||
618 | ||
d4fda8db | 619 | u8* CsrWifiRouterCtrlTrafficConfigReqSer(u8 *ptr, size_t *len, void *msg) |
635d2b00 GKH |
620 | { |
621 | CsrWifiRouterCtrlTrafficConfigReq *primitive = (CsrWifiRouterCtrlTrafficConfigReq *)msg; | |
622 | *len = 0; | |
623 | CsrUint16Ser(ptr, len, primitive->common.type); | |
8c87f69a GKH |
624 | CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag); |
625 | CsrUint16Ser(ptr, len, (u16) primitive->clientData); | |
626 | CsrUint16Ser(ptr, len, (u16) primitive->trafficConfigType); | |
627 | CsrUint16Ser(ptr, len, (u16) primitive->config.packetFilter); | |
26a6b2e1 | 628 | CsrUint32Ser(ptr, len, (u32) primitive->config.customFilter.etherType); |
7e6f5794 | 629 | CsrUint8Ser(ptr, len, (u8) primitive->config.customFilter.ipType); |
26a6b2e1 GKH |
630 | CsrUint32Ser(ptr, len, (u32) primitive->config.customFilter.udpSourcePort); |
631 | CsrUint32Ser(ptr, len, (u32) primitive->config.customFilter.udpDestPort); | |
635d2b00 GKH |
632 | return(ptr); |
633 | } | |
634 | ||
635 | ||
d4fda8db | 636 | void* CsrWifiRouterCtrlTrafficConfigReqDes(u8 *buffer, size_t length) |
635d2b00 | 637 | { |
786eeeb3 | 638 | CsrWifiRouterCtrlTrafficConfigReq *primitive = kmalloc(sizeof(CsrWifiRouterCtrlTrafficConfigReq), GFP_KERNEL); |
d4fda8db | 639 | size_t offset; |
635d2b00 GKH |
640 | offset = 0; |
641 | ||
642 | CsrUint16Des(&primitive->common.type, buffer, &offset); | |
8c87f69a GKH |
643 | CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset); |
644 | CsrUint16Des((u16 *) &primitive->clientData, buffer, &offset); | |
645 | CsrUint16Des((u16 *) &primitive->trafficConfigType, buffer, &offset); | |
646 | CsrUint16Des((u16 *) &primitive->config.packetFilter, buffer, &offset); | |
26a6b2e1 | 647 | CsrUint32Des((u32 *) &primitive->config.customFilter.etherType, buffer, &offset); |
7e6f5794 | 648 | CsrUint8Des((u8 *) &primitive->config.customFilter.ipType, buffer, &offset); |
26a6b2e1 GKH |
649 | CsrUint32Des((u32 *) &primitive->config.customFilter.udpSourcePort, buffer, &offset); |
650 | CsrUint32Des((u32 *) &primitive->config.customFilter.udpDestPort, buffer, &offset); | |
635d2b00 GKH |
651 | |
652 | return primitive; | |
653 | } | |
654 | ||
655 | ||
d4fda8db | 656 | size_t CsrWifiRouterCtrlWifiOnReqSizeof(void *msg) |
95edd09e GKH |
657 | { |
658 | CsrWifiRouterCtrlWifiOnReq *primitive = (CsrWifiRouterCtrlWifiOnReq *) msg; | |
d4fda8db | 659 | size_t bufferSize = 2; |
95edd09e GKH |
660 | |
661 | /* Calculate the Size of the Serialised Data. Could be more efficient (Try 10) */ | |
662 | bufferSize += 2; /* CsrWifiRouterCtrlRequestorInfo primitive->clientData */ | |
26a6b2e1 | 663 | bufferSize += 4; /* u32 primitive->dataLength */ |
7e6f5794 | 664 | bufferSize += primitive->dataLength; /* u8 primitive->data */ |
95edd09e GKH |
665 | return bufferSize; |
666 | } | |
667 | ||
668 | ||
d4fda8db | 669 | u8* CsrWifiRouterCtrlWifiOnReqSer(u8 *ptr, size_t *len, void *msg) |
95edd09e GKH |
670 | { |
671 | CsrWifiRouterCtrlWifiOnReq *primitive = (CsrWifiRouterCtrlWifiOnReq *)msg; | |
672 | *len = 0; | |
673 | CsrUint16Ser(ptr, len, primitive->common.type); | |
8c87f69a | 674 | CsrUint16Ser(ptr, len, (u16) primitive->clientData); |
26a6b2e1 | 675 | CsrUint32Ser(ptr, len, (u32) primitive->dataLength); |
95edd09e GKH |
676 | if (primitive->dataLength) |
677 | { | |
8c87f69a | 678 | CsrMemCpySer(ptr, len, (const void *) primitive->data, ((u16) (primitive->dataLength))); |
95edd09e GKH |
679 | } |
680 | return(ptr); | |
681 | } | |
682 | ||
683 | ||
d4fda8db | 684 | void* CsrWifiRouterCtrlWifiOnReqDes(u8 *buffer, size_t length) |
95edd09e | 685 | { |
786eeeb3 | 686 | CsrWifiRouterCtrlWifiOnReq *primitive = kmalloc(sizeof(CsrWifiRouterCtrlWifiOnReq), GFP_KERNEL); |
d4fda8db | 687 | size_t offset; |
95edd09e GKH |
688 | offset = 0; |
689 | ||
690 | CsrUint16Des(&primitive->common.type, buffer, &offset); | |
8c87f69a | 691 | CsrUint16Des((u16 *) &primitive->clientData, buffer, &offset); |
26a6b2e1 | 692 | CsrUint32Des((u32 *) &primitive->dataLength, buffer, &offset); |
95edd09e GKH |
693 | if (primitive->dataLength) |
694 | { | |
786eeeb3 | 695 | primitive->data = kmalloc(primitive->dataLength, GFP_KERNEL); |
8c87f69a | 696 | CsrMemCpyDes(primitive->data, buffer, &offset, ((u16) (primitive->dataLength))); |
95edd09e GKH |
697 | } |
698 | else | |
699 | { | |
700 | primitive->data = NULL; | |
701 | } | |
702 | ||
703 | return primitive; | |
704 | } | |
705 | ||
706 | ||
707 | void CsrWifiRouterCtrlWifiOnReqSerFree(void *voidPrimitivePointer) | |
708 | { | |
709 | CsrWifiRouterCtrlWifiOnReq *primitive = (CsrWifiRouterCtrlWifiOnReq *) voidPrimitivePointer; | |
55a27055 GKH |
710 | kfree(primitive->data); |
711 | kfree(primitive); | |
95edd09e GKH |
712 | } |
713 | ||
714 | ||
d4fda8db | 715 | size_t CsrWifiRouterCtrlWifiOnResSizeof(void *msg) |
635d2b00 GKH |
716 | { |
717 | CsrWifiRouterCtrlWifiOnRes *primitive = (CsrWifiRouterCtrlWifiOnRes *) msg; | |
d4fda8db | 718 | size_t bufferSize = 2; |
635d2b00 GKH |
719 | |
720 | /* Calculate the Size of the Serialised Data. Could be more efficient (Try 30) */ | |
721 | bufferSize += 2; /* CsrWifiRouterCtrlRequestorInfo primitive->clientData */ | |
722 | bufferSize += 2; /* CsrResult primitive->status */ | |
8c87f69a | 723 | bufferSize += 2; /* u16 primitive->numInterfaceAddress */ |
635d2b00 | 724 | { |
8c87f69a | 725 | u16 i1; |
635d2b00 GKH |
726 | for (i1 = 0; i1 < 2; i1++) |
727 | { | |
7e6f5794 | 728 | bufferSize += 6; /* u8 primitive->stationMacAddress[i1].a[6] */ |
635d2b00 GKH |
729 | } |
730 | } | |
26a6b2e1 | 731 | bufferSize += 4; /* u32 primitive->smeVersions.firmwarePatch */ |
4bcb20f8 | 732 | bufferSize += (primitive->smeVersions.smeBuild ? strlen(primitive->smeVersions.smeBuild) : 0) + 1; /* char* primitive->smeVersions.smeBuild (0 byte len + 1 for NULL Term) */ |
26a6b2e1 | 733 | bufferSize += 4; /* u32 primitive->smeVersions.smeHip */ |
5379b13d | 734 | bufferSize += 1; /* u8 primitive->scheduledInterrupt */ |
635d2b00 GKH |
735 | return bufferSize; |
736 | } | |
737 | ||
738 | ||
d4fda8db | 739 | u8* CsrWifiRouterCtrlWifiOnResSer(u8 *ptr, size_t *len, void *msg) |
635d2b00 GKH |
740 | { |
741 | CsrWifiRouterCtrlWifiOnRes *primitive = (CsrWifiRouterCtrlWifiOnRes *)msg; | |
742 | *len = 0; | |
743 | CsrUint16Ser(ptr, len, primitive->common.type); | |
8c87f69a GKH |
744 | CsrUint16Ser(ptr, len, (u16) primitive->clientData); |
745 | CsrUint16Ser(ptr, len, (u16) primitive->status); | |
746 | CsrUint16Ser(ptr, len, (u16) primitive->numInterfaceAddress); | |
635d2b00 | 747 | { |
8c87f69a | 748 | u16 i1; |
635d2b00 GKH |
749 | for (i1 = 0; i1 < 2; i1++) |
750 | { | |
8c87f69a | 751 | CsrMemCpySer(ptr, len, (const void *) primitive->stationMacAddress[i1].a, ((u16) (6))); |
635d2b00 GKH |
752 | } |
753 | } | |
26a6b2e1 | 754 | CsrUint32Ser(ptr, len, (u32) primitive->smeVersions.firmwarePatch); |
635d2b00 | 755 | CsrCharStringSer(ptr, len, primitive->smeVersions.smeBuild); |
26a6b2e1 | 756 | CsrUint32Ser(ptr, len, (u32) primitive->smeVersions.smeHip); |
7e6f5794 | 757 | CsrUint8Ser(ptr, len, (u8) primitive->scheduledInterrupt); |
635d2b00 GKH |
758 | return(ptr); |
759 | } | |
760 | ||
761 | ||
d4fda8db | 762 | void* CsrWifiRouterCtrlWifiOnResDes(u8 *buffer, size_t length) |
635d2b00 | 763 | { |
786eeeb3 | 764 | CsrWifiRouterCtrlWifiOnRes *primitive = kmalloc(sizeof(CsrWifiRouterCtrlWifiOnRes), GFP_KERNEL); |
d4fda8db | 765 | size_t offset; |
635d2b00 GKH |
766 | offset = 0; |
767 | ||
768 | CsrUint16Des(&primitive->common.type, buffer, &offset); | |
8c87f69a GKH |
769 | CsrUint16Des((u16 *) &primitive->clientData, buffer, &offset); |
770 | CsrUint16Des((u16 *) &primitive->status, buffer, &offset); | |
771 | CsrUint16Des((u16 *) &primitive->numInterfaceAddress, buffer, &offset); | |
635d2b00 | 772 | { |
8c87f69a | 773 | u16 i1; |
635d2b00 GKH |
774 | for (i1 = 0; i1 < 2; i1++) |
775 | { | |
8c87f69a | 776 | CsrMemCpyDes(primitive->stationMacAddress[i1].a, buffer, &offset, ((u16) (6))); |
635d2b00 GKH |
777 | } |
778 | } | |
26a6b2e1 | 779 | CsrUint32Des((u32 *) &primitive->smeVersions.firmwarePatch, buffer, &offset); |
635d2b00 | 780 | CsrCharStringDes(&primitive->smeVersions.smeBuild, buffer, &offset); |
26a6b2e1 | 781 | CsrUint32Des((u32 *) &primitive->smeVersions.smeHip, buffer, &offset); |
7e6f5794 | 782 | CsrUint8Des((u8 *) &primitive->scheduledInterrupt, buffer, &offset); |
635d2b00 GKH |
783 | |
784 | return primitive; | |
785 | } | |
786 | ||
787 | ||
788 | void CsrWifiRouterCtrlWifiOnResSerFree(void *voidPrimitivePointer) | |
789 | { | |
790 | CsrWifiRouterCtrlWifiOnRes *primitive = (CsrWifiRouterCtrlWifiOnRes *) voidPrimitivePointer; | |
55a27055 GKH |
791 | kfree(primitive->smeVersions.smeBuild); |
792 | kfree(primitive); | |
635d2b00 GKH |
793 | } |
794 | ||
795 | ||
d4fda8db | 796 | size_t CsrWifiRouterCtrlM4TransmitReqSizeof(void *msg) |
635d2b00 | 797 | { |
d4fda8db | 798 | size_t bufferSize = 2; |
635d2b00 GKH |
799 | |
800 | /* Calculate the Size of the Serialised Data. Could be more efficient (Try 7) */ | |
8c87f69a | 801 | bufferSize += 2; /* u16 primitive->interfaceTag */ |
635d2b00 GKH |
802 | bufferSize += 2; /* CsrWifiRouterCtrlRequestorInfo primitive->clientData */ |
803 | return bufferSize; | |
804 | } | |
805 | ||
806 | ||
d4fda8db | 807 | u8* CsrWifiRouterCtrlM4TransmitReqSer(u8 *ptr, size_t *len, void *msg) |
635d2b00 GKH |
808 | { |
809 | CsrWifiRouterCtrlM4TransmitReq *primitive = (CsrWifiRouterCtrlM4TransmitReq *)msg; | |
810 | *len = 0; | |
811 | CsrUint16Ser(ptr, len, primitive->common.type); | |
8c87f69a GKH |
812 | CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag); |
813 | CsrUint16Ser(ptr, len, (u16) primitive->clientData); | |
635d2b00 GKH |
814 | return(ptr); |
815 | } | |
816 | ||
817 | ||
d4fda8db | 818 | void* CsrWifiRouterCtrlM4TransmitReqDes(u8 *buffer, size_t length) |
635d2b00 | 819 | { |
786eeeb3 | 820 | CsrWifiRouterCtrlM4TransmitReq *primitive = kmalloc(sizeof(CsrWifiRouterCtrlM4TransmitReq), GFP_KERNEL); |
d4fda8db | 821 | size_t offset; |
635d2b00 GKH |
822 | offset = 0; |
823 | ||
824 | CsrUint16Des(&primitive->common.type, buffer, &offset); | |
8c87f69a GKH |
825 | CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset); |
826 | CsrUint16Des((u16 *) &primitive->clientData, buffer, &offset); | |
635d2b00 GKH |
827 | |
828 | return primitive; | |
829 | } | |
830 | ||
831 | ||
d4fda8db | 832 | size_t CsrWifiRouterCtrlModeSetReqSizeof(void *msg) |
635d2b00 | 833 | { |
d4fda8db | 834 | size_t bufferSize = 2; |
635d2b00 GKH |
835 | |
836 | /* Calculate the Size of the Serialised Data. Could be more efficient (Try 16) */ | |
8c87f69a | 837 | bufferSize += 2; /* u16 primitive->interfaceTag */ |
635d2b00 GKH |
838 | bufferSize += 2; /* CsrWifiRouterCtrlRequestorInfo primitive->clientData */ |
839 | bufferSize += 1; /* CsrWifiRouterCtrlMode primitive->mode */ | |
7e6f5794 | 840 | bufferSize += 6; /* u8 primitive->bssid.a[6] */ |
5379b13d GKH |
841 | bufferSize += 1; /* u8 primitive->protection */ |
842 | bufferSize += 1; /* u8 primitive->intraBssDistEnabled */ | |
635d2b00 GKH |
843 | return bufferSize; |
844 | } | |
845 | ||
846 | ||
d4fda8db | 847 | u8* CsrWifiRouterCtrlModeSetReqSer(u8 *ptr, size_t *len, void *msg) |
635d2b00 GKH |
848 | { |
849 | CsrWifiRouterCtrlModeSetReq *primitive = (CsrWifiRouterCtrlModeSetReq *)msg; | |
850 | *len = 0; | |
851 | CsrUint16Ser(ptr, len, primitive->common.type); | |
8c87f69a GKH |
852 | CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag); |
853 | CsrUint16Ser(ptr, len, (u16) primitive->clientData); | |
7e6f5794 | 854 | CsrUint8Ser(ptr, len, (u8) primitive->mode); |
8c87f69a | 855 | CsrMemCpySer(ptr, len, (const void *) primitive->bssid.a, ((u16) (6))); |
7e6f5794 GKH |
856 | CsrUint8Ser(ptr, len, (u8) primitive->protection); |
857 | CsrUint8Ser(ptr, len, (u8) primitive->intraBssDistEnabled); | |
635d2b00 GKH |
858 | return(ptr); |
859 | } | |
860 | ||
861 | ||
d4fda8db | 862 | void* CsrWifiRouterCtrlModeSetReqDes(u8 *buffer, size_t length) |
635d2b00 | 863 | { |
786eeeb3 | 864 | CsrWifiRouterCtrlModeSetReq *primitive = kmalloc(sizeof(CsrWifiRouterCtrlModeSetReq), GFP_KERNEL); |
d4fda8db | 865 | size_t offset; |
635d2b00 GKH |
866 | offset = 0; |
867 | ||
868 | CsrUint16Des(&primitive->common.type, buffer, &offset); | |
8c87f69a GKH |
869 | CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset); |
870 | CsrUint16Des((u16 *) &primitive->clientData, buffer, &offset); | |
7e6f5794 | 871 | CsrUint8Des((u8 *) &primitive->mode, buffer, &offset); |
8c87f69a | 872 | CsrMemCpyDes(primitive->bssid.a, buffer, &offset, ((u16) (6))); |
7e6f5794 GKH |
873 | CsrUint8Des((u8 *) &primitive->protection, buffer, &offset); |
874 | CsrUint8Des((u8 *) &primitive->intraBssDistEnabled, buffer, &offset); | |
635d2b00 GKH |
875 | |
876 | return primitive; | |
877 | } | |
878 | ||
879 | ||
d4fda8db | 880 | size_t CsrWifiRouterCtrlPeerAddReqSizeof(void *msg) |
635d2b00 | 881 | { |
d4fda8db | 882 | size_t bufferSize = 2; |
635d2b00 GKH |
883 | |
884 | /* Calculate the Size of the Serialised Data. Could be more efficient (Try 21) */ | |
8c87f69a | 885 | bufferSize += 2; /* u16 primitive->interfaceTag */ |
635d2b00 | 886 | bufferSize += 2; /* CsrWifiRouterCtrlRequestorInfo primitive->clientData */ |
7e6f5794 | 887 | bufferSize += 6; /* u8 primitive->peerMacAddress.a[6] */ |
8c87f69a | 888 | bufferSize += 2; /* u16 primitive->associationId */ |
5379b13d | 889 | bufferSize += 1; /* u8 primitive->staInfo.wmmOrQosEnabled */ |
635d2b00 | 890 | bufferSize += 2; /* CsrWifiRouterCtrlPowersaveTypeMask primitive->staInfo.powersaveMode */ |
7e6f5794 | 891 | bufferSize += 1; /* u8 primitive->staInfo.maxSpLength */ |
8c87f69a | 892 | bufferSize += 2; /* u16 primitive->staInfo.listenIntervalInTus */ |
635d2b00 GKH |
893 | return bufferSize; |
894 | } | |
895 | ||
896 | ||
d4fda8db | 897 | u8* CsrWifiRouterCtrlPeerAddReqSer(u8 *ptr, size_t *len, void *msg) |
635d2b00 GKH |
898 | { |
899 | CsrWifiRouterCtrlPeerAddReq *primitive = (CsrWifiRouterCtrlPeerAddReq *)msg; | |
900 | *len = 0; | |
901 | CsrUint16Ser(ptr, len, primitive->common.type); | |
8c87f69a GKH |
902 | CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag); |
903 | CsrUint16Ser(ptr, len, (u16) primitive->clientData); | |
904 | CsrMemCpySer(ptr, len, (const void *) primitive->peerMacAddress.a, ((u16) (6))); | |
905 | CsrUint16Ser(ptr, len, (u16) primitive->associationId); | |
7e6f5794 | 906 | CsrUint8Ser(ptr, len, (u8) primitive->staInfo.wmmOrQosEnabled); |
8c87f69a | 907 | CsrUint16Ser(ptr, len, (u16) primitive->staInfo.powersaveMode); |
7e6f5794 | 908 | CsrUint8Ser(ptr, len, (u8) primitive->staInfo.maxSpLength); |
8c87f69a | 909 | CsrUint16Ser(ptr, len, (u16) primitive->staInfo.listenIntervalInTus); |
635d2b00 GKH |
910 | return(ptr); |
911 | } | |
912 | ||
913 | ||
d4fda8db | 914 | void* CsrWifiRouterCtrlPeerAddReqDes(u8 *buffer, size_t length) |
635d2b00 | 915 | { |
786eeeb3 | 916 | CsrWifiRouterCtrlPeerAddReq *primitive = kmalloc(sizeof(CsrWifiRouterCtrlPeerAddReq), GFP_KERNEL); |
d4fda8db | 917 | size_t offset; |
635d2b00 GKH |
918 | offset = 0; |
919 | ||
920 | CsrUint16Des(&primitive->common.type, buffer, &offset); | |
8c87f69a GKH |
921 | CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset); |
922 | CsrUint16Des((u16 *) &primitive->clientData, buffer, &offset); | |
923 | CsrMemCpyDes(primitive->peerMacAddress.a, buffer, &offset, ((u16) (6))); | |
924 | CsrUint16Des((u16 *) &primitive->associationId, buffer, &offset); | |
7e6f5794 | 925 | CsrUint8Des((u8 *) &primitive->staInfo.wmmOrQosEnabled, buffer, &offset); |
8c87f69a | 926 | CsrUint16Des((u16 *) &primitive->staInfo.powersaveMode, buffer, &offset); |
7e6f5794 | 927 | CsrUint8Des((u8 *) &primitive->staInfo.maxSpLength, buffer, &offset); |
8c87f69a | 928 | CsrUint16Des((u16 *) &primitive->staInfo.listenIntervalInTus, buffer, &offset); |
635d2b00 GKH |
929 | |
930 | return primitive; | |
931 | } | |
932 | ||
933 | ||
d4fda8db | 934 | size_t CsrWifiRouterCtrlPeerDelReqSizeof(void *msg) |
635d2b00 | 935 | { |
d4fda8db | 936 | size_t bufferSize = 2; |
635d2b00 GKH |
937 | |
938 | /* Calculate the Size of the Serialised Data. Could be more efficient (Try 11) */ | |
8c87f69a | 939 | bufferSize += 2; /* u16 primitive->interfaceTag */ |
635d2b00 GKH |
940 | bufferSize += 2; /* CsrWifiRouterCtrlRequestorInfo primitive->clientData */ |
941 | bufferSize += 4; /* CsrWifiRouterCtrlPeerRecordHandle primitive->peerRecordHandle */ | |
942 | return bufferSize; | |
943 | } | |
944 | ||
945 | ||
d4fda8db | 946 | u8* CsrWifiRouterCtrlPeerDelReqSer(u8 *ptr, size_t *len, void *msg) |
635d2b00 GKH |
947 | { |
948 | CsrWifiRouterCtrlPeerDelReq *primitive = (CsrWifiRouterCtrlPeerDelReq *)msg; | |
949 | *len = 0; | |
950 | CsrUint16Ser(ptr, len, primitive->common.type); | |
8c87f69a GKH |
951 | CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag); |
952 | CsrUint16Ser(ptr, len, (u16) primitive->clientData); | |
26a6b2e1 | 953 | CsrUint32Ser(ptr, len, (u32) primitive->peerRecordHandle); |
635d2b00 GKH |
954 | return(ptr); |
955 | } | |
956 | ||
957 | ||
d4fda8db | 958 | void* CsrWifiRouterCtrlPeerDelReqDes(u8 *buffer, size_t length) |
635d2b00 | 959 | { |
786eeeb3 | 960 | CsrWifiRouterCtrlPeerDelReq *primitive = kmalloc(sizeof(CsrWifiRouterCtrlPeerDelReq), GFP_KERNEL); |
d4fda8db | 961 | size_t offset; |
635d2b00 GKH |
962 | offset = 0; |
963 | ||
964 | CsrUint16Des(&primitive->common.type, buffer, &offset); | |
8c87f69a GKH |
965 | CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset); |
966 | CsrUint16Des((u16 *) &primitive->clientData, buffer, &offset); | |
26a6b2e1 | 967 | CsrUint32Des((u32 *) &primitive->peerRecordHandle, buffer, &offset); |
635d2b00 GKH |
968 | |
969 | return primitive; | |
970 | } | |
971 | ||
972 | ||
d4fda8db | 973 | size_t CsrWifiRouterCtrlPeerUpdateReqSizeof(void *msg) |
635d2b00 | 974 | { |
d4fda8db | 975 | size_t bufferSize = 2; |
635d2b00 GKH |
976 | |
977 | /* Calculate the Size of the Serialised Data. Could be more efficient (Try 13) */ | |
8c87f69a | 978 | bufferSize += 2; /* u16 primitive->interfaceTag */ |
635d2b00 GKH |
979 | bufferSize += 2; /* CsrWifiRouterCtrlRequestorInfo primitive->clientData */ |
980 | bufferSize += 4; /* CsrWifiRouterCtrlPeerRecordHandle primitive->peerRecordHandle */ | |
981 | bufferSize += 2; /* CsrWifiRouterCtrlPowersaveTypeMask primitive->powersaveMode */ | |
982 | return bufferSize; | |
983 | } | |
984 | ||
985 | ||
d4fda8db | 986 | u8* CsrWifiRouterCtrlPeerUpdateReqSer(u8 *ptr, size_t *len, void *msg) |
635d2b00 GKH |
987 | { |
988 | CsrWifiRouterCtrlPeerUpdateReq *primitive = (CsrWifiRouterCtrlPeerUpdateReq *)msg; | |
989 | *len = 0; | |
990 | CsrUint16Ser(ptr, len, primitive->common.type); | |
8c87f69a GKH |
991 | CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag); |
992 | CsrUint16Ser(ptr, len, (u16) primitive->clientData); | |
26a6b2e1 | 993 | CsrUint32Ser(ptr, len, (u32) primitive->peerRecordHandle); |
8c87f69a | 994 | CsrUint16Ser(ptr, len, (u16) primitive->powersaveMode); |
635d2b00 GKH |
995 | return(ptr); |
996 | } | |
997 | ||
998 | ||
d4fda8db | 999 | void* CsrWifiRouterCtrlPeerUpdateReqDes(u8 *buffer, size_t length) |
635d2b00 | 1000 | { |
786eeeb3 | 1001 | CsrWifiRouterCtrlPeerUpdateReq *primitive = kmalloc(sizeof(CsrWifiRouterCtrlPeerUpdateReq), GFP_KERNEL); |
d4fda8db | 1002 | size_t offset; |
635d2b00 GKH |
1003 | offset = 0; |
1004 | ||
1005 | CsrUint16Des(&primitive->common.type, buffer, &offset); | |
8c87f69a GKH |
1006 | CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset); |
1007 | CsrUint16Des((u16 *) &primitive->clientData, buffer, &offset); | |
26a6b2e1 | 1008 | CsrUint32Des((u32 *) &primitive->peerRecordHandle, buffer, &offset); |
8c87f69a | 1009 | CsrUint16Des((u16 *) &primitive->powersaveMode, buffer, &offset); |
635d2b00 GKH |
1010 | |
1011 | return primitive; | |
1012 | } | |
1013 | ||
1014 | ||
d4fda8db | 1015 | size_t CsrWifiRouterCtrlBlockAckEnableReqSizeof(void *msg) |
635d2b00 | 1016 | { |
d4fda8db | 1017 | size_t bufferSize = 2; |
635d2b00 GKH |
1018 | |
1019 | /* Calculate the Size of the Serialised Data. Could be more efficient (Try 21) */ | |
8c87f69a | 1020 | bufferSize += 2; /* u16 primitive->interfaceTag */ |
635d2b00 | 1021 | bufferSize += 2; /* CsrWifiRouterCtrlRequestorInfo primitive->clientData */ |
7e6f5794 | 1022 | bufferSize += 6; /* u8 primitive->macAddress.a[6] */ |
635d2b00 GKH |
1023 | bufferSize += 1; /* CsrWifiRouterCtrlTrafficStreamId primitive->trafficStreamID */ |
1024 | bufferSize += 1; /* CsrWifiRouterCtrlBlockAckRole primitive->role */ | |
8c87f69a GKH |
1025 | bufferSize += 2; /* u16 primitive->bufferSize */ |
1026 | bufferSize += 2; /* u16 primitive->timeout */ | |
1027 | bufferSize += 2; /* u16 primitive->ssn */ | |
635d2b00 GKH |
1028 | return bufferSize; |
1029 | } | |
1030 | ||
1031 | ||
d4fda8db | 1032 | u8* CsrWifiRouterCtrlBlockAckEnableReqSer(u8 *ptr, size_t *len, void *msg) |
635d2b00 GKH |
1033 | { |
1034 | CsrWifiRouterCtrlBlockAckEnableReq *primitive = (CsrWifiRouterCtrlBlockAckEnableReq *)msg; | |
1035 | *len = 0; | |
1036 | CsrUint16Ser(ptr, len, primitive->common.type); | |
8c87f69a GKH |
1037 | CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag); |
1038 | CsrUint16Ser(ptr, len, (u16) primitive->clientData); | |
1039 | CsrMemCpySer(ptr, len, (const void *) primitive->macAddress.a, ((u16) (6))); | |
7e6f5794 GKH |
1040 | CsrUint8Ser(ptr, len, (u8) primitive->trafficStreamID); |
1041 | CsrUint8Ser(ptr, len, (u8) primitive->role); | |
8c87f69a GKH |
1042 | CsrUint16Ser(ptr, len, (u16) primitive->bufferSize); |
1043 | CsrUint16Ser(ptr, len, (u16) primitive->timeout); | |
1044 | CsrUint16Ser(ptr, len, (u16) primitive->ssn); | |
635d2b00 GKH |
1045 | return(ptr); |
1046 | } | |
1047 | ||
1048 | ||
d4fda8db | 1049 | void* CsrWifiRouterCtrlBlockAckEnableReqDes(u8 *buffer, size_t length) |
635d2b00 | 1050 | { |
786eeeb3 | 1051 | CsrWifiRouterCtrlBlockAckEnableReq *primitive = kmalloc(sizeof(CsrWifiRouterCtrlBlockAckEnableReq), GFP_KERNEL); |
d4fda8db | 1052 | size_t offset; |
635d2b00 GKH |
1053 | offset = 0; |
1054 | ||
1055 | CsrUint16Des(&primitive->common.type, buffer, &offset); | |
8c87f69a GKH |
1056 | CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset); |
1057 | CsrUint16Des((u16 *) &primitive->clientData, buffer, &offset); | |
1058 | CsrMemCpyDes(primitive->macAddress.a, buffer, &offset, ((u16) (6))); | |
7e6f5794 GKH |
1059 | CsrUint8Des((u8 *) &primitive->trafficStreamID, buffer, &offset); |
1060 | CsrUint8Des((u8 *) &primitive->role, buffer, &offset); | |
8c87f69a GKH |
1061 | CsrUint16Des((u16 *) &primitive->bufferSize, buffer, &offset); |
1062 | CsrUint16Des((u16 *) &primitive->timeout, buffer, &offset); | |
1063 | CsrUint16Des((u16 *) &primitive->ssn, buffer, &offset); | |
635d2b00 GKH |
1064 | |
1065 | return primitive; | |
1066 | } | |
1067 | ||
1068 | ||
d4fda8db | 1069 | size_t CsrWifiRouterCtrlBlockAckDisableReqSizeof(void *msg) |
635d2b00 | 1070 | { |
d4fda8db | 1071 | size_t bufferSize = 2; |
635d2b00 GKH |
1072 | |
1073 | /* Calculate the Size of the Serialised Data. Could be more efficient (Try 15) */ | |
8c87f69a | 1074 | bufferSize += 2; /* u16 primitive->interfaceTag */ |
635d2b00 | 1075 | bufferSize += 2; /* CsrWifiRouterCtrlRequestorInfo primitive->clientData */ |
7e6f5794 | 1076 | bufferSize += 6; /* u8 primitive->macAddress.a[6] */ |
635d2b00 GKH |
1077 | bufferSize += 1; /* CsrWifiRouterCtrlTrafficStreamId primitive->trafficStreamID */ |
1078 | bufferSize += 1; /* CsrWifiRouterCtrlBlockAckRole primitive->role */ | |
1079 | return bufferSize; | |
1080 | } | |
1081 | ||
1082 | ||
d4fda8db | 1083 | u8* CsrWifiRouterCtrlBlockAckDisableReqSer(u8 *ptr, size_t *len, void *msg) |
635d2b00 GKH |
1084 | { |
1085 | CsrWifiRouterCtrlBlockAckDisableReq *primitive = (CsrWifiRouterCtrlBlockAckDisableReq *)msg; | |
1086 | *len = 0; | |
1087 | CsrUint16Ser(ptr, len, primitive->common.type); | |
8c87f69a GKH |
1088 | CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag); |
1089 | CsrUint16Ser(ptr, len, (u16) primitive->clientData); | |
1090 | CsrMemCpySer(ptr, len, (const void *) primitive->macAddress.a, ((u16) (6))); | |
7e6f5794 GKH |
1091 | CsrUint8Ser(ptr, len, (u8) primitive->trafficStreamID); |
1092 | CsrUint8Ser(ptr, len, (u8) primitive->role); | |
635d2b00 GKH |
1093 | return(ptr); |
1094 | } | |
1095 | ||
1096 | ||
d4fda8db | 1097 | void* CsrWifiRouterCtrlBlockAckDisableReqDes(u8 *buffer, size_t length) |
635d2b00 | 1098 | { |
786eeeb3 | 1099 | CsrWifiRouterCtrlBlockAckDisableReq *primitive = kmalloc(sizeof(CsrWifiRouterCtrlBlockAckDisableReq), GFP_KERNEL); |
d4fda8db | 1100 | size_t offset; |
635d2b00 GKH |
1101 | offset = 0; |
1102 | ||
1103 | CsrUint16Des(&primitive->common.type, buffer, &offset); | |
8c87f69a GKH |
1104 | CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset); |
1105 | CsrUint16Des((u16 *) &primitive->clientData, buffer, &offset); | |
1106 | CsrMemCpyDes(primitive->macAddress.a, buffer, &offset, ((u16) (6))); | |
7e6f5794 GKH |
1107 | CsrUint8Des((u8 *) &primitive->trafficStreamID, buffer, &offset); |
1108 | CsrUint8Des((u8 *) &primitive->role, buffer, &offset); | |
635d2b00 GKH |
1109 | |
1110 | return primitive; | |
1111 | } | |
1112 | ||
1113 | ||
d4fda8db | 1114 | size_t CsrWifiRouterCtrlWapiRxPktReqSizeof(void *msg) |
635d2b00 | 1115 | { |
95edd09e | 1116 | CsrWifiRouterCtrlWapiRxPktReq *primitive = (CsrWifiRouterCtrlWapiRxPktReq *) msg; |
d4fda8db | 1117 | size_t bufferSize = 2; |
635d2b00 | 1118 | |
95edd09e | 1119 | /* Calculate the Size of the Serialised Data. Could be more efficient (Try 11) */ |
8c87f69a GKH |
1120 | bufferSize += 2; /* u16 primitive->interfaceTag */ |
1121 | bufferSize += 2; /* u16 primitive->signalLength */ | |
7e6f5794 | 1122 | bufferSize += primitive->signalLength; /* u8 primitive->signal */ |
8c87f69a | 1123 | bufferSize += 2; /* u16 primitive->dataLength */ |
7e6f5794 | 1124 | bufferSize += primitive->dataLength; /* u8 primitive->data */ |
635d2b00 GKH |
1125 | return bufferSize; |
1126 | } | |
1127 | ||
1128 | ||
d4fda8db | 1129 | u8* CsrWifiRouterCtrlWapiRxPktReqSer(u8 *ptr, size_t *len, void *msg) |
635d2b00 | 1130 | { |
95edd09e | 1131 | CsrWifiRouterCtrlWapiRxPktReq *primitive = (CsrWifiRouterCtrlWapiRxPktReq *)msg; |
635d2b00 GKH |
1132 | *len = 0; |
1133 | CsrUint16Ser(ptr, len, primitive->common.type); | |
8c87f69a GKH |
1134 | CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag); |
1135 | CsrUint16Ser(ptr, len, (u16) primitive->signalLength); | |
635d2b00 GKH |
1136 | if (primitive->signalLength) |
1137 | { | |
8c87f69a | 1138 | CsrMemCpySer(ptr, len, (const void *) primitive->signal, ((u16) (primitive->signalLength))); |
635d2b00 | 1139 | } |
8c87f69a | 1140 | CsrUint16Ser(ptr, len, (u16) primitive->dataLength); |
635d2b00 GKH |
1141 | if (primitive->dataLength) |
1142 | { | |
8c87f69a | 1143 | CsrMemCpySer(ptr, len, (const void *) primitive->data, ((u16) (primitive->dataLength))); |
635d2b00 GKH |
1144 | } |
1145 | return(ptr); | |
1146 | } | |
1147 | ||
1148 | ||
d4fda8db | 1149 | void* CsrWifiRouterCtrlWapiRxPktReqDes(u8 *buffer, size_t length) |
635d2b00 | 1150 | { |
786eeeb3 | 1151 | CsrWifiRouterCtrlWapiRxPktReq *primitive = kmalloc(sizeof(CsrWifiRouterCtrlWapiRxPktReq), GFP_KERNEL); |
d4fda8db | 1152 | size_t offset; |
635d2b00 GKH |
1153 | offset = 0; |
1154 | ||
1155 | CsrUint16Des(&primitive->common.type, buffer, &offset); | |
8c87f69a GKH |
1156 | CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset); |
1157 | CsrUint16Des((u16 *) &primitive->signalLength, buffer, &offset); | |
635d2b00 GKH |
1158 | if (primitive->signalLength) |
1159 | { | |
786eeeb3 | 1160 | primitive->signal = kmalloc(primitive->signalLength, GFP_KERNEL); |
8c87f69a | 1161 | CsrMemCpyDes(primitive->signal, buffer, &offset, ((u16) (primitive->signalLength))); |
635d2b00 GKH |
1162 | } |
1163 | else | |
1164 | { | |
1165 | primitive->signal = NULL; | |
1166 | } | |
8c87f69a | 1167 | CsrUint16Des((u16 *) &primitive->dataLength, buffer, &offset); |
635d2b00 GKH |
1168 | if (primitive->dataLength) |
1169 | { | |
786eeeb3 | 1170 | primitive->data = kmalloc(primitive->dataLength, GFP_KERNEL); |
8c87f69a | 1171 | CsrMemCpyDes(primitive->data, buffer, &offset, ((u16) (primitive->dataLength))); |
635d2b00 GKH |
1172 | } |
1173 | else | |
1174 | { | |
1175 | primitive->data = NULL; | |
1176 | } | |
1177 | ||
1178 | return primitive; | |
1179 | } | |
1180 | ||
1181 | ||
95edd09e | 1182 | void CsrWifiRouterCtrlWapiRxPktReqSerFree(void *voidPrimitivePointer) |
635d2b00 | 1183 | { |
95edd09e | 1184 | CsrWifiRouterCtrlWapiRxPktReq *primitive = (CsrWifiRouterCtrlWapiRxPktReq *) voidPrimitivePointer; |
55a27055 GKH |
1185 | kfree(primitive->signal); |
1186 | kfree(primitive->data); | |
1187 | kfree(primitive); | |
635d2b00 GKH |
1188 | } |
1189 | ||
1190 | ||
d4fda8db | 1191 | size_t CsrWifiRouterCtrlWapiUnicastTxPktReqSizeof(void *msg) |
95edd09e GKH |
1192 | { |
1193 | CsrWifiRouterCtrlWapiUnicastTxPktReq *primitive = (CsrWifiRouterCtrlWapiUnicastTxPktReq *) msg; | |
d4fda8db | 1194 | size_t bufferSize = 2; |
95edd09e GKH |
1195 | |
1196 | /* Calculate the Size of the Serialised Data. Could be more efficient (Try 8) */ | |
8c87f69a GKH |
1197 | bufferSize += 2; /* u16 primitive->interfaceTag */ |
1198 | bufferSize += 2; /* u16 primitive->dataLength */ | |
7e6f5794 | 1199 | bufferSize += primitive->dataLength; /* u8 primitive->data */ |
95edd09e GKH |
1200 | return bufferSize; |
1201 | } | |
1202 | ||
1203 | ||
d4fda8db | 1204 | u8* CsrWifiRouterCtrlWapiUnicastTxPktReqSer(u8 *ptr, size_t *len, void *msg) |
95edd09e GKH |
1205 | { |
1206 | CsrWifiRouterCtrlWapiUnicastTxPktReq *primitive = (CsrWifiRouterCtrlWapiUnicastTxPktReq *)msg; | |
1207 | *len = 0; | |
1208 | CsrUint16Ser(ptr, len, primitive->common.type); | |
8c87f69a GKH |
1209 | CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag); |
1210 | CsrUint16Ser(ptr, len, (u16) primitive->dataLength); | |
95edd09e GKH |
1211 | if (primitive->dataLength) |
1212 | { | |
8c87f69a | 1213 | CsrMemCpySer(ptr, len, (const void *) primitive->data, ((u16) (primitive->dataLength))); |
95edd09e GKH |
1214 | } |
1215 | return(ptr); | |
1216 | } | |
1217 | ||
1218 | ||
d4fda8db | 1219 | void* CsrWifiRouterCtrlWapiUnicastTxPktReqDes(u8 *buffer, size_t length) |
95edd09e | 1220 | { |
786eeeb3 | 1221 | CsrWifiRouterCtrlWapiUnicastTxPktReq *primitive = kmalloc(sizeof(CsrWifiRouterCtrlWapiUnicastTxPktReq), GFP_KERNEL); |
d4fda8db | 1222 | size_t offset; |
95edd09e GKH |
1223 | offset = 0; |
1224 | ||
1225 | CsrUint16Des(&primitive->common.type, buffer, &offset); | |
8c87f69a GKH |
1226 | CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset); |
1227 | CsrUint16Des((u16 *) &primitive->dataLength, buffer, &offset); | |
95edd09e GKH |
1228 | if (primitive->dataLength) |
1229 | { | |
786eeeb3 | 1230 | primitive->data = kmalloc(primitive->dataLength, GFP_KERNEL); |
8c87f69a | 1231 | CsrMemCpyDes(primitive->data, buffer, &offset, ((u16) (primitive->dataLength))); |
95edd09e GKH |
1232 | } |
1233 | else | |
1234 | { | |
1235 | primitive->data = NULL; | |
1236 | } | |
1237 | ||
1238 | return primitive; | |
1239 | } | |
1240 | ||
1241 | ||
1242 | void CsrWifiRouterCtrlWapiUnicastTxPktReqSerFree(void *voidPrimitivePointer) | |
1243 | { | |
1244 | CsrWifiRouterCtrlWapiUnicastTxPktReq *primitive = (CsrWifiRouterCtrlWapiUnicastTxPktReq *) voidPrimitivePointer; | |
55a27055 GKH |
1245 | kfree(primitive->data); |
1246 | kfree(primitive); | |
95edd09e GKH |
1247 | } |
1248 | ||
1249 | ||
d4fda8db | 1250 | size_t CsrWifiRouterCtrlHipIndSizeof(void *msg) |
635d2b00 GKH |
1251 | { |
1252 | CsrWifiRouterCtrlHipInd *primitive = (CsrWifiRouterCtrlHipInd *) msg; | |
d4fda8db | 1253 | size_t bufferSize = 2; |
635d2b00 GKH |
1254 | |
1255 | /* Calculate the Size of the Serialised Data. Could be more efficient (Try 12) */ | |
8c87f69a | 1256 | bufferSize += 2; /* u16 primitive->mlmeCommandLength */ |
7e6f5794 | 1257 | bufferSize += primitive->mlmeCommandLength; /* u8 primitive->mlmeCommand */ |
8c87f69a | 1258 | bufferSize += 2; /* u16 primitive->dataRef1Length */ |
7e6f5794 | 1259 | bufferSize += primitive->dataRef1Length; /* u8 primitive->dataRef1 */ |
8c87f69a | 1260 | bufferSize += 2; /* u16 primitive->dataRef2Length */ |
7e6f5794 | 1261 | bufferSize += primitive->dataRef2Length; /* u8 primitive->dataRef2 */ |
635d2b00 GKH |
1262 | return bufferSize; |
1263 | } | |
1264 | ||
1265 | ||
d4fda8db | 1266 | u8* CsrWifiRouterCtrlHipIndSer(u8 *ptr, size_t *len, void *msg) |
635d2b00 GKH |
1267 | { |
1268 | CsrWifiRouterCtrlHipInd *primitive = (CsrWifiRouterCtrlHipInd *)msg; | |
1269 | *len = 0; | |
1270 | CsrUint16Ser(ptr, len, primitive->common.type); | |
8c87f69a | 1271 | CsrUint16Ser(ptr, len, (u16) primitive->mlmeCommandLength); |
635d2b00 GKH |
1272 | if (primitive->mlmeCommandLength) |
1273 | { | |
8c87f69a | 1274 | CsrMemCpySer(ptr, len, (const void *) primitive->mlmeCommand, ((u16) (primitive->mlmeCommandLength))); |
635d2b00 | 1275 | } |
8c87f69a | 1276 | CsrUint16Ser(ptr, len, (u16) primitive->dataRef1Length); |
635d2b00 GKH |
1277 | if (primitive->dataRef1Length) |
1278 | { | |
8c87f69a | 1279 | CsrMemCpySer(ptr, len, (const void *) primitive->dataRef1, ((u16) (primitive->dataRef1Length))); |
635d2b00 | 1280 | } |
8c87f69a | 1281 | CsrUint16Ser(ptr, len, (u16) primitive->dataRef2Length); |
635d2b00 GKH |
1282 | if (primitive->dataRef2Length) |
1283 | { | |
8c87f69a | 1284 | CsrMemCpySer(ptr, len, (const void *) primitive->dataRef2, ((u16) (primitive->dataRef2Length))); |
635d2b00 GKH |
1285 | } |
1286 | return(ptr); | |
1287 | } | |
1288 | ||
1289 | ||
d4fda8db | 1290 | void* CsrWifiRouterCtrlHipIndDes(u8 *buffer, size_t length) |
635d2b00 | 1291 | { |
786eeeb3 | 1292 | CsrWifiRouterCtrlHipInd *primitive = kmalloc(sizeof(CsrWifiRouterCtrlHipInd), GFP_KERNEL); |
d4fda8db | 1293 | size_t offset; |
635d2b00 GKH |
1294 | offset = 0; |
1295 | ||
1296 | CsrUint16Des(&primitive->common.type, buffer, &offset); | |
8c87f69a | 1297 | CsrUint16Des((u16 *) &primitive->mlmeCommandLength, buffer, &offset); |
635d2b00 GKH |
1298 | if (primitive->mlmeCommandLength) |
1299 | { | |
786eeeb3 | 1300 | primitive->mlmeCommand = kmalloc(primitive->mlmeCommandLength, GFP_KERNEL); |
8c87f69a | 1301 | CsrMemCpyDes(primitive->mlmeCommand, buffer, &offset, ((u16) (primitive->mlmeCommandLength))); |
635d2b00 GKH |
1302 | } |
1303 | else | |
1304 | { | |
1305 | primitive->mlmeCommand = NULL; | |
1306 | } | |
8c87f69a | 1307 | CsrUint16Des((u16 *) &primitive->dataRef1Length, buffer, &offset); |
635d2b00 GKH |
1308 | if (primitive->dataRef1Length) |
1309 | { | |
786eeeb3 | 1310 | primitive->dataRef1 = kmalloc(primitive->dataRef1Length, GFP_KERNEL); |
8c87f69a | 1311 | CsrMemCpyDes(primitive->dataRef1, buffer, &offset, ((u16) (primitive->dataRef1Length))); |
635d2b00 GKH |
1312 | } |
1313 | else | |
1314 | { | |
1315 | primitive->dataRef1 = NULL; | |
1316 | } | |
8c87f69a | 1317 | CsrUint16Des((u16 *) &primitive->dataRef2Length, buffer, &offset); |
635d2b00 GKH |
1318 | if (primitive->dataRef2Length) |
1319 | { | |
786eeeb3 | 1320 | primitive->dataRef2 = kmalloc(primitive->dataRef2Length, GFP_KERNEL); |
8c87f69a | 1321 | CsrMemCpyDes(primitive->dataRef2, buffer, &offset, ((u16) (primitive->dataRef2Length))); |
635d2b00 GKH |
1322 | } |
1323 | else | |
1324 | { | |
1325 | primitive->dataRef2 = NULL; | |
1326 | } | |
1327 | ||
1328 | return primitive; | |
1329 | } | |
1330 | ||
1331 | ||
1332 | void CsrWifiRouterCtrlHipIndSerFree(void *voidPrimitivePointer) | |
1333 | { | |
1334 | CsrWifiRouterCtrlHipInd *primitive = (CsrWifiRouterCtrlHipInd *) voidPrimitivePointer; | |
55a27055 GKH |
1335 | kfree(primitive->mlmeCommand); |
1336 | kfree(primitive->dataRef1); | |
1337 | kfree(primitive->dataRef2); | |
1338 | kfree(primitive); | |
635d2b00 GKH |
1339 | } |
1340 | ||
1341 | ||
d4fda8db | 1342 | size_t CsrWifiRouterCtrlMulticastAddressIndSizeof(void *msg) |
635d2b00 GKH |
1343 | { |
1344 | CsrWifiRouterCtrlMulticastAddressInd *primitive = (CsrWifiRouterCtrlMulticastAddressInd *) msg; | |
d4fda8db | 1345 | size_t bufferSize = 2; |
635d2b00 GKH |
1346 | |
1347 | /* Calculate the Size of the Serialised Data. Could be more efficient (Try 15) */ | |
1348 | bufferSize += 2; /* CsrWifiRouterCtrlRequestorInfo primitive->clientData */ | |
8c87f69a | 1349 | bufferSize += 2; /* u16 primitive->interfaceTag */ |
635d2b00 | 1350 | bufferSize += 1; /* CsrWifiRouterCtrlListAction primitive->action */ |
7e6f5794 | 1351 | bufferSize += 1; /* u8 primitive->setAddressesCount */ |
635d2b00 | 1352 | { |
8c87f69a | 1353 | u16 i1; |
635d2b00 GKH |
1354 | for (i1 = 0; i1 < primitive->setAddressesCount; i1++) |
1355 | { | |
7e6f5794 | 1356 | bufferSize += 6; /* u8 primitive->setAddresses[i1].a[6] */ |
635d2b00 GKH |
1357 | } |
1358 | } | |
1359 | return bufferSize; | |
1360 | } | |
1361 | ||
1362 | ||
d4fda8db | 1363 | u8* CsrWifiRouterCtrlMulticastAddressIndSer(u8 *ptr, size_t *len, void *msg) |
635d2b00 GKH |
1364 | { |
1365 | CsrWifiRouterCtrlMulticastAddressInd *primitive = (CsrWifiRouterCtrlMulticastAddressInd *)msg; | |
1366 | *len = 0; | |
1367 | CsrUint16Ser(ptr, len, primitive->common.type); | |
8c87f69a GKH |
1368 | CsrUint16Ser(ptr, len, (u16) primitive->clientData); |
1369 | CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag); | |
7e6f5794 GKH |
1370 | CsrUint8Ser(ptr, len, (u8) primitive->action); |
1371 | CsrUint8Ser(ptr, len, (u8) primitive->setAddressesCount); | |
635d2b00 | 1372 | { |
8c87f69a | 1373 | u16 i1; |
635d2b00 GKH |
1374 | for (i1 = 0; i1 < primitive->setAddressesCount; i1++) |
1375 | { | |
8c87f69a | 1376 | CsrMemCpySer(ptr, len, (const void *) primitive->setAddresses[i1].a, ((u16) (6))); |
635d2b00 GKH |
1377 | } |
1378 | } | |
1379 | return(ptr); | |
1380 | } | |
1381 | ||
1382 | ||
d4fda8db | 1383 | void* CsrWifiRouterCtrlMulticastAddressIndDes(u8 *buffer, size_t length) |
635d2b00 | 1384 | { |
786eeeb3 | 1385 | CsrWifiRouterCtrlMulticastAddressInd *primitive = kmalloc(sizeof(CsrWifiRouterCtrlMulticastAddressInd), GFP_KERNEL); |
d4fda8db | 1386 | size_t offset; |
635d2b00 GKH |
1387 | offset = 0; |
1388 | ||
1389 | CsrUint16Des(&primitive->common.type, buffer, &offset); | |
8c87f69a GKH |
1390 | CsrUint16Des((u16 *) &primitive->clientData, buffer, &offset); |
1391 | CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset); | |
7e6f5794 GKH |
1392 | CsrUint8Des((u8 *) &primitive->action, buffer, &offset); |
1393 | CsrUint8Des((u8 *) &primitive->setAddressesCount, buffer, &offset); | |
635d2b00 GKH |
1394 | primitive->setAddresses = NULL; |
1395 | if (primitive->setAddressesCount) | |
1396 | { | |
786eeeb3 | 1397 | primitive->setAddresses = kmalloc(sizeof(CsrWifiMacAddress) * primitive->setAddressesCount, GFP_KERNEL); |
635d2b00 GKH |
1398 | } |
1399 | { | |
8c87f69a | 1400 | u16 i1; |
635d2b00 GKH |
1401 | for (i1 = 0; i1 < primitive->setAddressesCount; i1++) |
1402 | { | |
8c87f69a | 1403 | CsrMemCpyDes(primitive->setAddresses[i1].a, buffer, &offset, ((u16) (6))); |
635d2b00 GKH |
1404 | } |
1405 | } | |
1406 | ||
1407 | return primitive; | |
1408 | } | |
1409 | ||
1410 | ||
1411 | void CsrWifiRouterCtrlMulticastAddressIndSerFree(void *voidPrimitivePointer) | |
1412 | { | |
1413 | CsrWifiRouterCtrlMulticastAddressInd *primitive = (CsrWifiRouterCtrlMulticastAddressInd *) voidPrimitivePointer; | |
55a27055 GKH |
1414 | kfree(primitive->setAddresses); |
1415 | kfree(primitive); | |
635d2b00 GKH |
1416 | } |
1417 | ||
1418 | ||
d4fda8db | 1419 | size_t CsrWifiRouterCtrlPortConfigureCfmSizeof(void *msg) |
635d2b00 | 1420 | { |
d4fda8db | 1421 | size_t bufferSize = 2; |
635d2b00 GKH |
1422 | |
1423 | /* Calculate the Size of the Serialised Data. Could be more efficient (Try 15) */ | |
1424 | bufferSize += 2; /* CsrWifiRouterCtrlRequestorInfo primitive->clientData */ | |
8c87f69a | 1425 | bufferSize += 2; /* u16 primitive->interfaceTag */ |
635d2b00 | 1426 | bufferSize += 2; /* CsrResult primitive->status */ |
7e6f5794 | 1427 | bufferSize += 6; /* u8 primitive->macAddress.a[6] */ |
635d2b00 GKH |
1428 | return bufferSize; |
1429 | } | |
1430 | ||
1431 | ||
d4fda8db | 1432 | u8* CsrWifiRouterCtrlPortConfigureCfmSer(u8 *ptr, size_t *len, void *msg) |
635d2b00 GKH |
1433 | { |
1434 | CsrWifiRouterCtrlPortConfigureCfm *primitive = (CsrWifiRouterCtrlPortConfigureCfm *)msg; | |
1435 | *len = 0; | |
1436 | CsrUint16Ser(ptr, len, primitive->common.type); | |
8c87f69a GKH |
1437 | CsrUint16Ser(ptr, len, (u16) primitive->clientData); |
1438 | CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag); | |
1439 | CsrUint16Ser(ptr, len, (u16) primitive->status); | |
1440 | CsrMemCpySer(ptr, len, (const void *) primitive->macAddress.a, ((u16) (6))); | |
635d2b00 GKH |
1441 | return(ptr); |
1442 | } | |
1443 | ||
1444 | ||
d4fda8db | 1445 | void* CsrWifiRouterCtrlPortConfigureCfmDes(u8 *buffer, size_t length) |
635d2b00 | 1446 | { |
786eeeb3 | 1447 | CsrWifiRouterCtrlPortConfigureCfm *primitive = kmalloc(sizeof(CsrWifiRouterCtrlPortConfigureCfm), GFP_KERNEL); |
d4fda8db | 1448 | size_t offset; |
635d2b00 GKH |
1449 | offset = 0; |
1450 | ||
1451 | CsrUint16Des(&primitive->common.type, buffer, &offset); | |
8c87f69a GKH |
1452 | CsrUint16Des((u16 *) &primitive->clientData, buffer, &offset); |
1453 | CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset); | |
1454 | CsrUint16Des((u16 *) &primitive->status, buffer, &offset); | |
1455 | CsrMemCpyDes(primitive->macAddress.a, buffer, &offset, ((u16) (6))); | |
635d2b00 GKH |
1456 | |
1457 | return primitive; | |
1458 | } | |
1459 | ||
1460 | ||
d4fda8db | 1461 | size_t CsrWifiRouterCtrlSuspendIndSizeof(void *msg) |
635d2b00 | 1462 | { |
d4fda8db | 1463 | size_t bufferSize = 2; |
635d2b00 GKH |
1464 | |
1465 | /* Calculate the Size of the Serialised Data. Could be more efficient (Try 7) */ | |
1466 | bufferSize += 2; /* CsrWifiRouterCtrlRequestorInfo primitive->clientData */ | |
5379b13d GKH |
1467 | bufferSize += 1; /* u8 primitive->hardSuspend */ |
1468 | bufferSize += 1; /* u8 primitive->d3Suspend */ | |
635d2b00 GKH |
1469 | return bufferSize; |
1470 | } | |
1471 | ||
1472 | ||
d4fda8db | 1473 | u8* CsrWifiRouterCtrlSuspendIndSer(u8 *ptr, size_t *len, void *msg) |
635d2b00 GKH |
1474 | { |
1475 | CsrWifiRouterCtrlSuspendInd *primitive = (CsrWifiRouterCtrlSuspendInd *)msg; | |
1476 | *len = 0; | |
1477 | CsrUint16Ser(ptr, len, primitive->common.type); | |
8c87f69a | 1478 | CsrUint16Ser(ptr, len, (u16) primitive->clientData); |
7e6f5794 GKH |
1479 | CsrUint8Ser(ptr, len, (u8) primitive->hardSuspend); |
1480 | CsrUint8Ser(ptr, len, (u8) primitive->d3Suspend); | |
635d2b00 GKH |
1481 | return(ptr); |
1482 | } | |
1483 | ||
1484 | ||
d4fda8db | 1485 | void* CsrWifiRouterCtrlSuspendIndDes(u8 *buffer, size_t length) |
635d2b00 | 1486 | { |
786eeeb3 | 1487 | CsrWifiRouterCtrlSuspendInd *primitive = kmalloc(sizeof(CsrWifiRouterCtrlSuspendInd), GFP_KERNEL); |
d4fda8db | 1488 | size_t offset; |
635d2b00 GKH |
1489 | offset = 0; |
1490 | ||
1491 | CsrUint16Des(&primitive->common.type, buffer, &offset); | |
8c87f69a | 1492 | CsrUint16Des((u16 *) &primitive->clientData, buffer, &offset); |
7e6f5794 GKH |
1493 | CsrUint8Des((u8 *) &primitive->hardSuspend, buffer, &offset); |
1494 | CsrUint8Des((u8 *) &primitive->d3Suspend, buffer, &offset); | |
635d2b00 GKH |
1495 | |
1496 | return primitive; | |
1497 | } | |
1498 | ||
1499 | ||
d4fda8db | 1500 | size_t CsrWifiRouterCtrlTclasAddCfmSizeof(void *msg) |
635d2b00 | 1501 | { |
d4fda8db | 1502 | size_t bufferSize = 2; |
635d2b00 GKH |
1503 | |
1504 | /* Calculate the Size of the Serialised Data. Could be more efficient (Try 9) */ | |
1505 | bufferSize += 2; /* CsrWifiRouterCtrlRequestorInfo primitive->clientData */ | |
8c87f69a | 1506 | bufferSize += 2; /* u16 primitive->interfaceTag */ |
635d2b00 GKH |
1507 | bufferSize += 2; /* CsrResult primitive->status */ |
1508 | return bufferSize; | |
1509 | } | |
1510 | ||
1511 | ||
d4fda8db | 1512 | u8* CsrWifiRouterCtrlTclasAddCfmSer(u8 *ptr, size_t *len, void *msg) |
635d2b00 GKH |
1513 | { |
1514 | CsrWifiRouterCtrlTclasAddCfm *primitive = (CsrWifiRouterCtrlTclasAddCfm *)msg; | |
1515 | *len = 0; | |
1516 | CsrUint16Ser(ptr, len, primitive->common.type); | |
8c87f69a GKH |
1517 | CsrUint16Ser(ptr, len, (u16) primitive->clientData); |
1518 | CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag); | |
1519 | CsrUint16Ser(ptr, len, (u16) primitive->status); | |
635d2b00 GKH |
1520 | return(ptr); |
1521 | } | |
1522 | ||
1523 | ||
d4fda8db | 1524 | void* CsrWifiRouterCtrlTclasAddCfmDes(u8 *buffer, size_t length) |
635d2b00 | 1525 | { |
786eeeb3 | 1526 | CsrWifiRouterCtrlTclasAddCfm *primitive = kmalloc(sizeof(CsrWifiRouterCtrlTclasAddCfm), GFP_KERNEL); |
d4fda8db | 1527 | size_t offset; |
635d2b00 GKH |
1528 | offset = 0; |
1529 | ||
1530 | CsrUint16Des(&primitive->common.type, buffer, &offset); | |
8c87f69a GKH |
1531 | CsrUint16Des((u16 *) &primitive->clientData, buffer, &offset); |
1532 | CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset); | |
1533 | CsrUint16Des((u16 *) &primitive->status, buffer, &offset); | |
635d2b00 GKH |
1534 | |
1535 | return primitive; | |
1536 | } | |
1537 | ||
1538 | ||
d4fda8db | 1539 | size_t CsrWifiRouterCtrlRawSdioDeinitialiseCfmSizeof(void *msg) |
635d2b00 | 1540 | { |
d4fda8db | 1541 | size_t bufferSize = 2; |
635d2b00 GKH |
1542 | |
1543 | /* Calculate the Size of the Serialised Data. Could be more efficient (Try 7) */ | |
1544 | bufferSize += 2; /* CsrWifiRouterCtrlRequestorInfo primitive->clientData */ | |
1545 | bufferSize += 2; /* CsrResult primitive->result */ | |
1546 | return bufferSize; | |
1547 | } | |
1548 | ||
1549 | ||
d4fda8db | 1550 | u8* CsrWifiRouterCtrlRawSdioDeinitialiseCfmSer(u8 *ptr, size_t *len, void *msg) |
635d2b00 GKH |
1551 | { |
1552 | CsrWifiRouterCtrlRawSdioDeinitialiseCfm *primitive = (CsrWifiRouterCtrlRawSdioDeinitialiseCfm *)msg; | |
1553 | *len = 0; | |
1554 | CsrUint16Ser(ptr, len, primitive->common.type); | |
8c87f69a GKH |
1555 | CsrUint16Ser(ptr, len, (u16) primitive->clientData); |
1556 | CsrUint16Ser(ptr, len, (u16) primitive->result); | |
635d2b00 GKH |
1557 | return(ptr); |
1558 | } | |
1559 | ||
1560 | ||
d4fda8db | 1561 | void* CsrWifiRouterCtrlRawSdioDeinitialiseCfmDes(u8 *buffer, size_t length) |
635d2b00 | 1562 | { |
786eeeb3 | 1563 | CsrWifiRouterCtrlRawSdioDeinitialiseCfm *primitive = kmalloc(sizeof(CsrWifiRouterCtrlRawSdioDeinitialiseCfm), GFP_KERNEL); |
d4fda8db | 1564 | size_t offset; |
635d2b00 GKH |
1565 | offset = 0; |
1566 | ||
1567 | CsrUint16Des(&primitive->common.type, buffer, &offset); | |
8c87f69a GKH |
1568 | CsrUint16Des((u16 *) &primitive->clientData, buffer, &offset); |
1569 | CsrUint16Des((u16 *) &primitive->result, buffer, &offset); | |
635d2b00 GKH |
1570 | |
1571 | return primitive; | |
1572 | } | |
1573 | ||
1574 | ||
d4fda8db | 1575 | size_t CsrWifiRouterCtrlRawSdioInitialiseCfmSizeof(void *msg) |
635d2b00 | 1576 | { |
d4fda8db | 1577 | size_t bufferSize = 2; |
635d2b00 GKH |
1578 | |
1579 | /* Calculate the Size of the Serialised Data. Could be more efficient (Try 39) */ | |
1580 | bufferSize += 2; /* CsrWifiRouterCtrlRequestorInfo primitive->clientData */ | |
1581 | bufferSize += 2; /* CsrResult primitive->result */ | |
1582 | bufferSize += 4; /* CsrWifiRouterCtrlRawSdioByteRead primitive->byteRead */ | |
1583 | bufferSize += 4; /* CsrWifiRouterCtrlRawSdioByteWrite primitive->byteWrite */ | |
1584 | bufferSize += 4; /* CsrWifiRouterCtrlRawSdioFirmwareDownload primitive->firmwareDownload */ | |
1585 | bufferSize += 4; /* CsrWifiRouterCtrlRawSdioReset primitive->reset */ | |
1586 | bufferSize += 4; /* CsrWifiRouterCtrlRawSdioCoreDumpPrepare primitive->coreDumpPrepare */ | |
1587 | bufferSize += 4; /* CsrWifiRouterCtrlRawSdioByteBlockRead primitive->byteBlockRead */ | |
1588 | bufferSize += 4; /* CsrWifiRouterCtrlRawSdioGpRead16 primitive->gpRead16 */ | |
1589 | bufferSize += 4; /* CsrWifiRouterCtrlRawSdioGpWrite16 primitive->gpWrite16 */ | |
1590 | return bufferSize; | |
1591 | } | |
1592 | ||
1593 | ||
d4fda8db | 1594 | u8* CsrWifiRouterCtrlRawSdioInitialiseCfmSer(u8 *ptr, size_t *len, void *msg) |
635d2b00 GKH |
1595 | { |
1596 | CsrWifiRouterCtrlRawSdioInitialiseCfm *primitive = (CsrWifiRouterCtrlRawSdioInitialiseCfm *)msg; | |
1597 | *len = 0; | |
1598 | CsrUint16Ser(ptr, len, primitive->common.type); | |
8c87f69a GKH |
1599 | CsrUint16Ser(ptr, len, (u16) primitive->clientData); |
1600 | CsrUint16Ser(ptr, len, (u16) primitive->result); | |
635d2b00 GKH |
1601 | CsrUint32Ser(ptr, len, 0); /* Special for Function Pointers... primitive->byteRead */ |
1602 | CsrUint32Ser(ptr, len, 0); /* Special for Function Pointers... primitive->byteWrite */ | |
1603 | CsrUint32Ser(ptr, len, 0); /* Special for Function Pointers... primitive->firmwareDownload */ | |
1604 | CsrUint32Ser(ptr, len, 0); /* Special for Function Pointers... primitive->reset */ | |
1605 | CsrUint32Ser(ptr, len, 0); /* Special for Function Pointers... primitive->coreDumpPrepare */ | |
1606 | CsrUint32Ser(ptr, len, 0); /* Special for Function Pointers... primitive->byteBlockRead */ | |
1607 | CsrUint32Ser(ptr, len, 0); /* Special for Function Pointers... primitive->gpRead16 */ | |
1608 | CsrUint32Ser(ptr, len, 0); /* Special for Function Pointers... primitive->gpWrite16 */ | |
1609 | return(ptr); | |
1610 | } | |
1611 | ||
1612 | ||
d4fda8db | 1613 | void* CsrWifiRouterCtrlRawSdioInitialiseCfmDes(u8 *buffer, size_t length) |
635d2b00 | 1614 | { |
786eeeb3 | 1615 | CsrWifiRouterCtrlRawSdioInitialiseCfm *primitive = kmalloc(sizeof(CsrWifiRouterCtrlRawSdioInitialiseCfm), GFP_KERNEL); |
d4fda8db | 1616 | size_t offset; |
635d2b00 GKH |
1617 | offset = 0; |
1618 | ||
1619 | CsrUint16Des(&primitive->common.type, buffer, &offset); | |
8c87f69a GKH |
1620 | CsrUint16Des((u16 *) &primitive->clientData, buffer, &offset); |
1621 | CsrUint16Des((u16 *) &primitive->result, buffer, &offset); | |
635d2b00 GKH |
1622 | primitive->byteRead = NULL; /* Special for Function Pointers... */ |
1623 | offset += 4; | |
1624 | primitive->byteWrite = NULL; /* Special for Function Pointers... */ | |
1625 | offset += 4; | |
1626 | primitive->firmwareDownload = NULL; /* Special for Function Pointers... */ | |
1627 | offset += 4; | |
1628 | primitive->reset = NULL; /* Special for Function Pointers... */ | |
1629 | offset += 4; | |
1630 | primitive->coreDumpPrepare = NULL; /* Special for Function Pointers... */ | |
1631 | offset += 4; | |
1632 | primitive->byteBlockRead = NULL; /* Special for Function Pointers... */ | |
1633 | offset += 4; | |
1634 | primitive->gpRead16 = NULL; /* Special for Function Pointers... */ | |
1635 | offset += 4; | |
1636 | primitive->gpWrite16 = NULL; /* Special for Function Pointers... */ | |
1637 | offset += 4; | |
1638 | ||
1639 | return primitive; | |
1640 | } | |
1641 | ||
1642 | ||
d4fda8db | 1643 | size_t CsrWifiRouterCtrlTclasDelCfmSizeof(void *msg) |
635d2b00 | 1644 | { |
d4fda8db | 1645 | size_t bufferSize = 2; |
635d2b00 GKH |
1646 | |
1647 | /* Calculate the Size of the Serialised Data. Could be more efficient (Try 9) */ | |
1648 | bufferSize += 2; /* CsrWifiRouterCtrlRequestorInfo primitive->clientData */ | |
8c87f69a | 1649 | bufferSize += 2; /* u16 primitive->interfaceTag */ |
635d2b00 GKH |
1650 | bufferSize += 2; /* CsrResult primitive->status */ |
1651 | return bufferSize; | |
1652 | } | |
1653 | ||
1654 | ||
d4fda8db | 1655 | u8* CsrWifiRouterCtrlTclasDelCfmSer(u8 *ptr, size_t *len, void *msg) |
635d2b00 GKH |
1656 | { |
1657 | CsrWifiRouterCtrlTclasDelCfm *primitive = (CsrWifiRouterCtrlTclasDelCfm *)msg; | |
1658 | *len = 0; | |
1659 | CsrUint16Ser(ptr, len, primitive->common.type); | |
8c87f69a GKH |
1660 | CsrUint16Ser(ptr, len, (u16) primitive->clientData); |
1661 | CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag); | |
1662 | CsrUint16Ser(ptr, len, (u16) primitive->status); | |
635d2b00 GKH |
1663 | return(ptr); |
1664 | } | |
1665 | ||
1666 | ||
d4fda8db | 1667 | void* CsrWifiRouterCtrlTclasDelCfmDes(u8 *buffer, size_t length) |
635d2b00 | 1668 | { |
786eeeb3 | 1669 | CsrWifiRouterCtrlTclasDelCfm *primitive = kmalloc(sizeof(CsrWifiRouterCtrlTclasDelCfm), GFP_KERNEL); |
d4fda8db | 1670 | size_t offset; |
635d2b00 GKH |
1671 | offset = 0; |
1672 | ||
1673 | CsrUint16Des(&primitive->common.type, buffer, &offset); | |
8c87f69a GKH |
1674 | CsrUint16Des((u16 *) &primitive->clientData, buffer, &offset); |
1675 | CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset); | |
1676 | CsrUint16Des((u16 *) &primitive->status, buffer, &offset); | |
635d2b00 GKH |
1677 | |
1678 | return primitive; | |
1679 | } | |
1680 | ||
1681 | ||
d4fda8db | 1682 | size_t CsrWifiRouterCtrlTrafficProtocolIndSizeof(void *msg) |
635d2b00 | 1683 | { |
d4fda8db | 1684 | size_t bufferSize = 2; |
635d2b00 GKH |
1685 | |
1686 | /* Calculate the Size of the Serialised Data. Could be more efficient (Try 17) */ | |
1687 | bufferSize += 2; /* CsrWifiRouterCtrlRequestorInfo primitive->clientData */ | |
8c87f69a | 1688 | bufferSize += 2; /* u16 primitive->interfaceTag */ |
635d2b00 GKH |
1689 | bufferSize += 2; /* CsrWifiRouterCtrlTrafficPacketType primitive->packetType */ |
1690 | bufferSize += 2; /* CsrWifiRouterCtrlProtocolDirection primitive->direction */ | |
7e6f5794 | 1691 | bufferSize += 6; /* u8 primitive->srcAddress.a[6] */ |
635d2b00 GKH |
1692 | return bufferSize; |
1693 | } | |
1694 | ||
1695 | ||
d4fda8db | 1696 | u8* CsrWifiRouterCtrlTrafficProtocolIndSer(u8 *ptr, size_t *len, void *msg) |
635d2b00 GKH |
1697 | { |
1698 | CsrWifiRouterCtrlTrafficProtocolInd *primitive = (CsrWifiRouterCtrlTrafficProtocolInd *)msg; | |
1699 | *len = 0; | |
1700 | CsrUint16Ser(ptr, len, primitive->common.type); | |
8c87f69a GKH |
1701 | CsrUint16Ser(ptr, len, (u16) primitive->clientData); |
1702 | CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag); | |
1703 | CsrUint16Ser(ptr, len, (u16) primitive->packetType); | |
1704 | CsrUint16Ser(ptr, len, (u16) primitive->direction); | |
1705 | CsrMemCpySer(ptr, len, (const void *) primitive->srcAddress.a, ((u16) (6))); | |
635d2b00 GKH |
1706 | return(ptr); |
1707 | } | |
1708 | ||
1709 | ||
d4fda8db | 1710 | void* CsrWifiRouterCtrlTrafficProtocolIndDes(u8 *buffer, size_t length) |
635d2b00 | 1711 | { |
786eeeb3 | 1712 | CsrWifiRouterCtrlTrafficProtocolInd *primitive = kmalloc(sizeof(CsrWifiRouterCtrlTrafficProtocolInd), GFP_KERNEL); |
d4fda8db | 1713 | size_t offset; |
635d2b00 GKH |
1714 | offset = 0; |
1715 | ||
1716 | CsrUint16Des(&primitive->common.type, buffer, &offset); | |
8c87f69a GKH |
1717 | CsrUint16Des((u16 *) &primitive->clientData, buffer, &offset); |
1718 | CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset); | |
1719 | CsrUint16Des((u16 *) &primitive->packetType, buffer, &offset); | |
1720 | CsrUint16Des((u16 *) &primitive->direction, buffer, &offset); | |
1721 | CsrMemCpyDes(primitive->srcAddress.a, buffer, &offset, ((u16) (6))); | |
635d2b00 GKH |
1722 | |
1723 | return primitive; | |
1724 | } | |
1725 | ||
1726 | ||
d4fda8db | 1727 | size_t CsrWifiRouterCtrlTrafficSampleIndSizeof(void *msg) |
635d2b00 | 1728 | { |
d4fda8db | 1729 | size_t bufferSize = 2; |
635d2b00 GKH |
1730 | |
1731 | /* Calculate the Size of the Serialised Data. Could be more efficient (Try 38) */ | |
1732 | bufferSize += 2; /* CsrWifiRouterCtrlRequestorInfo primitive->clientData */ | |
8c87f69a | 1733 | bufferSize += 2; /* u16 primitive->interfaceTag */ |
26a6b2e1 GKH |
1734 | bufferSize += 4; /* u32 primitive->stats.rxMeanRate */ |
1735 | bufferSize += 4; /* u32 primitive->stats.rxFramesNum */ | |
1736 | bufferSize += 4; /* u32 primitive->stats.txFramesNum */ | |
1737 | bufferSize += 4; /* u32 primitive->stats.rxBytesCount */ | |
1738 | bufferSize += 4; /* u32 primitive->stats.txBytesCount */ | |
7e6f5794 | 1739 | bufferSize += 11; /* u8 primitive->stats.intervals[11] */ |
635d2b00 GKH |
1740 | return bufferSize; |
1741 | } | |
1742 | ||
1743 | ||
d4fda8db | 1744 | u8* CsrWifiRouterCtrlTrafficSampleIndSer(u8 *ptr, size_t *len, void *msg) |
635d2b00 GKH |
1745 | { |
1746 | CsrWifiRouterCtrlTrafficSampleInd *primitive = (CsrWifiRouterCtrlTrafficSampleInd *)msg; | |
1747 | *len = 0; | |
1748 | CsrUint16Ser(ptr, len, primitive->common.type); | |
8c87f69a GKH |
1749 | CsrUint16Ser(ptr, len, (u16) primitive->clientData); |
1750 | CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag); | |
26a6b2e1 GKH |
1751 | CsrUint32Ser(ptr, len, (u32) primitive->stats.rxMeanRate); |
1752 | CsrUint32Ser(ptr, len, (u32) primitive->stats.rxFramesNum); | |
1753 | CsrUint32Ser(ptr, len, (u32) primitive->stats.txFramesNum); | |
1754 | CsrUint32Ser(ptr, len, (u32) primitive->stats.rxBytesCount); | |
1755 | CsrUint32Ser(ptr, len, (u32) primitive->stats.txBytesCount); | |
8c87f69a | 1756 | CsrMemCpySer(ptr, len, (const void *) primitive->stats.intervals, ((u16) (11))); |
635d2b00 GKH |
1757 | return(ptr); |
1758 | } | |
1759 | ||
1760 | ||
d4fda8db | 1761 | void* CsrWifiRouterCtrlTrafficSampleIndDes(u8 *buffer, size_t length) |
635d2b00 | 1762 | { |
786eeeb3 | 1763 | CsrWifiRouterCtrlTrafficSampleInd *primitive = kmalloc(sizeof(CsrWifiRouterCtrlTrafficSampleInd), GFP_KERNEL); |
d4fda8db | 1764 | size_t offset; |
635d2b00 GKH |
1765 | offset = 0; |
1766 | ||
1767 | CsrUint16Des(&primitive->common.type, buffer, &offset); | |
8c87f69a GKH |
1768 | CsrUint16Des((u16 *) &primitive->clientData, buffer, &offset); |
1769 | CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset); | |
26a6b2e1 GKH |
1770 | CsrUint32Des((u32 *) &primitive->stats.rxMeanRate, buffer, &offset); |
1771 | CsrUint32Des((u32 *) &primitive->stats.rxFramesNum, buffer, &offset); | |
1772 | CsrUint32Des((u32 *) &primitive->stats.txFramesNum, buffer, &offset); | |
1773 | CsrUint32Des((u32 *) &primitive->stats.rxBytesCount, buffer, &offset); | |
1774 | CsrUint32Des((u32 *) &primitive->stats.txBytesCount, buffer, &offset); | |
8c87f69a | 1775 | CsrMemCpyDes(primitive->stats.intervals, buffer, &offset, ((u16) (11))); |
635d2b00 GKH |
1776 | |
1777 | return primitive; | |
1778 | } | |
1779 | ||
1780 | ||
d4fda8db | 1781 | size_t CsrWifiRouterCtrlWifiOnIndSizeof(void *msg) |
635d2b00 GKH |
1782 | { |
1783 | CsrWifiRouterCtrlWifiOnInd *primitive = (CsrWifiRouterCtrlWifiOnInd *) msg; | |
d4fda8db | 1784 | size_t bufferSize = 2; |
635d2b00 GKH |
1785 | |
1786 | /* Calculate the Size of the Serialised Data. Could be more efficient (Try 27) */ | |
1787 | bufferSize += 2; /* CsrWifiRouterCtrlRequestorInfo primitive->clientData */ | |
1788 | bufferSize += 2; /* CsrResult primitive->status */ | |
26a6b2e1 GKH |
1789 | bufferSize += 4; /* u32 primitive->versions.chipId */ |
1790 | bufferSize += 4; /* u32 primitive->versions.chipVersion */ | |
1791 | bufferSize += 4; /* u32 primitive->versions.firmwareBuild */ | |
1792 | bufferSize += 4; /* u32 primitive->versions.firmwareHip */ | |
4bcb20f8 | 1793 | bufferSize += (primitive->versions.routerBuild ? strlen(primitive->versions.routerBuild) : 0) + 1; /* char* primitive->versions.routerBuild (0 byte len + 1 for NULL Term) */ |
26a6b2e1 | 1794 | bufferSize += 4; /* u32 primitive->versions.routerHip */ |
635d2b00 GKH |
1795 | return bufferSize; |
1796 | } | |
1797 | ||
1798 | ||
d4fda8db | 1799 | u8* CsrWifiRouterCtrlWifiOnIndSer(u8 *ptr, size_t *len, void *msg) |
635d2b00 GKH |
1800 | { |
1801 | CsrWifiRouterCtrlWifiOnInd *primitive = (CsrWifiRouterCtrlWifiOnInd *)msg; | |
1802 | *len = 0; | |
1803 | CsrUint16Ser(ptr, len, primitive->common.type); | |
8c87f69a GKH |
1804 | CsrUint16Ser(ptr, len, (u16) primitive->clientData); |
1805 | CsrUint16Ser(ptr, len, (u16) primitive->status); | |
26a6b2e1 GKH |
1806 | CsrUint32Ser(ptr, len, (u32) primitive->versions.chipId); |
1807 | CsrUint32Ser(ptr, len, (u32) primitive->versions.chipVersion); | |
1808 | CsrUint32Ser(ptr, len, (u32) primitive->versions.firmwareBuild); | |
1809 | CsrUint32Ser(ptr, len, (u32) primitive->versions.firmwareHip); | |
635d2b00 | 1810 | CsrCharStringSer(ptr, len, primitive->versions.routerBuild); |
26a6b2e1 | 1811 | CsrUint32Ser(ptr, len, (u32) primitive->versions.routerHip); |
635d2b00 GKH |
1812 | return(ptr); |
1813 | } | |
1814 | ||
1815 | ||
d4fda8db | 1816 | void* CsrWifiRouterCtrlWifiOnIndDes(u8 *buffer, size_t length) |
635d2b00 | 1817 | { |
786eeeb3 | 1818 | CsrWifiRouterCtrlWifiOnInd *primitive = kmalloc(sizeof(CsrWifiRouterCtrlWifiOnInd), GFP_KERNEL); |
d4fda8db | 1819 | size_t offset; |
635d2b00 GKH |
1820 | offset = 0; |
1821 | ||
1822 | CsrUint16Des(&primitive->common.type, buffer, &offset); | |
8c87f69a GKH |
1823 | CsrUint16Des((u16 *) &primitive->clientData, buffer, &offset); |
1824 | CsrUint16Des((u16 *) &primitive->status, buffer, &offset); | |
26a6b2e1 GKH |
1825 | CsrUint32Des((u32 *) &primitive->versions.chipId, buffer, &offset); |
1826 | CsrUint32Des((u32 *) &primitive->versions.chipVersion, buffer, &offset); | |
1827 | CsrUint32Des((u32 *) &primitive->versions.firmwareBuild, buffer, &offset); | |
1828 | CsrUint32Des((u32 *) &primitive->versions.firmwareHip, buffer, &offset); | |
635d2b00 | 1829 | CsrCharStringDes(&primitive->versions.routerBuild, buffer, &offset); |
26a6b2e1 | 1830 | CsrUint32Des((u32 *) &primitive->versions.routerHip, buffer, &offset); |
635d2b00 GKH |
1831 | |
1832 | return primitive; | |
1833 | } | |
1834 | ||
1835 | ||
1836 | void CsrWifiRouterCtrlWifiOnIndSerFree(void *voidPrimitivePointer) | |
1837 | { | |
1838 | CsrWifiRouterCtrlWifiOnInd *primitive = (CsrWifiRouterCtrlWifiOnInd *) voidPrimitivePointer; | |
55a27055 GKH |
1839 | kfree(primitive->versions.routerBuild); |
1840 | kfree(primitive); | |
635d2b00 GKH |
1841 | } |
1842 | ||
1843 | ||
d4fda8db | 1844 | size_t CsrWifiRouterCtrlWifiOnCfmSizeof(void *msg) |
635d2b00 | 1845 | { |
d4fda8db | 1846 | size_t bufferSize = 2; |
635d2b00 GKH |
1847 | |
1848 | /* Calculate the Size of the Serialised Data. Could be more efficient (Try 7) */ | |
1849 | bufferSize += 2; /* CsrWifiRouterCtrlRequestorInfo primitive->clientData */ | |
1850 | bufferSize += 2; /* CsrResult primitive->status */ | |
1851 | return bufferSize; | |
1852 | } | |
1853 | ||
1854 | ||
d4fda8db | 1855 | u8* CsrWifiRouterCtrlWifiOnCfmSer(u8 *ptr, size_t *len, void *msg) |
635d2b00 GKH |
1856 | { |
1857 | CsrWifiRouterCtrlWifiOnCfm *primitive = (CsrWifiRouterCtrlWifiOnCfm *)msg; | |
1858 | *len = 0; | |
1859 | CsrUint16Ser(ptr, len, primitive->common.type); | |
8c87f69a GKH |
1860 | CsrUint16Ser(ptr, len, (u16) primitive->clientData); |
1861 | CsrUint16Ser(ptr, len, (u16) primitive->status); | |
635d2b00 GKH |
1862 | return(ptr); |
1863 | } | |
1864 | ||
1865 | ||
d4fda8db | 1866 | void* CsrWifiRouterCtrlWifiOnCfmDes(u8 *buffer, size_t length) |
635d2b00 | 1867 | { |
786eeeb3 | 1868 | CsrWifiRouterCtrlWifiOnCfm *primitive = kmalloc(sizeof(CsrWifiRouterCtrlWifiOnCfm), GFP_KERNEL); |
d4fda8db | 1869 | size_t offset; |
635d2b00 GKH |
1870 | offset = 0; |
1871 | ||
1872 | CsrUint16Des(&primitive->common.type, buffer, &offset); | |
8c87f69a GKH |
1873 | CsrUint16Des((u16 *) &primitive->clientData, buffer, &offset); |
1874 | CsrUint16Des((u16 *) &primitive->status, buffer, &offset); | |
635d2b00 GKH |
1875 | |
1876 | return primitive; | |
1877 | } | |
1878 | ||
1879 | ||
d4fda8db | 1880 | size_t CsrWifiRouterCtrlM4ReadyToSendIndSizeof(void *msg) |
635d2b00 | 1881 | { |
d4fda8db | 1882 | size_t bufferSize = 2; |
635d2b00 GKH |
1883 | |
1884 | /* Calculate the Size of the Serialised Data. Could be more efficient (Try 13) */ | |
1885 | bufferSize += 2; /* CsrWifiRouterCtrlRequestorInfo primitive->clientData */ | |
8c87f69a | 1886 | bufferSize += 2; /* u16 primitive->interfaceTag */ |
7e6f5794 | 1887 | bufferSize += 6; /* u8 primitive->peerMacAddress.a[6] */ |
635d2b00 GKH |
1888 | return bufferSize; |
1889 | } | |
1890 | ||
1891 | ||
d4fda8db | 1892 | u8* CsrWifiRouterCtrlM4ReadyToSendIndSer(u8 *ptr, size_t *len, void *msg) |
635d2b00 GKH |
1893 | { |
1894 | CsrWifiRouterCtrlM4ReadyToSendInd *primitive = (CsrWifiRouterCtrlM4ReadyToSendInd *)msg; | |
1895 | *len = 0; | |
1896 | CsrUint16Ser(ptr, len, primitive->common.type); | |
8c87f69a GKH |
1897 | CsrUint16Ser(ptr, len, (u16) primitive->clientData); |
1898 | CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag); | |
1899 | CsrMemCpySer(ptr, len, (const void *) primitive->peerMacAddress.a, ((u16) (6))); | |
635d2b00 GKH |
1900 | return(ptr); |
1901 | } | |
1902 | ||
1903 | ||
d4fda8db | 1904 | void* CsrWifiRouterCtrlM4ReadyToSendIndDes(u8 *buffer, size_t length) |
635d2b00 | 1905 | { |
786eeeb3 | 1906 | CsrWifiRouterCtrlM4ReadyToSendInd *primitive = kmalloc(sizeof(CsrWifiRouterCtrlM4ReadyToSendInd), GFP_KERNEL); |
d4fda8db | 1907 | size_t offset; |
635d2b00 GKH |
1908 | offset = 0; |
1909 | ||
1910 | CsrUint16Des(&primitive->common.type, buffer, &offset); | |
8c87f69a GKH |
1911 | CsrUint16Des((u16 *) &primitive->clientData, buffer, &offset); |
1912 | CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset); | |
1913 | CsrMemCpyDes(primitive->peerMacAddress.a, buffer, &offset, ((u16) (6))); | |
635d2b00 GKH |
1914 | |
1915 | return primitive; | |
1916 | } | |
1917 | ||
1918 | ||
d4fda8db | 1919 | size_t CsrWifiRouterCtrlM4TransmittedIndSizeof(void *msg) |
635d2b00 | 1920 | { |
d4fda8db | 1921 | size_t bufferSize = 2; |
635d2b00 GKH |
1922 | |
1923 | /* Calculate the Size of the Serialised Data. Could be more efficient (Try 15) */ | |
1924 | bufferSize += 2; /* CsrWifiRouterCtrlRequestorInfo primitive->clientData */ | |
8c87f69a | 1925 | bufferSize += 2; /* u16 primitive->interfaceTag */ |
7e6f5794 | 1926 | bufferSize += 6; /* u8 primitive->peerMacAddress.a[6] */ |
635d2b00 GKH |
1927 | bufferSize += 2; /* CsrResult primitive->status */ |
1928 | return bufferSize; | |
1929 | } | |
1930 | ||
1931 | ||
d4fda8db | 1932 | u8* CsrWifiRouterCtrlM4TransmittedIndSer(u8 *ptr, size_t *len, void *msg) |
635d2b00 GKH |
1933 | { |
1934 | CsrWifiRouterCtrlM4TransmittedInd *primitive = (CsrWifiRouterCtrlM4TransmittedInd *)msg; | |
1935 | *len = 0; | |
1936 | CsrUint16Ser(ptr, len, primitive->common.type); | |
8c87f69a GKH |
1937 | CsrUint16Ser(ptr, len, (u16) primitive->clientData); |
1938 | CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag); | |
1939 | CsrMemCpySer(ptr, len, (const void *) primitive->peerMacAddress.a, ((u16) (6))); | |
1940 | CsrUint16Ser(ptr, len, (u16) primitive->status); | |
635d2b00 GKH |
1941 | return(ptr); |
1942 | } | |
1943 | ||
1944 | ||
d4fda8db | 1945 | void* CsrWifiRouterCtrlM4TransmittedIndDes(u8 *buffer, size_t length) |
635d2b00 | 1946 | { |
786eeeb3 | 1947 | CsrWifiRouterCtrlM4TransmittedInd *primitive = kmalloc(sizeof(CsrWifiRouterCtrlM4TransmittedInd), GFP_KERNEL); |
d4fda8db | 1948 | size_t offset; |
635d2b00 GKH |
1949 | offset = 0; |
1950 | ||
1951 | CsrUint16Des(&primitive->common.type, buffer, &offset); | |
8c87f69a GKH |
1952 | CsrUint16Des((u16 *) &primitive->clientData, buffer, &offset); |
1953 | CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset); | |
1954 | CsrMemCpyDes(primitive->peerMacAddress.a, buffer, &offset, ((u16) (6))); | |
1955 | CsrUint16Des((u16 *) &primitive->status, buffer, &offset); | |
635d2b00 GKH |
1956 | |
1957 | return primitive; | |
1958 | } | |
1959 | ||
1960 | ||
d4fda8db | 1961 | size_t CsrWifiRouterCtrlMicFailureIndSizeof(void *msg) |
635d2b00 | 1962 | { |
d4fda8db | 1963 | size_t bufferSize = 2; |
635d2b00 GKH |
1964 | |
1965 | /* Calculate the Size of the Serialised Data. Could be more efficient (Try 14) */ | |
1966 | bufferSize += 2; /* CsrWifiRouterCtrlRequestorInfo primitive->clientData */ | |
8c87f69a | 1967 | bufferSize += 2; /* u16 primitive->interfaceTag */ |
7e6f5794 | 1968 | bufferSize += 6; /* u8 primitive->peerMacAddress.a[6] */ |
5379b13d | 1969 | bufferSize += 1; /* u8 primitive->unicastPdu */ |
635d2b00 GKH |
1970 | return bufferSize; |
1971 | } | |
1972 | ||
1973 | ||
d4fda8db | 1974 | u8* CsrWifiRouterCtrlMicFailureIndSer(u8 *ptr, size_t *len, void *msg) |
635d2b00 GKH |
1975 | { |
1976 | CsrWifiRouterCtrlMicFailureInd *primitive = (CsrWifiRouterCtrlMicFailureInd *)msg; | |
1977 | *len = 0; | |
1978 | CsrUint16Ser(ptr, len, primitive->common.type); | |
8c87f69a GKH |
1979 | CsrUint16Ser(ptr, len, (u16) primitive->clientData); |
1980 | CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag); | |
1981 | CsrMemCpySer(ptr, len, (const void *) primitive->peerMacAddress.a, ((u16) (6))); | |
7e6f5794 | 1982 | CsrUint8Ser(ptr, len, (u8) primitive->unicastPdu); |
635d2b00 GKH |
1983 | return(ptr); |
1984 | } | |
1985 | ||
1986 | ||
d4fda8db | 1987 | void* CsrWifiRouterCtrlMicFailureIndDes(u8 *buffer, size_t length) |
635d2b00 | 1988 | { |
786eeeb3 | 1989 | CsrWifiRouterCtrlMicFailureInd *primitive = kmalloc(sizeof(CsrWifiRouterCtrlMicFailureInd), GFP_KERNEL); |
d4fda8db | 1990 | size_t offset; |
635d2b00 GKH |
1991 | offset = 0; |
1992 | ||
1993 | CsrUint16Des(&primitive->common.type, buffer, &offset); | |
8c87f69a GKH |
1994 | CsrUint16Des((u16 *) &primitive->clientData, buffer, &offset); |
1995 | CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset); | |
1996 | CsrMemCpyDes(primitive->peerMacAddress.a, buffer, &offset, ((u16) (6))); | |
7e6f5794 | 1997 | CsrUint8Des((u8 *) &primitive->unicastPdu, buffer, &offset); |
635d2b00 GKH |
1998 | |
1999 | return primitive; | |
2000 | } | |
2001 | ||
2002 | ||
d4fda8db | 2003 | size_t CsrWifiRouterCtrlConnectedIndSizeof(void *msg) |
635d2b00 | 2004 | { |
d4fda8db | 2005 | size_t bufferSize = 2; |
635d2b00 GKH |
2006 | |
2007 | /* Calculate the Size of the Serialised Data. Could be more efficient (Try 14) */ | |
2008 | bufferSize += 2; /* CsrWifiRouterCtrlRequestorInfo primitive->clientData */ | |
8c87f69a | 2009 | bufferSize += 2; /* u16 primitive->interfaceTag */ |
7e6f5794 | 2010 | bufferSize += 6; /* u8 primitive->peerMacAddress.a[6] */ |
635d2b00 GKH |
2011 | bufferSize += 1; /* CsrWifiRouterCtrlPeerStatus primitive->peerStatus */ |
2012 | return bufferSize; | |
2013 | } | |
2014 | ||
2015 | ||
d4fda8db | 2016 | u8* CsrWifiRouterCtrlConnectedIndSer(u8 *ptr, size_t *len, void *msg) |
635d2b00 GKH |
2017 | { |
2018 | CsrWifiRouterCtrlConnectedInd *primitive = (CsrWifiRouterCtrlConnectedInd *)msg; | |
2019 | *len = 0; | |
2020 | CsrUint16Ser(ptr, len, primitive->common.type); | |
8c87f69a GKH |
2021 | CsrUint16Ser(ptr, len, (u16) primitive->clientData); |
2022 | CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag); | |
2023 | CsrMemCpySer(ptr, len, (const void *) primitive->peerMacAddress.a, ((u16) (6))); | |
7e6f5794 | 2024 | CsrUint8Ser(ptr, len, (u8) primitive->peerStatus); |
635d2b00 GKH |
2025 | return(ptr); |
2026 | } | |
2027 | ||
2028 | ||
d4fda8db | 2029 | void* CsrWifiRouterCtrlConnectedIndDes(u8 *buffer, size_t length) |
635d2b00 | 2030 | { |
786eeeb3 | 2031 | CsrWifiRouterCtrlConnectedInd *primitive = kmalloc(sizeof(CsrWifiRouterCtrlConnectedInd), GFP_KERNEL); |
d4fda8db | 2032 | size_t offset; |
635d2b00 GKH |
2033 | offset = 0; |
2034 | ||
2035 | CsrUint16Des(&primitive->common.type, buffer, &offset); | |
8c87f69a GKH |
2036 | CsrUint16Des((u16 *) &primitive->clientData, buffer, &offset); |
2037 | CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset); | |
2038 | CsrMemCpyDes(primitive->peerMacAddress.a, buffer, &offset, ((u16) (6))); | |
7e6f5794 | 2039 | CsrUint8Des((u8 *) &primitive->peerStatus, buffer, &offset); |
635d2b00 GKH |
2040 | |
2041 | return primitive; | |
2042 | } | |
2043 | ||
2044 | ||
d4fda8db | 2045 | size_t CsrWifiRouterCtrlPeerAddCfmSizeof(void *msg) |
635d2b00 | 2046 | { |
d4fda8db | 2047 | size_t bufferSize = 2; |
635d2b00 GKH |
2048 | |
2049 | /* Calculate the Size of the Serialised Data. Could be more efficient (Try 19) */ | |
2050 | bufferSize += 2; /* CsrWifiRouterCtrlRequestorInfo primitive->clientData */ | |
8c87f69a | 2051 | bufferSize += 2; /* u16 primitive->interfaceTag */ |
7e6f5794 | 2052 | bufferSize += 6; /* u8 primitive->peerMacAddress.a[6] */ |
635d2b00 GKH |
2053 | bufferSize += 4; /* CsrWifiRouterCtrlPeerRecordHandle primitive->peerRecordHandle */ |
2054 | bufferSize += 2; /* CsrResult primitive->status */ | |
2055 | return bufferSize; | |
2056 | } | |
2057 | ||
2058 | ||
d4fda8db | 2059 | u8* CsrWifiRouterCtrlPeerAddCfmSer(u8 *ptr, size_t *len, void *msg) |
635d2b00 GKH |
2060 | { |
2061 | CsrWifiRouterCtrlPeerAddCfm *primitive = (CsrWifiRouterCtrlPeerAddCfm *)msg; | |
2062 | *len = 0; | |
2063 | CsrUint16Ser(ptr, len, primitive->common.type); | |
8c87f69a GKH |
2064 | CsrUint16Ser(ptr, len, (u16) primitive->clientData); |
2065 | CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag); | |
2066 | CsrMemCpySer(ptr, len, (const void *) primitive->peerMacAddress.a, ((u16) (6))); | |
26a6b2e1 | 2067 | CsrUint32Ser(ptr, len, (u32) primitive->peerRecordHandle); |
8c87f69a | 2068 | CsrUint16Ser(ptr, len, (u16) primitive->status); |
635d2b00 GKH |
2069 | return(ptr); |
2070 | } | |
2071 | ||
2072 | ||
d4fda8db | 2073 | void* CsrWifiRouterCtrlPeerAddCfmDes(u8 *buffer, size_t length) |
635d2b00 | 2074 | { |
786eeeb3 | 2075 | CsrWifiRouterCtrlPeerAddCfm *primitive = kmalloc(sizeof(CsrWifiRouterCtrlPeerAddCfm), GFP_KERNEL); |
d4fda8db | 2076 | size_t offset; |
635d2b00 GKH |
2077 | offset = 0; |
2078 | ||
2079 | CsrUint16Des(&primitive->common.type, buffer, &offset); | |
8c87f69a GKH |
2080 | CsrUint16Des((u16 *) &primitive->clientData, buffer, &offset); |
2081 | CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset); | |
2082 | CsrMemCpyDes(primitive->peerMacAddress.a, buffer, &offset, ((u16) (6))); | |
26a6b2e1 | 2083 | CsrUint32Des((u32 *) &primitive->peerRecordHandle, buffer, &offset); |
8c87f69a | 2084 | CsrUint16Des((u16 *) &primitive->status, buffer, &offset); |
635d2b00 GKH |
2085 | |
2086 | return primitive; | |
2087 | } | |
2088 | ||
2089 | ||
d4fda8db | 2090 | size_t CsrWifiRouterCtrlPeerDelCfmSizeof(void *msg) |
635d2b00 | 2091 | { |
d4fda8db | 2092 | size_t bufferSize = 2; |
635d2b00 GKH |
2093 | |
2094 | /* Calculate the Size of the Serialised Data. Could be more efficient (Try 9) */ | |
2095 | bufferSize += 2; /* CsrWifiRouterCtrlRequestorInfo primitive->clientData */ | |
8c87f69a | 2096 | bufferSize += 2; /* u16 primitive->interfaceTag */ |
635d2b00 GKH |
2097 | bufferSize += 2; /* CsrResult primitive->status */ |
2098 | return bufferSize; | |
2099 | } | |
2100 | ||
2101 | ||
d4fda8db | 2102 | u8* CsrWifiRouterCtrlPeerDelCfmSer(u8 *ptr, size_t *len, void *msg) |
635d2b00 GKH |
2103 | { |
2104 | CsrWifiRouterCtrlPeerDelCfm *primitive = (CsrWifiRouterCtrlPeerDelCfm *)msg; | |
2105 | *len = 0; | |
2106 | CsrUint16Ser(ptr, len, primitive->common.type); | |
8c87f69a GKH |
2107 | CsrUint16Ser(ptr, len, (u16) primitive->clientData); |
2108 | CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag); | |
2109 | CsrUint16Ser(ptr, len, (u16) primitive->status); | |
635d2b00 GKH |
2110 | return(ptr); |
2111 | } | |
2112 | ||
2113 | ||
d4fda8db | 2114 | void* CsrWifiRouterCtrlPeerDelCfmDes(u8 *buffer, size_t length) |
635d2b00 | 2115 | { |
786eeeb3 | 2116 | CsrWifiRouterCtrlPeerDelCfm *primitive = kmalloc(sizeof(CsrWifiRouterCtrlPeerDelCfm), GFP_KERNEL); |
d4fda8db | 2117 | size_t offset; |
635d2b00 GKH |
2118 | offset = 0; |
2119 | ||
2120 | CsrUint16Des(&primitive->common.type, buffer, &offset); | |
8c87f69a GKH |
2121 | CsrUint16Des((u16 *) &primitive->clientData, buffer, &offset); |
2122 | CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset); | |
2123 | CsrUint16Des((u16 *) &primitive->status, buffer, &offset); | |
635d2b00 GKH |
2124 | |
2125 | return primitive; | |
2126 | } | |
2127 | ||
2128 | ||
d4fda8db | 2129 | size_t CsrWifiRouterCtrlUnexpectedFrameIndSizeof(void *msg) |
635d2b00 | 2130 | { |
d4fda8db | 2131 | size_t bufferSize = 2; |
635d2b00 GKH |
2132 | |
2133 | /* Calculate the Size of the Serialised Data. Could be more efficient (Try 13) */ | |
2134 | bufferSize += 2; /* CsrWifiRouterCtrlRequestorInfo primitive->clientData */ | |
8c87f69a | 2135 | bufferSize += 2; /* u16 primitive->interfaceTag */ |
7e6f5794 | 2136 | bufferSize += 6; /* u8 primitive->peerMacAddress.a[6] */ |
635d2b00 GKH |
2137 | return bufferSize; |
2138 | } | |
2139 | ||
2140 | ||
d4fda8db | 2141 | u8* CsrWifiRouterCtrlUnexpectedFrameIndSer(u8 *ptr, size_t *len, void *msg) |
635d2b00 GKH |
2142 | { |
2143 | CsrWifiRouterCtrlUnexpectedFrameInd *primitive = (CsrWifiRouterCtrlUnexpectedFrameInd *)msg; | |
2144 | *len = 0; | |
2145 | CsrUint16Ser(ptr, len, primitive->common.type); | |
8c87f69a GKH |
2146 | CsrUint16Ser(ptr, len, (u16) primitive->clientData); |
2147 | CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag); | |
2148 | CsrMemCpySer(ptr, len, (const void *) primitive->peerMacAddress.a, ((u16) (6))); | |
635d2b00 GKH |
2149 | return(ptr); |
2150 | } | |
2151 | ||
2152 | ||
d4fda8db | 2153 | void* CsrWifiRouterCtrlUnexpectedFrameIndDes(u8 *buffer, size_t length) |
635d2b00 | 2154 | { |
786eeeb3 | 2155 | CsrWifiRouterCtrlUnexpectedFrameInd *primitive = kmalloc(sizeof(CsrWifiRouterCtrlUnexpectedFrameInd), GFP_KERNEL); |
d4fda8db | 2156 | size_t offset; |
635d2b00 GKH |
2157 | offset = 0; |
2158 | ||
2159 | CsrUint16Des(&primitive->common.type, buffer, &offset); | |
8c87f69a GKH |
2160 | CsrUint16Des((u16 *) &primitive->clientData, buffer, &offset); |
2161 | CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset); | |
2162 | CsrMemCpyDes(primitive->peerMacAddress.a, buffer, &offset, ((u16) (6))); | |
635d2b00 GKH |
2163 | |
2164 | return primitive; | |
2165 | } | |
2166 | ||
2167 | ||
d4fda8db | 2168 | size_t CsrWifiRouterCtrlPeerUpdateCfmSizeof(void *msg) |
635d2b00 | 2169 | { |
d4fda8db | 2170 | size_t bufferSize = 2; |
635d2b00 GKH |
2171 | |
2172 | /* Calculate the Size of the Serialised Data. Could be more efficient (Try 9) */ | |
2173 | bufferSize += 2; /* CsrWifiRouterCtrlRequestorInfo primitive->clientData */ | |
8c87f69a | 2174 | bufferSize += 2; /* u16 primitive->interfaceTag */ |
635d2b00 GKH |
2175 | bufferSize += 2; /* CsrResult primitive->status */ |
2176 | return bufferSize; | |
2177 | } | |
2178 | ||
2179 | ||
d4fda8db | 2180 | u8* CsrWifiRouterCtrlPeerUpdateCfmSer(u8 *ptr, size_t *len, void *msg) |
635d2b00 GKH |
2181 | { |
2182 | CsrWifiRouterCtrlPeerUpdateCfm *primitive = (CsrWifiRouterCtrlPeerUpdateCfm *)msg; | |
2183 | *len = 0; | |
2184 | CsrUint16Ser(ptr, len, primitive->common.type); | |
8c87f69a GKH |
2185 | CsrUint16Ser(ptr, len, (u16) primitive->clientData); |
2186 | CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag); | |
2187 | CsrUint16Ser(ptr, len, (u16) primitive->status); | |
635d2b00 GKH |
2188 | return(ptr); |
2189 | } | |
2190 | ||
2191 | ||
d4fda8db | 2192 | void* CsrWifiRouterCtrlPeerUpdateCfmDes(u8 *buffer, size_t length) |
635d2b00 | 2193 | { |
786eeeb3 | 2194 | CsrWifiRouterCtrlPeerUpdateCfm *primitive = kmalloc(sizeof(CsrWifiRouterCtrlPeerUpdateCfm), GFP_KERNEL); |
d4fda8db | 2195 | size_t offset; |
635d2b00 GKH |
2196 | offset = 0; |
2197 | ||
2198 | CsrUint16Des(&primitive->common.type, buffer, &offset); | |
8c87f69a GKH |
2199 | CsrUint16Des((u16 *) &primitive->clientData, buffer, &offset); |
2200 | CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset); | |
2201 | CsrUint16Des((u16 *) &primitive->status, buffer, &offset); | |
635d2b00 GKH |
2202 | |
2203 | return primitive; | |
2204 | } | |
2205 | ||
2206 | ||
d4fda8db | 2207 | size_t CsrWifiRouterCtrlCapabilitiesCfmSizeof(void *msg) |
635d2b00 | 2208 | { |
d4fda8db | 2209 | size_t bufferSize = 2; |
635d2b00 GKH |
2210 | |
2211 | /* Calculate the Size of the Serialised Data. Could be more efficient (Try 9) */ | |
2212 | bufferSize += 2; /* CsrWifiRouterCtrlRequestorInfo primitive->clientData */ | |
8c87f69a GKH |
2213 | bufferSize += 2; /* u16 primitive->commandQueueSize */ |
2214 | bufferSize += 2; /* u16 primitive->trafficQueueSize */ | |
635d2b00 GKH |
2215 | return bufferSize; |
2216 | } | |
2217 | ||
2218 | ||
d4fda8db | 2219 | u8* CsrWifiRouterCtrlCapabilitiesCfmSer(u8 *ptr, size_t *len, void *msg) |
635d2b00 GKH |
2220 | { |
2221 | CsrWifiRouterCtrlCapabilitiesCfm *primitive = (CsrWifiRouterCtrlCapabilitiesCfm *)msg; | |
2222 | *len = 0; | |
2223 | CsrUint16Ser(ptr, len, primitive->common.type); | |
8c87f69a GKH |
2224 | CsrUint16Ser(ptr, len, (u16) primitive->clientData); |
2225 | CsrUint16Ser(ptr, len, (u16) primitive->commandQueueSize); | |
2226 | CsrUint16Ser(ptr, len, (u16) primitive->trafficQueueSize); | |
635d2b00 GKH |
2227 | return(ptr); |
2228 | } | |
2229 | ||
2230 | ||
d4fda8db | 2231 | void* CsrWifiRouterCtrlCapabilitiesCfmDes(u8 *buffer, size_t length) |
635d2b00 | 2232 | { |
786eeeb3 | 2233 | CsrWifiRouterCtrlCapabilitiesCfm *primitive = kmalloc(sizeof(CsrWifiRouterCtrlCapabilitiesCfm), GFP_KERNEL); |
d4fda8db | 2234 | size_t offset; |
635d2b00 GKH |
2235 | offset = 0; |
2236 | ||
2237 | CsrUint16Des(&primitive->common.type, buffer, &offset); | |
8c87f69a GKH |
2238 | CsrUint16Des((u16 *) &primitive->clientData, buffer, &offset); |
2239 | CsrUint16Des((u16 *) &primitive->commandQueueSize, buffer, &offset); | |
2240 | CsrUint16Des((u16 *) &primitive->trafficQueueSize, buffer, &offset); | |
635d2b00 GKH |
2241 | |
2242 | return primitive; | |
2243 | } | |
2244 | ||
2245 | ||
d4fda8db | 2246 | size_t CsrWifiRouterCtrlBlockAckEnableCfmSizeof(void *msg) |
635d2b00 | 2247 | { |
d4fda8db | 2248 | size_t bufferSize = 2; |
635d2b00 GKH |
2249 | |
2250 | /* Calculate the Size of the Serialised Data. Could be more efficient (Try 9) */ | |
2251 | bufferSize += 2; /* CsrWifiRouterCtrlRequestorInfo primitive->clientData */ | |
8c87f69a | 2252 | bufferSize += 2; /* u16 primitive->interfaceTag */ |
635d2b00 GKH |
2253 | bufferSize += 2; /* CsrResult primitive->status */ |
2254 | return bufferSize; | |
2255 | } | |
2256 | ||
2257 | ||
d4fda8db | 2258 | u8* CsrWifiRouterCtrlBlockAckEnableCfmSer(u8 *ptr, size_t *len, void *msg) |
635d2b00 GKH |
2259 | { |
2260 | CsrWifiRouterCtrlBlockAckEnableCfm *primitive = (CsrWifiRouterCtrlBlockAckEnableCfm *)msg; | |
2261 | *len = 0; | |
2262 | CsrUint16Ser(ptr, len, primitive->common.type); | |
8c87f69a GKH |
2263 | CsrUint16Ser(ptr, len, (u16) primitive->clientData); |
2264 | CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag); | |
2265 | CsrUint16Ser(ptr, len, (u16) primitive->status); | |
635d2b00 GKH |
2266 | return(ptr); |
2267 | } | |
2268 | ||
2269 | ||
d4fda8db | 2270 | void* CsrWifiRouterCtrlBlockAckEnableCfmDes(u8 *buffer, size_t length) |
635d2b00 | 2271 | { |
786eeeb3 | 2272 | CsrWifiRouterCtrlBlockAckEnableCfm *primitive = kmalloc(sizeof(CsrWifiRouterCtrlBlockAckEnableCfm), GFP_KERNEL); |
d4fda8db | 2273 | size_t offset; |
635d2b00 GKH |
2274 | offset = 0; |
2275 | ||
2276 | CsrUint16Des(&primitive->common.type, buffer, &offset); | |
8c87f69a GKH |
2277 | CsrUint16Des((u16 *) &primitive->clientData, buffer, &offset); |
2278 | CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset); | |
2279 | CsrUint16Des((u16 *) &primitive->status, buffer, &offset); | |
635d2b00 GKH |
2280 | |
2281 | return primitive; | |
2282 | } | |
2283 | ||
2284 | ||
d4fda8db | 2285 | size_t CsrWifiRouterCtrlBlockAckDisableCfmSizeof(void *msg) |
635d2b00 | 2286 | { |
d4fda8db | 2287 | size_t bufferSize = 2; |
635d2b00 GKH |
2288 | |
2289 | /* Calculate the Size of the Serialised Data. Could be more efficient (Try 9) */ | |
2290 | bufferSize += 2; /* CsrWifiRouterCtrlRequestorInfo primitive->clientData */ | |
8c87f69a | 2291 | bufferSize += 2; /* u16 primitive->interfaceTag */ |
635d2b00 GKH |
2292 | bufferSize += 2; /* CsrResult primitive->status */ |
2293 | return bufferSize; | |
2294 | } | |
2295 | ||
2296 | ||
d4fda8db | 2297 | u8* CsrWifiRouterCtrlBlockAckDisableCfmSer(u8 *ptr, size_t *len, void *msg) |
635d2b00 GKH |
2298 | { |
2299 | CsrWifiRouterCtrlBlockAckDisableCfm *primitive = (CsrWifiRouterCtrlBlockAckDisableCfm *)msg; | |
2300 | *len = 0; | |
2301 | CsrUint16Ser(ptr, len, primitive->common.type); | |
8c87f69a GKH |
2302 | CsrUint16Ser(ptr, len, (u16) primitive->clientData); |
2303 | CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag); | |
2304 | CsrUint16Ser(ptr, len, (u16) primitive->status); | |
635d2b00 GKH |
2305 | return(ptr); |
2306 | } | |
2307 | ||
2308 | ||
d4fda8db | 2309 | void* CsrWifiRouterCtrlBlockAckDisableCfmDes(u8 *buffer, size_t length) |
635d2b00 | 2310 | { |
786eeeb3 | 2311 | CsrWifiRouterCtrlBlockAckDisableCfm *primitive = kmalloc(sizeof(CsrWifiRouterCtrlBlockAckDisableCfm), GFP_KERNEL); |
d4fda8db | 2312 | size_t offset; |
635d2b00 GKH |
2313 | offset = 0; |
2314 | ||
2315 | CsrUint16Des(&primitive->common.type, buffer, &offset); | |
8c87f69a GKH |
2316 | CsrUint16Des((u16 *) &primitive->clientData, buffer, &offset); |
2317 | CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset); | |
2318 | CsrUint16Des((u16 *) &primitive->status, buffer, &offset); | |
635d2b00 GKH |
2319 | |
2320 | return primitive; | |
2321 | } | |
2322 | ||
2323 | ||
d4fda8db | 2324 | size_t CsrWifiRouterCtrlBlockAckErrorIndSizeof(void *msg) |
635d2b00 | 2325 | { |
d4fda8db | 2326 | size_t bufferSize = 2; |
635d2b00 GKH |
2327 | |
2328 | /* Calculate the Size of the Serialised Data. Could be more efficient (Try 16) */ | |
2329 | bufferSize += 2; /* CsrWifiRouterCtrlRequestorInfo primitive->clientData */ | |
8c87f69a | 2330 | bufferSize += 2; /* u16 primitive->interfaceTag */ |
635d2b00 | 2331 | bufferSize += 1; /* CsrWifiRouterCtrlTrafficStreamId primitive->trafficStreamID */ |
7e6f5794 | 2332 | bufferSize += 6; /* u8 primitive->peerMacAddress.a[6] */ |
635d2b00 GKH |
2333 | bufferSize += 2; /* CsrResult primitive->status */ |
2334 | return bufferSize; | |
2335 | } | |
2336 | ||
2337 | ||
d4fda8db | 2338 | u8* CsrWifiRouterCtrlBlockAckErrorIndSer(u8 *ptr, size_t *len, void *msg) |
635d2b00 GKH |
2339 | { |
2340 | CsrWifiRouterCtrlBlockAckErrorInd *primitive = (CsrWifiRouterCtrlBlockAckErrorInd *)msg; | |
2341 | *len = 0; | |
2342 | CsrUint16Ser(ptr, len, primitive->common.type); | |
8c87f69a GKH |
2343 | CsrUint16Ser(ptr, len, (u16) primitive->clientData); |
2344 | CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag); | |
7e6f5794 | 2345 | CsrUint8Ser(ptr, len, (u8) primitive->trafficStreamID); |
8c87f69a GKH |
2346 | CsrMemCpySer(ptr, len, (const void *) primitive->peerMacAddress.a, ((u16) (6))); |
2347 | CsrUint16Ser(ptr, len, (u16) primitive->status); | |
635d2b00 GKH |
2348 | return(ptr); |
2349 | } | |
2350 | ||
2351 | ||
d4fda8db | 2352 | void* CsrWifiRouterCtrlBlockAckErrorIndDes(u8 *buffer, size_t length) |
635d2b00 | 2353 | { |
786eeeb3 | 2354 | CsrWifiRouterCtrlBlockAckErrorInd *primitive = kmalloc(sizeof(CsrWifiRouterCtrlBlockAckErrorInd), GFP_KERNEL); |
d4fda8db | 2355 | size_t offset; |
635d2b00 GKH |
2356 | offset = 0; |
2357 | ||
2358 | CsrUint16Des(&primitive->common.type, buffer, &offset); | |
8c87f69a GKH |
2359 | CsrUint16Des((u16 *) &primitive->clientData, buffer, &offset); |
2360 | CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset); | |
7e6f5794 | 2361 | CsrUint8Des((u8 *) &primitive->trafficStreamID, buffer, &offset); |
8c87f69a GKH |
2362 | CsrMemCpyDes(primitive->peerMacAddress.a, buffer, &offset, ((u16) (6))); |
2363 | CsrUint16Des((u16 *) &primitive->status, buffer, &offset); | |
635d2b00 GKH |
2364 | |
2365 | return primitive; | |
2366 | } | |
2367 | ||
2368 | ||
d4fda8db | 2369 | size_t CsrWifiRouterCtrlStaInactiveIndSizeof(void *msg) |
635d2b00 | 2370 | { |
d4fda8db | 2371 | size_t bufferSize = 2; |
635d2b00 GKH |
2372 | |
2373 | /* Calculate the Size of the Serialised Data. Could be more efficient (Try 13) */ | |
2374 | bufferSize += 2; /* CsrWifiRouterCtrlRequestorInfo primitive->clientData */ | |
8c87f69a | 2375 | bufferSize += 2; /* u16 primitive->interfaceTag */ |
7e6f5794 | 2376 | bufferSize += 6; /* u8 primitive->staAddress.a[6] */ |
635d2b00 GKH |
2377 | return bufferSize; |
2378 | } | |
2379 | ||
2380 | ||
d4fda8db | 2381 | u8* CsrWifiRouterCtrlStaInactiveIndSer(u8 *ptr, size_t *len, void *msg) |
635d2b00 GKH |
2382 | { |
2383 | CsrWifiRouterCtrlStaInactiveInd *primitive = (CsrWifiRouterCtrlStaInactiveInd *)msg; | |
2384 | *len = 0; | |
2385 | CsrUint16Ser(ptr, len, primitive->common.type); | |
8c87f69a GKH |
2386 | CsrUint16Ser(ptr, len, (u16) primitive->clientData); |
2387 | CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag); | |
2388 | CsrMemCpySer(ptr, len, (const void *) primitive->staAddress.a, ((u16) (6))); | |
635d2b00 GKH |
2389 | return(ptr); |
2390 | } | |
2391 | ||
2392 | ||
d4fda8db | 2393 | void* CsrWifiRouterCtrlStaInactiveIndDes(u8 *buffer, size_t length) |
635d2b00 | 2394 | { |
786eeeb3 | 2395 | CsrWifiRouterCtrlStaInactiveInd *primitive = kmalloc(sizeof(CsrWifiRouterCtrlStaInactiveInd), GFP_KERNEL); |
d4fda8db | 2396 | size_t offset; |
635d2b00 GKH |
2397 | offset = 0; |
2398 | ||
2399 | CsrUint16Des(&primitive->common.type, buffer, &offset); | |
8c87f69a GKH |
2400 | CsrUint16Des((u16 *) &primitive->clientData, buffer, &offset); |
2401 | CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset); | |
2402 | CsrMemCpyDes(primitive->staAddress.a, buffer, &offset, ((u16) (6))); | |
635d2b00 GKH |
2403 | |
2404 | return primitive; | |
2405 | } | |
2406 | ||
2407 | ||
d4fda8db | 2408 | size_t CsrWifiRouterCtrlWapiRxMicCheckIndSizeof(void *msg) |
635d2b00 | 2409 | { |
95edd09e | 2410 | CsrWifiRouterCtrlWapiRxMicCheckInd *primitive = (CsrWifiRouterCtrlWapiRxMicCheckInd *) msg; |
d4fda8db | 2411 | size_t bufferSize = 2; |
635d2b00 GKH |
2412 | |
2413 | /* Calculate the Size of the Serialised Data. Could be more efficient (Try 13) */ | |
2414 | bufferSize += 2; /* CsrWifiRouterCtrlRequestorInfo primitive->clientData */ | |
8c87f69a GKH |
2415 | bufferSize += 2; /* u16 primitive->interfaceTag */ |
2416 | bufferSize += 2; /* u16 primitive->signalLength */ | |
7e6f5794 | 2417 | bufferSize += primitive->signalLength; /* u8 primitive->signal */ |
8c87f69a | 2418 | bufferSize += 2; /* u16 primitive->dataLength */ |
7e6f5794 | 2419 | bufferSize += primitive->dataLength; /* u8 primitive->data */ |
635d2b00 GKH |
2420 | return bufferSize; |
2421 | } | |
2422 | ||
2423 | ||
d4fda8db | 2424 | u8* CsrWifiRouterCtrlWapiRxMicCheckIndSer(u8 *ptr, size_t *len, void *msg) |
635d2b00 | 2425 | { |
95edd09e | 2426 | CsrWifiRouterCtrlWapiRxMicCheckInd *primitive = (CsrWifiRouterCtrlWapiRxMicCheckInd *)msg; |
635d2b00 GKH |
2427 | *len = 0; |
2428 | CsrUint16Ser(ptr, len, primitive->common.type); | |
8c87f69a GKH |
2429 | CsrUint16Ser(ptr, len, (u16) primitive->clientData); |
2430 | CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag); | |
2431 | CsrUint16Ser(ptr, len, (u16) primitive->signalLength); | |
635d2b00 GKH |
2432 | if (primitive->signalLength) |
2433 | { | |
8c87f69a | 2434 | CsrMemCpySer(ptr, len, (const void *) primitive->signal, ((u16) (primitive->signalLength))); |
635d2b00 | 2435 | } |
8c87f69a | 2436 | CsrUint16Ser(ptr, len, (u16) primitive->dataLength); |
635d2b00 GKH |
2437 | if (primitive->dataLength) |
2438 | { | |
8c87f69a | 2439 | CsrMemCpySer(ptr, len, (const void *) primitive->data, ((u16) (primitive->dataLength))); |
635d2b00 GKH |
2440 | } |
2441 | return(ptr); | |
2442 | } | |
2443 | ||
2444 | ||
d4fda8db | 2445 | void* CsrWifiRouterCtrlWapiRxMicCheckIndDes(u8 *buffer, size_t length) |
635d2b00 | 2446 | { |
786eeeb3 | 2447 | CsrWifiRouterCtrlWapiRxMicCheckInd *primitive = kmalloc(sizeof(CsrWifiRouterCtrlWapiRxMicCheckInd), GFP_KERNEL); |
d4fda8db | 2448 | size_t offset; |
635d2b00 GKH |
2449 | offset = 0; |
2450 | ||
2451 | CsrUint16Des(&primitive->common.type, buffer, &offset); | |
8c87f69a GKH |
2452 | CsrUint16Des((u16 *) &primitive->clientData, buffer, &offset); |
2453 | CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset); | |
2454 | CsrUint16Des((u16 *) &primitive->signalLength, buffer, &offset); | |
635d2b00 GKH |
2455 | if (primitive->signalLength) |
2456 | { | |
786eeeb3 | 2457 | primitive->signal = kmalloc(primitive->signalLength, GFP_KERNEL); |
8c87f69a | 2458 | CsrMemCpyDes(primitive->signal, buffer, &offset, ((u16) (primitive->signalLength))); |
635d2b00 GKH |
2459 | } |
2460 | else | |
2461 | { | |
2462 | primitive->signal = NULL; | |
2463 | } | |
8c87f69a | 2464 | CsrUint16Des((u16 *) &primitive->dataLength, buffer, &offset); |
635d2b00 GKH |
2465 | if (primitive->dataLength) |
2466 | { | |
786eeeb3 | 2467 | primitive->data = kmalloc(primitive->dataLength, GFP_KERNEL); |
8c87f69a | 2468 | CsrMemCpyDes(primitive->data, buffer, &offset, ((u16) (primitive->dataLength))); |
635d2b00 GKH |
2469 | } |
2470 | else | |
2471 | { | |
2472 | primitive->data = NULL; | |
2473 | } | |
2474 | ||
2475 | return primitive; | |
2476 | } | |
2477 | ||
2478 | ||
95edd09e | 2479 | void CsrWifiRouterCtrlWapiRxMicCheckIndSerFree(void *voidPrimitivePointer) |
635d2b00 | 2480 | { |
95edd09e | 2481 | CsrWifiRouterCtrlWapiRxMicCheckInd *primitive = (CsrWifiRouterCtrlWapiRxMicCheckInd *) voidPrimitivePointer; |
55a27055 GKH |
2482 | kfree(primitive->signal); |
2483 | kfree(primitive->data); | |
2484 | kfree(primitive); | |
635d2b00 GKH |
2485 | } |
2486 | ||
2487 | ||
d4fda8db | 2488 | size_t CsrWifiRouterCtrlModeSetCfmSizeof(void *msg) |
95edd09e | 2489 | { |
d4fda8db | 2490 | size_t bufferSize = 2; |
95edd09e GKH |
2491 | |
2492 | /* Calculate the Size of the Serialised Data. Could be more efficient (Try 10) */ | |
2493 | bufferSize += 2; /* CsrWifiRouterCtrlRequestorInfo primitive->clientData */ | |
8c87f69a | 2494 | bufferSize += 2; /* u16 primitive->interfaceTag */ |
95edd09e GKH |
2495 | bufferSize += 1; /* CsrWifiRouterCtrlMode primitive->mode */ |
2496 | bufferSize += 2; /* CsrResult primitive->status */ | |
2497 | return bufferSize; | |
2498 | } | |
2499 | ||
2500 | ||
d4fda8db | 2501 | u8* CsrWifiRouterCtrlModeSetCfmSer(u8 *ptr, size_t *len, void *msg) |
95edd09e GKH |
2502 | { |
2503 | CsrWifiRouterCtrlModeSetCfm *primitive = (CsrWifiRouterCtrlModeSetCfm *)msg; | |
2504 | *len = 0; | |
2505 | CsrUint16Ser(ptr, len, primitive->common.type); | |
8c87f69a GKH |
2506 | CsrUint16Ser(ptr, len, (u16) primitive->clientData); |
2507 | CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag); | |
7e6f5794 | 2508 | CsrUint8Ser(ptr, len, (u8) primitive->mode); |
8c87f69a | 2509 | CsrUint16Ser(ptr, len, (u16) primitive->status); |
95edd09e GKH |
2510 | return(ptr); |
2511 | } | |
2512 | ||
2513 | ||
d4fda8db | 2514 | void* CsrWifiRouterCtrlModeSetCfmDes(u8 *buffer, size_t length) |
95edd09e | 2515 | { |
786eeeb3 | 2516 | CsrWifiRouterCtrlModeSetCfm *primitive = kmalloc(sizeof(CsrWifiRouterCtrlModeSetCfm), GFP_KERNEL); |
d4fda8db | 2517 | size_t offset; |
95edd09e GKH |
2518 | offset = 0; |
2519 | ||
2520 | CsrUint16Des(&primitive->common.type, buffer, &offset); | |
8c87f69a GKH |
2521 | CsrUint16Des((u16 *) &primitive->clientData, buffer, &offset); |
2522 | CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset); | |
7e6f5794 | 2523 | CsrUint8Des((u8 *) &primitive->mode, buffer, &offset); |
8c87f69a | 2524 | CsrUint16Des((u16 *) &primitive->status, buffer, &offset); |
95edd09e GKH |
2525 | |
2526 | return primitive; | |
2527 | } | |
2528 | ||
2529 | ||
d4fda8db | 2530 | size_t CsrWifiRouterCtrlWapiUnicastTxEncryptIndSizeof(void *msg) |
95edd09e GKH |
2531 | { |
2532 | CsrWifiRouterCtrlWapiUnicastTxEncryptInd *primitive = (CsrWifiRouterCtrlWapiUnicastTxEncryptInd *) msg; | |
d4fda8db | 2533 | size_t bufferSize = 2; |
95edd09e GKH |
2534 | |
2535 | /* Calculate the Size of the Serialised Data. Could be more efficient (Try 10) */ | |
2536 | bufferSize += 2; /* CsrWifiRouterCtrlRequestorInfo primitive->clientData */ | |
8c87f69a GKH |
2537 | bufferSize += 2; /* u16 primitive->interfaceTag */ |
2538 | bufferSize += 2; /* u16 primitive->dataLength */ | |
7e6f5794 | 2539 | bufferSize += primitive->dataLength; /* u8 primitive->data */ |
95edd09e GKH |
2540 | return bufferSize; |
2541 | } | |
2542 | ||
2543 | ||
d4fda8db | 2544 | u8* CsrWifiRouterCtrlWapiUnicastTxEncryptIndSer(u8 *ptr, size_t *len, void *msg) |
95edd09e GKH |
2545 | { |
2546 | CsrWifiRouterCtrlWapiUnicastTxEncryptInd *primitive = (CsrWifiRouterCtrlWapiUnicastTxEncryptInd *)msg; | |
2547 | *len = 0; | |
2548 | CsrUint16Ser(ptr, len, primitive->common.type); | |
8c87f69a GKH |
2549 | CsrUint16Ser(ptr, len, (u16) primitive->clientData); |
2550 | CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag); | |
2551 | CsrUint16Ser(ptr, len, (u16) primitive->dataLength); | |
95edd09e GKH |
2552 | if (primitive->dataLength) |
2553 | { | |
8c87f69a | 2554 | CsrMemCpySer(ptr, len, (const void *) primitive->data, ((u16) (primitive->dataLength))); |
95edd09e GKH |
2555 | } |
2556 | return(ptr); | |
2557 | } | |
2558 | ||
2559 | ||
d4fda8db | 2560 | void* CsrWifiRouterCtrlWapiUnicastTxEncryptIndDes(u8 *buffer, size_t length) |
95edd09e | 2561 | { |
786eeeb3 | 2562 | CsrWifiRouterCtrlWapiUnicastTxEncryptInd *primitive = kmalloc(sizeof(CsrWifiRouterCtrlWapiUnicastTxEncryptInd), GFP_KERNEL); |
d4fda8db | 2563 | size_t offset; |
95edd09e GKH |
2564 | offset = 0; |
2565 | ||
2566 | CsrUint16Des(&primitive->common.type, buffer, &offset); | |
8c87f69a GKH |
2567 | CsrUint16Des((u16 *) &primitive->clientData, buffer, &offset); |
2568 | CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset); | |
2569 | CsrUint16Des((u16 *) &primitive->dataLength, buffer, &offset); | |
95edd09e GKH |
2570 | if (primitive->dataLength) |
2571 | { | |
786eeeb3 | 2572 | primitive->data = kmalloc(primitive->dataLength, GFP_KERNEL); |
8c87f69a | 2573 | CsrMemCpyDes(primitive->data, buffer, &offset, ((u16) (primitive->dataLength))); |
95edd09e GKH |
2574 | } |
2575 | else | |
2576 | { | |
2577 | primitive->data = NULL; | |
2578 | } | |
2579 | ||
2580 | return primitive; | |
2581 | } | |
2582 | ||
2583 | ||
2584 | void CsrWifiRouterCtrlWapiUnicastTxEncryptIndSerFree(void *voidPrimitivePointer) | |
2585 | { | |
2586 | CsrWifiRouterCtrlWapiUnicastTxEncryptInd *primitive = (CsrWifiRouterCtrlWapiUnicastTxEncryptInd *) voidPrimitivePointer; | |
55a27055 GKH |
2587 | kfree(primitive->data); |
2588 | kfree(primitive); | |
95edd09e GKH |
2589 | } |
2590 | ||
2591 |