Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
csr_wifi_sme_serialize.c
Go to the documentation of this file.
1 /*****************************************************************************
2 
3  (c) Cambridge Silicon Radio Limited 2012
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. */
12 #include <linux/string.h>
13 #include <linux/slab.h>
14 #include "csr_msgconv.h"
15 #include "csr_wifi_sme_prim.h"
16 #include "csr_wifi_sme_serialize.h"
17 
18 void CsrWifiSmePfree(void *ptr)
19 {
20  kfree(ptr);
21 }
22 
23 
25 {
26  size_t bufferSize = 2;
27 
28  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 11) */
29  bufferSize += 2; /* u16 primitive->adHocConfig.atimWindowTu */
30  bufferSize += 2; /* u16 primitive->adHocConfig.beaconPeriodTu */
31  bufferSize += 2; /* u16 primitive->adHocConfig.joinOnlyAttempts */
32  bufferSize += 2; /* u16 primitive->adHocConfig.joinAttemptIntervalMs */
33  return bufferSize;
34 }
35 
36 
37 u8* CsrWifiSmeAdhocConfigSetReqSer(u8 *ptr, size_t *len, void *msg)
38 {
40  *len = 0;
41  CsrUint16Ser(ptr, len, primitive->common.type);
42  CsrUint16Ser(ptr, len, (u16) primitive->adHocConfig.atimWindowTu);
43  CsrUint16Ser(ptr, len, (u16) primitive->adHocConfig.beaconPeriodTu);
44  CsrUint16Ser(ptr, len, (u16) primitive->adHocConfig.joinOnlyAttempts);
45  CsrUint16Ser(ptr, len, (u16) primitive->adHocConfig.joinAttemptIntervalMs);
46  return(ptr);
47 }
48 
49 
51 {
53  size_t offset;
54  offset = 0;
55 
56  CsrUint16Des(&primitive->common.type, buffer, &offset);
57  CsrUint16Des((u16 *) &primitive->adHocConfig.atimWindowTu, buffer, &offset);
58  CsrUint16Des((u16 *) &primitive->adHocConfig.beaconPeriodTu, buffer, &offset);
59  CsrUint16Des((u16 *) &primitive->adHocConfig.joinOnlyAttempts, buffer, &offset);
60  CsrUint16Des((u16 *) &primitive->adHocConfig.joinAttemptIntervalMs, buffer, &offset);
61 
62  return primitive;
63 }
64 
65 
67 {
69  size_t bufferSize = 2;
70 
71  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 13) */
72  bufferSize += 2; /* u16 primitive->interfaceTag */
73  bufferSize += 1; /* CsrWifiSmeListAction primitive->action */
74  bufferSize += 1; /* u8 primitive->setAddressCount */
75  {
76  u16 i1;
77  for (i1 = 0; i1 < primitive->setAddressCount; i1++)
78  {
79  bufferSize += 6; /* u8 primitive->setAddresses[i1].a[6] */
80  }
81  }
82  return bufferSize;
83 }
84 
85 
86 u8* CsrWifiSmeBlacklistReqSer(u8 *ptr, size_t *len, void *msg)
87 {
89  *len = 0;
90  CsrUint16Ser(ptr, len, primitive->common.type);
91  CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag);
92  CsrUint8Ser(ptr, len, (u8) primitive->action);
93  CsrUint8Ser(ptr, len, (u8) primitive->setAddressCount);
94  {
95  u16 i1;
96  for (i1 = 0; i1 < primitive->setAddressCount; i1++)
97  {
98  CsrMemCpySer(ptr, len, (const void *) primitive->setAddresses[i1].a, ((u16) (6)));
99  }
100  }
101  return(ptr);
102 }
103 
104 
106 {
108  size_t offset;
109  offset = 0;
110 
111  CsrUint16Des(&primitive->common.type, buffer, &offset);
112  CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset);
113  CsrUint8Des((u8 *) &primitive->action, buffer, &offset);
114  CsrUint8Des((u8 *) &primitive->setAddressCount, buffer, &offset);
115  primitive->setAddresses = NULL;
116  if (primitive->setAddressCount)
117  {
118  primitive->setAddresses = kmalloc(sizeof(CsrWifiMacAddress) * primitive->setAddressCount, GFP_KERNEL);
119  }
120  {
121  u16 i1;
122  for (i1 = 0; i1 < primitive->setAddressCount; i1++)
123  {
124  CsrMemCpyDes(primitive->setAddresses[i1].a, buffer, &offset, ((u16) (6)));
125  }
126  }
127 
128  return primitive;
129 }
130 
131 
132 void CsrWifiSmeBlacklistReqSerFree(void *voidPrimitivePointer)
133 {
134  CsrWifiSmeBlacklistReq *primitive = (CsrWifiSmeBlacklistReq *) voidPrimitivePointer;
135  kfree(primitive->setAddresses);
136  kfree(primitive);
137 }
138 
139 
141 {
143  size_t bufferSize = 2;
144 
145  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 6) */
146  bufferSize += 2; /* u16 primitive->calibrationDataLength */
147  bufferSize += primitive->calibrationDataLength; /* u8 primitive->calibrationData */
148  return bufferSize;
149 }
150 
151 
153 {
155  *len = 0;
156  CsrUint16Ser(ptr, len, primitive->common.type);
157  CsrUint16Ser(ptr, len, (u16) primitive->calibrationDataLength);
158  if (primitive->calibrationDataLength)
159  {
160  CsrMemCpySer(ptr, len, (const void *) primitive->calibrationData, ((u16) (primitive->calibrationDataLength)));
161  }
162  return(ptr);
163 }
164 
165 
167 {
169  size_t offset;
170  offset = 0;
171 
172  CsrUint16Des(&primitive->common.type, buffer, &offset);
173  CsrUint16Des((u16 *) &primitive->calibrationDataLength, buffer, &offset);
174  if (primitive->calibrationDataLength)
175  {
176  primitive->calibrationData = kmalloc(primitive->calibrationDataLength, GFP_KERNEL);
177  CsrMemCpyDes(primitive->calibrationData, buffer, &offset, ((u16) (primitive->calibrationDataLength)));
178  }
179  else
180  {
181  primitive->calibrationData = NULL;
182  }
183 
184  return primitive;
185 }
186 
187 
188 void CsrWifiSmeCalibrationDataSetReqSerFree(void *voidPrimitivePointer)
189 {
190  CsrWifiSmeCalibrationDataSetReq *primitive = (CsrWifiSmeCalibrationDataSetReq *) voidPrimitivePointer;
191  kfree(primitive->calibrationData);
192  kfree(primitive);
193 }
194 
195 
197 {
198  size_t bufferSize = 2;
199 
200  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 9) */
201  bufferSize += 2; /* u16 primitive->interfaceTag */
202  bufferSize += 1; /* u8 primitive->ccxConfig.keepAliveTimeMs */
203  bufferSize += 1; /* u8 primitive->ccxConfig.apRoamingEnabled */
204  bufferSize += 1; /* u8 primitive->ccxConfig.measurementsMask */
205  bufferSize += 1; /* u8 primitive->ccxConfig.ccxRadioMgtEnabled */
206  return bufferSize;
207 }
208 
209 
210 u8* CsrWifiSmeCcxConfigSetReqSer(u8 *ptr, size_t *len, void *msg)
211 {
213  *len = 0;
214  CsrUint16Ser(ptr, len, primitive->common.type);
215  CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag);
216  CsrUint8Ser(ptr, len, (u8) primitive->ccxConfig.keepAliveTimeMs);
217  CsrUint8Ser(ptr, len, (u8) primitive->ccxConfig.apRoamingEnabled);
218  CsrUint8Ser(ptr, len, (u8) primitive->ccxConfig.measurementsMask);
219  CsrUint8Ser(ptr, len, (u8) primitive->ccxConfig.ccxRadioMgtEnabled);
220  return(ptr);
221 }
222 
223 
225 {
227  size_t offset;
228  offset = 0;
229 
230  CsrUint16Des(&primitive->common.type, buffer, &offset);
231  CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset);
232  CsrUint8Des((u8 *) &primitive->ccxConfig.keepAliveTimeMs, buffer, &offset);
233  CsrUint8Des((u8 *) &primitive->ccxConfig.apRoamingEnabled, buffer, &offset);
234  CsrUint8Des((u8 *) &primitive->ccxConfig.measurementsMask, buffer, &offset);
235  CsrUint8Des((u8 *) &primitive->ccxConfig.ccxRadioMgtEnabled, buffer, &offset);
236 
237  return primitive;
238 }
239 
240 
242 {
243  size_t bufferSize = 2;
244 
245  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 29) */
246  bufferSize += 1; /* u8 primitive->coexConfig.coexEnableSchemeManagement */
247  bufferSize += 1; /* u8 primitive->coexConfig.coexPeriodicWakeHost */
248  bufferSize += 2; /* u16 primitive->coexConfig.coexTrafficBurstyLatencyMs */
249  bufferSize += 2; /* u16 primitive->coexConfig.coexTrafficContinuousLatencyMs */
250  bufferSize += 2; /* u16 primitive->coexConfig.coexObexBlackoutDurationMs */
251  bufferSize += 2; /* u16 primitive->coexConfig.coexObexBlackoutPeriodMs */
252  bufferSize += 2; /* u16 primitive->coexConfig.coexA2dpBrBlackoutDurationMs */
253  bufferSize += 2; /* u16 primitive->coexConfig.coexA2dpBrBlackoutPeriodMs */
254  bufferSize += 2; /* u16 primitive->coexConfig.coexA2dpEdrBlackoutDurationMs */
255  bufferSize += 2; /* u16 primitive->coexConfig.coexA2dpEdrBlackoutPeriodMs */
256  bufferSize += 2; /* u16 primitive->coexConfig.coexPagingBlackoutDurationMs */
257  bufferSize += 2; /* u16 primitive->coexConfig.coexPagingBlackoutPeriodMs */
258  bufferSize += 2; /* u16 primitive->coexConfig.coexInquiryBlackoutDurationMs */
259  bufferSize += 2; /* u16 primitive->coexConfig.coexInquiryBlackoutPeriodMs */
260  return bufferSize;
261 }
262 
263 
264 u8* CsrWifiSmeCoexConfigSetReqSer(u8 *ptr, size_t *len, void *msg)
265 {
267  *len = 0;
268  CsrUint16Ser(ptr, len, primitive->common.type);
269  CsrUint8Ser(ptr, len, (u8) primitive->coexConfig.coexEnableSchemeManagement);
270  CsrUint8Ser(ptr, len, (u8) primitive->coexConfig.coexPeriodicWakeHost);
271  CsrUint16Ser(ptr, len, (u16) primitive->coexConfig.coexTrafficBurstyLatencyMs);
273  CsrUint16Ser(ptr, len, (u16) primitive->coexConfig.coexObexBlackoutDurationMs);
274  CsrUint16Ser(ptr, len, (u16) primitive->coexConfig.coexObexBlackoutPeriodMs);
276  CsrUint16Ser(ptr, len, (u16) primitive->coexConfig.coexA2dpBrBlackoutPeriodMs);
278  CsrUint16Ser(ptr, len, (u16) primitive->coexConfig.coexA2dpEdrBlackoutPeriodMs);
280  CsrUint16Ser(ptr, len, (u16) primitive->coexConfig.coexPagingBlackoutPeriodMs);
282  CsrUint16Ser(ptr, len, (u16) primitive->coexConfig.coexInquiryBlackoutPeriodMs);
283  return(ptr);
284 }
285 
286 
288 {
290  size_t offset;
291  offset = 0;
292 
293  CsrUint16Des(&primitive->common.type, buffer, &offset);
294  CsrUint8Des((u8 *) &primitive->coexConfig.coexEnableSchemeManagement, buffer, &offset);
295  CsrUint8Des((u8 *) &primitive->coexConfig.coexPeriodicWakeHost, buffer, &offset);
296  CsrUint16Des((u16 *) &primitive->coexConfig.coexTrafficBurstyLatencyMs, buffer, &offset);
297  CsrUint16Des((u16 *) &primitive->coexConfig.coexTrafficContinuousLatencyMs, buffer, &offset);
298  CsrUint16Des((u16 *) &primitive->coexConfig.coexObexBlackoutDurationMs, buffer, &offset);
299  CsrUint16Des((u16 *) &primitive->coexConfig.coexObexBlackoutPeriodMs, buffer, &offset);
300  CsrUint16Des((u16 *) &primitive->coexConfig.coexA2dpBrBlackoutDurationMs, buffer, &offset);
301  CsrUint16Des((u16 *) &primitive->coexConfig.coexA2dpBrBlackoutPeriodMs, buffer, &offset);
302  CsrUint16Des((u16 *) &primitive->coexConfig.coexA2dpEdrBlackoutDurationMs, buffer, &offset);
303  CsrUint16Des((u16 *) &primitive->coexConfig.coexA2dpEdrBlackoutPeriodMs, buffer, &offset);
304  CsrUint16Des((u16 *) &primitive->coexConfig.coexPagingBlackoutDurationMs, buffer, &offset);
305  CsrUint16Des((u16 *) &primitive->coexConfig.coexPagingBlackoutPeriodMs, buffer, &offset);
306  CsrUint16Des((u16 *) &primitive->coexConfig.coexInquiryBlackoutDurationMs, buffer, &offset);
307  CsrUint16Des((u16 *) &primitive->coexConfig.coexInquiryBlackoutPeriodMs, buffer, &offset);
308 
309  return primitive;
310 }
311 
312 
314 {
315  CsrWifiSmeConnectReq *primitive = (CsrWifiSmeConnectReq *) msg;
316  size_t bufferSize = 2;
317 
318  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 57) */
319  bufferSize += 2; /* u16 primitive->interfaceTag */
320  bufferSize += 32; /* u8 primitive->connectionConfig.ssid.ssid[32] */
321  bufferSize += 1; /* u8 primitive->connectionConfig.ssid.length */
322  bufferSize += 6; /* u8 primitive->connectionConfig.bssid.a[6] */
323  bufferSize += 1; /* CsrWifiSmeBssType primitive->connectionConfig.bssType */
324  bufferSize += 1; /* CsrWifiSmeRadioIF primitive->connectionConfig.ifIndex */
325  bufferSize += 1; /* CsrWifiSme80211PrivacyMode primitive->connectionConfig.privacyMode */
326  bufferSize += 2; /* CsrWifiSmeAuthModeMask primitive->connectionConfig.authModeMask */
327  bufferSize += 2; /* CsrWifiSmeEncryptionMask primitive->connectionConfig.encryptionModeMask */
328  bufferSize += 2; /* u16 primitive->connectionConfig.mlmeAssociateReqInformationElementsLength */
329  bufferSize += primitive->connectionConfig.mlmeAssociateReqInformationElementsLength; /* u8 primitive->connectionConfig.mlmeAssociateReqInformationElements */
330  bufferSize += 1; /* CsrWifiSmeWmmQosInfoMask primitive->connectionConfig.wmmQosInfo */
331  bufferSize += 1; /* u8 primitive->connectionConfig.adhocJoinOnly */
332  bufferSize += 1; /* u8 primitive->connectionConfig.adhocChannel */
333  return bufferSize;
334 }
335 
336 
337 u8* CsrWifiSmeConnectReqSer(u8 *ptr, size_t *len, void *msg)
338 {
339  CsrWifiSmeConnectReq *primitive = (CsrWifiSmeConnectReq *)msg;
340  *len = 0;
341  CsrUint16Ser(ptr, len, primitive->common.type);
342  CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag);
343  CsrMemCpySer(ptr, len, (const void *) primitive->connectionConfig.ssid.ssid, ((u16) (32)));
344  CsrUint8Ser(ptr, len, (u8) primitive->connectionConfig.ssid.length);
345  CsrMemCpySer(ptr, len, (const void *) primitive->connectionConfig.bssid.a, ((u16) (6)));
346  CsrUint8Ser(ptr, len, (u8) primitive->connectionConfig.bssType);
347  CsrUint8Ser(ptr, len, (u8) primitive->connectionConfig.ifIndex);
348  CsrUint8Ser(ptr, len, (u8) primitive->connectionConfig.privacyMode);
349  CsrUint16Ser(ptr, len, (u16) primitive->connectionConfig.authModeMask);
350  CsrUint16Ser(ptr, len, (u16) primitive->connectionConfig.encryptionModeMask);
353  {
355  }
356  CsrUint8Ser(ptr, len, (u8) primitive->connectionConfig.wmmQosInfo);
357  CsrUint8Ser(ptr, len, (u8) primitive->connectionConfig.adhocJoinOnly);
358  CsrUint8Ser(ptr, len, (u8) primitive->connectionConfig.adhocChannel);
359  return(ptr);
360 }
361 
362 
364 {
366  size_t offset;
367  offset = 0;
368 
369  CsrUint16Des(&primitive->common.type, buffer, &offset);
370  CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset);
371  CsrMemCpyDes(primitive->connectionConfig.ssid.ssid, buffer, &offset, ((u16) (32)));
372  CsrUint8Des((u8 *) &primitive->connectionConfig.ssid.length, buffer, &offset);
373  CsrMemCpyDes(primitive->connectionConfig.bssid.a, buffer, &offset, ((u16) (6)));
374  CsrUint8Des((u8 *) &primitive->connectionConfig.bssType, buffer, &offset);
375  CsrUint8Des((u8 *) &primitive->connectionConfig.ifIndex, buffer, &offset);
376  CsrUint8Des((u8 *) &primitive->connectionConfig.privacyMode, buffer, &offset);
377  CsrUint16Des((u16 *) &primitive->connectionConfig.authModeMask, buffer, &offset);
378  CsrUint16Des((u16 *) &primitive->connectionConfig.encryptionModeMask, buffer, &offset);
381  {
384  }
385  else
386  {
388  }
389  CsrUint8Des((u8 *) &primitive->connectionConfig.wmmQosInfo, buffer, &offset);
390  CsrUint8Des((u8 *) &primitive->connectionConfig.adhocJoinOnly, buffer, &offset);
391  CsrUint8Des((u8 *) &primitive->connectionConfig.adhocChannel, buffer, &offset);
392 
393  return primitive;
394 }
395 
396 
397 void CsrWifiSmeConnectReqSerFree(void *voidPrimitivePointer)
398 {
399  CsrWifiSmeConnectReq *primitive = (CsrWifiSmeConnectReq *) voidPrimitivePointer;
401  kfree(primitive);
402 }
403 
404 
406 {
407  size_t bufferSize = 2;
408 
409  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 8) */
410  bufferSize += 2; /* u16 primitive->interfaceTag */
411  bufferSize += 1; /* CsrWifiSmeHostPowerMode primitive->hostConfig.powerMode */
412  bufferSize += 2; /* u16 primitive->hostConfig.applicationDataPeriodMs */
413  return bufferSize;
414 }
415 
416 
417 u8* CsrWifiSmeHostConfigSetReqSer(u8 *ptr, size_t *len, void *msg)
418 {
420  *len = 0;
421  CsrUint16Ser(ptr, len, primitive->common.type);
422  CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag);
423  CsrUint8Ser(ptr, len, (u8) primitive->hostConfig.powerMode);
424  CsrUint16Ser(ptr, len, (u16) primitive->hostConfig.applicationDataPeriodMs);
425  return(ptr);
426 }
427 
428 
430 {
432  size_t offset;
433  offset = 0;
434 
435  CsrUint16Des(&primitive->common.type, buffer, &offset);
436  CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset);
437  CsrUint8Des((u8 *) &primitive->hostConfig.powerMode, buffer, &offset);
438  CsrUint16Des((u16 *) &primitive->hostConfig.applicationDataPeriodMs, buffer, &offset);
439 
440  return primitive;
441 }
442 
443 
445 {
446  size_t bufferSize = 2;
447 
448  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 65) */
449  bufferSize += 2; /* u16 primitive->interfaceTag */
450  bufferSize += 1; /* CsrWifiSmeListAction primitive->action */
451  bufferSize += 1; /* CsrWifiSmeKeyType primitive->key.keyType */
452  bufferSize += 1; /* u8 primitive->key.keyIndex */
453  bufferSize += 1; /* u8 primitive->key.wepTxKey */
454  {
455  u16 i2;
456  for (i2 = 0; i2 < 8; i2++)
457  {
458  bufferSize += 2; /* u16 primitive->key.keyRsc[8] */
459  }
460  }
461  bufferSize += 1; /* u8 primitive->key.authenticator */
462  bufferSize += 6; /* u8 primitive->key.address.a[6] */
463  bufferSize += 1; /* u8 primitive->key.keyLength */
464  bufferSize += 32; /* u8 primitive->key.key[32] */
465  return bufferSize;
466 }
467 
468 
469 u8* CsrWifiSmeKeyReqSer(u8 *ptr, size_t *len, void *msg)
470 {
471  CsrWifiSmeKeyReq *primitive = (CsrWifiSmeKeyReq *)msg;
472  *len = 0;
473  CsrUint16Ser(ptr, len, primitive->common.type);
474  CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag);
475  CsrUint8Ser(ptr, len, (u8) primitive->action);
476  CsrUint8Ser(ptr, len, (u8) primitive->key.keyType);
477  CsrUint8Ser(ptr, len, (u8) primitive->key.keyIndex);
478  CsrUint8Ser(ptr, len, (u8) primitive->key.wepTxKey);
479  {
480  u16 i2;
481  for (i2 = 0; i2 < 8; i2++)
482  {
483  CsrUint16Ser(ptr, len, (u16) primitive->key.keyRsc[i2]);
484  }
485  }
486  CsrUint8Ser(ptr, len, (u8) primitive->key.authenticator);
487  CsrMemCpySer(ptr, len, (const void *) primitive->key.address.a, ((u16) (6)));
488  CsrUint8Ser(ptr, len, (u8) primitive->key.keyLength);
489  CsrMemCpySer(ptr, len, (const void *) primitive->key.key, ((u16) (32)));
490  return(ptr);
491 }
492 
493 
495 {
496  CsrWifiSmeKeyReq *primitive = kmalloc(sizeof(CsrWifiSmeKeyReq), GFP_KERNEL);
497  size_t offset;
498  offset = 0;
499 
500  CsrUint16Des(&primitive->common.type, buffer, &offset);
501  CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset);
502  CsrUint8Des((u8 *) &primitive->action, buffer, &offset);
503  CsrUint8Des((u8 *) &primitive->key.keyType, buffer, &offset);
504  CsrUint8Des((u8 *) &primitive->key.keyIndex, buffer, &offset);
505  CsrUint8Des((u8 *) &primitive->key.wepTxKey, buffer, &offset);
506  {
507  u16 i2;
508  for (i2 = 0; i2 < 8; i2++)
509  {
510  CsrUint16Des((u16 *) &primitive->key.keyRsc[i2], buffer, &offset);
511  }
512  }
513  CsrUint8Des((u8 *) &primitive->key.authenticator, buffer, &offset);
514  CsrMemCpyDes(primitive->key.address.a, buffer, &offset, ((u16) (6)));
515  CsrUint8Des((u8 *) &primitive->key.keyLength, buffer, &offset);
516  CsrMemCpyDes(primitive->key.key, buffer, &offset, ((u16) (32)));
517 
518  return primitive;
519 }
520 
521 
523 {
524  size_t bufferSize = 2;
525 
526  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 11) */
527  bufferSize += 1; /* u8 primitive->mibConfig.unifiFixMaxTxDataRate */
528  bufferSize += 1; /* u8 primitive->mibConfig.unifiFixTxDataRate */
529  bufferSize += 2; /* u16 primitive->mibConfig.dot11RtsThreshold */
530  bufferSize += 2; /* u16 primitive->mibConfig.dot11FragmentationThreshold */
531  bufferSize += 2; /* u16 primitive->mibConfig.dot11CurrentTxPowerLevel */
532  return bufferSize;
533 }
534 
535 
536 u8* CsrWifiSmeMibConfigSetReqSer(u8 *ptr, size_t *len, void *msg)
537 {
539  *len = 0;
540  CsrUint16Ser(ptr, len, primitive->common.type);
541  CsrUint8Ser(ptr, len, (u8) primitive->mibConfig.unifiFixMaxTxDataRate);
542  CsrUint8Ser(ptr, len, (u8) primitive->mibConfig.unifiFixTxDataRate);
543  CsrUint16Ser(ptr, len, (u16) primitive->mibConfig.dot11RtsThreshold);
544  CsrUint16Ser(ptr, len, (u16) primitive->mibConfig.dot11FragmentationThreshold);
545  CsrUint16Ser(ptr, len, (u16) primitive->mibConfig.dot11CurrentTxPowerLevel);
546  return(ptr);
547 }
548 
549 
551 {
553  size_t offset;
554  offset = 0;
555 
556  CsrUint16Des(&primitive->common.type, buffer, &offset);
557  CsrUint8Des((u8 *) &primitive->mibConfig.unifiFixMaxTxDataRate, buffer, &offset);
558  CsrUint8Des((u8 *) &primitive->mibConfig.unifiFixTxDataRate, buffer, &offset);
559  CsrUint16Des((u16 *) &primitive->mibConfig.dot11RtsThreshold, buffer, &offset);
560  CsrUint16Des((u16 *) &primitive->mibConfig.dot11FragmentationThreshold, buffer, &offset);
561  CsrUint16Des((u16 *) &primitive->mibConfig.dot11CurrentTxPowerLevel, buffer, &offset);
562 
563  return primitive;
564 }
565 
566 
568 {
570  size_t bufferSize = 2;
571 
572  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 6) */
573  bufferSize += 2; /* u16 primitive->mibAttributeLength */
574  bufferSize += primitive->mibAttributeLength; /* u8 primitive->mibAttribute */
575  return bufferSize;
576 }
577 
578 
579 u8* CsrWifiSmeMibGetNextReqSer(u8 *ptr, size_t *len, void *msg)
580 {
582  *len = 0;
583  CsrUint16Ser(ptr, len, primitive->common.type);
584  CsrUint16Ser(ptr, len, (u16) primitive->mibAttributeLength);
585  if (primitive->mibAttributeLength)
586  {
587  CsrMemCpySer(ptr, len, (const void *) primitive->mibAttribute, ((u16) (primitive->mibAttributeLength)));
588  }
589  return(ptr);
590 }
591 
592 
594 {
596  size_t offset;
597  offset = 0;
598 
599  CsrUint16Des(&primitive->common.type, buffer, &offset);
600  CsrUint16Des((u16 *) &primitive->mibAttributeLength, buffer, &offset);
601  if (primitive->mibAttributeLength)
602  {
603  primitive->mibAttribute = kmalloc(primitive->mibAttributeLength, GFP_KERNEL);
604  CsrMemCpyDes(primitive->mibAttribute, buffer, &offset, ((u16) (primitive->mibAttributeLength)));
605  }
606  else
607  {
608  primitive->mibAttribute = NULL;
609  }
610 
611  return primitive;
612 }
613 
614 
615 void CsrWifiSmeMibGetNextReqSerFree(void *voidPrimitivePointer)
616 {
617  CsrWifiSmeMibGetNextReq *primitive = (CsrWifiSmeMibGetNextReq *) voidPrimitivePointer;
618  kfree(primitive->mibAttribute);
619  kfree(primitive);
620 }
621 
622 
624 {
625  CsrWifiSmeMibGetReq *primitive = (CsrWifiSmeMibGetReq *) msg;
626  size_t bufferSize = 2;
627 
628  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 6) */
629  bufferSize += 2; /* u16 primitive->mibAttributeLength */
630  bufferSize += primitive->mibAttributeLength; /* u8 primitive->mibAttribute */
631  return bufferSize;
632 }
633 
634 
635 u8* CsrWifiSmeMibGetReqSer(u8 *ptr, size_t *len, void *msg)
636 {
637  CsrWifiSmeMibGetReq *primitive = (CsrWifiSmeMibGetReq *)msg;
638  *len = 0;
639  CsrUint16Ser(ptr, len, primitive->common.type);
640  CsrUint16Ser(ptr, len, (u16) primitive->mibAttributeLength);
641  if (primitive->mibAttributeLength)
642  {
643  CsrMemCpySer(ptr, len, (const void *) primitive->mibAttribute, ((u16) (primitive->mibAttributeLength)));
644  }
645  return(ptr);
646 }
647 
648 
650 {
652  size_t offset;
653  offset = 0;
654 
655  CsrUint16Des(&primitive->common.type, buffer, &offset);
656  CsrUint16Des((u16 *) &primitive->mibAttributeLength, buffer, &offset);
657  if (primitive->mibAttributeLength)
658  {
659  primitive->mibAttribute = kmalloc(primitive->mibAttributeLength, GFP_KERNEL);
660  CsrMemCpyDes(primitive->mibAttribute, buffer, &offset, ((u16) (primitive->mibAttributeLength)));
661  }
662  else
663  {
664  primitive->mibAttribute = NULL;
665  }
666 
667  return primitive;
668 }
669 
670 
671 void CsrWifiSmeMibGetReqSerFree(void *voidPrimitivePointer)
672 {
673  CsrWifiSmeMibGetReq *primitive = (CsrWifiSmeMibGetReq *) voidPrimitivePointer;
674  kfree(primitive->mibAttribute);
675  kfree(primitive);
676 }
677 
678 
680 {
681  CsrWifiSmeMibSetReq *primitive = (CsrWifiSmeMibSetReq *) msg;
682  size_t bufferSize = 2;
683 
684  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 6) */
685  bufferSize += 2; /* u16 primitive->mibAttributeLength */
686  bufferSize += primitive->mibAttributeLength; /* u8 primitive->mibAttribute */
687  return bufferSize;
688 }
689 
690 
691 u8* CsrWifiSmeMibSetReqSer(u8 *ptr, size_t *len, void *msg)
692 {
693  CsrWifiSmeMibSetReq *primitive = (CsrWifiSmeMibSetReq *)msg;
694  *len = 0;
695  CsrUint16Ser(ptr, len, primitive->common.type);
696  CsrUint16Ser(ptr, len, (u16) primitive->mibAttributeLength);
697  if (primitive->mibAttributeLength)
698  {
699  CsrMemCpySer(ptr, len, (const void *) primitive->mibAttribute, ((u16) (primitive->mibAttributeLength)));
700  }
701  return(ptr);
702 }
703 
704 
706 {
708  size_t offset;
709  offset = 0;
710 
711  CsrUint16Des(&primitive->common.type, buffer, &offset);
712  CsrUint16Des((u16 *) &primitive->mibAttributeLength, buffer, &offset);
713  if (primitive->mibAttributeLength)
714  {
715  primitive->mibAttribute = kmalloc(primitive->mibAttributeLength, GFP_KERNEL);
716  CsrMemCpyDes(primitive->mibAttribute, buffer, &offset, ((u16) (primitive->mibAttributeLength)));
717  }
718  else
719  {
720  primitive->mibAttribute = NULL;
721  }
722 
723  return primitive;
724 }
725 
726 
727 void CsrWifiSmeMibSetReqSerFree(void *voidPrimitivePointer)
728 {
729  CsrWifiSmeMibSetReq *primitive = (CsrWifiSmeMibSetReq *) voidPrimitivePointer;
730  kfree(primitive->mibAttribute);
731  kfree(primitive);
732 }
733 
734 
736 {
738  size_t bufferSize = 2;
739 
740  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 13) */
741  bufferSize += 2; /* u16 primitive->interfaceTag */
742  bufferSize += 1; /* CsrWifiSmeListAction primitive->action */
743  bufferSize += 1; /* u8 primitive->setAddressesCount */
744  {
745  u16 i1;
746  for (i1 = 0; i1 < primitive->setAddressesCount; i1++)
747  {
748  bufferSize += 6; /* u8 primitive->setAddresses[i1].a[6] */
749  }
750  }
751  return bufferSize;
752 }
753 
754 
756 {
758  *len = 0;
759  CsrUint16Ser(ptr, len, primitive->common.type);
760  CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag);
761  CsrUint8Ser(ptr, len, (u8) primitive->action);
762  CsrUint8Ser(ptr, len, (u8) primitive->setAddressesCount);
763  {
764  u16 i1;
765  for (i1 = 0; i1 < primitive->setAddressesCount; i1++)
766  {
767  CsrMemCpySer(ptr, len, (const void *) primitive->setAddresses[i1].a, ((u16) (6)));
768  }
769  }
770  return(ptr);
771 }
772 
773 
775 {
777  size_t offset;
778  offset = 0;
779 
780  CsrUint16Des(&primitive->common.type, buffer, &offset);
781  CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset);
782  CsrUint8Des((u8 *) &primitive->action, buffer, &offset);
783  CsrUint8Des((u8 *) &primitive->setAddressesCount, buffer, &offset);
784  primitive->setAddresses = NULL;
785  if (primitive->setAddressesCount)
786  {
787  primitive->setAddresses = kmalloc(sizeof(CsrWifiMacAddress) * primitive->setAddressesCount, GFP_KERNEL);
788  }
789  {
790  u16 i1;
791  for (i1 = 0; i1 < primitive->setAddressesCount; i1++)
792  {
793  CsrMemCpyDes(primitive->setAddresses[i1].a, buffer, &offset, ((u16) (6)));
794  }
795  }
796 
797  return primitive;
798 }
799 
800 
801 void CsrWifiSmeMulticastAddressReqSerFree(void *voidPrimitivePointer)
802 {
803  CsrWifiSmeMulticastAddressReq *primitive = (CsrWifiSmeMulticastAddressReq *) voidPrimitivePointer;
804  kfree(primitive->setAddresses);
805  kfree(primitive);
806 }
807 
808 
810 {
812  size_t bufferSize = 2;
813 
814  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 13) */
815  bufferSize += 2; /* u16 primitive->interfaceTag */
816  bufferSize += 2; /* u16 primitive->filterLength */
817  bufferSize += primitive->filterLength; /* u8 primitive->filter */
818  bufferSize += 1; /* CsrWifiSmePacketFilterMode primitive->mode */
819  bufferSize += 4; /* u8 primitive->arpFilterAddress.a[4] */
820  return bufferSize;
821 }
822 
823 
825 {
827  *len = 0;
828  CsrUint16Ser(ptr, len, primitive->common.type);
829  CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag);
830  CsrUint16Ser(ptr, len, (u16) primitive->filterLength);
831  if (primitive->filterLength)
832  {
833  CsrMemCpySer(ptr, len, (const void *) primitive->filter, ((u16) (primitive->filterLength)));
834  }
835  CsrUint8Ser(ptr, len, (u8) primitive->mode);
836  CsrMemCpySer(ptr, len, (const void *) primitive->arpFilterAddress.a, ((u16) (4)));
837  return(ptr);
838 }
839 
840 
842 {
844  size_t offset;
845  offset = 0;
846 
847  CsrUint16Des(&primitive->common.type, buffer, &offset);
848  CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset);
849  CsrUint16Des((u16 *) &primitive->filterLength, buffer, &offset);
850  if (primitive->filterLength)
851  {
852  primitive->filter = kmalloc(primitive->filterLength, GFP_KERNEL);
853  CsrMemCpyDes(primitive->filter, buffer, &offset, ((u16) (primitive->filterLength)));
854  }
855  else
856  {
857  primitive->filter = NULL;
858  }
859  CsrUint8Des((u8 *) &primitive->mode, buffer, &offset);
860  CsrMemCpyDes(primitive->arpFilterAddress.a, buffer, &offset, ((u16) (4)));
861 
862  return primitive;
863 }
864 
865 
866 void CsrWifiSmePacketFilterSetReqSerFree(void *voidPrimitivePointer)
867 {
868  CsrWifiSmePacketFilterSetReq *primitive = (CsrWifiSmePacketFilterSetReq *) voidPrimitivePointer;
869  kfree(primitive->filter);
870  kfree(primitive);
871 }
872 
873 
875 {
876  CsrWifiSmePmkidReq *primitive = (CsrWifiSmePmkidReq *) msg;
877  size_t bufferSize = 2;
878 
879  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 29) */
880  bufferSize += 2; /* u16 primitive->interfaceTag */
881  bufferSize += 1; /* CsrWifiSmeListAction primitive->action */
882  bufferSize += 1; /* u8 primitive->setPmkidsCount */
883  {
884  u16 i1;
885  for (i1 = 0; i1 < primitive->setPmkidsCount; i1++)
886  {
887  bufferSize += 6; /* u8 primitive->setPmkids[i1].bssid.a[6] */
888  bufferSize += 16; /* u8 primitive->setPmkids[i1].pmkid[16] */
889  }
890  }
891  return bufferSize;
892 }
893 
894 
895 u8* CsrWifiSmePmkidReqSer(u8 *ptr, size_t *len, void *msg)
896 {
897  CsrWifiSmePmkidReq *primitive = (CsrWifiSmePmkidReq *)msg;
898  *len = 0;
899  CsrUint16Ser(ptr, len, primitive->common.type);
900  CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag);
901  CsrUint8Ser(ptr, len, (u8) primitive->action);
902  CsrUint8Ser(ptr, len, (u8) primitive->setPmkidsCount);
903  {
904  u16 i1;
905  for (i1 = 0; i1 < primitive->setPmkidsCount; i1++)
906  {
907  CsrMemCpySer(ptr, len, (const void *) primitive->setPmkids[i1].bssid.a, ((u16) (6)));
908  CsrMemCpySer(ptr, len, (const void *) primitive->setPmkids[i1].pmkid, ((u16) (16)));
909  }
910  }
911  return(ptr);
912 }
913 
914 
916 {
918  size_t offset;
919  offset = 0;
920 
921  CsrUint16Des(&primitive->common.type, buffer, &offset);
922  CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset);
923  CsrUint8Des((u8 *) &primitive->action, buffer, &offset);
924  CsrUint8Des((u8 *) &primitive->setPmkidsCount, buffer, &offset);
925  primitive->setPmkids = NULL;
926  if (primitive->setPmkidsCount)
927  {
928  primitive->setPmkids = kmalloc(sizeof(CsrWifiSmePmkid) * primitive->setPmkidsCount, GFP_KERNEL);
929  }
930  {
931  u16 i1;
932  for (i1 = 0; i1 < primitive->setPmkidsCount; i1++)
933  {
934  CsrMemCpyDes(primitive->setPmkids[i1].bssid.a, buffer, &offset, ((u16) (6)));
935  CsrMemCpyDes(primitive->setPmkids[i1].pmkid, buffer, &offset, ((u16) (16)));
936  }
937  }
938 
939  return primitive;
940 }
941 
942 
943 void CsrWifiSmePmkidReqSerFree(void *voidPrimitivePointer)
944 {
945  CsrWifiSmePmkidReq *primitive = (CsrWifiSmePmkidReq *) voidPrimitivePointer;
946  kfree(primitive->setPmkids);
947  kfree(primitive);
948 }
949 
950 
952 {
953  size_t bufferSize = 2;
954 
955  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 11) */
956  bufferSize += 1; /* CsrWifiSmePowerSaveLevel primitive->powerConfig.powerSaveLevel */
957  bufferSize += 2; /* u16 primitive->powerConfig.listenIntervalTu */
958  bufferSize += 1; /* u8 primitive->powerConfig.rxDtims */
959  bufferSize += 1; /* CsrWifiSmeD3AutoScanMode primitive->powerConfig.d3AutoScanMode */
960  bufferSize += 1; /* u8 primitive->powerConfig.clientTrafficWindow */
961  bufferSize += 1; /* u8 primitive->powerConfig.opportunisticPowerSave */
962  bufferSize += 1; /* u8 primitive->powerConfig.noticeOfAbsence */
963  return bufferSize;
964 }
965 
966 
968 {
970  *len = 0;
971  CsrUint16Ser(ptr, len, primitive->common.type);
972  CsrUint8Ser(ptr, len, (u8) primitive->powerConfig.powerSaveLevel);
973  CsrUint16Ser(ptr, len, (u16) primitive->powerConfig.listenIntervalTu);
974  CsrUint8Ser(ptr, len, (u8) primitive->powerConfig.rxDtims);
975  CsrUint8Ser(ptr, len, (u8) primitive->powerConfig.d3AutoScanMode);
976  CsrUint8Ser(ptr, len, (u8) primitive->powerConfig.clientTrafficWindow);
977  CsrUint8Ser(ptr, len, (u8) primitive->powerConfig.opportunisticPowerSave);
978  CsrUint8Ser(ptr, len, (u8) primitive->powerConfig.noticeOfAbsence);
979  return(ptr);
980 }
981 
982 
984 {
986  size_t offset;
987  offset = 0;
988 
989  CsrUint16Des(&primitive->common.type, buffer, &offset);
990  CsrUint8Des((u8 *) &primitive->powerConfig.powerSaveLevel, buffer, &offset);
991  CsrUint16Des((u16 *) &primitive->powerConfig.listenIntervalTu, buffer, &offset);
992  CsrUint8Des((u8 *) &primitive->powerConfig.rxDtims, buffer, &offset);
993  CsrUint8Des((u8 *) &primitive->powerConfig.d3AutoScanMode, buffer, &offset);
994  CsrUint8Des((u8 *) &primitive->powerConfig.clientTrafficWindow, buffer, &offset);
995  CsrUint8Des((u8 *) &primitive->powerConfig.opportunisticPowerSave, buffer, &offset);
996  CsrUint8Des((u8 *) &primitive->powerConfig.noticeOfAbsence, buffer, &offset);
997 
998  return primitive;
999 }
1000 
1001 
1003 {
1004  size_t bufferSize = 2;
1005 
1006  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 70) */
1007  bufferSize += 2; /* u16 primitive->interfaceTag */
1008  {
1009  u16 i2;
1010  for (i2 = 0; i2 < 3; i2++)
1011  {
1012  bufferSize += 2; /* s16 primitive->roamingConfig.roamingBands[i2].rssiHighThreshold */
1013  bufferSize += 2; /* s16 primitive->roamingConfig.roamingBands[i2].rssiLowThreshold */
1014  bufferSize += 2; /* s16 primitive->roamingConfig.roamingBands[i2].snrHighThreshold */
1015  bufferSize += 2; /* s16 primitive->roamingConfig.roamingBands[i2].snrLowThreshold */
1016  }
1017  }
1018  bufferSize += 1; /* u8 primitive->roamingConfig.disableSmoothRoaming */
1019  bufferSize += 1; /* u8 primitive->roamingConfig.disableRoamScans */
1020  bufferSize += 1; /* u8 primitive->roamingConfig.reconnectLimit */
1021  bufferSize += 2; /* u16 primitive->roamingConfig.reconnectLimitIntervalMs */
1022  {
1023  u16 i2;
1024  for (i2 = 0; i2 < 3; i2++)
1025  {
1026  bufferSize += 2; /* u16 primitive->roamingConfig.roamScanCfg[i2].intervalSeconds */
1027  bufferSize += 2; /* u16 primitive->roamingConfig.roamScanCfg[i2].validitySeconds */
1028  bufferSize += 2; /* u16 primitive->roamingConfig.roamScanCfg[i2].minActiveChannelTimeTu */
1029  bufferSize += 2; /* u16 primitive->roamingConfig.roamScanCfg[i2].maxActiveChannelTimeTu */
1030  bufferSize += 2; /* u16 primitive->roamingConfig.roamScanCfg[i2].minPassiveChannelTimeTu */
1031  bufferSize += 2; /* u16 primitive->roamingConfig.roamScanCfg[i2].maxPassiveChannelTimeTu */
1032  }
1033  }
1034  return bufferSize;
1035 }
1036 
1037 
1039 {
1041  *len = 0;
1042  CsrUint16Ser(ptr, len, primitive->common.type);
1043  CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag);
1044  {
1045  u16 i2;
1046  for (i2 = 0; i2 < 3; i2++)
1047  {
1048  CsrUint16Ser(ptr, len, (u16) primitive->roamingConfig.roamingBands[i2].rssiHighThreshold);
1049  CsrUint16Ser(ptr, len, (u16) primitive->roamingConfig.roamingBands[i2].rssiLowThreshold);
1050  CsrUint16Ser(ptr, len, (u16) primitive->roamingConfig.roamingBands[i2].snrHighThreshold);
1051  CsrUint16Ser(ptr, len, (u16) primitive->roamingConfig.roamingBands[i2].snrLowThreshold);
1052  }
1053  }
1054  CsrUint8Ser(ptr, len, (u8) primitive->roamingConfig.disableSmoothRoaming);
1055  CsrUint8Ser(ptr, len, (u8) primitive->roamingConfig.disableRoamScans);
1056  CsrUint8Ser(ptr, len, (u8) primitive->roamingConfig.reconnectLimit);
1057  CsrUint16Ser(ptr, len, (u16) primitive->roamingConfig.reconnectLimitIntervalMs);
1058  {
1059  u16 i2;
1060  for (i2 = 0; i2 < 3; i2++)
1061  {
1062  CsrUint16Ser(ptr, len, (u16) primitive->roamingConfig.roamScanCfg[i2].intervalSeconds);
1063  CsrUint16Ser(ptr, len, (u16) primitive->roamingConfig.roamScanCfg[i2].validitySeconds);
1064  CsrUint16Ser(ptr, len, (u16) primitive->roamingConfig.roamScanCfg[i2].minActiveChannelTimeTu);
1065  CsrUint16Ser(ptr, len, (u16) primitive->roamingConfig.roamScanCfg[i2].maxActiveChannelTimeTu);
1068  }
1069  }
1070  return(ptr);
1071 }
1072 
1073 
1075 {
1077  size_t offset;
1078  offset = 0;
1079 
1080  CsrUint16Des(&primitive->common.type, buffer, &offset);
1081  CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset);
1082  {
1083  u16 i2;
1084  for (i2 = 0; i2 < 3; i2++)
1085  {
1086  CsrUint16Des((u16 *) &primitive->roamingConfig.roamingBands[i2].rssiHighThreshold, buffer, &offset);
1087  CsrUint16Des((u16 *) &primitive->roamingConfig.roamingBands[i2].rssiLowThreshold, buffer, &offset);
1088  CsrUint16Des((u16 *) &primitive->roamingConfig.roamingBands[i2].snrHighThreshold, buffer, &offset);
1089  CsrUint16Des((u16 *) &primitive->roamingConfig.roamingBands[i2].snrLowThreshold, buffer, &offset);
1090  }
1091  }
1092  CsrUint8Des((u8 *) &primitive->roamingConfig.disableSmoothRoaming, buffer, &offset);
1093  CsrUint8Des((u8 *) &primitive->roamingConfig.disableRoamScans, buffer, &offset);
1094  CsrUint8Des((u8 *) &primitive->roamingConfig.reconnectLimit, buffer, &offset);
1095  CsrUint16Des((u16 *) &primitive->roamingConfig.reconnectLimitIntervalMs, buffer, &offset);
1096  {
1097  u16 i2;
1098  for (i2 = 0; i2 < 3; i2++)
1099  {
1100  CsrUint16Des((u16 *) &primitive->roamingConfig.roamScanCfg[i2].intervalSeconds, buffer, &offset);
1101  CsrUint16Des((u16 *) &primitive->roamingConfig.roamScanCfg[i2].validitySeconds, buffer, &offset);
1102  CsrUint16Des((u16 *) &primitive->roamingConfig.roamScanCfg[i2].minActiveChannelTimeTu, buffer, &offset);
1103  CsrUint16Des((u16 *) &primitive->roamingConfig.roamScanCfg[i2].maxActiveChannelTimeTu, buffer, &offset);
1104  CsrUint16Des((u16 *) &primitive->roamingConfig.roamScanCfg[i2].minPassiveChannelTimeTu, buffer, &offset);
1105  CsrUint16Des((u16 *) &primitive->roamingConfig.roamScanCfg[i2].maxPassiveChannelTimeTu, buffer, &offset);
1106  }
1107  }
1108 
1109  return primitive;
1110 }
1111 
1112 
1114 {
1116  size_t bufferSize = 2;
1117 
1118  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 63) */
1119  {
1120  u16 i2;
1121  for (i2 = 0; i2 < 4; i2++)
1122  {
1123  bufferSize += 2; /* u16 primitive->scanConfig.scanCfg[i2].intervalSeconds */
1124  bufferSize += 2; /* u16 primitive->scanConfig.scanCfg[i2].validitySeconds */
1125  bufferSize += 2; /* u16 primitive->scanConfig.scanCfg[i2].minActiveChannelTimeTu */
1126  bufferSize += 2; /* u16 primitive->scanConfig.scanCfg[i2].maxActiveChannelTimeTu */
1127  bufferSize += 2; /* u16 primitive->scanConfig.scanCfg[i2].minPassiveChannelTimeTu */
1128  bufferSize += 2; /* u16 primitive->scanConfig.scanCfg[i2].maxPassiveChannelTimeTu */
1129  }
1130  }
1131  bufferSize += 1; /* u8 primitive->scanConfig.disableAutonomousScans */
1132  bufferSize += 2; /* u16 primitive->scanConfig.maxResults */
1133  bufferSize += 1; /* s8 primitive->scanConfig.highRssiThreshold */
1134  bufferSize += 1; /* s8 primitive->scanConfig.lowRssiThreshold */
1135  bufferSize += 1; /* s8 primitive->scanConfig.deltaRssiThreshold */
1136  bufferSize += 1; /* s8 primitive->scanConfig.highSnrThreshold */
1137  bufferSize += 1; /* s8 primitive->scanConfig.lowSnrThreshold */
1138  bufferSize += 1; /* s8 primitive->scanConfig.deltaSnrThreshold */
1139  bufferSize += 2; /* u16 primitive->scanConfig.passiveChannelListCount */
1140  bufferSize += primitive->scanConfig.passiveChannelListCount; /* u8 primitive->scanConfig.passiveChannelList */
1141  return bufferSize;
1142 }
1143 
1144 
1146 {
1148  *len = 0;
1149  CsrUint16Ser(ptr, len, primitive->common.type);
1150  {
1151  u16 i2;
1152  for (i2 = 0; i2 < 4; i2++)
1153  {
1154  CsrUint16Ser(ptr, len, (u16) primitive->scanConfig.scanCfg[i2].intervalSeconds);
1155  CsrUint16Ser(ptr, len, (u16) primitive->scanConfig.scanCfg[i2].validitySeconds);
1156  CsrUint16Ser(ptr, len, (u16) primitive->scanConfig.scanCfg[i2].minActiveChannelTimeTu);
1157  CsrUint16Ser(ptr, len, (u16) primitive->scanConfig.scanCfg[i2].maxActiveChannelTimeTu);
1158  CsrUint16Ser(ptr, len, (u16) primitive->scanConfig.scanCfg[i2].minPassiveChannelTimeTu);
1159  CsrUint16Ser(ptr, len, (u16) primitive->scanConfig.scanCfg[i2].maxPassiveChannelTimeTu);
1160  }
1161  }
1162  CsrUint8Ser(ptr, len, (u8) primitive->scanConfig.disableAutonomousScans);
1163  CsrUint16Ser(ptr, len, (u16) primitive->scanConfig.maxResults);
1164  CsrUint8Ser(ptr, len, (u8) primitive->scanConfig.highRssiThreshold);
1165  CsrUint8Ser(ptr, len, (u8) primitive->scanConfig.lowRssiThreshold);
1166  CsrUint8Ser(ptr, len, (u8) primitive->scanConfig.deltaRssiThreshold);
1167  CsrUint8Ser(ptr, len, (u8) primitive->scanConfig.highSnrThreshold);
1168  CsrUint8Ser(ptr, len, (u8) primitive->scanConfig.lowSnrThreshold);
1169  CsrUint8Ser(ptr, len, (u8) primitive->scanConfig.deltaSnrThreshold);
1170  CsrUint16Ser(ptr, len, (u16) primitive->scanConfig.passiveChannelListCount);
1171  if (primitive->scanConfig.passiveChannelListCount)
1172  {
1173  CsrMemCpySer(ptr, len, (const void *) primitive->scanConfig.passiveChannelList, ((u16) (primitive->scanConfig.passiveChannelListCount)));
1174  }
1175  return(ptr);
1176 }
1177 
1178 
1180 {
1182  size_t offset;
1183  offset = 0;
1184 
1185  CsrUint16Des(&primitive->common.type, buffer, &offset);
1186  {
1187  u16 i2;
1188  for (i2 = 0; i2 < 4; i2++)
1189  {
1190  CsrUint16Des((u16 *) &primitive->scanConfig.scanCfg[i2].intervalSeconds, buffer, &offset);
1191  CsrUint16Des((u16 *) &primitive->scanConfig.scanCfg[i2].validitySeconds, buffer, &offset);
1192  CsrUint16Des((u16 *) &primitive->scanConfig.scanCfg[i2].minActiveChannelTimeTu, buffer, &offset);
1193  CsrUint16Des((u16 *) &primitive->scanConfig.scanCfg[i2].maxActiveChannelTimeTu, buffer, &offset);
1194  CsrUint16Des((u16 *) &primitive->scanConfig.scanCfg[i2].minPassiveChannelTimeTu, buffer, &offset);
1195  CsrUint16Des((u16 *) &primitive->scanConfig.scanCfg[i2].maxPassiveChannelTimeTu, buffer, &offset);
1196  }
1197  }
1198  CsrUint8Des((u8 *) &primitive->scanConfig.disableAutonomousScans, buffer, &offset);
1199  CsrUint16Des((u16 *) &primitive->scanConfig.maxResults, buffer, &offset);
1200  CsrUint8Des((u8 *) &primitive->scanConfig.highRssiThreshold, buffer, &offset);
1201  CsrUint8Des((u8 *) &primitive->scanConfig.lowRssiThreshold, buffer, &offset);
1202  CsrUint8Des((u8 *) &primitive->scanConfig.deltaRssiThreshold, buffer, &offset);
1203  CsrUint8Des((u8 *) &primitive->scanConfig.highSnrThreshold, buffer, &offset);
1204  CsrUint8Des((u8 *) &primitive->scanConfig.lowSnrThreshold, buffer, &offset);
1205  CsrUint8Des((u8 *) &primitive->scanConfig.deltaSnrThreshold, buffer, &offset);
1206  CsrUint16Des((u16 *) &primitive->scanConfig.passiveChannelListCount, buffer, &offset);
1207  if (primitive->scanConfig.passiveChannelListCount)
1208  {
1210  CsrMemCpyDes(primitive->scanConfig.passiveChannelList, buffer, &offset, ((u16) (primitive->scanConfig.passiveChannelListCount)));
1211  }
1212  else
1213  {
1214  primitive->scanConfig.passiveChannelList = NULL;
1215  }
1216 
1217  return primitive;
1218 }
1219 
1220 
1221 void CsrWifiSmeScanConfigSetReqSerFree(void *voidPrimitivePointer)
1222 {
1223  CsrWifiSmeScanConfigSetReq *primitive = (CsrWifiSmeScanConfigSetReq *) voidPrimitivePointer;
1224  kfree(primitive->scanConfig.passiveChannelList);
1225  kfree(primitive);
1226 }
1227 
1228 
1230 {
1231  CsrWifiSmeScanFullReq *primitive = (CsrWifiSmeScanFullReq *) msg;
1232  size_t bufferSize = 2;
1233 
1234  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 52) */
1235  bufferSize += 1; /* u8 primitive->ssidCount */
1236  {
1237  u16 i1;
1238  for (i1 = 0; i1 < primitive->ssidCount; i1++)
1239  {
1240  bufferSize += 32; /* u8 primitive->ssid[i1].ssid[32] */
1241  bufferSize += 1; /* u8 primitive->ssid[i1].length */
1242  }
1243  }
1244  bufferSize += 6; /* u8 primitive->bssid.a[6] */
1245  bufferSize += 1; /* u8 primitive->forceScan */
1246  bufferSize += 1; /* CsrWifiSmeBssType primitive->bssType */
1247  bufferSize += 1; /* CsrWifiSmeScanType primitive->scanType */
1248  bufferSize += 2; /* u16 primitive->channelListCount */
1249  bufferSize += primitive->channelListCount; /* u8 primitive->channelList */
1250  bufferSize += 2; /* u16 primitive->probeIeLength */
1251  bufferSize += primitive->probeIeLength; /* u8 primitive->probeIe */
1252  return bufferSize;
1253 }
1254 
1255 
1256 u8* CsrWifiSmeScanFullReqSer(u8 *ptr, size_t *len, void *msg)
1257 {
1258  CsrWifiSmeScanFullReq *primitive = (CsrWifiSmeScanFullReq *)msg;
1259  *len = 0;
1260  CsrUint16Ser(ptr, len, primitive->common.type);
1261  CsrUint8Ser(ptr, len, (u8) primitive->ssidCount);
1262  {
1263  u16 i1;
1264  for (i1 = 0; i1 < primitive->ssidCount; i1++)
1265  {
1266  CsrMemCpySer(ptr, len, (const void *) primitive->ssid[i1].ssid, ((u16) (32)));
1267  CsrUint8Ser(ptr, len, (u8) primitive->ssid[i1].length);
1268  }
1269  }
1270  CsrMemCpySer(ptr, len, (const void *) primitive->bssid.a, ((u16) (6)));
1271  CsrUint8Ser(ptr, len, (u8) primitive->forceScan);
1272  CsrUint8Ser(ptr, len, (u8) primitive->bssType);
1273  CsrUint8Ser(ptr, len, (u8) primitive->scanType);
1274  CsrUint16Ser(ptr, len, (u16) primitive->channelListCount);
1275  if (primitive->channelListCount)
1276  {
1277  CsrMemCpySer(ptr, len, (const void *) primitive->channelList, ((u16) (primitive->channelListCount)));
1278  }
1279  CsrUint16Ser(ptr, len, (u16) primitive->probeIeLength);
1280  if (primitive->probeIeLength)
1281  {
1282  CsrMemCpySer(ptr, len, (const void *) primitive->probeIe, ((u16) (primitive->probeIeLength)));
1283  }
1284  return(ptr);
1285 }
1286 
1287 
1289 {
1291  size_t offset;
1292  offset = 0;
1293 
1294  CsrUint16Des(&primitive->common.type, buffer, &offset);
1295  CsrUint8Des((u8 *) &primitive->ssidCount, buffer, &offset);
1296  primitive->ssid = NULL;
1297  if (primitive->ssidCount)
1298  {
1299  primitive->ssid = kmalloc(sizeof(CsrWifiSsid) * primitive->ssidCount, GFP_KERNEL);
1300  }
1301  {
1302  u16 i1;
1303  for (i1 = 0; i1 < primitive->ssidCount; i1++)
1304  {
1305  CsrMemCpyDes(primitive->ssid[i1].ssid, buffer, &offset, ((u16) (32)));
1306  CsrUint8Des((u8 *) &primitive->ssid[i1].length, buffer, &offset);
1307  }
1308  }
1309  CsrMemCpyDes(primitive->bssid.a, buffer, &offset, ((u16) (6)));
1310  CsrUint8Des((u8 *) &primitive->forceScan, buffer, &offset);
1311  CsrUint8Des((u8 *) &primitive->bssType, buffer, &offset);
1312  CsrUint8Des((u8 *) &primitive->scanType, buffer, &offset);
1313  CsrUint16Des((u16 *) &primitive->channelListCount, buffer, &offset);
1314  if (primitive->channelListCount)
1315  {
1316  primitive->channelList = kmalloc(primitive->channelListCount, GFP_KERNEL);
1317  CsrMemCpyDes(primitive->channelList, buffer, &offset, ((u16) (primitive->channelListCount)));
1318  }
1319  else
1320  {
1321  primitive->channelList = NULL;
1322  }
1323  CsrUint16Des((u16 *) &primitive->probeIeLength, buffer, &offset);
1324  if (primitive->probeIeLength)
1325  {
1326  primitive->probeIe = kmalloc(primitive->probeIeLength, GFP_KERNEL);
1327  CsrMemCpyDes(primitive->probeIe, buffer, &offset, ((u16) (primitive->probeIeLength)));
1328  }
1329  else
1330  {
1331  primitive->probeIe = NULL;
1332  }
1333 
1334  return primitive;
1335 }
1336 
1337 
1338 void CsrWifiSmeScanFullReqSerFree(void *voidPrimitivePointer)
1339 {
1340  CsrWifiSmeScanFullReq *primitive = (CsrWifiSmeScanFullReq *) voidPrimitivePointer;
1341  kfree(primitive->ssid);
1342  kfree(primitive->channelList);
1343  kfree(primitive->probeIe);
1344  kfree(primitive);
1345 }
1346 
1347 
1349 {
1350  size_t bufferSize = 2;
1351 
1352  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 11) */
1353  bufferSize += 2; /* u16 primitive->interfaceTag */
1354  bufferSize += 1; /* u8 primitive->smeConfig.connectionQualityRssiChangeTrigger */
1355  bufferSize += 1; /* u8 primitive->smeConfig.connectionQualitySnrChangeTrigger */
1356  bufferSize += 1; /* CsrWifiSmeWmmModeMask primitive->smeConfig.wmmModeMask */
1357  bufferSize += 1; /* CsrWifiSmeRadioIF primitive->smeConfig.ifIndex */
1358  bufferSize += 1; /* u8 primitive->smeConfig.allowUnicastUseGroupCipher */
1359  bufferSize += 1; /* u8 primitive->smeConfig.enableOpportunisticKeyCaching */
1360  return bufferSize;
1361 }
1362 
1363 
1365 {
1367  *len = 0;
1368  CsrUint16Ser(ptr, len, primitive->common.type);
1369  CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag);
1372  CsrUint8Ser(ptr, len, (u8) primitive->smeConfig.wmmModeMask);
1373  CsrUint8Ser(ptr, len, (u8) primitive->smeConfig.ifIndex);
1374  CsrUint8Ser(ptr, len, (u8) primitive->smeConfig.allowUnicastUseGroupCipher);
1375  CsrUint8Ser(ptr, len, (u8) primitive->smeConfig.enableOpportunisticKeyCaching);
1376  return(ptr);
1377 }
1378 
1379 
1381 {
1383  size_t offset;
1384  offset = 0;
1385 
1386  CsrUint16Des(&primitive->common.type, buffer, &offset);
1387  CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset);
1388  CsrUint8Des((u8 *) &primitive->smeConfig.connectionQualityRssiChangeTrigger, buffer, &offset);
1389  CsrUint8Des((u8 *) &primitive->smeConfig.connectionQualitySnrChangeTrigger, buffer, &offset);
1390  CsrUint8Des((u8 *) &primitive->smeConfig.wmmModeMask, buffer, &offset);
1391  CsrUint8Des((u8 *) &primitive->smeConfig.ifIndex, buffer, &offset);
1392  CsrUint8Des((u8 *) &primitive->smeConfig.allowUnicastUseGroupCipher, buffer, &offset);
1393  CsrUint8Des((u8 *) &primitive->smeConfig.enableOpportunisticKeyCaching, buffer, &offset);
1394 
1395  return primitive;
1396 }
1397 
1398 
1400 {
1401  CsrWifiSmeTspecReq *primitive = (CsrWifiSmeTspecReq *) msg;
1402  size_t bufferSize = 2;
1403 
1404  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 18) */
1405  bufferSize += 2; /* u16 primitive->interfaceTag */
1406  bufferSize += 1; /* CsrWifiSmeListAction primitive->action */
1407  bufferSize += 4; /* u32 primitive->transactionId */
1408  bufferSize += 1; /* u8 primitive->strict */
1409  bufferSize += 1; /* CsrWifiSmeTspecCtrlMask primitive->ctrlMask */
1410  bufferSize += 2; /* u16 primitive->tspecLength */
1411  bufferSize += primitive->tspecLength; /* u8 primitive->tspec */
1412  bufferSize += 2; /* u16 primitive->tclasLength */
1413  bufferSize += primitive->tclasLength; /* u8 primitive->tclas */
1414  return bufferSize;
1415 }
1416 
1417 
1418 u8* CsrWifiSmeTspecReqSer(u8 *ptr, size_t *len, void *msg)
1419 {
1420  CsrWifiSmeTspecReq *primitive = (CsrWifiSmeTspecReq *)msg;
1421  *len = 0;
1422  CsrUint16Ser(ptr, len, primitive->common.type);
1423  CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag);
1424  CsrUint8Ser(ptr, len, (u8) primitive->action);
1425  CsrUint32Ser(ptr, len, (u32) primitive->transactionId);
1426  CsrUint8Ser(ptr, len, (u8) primitive->strict);
1427  CsrUint8Ser(ptr, len, (u8) primitive->ctrlMask);
1428  CsrUint16Ser(ptr, len, (u16) primitive->tspecLength);
1429  if (primitive->tspecLength)
1430  {
1431  CsrMemCpySer(ptr, len, (const void *) primitive->tspec, ((u16) (primitive->tspecLength)));
1432  }
1433  CsrUint16Ser(ptr, len, (u16) primitive->tclasLength);
1434  if (primitive->tclasLength)
1435  {
1436  CsrMemCpySer(ptr, len, (const void *) primitive->tclas, ((u16) (primitive->tclasLength)));
1437  }
1438  return(ptr);
1439 }
1440 
1441 
1443 {
1445  size_t offset;
1446  offset = 0;
1447 
1448  CsrUint16Des(&primitive->common.type, buffer, &offset);
1449  CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset);
1450  CsrUint8Des((u8 *) &primitive->action, buffer, &offset);
1451  CsrUint32Des((u32 *) &primitive->transactionId, buffer, &offset);
1452  CsrUint8Des((u8 *) &primitive->strict, buffer, &offset);
1453  CsrUint8Des((u8 *) &primitive->ctrlMask, buffer, &offset);
1454  CsrUint16Des((u16 *) &primitive->tspecLength, buffer, &offset);
1455  if (primitive->tspecLength)
1456  {
1457  primitive->tspec = kmalloc(primitive->tspecLength, GFP_KERNEL);
1458  CsrMemCpyDes(primitive->tspec, buffer, &offset, ((u16) (primitive->tspecLength)));
1459  }
1460  else
1461  {
1462  primitive->tspec = NULL;
1463  }
1464  CsrUint16Des((u16 *) &primitive->tclasLength, buffer, &offset);
1465  if (primitive->tclasLength)
1466  {
1467  primitive->tclas = kmalloc(primitive->tclasLength, GFP_KERNEL);
1468  CsrMemCpyDes(primitive->tclas, buffer, &offset, ((u16) (primitive->tclasLength)));
1469  }
1470  else
1471  {
1472  primitive->tclas = NULL;
1473  }
1474 
1475  return primitive;
1476 }
1477 
1478 
1479 void CsrWifiSmeTspecReqSerFree(void *voidPrimitivePointer)
1480 {
1481  CsrWifiSmeTspecReq *primitive = (CsrWifiSmeTspecReq *) voidPrimitivePointer;
1482  kfree(primitive->tspec);
1483  kfree(primitive->tclas);
1484  kfree(primitive);
1485 }
1486 
1487 
1489 {
1491  size_t bufferSize = 2;
1492 
1493  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 14) */
1494  bufferSize += 6; /* u8 primitive->address.a[6] */
1495  bufferSize += 2; /* u16 primitive->mibFilesCount */
1496  {
1497  u16 i1;
1498  for (i1 = 0; i1 < primitive->mibFilesCount; i1++)
1499  {
1500  bufferSize += 2; /* u16 primitive->mibFiles[i1].length */
1501  bufferSize += primitive->mibFiles[i1].length; /* u8 primitive->mibFiles[i1].data */
1502  }
1503  }
1504  return bufferSize;
1505 }
1506 
1507 
1509 {
1511  *len = 0;
1512  CsrUint16Ser(ptr, len, primitive->common.type);
1513  CsrMemCpySer(ptr, len, (const void *) primitive->address.a, ((u16) (6)));
1514  CsrUint16Ser(ptr, len, (u16) primitive->mibFilesCount);
1515  {
1516  u16 i1;
1517  for (i1 = 0; i1 < primitive->mibFilesCount; i1++)
1518  {
1519  CsrUint16Ser(ptr, len, (u16) primitive->mibFiles[i1].length);
1520  if (primitive->mibFiles[i1].length)
1521  {
1522  CsrMemCpySer(ptr, len, (const void *) primitive->mibFiles[i1].data, ((u16) (primitive->mibFiles[i1].length)));
1523  }
1524  }
1525  }
1526  return(ptr);
1527 }
1528 
1529 
1531 {
1533  size_t offset;
1534  offset = 0;
1535 
1536  CsrUint16Des(&primitive->common.type, buffer, &offset);
1537  CsrMemCpyDes(primitive->address.a, buffer, &offset, ((u16) (6)));
1538  CsrUint16Des((u16 *) &primitive->mibFilesCount, buffer, &offset);
1539  primitive->mibFiles = NULL;
1540  if (primitive->mibFilesCount)
1541  {
1542  primitive->mibFiles = kmalloc(sizeof(CsrWifiSmeDataBlock) * primitive->mibFilesCount, GFP_KERNEL);
1543  }
1544  {
1545  u16 i1;
1546  for (i1 = 0; i1 < primitive->mibFilesCount; i1++)
1547  {
1548  CsrUint16Des((u16 *) &primitive->mibFiles[i1].length, buffer, &offset);
1549  if (primitive->mibFiles[i1].length)
1550  {
1551  primitive->mibFiles[i1].data = kmalloc(primitive->mibFiles[i1].length, GFP_KERNEL);
1552  CsrMemCpyDes(primitive->mibFiles[i1].data, buffer, &offset, ((u16) (primitive->mibFiles[i1].length)));
1553  }
1554  else
1555  {
1556  primitive->mibFiles[i1].data = NULL;
1557  }
1558  }
1559  }
1560 
1561  return primitive;
1562 }
1563 
1564 
1565 void CsrWifiSmeWifiFlightmodeReqSerFree(void *voidPrimitivePointer)
1566 {
1567  CsrWifiSmeWifiFlightmodeReq *primitive = (CsrWifiSmeWifiFlightmodeReq *) voidPrimitivePointer;
1568  {
1569  u16 i1;
1570  for (i1 = 0; i1 < primitive->mibFilesCount; i1++)
1571  {
1572  kfree(primitive->mibFiles[i1].data);
1573  }
1574  }
1575  kfree(primitive->mibFiles);
1576  kfree(primitive);
1577 }
1578 
1579 
1581 {
1582  CsrWifiSmeWifiOnReq *primitive = (CsrWifiSmeWifiOnReq *) msg;
1583  size_t bufferSize = 2;
1584 
1585  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 14) */
1586  bufferSize += 6; /* u8 primitive->address.a[6] */
1587  bufferSize += 2; /* u16 primitive->mibFilesCount */
1588  {
1589  u16 i1;
1590  for (i1 = 0; i1 < primitive->mibFilesCount; i1++)
1591  {
1592  bufferSize += 2; /* u16 primitive->mibFiles[i1].length */
1593  bufferSize += primitive->mibFiles[i1].length; /* u8 primitive->mibFiles[i1].data */
1594  }
1595  }
1596  return bufferSize;
1597 }
1598 
1599 
1600 u8* CsrWifiSmeWifiOnReqSer(u8 *ptr, size_t *len, void *msg)
1601 {
1602  CsrWifiSmeWifiOnReq *primitive = (CsrWifiSmeWifiOnReq *)msg;
1603  *len = 0;
1604  CsrUint16Ser(ptr, len, primitive->common.type);
1605  CsrMemCpySer(ptr, len, (const void *) primitive->address.a, ((u16) (6)));
1606  CsrUint16Ser(ptr, len, (u16) primitive->mibFilesCount);
1607  {
1608  u16 i1;
1609  for (i1 = 0; i1 < primitive->mibFilesCount; i1++)
1610  {
1611  CsrUint16Ser(ptr, len, (u16) primitive->mibFiles[i1].length);
1612  if (primitive->mibFiles[i1].length)
1613  {
1614  CsrMemCpySer(ptr, len, (const void *) primitive->mibFiles[i1].data, ((u16) (primitive->mibFiles[i1].length)));
1615  }
1616  }
1617  }
1618  return(ptr);
1619 }
1620 
1621 
1623 {
1625  size_t offset;
1626  offset = 0;
1627 
1628  CsrUint16Des(&primitive->common.type, buffer, &offset);
1629  CsrMemCpyDes(primitive->address.a, buffer, &offset, ((u16) (6)));
1630  CsrUint16Des((u16 *) &primitive->mibFilesCount, buffer, &offset);
1631  primitive->mibFiles = NULL;
1632  if (primitive->mibFilesCount)
1633  {
1634  primitive->mibFiles = kmalloc(sizeof(CsrWifiSmeDataBlock) * primitive->mibFilesCount, GFP_KERNEL);
1635  }
1636  {
1637  u16 i1;
1638  for (i1 = 0; i1 < primitive->mibFilesCount; i1++)
1639  {
1640  CsrUint16Des((u16 *) &primitive->mibFiles[i1].length, buffer, &offset);
1641  if (primitive->mibFiles[i1].length)
1642  {
1643  primitive->mibFiles[i1].data = kmalloc(primitive->mibFiles[i1].length, GFP_KERNEL);
1644  CsrMemCpyDes(primitive->mibFiles[i1].data, buffer, &offset, ((u16) (primitive->mibFiles[i1].length)));
1645  }
1646  else
1647  {
1648  primitive->mibFiles[i1].data = NULL;
1649  }
1650  }
1651  }
1652 
1653  return primitive;
1654 }
1655 
1656 
1657 void CsrWifiSmeWifiOnReqSerFree(void *voidPrimitivePointer)
1658 {
1659  CsrWifiSmeWifiOnReq *primitive = (CsrWifiSmeWifiOnReq *) voidPrimitivePointer;
1660  {
1661  u16 i1;
1662  for (i1 = 0; i1 < primitive->mibFilesCount; i1++)
1663  {
1664  kfree(primitive->mibFiles[i1].data);
1665  }
1666  }
1667  kfree(primitive->mibFiles);
1668  kfree(primitive);
1669 }
1670 
1671 
1673 {
1675  size_t bufferSize = 2;
1676 
1677  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 37) */
1678  bufferSize += 1; /* u8 primitive->cloakedSsids.cloakedSsidsCount */
1679  {
1680  u16 i2;
1681  for (i2 = 0; i2 < primitive->cloakedSsids.cloakedSsidsCount; i2++)
1682  {
1683  bufferSize += 32; /* u8 primitive->cloakedSsids.cloakedSsids[i2].ssid[32] */
1684  bufferSize += 1; /* u8 primitive->cloakedSsids.cloakedSsids[i2].length */
1685  }
1686  }
1687  return bufferSize;
1688 }
1689 
1690 
1692 {
1694  *len = 0;
1695  CsrUint16Ser(ptr, len, primitive->common.type);
1696  CsrUint8Ser(ptr, len, (u8) primitive->cloakedSsids.cloakedSsidsCount);
1697  {
1698  u16 i2;
1699  for (i2 = 0; i2 < primitive->cloakedSsids.cloakedSsidsCount; i2++)
1700  {
1701  CsrMemCpySer(ptr, len, (const void *) primitive->cloakedSsids.cloakedSsids[i2].ssid, ((u16) (32)));
1702  CsrUint8Ser(ptr, len, (u8) primitive->cloakedSsids.cloakedSsids[i2].length);
1703  }
1704  }
1705  return(ptr);
1706 }
1707 
1708 
1710 {
1712  size_t offset;
1713  offset = 0;
1714 
1715  CsrUint16Des(&primitive->common.type, buffer, &offset);
1716  CsrUint8Des((u8 *) &primitive->cloakedSsids.cloakedSsidsCount, buffer, &offset);
1717  primitive->cloakedSsids.cloakedSsids = NULL;
1718  if (primitive->cloakedSsids.cloakedSsidsCount)
1719  {
1721  }
1722  {
1723  u16 i2;
1724  for (i2 = 0; i2 < primitive->cloakedSsids.cloakedSsidsCount; i2++)
1725  {
1726  CsrMemCpyDes(primitive->cloakedSsids.cloakedSsids[i2].ssid, buffer, &offset, ((u16) (32)));
1727  CsrUint8Des((u8 *) &primitive->cloakedSsids.cloakedSsids[i2].length, buffer, &offset);
1728  }
1729  }
1730 
1731  return primitive;
1732 }
1733 
1734 
1735 void CsrWifiSmeCloakedSsidsSetReqSerFree(void *voidPrimitivePointer)
1736 {
1737  CsrWifiSmeCloakedSsidsSetReq *primitive = (CsrWifiSmeCloakedSsidsSetReq *) voidPrimitivePointer;
1738  kfree(primitive->cloakedSsids.cloakedSsids);
1739  kfree(primitive);
1740 }
1741 
1742 
1744 {
1745  size_t bufferSize = 2;
1746 
1747  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 8) */
1748  bufferSize += 1; /* CsrWifiSme80211dTrustLevel primitive->deviceConfig.trustLevel */
1749  bufferSize += 2; /* u8 primitive->deviceConfig.countryCode[2] */
1750  bufferSize += 1; /* CsrWifiSmeFirmwareDriverInterface primitive->deviceConfig.firmwareDriverInterface */
1751  bufferSize += 1; /* u8 primitive->deviceConfig.enableStrictDraftN */
1752  return bufferSize;
1753 }
1754 
1755 
1757 {
1759  *len = 0;
1760  CsrUint16Ser(ptr, len, primitive->common.type);
1761  CsrUint8Ser(ptr, len, (u8) primitive->deviceConfig.trustLevel);
1762  CsrMemCpySer(ptr, len, (const void *) primitive->deviceConfig.countryCode, ((u16) (2)));
1763  CsrUint8Ser(ptr, len, (u8) primitive->deviceConfig.firmwareDriverInterface);
1764  CsrUint8Ser(ptr, len, (u8) primitive->deviceConfig.enableStrictDraftN);
1765  return(ptr);
1766 }
1767 
1768 
1770 {
1772  size_t offset;
1773  offset = 0;
1774 
1775  CsrUint16Des(&primitive->common.type, buffer, &offset);
1776  CsrUint8Des((u8 *) &primitive->deviceConfig.trustLevel, buffer, &offset);
1777  CsrMemCpyDes(primitive->deviceConfig.countryCode, buffer, &offset, ((u16) (2)));
1778  CsrUint8Des((u8 *) &primitive->deviceConfig.firmwareDriverInterface, buffer, &offset);
1779  CsrUint8Des((u8 *) &primitive->deviceConfig.enableStrictDraftN, buffer, &offset);
1780 
1781  return primitive;
1782 }
1783 
1784 
1786 {
1788  size_t bufferSize = 2;
1789 
1790  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 240) */
1791  bufferSize += 1; /* u8 primitive->wpsConfig.wpsVersion */
1792  bufferSize += 16; /* u8 primitive->wpsConfig.uuid[16] */
1793  bufferSize += 32; /* u8 primitive->wpsConfig.deviceName[32] */
1794  bufferSize += 1; /* u8 primitive->wpsConfig.deviceNameLength */
1795  bufferSize += 64; /* u8 primitive->wpsConfig.manufacturer[64] */
1796  bufferSize += 1; /* u8 primitive->wpsConfig.manufacturerLength */
1797  bufferSize += 32; /* u8 primitive->wpsConfig.modelName[32] */
1798  bufferSize += 1; /* u8 primitive->wpsConfig.modelNameLength */
1799  bufferSize += 32; /* u8 primitive->wpsConfig.modelNumber[32] */
1800  bufferSize += 1; /* u8 primitive->wpsConfig.modelNumberLength */
1801  bufferSize += 32; /* u8 primitive->wpsConfig.serialNumber[32] */
1802  bufferSize += 8; /* u8 primitive->wpsConfig.primDeviceType.deviceDetails[8] */
1803  bufferSize += 1; /* u8 primitive->wpsConfig.secondaryDeviceTypeCount */
1804  {
1805  u16 i2;
1806  for (i2 = 0; i2 < primitive->wpsConfig.secondaryDeviceTypeCount; i2++)
1807  {
1808  bufferSize += 8; /* u8 primitive->wpsConfig.secondaryDeviceType[i2].deviceDetails[8] */
1809  }
1810  }
1811  bufferSize += 2; /* CsrWifiSmeWpsConfigTypeMask primitive->wpsConfig.configMethods */
1812  bufferSize += 1; /* u8 primitive->wpsConfig.rfBands */
1813  bufferSize += 4; /* u8 primitive->wpsConfig.osVersion[4] */
1814  return bufferSize;
1815 }
1816 
1817 
1819 {
1821  *len = 0;
1822  CsrUint16Ser(ptr, len, primitive->common.type);
1823  CsrUint8Ser(ptr, len, (u8) primitive->wpsConfig.wpsVersion);
1824  CsrMemCpySer(ptr, len, (const void *) primitive->wpsConfig.uuid, ((u16) (16)));
1825  CsrMemCpySer(ptr, len, (const void *) primitive->wpsConfig.deviceName, ((u16) (32)));
1826  CsrUint8Ser(ptr, len, (u8) primitive->wpsConfig.deviceNameLength);
1827  CsrMemCpySer(ptr, len, (const void *) primitive->wpsConfig.manufacturer, ((u16) (64)));
1828  CsrUint8Ser(ptr, len, (u8) primitive->wpsConfig.manufacturerLength);
1829  CsrMemCpySer(ptr, len, (const void *) primitive->wpsConfig.modelName, ((u16) (32)));
1830  CsrUint8Ser(ptr, len, (u8) primitive->wpsConfig.modelNameLength);
1831  CsrMemCpySer(ptr, len, (const void *) primitive->wpsConfig.modelNumber, ((u16) (32)));
1832  CsrUint8Ser(ptr, len, (u8) primitive->wpsConfig.modelNumberLength);
1833  CsrMemCpySer(ptr, len, (const void *) primitive->wpsConfig.serialNumber, ((u16) (32)));
1834  CsrMemCpySer(ptr, len, (const void *) primitive->wpsConfig.primDeviceType.deviceDetails, ((u16) (8)));
1835  CsrUint8Ser(ptr, len, (u8) primitive->wpsConfig.secondaryDeviceTypeCount);
1836  {
1837  u16 i2;
1838  for (i2 = 0; i2 < primitive->wpsConfig.secondaryDeviceTypeCount; i2++)
1839  {
1840  CsrMemCpySer(ptr, len, (const void *) primitive->wpsConfig.secondaryDeviceType[i2].deviceDetails, ((u16) (8)));
1841  }
1842  }
1843  CsrUint16Ser(ptr, len, (u16) primitive->wpsConfig.configMethods);
1844  CsrUint8Ser(ptr, len, (u8) primitive->wpsConfig.rfBands);
1845  CsrMemCpySer(ptr, len, (const void *) primitive->wpsConfig.osVersion, ((u16) (4)));
1846  return(ptr);
1847 }
1848 
1849 
1851 {
1853  size_t offset;
1854  offset = 0;
1855 
1856  CsrUint16Des(&primitive->common.type, buffer, &offset);
1857  CsrUint8Des((u8 *) &primitive->wpsConfig.wpsVersion, buffer, &offset);
1858  CsrMemCpyDes(primitive->wpsConfig.uuid, buffer, &offset, ((u16) (16)));
1859  CsrMemCpyDes(primitive->wpsConfig.deviceName, buffer, &offset, ((u16) (32)));
1860  CsrUint8Des((u8 *) &primitive->wpsConfig.deviceNameLength, buffer, &offset);
1861  CsrMemCpyDes(primitive->wpsConfig.manufacturer, buffer, &offset, ((u16) (64)));
1862  CsrUint8Des((u8 *) &primitive->wpsConfig.manufacturerLength, buffer, &offset);
1863  CsrMemCpyDes(primitive->wpsConfig.modelName, buffer, &offset, ((u16) (32)));
1864  CsrUint8Des((u8 *) &primitive->wpsConfig.modelNameLength, buffer, &offset);
1865  CsrMemCpyDes(primitive->wpsConfig.modelNumber, buffer, &offset, ((u16) (32)));
1866  CsrUint8Des((u8 *) &primitive->wpsConfig.modelNumberLength, buffer, &offset);
1867  CsrMemCpyDes(primitive->wpsConfig.serialNumber, buffer, &offset, ((u16) (32)));
1868  CsrMemCpyDes(primitive->wpsConfig.primDeviceType.deviceDetails, buffer, &offset, ((u16) (8)));
1869  CsrUint8Des((u8 *) &primitive->wpsConfig.secondaryDeviceTypeCount, buffer, &offset);
1870  primitive->wpsConfig.secondaryDeviceType = NULL;
1871  if (primitive->wpsConfig.secondaryDeviceTypeCount)
1872  {
1874  }
1875  {
1876  u16 i2;
1877  for (i2 = 0; i2 < primitive->wpsConfig.secondaryDeviceTypeCount; i2++)
1878  {
1879  CsrMemCpyDes(primitive->wpsConfig.secondaryDeviceType[i2].deviceDetails, buffer, &offset, ((u16) (8)));
1880  }
1881  }
1882  CsrUint16Des((u16 *) &primitive->wpsConfig.configMethods, buffer, &offset);
1883  CsrUint8Des((u8 *) &primitive->wpsConfig.rfBands, buffer, &offset);
1884  CsrMemCpyDes(primitive->wpsConfig.osVersion, buffer, &offset, ((u16) (4)));
1885 
1886  return primitive;
1887 }
1888 
1889 
1890 void CsrWifiSmeWpsConfigurationReqSerFree(void *voidPrimitivePointer)
1891 {
1892  CsrWifiSmeWpsConfigurationReq *primitive = (CsrWifiSmeWpsConfigurationReq *) voidPrimitivePointer;
1893  kfree(primitive->wpsConfig.secondaryDeviceType);
1894  kfree(primitive);
1895 }
1896 
1897 
1899 {
1900  CsrWifiSmeSetReq *primitive = (CsrWifiSmeSetReq *) msg;
1901  size_t bufferSize = 2;
1902 
1903  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 8) */
1904  bufferSize += 4; /* u32 primitive->dataLength */
1905  bufferSize += primitive->dataLength; /* u8 primitive->data */
1906  return bufferSize;
1907 }
1908 
1909 
1910 u8* CsrWifiSmeSetReqSer(u8 *ptr, size_t *len, void *msg)
1911 {
1912  CsrWifiSmeSetReq *primitive = (CsrWifiSmeSetReq *)msg;
1913  *len = 0;
1914  CsrUint16Ser(ptr, len, primitive->common.type);
1915  CsrUint32Ser(ptr, len, (u32) primitive->dataLength);
1916  if (primitive->dataLength)
1917  {
1918  CsrMemCpySer(ptr, len, (const void *) primitive->data, ((u16) (primitive->dataLength)));
1919  }
1920  return(ptr);
1921 }
1922 
1923 
1925 {
1926  CsrWifiSmeSetReq *primitive = kmalloc(sizeof(CsrWifiSmeSetReq), GFP_KERNEL);
1927  size_t offset;
1928  offset = 0;
1929 
1930  CsrUint16Des(&primitive->common.type, buffer, &offset);
1931  CsrUint32Des((u32 *) &primitive->dataLength, buffer, &offset);
1932  if (primitive->dataLength)
1933  {
1934  primitive->data = kmalloc(primitive->dataLength, GFP_KERNEL);
1935  CsrMemCpyDes(primitive->data, buffer, &offset, ((u16) (primitive->dataLength)));
1936  }
1937  else
1938  {
1939  primitive->data = NULL;
1940  }
1941 
1942  return primitive;
1943 }
1944 
1945 
1946 void CsrWifiSmeSetReqSerFree(void *voidPrimitivePointer)
1947 {
1948  CsrWifiSmeSetReq *primitive = (CsrWifiSmeSetReq *) voidPrimitivePointer;
1949  kfree(primitive->data);
1950  kfree(primitive);
1951 }
1952 
1953 
1955 {
1956  size_t bufferSize = 2;
1957 
1958  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 13) */
1959  bufferSize += 2; /* CsrResult primitive->status */
1960  bufferSize += 2; /* u16 primitive->adHocConfig.atimWindowTu */
1961  bufferSize += 2; /* u16 primitive->adHocConfig.beaconPeriodTu */
1962  bufferSize += 2; /* u16 primitive->adHocConfig.joinOnlyAttempts */
1963  bufferSize += 2; /* u16 primitive->adHocConfig.joinAttemptIntervalMs */
1964  return bufferSize;
1965 }
1966 
1967 
1969 {
1971  *len = 0;
1972  CsrUint16Ser(ptr, len, primitive->common.type);
1973  CsrUint16Ser(ptr, len, (u16) primitive->status);
1974  CsrUint16Ser(ptr, len, (u16) primitive->adHocConfig.atimWindowTu);
1975  CsrUint16Ser(ptr, len, (u16) primitive->adHocConfig.beaconPeriodTu);
1976  CsrUint16Ser(ptr, len, (u16) primitive->adHocConfig.joinOnlyAttempts);
1977  CsrUint16Ser(ptr, len, (u16) primitive->adHocConfig.joinAttemptIntervalMs);
1978  return(ptr);
1979 }
1980 
1981 
1983 {
1985  size_t offset;
1986  offset = 0;
1987 
1988  CsrUint16Des(&primitive->common.type, buffer, &offset);
1989  CsrUint16Des((u16 *) &primitive->status, buffer, &offset);
1990  CsrUint16Des((u16 *) &primitive->adHocConfig.atimWindowTu, buffer, &offset);
1991  CsrUint16Des((u16 *) &primitive->adHocConfig.beaconPeriodTu, buffer, &offset);
1992  CsrUint16Des((u16 *) &primitive->adHocConfig.joinOnlyAttempts, buffer, &offset);
1993  CsrUint16Des((u16 *) &primitive->adHocConfig.joinAttemptIntervalMs, buffer, &offset);
1994 
1995  return primitive;
1996 }
1997 
1998 
2000 {
2002  size_t bufferSize = 2;
2003 
2004  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 98) */
2005  bufferSize += 2; /* u16 primitive->interfaceTag */
2006  bufferSize += 2; /* CsrResult primitive->status */
2007  bufferSize += 32; /* u8 primitive->connectionInfo.ssid.ssid[32] */
2008  bufferSize += 1; /* u8 primitive->connectionInfo.ssid.length */
2009  bufferSize += 6; /* u8 primitive->connectionInfo.bssid.a[6] */
2010  bufferSize += 1; /* CsrWifiSme80211NetworkType primitive->connectionInfo.networkType80211 */
2011  bufferSize += 1; /* u8 primitive->connectionInfo.channelNumber */
2012  bufferSize += 2; /* u16 primitive->connectionInfo.channelFrequency */
2013  bufferSize += 2; /* CsrWifiSmeAuthMode primitive->connectionInfo.authMode */
2014  bufferSize += 2; /* CsrWifiSmeEncryption primitive->connectionInfo.pairwiseCipher */
2015  bufferSize += 2; /* CsrWifiSmeEncryption primitive->connectionInfo.groupCipher */
2016  bufferSize += 1; /* CsrWifiSmeRadioIF primitive->connectionInfo.ifIndex */
2017  bufferSize += 2; /* u16 primitive->connectionInfo.atimWindowTu */
2018  bufferSize += 2; /* u16 primitive->connectionInfo.beaconPeriodTu */
2019  bufferSize += 1; /* u8 primitive->connectionInfo.reassociation */
2020  bufferSize += 2; /* u16 primitive->connectionInfo.beaconFrameLength */
2021  bufferSize += primitive->connectionInfo.beaconFrameLength; /* u8 primitive->connectionInfo.beaconFrame */
2022  bufferSize += 2; /* u16 primitive->connectionInfo.associationReqFrameLength */
2023  bufferSize += primitive->connectionInfo.associationReqFrameLength; /* u8 primitive->connectionInfo.associationReqFrame */
2024  bufferSize += 2; /* u16 primitive->connectionInfo.associationRspFrameLength */
2025  bufferSize += primitive->connectionInfo.associationRspFrameLength; /* u8 primitive->connectionInfo.associationRspFrame */
2026  bufferSize += 2; /* u16 primitive->connectionInfo.assocScanInfoElementsLength */
2027  bufferSize += primitive->connectionInfo.assocScanInfoElementsLength; /* u8 primitive->connectionInfo.assocScanInfoElements */
2028  bufferSize += 2; /* u16 primitive->connectionInfo.assocReqCapabilities */
2029  bufferSize += 2; /* u16 primitive->connectionInfo.assocReqListenIntervalTu */
2030  bufferSize += 6; /* u8 primitive->connectionInfo.assocReqApAddress.a[6] */
2031  bufferSize += 2; /* u16 primitive->connectionInfo.assocReqInfoElementsLength */
2032  bufferSize += primitive->connectionInfo.assocReqInfoElementsLength; /* u8 primitive->connectionInfo.assocReqInfoElements */
2033  bufferSize += 2; /* CsrWifiSmeIEEE80211Result primitive->connectionInfo.assocRspResult */
2034  bufferSize += 2; /* u16 primitive->connectionInfo.assocRspCapabilityInfo */
2035  bufferSize += 2; /* u16 primitive->connectionInfo.assocRspAssociationId */
2036  bufferSize += 2; /* u16 primitive->connectionInfo.assocRspInfoElementsLength */
2037  bufferSize += primitive->connectionInfo.assocRspInfoElementsLength; /* u8 primitive->connectionInfo.assocRspInfoElements */
2038  bufferSize += 2; /* CsrWifiSmeIEEE80211Reason primitive->deauthReason */
2039  return bufferSize;
2040 }
2041 
2042 
2044 {
2046  *len = 0;
2047  CsrUint16Ser(ptr, len, primitive->common.type);
2048  CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag);
2049  CsrUint16Ser(ptr, len, (u16) primitive->status);
2050  CsrMemCpySer(ptr, len, (const void *) primitive->connectionInfo.ssid.ssid, ((u16) (32)));
2051  CsrUint8Ser(ptr, len, (u8) primitive->connectionInfo.ssid.length);
2052  CsrMemCpySer(ptr, len, (const void *) primitive->connectionInfo.bssid.a, ((u16) (6)));
2053  CsrUint8Ser(ptr, len, (u8) primitive->connectionInfo.networkType80211);
2054  CsrUint8Ser(ptr, len, (u8) primitive->connectionInfo.channelNumber);
2055  CsrUint16Ser(ptr, len, (u16) primitive->connectionInfo.channelFrequency);
2056  CsrUint16Ser(ptr, len, (u16) primitive->connectionInfo.authMode);
2057  CsrUint16Ser(ptr, len, (u16) primitive->connectionInfo.pairwiseCipher);
2058  CsrUint16Ser(ptr, len, (u16) primitive->connectionInfo.groupCipher);
2059  CsrUint8Ser(ptr, len, (u8) primitive->connectionInfo.ifIndex);
2060  CsrUint16Ser(ptr, len, (u16) primitive->connectionInfo.atimWindowTu);
2061  CsrUint16Ser(ptr, len, (u16) primitive->connectionInfo.beaconPeriodTu);
2062  CsrUint8Ser(ptr, len, (u8) primitive->connectionInfo.reassociation);
2063  CsrUint16Ser(ptr, len, (u16) primitive->connectionInfo.beaconFrameLength);
2064  if (primitive->connectionInfo.beaconFrameLength)
2065  {
2066  CsrMemCpySer(ptr, len, (const void *) primitive->connectionInfo.beaconFrame, ((u16) (primitive->connectionInfo.beaconFrameLength)));
2067  }
2068  CsrUint16Ser(ptr, len, (u16) primitive->connectionInfo.associationReqFrameLength);
2070  {
2071  CsrMemCpySer(ptr, len, (const void *) primitive->connectionInfo.associationReqFrame, ((u16) (primitive->connectionInfo.associationReqFrameLength)));
2072  }
2073  CsrUint16Ser(ptr, len, (u16) primitive->connectionInfo.associationRspFrameLength);
2075  {
2076  CsrMemCpySer(ptr, len, (const void *) primitive->connectionInfo.associationRspFrame, ((u16) (primitive->connectionInfo.associationRspFrameLength)));
2077  }
2080  {
2081  CsrMemCpySer(ptr, len, (const void *) primitive->connectionInfo.assocScanInfoElements, ((u16) (primitive->connectionInfo.assocScanInfoElementsLength)));
2082  }
2083  CsrUint16Ser(ptr, len, (u16) primitive->connectionInfo.assocReqCapabilities);
2084  CsrUint16Ser(ptr, len, (u16) primitive->connectionInfo.assocReqListenIntervalTu);
2085  CsrMemCpySer(ptr, len, (const void *) primitive->connectionInfo.assocReqApAddress.a, ((u16) (6)));
2088  {
2089  CsrMemCpySer(ptr, len, (const void *) primitive->connectionInfo.assocReqInfoElements, ((u16) (primitive->connectionInfo.assocReqInfoElementsLength)));
2090  }
2091  CsrUint16Ser(ptr, len, (u16) primitive->connectionInfo.assocRspResult);
2092  CsrUint16Ser(ptr, len, (u16) primitive->connectionInfo.assocRspCapabilityInfo);
2093  CsrUint16Ser(ptr, len, (u16) primitive->connectionInfo.assocRspAssociationId);
2096  {
2097  CsrMemCpySer(ptr, len, (const void *) primitive->connectionInfo.assocRspInfoElements, ((u16) (primitive->connectionInfo.assocRspInfoElementsLength)));
2098  }
2099  CsrUint16Ser(ptr, len, (u16) primitive->deauthReason);
2100  return(ptr);
2101 }
2102 
2103 
2105 {
2107  size_t offset;
2108  offset = 0;
2109 
2110  CsrUint16Des(&primitive->common.type, buffer, &offset);
2111  CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset);
2112  CsrUint16Des((u16 *) &primitive->status, buffer, &offset);
2113  CsrMemCpyDes(primitive->connectionInfo.ssid.ssid, buffer, &offset, ((u16) (32)));
2114  CsrUint8Des((u8 *) &primitive->connectionInfo.ssid.length, buffer, &offset);
2115  CsrMemCpyDes(primitive->connectionInfo.bssid.a, buffer, &offset, ((u16) (6)));
2116  CsrUint8Des((u8 *) &primitive->connectionInfo.networkType80211, buffer, &offset);
2117  CsrUint8Des((u8 *) &primitive->connectionInfo.channelNumber, buffer, &offset);
2118  CsrUint16Des((u16 *) &primitive->connectionInfo.channelFrequency, buffer, &offset);
2119  CsrUint16Des((u16 *) &primitive->connectionInfo.authMode, buffer, &offset);
2120  CsrUint16Des((u16 *) &primitive->connectionInfo.pairwiseCipher, buffer, &offset);
2121  CsrUint16Des((u16 *) &primitive->connectionInfo.groupCipher, buffer, &offset);
2122  CsrUint8Des((u8 *) &primitive->connectionInfo.ifIndex, buffer, &offset);
2123  CsrUint16Des((u16 *) &primitive->connectionInfo.atimWindowTu, buffer, &offset);
2124  CsrUint16Des((u16 *) &primitive->connectionInfo.beaconPeriodTu, buffer, &offset);
2125  CsrUint8Des((u8 *) &primitive->connectionInfo.reassociation, buffer, &offset);
2126  CsrUint16Des((u16 *) &primitive->connectionInfo.beaconFrameLength, buffer, &offset);
2127  if (primitive->connectionInfo.beaconFrameLength)
2128  {
2130  CsrMemCpyDes(primitive->connectionInfo.beaconFrame, buffer, &offset, ((u16) (primitive->connectionInfo.beaconFrameLength)));
2131  }
2132  else
2133  {
2134  primitive->connectionInfo.beaconFrame = NULL;
2135  }
2136  CsrUint16Des((u16 *) &primitive->connectionInfo.associationReqFrameLength, buffer, &offset);
2138  {
2140  CsrMemCpyDes(primitive->connectionInfo.associationReqFrame, buffer, &offset, ((u16) (primitive->connectionInfo.associationReqFrameLength)));
2141  }
2142  else
2143  {
2145  }
2146  CsrUint16Des((u16 *) &primitive->connectionInfo.associationRspFrameLength, buffer, &offset);
2148  {
2150  CsrMemCpyDes(primitive->connectionInfo.associationRspFrame, buffer, &offset, ((u16) (primitive->connectionInfo.associationRspFrameLength)));
2151  }
2152  else
2153  {
2155  }
2156  CsrUint16Des((u16 *) &primitive->connectionInfo.assocScanInfoElementsLength, buffer, &offset);
2158  {
2160  CsrMemCpyDes(primitive->connectionInfo.assocScanInfoElements, buffer, &offset, ((u16) (primitive->connectionInfo.assocScanInfoElementsLength)));
2161  }
2162  else
2163  {
2165  }
2166  CsrUint16Des((u16 *) &primitive->connectionInfo.assocReqCapabilities, buffer, &offset);
2167  CsrUint16Des((u16 *) &primitive->connectionInfo.assocReqListenIntervalTu, buffer, &offset);
2168  CsrMemCpyDes(primitive->connectionInfo.assocReqApAddress.a, buffer, &offset, ((u16) (6)));
2169  CsrUint16Des((u16 *) &primitive->connectionInfo.assocReqInfoElementsLength, buffer, &offset);
2171  {
2173  CsrMemCpyDes(primitive->connectionInfo.assocReqInfoElements, buffer, &offset, ((u16) (primitive->connectionInfo.assocReqInfoElementsLength)));
2174  }
2175  else
2176  {
2178  }
2179  CsrUint16Des((u16 *) &primitive->connectionInfo.assocRspResult, buffer, &offset);
2180  CsrUint16Des((u16 *) &primitive->connectionInfo.assocRspCapabilityInfo, buffer, &offset);
2181  CsrUint16Des((u16 *) &primitive->connectionInfo.assocRspAssociationId, buffer, &offset);
2182  CsrUint16Des((u16 *) &primitive->connectionInfo.assocRspInfoElementsLength, buffer, &offset);
2184  {
2186  CsrMemCpyDes(primitive->connectionInfo.assocRspInfoElements, buffer, &offset, ((u16) (primitive->connectionInfo.assocRspInfoElementsLength)));
2187  }
2188  else
2189  {
2191  }
2192  CsrUint16Des((u16 *) &primitive->deauthReason, buffer, &offset);
2193 
2194  return primitive;
2195 }
2196 
2197 
2198 void CsrWifiSmeAssociationCompleteIndSerFree(void *voidPrimitivePointer)
2199 {
2200  CsrWifiSmeAssociationCompleteInd *primitive = (CsrWifiSmeAssociationCompleteInd *) voidPrimitivePointer;
2201  kfree(primitive->connectionInfo.beaconFrame);
2207  kfree(primitive);
2208 }
2209 
2210 
2212 {
2213  size_t bufferSize = 2;
2214 
2215  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 44) */
2216  bufferSize += 2; /* u16 primitive->interfaceTag */
2217  bufferSize += 6; /* u8 primitive->address.a[6] */
2218  bufferSize += 32; /* u8 primitive->ssid.ssid[32] */
2219  bufferSize += 1; /* u8 primitive->ssid.length */
2220  return bufferSize;
2221 }
2222 
2223 
2225 {
2227  *len = 0;
2228  CsrUint16Ser(ptr, len, primitive->common.type);
2229  CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag);
2230  CsrMemCpySer(ptr, len, (const void *) primitive->address.a, ((u16) (6)));
2231  CsrMemCpySer(ptr, len, (const void *) primitive->ssid.ssid, ((u16) (32)));
2232  CsrUint8Ser(ptr, len, (u8) primitive->ssid.length);
2233  return(ptr);
2234 }
2235 
2236 
2238 {
2240  size_t offset;
2241  offset = 0;
2242 
2243  CsrUint16Des(&primitive->common.type, buffer, &offset);
2244  CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset);
2245  CsrMemCpyDes(primitive->address.a, buffer, &offset, ((u16) (6)));
2246  CsrMemCpyDes(primitive->ssid.ssid, buffer, &offset, ((u16) (32)));
2247  CsrUint8Des((u8 *) &primitive->ssid.length, buffer, &offset);
2248 
2249  return primitive;
2250 }
2251 
2252 
2254 {
2255  CsrWifiSmeBlacklistCfm *primitive = (CsrWifiSmeBlacklistCfm *) msg;
2256  size_t bufferSize = 2;
2257 
2258  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 15) */
2259  bufferSize += 2; /* u16 primitive->interfaceTag */
2260  bufferSize += 2; /* CsrResult primitive->status */
2261  bufferSize += 1; /* CsrWifiSmeListAction primitive->action */
2262  bufferSize += 1; /* u8 primitive->getAddressCount */
2263  {
2264  u16 i1;
2265  for (i1 = 0; i1 < primitive->getAddressCount; i1++)
2266  {
2267  bufferSize += 6; /* u8 primitive->getAddresses[i1].a[6] */
2268  }
2269  }
2270  return bufferSize;
2271 }
2272 
2273 
2274 u8* CsrWifiSmeBlacklistCfmSer(u8 *ptr, size_t *len, void *msg)
2275 {
2276  CsrWifiSmeBlacklistCfm *primitive = (CsrWifiSmeBlacklistCfm *)msg;
2277  *len = 0;
2278  CsrUint16Ser(ptr, len, primitive->common.type);
2279  CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag);
2280  CsrUint16Ser(ptr, len, (u16) primitive->status);
2281  CsrUint8Ser(ptr, len, (u8) primitive->action);
2282  CsrUint8Ser(ptr, len, (u8) primitive->getAddressCount);
2283  {
2284  u16 i1;
2285  for (i1 = 0; i1 < primitive->getAddressCount; i1++)
2286  {
2287  CsrMemCpySer(ptr, len, (const void *) primitive->getAddresses[i1].a, ((u16) (6)));
2288  }
2289  }
2290  return(ptr);
2291 }
2292 
2293 
2295 {
2297  size_t offset;
2298  offset = 0;
2299 
2300  CsrUint16Des(&primitive->common.type, buffer, &offset);
2301  CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset);
2302  CsrUint16Des((u16 *) &primitive->status, buffer, &offset);
2303  CsrUint8Des((u8 *) &primitive->action, buffer, &offset);
2304  CsrUint8Des((u8 *) &primitive->getAddressCount, buffer, &offset);
2305  primitive->getAddresses = NULL;
2306  if (primitive->getAddressCount)
2307  {
2308  primitive->getAddresses = kmalloc(sizeof(CsrWifiMacAddress) * primitive->getAddressCount, GFP_KERNEL);
2309  }
2310  {
2311  u16 i1;
2312  for (i1 = 0; i1 < primitive->getAddressCount; i1++)
2313  {
2314  CsrMemCpyDes(primitive->getAddresses[i1].a, buffer, &offset, ((u16) (6)));
2315  }
2316  }
2317 
2318  return primitive;
2319 }
2320 
2321 
2322 void CsrWifiSmeBlacklistCfmSerFree(void *voidPrimitivePointer)
2323 {
2324  CsrWifiSmeBlacklistCfm *primitive = (CsrWifiSmeBlacklistCfm *) voidPrimitivePointer;
2325  kfree(primitive->getAddresses);
2326  kfree(primitive);
2327 }
2328 
2329 
2331 {
2333  size_t bufferSize = 2;
2334 
2335  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 8) */
2336  bufferSize += 2; /* CsrResult primitive->status */
2337  bufferSize += 2; /* u16 primitive->calibrationDataLength */
2338  bufferSize += primitive->calibrationDataLength; /* u8 primitive->calibrationData */
2339  return bufferSize;
2340 }
2341 
2342 
2344 {
2346  *len = 0;
2347  CsrUint16Ser(ptr, len, primitive->common.type);
2348  CsrUint16Ser(ptr, len, (u16) primitive->status);
2349  CsrUint16Ser(ptr, len, (u16) primitive->calibrationDataLength);
2350  if (primitive->calibrationDataLength)
2351  {
2352  CsrMemCpySer(ptr, len, (const void *) primitive->calibrationData, ((u16) (primitive->calibrationDataLength)));
2353  }
2354  return(ptr);
2355 }
2356 
2357 
2359 {
2361  size_t offset;
2362  offset = 0;
2363 
2364  CsrUint16Des(&primitive->common.type, buffer, &offset);
2365  CsrUint16Des((u16 *) &primitive->status, buffer, &offset);
2366  CsrUint16Des((u16 *) &primitive->calibrationDataLength, buffer, &offset);
2367  if (primitive->calibrationDataLength)
2368  {
2369  primitive->calibrationData = kmalloc(primitive->calibrationDataLength, GFP_KERNEL);
2370  CsrMemCpyDes(primitive->calibrationData, buffer, &offset, ((u16) (primitive->calibrationDataLength)));
2371  }
2372  else
2373  {
2374  primitive->calibrationData = NULL;
2375  }
2376 
2377  return primitive;
2378 }
2379 
2380 
2381 void CsrWifiSmeCalibrationDataGetCfmSerFree(void *voidPrimitivePointer)
2382 {
2383  CsrWifiSmeCalibrationDataGetCfm *primitive = (CsrWifiSmeCalibrationDataGetCfm *) voidPrimitivePointer;
2384  kfree(primitive->calibrationData);
2385  kfree(primitive);
2386 }
2387 
2388 
2390 {
2391  size_t bufferSize = 2;
2392 
2393  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 11) */
2394  bufferSize += 2; /* u16 primitive->interfaceTag */
2395  bufferSize += 2; /* CsrResult primitive->status */
2396  bufferSize += 1; /* u8 primitive->ccxConfig.keepAliveTimeMs */
2397  bufferSize += 1; /* u8 primitive->ccxConfig.apRoamingEnabled */
2398  bufferSize += 1; /* u8 primitive->ccxConfig.measurementsMask */
2399  bufferSize += 1; /* u8 primitive->ccxConfig.ccxRadioMgtEnabled */
2400  return bufferSize;
2401 }
2402 
2403 
2404 u8* CsrWifiSmeCcxConfigGetCfmSer(u8 *ptr, size_t *len, void *msg)
2405 {
2407  *len = 0;
2408  CsrUint16Ser(ptr, len, primitive->common.type);
2409  CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag);
2410  CsrUint16Ser(ptr, len, (u16) primitive->status);
2411  CsrUint8Ser(ptr, len, (u8) primitive->ccxConfig.keepAliveTimeMs);
2412  CsrUint8Ser(ptr, len, (u8) primitive->ccxConfig.apRoamingEnabled);
2413  CsrUint8Ser(ptr, len, (u8) primitive->ccxConfig.measurementsMask);
2414  CsrUint8Ser(ptr, len, (u8) primitive->ccxConfig.ccxRadioMgtEnabled);
2415  return(ptr);
2416 }
2417 
2418 
2420 {
2422  size_t offset;
2423  offset = 0;
2424 
2425  CsrUint16Des(&primitive->common.type, buffer, &offset);
2426  CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset);
2427  CsrUint16Des((u16 *) &primitive->status, buffer, &offset);
2428  CsrUint8Des((u8 *) &primitive->ccxConfig.keepAliveTimeMs, buffer, &offset);
2429  CsrUint8Des((u8 *) &primitive->ccxConfig.apRoamingEnabled, buffer, &offset);
2430  CsrUint8Des((u8 *) &primitive->ccxConfig.measurementsMask, buffer, &offset);
2431  CsrUint8Des((u8 *) &primitive->ccxConfig.ccxRadioMgtEnabled, buffer, &offset);
2432 
2433  return primitive;
2434 }
2435 
2436 
2438 {
2439  size_t bufferSize = 2;
2440 
2441  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 7) */
2442  bufferSize += 2; /* u16 primitive->interfaceTag */
2443  bufferSize += 2; /* CsrResult primitive->status */
2444  return bufferSize;
2445 }
2446 
2447 
2448 u8* CsrWifiSmeCcxConfigSetCfmSer(u8 *ptr, size_t *len, void *msg)
2449 {
2451  *len = 0;
2452  CsrUint16Ser(ptr, len, primitive->common.type);
2453  CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag);
2454  CsrUint16Ser(ptr, len, (u16) primitive->status);
2455  return(ptr);
2456 }
2457 
2458 
2460 {
2462  size_t offset;
2463  offset = 0;
2464 
2465  CsrUint16Des(&primitive->common.type, buffer, &offset);
2466  CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset);
2467  CsrUint16Des((u16 *) &primitive->status, buffer, &offset);
2468 
2469  return primitive;
2470 }
2471 
2472 
2474 {
2475  size_t bufferSize = 2;
2476 
2477  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 31) */
2478  bufferSize += 2; /* CsrResult primitive->status */
2479  bufferSize += 1; /* u8 primitive->coexConfig.coexEnableSchemeManagement */
2480  bufferSize += 1; /* u8 primitive->coexConfig.coexPeriodicWakeHost */
2481  bufferSize += 2; /* u16 primitive->coexConfig.coexTrafficBurstyLatencyMs */
2482  bufferSize += 2; /* u16 primitive->coexConfig.coexTrafficContinuousLatencyMs */
2483  bufferSize += 2; /* u16 primitive->coexConfig.coexObexBlackoutDurationMs */
2484  bufferSize += 2; /* u16 primitive->coexConfig.coexObexBlackoutPeriodMs */
2485  bufferSize += 2; /* u16 primitive->coexConfig.coexA2dpBrBlackoutDurationMs */
2486  bufferSize += 2; /* u16 primitive->coexConfig.coexA2dpBrBlackoutPeriodMs */
2487  bufferSize += 2; /* u16 primitive->coexConfig.coexA2dpEdrBlackoutDurationMs */
2488  bufferSize += 2; /* u16 primitive->coexConfig.coexA2dpEdrBlackoutPeriodMs */
2489  bufferSize += 2; /* u16 primitive->coexConfig.coexPagingBlackoutDurationMs */
2490  bufferSize += 2; /* u16 primitive->coexConfig.coexPagingBlackoutPeriodMs */
2491  bufferSize += 2; /* u16 primitive->coexConfig.coexInquiryBlackoutDurationMs */
2492  bufferSize += 2; /* u16 primitive->coexConfig.coexInquiryBlackoutPeriodMs */
2493  return bufferSize;
2494 }
2495 
2496 
2498 {
2500  *len = 0;
2501  CsrUint16Ser(ptr, len, primitive->common.type);
2502  CsrUint16Ser(ptr, len, (u16) primitive->status);
2503  CsrUint8Ser(ptr, len, (u8) primitive->coexConfig.coexEnableSchemeManagement);
2504  CsrUint8Ser(ptr, len, (u8) primitive->coexConfig.coexPeriodicWakeHost);
2505  CsrUint16Ser(ptr, len, (u16) primitive->coexConfig.coexTrafficBurstyLatencyMs);
2507  CsrUint16Ser(ptr, len, (u16) primitive->coexConfig.coexObexBlackoutDurationMs);
2508  CsrUint16Ser(ptr, len, (u16) primitive->coexConfig.coexObexBlackoutPeriodMs);
2509  CsrUint16Ser(ptr, len, (u16) primitive->coexConfig.coexA2dpBrBlackoutDurationMs);
2510  CsrUint16Ser(ptr, len, (u16) primitive->coexConfig.coexA2dpBrBlackoutPeriodMs);
2511  CsrUint16Ser(ptr, len, (u16) primitive->coexConfig.coexA2dpEdrBlackoutDurationMs);
2512  CsrUint16Ser(ptr, len, (u16) primitive->coexConfig.coexA2dpEdrBlackoutPeriodMs);
2513  CsrUint16Ser(ptr, len, (u16) primitive->coexConfig.coexPagingBlackoutDurationMs);
2514  CsrUint16Ser(ptr, len, (u16) primitive->coexConfig.coexPagingBlackoutPeriodMs);
2515  CsrUint16Ser(ptr, len, (u16) primitive->coexConfig.coexInquiryBlackoutDurationMs);
2516  CsrUint16Ser(ptr, len, (u16) primitive->coexConfig.coexInquiryBlackoutPeriodMs);
2517  return(ptr);
2518 }
2519 
2520 
2522 {
2524  size_t offset;
2525  offset = 0;
2526 
2527  CsrUint16Des(&primitive->common.type, buffer, &offset);
2528  CsrUint16Des((u16 *) &primitive->status, buffer, &offset);
2529  CsrUint8Des((u8 *) &primitive->coexConfig.coexEnableSchemeManagement, buffer, &offset);
2530  CsrUint8Des((u8 *) &primitive->coexConfig.coexPeriodicWakeHost, buffer, &offset);
2531  CsrUint16Des((u16 *) &primitive->coexConfig.coexTrafficBurstyLatencyMs, buffer, &offset);
2532  CsrUint16Des((u16 *) &primitive->coexConfig.coexTrafficContinuousLatencyMs, buffer, &offset);
2533  CsrUint16Des((u16 *) &primitive->coexConfig.coexObexBlackoutDurationMs, buffer, &offset);
2534  CsrUint16Des((u16 *) &primitive->coexConfig.coexObexBlackoutPeriodMs, buffer, &offset);
2535  CsrUint16Des((u16 *) &primitive->coexConfig.coexA2dpBrBlackoutDurationMs, buffer, &offset);
2536  CsrUint16Des((u16 *) &primitive->coexConfig.coexA2dpBrBlackoutPeriodMs, buffer, &offset);
2537  CsrUint16Des((u16 *) &primitive->coexConfig.coexA2dpEdrBlackoutDurationMs, buffer, &offset);
2538  CsrUint16Des((u16 *) &primitive->coexConfig.coexA2dpEdrBlackoutPeriodMs, buffer, &offset);
2539  CsrUint16Des((u16 *) &primitive->coexConfig.coexPagingBlackoutDurationMs, buffer, &offset);
2540  CsrUint16Des((u16 *) &primitive->coexConfig.coexPagingBlackoutPeriodMs, buffer, &offset);
2541  CsrUint16Des((u16 *) &primitive->coexConfig.coexInquiryBlackoutDurationMs, buffer, &offset);
2542  CsrUint16Des((u16 *) &primitive->coexConfig.coexInquiryBlackoutPeriodMs, buffer, &offset);
2543 
2544  return primitive;
2545 }
2546 
2547 
2549 {
2550  size_t bufferSize = 2;
2551 
2552  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 24) */
2553  bufferSize += 2; /* CsrResult primitive->status */
2554  bufferSize += 1; /* u8 primitive->coexInfo.hasTrafficData */
2555  bufferSize += 1; /* CsrWifiSmeTrafficType primitive->coexInfo.currentTrafficType */
2556  bufferSize += 2; /* u16 primitive->coexInfo.currentPeriodMs */
2557  bufferSize += 1; /* CsrWifiSmePowerSaveLevel primitive->coexInfo.currentPowerSave */
2558  bufferSize += 2; /* u16 primitive->coexInfo.currentCoexPeriodMs */
2559  bufferSize += 2; /* u16 primitive->coexInfo.currentCoexLatencyMs */
2560  bufferSize += 1; /* u8 primitive->coexInfo.hasBtDevice */
2561  bufferSize += 4; /* u32 primitive->coexInfo.currentBlackoutDurationUs */
2562  bufferSize += 4; /* u32 primitive->coexInfo.currentBlackoutPeriodUs */
2563  bufferSize += 1; /* CsrWifiSmeCoexScheme primitive->coexInfo.currentCoexScheme */
2564  return bufferSize;
2565 }
2566 
2567 
2568 u8* CsrWifiSmeCoexInfoGetCfmSer(u8 *ptr, size_t *len, void *msg)
2569 {
2571  *len = 0;
2572  CsrUint16Ser(ptr, len, primitive->common.type);
2573  CsrUint16Ser(ptr, len, (u16) primitive->status);
2574  CsrUint8Ser(ptr, len, (u8) primitive->coexInfo.hasTrafficData);
2575  CsrUint8Ser(ptr, len, (u8) primitive->coexInfo.currentTrafficType);
2576  CsrUint16Ser(ptr, len, (u16) primitive->coexInfo.currentPeriodMs);
2577  CsrUint8Ser(ptr, len, (u8) primitive->coexInfo.currentPowerSave);
2578  CsrUint16Ser(ptr, len, (u16) primitive->coexInfo.currentCoexPeriodMs);
2579  CsrUint16Ser(ptr, len, (u16) primitive->coexInfo.currentCoexLatencyMs);
2580  CsrUint8Ser(ptr, len, (u8) primitive->coexInfo.hasBtDevice);
2581  CsrUint32Ser(ptr, len, (u32) primitive->coexInfo.currentBlackoutDurationUs);
2582  CsrUint32Ser(ptr, len, (u32) primitive->coexInfo.currentBlackoutPeriodUs);
2583  CsrUint8Ser(ptr, len, (u8) primitive->coexInfo.currentCoexScheme);
2584  return(ptr);
2585 }
2586 
2587 
2589 {
2591  size_t offset;
2592  offset = 0;
2593 
2594  CsrUint16Des(&primitive->common.type, buffer, &offset);
2595  CsrUint16Des((u16 *) &primitive->status, buffer, &offset);
2596  CsrUint8Des((u8 *) &primitive->coexInfo.hasTrafficData, buffer, &offset);
2597  CsrUint8Des((u8 *) &primitive->coexInfo.currentTrafficType, buffer, &offset);
2598  CsrUint16Des((u16 *) &primitive->coexInfo.currentPeriodMs, buffer, &offset);
2599  CsrUint8Des((u8 *) &primitive->coexInfo.currentPowerSave, buffer, &offset);
2600  CsrUint16Des((u16 *) &primitive->coexInfo.currentCoexPeriodMs, buffer, &offset);
2601  CsrUint16Des((u16 *) &primitive->coexInfo.currentCoexLatencyMs, buffer, &offset);
2602  CsrUint8Des((u8 *) &primitive->coexInfo.hasBtDevice, buffer, &offset);
2603  CsrUint32Des((u32 *) &primitive->coexInfo.currentBlackoutDurationUs, buffer, &offset);
2604  CsrUint32Des((u32 *) &primitive->coexInfo.currentBlackoutPeriodUs, buffer, &offset);
2605  CsrUint8Des((u8 *) &primitive->coexInfo.currentCoexScheme, buffer, &offset);
2606 
2607  return primitive;
2608 }
2609 
2610 
2612 {
2613  size_t bufferSize = 2;
2614 
2615  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 7) */
2616  bufferSize += 2; /* u16 primitive->interfaceTag */
2617  bufferSize += 2; /* CsrResult primitive->status */
2618  return bufferSize;
2619 }
2620 
2621 
2622 u8* CsrWifiSmeConnectCfmSer(u8 *ptr, size_t *len, void *msg)
2623 {
2624  CsrWifiSmeConnectCfm *primitive = (CsrWifiSmeConnectCfm *)msg;
2625  *len = 0;
2626  CsrUint16Ser(ptr, len, primitive->common.type);
2627  CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag);
2628  CsrUint16Ser(ptr, len, (u16) primitive->status);
2629  return(ptr);
2630 }
2631 
2632 
2634 {
2636  size_t offset;
2637  offset = 0;
2638 
2639  CsrUint16Des(&primitive->common.type, buffer, &offset);
2640  CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset);
2641  CsrUint16Des((u16 *) &primitive->status, buffer, &offset);
2642 
2643  return primitive;
2644 }
2645 
2646 
2648 {
2650  size_t bufferSize = 2;
2651 
2652  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 59) */
2653  bufferSize += 2; /* u16 primitive->interfaceTag */
2654  bufferSize += 2; /* CsrResult primitive->status */
2655  bufferSize += 32; /* u8 primitive->connectionConfig.ssid.ssid[32] */
2656  bufferSize += 1; /* u8 primitive->connectionConfig.ssid.length */
2657  bufferSize += 6; /* u8 primitive->connectionConfig.bssid.a[6] */
2658  bufferSize += 1; /* CsrWifiSmeBssType primitive->connectionConfig.bssType */
2659  bufferSize += 1; /* CsrWifiSmeRadioIF primitive->connectionConfig.ifIndex */
2660  bufferSize += 1; /* CsrWifiSme80211PrivacyMode primitive->connectionConfig.privacyMode */
2661  bufferSize += 2; /* CsrWifiSmeAuthModeMask primitive->connectionConfig.authModeMask */
2662  bufferSize += 2; /* CsrWifiSmeEncryptionMask primitive->connectionConfig.encryptionModeMask */
2663  bufferSize += 2; /* u16 primitive->connectionConfig.mlmeAssociateReqInformationElementsLength */
2664  bufferSize += primitive->connectionConfig.mlmeAssociateReqInformationElementsLength; /* u8 primitive->connectionConfig.mlmeAssociateReqInformationElements */
2665  bufferSize += 1; /* CsrWifiSmeWmmQosInfoMask primitive->connectionConfig.wmmQosInfo */
2666  bufferSize += 1; /* u8 primitive->connectionConfig.adhocJoinOnly */
2667  bufferSize += 1; /* u8 primitive->connectionConfig.adhocChannel */
2668  return bufferSize;
2669 }
2670 
2671 
2673 {
2675  *len = 0;
2676  CsrUint16Ser(ptr, len, primitive->common.type);
2677  CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag);
2678  CsrUint16Ser(ptr, len, (u16) primitive->status);
2679  CsrMemCpySer(ptr, len, (const void *) primitive->connectionConfig.ssid.ssid, ((u16) (32)));
2680  CsrUint8Ser(ptr, len, (u8) primitive->connectionConfig.ssid.length);
2681  CsrMemCpySer(ptr, len, (const void *) primitive->connectionConfig.bssid.a, ((u16) (6)));
2682  CsrUint8Ser(ptr, len, (u8) primitive->connectionConfig.bssType);
2683  CsrUint8Ser(ptr, len, (u8) primitive->connectionConfig.ifIndex);
2684  CsrUint8Ser(ptr, len, (u8) primitive->connectionConfig.privacyMode);
2685  CsrUint16Ser(ptr, len, (u16) primitive->connectionConfig.authModeMask);
2686  CsrUint16Ser(ptr, len, (u16) primitive->connectionConfig.encryptionModeMask);
2689  {
2691  }
2692  CsrUint8Ser(ptr, len, (u8) primitive->connectionConfig.wmmQosInfo);
2693  CsrUint8Ser(ptr, len, (u8) primitive->connectionConfig.adhocJoinOnly);
2694  CsrUint8Ser(ptr, len, (u8) primitive->connectionConfig.adhocChannel);
2695  return(ptr);
2696 }
2697 
2698 
2700 {
2702  size_t offset;
2703  offset = 0;
2704 
2705  CsrUint16Des(&primitive->common.type, buffer, &offset);
2706  CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset);
2707  CsrUint16Des((u16 *) &primitive->status, buffer, &offset);
2708  CsrMemCpyDes(primitive->connectionConfig.ssid.ssid, buffer, &offset, ((u16) (32)));
2709  CsrUint8Des((u8 *) &primitive->connectionConfig.ssid.length, buffer, &offset);
2710  CsrMemCpyDes(primitive->connectionConfig.bssid.a, buffer, &offset, ((u16) (6)));
2711  CsrUint8Des((u8 *) &primitive->connectionConfig.bssType, buffer, &offset);
2712  CsrUint8Des((u8 *) &primitive->connectionConfig.ifIndex, buffer, &offset);
2713  CsrUint8Des((u8 *) &primitive->connectionConfig.privacyMode, buffer, &offset);
2714  CsrUint16Des((u16 *) &primitive->connectionConfig.authModeMask, buffer, &offset);
2715  CsrUint16Des((u16 *) &primitive->connectionConfig.encryptionModeMask, buffer, &offset);
2718  {
2721  }
2722  else
2723  {
2725  }
2726  CsrUint8Des((u8 *) &primitive->connectionConfig.wmmQosInfo, buffer, &offset);
2727  CsrUint8Des((u8 *) &primitive->connectionConfig.adhocJoinOnly, buffer, &offset);
2728  CsrUint8Des((u8 *) &primitive->connectionConfig.adhocChannel, buffer, &offset);
2729 
2730  return primitive;
2731 }
2732 
2733 
2734 void CsrWifiSmeConnectionConfigGetCfmSerFree(void *voidPrimitivePointer)
2735 {
2736  CsrWifiSmeConnectionConfigGetCfm *primitive = (CsrWifiSmeConnectionConfigGetCfm *) voidPrimitivePointer;
2738  kfree(primitive);
2739 }
2740 
2741 
2743 {
2745  size_t bufferSize = 2;
2746 
2747  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 96) */
2748  bufferSize += 2; /* u16 primitive->interfaceTag */
2749  bufferSize += 2; /* CsrResult primitive->status */
2750  bufferSize += 32; /* u8 primitive->connectionInfo.ssid.ssid[32] */
2751  bufferSize += 1; /* u8 primitive->connectionInfo.ssid.length */
2752  bufferSize += 6; /* u8 primitive->connectionInfo.bssid.a[6] */
2753  bufferSize += 1; /* CsrWifiSme80211NetworkType primitive->connectionInfo.networkType80211 */
2754  bufferSize += 1; /* u8 primitive->connectionInfo.channelNumber */
2755  bufferSize += 2; /* u16 primitive->connectionInfo.channelFrequency */
2756  bufferSize += 2; /* CsrWifiSmeAuthMode primitive->connectionInfo.authMode */
2757  bufferSize += 2; /* CsrWifiSmeEncryption primitive->connectionInfo.pairwiseCipher */
2758  bufferSize += 2; /* CsrWifiSmeEncryption primitive->connectionInfo.groupCipher */
2759  bufferSize += 1; /* CsrWifiSmeRadioIF primitive->connectionInfo.ifIndex */
2760  bufferSize += 2; /* u16 primitive->connectionInfo.atimWindowTu */
2761  bufferSize += 2; /* u16 primitive->connectionInfo.beaconPeriodTu */
2762  bufferSize += 1; /* u8 primitive->connectionInfo.reassociation */
2763  bufferSize += 2; /* u16 primitive->connectionInfo.beaconFrameLength */
2764  bufferSize += primitive->connectionInfo.beaconFrameLength; /* u8 primitive->connectionInfo.beaconFrame */
2765  bufferSize += 2; /* u16 primitive->connectionInfo.associationReqFrameLength */
2766  bufferSize += primitive->connectionInfo.associationReqFrameLength; /* u8 primitive->connectionInfo.associationReqFrame */
2767  bufferSize += 2; /* u16 primitive->connectionInfo.associationRspFrameLength */
2768  bufferSize += primitive->connectionInfo.associationRspFrameLength; /* u8 primitive->connectionInfo.associationRspFrame */
2769  bufferSize += 2; /* u16 primitive->connectionInfo.assocScanInfoElementsLength */
2770  bufferSize += primitive->connectionInfo.assocScanInfoElementsLength; /* u8 primitive->connectionInfo.assocScanInfoElements */
2771  bufferSize += 2; /* u16 primitive->connectionInfo.assocReqCapabilities */
2772  bufferSize += 2; /* u16 primitive->connectionInfo.assocReqListenIntervalTu */
2773  bufferSize += 6; /* u8 primitive->connectionInfo.assocReqApAddress.a[6] */
2774  bufferSize += 2; /* u16 primitive->connectionInfo.assocReqInfoElementsLength */
2775  bufferSize += primitive->connectionInfo.assocReqInfoElementsLength; /* u8 primitive->connectionInfo.assocReqInfoElements */
2776  bufferSize += 2; /* CsrWifiSmeIEEE80211Result primitive->connectionInfo.assocRspResult */
2777  bufferSize += 2; /* u16 primitive->connectionInfo.assocRspCapabilityInfo */
2778  bufferSize += 2; /* u16 primitive->connectionInfo.assocRspAssociationId */
2779  bufferSize += 2; /* u16 primitive->connectionInfo.assocRspInfoElementsLength */
2780  bufferSize += primitive->connectionInfo.assocRspInfoElementsLength; /* u8 primitive->connectionInfo.assocRspInfoElements */
2781  return bufferSize;
2782 }
2783 
2784 
2786 {
2788  *len = 0;
2789  CsrUint16Ser(ptr, len, primitive->common.type);
2790  CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag);
2791  CsrUint16Ser(ptr, len, (u16) primitive->status);
2792  CsrMemCpySer(ptr, len, (const void *) primitive->connectionInfo.ssid.ssid, ((u16) (32)));
2793  CsrUint8Ser(ptr, len, (u8) primitive->connectionInfo.ssid.length);
2794  CsrMemCpySer(ptr, len, (const void *) primitive->connectionInfo.bssid.a, ((u16) (6)));
2795  CsrUint8Ser(ptr, len, (u8) primitive->connectionInfo.networkType80211);
2796  CsrUint8Ser(ptr, len, (u8) primitive->connectionInfo.channelNumber);
2797  CsrUint16Ser(ptr, len, (u16) primitive->connectionInfo.channelFrequency);
2798  CsrUint16Ser(ptr, len, (u16) primitive->connectionInfo.authMode);
2799  CsrUint16Ser(ptr, len, (u16) primitive->connectionInfo.pairwiseCipher);
2800  CsrUint16Ser(ptr, len, (u16) primitive->connectionInfo.groupCipher);
2801  CsrUint8Ser(ptr, len, (u8) primitive->connectionInfo.ifIndex);
2802  CsrUint16Ser(ptr, len, (u16) primitive->connectionInfo.atimWindowTu);
2803  CsrUint16Ser(ptr, len, (u16) primitive->connectionInfo.beaconPeriodTu);
2804  CsrUint8Ser(ptr, len, (u8) primitive->connectionInfo.reassociation);
2805  CsrUint16Ser(ptr, len, (u16) primitive->connectionInfo.beaconFrameLength);
2806  if (primitive->connectionInfo.beaconFrameLength)
2807  {
2808  CsrMemCpySer(ptr, len, (const void *) primitive->connectionInfo.beaconFrame, ((u16) (primitive->connectionInfo.beaconFrameLength)));
2809  }
2810  CsrUint16Ser(ptr, len, (u16) primitive->connectionInfo.associationReqFrameLength);
2812  {
2813  CsrMemCpySer(ptr, len, (const void *) primitive->connectionInfo.associationReqFrame, ((u16) (primitive->connectionInfo.associationReqFrameLength)));
2814  }
2815  CsrUint16Ser(ptr, len, (u16) primitive->connectionInfo.associationRspFrameLength);
2817  {
2818  CsrMemCpySer(ptr, len, (const void *) primitive->connectionInfo.associationRspFrame, ((u16) (primitive->connectionInfo.associationRspFrameLength)));
2819  }
2822  {
2823  CsrMemCpySer(ptr, len, (const void *) primitive->connectionInfo.assocScanInfoElements, ((u16) (primitive->connectionInfo.assocScanInfoElementsLength)));
2824  }
2825  CsrUint16Ser(ptr, len, (u16) primitive->connectionInfo.assocReqCapabilities);
2826  CsrUint16Ser(ptr, len, (u16) primitive->connectionInfo.assocReqListenIntervalTu);
2827  CsrMemCpySer(ptr, len, (const void *) primitive->connectionInfo.assocReqApAddress.a, ((u16) (6)));
2830  {
2831  CsrMemCpySer(ptr, len, (const void *) primitive->connectionInfo.assocReqInfoElements, ((u16) (primitive->connectionInfo.assocReqInfoElementsLength)));
2832  }
2833  CsrUint16Ser(ptr, len, (u16) primitive->connectionInfo.assocRspResult);
2834  CsrUint16Ser(ptr, len, (u16) primitive->connectionInfo.assocRspCapabilityInfo);
2835  CsrUint16Ser(ptr, len, (u16) primitive->connectionInfo.assocRspAssociationId);
2838  {
2839  CsrMemCpySer(ptr, len, (const void *) primitive->connectionInfo.assocRspInfoElements, ((u16) (primitive->connectionInfo.assocRspInfoElementsLength)));
2840  }
2841  return(ptr);
2842 }
2843 
2844 
2846 {
2848  size_t offset;
2849  offset = 0;
2850 
2851  CsrUint16Des(&primitive->common.type, buffer, &offset);
2852  CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset);
2853  CsrUint16Des((u16 *) &primitive->status, buffer, &offset);
2854  CsrMemCpyDes(primitive->connectionInfo.ssid.ssid, buffer, &offset, ((u16) (32)));
2855  CsrUint8Des((u8 *) &primitive->connectionInfo.ssid.length, buffer, &offset);
2856  CsrMemCpyDes(primitive->connectionInfo.bssid.a, buffer, &offset, ((u16) (6)));
2857  CsrUint8Des((u8 *) &primitive->connectionInfo.networkType80211, buffer, &offset);
2858  CsrUint8Des((u8 *) &primitive->connectionInfo.channelNumber, buffer, &offset);
2859  CsrUint16Des((u16 *) &primitive->connectionInfo.channelFrequency, buffer, &offset);
2860  CsrUint16Des((u16 *) &primitive->connectionInfo.authMode, buffer, &offset);
2861  CsrUint16Des((u16 *) &primitive->connectionInfo.pairwiseCipher, buffer, &offset);
2862  CsrUint16Des((u16 *) &primitive->connectionInfo.groupCipher, buffer, &offset);
2863  CsrUint8Des((u8 *) &primitive->connectionInfo.ifIndex, buffer, &offset);
2864  CsrUint16Des((u16 *) &primitive->connectionInfo.atimWindowTu, buffer, &offset);
2865  CsrUint16Des((u16 *) &primitive->connectionInfo.beaconPeriodTu, buffer, &offset);
2866  CsrUint8Des((u8 *) &primitive->connectionInfo.reassociation, buffer, &offset);
2867  CsrUint16Des((u16 *) &primitive->connectionInfo.beaconFrameLength, buffer, &offset);
2868  if (primitive->connectionInfo.beaconFrameLength)
2869  {
2871  CsrMemCpyDes(primitive->connectionInfo.beaconFrame, buffer, &offset, ((u16) (primitive->connectionInfo.beaconFrameLength)));
2872  }
2873  else
2874  {
2875  primitive->connectionInfo.beaconFrame = NULL;
2876  }
2877  CsrUint16Des((u16 *) &primitive->connectionInfo.associationReqFrameLength, buffer, &offset);
2879  {
2881  CsrMemCpyDes(primitive->connectionInfo.associationReqFrame, buffer, &offset, ((u16) (primitive->connectionInfo.associationReqFrameLength)));
2882  }
2883  else
2884  {
2886  }
2887  CsrUint16Des((u16 *) &primitive->connectionInfo.associationRspFrameLength, buffer, &offset);
2889  {
2891  CsrMemCpyDes(primitive->connectionInfo.associationRspFrame, buffer, &offset, ((u16) (primitive->connectionInfo.associationRspFrameLength)));
2892  }
2893  else
2894  {
2896  }
2897  CsrUint16Des((u16 *) &primitive->connectionInfo.assocScanInfoElementsLength, buffer, &offset);
2899  {
2901  CsrMemCpyDes(primitive->connectionInfo.assocScanInfoElements, buffer, &offset, ((u16) (primitive->connectionInfo.assocScanInfoElementsLength)));
2902  }
2903  else
2904  {
2906  }
2907  CsrUint16Des((u16 *) &primitive->connectionInfo.assocReqCapabilities, buffer, &offset);
2908  CsrUint16Des((u16 *) &primitive->connectionInfo.assocReqListenIntervalTu, buffer, &offset);
2909  CsrMemCpyDes(primitive->connectionInfo.assocReqApAddress.a, buffer, &offset, ((u16) (6)));
2910  CsrUint16Des((u16 *) &primitive->connectionInfo.assocReqInfoElementsLength, buffer, &offset);
2912  {
2914  CsrMemCpyDes(primitive->connectionInfo.assocReqInfoElements, buffer, &offset, ((u16) (primitive->connectionInfo.assocReqInfoElementsLength)));
2915  }
2916  else
2917  {
2919  }
2920  CsrUint16Des((u16 *) &primitive->connectionInfo.assocRspResult, buffer, &offset);
2921  CsrUint16Des((u16 *) &primitive->connectionInfo.assocRspCapabilityInfo, buffer, &offset);
2922  CsrUint16Des((u16 *) &primitive->connectionInfo.assocRspAssociationId, buffer, &offset);
2923  CsrUint16Des((u16 *) &primitive->connectionInfo.assocRspInfoElementsLength, buffer, &offset);
2925  {
2927  CsrMemCpyDes(primitive->connectionInfo.assocRspInfoElements, buffer, &offset, ((u16) (primitive->connectionInfo.assocRspInfoElementsLength)));
2928  }
2929  else
2930  {
2932  }
2933 
2934  return primitive;
2935 }
2936 
2937 
2938 void CsrWifiSmeConnectionInfoGetCfmSerFree(void *voidPrimitivePointer)
2939 {
2940  CsrWifiSmeConnectionInfoGetCfm *primitive = (CsrWifiSmeConnectionInfoGetCfm *) voidPrimitivePointer;
2941  kfree(primitive->connectionInfo.beaconFrame);
2947  kfree(primitive);
2948 }
2949 
2950 
2952 {
2953  size_t bufferSize = 2;
2954 
2955  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 9) */
2956  bufferSize += 2; /* u16 primitive->interfaceTag */
2957  bufferSize += 2; /* s16 primitive->linkQuality.unifiRssi */
2958  bufferSize += 2; /* s16 primitive->linkQuality.unifiSnr */
2959  return bufferSize;
2960 }
2961 
2962 
2964 {
2966  *len = 0;
2967  CsrUint16Ser(ptr, len, primitive->common.type);
2968  CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag);
2969  CsrUint16Ser(ptr, len, (u16) primitive->linkQuality.unifiRssi);
2970  CsrUint16Ser(ptr, len, (u16) primitive->linkQuality.unifiSnr);
2971  return(ptr);
2972 }
2973 
2974 
2976 {
2978  size_t offset;
2979  offset = 0;
2980 
2981  CsrUint16Des(&primitive->common.type, buffer, &offset);
2982  CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset);
2983  CsrUint16Des((u16 *) &primitive->linkQuality.unifiRssi, buffer, &offset);
2984  CsrUint16Des((u16 *) &primitive->linkQuality.unifiSnr, buffer, &offset);
2985 
2986  return primitive;
2987 }
2988 
2989 
2991 {
2992  size_t bufferSize = 2;
2993 
2994  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 101) */
2995  bufferSize += 2; /* u16 primitive->interfaceTag */
2996  bufferSize += 2; /* CsrResult primitive->status */
2997  bufferSize += 1; /* u8 primitive->connectionStats.unifiTxDataRate */
2998  bufferSize += 1; /* u8 primitive->connectionStats.unifiRxDataRate */
2999  bufferSize += 4; /* u32 primitive->connectionStats.dot11RetryCount */
3000  bufferSize += 4; /* u32 primitive->connectionStats.dot11MultipleRetryCount */
3001  bufferSize += 4; /* u32 primitive->connectionStats.dot11AckFailureCount */
3002  bufferSize += 4; /* u32 primitive->connectionStats.dot11FrameDuplicateCount */
3003  bufferSize += 4; /* u32 primitive->connectionStats.dot11FcsErrorCount */
3004  bufferSize += 4; /* u32 primitive->connectionStats.dot11RtsSuccessCount */
3005  bufferSize += 4; /* u32 primitive->connectionStats.dot11RtsFailureCount */
3006  bufferSize += 4; /* u32 primitive->connectionStats.dot11FailedCount */
3007  bufferSize += 4; /* u32 primitive->connectionStats.dot11TransmittedFragmentCount */
3008  bufferSize += 4; /* u32 primitive->connectionStats.dot11TransmittedFrameCount */
3009  bufferSize += 4; /* u32 primitive->connectionStats.dot11WepExcludedCount */
3010  bufferSize += 4; /* u32 primitive->connectionStats.dot11WepIcvErrorCount */
3011  bufferSize += 4; /* u32 primitive->connectionStats.dot11WepUndecryptableCount */
3012  bufferSize += 4; /* u32 primitive->connectionStats.dot11MulticastReceivedFrameCount */
3013  bufferSize += 4; /* u32 primitive->connectionStats.dot11MulticastTransmittedFrameCount */
3014  bufferSize += 4; /* u32 primitive->connectionStats.dot11ReceivedFragmentCount */
3015  bufferSize += 4; /* u32 primitive->connectionStats.dot11Rsna4WayHandshakeFailures */
3016  bufferSize += 4; /* u32 primitive->connectionStats.dot11RsnaTkipCounterMeasuresInvoked */
3017  bufferSize += 4; /* u32 primitive->connectionStats.dot11RsnaStatsTkipLocalMicFailures */
3018  bufferSize += 4; /* u32 primitive->connectionStats.dot11RsnaStatsTkipReplays */
3019  bufferSize += 4; /* u32 primitive->connectionStats.dot11RsnaStatsTkipIcvErrors */
3020  bufferSize += 4; /* u32 primitive->connectionStats.dot11RsnaStatsCcmpReplays */
3021  bufferSize += 4; /* u32 primitive->connectionStats.dot11RsnaStatsCcmpDecryptErrors */
3022  return bufferSize;
3023 }
3024 
3025 
3027 {
3029  *len = 0;
3030  CsrUint16Ser(ptr, len, primitive->common.type);
3031  CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag);
3032  CsrUint16Ser(ptr, len, (u16) primitive->status);
3033  CsrUint8Ser(ptr, len, (u8) primitive->connectionStats.unifiTxDataRate);
3034  CsrUint8Ser(ptr, len, (u8) primitive->connectionStats.unifiRxDataRate);
3035  CsrUint32Ser(ptr, len, (u32) primitive->connectionStats.dot11RetryCount);
3036  CsrUint32Ser(ptr, len, (u32) primitive->connectionStats.dot11MultipleRetryCount);
3037  CsrUint32Ser(ptr, len, (u32) primitive->connectionStats.dot11AckFailureCount);
3038  CsrUint32Ser(ptr, len, (u32) primitive->connectionStats.dot11FrameDuplicateCount);
3039  CsrUint32Ser(ptr, len, (u32) primitive->connectionStats.dot11FcsErrorCount);
3040  CsrUint32Ser(ptr, len, (u32) primitive->connectionStats.dot11RtsSuccessCount);
3041  CsrUint32Ser(ptr, len, (u32) primitive->connectionStats.dot11RtsFailureCount);
3042  CsrUint32Ser(ptr, len, (u32) primitive->connectionStats.dot11FailedCount);
3045  CsrUint32Ser(ptr, len, (u32) primitive->connectionStats.dot11WepExcludedCount);
3046  CsrUint32Ser(ptr, len, (u32) primitive->connectionStats.dot11WepIcvErrorCount);
3058  return(ptr);
3059 }
3060 
3061 
3063 {
3065  size_t offset;
3066  offset = 0;
3067 
3068  CsrUint16Des(&primitive->common.type, buffer, &offset);
3069  CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset);
3070  CsrUint16Des((u16 *) &primitive->status, buffer, &offset);
3071  CsrUint8Des((u8 *) &primitive->connectionStats.unifiTxDataRate, buffer, &offset);
3072  CsrUint8Des((u8 *) &primitive->connectionStats.unifiRxDataRate, buffer, &offset);
3073  CsrUint32Des((u32 *) &primitive->connectionStats.dot11RetryCount, buffer, &offset);
3074  CsrUint32Des((u32 *) &primitive->connectionStats.dot11MultipleRetryCount, buffer, &offset);
3075  CsrUint32Des((u32 *) &primitive->connectionStats.dot11AckFailureCount, buffer, &offset);
3076  CsrUint32Des((u32 *) &primitive->connectionStats.dot11FrameDuplicateCount, buffer, &offset);
3077  CsrUint32Des((u32 *) &primitive->connectionStats.dot11FcsErrorCount, buffer, &offset);
3078  CsrUint32Des((u32 *) &primitive->connectionStats.dot11RtsSuccessCount, buffer, &offset);
3079  CsrUint32Des((u32 *) &primitive->connectionStats.dot11RtsFailureCount, buffer, &offset);
3080  CsrUint32Des((u32 *) &primitive->connectionStats.dot11FailedCount, buffer, &offset);
3081  CsrUint32Des((u32 *) &primitive->connectionStats.dot11TransmittedFragmentCount, buffer, &offset);
3082  CsrUint32Des((u32 *) &primitive->connectionStats.dot11TransmittedFrameCount, buffer, &offset);
3083  CsrUint32Des((u32 *) &primitive->connectionStats.dot11WepExcludedCount, buffer, &offset);
3084  CsrUint32Des((u32 *) &primitive->connectionStats.dot11WepIcvErrorCount, buffer, &offset);
3085  CsrUint32Des((u32 *) &primitive->connectionStats.dot11WepUndecryptableCount, buffer, &offset);
3086  CsrUint32Des((u32 *) &primitive->connectionStats.dot11MulticastReceivedFrameCount, buffer, &offset);
3087  CsrUint32Des((u32 *) &primitive->connectionStats.dot11MulticastTransmittedFrameCount, buffer, &offset);
3088  CsrUint32Des((u32 *) &primitive->connectionStats.dot11ReceivedFragmentCount, buffer, &offset);
3089  CsrUint32Des((u32 *) &primitive->connectionStats.dot11Rsna4WayHandshakeFailures, buffer, &offset);
3090  CsrUint32Des((u32 *) &primitive->connectionStats.dot11RsnaTkipCounterMeasuresInvoked, buffer, &offset);
3091  CsrUint32Des((u32 *) &primitive->connectionStats.dot11RsnaStatsTkipLocalMicFailures, buffer, &offset);
3092  CsrUint32Des((u32 *) &primitive->connectionStats.dot11RsnaStatsTkipReplays, buffer, &offset);
3093  CsrUint32Des((u32 *) &primitive->connectionStats.dot11RsnaStatsTkipIcvErrors, buffer, &offset);
3094  CsrUint32Des((u32 *) &primitive->connectionStats.dot11RsnaStatsCcmpReplays, buffer, &offset);
3095  CsrUint32Des((u32 *) &primitive->connectionStats.dot11RsnaStatsCcmpDecryptErrors, buffer, &offset);
3096 
3097  return primitive;
3098 }
3099 
3100 
3102 {
3103  size_t bufferSize = 2;
3104 
3105  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 7) */
3106  bufferSize += 2; /* u16 primitive->interfaceTag */
3107  bufferSize += 2; /* CsrResult primitive->status */
3108  return bufferSize;
3109 }
3110 
3111 
3112 u8* CsrWifiSmeDisconnectCfmSer(u8 *ptr, size_t *len, void *msg)
3113 {
3115  *len = 0;
3116  CsrUint16Ser(ptr, len, primitive->common.type);
3117  CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag);
3118  CsrUint16Ser(ptr, len, (u16) primitive->status);
3119  return(ptr);
3120 }
3121 
3122 
3124 {
3126  size_t offset;
3127  offset = 0;
3128 
3129  CsrUint16Des(&primitive->common.type, buffer, &offset);
3130  CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset);
3131  CsrUint16Des((u16 *) &primitive->status, buffer, &offset);
3132 
3133  return primitive;
3134 }
3135 
3136 
3138 {
3139  size_t bufferSize = 2;
3140 
3141  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 10) */
3142  bufferSize += 2; /* u16 primitive->interfaceTag */
3143  bufferSize += 2; /* CsrResult primitive->status */
3144  bufferSize += 1; /* CsrWifiSmeHostPowerMode primitive->hostConfig.powerMode */
3145  bufferSize += 2; /* u16 primitive->hostConfig.applicationDataPeriodMs */
3146  return bufferSize;
3147 }
3148 
3149 
3151 {
3153  *len = 0;
3154  CsrUint16Ser(ptr, len, primitive->common.type);
3155  CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag);
3156  CsrUint16Ser(ptr, len, (u16) primitive->status);
3157  CsrUint8Ser(ptr, len, (u8) primitive->hostConfig.powerMode);
3158  CsrUint16Ser(ptr, len, (u16) primitive->hostConfig.applicationDataPeriodMs);
3159  return(ptr);
3160 }
3161 
3162 
3164 {
3166  size_t offset;
3167  offset = 0;
3168 
3169  CsrUint16Des(&primitive->common.type, buffer, &offset);
3170  CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset);
3171  CsrUint16Des((u16 *) &primitive->status, buffer, &offset);
3172  CsrUint8Des((u8 *) &primitive->hostConfig.powerMode, buffer, &offset);
3173  CsrUint16Des((u16 *) &primitive->hostConfig.applicationDataPeriodMs, buffer, &offset);
3174 
3175  return primitive;
3176 }
3177 
3178 
3180 {
3181  size_t bufferSize = 2;
3182 
3183  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 7) */
3184  bufferSize += 2; /* u16 primitive->interfaceTag */
3185  bufferSize += 2; /* CsrResult primitive->status */
3186  return bufferSize;
3187 }
3188 
3189 
3191 {
3193  *len = 0;
3194  CsrUint16Ser(ptr, len, primitive->common.type);
3195  CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag);
3196  CsrUint16Ser(ptr, len, (u16) primitive->status);
3197  return(ptr);
3198 }
3199 
3200 
3202 {
3204  size_t offset;
3205  offset = 0;
3206 
3207  CsrUint16Des(&primitive->common.type, buffer, &offset);
3208  CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset);
3209  CsrUint16Des((u16 *) &primitive->status, buffer, &offset);
3210 
3211  return primitive;
3212 }
3213 
3214 
3216 {
3217  size_t bufferSize = 2;
3218 
3219  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 10) */
3220  bufferSize += 6; /* u8 primitive->address.a[6] */
3221  bufferSize += 1; /* u8 primitive->isconnected */
3222  return bufferSize;
3223 }
3224 
3225 
3226 u8* CsrWifiSmeIbssStationIndSer(u8 *ptr, size_t *len, void *msg)
3227 {
3229  *len = 0;
3230  CsrUint16Ser(ptr, len, primitive->common.type);
3231  CsrMemCpySer(ptr, len, (const void *) primitive->address.a, ((u16) (6)));
3232  CsrUint8Ser(ptr, len, (u8) primitive->isconnected);
3233  return(ptr);
3234 }
3235 
3236 
3238 {
3240  size_t offset;
3241  offset = 0;
3242 
3243  CsrUint16Des(&primitive->common.type, buffer, &offset);
3244  CsrMemCpyDes(primitive->address.a, buffer, &offset, ((u16) (6)));
3245  CsrUint8Des((u8 *) &primitive->isconnected, buffer, &offset);
3246 
3247  return primitive;
3248 }
3249 
3250 
3252 {
3253  size_t bufferSize = 2;
3254 
3255  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 15) */
3256  bufferSize += 2; /* u16 primitive->interfaceTag */
3257  bufferSize += 2; /* CsrResult primitive->status */
3258  bufferSize += 1; /* CsrWifiSmeListAction primitive->action */
3259  bufferSize += 1; /* CsrWifiSmeKeyType primitive->keyType */
3260  bufferSize += 6; /* u8 primitive->peerMacAddress.a[6] */
3261  return bufferSize;
3262 }
3263 
3264 
3265 u8* CsrWifiSmeKeyCfmSer(u8 *ptr, size_t *len, void *msg)
3266 {
3267  CsrWifiSmeKeyCfm *primitive = (CsrWifiSmeKeyCfm *)msg;
3268  *len = 0;
3269  CsrUint16Ser(ptr, len, primitive->common.type);
3270  CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag);
3271  CsrUint16Ser(ptr, len, (u16) primitive->status);
3272  CsrUint8Ser(ptr, len, (u8) primitive->action);
3273  CsrUint8Ser(ptr, len, (u8) primitive->keyType);
3274  CsrMemCpySer(ptr, len, (const void *) primitive->peerMacAddress.a, ((u16) (6)));
3275  return(ptr);
3276 }
3277 
3278 
3280 {
3281  CsrWifiSmeKeyCfm *primitive = kmalloc(sizeof(CsrWifiSmeKeyCfm), GFP_KERNEL);
3282  size_t offset;
3283  offset = 0;
3284 
3285  CsrUint16Des(&primitive->common.type, buffer, &offset);
3286  CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset);
3287  CsrUint16Des((u16 *) &primitive->status, buffer, &offset);
3288  CsrUint8Des((u8 *) &primitive->action, buffer, &offset);
3289  CsrUint8Des((u8 *) &primitive->keyType, buffer, &offset);
3290  CsrMemCpyDes(primitive->peerMacAddress.a, buffer, &offset, ((u16) (6)));
3291 
3292  return primitive;
3293 }
3294 
3295 
3297 {
3298  size_t bufferSize = 2;
3299 
3300  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 11) */
3301  bufferSize += 2; /* u16 primitive->interfaceTag */
3302  bufferSize += 2; /* CsrResult primitive->status */
3303  bufferSize += 2; /* s16 primitive->linkQuality.unifiRssi */
3304  bufferSize += 2; /* s16 primitive->linkQuality.unifiSnr */
3305  return bufferSize;
3306 }
3307 
3308 
3310 {
3312  *len = 0;
3313  CsrUint16Ser(ptr, len, primitive->common.type);
3314  CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag);
3315  CsrUint16Ser(ptr, len, (u16) primitive->status);
3316  CsrUint16Ser(ptr, len, (u16) primitive->linkQuality.unifiRssi);
3317  CsrUint16Ser(ptr, len, (u16) primitive->linkQuality.unifiSnr);
3318  return(ptr);
3319 }
3320 
3321 
3323 {
3325  size_t offset;
3326  offset = 0;
3327 
3328  CsrUint16Des(&primitive->common.type, buffer, &offset);
3329  CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset);
3330  CsrUint16Des((u16 *) &primitive->status, buffer, &offset);
3331  CsrUint16Des((u16 *) &primitive->linkQuality.unifiRssi, buffer, &offset);
3332  CsrUint16Des((u16 *) &primitive->linkQuality.unifiSnr, buffer, &offset);
3333 
3334  return primitive;
3335 }
3336 
3337 
3339 {
3341  size_t bufferSize = 2;
3342 
3343  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 99) */
3344  bufferSize += 2; /* u16 primitive->interfaceTag */
3345  bufferSize += 1; /* CsrWifiSmeMediaStatus primitive->mediaStatus */
3346  bufferSize += 32; /* u8 primitive->connectionInfo.ssid.ssid[32] */
3347  bufferSize += 1; /* u8 primitive->connectionInfo.ssid.length */
3348  bufferSize += 6; /* u8 primitive->connectionInfo.bssid.a[6] */
3349  bufferSize += 1; /* CsrWifiSme80211NetworkType primitive->connectionInfo.networkType80211 */
3350  bufferSize += 1; /* u8 primitive->connectionInfo.channelNumber */
3351  bufferSize += 2; /* u16 primitive->connectionInfo.channelFrequency */
3352  bufferSize += 2; /* CsrWifiSmeAuthMode primitive->connectionInfo.authMode */
3353  bufferSize += 2; /* CsrWifiSmeEncryption primitive->connectionInfo.pairwiseCipher */
3354  bufferSize += 2; /* CsrWifiSmeEncryption primitive->connectionInfo.groupCipher */
3355  bufferSize += 1; /* CsrWifiSmeRadioIF primitive->connectionInfo.ifIndex */
3356  bufferSize += 2; /* u16 primitive->connectionInfo.atimWindowTu */
3357  bufferSize += 2; /* u16 primitive->connectionInfo.beaconPeriodTu */
3358  bufferSize += 1; /* u8 primitive->connectionInfo.reassociation */
3359  bufferSize += 2; /* u16 primitive->connectionInfo.beaconFrameLength */
3360  bufferSize += primitive->connectionInfo.beaconFrameLength; /* u8 primitive->connectionInfo.beaconFrame */
3361  bufferSize += 2; /* u16 primitive->connectionInfo.associationReqFrameLength */
3362  bufferSize += primitive->connectionInfo.associationReqFrameLength; /* u8 primitive->connectionInfo.associationReqFrame */
3363  bufferSize += 2; /* u16 primitive->connectionInfo.associationRspFrameLength */
3364  bufferSize += primitive->connectionInfo.associationRspFrameLength; /* u8 primitive->connectionInfo.associationRspFrame */
3365  bufferSize += 2; /* u16 primitive->connectionInfo.assocScanInfoElementsLength */
3366  bufferSize += primitive->connectionInfo.assocScanInfoElementsLength; /* u8 primitive->connectionInfo.assocScanInfoElements */
3367  bufferSize += 2; /* u16 primitive->connectionInfo.assocReqCapabilities */
3368  bufferSize += 2; /* u16 primitive->connectionInfo.assocReqListenIntervalTu */
3369  bufferSize += 6; /* u8 primitive->connectionInfo.assocReqApAddress.a[6] */
3370  bufferSize += 2; /* u16 primitive->connectionInfo.assocReqInfoElementsLength */
3371  bufferSize += primitive->connectionInfo.assocReqInfoElementsLength; /* u8 primitive->connectionInfo.assocReqInfoElements */
3372  bufferSize += 2; /* CsrWifiSmeIEEE80211Result primitive->connectionInfo.assocRspResult */
3373  bufferSize += 2; /* u16 primitive->connectionInfo.assocRspCapabilityInfo */
3374  bufferSize += 2; /* u16 primitive->connectionInfo.assocRspAssociationId */
3375  bufferSize += 2; /* u16 primitive->connectionInfo.assocRspInfoElementsLength */
3376  bufferSize += primitive->connectionInfo.assocRspInfoElementsLength; /* u8 primitive->connectionInfo.assocRspInfoElements */
3377  bufferSize += 2; /* CsrWifiSmeIEEE80211Reason primitive->disassocReason */
3378  bufferSize += 2; /* CsrWifiSmeIEEE80211Reason primitive->deauthReason */
3379  return bufferSize;
3380 }
3381 
3382 
3383 u8* CsrWifiSmeMediaStatusIndSer(u8 *ptr, size_t *len, void *msg)
3384 {
3386  *len = 0;
3387  CsrUint16Ser(ptr, len, primitive->common.type);
3388  CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag);
3389  CsrUint8Ser(ptr, len, (u8) primitive->mediaStatus);
3390  CsrMemCpySer(ptr, len, (const void *) primitive->connectionInfo.ssid.ssid, ((u16) (32)));
3391  CsrUint8Ser(ptr, len, (u8) primitive->connectionInfo.ssid.length);
3392  CsrMemCpySer(ptr, len, (const void *) primitive->connectionInfo.bssid.a, ((u16) (6)));
3393  CsrUint8Ser(ptr, len, (u8) primitive->connectionInfo.networkType80211);
3394  CsrUint8Ser(ptr, len, (u8) primitive->connectionInfo.channelNumber);
3395  CsrUint16Ser(ptr, len, (u16) primitive->connectionInfo.channelFrequency);
3396  CsrUint16Ser(ptr, len, (u16) primitive->connectionInfo.authMode);
3397  CsrUint16Ser(ptr, len, (u16) primitive->connectionInfo.pairwiseCipher);
3398  CsrUint16Ser(ptr, len, (u16) primitive->connectionInfo.groupCipher);
3399  CsrUint8Ser(ptr, len, (u8) primitive->connectionInfo.ifIndex);
3400  CsrUint16Ser(ptr, len, (u16) primitive->connectionInfo.atimWindowTu);
3401  CsrUint16Ser(ptr, len, (u16) primitive->connectionInfo.beaconPeriodTu);
3402  CsrUint8Ser(ptr, len, (u8) primitive->connectionInfo.reassociation);
3403  CsrUint16Ser(ptr, len, (u16) primitive->connectionInfo.beaconFrameLength);
3404  if (primitive->connectionInfo.beaconFrameLength)
3405  {
3406  CsrMemCpySer(ptr, len, (const void *) primitive->connectionInfo.beaconFrame, ((u16) (primitive->connectionInfo.beaconFrameLength)));
3407  }
3408  CsrUint16Ser(ptr, len, (u16) primitive->connectionInfo.associationReqFrameLength);
3410  {
3411  CsrMemCpySer(ptr, len, (const void *) primitive->connectionInfo.associationReqFrame, ((u16) (primitive->connectionInfo.associationReqFrameLength)));
3412  }
3413  CsrUint16Ser(ptr, len, (u16) primitive->connectionInfo.associationRspFrameLength);
3415  {
3416  CsrMemCpySer(ptr, len, (const void *) primitive->connectionInfo.associationRspFrame, ((u16) (primitive->connectionInfo.associationRspFrameLength)));
3417  }
3420  {
3421  CsrMemCpySer(ptr, len, (const void *) primitive->connectionInfo.assocScanInfoElements, ((u16) (primitive->connectionInfo.assocScanInfoElementsLength)));
3422  }
3423  CsrUint16Ser(ptr, len, (u16) primitive->connectionInfo.assocReqCapabilities);
3424  CsrUint16Ser(ptr, len, (u16) primitive->connectionInfo.assocReqListenIntervalTu);
3425  CsrMemCpySer(ptr, len, (const void *) primitive->connectionInfo.assocReqApAddress.a, ((u16) (6)));
3428  {
3429  CsrMemCpySer(ptr, len, (const void *) primitive->connectionInfo.assocReqInfoElements, ((u16) (primitive->connectionInfo.assocReqInfoElementsLength)));
3430  }
3431  CsrUint16Ser(ptr, len, (u16) primitive->connectionInfo.assocRspResult);
3432  CsrUint16Ser(ptr, len, (u16) primitive->connectionInfo.assocRspCapabilityInfo);
3433  CsrUint16Ser(ptr, len, (u16) primitive->connectionInfo.assocRspAssociationId);
3436  {
3437  CsrMemCpySer(ptr, len, (const void *) primitive->connectionInfo.assocRspInfoElements, ((u16) (primitive->connectionInfo.assocRspInfoElementsLength)));
3438  }
3439  CsrUint16Ser(ptr, len, (u16) primitive->disassocReason);
3440  CsrUint16Ser(ptr, len, (u16) primitive->deauthReason);
3441  return(ptr);
3442 }
3443 
3444 
3446 {
3448  size_t offset;
3449  offset = 0;
3450 
3451  CsrUint16Des(&primitive->common.type, buffer, &offset);
3452  CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset);
3453  CsrUint8Des((u8 *) &primitive->mediaStatus, buffer, &offset);
3454  CsrMemCpyDes(primitive->connectionInfo.ssid.ssid, buffer, &offset, ((u16) (32)));
3455  CsrUint8Des((u8 *) &primitive->connectionInfo.ssid.length, buffer, &offset);
3456  CsrMemCpyDes(primitive->connectionInfo.bssid.a, buffer, &offset, ((u16) (6)));
3457  CsrUint8Des((u8 *) &primitive->connectionInfo.networkType80211, buffer, &offset);
3458  CsrUint8Des((u8 *) &primitive->connectionInfo.channelNumber, buffer, &offset);
3459  CsrUint16Des((u16 *) &primitive->connectionInfo.channelFrequency, buffer, &offset);
3460  CsrUint16Des((u16 *) &primitive->connectionInfo.authMode, buffer, &offset);
3461  CsrUint16Des((u16 *) &primitive->connectionInfo.pairwiseCipher, buffer, &offset);
3462  CsrUint16Des((u16 *) &primitive->connectionInfo.groupCipher, buffer, &offset);
3463  CsrUint8Des((u8 *) &primitive->connectionInfo.ifIndex, buffer, &offset);
3464  CsrUint16Des((u16 *) &primitive->connectionInfo.atimWindowTu, buffer, &offset);
3465  CsrUint16Des((u16 *) &primitive->connectionInfo.beaconPeriodTu, buffer, &offset);
3466  CsrUint8Des((u8 *) &primitive->connectionInfo.reassociation, buffer, &offset);
3467  CsrUint16Des((u16 *) &primitive->connectionInfo.beaconFrameLength, buffer, &offset);
3468  if (primitive->connectionInfo.beaconFrameLength)
3469  {
3471  CsrMemCpyDes(primitive->connectionInfo.beaconFrame, buffer, &offset, ((u16) (primitive->connectionInfo.beaconFrameLength)));
3472  }
3473  else
3474  {
3475  primitive->connectionInfo.beaconFrame = NULL;
3476  }
3477  CsrUint16Des((u16 *) &primitive->connectionInfo.associationReqFrameLength, buffer, &offset);
3479  {
3481  CsrMemCpyDes(primitive->connectionInfo.associationReqFrame, buffer, &offset, ((u16) (primitive->connectionInfo.associationReqFrameLength)));
3482  }
3483  else
3484  {
3486  }
3487  CsrUint16Des((u16 *) &primitive->connectionInfo.associationRspFrameLength, buffer, &offset);
3489  {
3491  CsrMemCpyDes(primitive->connectionInfo.associationRspFrame, buffer, &offset, ((u16) (primitive->connectionInfo.associationRspFrameLength)));
3492  }
3493  else
3494  {
3496  }
3497  CsrUint16Des((u16 *) &primitive->connectionInfo.assocScanInfoElementsLength, buffer, &offset);
3499  {
3501  CsrMemCpyDes(primitive->connectionInfo.assocScanInfoElements, buffer, &offset, ((u16) (primitive->connectionInfo.assocScanInfoElementsLength)));
3502  }
3503  else
3504  {
3506  }
3507  CsrUint16Des((u16 *) &primitive->connectionInfo.assocReqCapabilities, buffer, &offset);
3508  CsrUint16Des((u16 *) &primitive->connectionInfo.assocReqListenIntervalTu, buffer, &offset);
3509  CsrMemCpyDes(primitive->connectionInfo.assocReqApAddress.a, buffer, &offset, ((u16) (6)));
3510  CsrUint16Des((u16 *) &primitive->connectionInfo.assocReqInfoElementsLength, buffer, &offset);
3512  {
3514  CsrMemCpyDes(primitive->connectionInfo.assocReqInfoElements, buffer, &offset, ((u16) (primitive->connectionInfo.assocReqInfoElementsLength)));
3515  }
3516  else
3517  {
3519  }
3520  CsrUint16Des((u16 *) &primitive->connectionInfo.assocRspResult, buffer, &offset);
3521  CsrUint16Des((u16 *) &primitive->connectionInfo.assocRspCapabilityInfo, buffer, &offset);
3522  CsrUint16Des((u16 *) &primitive->connectionInfo.assocRspAssociationId, buffer, &offset);
3523  CsrUint16Des((u16 *) &primitive->connectionInfo.assocRspInfoElementsLength, buffer, &offset);
3525  {
3527  CsrMemCpyDes(primitive->connectionInfo.assocRspInfoElements, buffer, &offset, ((u16) (primitive->connectionInfo.assocRspInfoElementsLength)));
3528  }
3529  else
3530  {
3532  }
3533  CsrUint16Des((u16 *) &primitive->disassocReason, buffer, &offset);
3534  CsrUint16Des((u16 *) &primitive->deauthReason, buffer, &offset);
3535 
3536  return primitive;
3537 }
3538 
3539 
3540 void CsrWifiSmeMediaStatusIndSerFree(void *voidPrimitivePointer)
3541 {
3542  CsrWifiSmeMediaStatusInd *primitive = (CsrWifiSmeMediaStatusInd *) voidPrimitivePointer;
3543  kfree(primitive->connectionInfo.beaconFrame);
3549  kfree(primitive);
3550 }
3551 
3552 
3554 {
3555  size_t bufferSize = 2;
3556 
3557  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 13) */
3558  bufferSize += 2; /* CsrResult primitive->status */
3559  bufferSize += 1; /* u8 primitive->mibConfig.unifiFixMaxTxDataRate */
3560  bufferSize += 1; /* u8 primitive->mibConfig.unifiFixTxDataRate */
3561  bufferSize += 2; /* u16 primitive->mibConfig.dot11RtsThreshold */
3562  bufferSize += 2; /* u16 primitive->mibConfig.dot11FragmentationThreshold */
3563  bufferSize += 2; /* u16 primitive->mibConfig.dot11CurrentTxPowerLevel */
3564  return bufferSize;
3565 }
3566 
3567 
3568 u8* CsrWifiSmeMibConfigGetCfmSer(u8 *ptr, size_t *len, void *msg)
3569 {
3571  *len = 0;
3572  CsrUint16Ser(ptr, len, primitive->common.type);
3573  CsrUint16Ser(ptr, len, (u16) primitive->status);
3574  CsrUint8Ser(ptr, len, (u8) primitive->mibConfig.unifiFixMaxTxDataRate);
3575  CsrUint8Ser(ptr, len, (u8) primitive->mibConfig.unifiFixTxDataRate);
3576  CsrUint16Ser(ptr, len, (u16) primitive->mibConfig.dot11RtsThreshold);
3577  CsrUint16Ser(ptr, len, (u16) primitive->mibConfig.dot11FragmentationThreshold);
3578  CsrUint16Ser(ptr, len, (u16) primitive->mibConfig.dot11CurrentTxPowerLevel);
3579  return(ptr);
3580 }
3581 
3582 
3584 {
3586  size_t offset;
3587  offset = 0;
3588 
3589  CsrUint16Des(&primitive->common.type, buffer, &offset);
3590  CsrUint16Des((u16 *) &primitive->status, buffer, &offset);
3591  CsrUint8Des((u8 *) &primitive->mibConfig.unifiFixMaxTxDataRate, buffer, &offset);
3592  CsrUint8Des((u8 *) &primitive->mibConfig.unifiFixTxDataRate, buffer, &offset);
3593  CsrUint16Des((u16 *) &primitive->mibConfig.dot11RtsThreshold, buffer, &offset);
3594  CsrUint16Des((u16 *) &primitive->mibConfig.dot11FragmentationThreshold, buffer, &offset);
3595  CsrUint16Des((u16 *) &primitive->mibConfig.dot11CurrentTxPowerLevel, buffer, &offset);
3596 
3597  return primitive;
3598 }
3599 
3600 
3602 {
3603  CsrWifiSmeMibGetCfm *primitive = (CsrWifiSmeMibGetCfm *) msg;
3604  size_t bufferSize = 2;
3605 
3606  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 8) */
3607  bufferSize += 2; /* CsrResult primitive->status */
3608  bufferSize += 2; /* u16 primitive->mibAttributeLength */
3609  bufferSize += primitive->mibAttributeLength; /* u8 primitive->mibAttribute */
3610  return bufferSize;
3611 }
3612 
3613 
3614 u8* CsrWifiSmeMibGetCfmSer(u8 *ptr, size_t *len, void *msg)
3615 {
3616  CsrWifiSmeMibGetCfm *primitive = (CsrWifiSmeMibGetCfm *)msg;
3617  *len = 0;
3618  CsrUint16Ser(ptr, len, primitive->common.type);
3619  CsrUint16Ser(ptr, len, (u16) primitive->status);
3620  CsrUint16Ser(ptr, len, (u16) primitive->mibAttributeLength);
3621  if (primitive->mibAttributeLength)
3622  {
3623  CsrMemCpySer(ptr, len, (const void *) primitive->mibAttribute, ((u16) (primitive->mibAttributeLength)));
3624  }
3625  return(ptr);
3626 }
3627 
3628 
3630 {
3632  size_t offset;
3633  offset = 0;
3634 
3635  CsrUint16Des(&primitive->common.type, buffer, &offset);
3636  CsrUint16Des((u16 *) &primitive->status, buffer, &offset);
3637  CsrUint16Des((u16 *) &primitive->mibAttributeLength, buffer, &offset);
3638  if (primitive->mibAttributeLength)
3639  {
3640  primitive->mibAttribute = kmalloc(primitive->mibAttributeLength, GFP_KERNEL);
3641  CsrMemCpyDes(primitive->mibAttribute, buffer, &offset, ((u16) (primitive->mibAttributeLength)));
3642  }
3643  else
3644  {
3645  primitive->mibAttribute = NULL;
3646  }
3647 
3648  return primitive;
3649 }
3650 
3651 
3652 void CsrWifiSmeMibGetCfmSerFree(void *voidPrimitivePointer)
3653 {
3654  CsrWifiSmeMibGetCfm *primitive = (CsrWifiSmeMibGetCfm *) voidPrimitivePointer;
3655  kfree(primitive->mibAttribute);
3656  kfree(primitive);
3657 }
3658 
3659 
3661 {
3662  CsrWifiSmeMibGetNextCfm *primitive = (CsrWifiSmeMibGetNextCfm *) msg;
3663  size_t bufferSize = 2;
3664 
3665  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 8) */
3666  bufferSize += 2; /* CsrResult primitive->status */
3667  bufferSize += 2; /* u16 primitive->mibAttributeLength */
3668  bufferSize += primitive->mibAttributeLength; /* u8 primitive->mibAttribute */
3669  return bufferSize;
3670 }
3671 
3672 
3673 u8* CsrWifiSmeMibGetNextCfmSer(u8 *ptr, size_t *len, void *msg)
3674 {
3676  *len = 0;
3677  CsrUint16Ser(ptr, len, primitive->common.type);
3678  CsrUint16Ser(ptr, len, (u16) primitive->status);
3679  CsrUint16Ser(ptr, len, (u16) primitive->mibAttributeLength);
3680  if (primitive->mibAttributeLength)
3681  {
3682  CsrMemCpySer(ptr, len, (const void *) primitive->mibAttribute, ((u16) (primitive->mibAttributeLength)));
3683  }
3684  return(ptr);
3685 }
3686 
3687 
3689 {
3691  size_t offset;
3692  offset = 0;
3693 
3694  CsrUint16Des(&primitive->common.type, buffer, &offset);
3695  CsrUint16Des((u16 *) &primitive->status, buffer, &offset);
3696  CsrUint16Des((u16 *) &primitive->mibAttributeLength, buffer, &offset);
3697  if (primitive->mibAttributeLength)
3698  {
3699  primitive->mibAttribute = kmalloc(primitive->mibAttributeLength, GFP_KERNEL);
3700  CsrMemCpyDes(primitive->mibAttribute, buffer, &offset, ((u16) (primitive->mibAttributeLength)));
3701  }
3702  else
3703  {
3704  primitive->mibAttribute = NULL;
3705  }
3706 
3707  return primitive;
3708 }
3709 
3710 
3711 void CsrWifiSmeMibGetNextCfmSerFree(void *voidPrimitivePointer)
3712 {
3713  CsrWifiSmeMibGetNextCfm *primitive = (CsrWifiSmeMibGetNextCfm *) voidPrimitivePointer;
3714  kfree(primitive->mibAttribute);
3715  kfree(primitive);
3716 }
3717 
3718 
3720 {
3721  size_t bufferSize = 2;
3722 
3723  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 15) */
3724  bufferSize += 2; /* u16 primitive->interfaceTag */
3725  bufferSize += 1; /* u8 primitive->secondFailure */
3726  bufferSize += 2; /* u16 primitive->count */
3727  bufferSize += 6; /* u8 primitive->address.a[6] */
3728  bufferSize += 1; /* CsrWifiSmeKeyType primitive->keyType */
3729  return bufferSize;
3730 }
3731 
3732 
3733 u8* CsrWifiSmeMicFailureIndSer(u8 *ptr, size_t *len, void *msg)
3734 {
3736  *len = 0;
3737  CsrUint16Ser(ptr, len, primitive->common.type);
3738  CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag);
3739  CsrUint8Ser(ptr, len, (u8) primitive->secondFailure);
3740  CsrUint16Ser(ptr, len, (u16) primitive->count);
3741  CsrMemCpySer(ptr, len, (const void *) primitive->address.a, ((u16) (6)));
3742  CsrUint8Ser(ptr, len, (u8) primitive->keyType);
3743  return(ptr);
3744 }
3745 
3746 
3748 {
3750  size_t offset;
3751  offset = 0;
3752 
3753  CsrUint16Des(&primitive->common.type, buffer, &offset);
3754  CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset);
3755  CsrUint8Des((u8 *) &primitive->secondFailure, buffer, &offset);
3756  CsrUint16Des((u16 *) &primitive->count, buffer, &offset);
3757  CsrMemCpyDes(primitive->address.a, buffer, &offset, ((u16) (6)));
3758  CsrUint8Des((u8 *) &primitive->keyType, buffer, &offset);
3759 
3760  return primitive;
3761 }
3762 
3763 
3765 {
3767  size_t bufferSize = 2;
3768 
3769  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 15) */
3770  bufferSize += 2; /* u16 primitive->interfaceTag */
3771  bufferSize += 2; /* CsrResult primitive->status */
3772  bufferSize += 1; /* CsrWifiSmeListAction primitive->action */
3773  bufferSize += 1; /* u8 primitive->getAddressesCount */
3774  {
3775  u16 i1;
3776  for (i1 = 0; i1 < primitive->getAddressesCount; i1++)
3777  {
3778  bufferSize += 6; /* u8 primitive->getAddresses[i1].a[6] */
3779  }
3780  }
3781  return bufferSize;
3782 }
3783 
3784 
3786 {
3788  *len = 0;
3789  CsrUint16Ser(ptr, len, primitive->common.type);
3790  CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag);
3791  CsrUint16Ser(ptr, len, (u16) primitive->status);
3792  CsrUint8Ser(ptr, len, (u8) primitive->action);
3793  CsrUint8Ser(ptr, len, (u8) primitive->getAddressesCount);
3794  {
3795  u16 i1;
3796  for (i1 = 0; i1 < primitive->getAddressesCount; i1++)
3797  {
3798  CsrMemCpySer(ptr, len, (const void *) primitive->getAddresses[i1].a, ((u16) (6)));
3799  }
3800  }
3801  return(ptr);
3802 }
3803 
3804 
3806 {
3808  size_t offset;
3809  offset = 0;
3810 
3811  CsrUint16Des(&primitive->common.type, buffer, &offset);
3812  CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset);
3813  CsrUint16Des((u16 *) &primitive->status, buffer, &offset);
3814  CsrUint8Des((u8 *) &primitive->action, buffer, &offset);
3815  CsrUint8Des((u8 *) &primitive->getAddressesCount, buffer, &offset);
3816  primitive->getAddresses = NULL;
3817  if (primitive->getAddressesCount)
3818  {
3819  primitive->getAddresses = kmalloc(sizeof(CsrWifiMacAddress) * primitive->getAddressesCount, GFP_KERNEL);
3820  }
3821  {
3822  u16 i1;
3823  for (i1 = 0; i1 < primitive->getAddressesCount; i1++)
3824  {
3825  CsrMemCpyDes(primitive->getAddresses[i1].a, buffer, &offset, ((u16) (6)));
3826  }
3827  }
3828 
3829  return primitive;
3830 }
3831 
3832 
3833 void CsrWifiSmeMulticastAddressCfmSerFree(void *voidPrimitivePointer)
3834 {
3835  CsrWifiSmeMulticastAddressCfm *primitive = (CsrWifiSmeMulticastAddressCfm *) voidPrimitivePointer;
3836  kfree(primitive->getAddresses);
3837  kfree(primitive);
3838 }
3839 
3840 
3842 {
3843  size_t bufferSize = 2;
3844 
3845  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 7) */
3846  bufferSize += 2; /* u16 primitive->interfaceTag */
3847  bufferSize += 2; /* CsrResult primitive->status */
3848  return bufferSize;
3849 }
3850 
3851 
3853 {
3855  *len = 0;
3856  CsrUint16Ser(ptr, len, primitive->common.type);
3857  CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag);
3858  CsrUint16Ser(ptr, len, (u16) primitive->status);
3859  return(ptr);
3860 }
3861 
3862 
3864 {
3866  size_t offset;
3867  offset = 0;
3868 
3869  CsrUint16Des(&primitive->common.type, buffer, &offset);
3870  CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset);
3871  CsrUint16Des((u16 *) &primitive->status, buffer, &offset);
3872 
3873  return primitive;
3874 }
3875 
3876 
3878 {
3879  size_t bufferSize = 2;
3880 
3881  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 11) */
3882  bufferSize += 2; /* CsrResult primitive->status */
3883  bufferSize += 6; /* u8 primitive->permanentMacAddress.a[6] */
3884  return bufferSize;
3885 }
3886 
3887 
3889 {
3891  *len = 0;
3892  CsrUint16Ser(ptr, len, primitive->common.type);
3893  CsrUint16Ser(ptr, len, (u16) primitive->status);
3894  CsrMemCpySer(ptr, len, (const void *) primitive->permanentMacAddress.a, ((u16) (6)));
3895  return(ptr);
3896 }
3897 
3898 
3900 {
3902  size_t offset;
3903  offset = 0;
3904 
3905  CsrUint16Des(&primitive->common.type, buffer, &offset);
3906  CsrUint16Des((u16 *) &primitive->status, buffer, &offset);
3907  CsrMemCpyDes(primitive->permanentMacAddress.a, buffer, &offset, ((u16) (6)));
3908 
3909  return primitive;
3910 }
3911 
3912 
3914 {
3916  size_t bufferSize = 2;
3917 
3918  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 13) */
3919  bufferSize += 2; /* u16 primitive->interfaceTag */
3920  bufferSize += 1; /* u8 primitive->pmkidCandidatesCount */
3921  {
3922  u16 i1;
3923  for (i1 = 0; i1 < primitive->pmkidCandidatesCount; i1++)
3924  {
3925  bufferSize += 6; /* u8 primitive->pmkidCandidates[i1].bssid.a[6] */
3926  bufferSize += 1; /* u8 primitive->pmkidCandidates[i1].preAuthAllowed */
3927  }
3928  }
3929  return bufferSize;
3930 }
3931 
3932 
3934 {
3936  *len = 0;
3937  CsrUint16Ser(ptr, len, primitive->common.type);
3938  CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag);
3939  CsrUint8Ser(ptr, len, (u8) primitive->pmkidCandidatesCount);
3940  {
3941  u16 i1;
3942  for (i1 = 0; i1 < primitive->pmkidCandidatesCount; i1++)
3943  {
3944  CsrMemCpySer(ptr, len, (const void *) primitive->pmkidCandidates[i1].bssid.a, ((u16) (6)));
3945  CsrUint8Ser(ptr, len, (u8) primitive->pmkidCandidates[i1].preAuthAllowed);
3946  }
3947  }
3948  return(ptr);
3949 }
3950 
3951 
3953 {
3955  size_t offset;
3956  offset = 0;
3957 
3958  CsrUint16Des(&primitive->common.type, buffer, &offset);
3959  CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset);
3960  CsrUint8Des((u8 *) &primitive->pmkidCandidatesCount, buffer, &offset);
3961  primitive->pmkidCandidates = NULL;
3962  if (primitive->pmkidCandidatesCount)
3963  {
3965  }
3966  {
3967  u16 i1;
3968  for (i1 = 0; i1 < primitive->pmkidCandidatesCount; i1++)
3969  {
3970  CsrMemCpyDes(primitive->pmkidCandidates[i1].bssid.a, buffer, &offset, ((u16) (6)));
3971  CsrUint8Des((u8 *) &primitive->pmkidCandidates[i1].preAuthAllowed, buffer, &offset);
3972  }
3973  }
3974 
3975  return primitive;
3976 }
3977 
3978 
3979 void CsrWifiSmePmkidCandidateListIndSerFree(void *voidPrimitivePointer)
3980 {
3981  CsrWifiSmePmkidCandidateListInd *primitive = (CsrWifiSmePmkidCandidateListInd *) voidPrimitivePointer;
3982  kfree(primitive->pmkidCandidates);
3983  kfree(primitive);
3984 }
3985 
3986 
3988 {
3989  CsrWifiSmePmkidCfm *primitive = (CsrWifiSmePmkidCfm *) msg;
3990  size_t bufferSize = 2;
3991 
3992  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 31) */
3993  bufferSize += 2; /* u16 primitive->interfaceTag */
3994  bufferSize += 2; /* CsrResult primitive->status */
3995  bufferSize += 1; /* CsrWifiSmeListAction primitive->action */
3996  bufferSize += 1; /* u8 primitive->getPmkidsCount */
3997  {
3998  u16 i1;
3999  for (i1 = 0; i1 < primitive->getPmkidsCount; i1++)
4000  {
4001  bufferSize += 6; /* u8 primitive->getPmkids[i1].bssid.a[6] */
4002  bufferSize += 16; /* u8 primitive->getPmkids[i1].pmkid[16] */
4003  }
4004  }
4005  return bufferSize;
4006 }
4007 
4008 
4009 u8* CsrWifiSmePmkidCfmSer(u8 *ptr, size_t *len, void *msg)
4010 {
4011  CsrWifiSmePmkidCfm *primitive = (CsrWifiSmePmkidCfm *)msg;
4012  *len = 0;
4013  CsrUint16Ser(ptr, len, primitive->common.type);
4014  CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag);
4015  CsrUint16Ser(ptr, len, (u16) primitive->status);
4016  CsrUint8Ser(ptr, len, (u8) primitive->action);
4017  CsrUint8Ser(ptr, len, (u8) primitive->getPmkidsCount);
4018  {
4019  u16 i1;
4020  for (i1 = 0; i1 < primitive->getPmkidsCount; i1++)
4021  {
4022  CsrMemCpySer(ptr, len, (const void *) primitive->getPmkids[i1].bssid.a, ((u16) (6)));
4023  CsrMemCpySer(ptr, len, (const void *) primitive->getPmkids[i1].pmkid, ((u16) (16)));
4024  }
4025  }
4026  return(ptr);
4027 }
4028 
4029 
4031 {
4033  size_t offset;
4034  offset = 0;
4035 
4036  CsrUint16Des(&primitive->common.type, buffer, &offset);
4037  CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset);
4038  CsrUint16Des((u16 *) &primitive->status, buffer, &offset);
4039  CsrUint8Des((u8 *) &primitive->action, buffer, &offset);
4040  CsrUint8Des((u8 *) &primitive->getPmkidsCount, buffer, &offset);
4041  primitive->getPmkids = NULL;
4042  if (primitive->getPmkidsCount)
4043  {
4044  primitive->getPmkids = kmalloc(sizeof(CsrWifiSmePmkid) * primitive->getPmkidsCount, GFP_KERNEL);
4045  }
4046  {
4047  u16 i1;
4048  for (i1 = 0; i1 < primitive->getPmkidsCount; i1++)
4049  {
4050  CsrMemCpyDes(primitive->getPmkids[i1].bssid.a, buffer, &offset, ((u16) (6)));
4051  CsrMemCpyDes(primitive->getPmkids[i1].pmkid, buffer, &offset, ((u16) (16)));
4052  }
4053  }
4054 
4055  return primitive;
4056 }
4057 
4058 
4059 void CsrWifiSmePmkidCfmSerFree(void *voidPrimitivePointer)
4060 {
4061  CsrWifiSmePmkidCfm *primitive = (CsrWifiSmePmkidCfm *) voidPrimitivePointer;
4062  kfree(primitive->getPmkids);
4063  kfree(primitive);
4064 }
4065 
4066 
4068 {
4069  size_t bufferSize = 2;
4070 
4071  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 13) */
4072  bufferSize += 2; /* CsrResult primitive->status */
4073  bufferSize += 1; /* CsrWifiSmePowerSaveLevel primitive->powerConfig.powerSaveLevel */
4074  bufferSize += 2; /* u16 primitive->powerConfig.listenIntervalTu */
4075  bufferSize += 1; /* u8 primitive->powerConfig.rxDtims */
4076  bufferSize += 1; /* CsrWifiSmeD3AutoScanMode primitive->powerConfig.d3AutoScanMode */
4077  bufferSize += 1; /* u8 primitive->powerConfig.clientTrafficWindow */
4078  bufferSize += 1; /* u8 primitive->powerConfig.opportunisticPowerSave */
4079  bufferSize += 1; /* u8 primitive->powerConfig.noticeOfAbsence */
4080  return bufferSize;
4081 }
4082 
4083 
4085 {
4087  *len = 0;
4088  CsrUint16Ser(ptr, len, primitive->common.type);
4089  CsrUint16Ser(ptr, len, (u16) primitive->status);
4090  CsrUint8Ser(ptr, len, (u8) primitive->powerConfig.powerSaveLevel);
4091  CsrUint16Ser(ptr, len, (u16) primitive->powerConfig.listenIntervalTu);
4092  CsrUint8Ser(ptr, len, (u8) primitive->powerConfig.rxDtims);
4093  CsrUint8Ser(ptr, len, (u8) primitive->powerConfig.d3AutoScanMode);
4094  CsrUint8Ser(ptr, len, (u8) primitive->powerConfig.clientTrafficWindow);
4095  CsrUint8Ser(ptr, len, (u8) primitive->powerConfig.opportunisticPowerSave);
4096  CsrUint8Ser(ptr, len, (u8) primitive->powerConfig.noticeOfAbsence);
4097  return(ptr);
4098 }
4099 
4100 
4102 {
4104  size_t offset;
4105  offset = 0;
4106 
4107  CsrUint16Des(&primitive->common.type, buffer, &offset);
4108  CsrUint16Des((u16 *) &primitive->status, buffer, &offset);
4109  CsrUint8Des((u8 *) &primitive->powerConfig.powerSaveLevel, buffer, &offset);
4110  CsrUint16Des((u16 *) &primitive->powerConfig.listenIntervalTu, buffer, &offset);
4111  CsrUint8Des((u8 *) &primitive->powerConfig.rxDtims, buffer, &offset);
4112  CsrUint8Des((u8 *) &primitive->powerConfig.d3AutoScanMode, buffer, &offset);
4113  CsrUint8Des((u8 *) &primitive->powerConfig.clientTrafficWindow, buffer, &offset);
4114  CsrUint8Des((u8 *) &primitive->powerConfig.opportunisticPowerSave, buffer, &offset);
4115  CsrUint8Des((u8 *) &primitive->powerConfig.noticeOfAbsence, buffer, &offset);
4116 
4117  return primitive;
4118 }
4119 
4120 
4122 {
4123  size_t bufferSize = 2;
4124 
4125  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 10) */
4126  bufferSize += 2; /* CsrResult primitive->status */
4127  bufferSize += 1; /* u8 primitive->regDomInfo.dot11MultiDomainCapabilityImplemented */
4128  bufferSize += 1; /* u8 primitive->regDomInfo.dot11MultiDomainCapabilityEnabled */
4129  bufferSize += 1; /* CsrWifiSmeRegulatoryDomain primitive->regDomInfo.currentRegulatoryDomain */
4130  bufferSize += 2; /* u8 primitive->regDomInfo.currentCountryCode[2] */
4131  return bufferSize;
4132 }
4133 
4134 
4136 {
4138  *len = 0;
4139  CsrUint16Ser(ptr, len, primitive->common.type);
4140  CsrUint16Ser(ptr, len, (u16) primitive->status);
4143  CsrUint8Ser(ptr, len, (u8) primitive->regDomInfo.currentRegulatoryDomain);
4144  CsrMemCpySer(ptr, len, (const void *) primitive->regDomInfo.currentCountryCode, ((u16) (2)));
4145  return(ptr);
4146 }
4147 
4148 
4150 {
4152  size_t offset;
4153  offset = 0;
4154 
4155  CsrUint16Des(&primitive->common.type, buffer, &offset);
4156  CsrUint16Des((u16 *) &primitive->status, buffer, &offset);
4157  CsrUint8Des((u8 *) &primitive->regDomInfo.dot11MultiDomainCapabilityImplemented, buffer, &offset);
4158  CsrUint8Des((u8 *) &primitive->regDomInfo.dot11MultiDomainCapabilityEnabled, buffer, &offset);
4159  CsrUint8Des((u8 *) &primitive->regDomInfo.currentRegulatoryDomain, buffer, &offset);
4160  CsrMemCpyDes(primitive->regDomInfo.currentCountryCode, buffer, &offset, ((u16) (2)));
4161 
4162  return primitive;
4163 }
4164 
4165 
4167 {
4168  size_t bufferSize = 2;
4169 
4170  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 7) */
4171  bufferSize += 2; /* u16 primitive->interfaceTag */
4172  bufferSize += 2; /* CsrResult primitive->status */
4173  return bufferSize;
4174 }
4175 
4176 
4177 u8* CsrWifiSmeRoamCompleteIndSer(u8 *ptr, size_t *len, void *msg)
4178 {
4180  *len = 0;
4181  CsrUint16Ser(ptr, len, primitive->common.type);
4182  CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag);
4183  CsrUint16Ser(ptr, len, (u16) primitive->status);
4184  return(ptr);
4185 }
4186 
4187 
4189 {
4191  size_t offset;
4192  offset = 0;
4193 
4194  CsrUint16Des(&primitive->common.type, buffer, &offset);
4195  CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset);
4196  CsrUint16Des((u16 *) &primitive->status, buffer, &offset);
4197 
4198  return primitive;
4199 }
4200 
4201 
4203 {
4204  size_t bufferSize = 2;
4205 
4206  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 8) */
4207  bufferSize += 2; /* u16 primitive->interfaceTag */
4208  bufferSize += 1; /* CsrWifiSmeRoamReason primitive->roamReason */
4209  bufferSize += 2; /* CsrWifiSmeIEEE80211Reason primitive->reason80211 */
4210  return bufferSize;
4211 }
4212 
4213 
4214 u8* CsrWifiSmeRoamStartIndSer(u8 *ptr, size_t *len, void *msg)
4215 {
4216  CsrWifiSmeRoamStartInd *primitive = (CsrWifiSmeRoamStartInd *)msg;
4217  *len = 0;
4218  CsrUint16Ser(ptr, len, primitive->common.type);
4219  CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag);
4220  CsrUint8Ser(ptr, len, (u8) primitive->roamReason);
4221  CsrUint16Ser(ptr, len, (u16) primitive->reason80211);
4222  return(ptr);
4223 }
4224 
4225 
4227 {
4229  size_t offset;
4230  offset = 0;
4231 
4232  CsrUint16Des(&primitive->common.type, buffer, &offset);
4233  CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset);
4234  CsrUint8Des((u8 *) &primitive->roamReason, buffer, &offset);
4235  CsrUint16Des((u16 *) &primitive->reason80211, buffer, &offset);
4236 
4237  return primitive;
4238 }
4239 
4240 
4242 {
4243  size_t bufferSize = 2;
4244 
4245  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 72) */
4246  bufferSize += 2; /* u16 primitive->interfaceTag */
4247  bufferSize += 2; /* CsrResult primitive->status */
4248  {
4249  u16 i2;
4250  for (i2 = 0; i2 < 3; i2++)
4251  {
4252  bufferSize += 2; /* s16 primitive->roamingConfig.roamingBands[i2].rssiHighThreshold */
4253  bufferSize += 2; /* s16 primitive->roamingConfig.roamingBands[i2].rssiLowThreshold */
4254  bufferSize += 2; /* s16 primitive->roamingConfig.roamingBands[i2].snrHighThreshold */
4255  bufferSize += 2; /* s16 primitive->roamingConfig.roamingBands[i2].snrLowThreshold */
4256  }
4257  }
4258  bufferSize += 1; /* u8 primitive->roamingConfig.disableSmoothRoaming */
4259  bufferSize += 1; /* u8 primitive->roamingConfig.disableRoamScans */
4260  bufferSize += 1; /* u8 primitive->roamingConfig.reconnectLimit */
4261  bufferSize += 2; /* u16 primitive->roamingConfig.reconnectLimitIntervalMs */
4262  {
4263  u16 i2;
4264  for (i2 = 0; i2 < 3; i2++)
4265  {
4266  bufferSize += 2; /* u16 primitive->roamingConfig.roamScanCfg[i2].intervalSeconds */
4267  bufferSize += 2; /* u16 primitive->roamingConfig.roamScanCfg[i2].validitySeconds */
4268  bufferSize += 2; /* u16 primitive->roamingConfig.roamScanCfg[i2].minActiveChannelTimeTu */
4269  bufferSize += 2; /* u16 primitive->roamingConfig.roamScanCfg[i2].maxActiveChannelTimeTu */
4270  bufferSize += 2; /* u16 primitive->roamingConfig.roamScanCfg[i2].minPassiveChannelTimeTu */
4271  bufferSize += 2; /* u16 primitive->roamingConfig.roamScanCfg[i2].maxPassiveChannelTimeTu */
4272  }
4273  }
4274  return bufferSize;
4275 }
4276 
4277 
4279 {
4281  *len = 0;
4282  CsrUint16Ser(ptr, len, primitive->common.type);
4283  CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag);
4284  CsrUint16Ser(ptr, len, (u16) primitive->status);
4285  {
4286  u16 i2;
4287  for (i2 = 0; i2 < 3; i2++)
4288  {
4289  CsrUint16Ser(ptr, len, (u16) primitive->roamingConfig.roamingBands[i2].rssiHighThreshold);
4290  CsrUint16Ser(ptr, len, (u16) primitive->roamingConfig.roamingBands[i2].rssiLowThreshold);
4291  CsrUint16Ser(ptr, len, (u16) primitive->roamingConfig.roamingBands[i2].snrHighThreshold);
4292  CsrUint16Ser(ptr, len, (u16) primitive->roamingConfig.roamingBands[i2].snrLowThreshold);
4293  }
4294  }
4295  CsrUint8Ser(ptr, len, (u8) primitive->roamingConfig.disableSmoothRoaming);
4296  CsrUint8Ser(ptr, len, (u8) primitive->roamingConfig.disableRoamScans);
4297  CsrUint8Ser(ptr, len, (u8) primitive->roamingConfig.reconnectLimit);
4298  CsrUint16Ser(ptr, len, (u16) primitive->roamingConfig.reconnectLimitIntervalMs);
4299  {
4300  u16 i2;
4301  for (i2 = 0; i2 < 3; i2++)
4302  {
4303  CsrUint16Ser(ptr, len, (u16) primitive->roamingConfig.roamScanCfg[i2].intervalSeconds);
4304  CsrUint16Ser(ptr, len, (u16) primitive->roamingConfig.roamScanCfg[i2].validitySeconds);
4305  CsrUint16Ser(ptr, len, (u16) primitive->roamingConfig.roamScanCfg[i2].minActiveChannelTimeTu);
4306  CsrUint16Ser(ptr, len, (u16) primitive->roamingConfig.roamScanCfg[i2].maxActiveChannelTimeTu);
4309  }
4310  }
4311  return(ptr);
4312 }
4313 
4314 
4316 {
4318  size_t offset;
4319  offset = 0;
4320 
4321  CsrUint16Des(&primitive->common.type, buffer, &offset);
4322  CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset);
4323  CsrUint16Des((u16 *) &primitive->status, buffer, &offset);
4324  {
4325  u16 i2;
4326  for (i2 = 0; i2 < 3; i2++)
4327  {
4328  CsrUint16Des((u16 *) &primitive->roamingConfig.roamingBands[i2].rssiHighThreshold, buffer, &offset);
4329  CsrUint16Des((u16 *) &primitive->roamingConfig.roamingBands[i2].rssiLowThreshold, buffer, &offset);
4330  CsrUint16Des((u16 *) &primitive->roamingConfig.roamingBands[i2].snrHighThreshold, buffer, &offset);
4331  CsrUint16Des((u16 *) &primitive->roamingConfig.roamingBands[i2].snrLowThreshold, buffer, &offset);
4332  }
4333  }
4334  CsrUint8Des((u8 *) &primitive->roamingConfig.disableSmoothRoaming, buffer, &offset);
4335  CsrUint8Des((u8 *) &primitive->roamingConfig.disableRoamScans, buffer, &offset);
4336  CsrUint8Des((u8 *) &primitive->roamingConfig.reconnectLimit, buffer, &offset);
4337  CsrUint16Des((u16 *) &primitive->roamingConfig.reconnectLimitIntervalMs, buffer, &offset);
4338  {
4339  u16 i2;
4340  for (i2 = 0; i2 < 3; i2++)
4341  {
4342  CsrUint16Des((u16 *) &primitive->roamingConfig.roamScanCfg[i2].intervalSeconds, buffer, &offset);
4343  CsrUint16Des((u16 *) &primitive->roamingConfig.roamScanCfg[i2].validitySeconds, buffer, &offset);
4344  CsrUint16Des((u16 *) &primitive->roamingConfig.roamScanCfg[i2].minActiveChannelTimeTu, buffer, &offset);
4345  CsrUint16Des((u16 *) &primitive->roamingConfig.roamScanCfg[i2].maxActiveChannelTimeTu, buffer, &offset);
4346  CsrUint16Des((u16 *) &primitive->roamingConfig.roamScanCfg[i2].minPassiveChannelTimeTu, buffer, &offset);
4347  CsrUint16Des((u16 *) &primitive->roamingConfig.roamScanCfg[i2].maxPassiveChannelTimeTu, buffer, &offset);
4348  }
4349  }
4350 
4351  return primitive;
4352 }
4353 
4354 
4356 {
4357  size_t bufferSize = 2;
4358 
4359  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 7) */
4360  bufferSize += 2; /* u16 primitive->interfaceTag */
4361  bufferSize += 2; /* CsrResult primitive->status */
4362  return bufferSize;
4363 }
4364 
4365 
4367 {
4369  *len = 0;
4370  CsrUint16Ser(ptr, len, primitive->common.type);
4371  CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag);
4372  CsrUint16Ser(ptr, len, (u16) primitive->status);
4373  return(ptr);
4374 }
4375 
4376 
4378 {
4380  size_t offset;
4381  offset = 0;
4382 
4383  CsrUint16Des(&primitive->common.type, buffer, &offset);
4384  CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset);
4385  CsrUint16Des((u16 *) &primitive->status, buffer, &offset);
4386 
4387  return primitive;
4388 }
4389 
4390 
4392 {
4394  size_t bufferSize = 2;
4395 
4396  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 65) */
4397  bufferSize += 2; /* CsrResult primitive->status */
4398  {
4399  u16 i2;
4400  for (i2 = 0; i2 < 4; i2++)
4401  {
4402  bufferSize += 2; /* u16 primitive->scanConfig.scanCfg[i2].intervalSeconds */
4403  bufferSize += 2; /* u16 primitive->scanConfig.scanCfg[i2].validitySeconds */
4404  bufferSize += 2; /* u16 primitive->scanConfig.scanCfg[i2].minActiveChannelTimeTu */
4405  bufferSize += 2; /* u16 primitive->scanConfig.scanCfg[i2].maxActiveChannelTimeTu */
4406  bufferSize += 2; /* u16 primitive->scanConfig.scanCfg[i2].minPassiveChannelTimeTu */
4407  bufferSize += 2; /* u16 primitive->scanConfig.scanCfg[i2].maxPassiveChannelTimeTu */
4408  }
4409  }
4410  bufferSize += 1; /* u8 primitive->scanConfig.disableAutonomousScans */
4411  bufferSize += 2; /* u16 primitive->scanConfig.maxResults */
4412  bufferSize += 1; /* s8 primitive->scanConfig.highRssiThreshold */
4413  bufferSize += 1; /* s8 primitive->scanConfig.lowRssiThreshold */
4414  bufferSize += 1; /* s8 primitive->scanConfig.deltaRssiThreshold */
4415  bufferSize += 1; /* s8 primitive->scanConfig.highSnrThreshold */
4416  bufferSize += 1; /* s8 primitive->scanConfig.lowSnrThreshold */
4417  bufferSize += 1; /* s8 primitive->scanConfig.deltaSnrThreshold */
4418  bufferSize += 2; /* u16 primitive->scanConfig.passiveChannelListCount */
4419  bufferSize += primitive->scanConfig.passiveChannelListCount; /* u8 primitive->scanConfig.passiveChannelList */
4420  return bufferSize;
4421 }
4422 
4423 
4425 {
4427  *len = 0;
4428  CsrUint16Ser(ptr, len, primitive->common.type);
4429  CsrUint16Ser(ptr, len, (u16) primitive->status);
4430  {
4431  u16 i2;
4432  for (i2 = 0; i2 < 4; i2++)
4433  {
4434  CsrUint16Ser(ptr, len, (u16) primitive->scanConfig.scanCfg[i2].intervalSeconds);
4435  CsrUint16Ser(ptr, len, (u16) primitive->scanConfig.scanCfg[i2].validitySeconds);
4436  CsrUint16Ser(ptr, len, (u16) primitive->scanConfig.scanCfg[i2].minActiveChannelTimeTu);
4437  CsrUint16Ser(ptr, len, (u16) primitive->scanConfig.scanCfg[i2].maxActiveChannelTimeTu);
4438  CsrUint16Ser(ptr, len, (u16) primitive->scanConfig.scanCfg[i2].minPassiveChannelTimeTu);
4439  CsrUint16Ser(ptr, len, (u16) primitive->scanConfig.scanCfg[i2].maxPassiveChannelTimeTu);
4440  }
4441  }
4442  CsrUint8Ser(ptr, len, (u8) primitive->scanConfig.disableAutonomousScans);
4443  CsrUint16Ser(ptr, len, (u16) primitive->scanConfig.maxResults);
4444  CsrUint8Ser(ptr, len, (u8) primitive->scanConfig.highRssiThreshold);
4445  CsrUint8Ser(ptr, len, (u8) primitive->scanConfig.lowRssiThreshold);
4446  CsrUint8Ser(ptr, len, (u8) primitive->scanConfig.deltaRssiThreshold);
4447  CsrUint8Ser(ptr, len, (u8) primitive->scanConfig.highSnrThreshold);
4448  CsrUint8Ser(ptr, len, (u8) primitive->scanConfig.lowSnrThreshold);
4449  CsrUint8Ser(ptr, len, (u8) primitive->scanConfig.deltaSnrThreshold);
4450  CsrUint16Ser(ptr, len, (u16) primitive->scanConfig.passiveChannelListCount);
4451  if (primitive->scanConfig.passiveChannelListCount)
4452  {
4453  CsrMemCpySer(ptr, len, (const void *) primitive->scanConfig.passiveChannelList, ((u16) (primitive->scanConfig.passiveChannelListCount)));
4454  }
4455  return(ptr);
4456 }
4457 
4458 
4460 {
4462  size_t offset;
4463  offset = 0;
4464 
4465  CsrUint16Des(&primitive->common.type, buffer, &offset);
4466  CsrUint16Des((u16 *) &primitive->status, buffer, &offset);
4467  {
4468  u16 i2;
4469  for (i2 = 0; i2 < 4; i2++)
4470  {
4471  CsrUint16Des((u16 *) &primitive->scanConfig.scanCfg[i2].intervalSeconds, buffer, &offset);
4472  CsrUint16Des((u16 *) &primitive->scanConfig.scanCfg[i2].validitySeconds, buffer, &offset);
4473  CsrUint16Des((u16 *) &primitive->scanConfig.scanCfg[i2].minActiveChannelTimeTu, buffer, &offset);
4474  CsrUint16Des((u16 *) &primitive->scanConfig.scanCfg[i2].maxActiveChannelTimeTu, buffer, &offset);
4475  CsrUint16Des((u16 *) &primitive->scanConfig.scanCfg[i2].minPassiveChannelTimeTu, buffer, &offset);
4476  CsrUint16Des((u16 *) &primitive->scanConfig.scanCfg[i2].maxPassiveChannelTimeTu, buffer, &offset);
4477  }
4478  }
4479  CsrUint8Des((u8 *) &primitive->scanConfig.disableAutonomousScans, buffer, &offset);
4480  CsrUint16Des((u16 *) &primitive->scanConfig.maxResults, buffer, &offset);
4481  CsrUint8Des((u8 *) &primitive->scanConfig.highRssiThreshold, buffer, &offset);
4482  CsrUint8Des((u8 *) &primitive->scanConfig.lowRssiThreshold, buffer, &offset);
4483  CsrUint8Des((u8 *) &primitive->scanConfig.deltaRssiThreshold, buffer, &offset);
4484  CsrUint8Des((u8 *) &primitive->scanConfig.highSnrThreshold, buffer, &offset);
4485  CsrUint8Des((u8 *) &primitive->scanConfig.lowSnrThreshold, buffer, &offset);
4486  CsrUint8Des((u8 *) &primitive->scanConfig.deltaSnrThreshold, buffer, &offset);
4487  CsrUint16Des((u16 *) &primitive->scanConfig.passiveChannelListCount, buffer, &offset);
4488  if (primitive->scanConfig.passiveChannelListCount)
4489  {
4491  CsrMemCpyDes(primitive->scanConfig.passiveChannelList, buffer, &offset, ((u16) (primitive->scanConfig.passiveChannelListCount)));
4492  }
4493  else
4494  {
4495  primitive->scanConfig.passiveChannelList = NULL;
4496  }
4497 
4498  return primitive;
4499 }
4500 
4501 
4502 void CsrWifiSmeScanConfigGetCfmSerFree(void *voidPrimitivePointer)
4503 {
4504  CsrWifiSmeScanConfigGetCfm *primitive = (CsrWifiSmeScanConfigGetCfm *) voidPrimitivePointer;
4505  kfree(primitive->scanConfig.passiveChannelList);
4506  kfree(primitive);
4507 }
4508 
4509 
4511 {
4512  CsrWifiSmeScanResultInd *primitive = (CsrWifiSmeScanResultInd *) msg;
4513  size_t bufferSize = 2;
4514 
4515  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 149) */
4516  bufferSize += 32; /* u8 primitive->result.ssid.ssid[32] */
4517  bufferSize += 1; /* u8 primitive->result.ssid.length */
4518  bufferSize += 6; /* u8 primitive->result.bssid.a[6] */
4519  bufferSize += 2; /* s16 primitive->result.rssi */
4520  bufferSize += 2; /* s16 primitive->result.snr */
4521  bufferSize += 1; /* CsrWifiSmeRadioIF primitive->result.ifIndex */
4522  bufferSize += 2; /* u16 primitive->result.beaconPeriodTu */
4523  bufferSize += 8; /* u8 primitive->result.timeStamp.data[8] */
4524  bufferSize += 8; /* u8 primitive->result.localTime.data[8] */
4525  bufferSize += 2; /* u16 primitive->result.channelFrequency */
4526  bufferSize += 2; /* u16 primitive->result.capabilityInformation */
4527  bufferSize += 1; /* u8 primitive->result.channelNumber */
4528  bufferSize += 1; /* CsrWifiSmeBasicUsability primitive->result.usability */
4529  bufferSize += 1; /* CsrWifiSmeBssType primitive->result.bssType */
4530  bufferSize += 2; /* u16 primitive->result.informationElementsLength */
4531  bufferSize += primitive->result.informationElementsLength; /* u8 primitive->result.informationElements */
4532  bufferSize += 1; /* CsrWifiSmeP2pRole primitive->result.p2pDeviceRole */
4533  switch (primitive->result.p2pDeviceRole)
4534  {
4536  bufferSize += 1; /* u8 primitive->result.deviceInfo.reservedCli.empty */
4537  break;
4539  bufferSize += 1; /* CsrWifiSmeP2pGroupCapabilityMask primitive->result.deviceInfo.groupInfo.groupCapability */
4540  bufferSize += 6; /* u8 primitive->result.deviceInfo.groupInfo.p2pDeviceAddress.a[6] */
4541  bufferSize += 1; /* u8 primitive->result.deviceInfo.groupInfo.p2pClientInfoCount */
4542  {
4543  u16 i4;
4544  for (i4 = 0; i4 < primitive->result.deviceInfo.groupInfo.p2pClientInfoCount; i4++)
4545  {
4546  bufferSize += 6; /* u8 primitive->result.deviceInfo.groupInfo.p2PClientInfo[i4].p2PClientInterfaceAddress.a[6] */
4547  bufferSize += 6; /* u8 primitive->result.deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.deviceAddress.a[6] */
4548  bufferSize += 2; /* CsrWifiSmeWpsConfigTypeMask primitive->result.deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.configMethods */
4549  bufferSize += 1; /* CsrWifiSmeP2pCapabilityMask primitive->result.deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.p2PDeviceCap */
4550  bufferSize += 8; /* u8 primitive->result.deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.primDeviceType.deviceDetails[8] */
4551  bufferSize += 1; /* u8 primitive->result.deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.secondaryDeviceTypeCount */
4552  {
4553  u16 i6;
4554  for (i6 = 0; i6 < primitive->result.deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.secondaryDeviceTypeCount; i6++)
4555  {
4556  bufferSize += 8; /* u8 primitive->result.deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.secDeviceType[i6].deviceDetails[8] */
4557  }
4558  }
4559  bufferSize += 32; /* u8 primitive->result.deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.deviceName[32] */
4560  bufferSize += 1; /* u8 primitive->result.deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.deviceNameLength */
4561  }
4562  }
4563  break;
4565  bufferSize += 1; /* u8 primitive->result.deviceInfo.reservedNone.empty */
4566  break;
4568  bufferSize += 6; /* u8 primitive->result.deviceInfo.standalonedevInfo.deviceAddress.a[6] */
4569  bufferSize += 2; /* CsrWifiSmeWpsConfigTypeMask primitive->result.deviceInfo.standalonedevInfo.configMethods */
4570  bufferSize += 1; /* CsrWifiSmeP2pCapabilityMask primitive->result.deviceInfo.standalonedevInfo.p2PDeviceCap */
4571  bufferSize += 8; /* u8 primitive->result.deviceInfo.standalonedevInfo.primDeviceType.deviceDetails[8] */
4572  bufferSize += 1; /* u8 primitive->result.deviceInfo.standalonedevInfo.secondaryDeviceTypeCount */
4573  {
4574  u16 i4;
4575  for (i4 = 0; i4 < primitive->result.deviceInfo.standalonedevInfo.secondaryDeviceTypeCount; i4++)
4576  {
4577  bufferSize += 8; /* u8 primitive->result.deviceInfo.standalonedevInfo.secDeviceType[i4].deviceDetails[8] */
4578  }
4579  }
4580  bufferSize += 32; /* u8 primitive->result.deviceInfo.standalonedevInfo.deviceName[32] */
4581  bufferSize += 1; /* u8 primitive->result.deviceInfo.standalonedevInfo.deviceNameLength */
4582  break;
4583  default:
4584  break;
4585  }
4586  return bufferSize;
4587 }
4588 
4589 
4590 u8* CsrWifiSmeScanResultIndSer(u8 *ptr, size_t *len, void *msg)
4591 {
4593  *len = 0;
4594  CsrUint16Ser(ptr, len, primitive->common.type);
4595  CsrMemCpySer(ptr, len, (const void *) primitive->result.ssid.ssid, ((u16) (32)));
4596  CsrUint8Ser(ptr, len, (u8) primitive->result.ssid.length);
4597  CsrMemCpySer(ptr, len, (const void *) primitive->result.bssid.a, ((u16) (6)));
4598  CsrUint16Ser(ptr, len, (u16) primitive->result.rssi);
4599  CsrUint16Ser(ptr, len, (u16) primitive->result.snr);
4600  CsrUint8Ser(ptr, len, (u8) primitive->result.ifIndex);
4601  CsrUint16Ser(ptr, len, (u16) primitive->result.beaconPeriodTu);
4602  CsrMemCpySer(ptr, len, (const void *) primitive->result.timeStamp.data, ((u16) (8)));
4603  CsrMemCpySer(ptr, len, (const void *) primitive->result.localTime.data, ((u16) (8)));
4604  CsrUint16Ser(ptr, len, (u16) primitive->result.channelFrequency);
4605  CsrUint16Ser(ptr, len, (u16) primitive->result.capabilityInformation);
4606  CsrUint8Ser(ptr, len, (u8) primitive->result.channelNumber);
4607  CsrUint8Ser(ptr, len, (u8) primitive->result.usability);
4608  CsrUint8Ser(ptr, len, (u8) primitive->result.bssType);
4609  CsrUint16Ser(ptr, len, (u16) primitive->result.informationElementsLength);
4610  if (primitive->result.informationElementsLength)
4611  {
4612  CsrMemCpySer(ptr, len, (const void *) primitive->result.informationElements, ((u16) (primitive->result.informationElementsLength)));
4613  }
4614  CsrUint8Ser(ptr, len, (u8) primitive->result.p2pDeviceRole);
4615  switch (primitive->result.p2pDeviceRole)
4616  {
4618  CsrUint8Ser(ptr, len, (u8) primitive->result.deviceInfo.reservedCli.empty);
4619  break;
4621  CsrUint8Ser(ptr, len, (u8) primitive->result.deviceInfo.groupInfo.groupCapability);
4622  CsrMemCpySer(ptr, len, (const void *) primitive->result.deviceInfo.groupInfo.p2pDeviceAddress.a, ((u16) (6)));
4623  CsrUint8Ser(ptr, len, (u8) primitive->result.deviceInfo.groupInfo.p2pClientInfoCount);
4624  {
4625  u16 i4;
4626  for (i4 = 0; i4 < primitive->result.deviceInfo.groupInfo.p2pClientInfoCount; i4++)
4627  {
4628  CsrMemCpySer(ptr, len, (const void *) primitive->result.deviceInfo.groupInfo.p2PClientInfo[i4].p2PClientInterfaceAddress.a, ((u16) (6)));
4629  CsrMemCpySer(ptr, len, (const void *) primitive->result.deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.deviceAddress.a, ((u16) (6)));
4632  CsrMemCpySer(ptr, len, (const void *) primitive->result.deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.primDeviceType.deviceDetails, ((u16) (8)));
4634  {
4635  u16 i6;
4636  for (i6 = 0; i6 < primitive->result.deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.secondaryDeviceTypeCount; i6++)
4637  {
4638  CsrMemCpySer(ptr, len, (const void *) primitive->result.deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.secDeviceType[i6].deviceDetails, ((u16) (8)));
4639  }
4640  }
4641  CsrMemCpySer(ptr, len, (const void *) primitive->result.deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.deviceName, ((u16) (32)));
4643  }
4644  }
4645  break;
4647  CsrUint8Ser(ptr, len, (u8) primitive->result.deviceInfo.reservedNone.empty);
4648  break;
4650  CsrMemCpySer(ptr, len, (const void *) primitive->result.deviceInfo.standalonedevInfo.deviceAddress.a, ((u16) (6)));
4653  CsrMemCpySer(ptr, len, (const void *) primitive->result.deviceInfo.standalonedevInfo.primDeviceType.deviceDetails, ((u16) (8)));
4655  {
4656  u16 i4;
4657  for (i4 = 0; i4 < primitive->result.deviceInfo.standalonedevInfo.secondaryDeviceTypeCount; i4++)
4658  {
4659  CsrMemCpySer(ptr, len, (const void *) primitive->result.deviceInfo.standalonedevInfo.secDeviceType[i4].deviceDetails, ((u16) (8)));
4660  }
4661  }
4662  CsrMemCpySer(ptr, len, (const void *) primitive->result.deviceInfo.standalonedevInfo.deviceName, ((u16) (32)));
4664  break;
4665  default:
4666  break;
4667  }
4668  return(ptr);
4669 }
4670 
4671 
4673 {
4675  size_t offset;
4676  offset = 0;
4677 
4678  CsrUint16Des(&primitive->common.type, buffer, &offset);
4679  CsrMemCpyDes(primitive->result.ssid.ssid, buffer, &offset, ((u16) (32)));
4680  CsrUint8Des((u8 *) &primitive->result.ssid.length, buffer, &offset);
4681  CsrMemCpyDes(primitive->result.bssid.a, buffer, &offset, ((u16) (6)));
4682  CsrUint16Des((u16 *) &primitive->result.rssi, buffer, &offset);
4683  CsrUint16Des((u16 *) &primitive->result.snr, buffer, &offset);
4684  CsrUint8Des((u8 *) &primitive->result.ifIndex, buffer, &offset);
4685  CsrUint16Des((u16 *) &primitive->result.beaconPeriodTu, buffer, &offset);
4686  CsrMemCpyDes(primitive->result.timeStamp.data, buffer, &offset, ((u16) (8)));
4687  CsrMemCpyDes(primitive->result.localTime.data, buffer, &offset, ((u16) (8)));
4688  CsrUint16Des((u16 *) &primitive->result.channelFrequency, buffer, &offset);
4689  CsrUint16Des((u16 *) &primitive->result.capabilityInformation, buffer, &offset);
4690  CsrUint8Des((u8 *) &primitive->result.channelNumber, buffer, &offset);
4691  CsrUint8Des((u8 *) &primitive->result.usability, buffer, &offset);
4692  CsrUint8Des((u8 *) &primitive->result.bssType, buffer, &offset);
4693  CsrUint16Des((u16 *) &primitive->result.informationElementsLength, buffer, &offset);
4694  if (primitive->result.informationElementsLength)
4695  {
4697  CsrMemCpyDes(primitive->result.informationElements, buffer, &offset, ((u16) (primitive->result.informationElementsLength)));
4698  }
4699  else
4700  {
4701  primitive->result.informationElements = NULL;
4702  }
4703  CsrUint8Des((u8 *) &primitive->result.p2pDeviceRole, buffer, &offset);
4704  switch (primitive->result.p2pDeviceRole)
4705  {
4707  CsrUint8Des((u8 *) &primitive->result.deviceInfo.reservedCli.empty, buffer, &offset);
4708  break;
4710  CsrUint8Des((u8 *) &primitive->result.deviceInfo.groupInfo.groupCapability, buffer, &offset);
4711  CsrMemCpyDes(primitive->result.deviceInfo.groupInfo.p2pDeviceAddress.a, buffer, &offset, ((u16) (6)));
4712  CsrUint8Des((u8 *) &primitive->result.deviceInfo.groupInfo.p2pClientInfoCount, buffer, &offset);
4715  {
4717  }
4718  {
4719  u16 i4;
4720  for (i4 = 0; i4 < primitive->result.deviceInfo.groupInfo.p2pClientInfoCount; i4++)
4721  {
4722  CsrMemCpyDes(primitive->result.deviceInfo.groupInfo.p2PClientInfo[i4].p2PClientInterfaceAddress.a, buffer, &offset, ((u16) (6)));
4723  CsrMemCpyDes(primitive->result.deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.deviceAddress.a, buffer, &offset, ((u16) (6)));
4725  CsrUint8Des((u8 *) &primitive->result.deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.p2PDeviceCap, buffer, &offset);
4730  {
4732  }
4733  {
4734  u16 i6;
4735  for (i6 = 0; i6 < primitive->result.deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.secondaryDeviceTypeCount; i6++)
4736  {
4738  }
4739  }
4740  CsrMemCpyDes(primitive->result.deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.deviceName, buffer, &offset, ((u16) (32)));
4742  }
4743  }
4744  break;
4746  CsrUint8Des((u8 *) &primitive->result.deviceInfo.reservedNone.empty, buffer, &offset);
4747  break;
4749  CsrMemCpyDes(primitive->result.deviceInfo.standalonedevInfo.deviceAddress.a, buffer, &offset, ((u16) (6)));
4750  CsrUint16Des((u16 *) &primitive->result.deviceInfo.standalonedevInfo.configMethods, buffer, &offset);
4751  CsrUint8Des((u8 *) &primitive->result.deviceInfo.standalonedevInfo.p2PDeviceCap, buffer, &offset);
4752  CsrMemCpyDes(primitive->result.deviceInfo.standalonedevInfo.primDeviceType.deviceDetails, buffer, &offset, ((u16) (8)));
4753  CsrUint8Des((u8 *) &primitive->result.deviceInfo.standalonedevInfo.secondaryDeviceTypeCount, buffer, &offset);
4756  {
4758  }
4759  {
4760  u16 i4;
4761  for (i4 = 0; i4 < primitive->result.deviceInfo.standalonedevInfo.secondaryDeviceTypeCount; i4++)
4762  {
4763  CsrMemCpyDes(primitive->result.deviceInfo.standalonedevInfo.secDeviceType[i4].deviceDetails, buffer, &offset, ((u16) (8)));
4764  }
4765  }
4766  CsrMemCpyDes(primitive->result.deviceInfo.standalonedevInfo.deviceName, buffer, &offset, ((u16) (32)));
4767  CsrUint8Des((u8 *) &primitive->result.deviceInfo.standalonedevInfo.deviceNameLength, buffer, &offset);
4768  break;
4769  default:
4770  break;
4771  }
4772 
4773  return primitive;
4774 }
4775 
4776 
4777 void CsrWifiSmeScanResultIndSerFree(void *voidPrimitivePointer)
4778 {
4779  CsrWifiSmeScanResultInd *primitive = (CsrWifiSmeScanResultInd *) voidPrimitivePointer;
4780  kfree(primitive->result.informationElements);
4781  switch (primitive->result.p2pDeviceRole)
4782  {
4784  {
4785  u16 i4;
4786  for (i4 = 0; i4 < primitive->result.deviceInfo.groupInfo.p2pClientInfoCount; i4++)
4787  {
4789  }
4790  }
4792  break;
4795  break;
4796  default:
4797  break;
4798  }
4799  kfree(primitive);
4800 }
4801 
4802 
4804 {
4806  size_t bufferSize = 2;
4807 
4808  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 153) */
4809  bufferSize += 2; /* CsrResult primitive->status */
4810  bufferSize += 2; /* u16 primitive->scanResultsCount */
4811  {
4812  u16 i1;
4813  for (i1 = 0; i1 < primitive->scanResultsCount; i1++)
4814  {
4815  bufferSize += 32; /* u8 primitive->scanResults[i1].ssid.ssid[32] */
4816  bufferSize += 1; /* u8 primitive->scanResults[i1].ssid.length */
4817  bufferSize += 6; /* u8 primitive->scanResults[i1].bssid.a[6] */
4818  bufferSize += 2; /* s16 primitive->scanResults[i1].rssi */
4819  bufferSize += 2; /* s16 primitive->scanResults[i1].snr */
4820  bufferSize += 1; /* CsrWifiSmeRadioIF primitive->scanResults[i1].ifIndex */
4821  bufferSize += 2; /* u16 primitive->scanResults[i1].beaconPeriodTu */
4822  bufferSize += 8; /* u8 primitive->scanResults[i1].timeStamp.data[8] */
4823  bufferSize += 8; /* u8 primitive->scanResults[i1].localTime.data[8] */
4824  bufferSize += 2; /* u16 primitive->scanResults[i1].channelFrequency */
4825  bufferSize += 2; /* u16 primitive->scanResults[i1].capabilityInformation */
4826  bufferSize += 1; /* u8 primitive->scanResults[i1].channelNumber */
4827  bufferSize += 1; /* CsrWifiSmeBasicUsability primitive->scanResults[i1].usability */
4828  bufferSize += 1; /* CsrWifiSmeBssType primitive->scanResults[i1].bssType */
4829  bufferSize += 2; /* u16 primitive->scanResults[i1].informationElementsLength */
4830  bufferSize += primitive->scanResults[i1].informationElementsLength; /* u8 primitive->scanResults[i1].informationElements */
4831  bufferSize += 1; /* CsrWifiSmeP2pRole primitive->scanResults[i1].p2pDeviceRole */
4832  switch (primitive->scanResults[i1].p2pDeviceRole)
4833  {
4835  bufferSize += 1; /* u8 primitive->scanResults[i1].deviceInfo.reservedCli.empty */
4836  break;
4838  bufferSize += 1; /* CsrWifiSmeP2pGroupCapabilityMask primitive->scanResults[i1].deviceInfo.groupInfo.groupCapability */
4839  bufferSize += 6; /* u8 primitive->scanResults[i1].deviceInfo.groupInfo.p2pDeviceAddress.a[6] */
4840  bufferSize += 1; /* u8 primitive->scanResults[i1].deviceInfo.groupInfo.p2pClientInfoCount */
4841  {
4842  u16 i4;
4843  for (i4 = 0; i4 < primitive->scanResults[i1].deviceInfo.groupInfo.p2pClientInfoCount; i4++)
4844  {
4845  bufferSize += 6; /* u8 primitive->scanResults[i1].deviceInfo.groupInfo.p2PClientInfo[i4].p2PClientInterfaceAddress.a[6] */
4846  bufferSize += 6; /* u8 primitive->scanResults[i1].deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.deviceAddress.a[6] */
4847  bufferSize += 2; /* CsrWifiSmeWpsConfigTypeMask primitive->scanResults[i1].deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.configMethods */
4848  bufferSize += 1; /* CsrWifiSmeP2pCapabilityMask primitive->scanResults[i1].deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.p2PDeviceCap */
4849  bufferSize += 8; /* u8 primitive->scanResults[i1].deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.primDeviceType.deviceDetails[8] */
4850  bufferSize += 1; /* u8 primitive->scanResults[i1].deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.secondaryDeviceTypeCount */
4851  {
4852  u16 i6;
4853  for (i6 = 0; i6 < primitive->scanResults[i1].deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.secondaryDeviceTypeCount; i6++)
4854  {
4855  bufferSize += 8; /* u8 primitive->scanResults[i1].deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.secDeviceType[i6].deviceDetails[8] */
4856  }
4857  }
4858  bufferSize += 32; /* u8 primitive->scanResults[i1].deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.deviceName[32] */
4859  bufferSize += 1; /* u8 primitive->scanResults[i1].deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.deviceNameLength */
4860  }
4861  }
4862  break;
4864  bufferSize += 1; /* u8 primitive->scanResults[i1].deviceInfo.reservedNone.empty */
4865  break;
4867  bufferSize += 6; /* u8 primitive->scanResults[i1].deviceInfo.standalonedevInfo.deviceAddress.a[6] */
4868  bufferSize += 2; /* CsrWifiSmeWpsConfigTypeMask primitive->scanResults[i1].deviceInfo.standalonedevInfo.configMethods */
4869  bufferSize += 1; /* CsrWifiSmeP2pCapabilityMask primitive->scanResults[i1].deviceInfo.standalonedevInfo.p2PDeviceCap */
4870  bufferSize += 8; /* u8 primitive->scanResults[i1].deviceInfo.standalonedevInfo.primDeviceType.deviceDetails[8] */
4871  bufferSize += 1; /* u8 primitive->scanResults[i1].deviceInfo.standalonedevInfo.secondaryDeviceTypeCount */
4872  {
4873  u16 i4;
4874  for (i4 = 0; i4 < primitive->scanResults[i1].deviceInfo.standalonedevInfo.secondaryDeviceTypeCount; i4++)
4875  {
4876  bufferSize += 8; /* u8 primitive->scanResults[i1].deviceInfo.standalonedevInfo.secDeviceType[i4].deviceDetails[8] */
4877  }
4878  }
4879  bufferSize += 32; /* u8 primitive->scanResults[i1].deviceInfo.standalonedevInfo.deviceName[32] */
4880  bufferSize += 1; /* u8 primitive->scanResults[i1].deviceInfo.standalonedevInfo.deviceNameLength */
4881  break;
4882  default:
4883  break;
4884  }
4885  }
4886  }
4887  return bufferSize;
4888 }
4889 
4890 
4892 {
4894  *len = 0;
4895  CsrUint16Ser(ptr, len, primitive->common.type);
4896  CsrUint16Ser(ptr, len, (u16) primitive->status);
4897  CsrUint16Ser(ptr, len, (u16) primitive->scanResultsCount);
4898  {
4899  u16 i1;
4900  for (i1 = 0; i1 < primitive->scanResultsCount; i1++)
4901  {
4902  CsrMemCpySer(ptr, len, (const void *) primitive->scanResults[i1].ssid.ssid, ((u16) (32)));
4903  CsrUint8Ser(ptr, len, (u8) primitive->scanResults[i1].ssid.length);
4904  CsrMemCpySer(ptr, len, (const void *) primitive->scanResults[i1].bssid.a, ((u16) (6)));
4905  CsrUint16Ser(ptr, len, (u16) primitive->scanResults[i1].rssi);
4906  CsrUint16Ser(ptr, len, (u16) primitive->scanResults[i1].snr);
4907  CsrUint8Ser(ptr, len, (u8) primitive->scanResults[i1].ifIndex);
4908  CsrUint16Ser(ptr, len, (u16) primitive->scanResults[i1].beaconPeriodTu);
4909  CsrMemCpySer(ptr, len, (const void *) primitive->scanResults[i1].timeStamp.data, ((u16) (8)));
4910  CsrMemCpySer(ptr, len, (const void *) primitive->scanResults[i1].localTime.data, ((u16) (8)));
4911  CsrUint16Ser(ptr, len, (u16) primitive->scanResults[i1].channelFrequency);
4912  CsrUint16Ser(ptr, len, (u16) primitive->scanResults[i1].capabilityInformation);
4913  CsrUint8Ser(ptr, len, (u8) primitive->scanResults[i1].channelNumber);
4914  CsrUint8Ser(ptr, len, (u8) primitive->scanResults[i1].usability);
4915  CsrUint8Ser(ptr, len, (u8) primitive->scanResults[i1].bssType);
4916  CsrUint16Ser(ptr, len, (u16) primitive->scanResults[i1].informationElementsLength);
4917  if (primitive->scanResults[i1].informationElementsLength)
4918  {
4919  CsrMemCpySer(ptr, len, (const void *) primitive->scanResults[i1].informationElements, ((u16) (primitive->scanResults[i1].informationElementsLength)));
4920  }
4921  CsrUint8Ser(ptr, len, (u8) primitive->scanResults[i1].p2pDeviceRole);
4922  switch (primitive->scanResults[i1].p2pDeviceRole)
4923  {
4925  CsrUint8Ser(ptr, len, (u8) primitive->scanResults[i1].deviceInfo.reservedCli.empty);
4926  break;
4928  CsrUint8Ser(ptr, len, (u8) primitive->scanResults[i1].deviceInfo.groupInfo.groupCapability);
4929  CsrMemCpySer(ptr, len, (const void *) primitive->scanResults[i1].deviceInfo.groupInfo.p2pDeviceAddress.a, ((u16) (6)));
4930  CsrUint8Ser(ptr, len, (u8) primitive->scanResults[i1].deviceInfo.groupInfo.p2pClientInfoCount);
4931  {
4932  u16 i4;
4933  for (i4 = 0; i4 < primitive->scanResults[i1].deviceInfo.groupInfo.p2pClientInfoCount; i4++)
4934  {
4935  CsrMemCpySer(ptr, len, (const void *) primitive->scanResults[i1].deviceInfo.groupInfo.p2PClientInfo[i4].p2PClientInterfaceAddress.a, ((u16) (6)));
4936  CsrMemCpySer(ptr, len, (const void *) primitive->scanResults[i1].deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.deviceAddress.a, ((u16) (6)));
4939  CsrMemCpySer(ptr, len, (const void *) primitive->scanResults[i1].deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.primDeviceType.deviceDetails, ((u16) (8)));
4941  {
4942  u16 i6;
4943  for (i6 = 0; i6 < primitive->scanResults[i1].deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.secondaryDeviceTypeCount; i6++)
4944  {
4945  CsrMemCpySer(ptr, len, (const void *) primitive->scanResults[i1].deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.secDeviceType[i6].deviceDetails, ((u16) (8)));
4946  }
4947  }
4948  CsrMemCpySer(ptr, len, (const void *) primitive->scanResults[i1].deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.deviceName, ((u16) (32)));
4950  }
4951  }
4952  break;
4954  CsrUint8Ser(ptr, len, (u8) primitive->scanResults[i1].deviceInfo.reservedNone.empty);
4955  break;
4957  CsrMemCpySer(ptr, len, (const void *) primitive->scanResults[i1].deviceInfo.standalonedevInfo.deviceAddress.a, ((u16) (6)));
4959  CsrUint8Ser(ptr, len, (u8) primitive->scanResults[i1].deviceInfo.standalonedevInfo.p2PDeviceCap);
4960  CsrMemCpySer(ptr, len, (const void *) primitive->scanResults[i1].deviceInfo.standalonedevInfo.primDeviceType.deviceDetails, ((u16) (8)));
4962  {
4963  u16 i4;
4964  for (i4 = 0; i4 < primitive->scanResults[i1].deviceInfo.standalonedevInfo.secondaryDeviceTypeCount; i4++)
4965  {
4966  CsrMemCpySer(ptr, len, (const void *) primitive->scanResults[i1].deviceInfo.standalonedevInfo.secDeviceType[i4].deviceDetails, ((u16) (8)));
4967  }
4968  }
4969  CsrMemCpySer(ptr, len, (const void *) primitive->scanResults[i1].deviceInfo.standalonedevInfo.deviceName, ((u16) (32)));
4971  break;
4972  default:
4973  break;
4974  }
4975  }
4976  }
4977  return(ptr);
4978 }
4979 
4980 
4982 {
4984  size_t offset;
4985  offset = 0;
4986 
4987  CsrUint16Des(&primitive->common.type, buffer, &offset);
4988  CsrUint16Des((u16 *) &primitive->status, buffer, &offset);
4989  CsrUint16Des((u16 *) &primitive->scanResultsCount, buffer, &offset);
4990  primitive->scanResults = NULL;
4991  if (primitive->scanResultsCount)
4992  {
4993  primitive->scanResults = kmalloc(sizeof(CsrWifiSmeScanResult) * primitive->scanResultsCount, GFP_KERNEL);
4994  }
4995  {
4996  u16 i1;
4997  for (i1 = 0; i1 < primitive->scanResultsCount; i1++)
4998  {
4999  CsrMemCpyDes(primitive->scanResults[i1].ssid.ssid, buffer, &offset, ((u16) (32)));
5000  CsrUint8Des((u8 *) &primitive->scanResults[i1].ssid.length, buffer, &offset);
5001  CsrMemCpyDes(primitive->scanResults[i1].bssid.a, buffer, &offset, ((u16) (6)));
5002  CsrUint16Des((u16 *) &primitive->scanResults[i1].rssi, buffer, &offset);
5003  CsrUint16Des((u16 *) &primitive->scanResults[i1].snr, buffer, &offset);
5004  CsrUint8Des((u8 *) &primitive->scanResults[i1].ifIndex, buffer, &offset);
5005  CsrUint16Des((u16 *) &primitive->scanResults[i1].beaconPeriodTu, buffer, &offset);
5006  CsrMemCpyDes(primitive->scanResults[i1].timeStamp.data, buffer, &offset, ((u16) (8)));
5007  CsrMemCpyDes(primitive->scanResults[i1].localTime.data, buffer, &offset, ((u16) (8)));
5008  CsrUint16Des((u16 *) &primitive->scanResults[i1].channelFrequency, buffer, &offset);
5009  CsrUint16Des((u16 *) &primitive->scanResults[i1].capabilityInformation, buffer, &offset);
5010  CsrUint8Des((u8 *) &primitive->scanResults[i1].channelNumber, buffer, &offset);
5011  CsrUint8Des((u8 *) &primitive->scanResults[i1].usability, buffer, &offset);
5012  CsrUint8Des((u8 *) &primitive->scanResults[i1].bssType, buffer, &offset);
5013  CsrUint16Des((u16 *) &primitive->scanResults[i1].informationElementsLength, buffer, &offset);
5014  if (primitive->scanResults[i1].informationElementsLength)
5015  {
5017  CsrMemCpyDes(primitive->scanResults[i1].informationElements, buffer, &offset, ((u16) (primitive->scanResults[i1].informationElementsLength)));
5018  }
5019  else
5020  {
5021  primitive->scanResults[i1].informationElements = NULL;
5022  }
5023  CsrUint8Des((u8 *) &primitive->scanResults[i1].p2pDeviceRole, buffer, &offset);
5024  switch (primitive->scanResults[i1].p2pDeviceRole)
5025  {
5027  CsrUint8Des((u8 *) &primitive->scanResults[i1].deviceInfo.reservedCli.empty, buffer, &offset);
5028  break;
5030  CsrUint8Des((u8 *) &primitive->scanResults[i1].deviceInfo.groupInfo.groupCapability, buffer, &offset);
5031  CsrMemCpyDes(primitive->scanResults[i1].deviceInfo.groupInfo.p2pDeviceAddress.a, buffer, &offset, ((u16) (6)));
5032  CsrUint8Des((u8 *) &primitive->scanResults[i1].deviceInfo.groupInfo.p2pClientInfoCount, buffer, &offset);
5035  {
5037  }
5038  {
5039  u16 i4;
5040  for (i4 = 0; i4 < primitive->scanResults[i1].deviceInfo.groupInfo.p2pClientInfoCount; i4++)
5041  {
5042  CsrMemCpyDes(primitive->scanResults[i1].deviceInfo.groupInfo.p2PClientInfo[i4].p2PClientInterfaceAddress.a, buffer, &offset, ((u16) (6)));
5043  CsrMemCpyDes(primitive->scanResults[i1].deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.deviceAddress.a, buffer, &offset, ((u16) (6)));
5044  CsrUint16Des((u16 *) &primitive->scanResults[i1].deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.configMethods, buffer, &offset);
5045  CsrUint8Des((u8 *) &primitive->scanResults[i1].deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.p2PDeviceCap, buffer, &offset);
5050  {
5052  }
5053  {
5054  u16 i6;
5055  for (i6 = 0; i6 < primitive->scanResults[i1].deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.secondaryDeviceTypeCount; i6++)
5056  {
5057  CsrMemCpyDes(primitive->scanResults[i1].deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.secDeviceType[i6].deviceDetails, buffer, &offset, ((u16) (8)));
5058  }
5059  }
5060  CsrMemCpyDes(primitive->scanResults[i1].deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.deviceName, buffer, &offset, ((u16) (32)));
5062  }
5063  }
5064  break;
5066  CsrUint8Des((u8 *) &primitive->scanResults[i1].deviceInfo.reservedNone.empty, buffer, &offset);
5067  break;
5069  CsrMemCpyDes(primitive->scanResults[i1].deviceInfo.standalonedevInfo.deviceAddress.a, buffer, &offset, ((u16) (6)));
5070  CsrUint16Des((u16 *) &primitive->scanResults[i1].deviceInfo.standalonedevInfo.configMethods, buffer, &offset);
5071  CsrUint8Des((u8 *) &primitive->scanResults[i1].deviceInfo.standalonedevInfo.p2PDeviceCap, buffer, &offset);
5072  CsrMemCpyDes(primitive->scanResults[i1].deviceInfo.standalonedevInfo.primDeviceType.deviceDetails, buffer, &offset, ((u16) (8)));
5073  CsrUint8Des((u8 *) &primitive->scanResults[i1].deviceInfo.standalonedevInfo.secondaryDeviceTypeCount, buffer, &offset);
5076  {
5078  }
5079  {
5080  u16 i4;
5081  for (i4 = 0; i4 < primitive->scanResults[i1].deviceInfo.standalonedevInfo.secondaryDeviceTypeCount; i4++)
5082  {
5083  CsrMemCpyDes(primitive->scanResults[i1].deviceInfo.standalonedevInfo.secDeviceType[i4].deviceDetails, buffer, &offset, ((u16) (8)));
5084  }
5085  }
5086  CsrMemCpyDes(primitive->scanResults[i1].deviceInfo.standalonedevInfo.deviceName, buffer, &offset, ((u16) (32)));
5087  CsrUint8Des((u8 *) &primitive->scanResults[i1].deviceInfo.standalonedevInfo.deviceNameLength, buffer, &offset);
5088  break;
5089  default:
5090  break;
5091  }
5092  }
5093  }
5094 
5095  return primitive;
5096 }
5097 
5098 
5099 void CsrWifiSmeScanResultsGetCfmSerFree(void *voidPrimitivePointer)
5100 {
5101  CsrWifiSmeScanResultsGetCfm *primitive = (CsrWifiSmeScanResultsGetCfm *) voidPrimitivePointer;
5102  {
5103  u16 i1;
5104  for (i1 = 0; i1 < primitive->scanResultsCount; i1++)
5105  {
5106  kfree(primitive->scanResults[i1].informationElements);
5107  switch (primitive->scanResults[i1].p2pDeviceRole)
5108  {
5110  {
5111  u16 i4;
5112  for (i4 = 0; i4 < primitive->scanResults[i1].deviceInfo.groupInfo.p2pClientInfoCount; i4++)
5113  {
5115  }
5116  }
5118  break;
5121  break;
5122  default:
5123  break;
5124  }
5125  }
5126  }
5127  kfree(primitive->scanResults);
5128  kfree(primitive);
5129 }
5130 
5131 
5133 {
5134  size_t bufferSize = 2;
5135 
5136  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 13) */
5137  bufferSize += 2; /* u16 primitive->interfaceTag */
5138  bufferSize += 2; /* CsrResult primitive->status */
5139  bufferSize += 1; /* u8 primitive->smeConfig.connectionQualityRssiChangeTrigger */
5140  bufferSize += 1; /* u8 primitive->smeConfig.connectionQualitySnrChangeTrigger */
5141  bufferSize += 1; /* CsrWifiSmeWmmModeMask primitive->smeConfig.wmmModeMask */
5142  bufferSize += 1; /* CsrWifiSmeRadioIF primitive->smeConfig.ifIndex */
5143  bufferSize += 1; /* u8 primitive->smeConfig.allowUnicastUseGroupCipher */
5144  bufferSize += 1; /* u8 primitive->smeConfig.enableOpportunisticKeyCaching */
5145  return bufferSize;
5146 }
5147 
5148 
5150 {
5152  *len = 0;
5153  CsrUint16Ser(ptr, len, primitive->common.type);
5154  CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag);
5155  CsrUint16Ser(ptr, len, (u16) primitive->status);
5158  CsrUint8Ser(ptr, len, (u8) primitive->smeConfig.wmmModeMask);
5159  CsrUint8Ser(ptr, len, (u8) primitive->smeConfig.ifIndex);
5160  CsrUint8Ser(ptr, len, (u8) primitive->smeConfig.allowUnicastUseGroupCipher);
5161  CsrUint8Ser(ptr, len, (u8) primitive->smeConfig.enableOpportunisticKeyCaching);
5162  return(ptr);
5163 }
5164 
5165 
5167 {
5169  size_t offset;
5170  offset = 0;
5171 
5172  CsrUint16Des(&primitive->common.type, buffer, &offset);
5173  CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset);
5174  CsrUint16Des((u16 *) &primitive->status, buffer, &offset);
5175  CsrUint8Des((u8 *) &primitive->smeConfig.connectionQualityRssiChangeTrigger, buffer, &offset);
5176  CsrUint8Des((u8 *) &primitive->smeConfig.connectionQualitySnrChangeTrigger, buffer, &offset);
5177  CsrUint8Des((u8 *) &primitive->smeConfig.wmmModeMask, buffer, &offset);
5178  CsrUint8Des((u8 *) &primitive->smeConfig.ifIndex, buffer, &offset);
5179  CsrUint8Des((u8 *) &primitive->smeConfig.allowUnicastUseGroupCipher, buffer, &offset);
5180  CsrUint8Des((u8 *) &primitive->smeConfig.enableOpportunisticKeyCaching, buffer, &offset);
5181 
5182  return primitive;
5183 }
5184 
5185 
5187 {
5188  size_t bufferSize = 2;
5189 
5190  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 7) */
5191  bufferSize += 2; /* u16 primitive->interfaceTag */
5192  bufferSize += 2; /* CsrResult primitive->status */
5193  return bufferSize;
5194 }
5195 
5196 
5198 {
5200  *len = 0;
5201  CsrUint16Ser(ptr, len, primitive->common.type);
5202  CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag);
5203  CsrUint16Ser(ptr, len, (u16) primitive->status);
5204  return(ptr);
5205 }
5206 
5207 
5209 {
5211  size_t offset;
5212  offset = 0;
5213 
5214  CsrUint16Des(&primitive->common.type, buffer, &offset);
5215  CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset);
5216  CsrUint16Des((u16 *) &primitive->status, buffer, &offset);
5217 
5218  return primitive;
5219 }
5220 
5221 
5223 {
5224  size_t bufferSize = 2;
5225 
5226  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 17) */
5227  bufferSize += 2; /* CsrResult primitive->status */
5228  {
5229  u16 i1;
5230  for (i1 = 0; i1 < 2; i1++)
5231  {
5232  bufferSize += 6; /* u8 primitive->stationMacAddress[i1].a[6] */
5233  }
5234  }
5235  return bufferSize;
5236 }
5237 
5238 
5240 {
5242  *len = 0;
5243  CsrUint16Ser(ptr, len, primitive->common.type);
5244  CsrUint16Ser(ptr, len, (u16) primitive->status);
5245  {
5246  u16 i1;
5247  for (i1 = 0; i1 < 2; i1++)
5248  {
5249  CsrMemCpySer(ptr, len, (const void *) primitive->stationMacAddress[i1].a, ((u16) (6)));
5250  }
5251  }
5252  return(ptr);
5253 }
5254 
5255 
5257 {
5259  size_t offset;
5260  offset = 0;
5261 
5262  CsrUint16Des(&primitive->common.type, buffer, &offset);
5263  CsrUint16Des((u16 *) &primitive->status, buffer, &offset);
5264  {
5265  u16 i1;
5266  for (i1 = 0; i1 < 2; i1++)
5267  {
5268  CsrMemCpyDes(primitive->stationMacAddress[i1].a, buffer, &offset, ((u16) (6)));
5269  }
5270  }
5271 
5272  return primitive;
5273 }
5274 
5275 
5277 {
5278  CsrWifiSmeTspecInd *primitive = (CsrWifiSmeTspecInd *) msg;
5279  size_t bufferSize = 2;
5280 
5281  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 13) */
5282  bufferSize += 2; /* u16 primitive->interfaceTag */
5283  bufferSize += 4; /* u32 primitive->transactionId */
5284  bufferSize += 1; /* CsrWifiSmeTspecResultCode primitive->tspecResultCode */
5285  bufferSize += 2; /* u16 primitive->tspecLength */
5286  bufferSize += primitive->tspecLength; /* u8 primitive->tspec */
5287  return bufferSize;
5288 }
5289 
5290 
5291 u8* CsrWifiSmeTspecIndSer(u8 *ptr, size_t *len, void *msg)
5292 {
5293  CsrWifiSmeTspecInd *primitive = (CsrWifiSmeTspecInd *)msg;
5294  *len = 0;
5295  CsrUint16Ser(ptr, len, primitive->common.type);
5296  CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag);
5297  CsrUint32Ser(ptr, len, (u32) primitive->transactionId);
5298  CsrUint8Ser(ptr, len, (u8) primitive->tspecResultCode);
5299  CsrUint16Ser(ptr, len, (u16) primitive->tspecLength);
5300  if (primitive->tspecLength)
5301  {
5302  CsrMemCpySer(ptr, len, (const void *) primitive->tspec, ((u16) (primitive->tspecLength)));
5303  }
5304  return(ptr);
5305 }
5306 
5307 
5309 {
5311  size_t offset;
5312  offset = 0;
5313 
5314  CsrUint16Des(&primitive->common.type, buffer, &offset);
5315  CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset);
5316  CsrUint32Des((u32 *) &primitive->transactionId, buffer, &offset);
5317  CsrUint8Des((u8 *) &primitive->tspecResultCode, buffer, &offset);
5318  CsrUint16Des((u16 *) &primitive->tspecLength, buffer, &offset);
5319  if (primitive->tspecLength)
5320  {
5321  primitive->tspec = kmalloc(primitive->tspecLength, GFP_KERNEL);
5322  CsrMemCpyDes(primitive->tspec, buffer, &offset, ((u16) (primitive->tspecLength)));
5323  }
5324  else
5325  {
5326  primitive->tspec = NULL;
5327  }
5328 
5329  return primitive;
5330 }
5331 
5332 
5333 void CsrWifiSmeTspecIndSerFree(void *voidPrimitivePointer)
5334 {
5335  CsrWifiSmeTspecInd *primitive = (CsrWifiSmeTspecInd *) voidPrimitivePointer;
5336  kfree(primitive->tspec);
5337  kfree(primitive);
5338 }
5339 
5340 
5342 {
5343  CsrWifiSmeTspecCfm *primitive = (CsrWifiSmeTspecCfm *) msg;
5344  size_t bufferSize = 2;
5345 
5346  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 15) */
5347  bufferSize += 2; /* u16 primitive->interfaceTag */
5348  bufferSize += 2; /* CsrResult primitive->status */
5349  bufferSize += 4; /* u32 primitive->transactionId */
5350  bufferSize += 1; /* CsrWifiSmeTspecResultCode primitive->tspecResultCode */
5351  bufferSize += 2; /* u16 primitive->tspecLength */
5352  bufferSize += primitive->tspecLength; /* u8 primitive->tspec */
5353  return bufferSize;
5354 }
5355 
5356 
5357 u8* CsrWifiSmeTspecCfmSer(u8 *ptr, size_t *len, void *msg)
5358 {
5359  CsrWifiSmeTspecCfm *primitive = (CsrWifiSmeTspecCfm *)msg;
5360  *len = 0;
5361  CsrUint16Ser(ptr, len, primitive->common.type);
5362  CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag);
5363  CsrUint16Ser(ptr, len, (u16) primitive->status);
5364  CsrUint32Ser(ptr, len, (u32) primitive->transactionId);
5365  CsrUint8Ser(ptr, len, (u8) primitive->tspecResultCode);
5366  CsrUint16Ser(ptr, len, (u16) primitive->tspecLength);
5367  if (primitive->tspecLength)
5368  {
5369  CsrMemCpySer(ptr, len, (const void *) primitive->tspec, ((u16) (primitive->tspecLength)));
5370  }
5371  return(ptr);
5372 }
5373 
5374 
5376 {
5378  size_t offset;
5379  offset = 0;
5380 
5381  CsrUint16Des(&primitive->common.type, buffer, &offset);
5382  CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset);
5383  CsrUint16Des((u16 *) &primitive->status, buffer, &offset);
5384  CsrUint32Des((u32 *) &primitive->transactionId, buffer, &offset);
5385  CsrUint8Des((u8 *) &primitive->tspecResultCode, buffer, &offset);
5386  CsrUint16Des((u16 *) &primitive->tspecLength, buffer, &offset);
5387  if (primitive->tspecLength)
5388  {
5389  primitive->tspec = kmalloc(primitive->tspecLength, GFP_KERNEL);
5390  CsrMemCpyDes(primitive->tspec, buffer, &offset, ((u16) (primitive->tspecLength)));
5391  }
5392  else
5393  {
5394  primitive->tspec = NULL;
5395  }
5396 
5397  return primitive;
5398 }
5399 
5400 
5401 void CsrWifiSmeTspecCfmSerFree(void *voidPrimitivePointer)
5402 {
5403  CsrWifiSmeTspecCfm *primitive = (CsrWifiSmeTspecCfm *) voidPrimitivePointer;
5404  kfree(primitive->tspec);
5405  kfree(primitive);
5406 }
5407 
5408 
5410 {
5412  size_t bufferSize = 2;
5413 
5414  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 33) */
5415  bufferSize += 2; /* CsrResult primitive->status */
5416  bufferSize += 4; /* u32 primitive->versions.chipId */
5417  bufferSize += 4; /* u32 primitive->versions.chipVersion */
5418  bufferSize += 4; /* u32 primitive->versions.firmwareBuild */
5419  bufferSize += 4; /* u32 primitive->versions.firmwarePatch */
5420  bufferSize += 4; /* u32 primitive->versions.firmwareHip */
5421  bufferSize += (primitive->versions.routerBuild ? strlen(primitive->versions.routerBuild) : 0) + 1; /* char* primitive->versions.routerBuild (0 byte len + 1 for NULL Term) */
5422  bufferSize += 4; /* u32 primitive->versions.routerHip */
5423  bufferSize += (primitive->versions.smeBuild ? strlen(primitive->versions.smeBuild) : 0) + 1; /* char* primitive->versions.smeBuild (0 byte len + 1 for NULL Term) */
5424  bufferSize += 4; /* u32 primitive->versions.smeHip */
5425  return bufferSize;
5426 }
5427 
5428 
5429 u8* CsrWifiSmeVersionsGetCfmSer(u8 *ptr, size_t *len, void *msg)
5430 {
5432  *len = 0;
5433  CsrUint16Ser(ptr, len, primitive->common.type);
5434  CsrUint16Ser(ptr, len, (u16) primitive->status);
5435  CsrUint32Ser(ptr, len, (u32) primitive->versions.chipId);
5436  CsrUint32Ser(ptr, len, (u32) primitive->versions.chipVersion);
5437  CsrUint32Ser(ptr, len, (u32) primitive->versions.firmwareBuild);
5438  CsrUint32Ser(ptr, len, (u32) primitive->versions.firmwarePatch);
5439  CsrUint32Ser(ptr, len, (u32) primitive->versions.firmwareHip);
5440  CsrCharStringSer(ptr, len, primitive->versions.routerBuild);
5441  CsrUint32Ser(ptr, len, (u32) primitive->versions.routerHip);
5442  CsrCharStringSer(ptr, len, primitive->versions.smeBuild);
5443  CsrUint32Ser(ptr, len, (u32) primitive->versions.smeHip);
5444  return(ptr);
5445 }
5446 
5447 
5449 {
5451  size_t offset;
5452  offset = 0;
5453 
5454  CsrUint16Des(&primitive->common.type, buffer, &offset);
5455  CsrUint16Des((u16 *) &primitive->status, buffer, &offset);
5456  CsrUint32Des((u32 *) &primitive->versions.chipId, buffer, &offset);
5457  CsrUint32Des((u32 *) &primitive->versions.chipVersion, buffer, &offset);
5458  CsrUint32Des((u32 *) &primitive->versions.firmwareBuild, buffer, &offset);
5459  CsrUint32Des((u32 *) &primitive->versions.firmwarePatch, buffer, &offset);
5460  CsrUint32Des((u32 *) &primitive->versions.firmwareHip, buffer, &offset);
5461  CsrCharStringDes(&primitive->versions.routerBuild, buffer, &offset);
5462  CsrUint32Des((u32 *) &primitive->versions.routerHip, buffer, &offset);
5463  CsrCharStringDes(&primitive->versions.smeBuild, buffer, &offset);
5464  CsrUint32Des((u32 *) &primitive->versions.smeHip, buffer, &offset);
5465 
5466  return primitive;
5467 }
5468 
5469 
5470 void CsrWifiSmeVersionsGetCfmSerFree(void *voidPrimitivePointer)
5471 {
5472  CsrWifiSmeVersionsGetCfm *primitive = (CsrWifiSmeVersionsGetCfm *) voidPrimitivePointer;
5473  kfree(primitive->versions.routerBuild);
5474  kfree(primitive->versions.smeBuild);
5475  kfree(primitive);
5476 }
5477 
5478 
5480 {
5482  size_t bufferSize = 2;
5483 
5484  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 39) */
5485  bufferSize += 2; /* CsrResult primitive->status */
5486  bufferSize += 1; /* u8 primitive->cloakedSsids.cloakedSsidsCount */
5487  {
5488  u16 i2;
5489  for (i2 = 0; i2 < primitive->cloakedSsids.cloakedSsidsCount; i2++)
5490  {
5491  bufferSize += 32; /* u8 primitive->cloakedSsids.cloakedSsids[i2].ssid[32] */
5492  bufferSize += 1; /* u8 primitive->cloakedSsids.cloakedSsids[i2].length */
5493  }
5494  }
5495  return bufferSize;
5496 }
5497 
5498 
5500 {
5502  *len = 0;
5503  CsrUint16Ser(ptr, len, primitive->common.type);
5504  CsrUint16Ser(ptr, len, (u16) primitive->status);
5505  CsrUint8Ser(ptr, len, (u8) primitive->cloakedSsids.cloakedSsidsCount);
5506  {
5507  u16 i2;
5508  for (i2 = 0; i2 < primitive->cloakedSsids.cloakedSsidsCount; i2++)
5509  {
5510  CsrMemCpySer(ptr, len, (const void *) primitive->cloakedSsids.cloakedSsids[i2].ssid, ((u16) (32)));
5511  CsrUint8Ser(ptr, len, (u8) primitive->cloakedSsids.cloakedSsids[i2].length);
5512  }
5513  }
5514  return(ptr);
5515 }
5516 
5517 
5519 {
5521  size_t offset;
5522  offset = 0;
5523 
5524  CsrUint16Des(&primitive->common.type, buffer, &offset);
5525  CsrUint16Des((u16 *) &primitive->status, buffer, &offset);
5526  CsrUint8Des((u8 *) &primitive->cloakedSsids.cloakedSsidsCount, buffer, &offset);
5527  primitive->cloakedSsids.cloakedSsids = NULL;
5528  if (primitive->cloakedSsids.cloakedSsidsCount)
5529  {
5531  }
5532  {
5533  u16 i2;
5534  for (i2 = 0; i2 < primitive->cloakedSsids.cloakedSsidsCount; i2++)
5535  {
5536  CsrMemCpyDes(primitive->cloakedSsids.cloakedSsids[i2].ssid, buffer, &offset, ((u16) (32)));
5537  CsrUint8Des((u8 *) &primitive->cloakedSsids.cloakedSsids[i2].length, buffer, &offset);
5538  }
5539  }
5540 
5541  return primitive;
5542 }
5543 
5544 
5545 void CsrWifiSmeCloakedSsidsGetCfmSerFree(void *voidPrimitivePointer)
5546 {
5547  CsrWifiSmeCloakedSsidsGetCfm *primitive = (CsrWifiSmeCloakedSsidsGetCfm *) voidPrimitivePointer;
5548  kfree(primitive->cloakedSsids.cloakedSsids);
5549  kfree(primitive);
5550 }
5551 
5552 
5554 {
5555  size_t bufferSize = 2;
5556 
5557  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 9) */
5558  bufferSize += 6; /* u8 primitive->address.a[6] */
5559  return bufferSize;
5560 }
5561 
5562 
5563 u8* CsrWifiSmeWifiOnIndSer(u8 *ptr, size_t *len, void *msg)
5564 {
5565  CsrWifiSmeWifiOnInd *primitive = (CsrWifiSmeWifiOnInd *)msg;
5566  *len = 0;
5567  CsrUint16Ser(ptr, len, primitive->common.type);
5568  CsrMemCpySer(ptr, len, (const void *) primitive->address.a, ((u16) (6)));
5569  return(ptr);
5570 }
5571 
5572 
5574 {
5576  size_t offset;
5577  offset = 0;
5578 
5579  CsrUint16Des(&primitive->common.type, buffer, &offset);
5580  CsrMemCpyDes(primitive->address.a, buffer, &offset, ((u16) (6)));
5581 
5582  return primitive;
5583 }
5584 
5585 
5587 {
5588  size_t bufferSize = 2;
5589 
5590  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 10) */
5591  bufferSize += 2; /* CsrResult primitive->status */
5592  bufferSize += 1; /* CsrWifiSme80211dTrustLevel primitive->deviceConfig.trustLevel */
5593  bufferSize += 2; /* u8 primitive->deviceConfig.countryCode[2] */
5594  bufferSize += 1; /* CsrWifiSmeFirmwareDriverInterface primitive->deviceConfig.firmwareDriverInterface */
5595  bufferSize += 1; /* u8 primitive->deviceConfig.enableStrictDraftN */
5596  return bufferSize;
5597 }
5598 
5599 
5601 {
5603  *len = 0;
5604  CsrUint16Ser(ptr, len, primitive->common.type);
5605  CsrUint16Ser(ptr, len, (u16) primitive->status);
5606  CsrUint8Ser(ptr, len, (u8) primitive->deviceConfig.trustLevel);
5607  CsrMemCpySer(ptr, len, (const void *) primitive->deviceConfig.countryCode, ((u16) (2)));
5608  CsrUint8Ser(ptr, len, (u8) primitive->deviceConfig.firmwareDriverInterface);
5609  CsrUint8Ser(ptr, len, (u8) primitive->deviceConfig.enableStrictDraftN);
5610  return(ptr);
5611 }
5612 
5613 
5615 {
5617  size_t offset;
5618  offset = 0;
5619 
5620  CsrUint16Des(&primitive->common.type, buffer, &offset);
5621  CsrUint16Des((u16 *) &primitive->status, buffer, &offset);
5622  CsrUint8Des((u8 *) &primitive->deviceConfig.trustLevel, buffer, &offset);
5623  CsrMemCpyDes(primitive->deviceConfig.countryCode, buffer, &offset, ((u16) (2)));
5624  CsrUint8Des((u8 *) &primitive->deviceConfig.firmwareDriverInterface, buffer, &offset);
5625  CsrUint8Des((u8 *) &primitive->deviceConfig.enableStrictDraftN, buffer, &offset);
5626 
5627  return primitive;
5628 }
5629 
5630 
5632 {
5633  size_t bufferSize = 2;
5634 
5635  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 9) */
5636  bufferSize += 2; /* CsrResult primitive->status */
5637  bufferSize += 2; /* u16 primitive->numInterfaces */
5638  bufferSize += 2; /* u8 primitive->capBitmap[2] */
5639  return bufferSize;
5640 }
5641 
5642 
5644 {
5646  *len = 0;
5647  CsrUint16Ser(ptr, len, primitive->common.type);
5648  CsrUint16Ser(ptr, len, (u16) primitive->status);
5649  CsrUint16Ser(ptr, len, (u16) primitive->numInterfaces);
5650  CsrMemCpySer(ptr, len, (const void *) primitive->capBitmap, ((u16) (2)));
5651  return(ptr);
5652 }
5653 
5654 
5656 {
5658  size_t offset;
5659  offset = 0;
5660 
5661  CsrUint16Des(&primitive->common.type, buffer, &offset);
5662  CsrUint16Des((u16 *) &primitive->status, buffer, &offset);
5663  CsrUint16Des((u16 *) &primitive->numInterfaces, buffer, &offset);
5664  CsrMemCpyDes(primitive->capBitmap, buffer, &offset, ((u16) (2)));
5665 
5666  return primitive;
5667 }
5668 
5669 
5671 {
5672  CsrWifiSmeErrorInd *primitive = (CsrWifiSmeErrorInd *) msg;
5673  size_t bufferSize = 2;
5674 
5675  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 3) */
5676  bufferSize += (primitive->errorMessage ? strlen(primitive->errorMessage) : 0) + 1; /* char* primitive->errorMessage (0 byte len + 1 for NULL Term) */
5677  return bufferSize;
5678 }
5679 
5680 
5681 u8* CsrWifiSmeErrorIndSer(u8 *ptr, size_t *len, void *msg)
5682 {
5683  CsrWifiSmeErrorInd *primitive = (CsrWifiSmeErrorInd *)msg;
5684  *len = 0;
5685  CsrUint16Ser(ptr, len, primitive->common.type);
5686  CsrCharStringSer(ptr, len, primitive->errorMessage);
5687  return(ptr);
5688 }
5689 
5690 
5692 {
5694  size_t offset;
5695  offset = 0;
5696 
5697  CsrUint16Des(&primitive->common.type, buffer, &offset);
5698  CsrCharStringDes(&primitive->errorMessage, buffer, &offset);
5699 
5700  return primitive;
5701 }
5702 
5703 
5704 void CsrWifiSmeErrorIndSerFree(void *voidPrimitivePointer)
5705 {
5706  CsrWifiSmeErrorInd *primitive = (CsrWifiSmeErrorInd *) voidPrimitivePointer;
5707  kfree(primitive->errorMessage);
5708  kfree(primitive);
5709 }
5710 
5711 
5713 {
5714  CsrWifiSmeInfoInd *primitive = (CsrWifiSmeInfoInd *) msg;
5715  size_t bufferSize = 2;
5716 
5717  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 3) */
5718  bufferSize += (primitive->infoMessage ? strlen(primitive->infoMessage) : 0) + 1; /* char* primitive->infoMessage (0 byte len + 1 for NULL Term) */
5719  return bufferSize;
5720 }
5721 
5722 
5723 u8* CsrWifiSmeInfoIndSer(u8 *ptr, size_t *len, void *msg)
5724 {
5725  CsrWifiSmeInfoInd *primitive = (CsrWifiSmeInfoInd *)msg;
5726  *len = 0;
5727  CsrUint16Ser(ptr, len, primitive->common.type);
5728  CsrCharStringSer(ptr, len, primitive->infoMessage);
5729  return(ptr);
5730 }
5731 
5732 
5734 {
5735  CsrWifiSmeInfoInd *primitive = kmalloc(sizeof(CsrWifiSmeInfoInd), GFP_KERNEL);
5736  size_t offset;
5737  offset = 0;
5738 
5739  CsrUint16Des(&primitive->common.type, buffer, &offset);
5740  CsrCharStringDes(&primitive->infoMessage, buffer, &offset);
5741 
5742  return primitive;
5743 }
5744 
5745 
5746 void CsrWifiSmeInfoIndSerFree(void *voidPrimitivePointer)
5747 {
5748  CsrWifiSmeInfoInd *primitive = (CsrWifiSmeInfoInd *) voidPrimitivePointer;
5749  kfree(primitive->infoMessage);
5750  kfree(primitive);
5751 }
5752 
5753 
5755 {
5756  CsrWifiSmeCoreDumpInd *primitive = (CsrWifiSmeCoreDumpInd *) msg;
5757  size_t bufferSize = 2;
5758 
5759  /* Calculate the Size of the Serialised Data. Could be more efficient (Try 8) */
5760  bufferSize += 4; /* u32 primitive->dataLength */
5761  bufferSize += primitive->dataLength; /* u8 primitive->data */
5762  return bufferSize;
5763 }
5764 
5765 
5766 u8* CsrWifiSmeCoreDumpIndSer(u8 *ptr, size_t *len, void *msg)
5767 {
5768  CsrWifiSmeCoreDumpInd *primitive = (CsrWifiSmeCoreDumpInd *)msg;
5769  *len = 0;
5770  CsrUint16Ser(ptr, len, primitive->common.type);
5771  CsrUint32Ser(ptr, len, (u32) primitive->dataLength);
5772  if (primitive->dataLength)
5773  {
5774  CsrMemCpySer(ptr, len, (const void *) primitive->data, ((u16) (primitive->dataLength)));
5775  }
5776  return(ptr);
5777 }
5778 
5779 
5781 {
5783  size_t offset;
5784  offset = 0;
5785 
5786  CsrUint16Des(&primitive->common.type, buffer, &offset);
5787  CsrUint32Des((u32 *) &primitive->dataLength, buffer, &offset);
5788  if (primitive->dataLength)
5789  {
5790  primitive->data = kmalloc(primitive->dataLength, GFP_KERNEL);
5791  CsrMemCpyDes(primitive->data, buffer, &offset, ((u16) (primitive->dataLength)));
5792  }
5793  else
5794  {
5795  primitive->data = NULL;
5796  }
5797 
5798  return primitive;
5799 }
5800 
5801 
5802 void CsrWifiSmeCoreDumpIndSerFree(void *voidPrimitivePointer)
5803 {
5804  CsrWifiSmeCoreDumpInd *primitive = (CsrWifiSmeCoreDumpInd *) voidPrimitivePointer;
5805  kfree(primitive->data);
5806  kfree(primitive);
5807 }
5808 
5809