Root/drivers/staging/csr/csr_wifi_sme_serialize.c

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
18void CsrWifiSmePfree(void *ptr)
19{
20    kfree(ptr);
21}
22
23
24size_t CsrWifiSmeAdhocConfigSetReqSizeof(void *msg)
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
37u8* CsrWifiSmeAdhocConfigSetReqSer(u8 *ptr, size_t *len, void *msg)
38{
39    CsrWifiSmeAdhocConfigSetReq *primitive = (CsrWifiSmeAdhocConfigSetReq *)msg;
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
50void* CsrWifiSmeAdhocConfigSetReqDes(u8 *buffer, size_t length)
51{
52    CsrWifiSmeAdhocConfigSetReq *primitive = kmalloc(sizeof(CsrWifiSmeAdhocConfigSetReq), GFP_KERNEL);
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
66size_t CsrWifiSmeBlacklistReqSizeof(void *msg)
67{
68    CsrWifiSmeBlacklistReq *primitive = (CsrWifiSmeBlacklistReq *) msg;
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
86u8* CsrWifiSmeBlacklistReqSer(u8 *ptr, size_t *len, void *msg)
87{
88    CsrWifiSmeBlacklistReq *primitive = (CsrWifiSmeBlacklistReq *)msg;
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
105void* CsrWifiSmeBlacklistReqDes(u8 *buffer, size_t length)
106{
107    CsrWifiSmeBlacklistReq *primitive = kmalloc(sizeof(CsrWifiSmeBlacklistReq), GFP_KERNEL);
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
132void CsrWifiSmeBlacklistReqSerFree(void *voidPrimitivePointer)
133{
134    CsrWifiSmeBlacklistReq *primitive = (CsrWifiSmeBlacklistReq *) voidPrimitivePointer;
135    kfree(primitive->setAddresses);
136    kfree(primitive);
137}
138
139
140size_t CsrWifiSmeCalibrationDataSetReqSizeof(void *msg)
141{
142    CsrWifiSmeCalibrationDataSetReq *primitive = (CsrWifiSmeCalibrationDataSetReq *) msg;
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
152u8* CsrWifiSmeCalibrationDataSetReqSer(u8 *ptr, size_t *len, void *msg)
153{
154    CsrWifiSmeCalibrationDataSetReq *primitive = (CsrWifiSmeCalibrationDataSetReq *)msg;
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
166void* CsrWifiSmeCalibrationDataSetReqDes(u8 *buffer, size_t length)
167{
168    CsrWifiSmeCalibrationDataSetReq *primitive = kmalloc(sizeof(CsrWifiSmeCalibrationDataSetReq), GFP_KERNEL);
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
188void CsrWifiSmeCalibrationDataSetReqSerFree(void *voidPrimitivePointer)
189{
190    CsrWifiSmeCalibrationDataSetReq *primitive = (CsrWifiSmeCalibrationDataSetReq *) voidPrimitivePointer;
191    kfree(primitive->calibrationData);
192    kfree(primitive);
193}
194
195
196size_t CsrWifiSmeCcxConfigSetReqSizeof(void *msg)
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
210u8* CsrWifiSmeCcxConfigSetReqSer(u8 *ptr, size_t *len, void *msg)
211{
212    CsrWifiSmeCcxConfigSetReq *primitive = (CsrWifiSmeCcxConfigSetReq *)msg;
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
224void* CsrWifiSmeCcxConfigSetReqDes(u8 *buffer, size_t length)
225{
226    CsrWifiSmeCcxConfigSetReq *primitive = kmalloc(sizeof(CsrWifiSmeCcxConfigSetReq), GFP_KERNEL);
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
241size_t CsrWifiSmeCoexConfigSetReqSizeof(void *msg)
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
264u8* CsrWifiSmeCoexConfigSetReqSer(u8 *ptr, size_t *len, void *msg)
265{
266    CsrWifiSmeCoexConfigSetReq *primitive = (CsrWifiSmeCoexConfigSetReq *)msg;
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);
272    CsrUint16Ser(ptr, len, (u16) primitive->coexConfig.coexTrafficContinuousLatencyMs);
273    CsrUint16Ser(ptr, len, (u16) primitive->coexConfig.coexObexBlackoutDurationMs);
274    CsrUint16Ser(ptr, len, (u16) primitive->coexConfig.coexObexBlackoutPeriodMs);
275    CsrUint16Ser(ptr, len, (u16) primitive->coexConfig.coexA2dpBrBlackoutDurationMs);
276    CsrUint16Ser(ptr, len, (u16) primitive->coexConfig.coexA2dpBrBlackoutPeriodMs);
277    CsrUint16Ser(ptr, len, (u16) primitive->coexConfig.coexA2dpEdrBlackoutDurationMs);
278    CsrUint16Ser(ptr, len, (u16) primitive->coexConfig.coexA2dpEdrBlackoutPeriodMs);
279    CsrUint16Ser(ptr, len, (u16) primitive->coexConfig.coexPagingBlackoutDurationMs);
280    CsrUint16Ser(ptr, len, (u16) primitive->coexConfig.coexPagingBlackoutPeriodMs);
281    CsrUint16Ser(ptr, len, (u16) primitive->coexConfig.coexInquiryBlackoutDurationMs);
282    CsrUint16Ser(ptr, len, (u16) primitive->coexConfig.coexInquiryBlackoutPeriodMs);
283    return(ptr);
284}
285
286
287void* CsrWifiSmeCoexConfigSetReqDes(u8 *buffer, size_t length)
288{
289    CsrWifiSmeCoexConfigSetReq *primitive = kmalloc(sizeof(CsrWifiSmeCoexConfigSetReq), GFP_KERNEL);
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
313size_t CsrWifiSmeConnectReqSizeof(void *msg)
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
337u8* 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);
351    CsrUint16Ser(ptr, len, (u16) primitive->connectionConfig.mlmeAssociateReqInformationElementsLength);
352    if (primitive->connectionConfig.mlmeAssociateReqInformationElementsLength)
353    {
354        CsrMemCpySer(ptr, len, (const void *) primitive->connectionConfig.mlmeAssociateReqInformationElements, ((u16) (primitive->connectionConfig.mlmeAssociateReqInformationElementsLength)));
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
363void* CsrWifiSmeConnectReqDes(u8 *buffer, size_t length)
364{
365    CsrWifiSmeConnectReq *primitive = kmalloc(sizeof(CsrWifiSmeConnectReq), GFP_KERNEL);
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);
379    CsrUint16Des((u16 *) &primitive->connectionConfig.mlmeAssociateReqInformationElementsLength, buffer, &offset);
380    if (primitive->connectionConfig.mlmeAssociateReqInformationElementsLength)
381    {
382        primitive->connectionConfig.mlmeAssociateReqInformationElements = kmalloc(primitive->connectionConfig.mlmeAssociateReqInformationElementsLength, GFP_KERNEL);
383        CsrMemCpyDes(primitive->connectionConfig.mlmeAssociateReqInformationElements, buffer, &offset, ((u16) (primitive->connectionConfig.mlmeAssociateReqInformationElementsLength)));
384    }
385    else
386    {
387        primitive->connectionConfig.mlmeAssociateReqInformationElements = NULL;
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
397void CsrWifiSmeConnectReqSerFree(void *voidPrimitivePointer)
398{
399    CsrWifiSmeConnectReq *primitive = (CsrWifiSmeConnectReq *) voidPrimitivePointer;
400    kfree(primitive->connectionConfig.mlmeAssociateReqInformationElements);
401    kfree(primitive);
402}
403
404
405size_t CsrWifiSmeHostConfigSetReqSizeof(void *msg)
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
417u8* CsrWifiSmeHostConfigSetReqSer(u8 *ptr, size_t *len, void *msg)
418{
419    CsrWifiSmeHostConfigSetReq *primitive = (CsrWifiSmeHostConfigSetReq *)msg;
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
429void* CsrWifiSmeHostConfigSetReqDes(u8 *buffer, size_t length)
430{
431    CsrWifiSmeHostConfigSetReq *primitive = kmalloc(sizeof(CsrWifiSmeHostConfigSetReq), GFP_KERNEL);
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
444size_t CsrWifiSmeKeyReqSizeof(void *msg)
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
469u8* 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
494void* CsrWifiSmeKeyReqDes(u8 *buffer, size_t length)
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
522size_t CsrWifiSmeMibConfigSetReqSizeof(void *msg)
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
536u8* CsrWifiSmeMibConfigSetReqSer(u8 *ptr, size_t *len, void *msg)
537{
538    CsrWifiSmeMibConfigSetReq *primitive = (CsrWifiSmeMibConfigSetReq *)msg;
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
550void* CsrWifiSmeMibConfigSetReqDes(u8 *buffer, size_t length)
551{
552    CsrWifiSmeMibConfigSetReq *primitive = kmalloc(sizeof(CsrWifiSmeMibConfigSetReq), GFP_KERNEL);
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
567size_t CsrWifiSmeMibGetNextReqSizeof(void *msg)
568{
569    CsrWifiSmeMibGetNextReq *primitive = (CsrWifiSmeMibGetNextReq *) msg;
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
579u8* CsrWifiSmeMibGetNextReqSer(u8 *ptr, size_t *len, void *msg)
580{
581    CsrWifiSmeMibGetNextReq *primitive = (CsrWifiSmeMibGetNextReq *)msg;
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
593void* CsrWifiSmeMibGetNextReqDes(u8 *buffer, size_t length)
594{
595    CsrWifiSmeMibGetNextReq *primitive = kmalloc(sizeof(CsrWifiSmeMibGetNextReq), GFP_KERNEL);
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
615void CsrWifiSmeMibGetNextReqSerFree(void *voidPrimitivePointer)
616{
617    CsrWifiSmeMibGetNextReq *primitive = (CsrWifiSmeMibGetNextReq *) voidPrimitivePointer;
618    kfree(primitive->mibAttribute);
619    kfree(primitive);
620}
621
622
623size_t CsrWifiSmeMibGetReqSizeof(void *msg)
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
635u8* 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
649void* CsrWifiSmeMibGetReqDes(u8 *buffer, size_t length)
650{
651    CsrWifiSmeMibGetReq *primitive = kmalloc(sizeof(CsrWifiSmeMibGetReq), GFP_KERNEL);
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
671void CsrWifiSmeMibGetReqSerFree(void *voidPrimitivePointer)
672{
673    CsrWifiSmeMibGetReq *primitive = (CsrWifiSmeMibGetReq *) voidPrimitivePointer;
674    kfree(primitive->mibAttribute);
675    kfree(primitive);
676}
677
678
679size_t CsrWifiSmeMibSetReqSizeof(void *msg)
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
691u8* 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
705void* CsrWifiSmeMibSetReqDes(u8 *buffer, size_t length)
706{
707    CsrWifiSmeMibSetReq *primitive = kmalloc(sizeof(CsrWifiSmeMibSetReq), GFP_KERNEL);
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
727void CsrWifiSmeMibSetReqSerFree(void *voidPrimitivePointer)
728{
729    CsrWifiSmeMibSetReq *primitive = (CsrWifiSmeMibSetReq *) voidPrimitivePointer;
730    kfree(primitive->mibAttribute);
731    kfree(primitive);
732}
733
734
735size_t CsrWifiSmeMulticastAddressReqSizeof(void *msg)
736{
737    CsrWifiSmeMulticastAddressReq *primitive = (CsrWifiSmeMulticastAddressReq *) msg;
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
755u8* CsrWifiSmeMulticastAddressReqSer(u8 *ptr, size_t *len, void *msg)
756{
757    CsrWifiSmeMulticastAddressReq *primitive = (CsrWifiSmeMulticastAddressReq *)msg;
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
774void* CsrWifiSmeMulticastAddressReqDes(u8 *buffer, size_t length)
775{
776    CsrWifiSmeMulticastAddressReq *primitive = kmalloc(sizeof(CsrWifiSmeMulticastAddressReq), GFP_KERNEL);
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
801void CsrWifiSmeMulticastAddressReqSerFree(void *voidPrimitivePointer)
802{
803    CsrWifiSmeMulticastAddressReq *primitive = (CsrWifiSmeMulticastAddressReq *) voidPrimitivePointer;
804    kfree(primitive->setAddresses);
805    kfree(primitive);
806}
807
808
809size_t CsrWifiSmePacketFilterSetReqSizeof(void *msg)
810{
811    CsrWifiSmePacketFilterSetReq *primitive = (CsrWifiSmePacketFilterSetReq *) msg;
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
824u8* CsrWifiSmePacketFilterSetReqSer(u8 *ptr, size_t *len, void *msg)
825{
826    CsrWifiSmePacketFilterSetReq *primitive = (CsrWifiSmePacketFilterSetReq *)msg;
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
841void* CsrWifiSmePacketFilterSetReqDes(u8 *buffer, size_t length)
842{
843    CsrWifiSmePacketFilterSetReq *primitive = kmalloc(sizeof(CsrWifiSmePacketFilterSetReq), GFP_KERNEL);
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
866void CsrWifiSmePacketFilterSetReqSerFree(void *voidPrimitivePointer)
867{
868    CsrWifiSmePacketFilterSetReq *primitive = (CsrWifiSmePacketFilterSetReq *) voidPrimitivePointer;
869    kfree(primitive->filter);
870    kfree(primitive);
871}
872
873
874size_t CsrWifiSmePmkidReqSizeof(void *msg)
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
895u8* 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
915void* CsrWifiSmePmkidReqDes(u8 *buffer, size_t length)
916{
917    CsrWifiSmePmkidReq *primitive = kmalloc(sizeof(CsrWifiSmePmkidReq), GFP_KERNEL);
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
943void CsrWifiSmePmkidReqSerFree(void *voidPrimitivePointer)
944{
945    CsrWifiSmePmkidReq *primitive = (CsrWifiSmePmkidReq *) voidPrimitivePointer;
946    kfree(primitive->setPmkids);
947    kfree(primitive);
948}
949
950
951size_t CsrWifiSmePowerConfigSetReqSizeof(void *msg)
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
967u8* CsrWifiSmePowerConfigSetReqSer(u8 *ptr, size_t *len, void *msg)
968{
969    CsrWifiSmePowerConfigSetReq *primitive = (CsrWifiSmePowerConfigSetReq *)msg;
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
983void* CsrWifiSmePowerConfigSetReqDes(u8 *buffer, size_t length)
984{
985    CsrWifiSmePowerConfigSetReq *primitive = kmalloc(sizeof(CsrWifiSmePowerConfigSetReq), GFP_KERNEL);
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
1002size_t CsrWifiSmeRoamingConfigSetReqSizeof(void *msg)
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
1038u8* CsrWifiSmeRoamingConfigSetReqSer(u8 *ptr, size_t *len, void *msg)
1039{
1040    CsrWifiSmeRoamingConfigSetReq *primitive = (CsrWifiSmeRoamingConfigSetReq *)msg;
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);
1066            CsrUint16Ser(ptr, len, (u16) primitive->roamingConfig.roamScanCfg[i2].minPassiveChannelTimeTu);
1067            CsrUint16Ser(ptr, len, (u16) primitive->roamingConfig.roamScanCfg[i2].maxPassiveChannelTimeTu);
1068        }
1069    }
1070    return(ptr);
1071}
1072
1073
1074void* CsrWifiSmeRoamingConfigSetReqDes(u8 *buffer, size_t length)
1075{
1076    CsrWifiSmeRoamingConfigSetReq *primitive = kmalloc(sizeof(CsrWifiSmeRoamingConfigSetReq), GFP_KERNEL);
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
1113size_t CsrWifiSmeScanConfigSetReqSizeof(void *msg)
1114{
1115    CsrWifiSmeScanConfigSetReq *primitive = (CsrWifiSmeScanConfigSetReq *) msg;
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
1145u8* CsrWifiSmeScanConfigSetReqSer(u8 *ptr, size_t *len, void *msg)
1146{
1147    CsrWifiSmeScanConfigSetReq *primitive = (CsrWifiSmeScanConfigSetReq *)msg;
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
1179void* CsrWifiSmeScanConfigSetReqDes(u8 *buffer, size_t length)
1180{
1181    CsrWifiSmeScanConfigSetReq *primitive = kmalloc(sizeof(CsrWifiSmeScanConfigSetReq), GFP_KERNEL);
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    {
1209        primitive->scanConfig.passiveChannelList = kmalloc(primitive->scanConfig.passiveChannelListCount, GFP_KERNEL);
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
1221void CsrWifiSmeScanConfigSetReqSerFree(void *voidPrimitivePointer)
1222{
1223    CsrWifiSmeScanConfigSetReq *primitive = (CsrWifiSmeScanConfigSetReq *) voidPrimitivePointer;
1224    kfree(primitive->scanConfig.passiveChannelList);
1225    kfree(primitive);
1226}
1227
1228
1229size_t CsrWifiSmeScanFullReqSizeof(void *msg)
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
1256u8* 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
1288void* CsrWifiSmeScanFullReqDes(u8 *buffer, size_t length)
1289{
1290    CsrWifiSmeScanFullReq *primitive = kmalloc(sizeof(CsrWifiSmeScanFullReq), GFP_KERNEL);
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
1338void 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
1348size_t CsrWifiSmeSmeStaConfigSetReqSizeof(void *msg)
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
1364u8* CsrWifiSmeSmeStaConfigSetReqSer(u8 *ptr, size_t *len, void *msg)
1365{
1366    CsrWifiSmeSmeStaConfigSetReq *primitive = (CsrWifiSmeSmeStaConfigSetReq *)msg;
1367    *len = 0;
1368    CsrUint16Ser(ptr, len, primitive->common.type);
1369    CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag);
1370    CsrUint8Ser(ptr, len, (u8) primitive->smeConfig.connectionQualityRssiChangeTrigger);
1371    CsrUint8Ser(ptr, len, (u8) primitive->smeConfig.connectionQualitySnrChangeTrigger);
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
1380void* CsrWifiSmeSmeStaConfigSetReqDes(u8 *buffer, size_t length)
1381{
1382    CsrWifiSmeSmeStaConfigSetReq *primitive = kmalloc(sizeof(CsrWifiSmeSmeStaConfigSetReq), GFP_KERNEL);
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
1399size_t CsrWifiSmeTspecReqSizeof(void *msg)
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
1418u8* 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
1442void* CsrWifiSmeTspecReqDes(u8 *buffer, size_t length)
1443{
1444    CsrWifiSmeTspecReq *primitive = kmalloc(sizeof(CsrWifiSmeTspecReq), GFP_KERNEL);
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
1479void CsrWifiSmeTspecReqSerFree(void *voidPrimitivePointer)
1480{
1481    CsrWifiSmeTspecReq *primitive = (CsrWifiSmeTspecReq *) voidPrimitivePointer;
1482    kfree(primitive->tspec);
1483    kfree(primitive->tclas);
1484    kfree(primitive);
1485}
1486
1487
1488size_t CsrWifiSmeWifiFlightmodeReqSizeof(void *msg)
1489{
1490    CsrWifiSmeWifiFlightmodeReq *primitive = (CsrWifiSmeWifiFlightmodeReq *) msg;
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
1508u8* CsrWifiSmeWifiFlightmodeReqSer(u8 *ptr, size_t *len, void *msg)
1509{
1510    CsrWifiSmeWifiFlightmodeReq *primitive = (CsrWifiSmeWifiFlightmodeReq *)msg;
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
1530void* CsrWifiSmeWifiFlightmodeReqDes(u8 *buffer, size_t length)
1531{
1532    CsrWifiSmeWifiFlightmodeReq *primitive = kmalloc(sizeof(CsrWifiSmeWifiFlightmodeReq), GFP_KERNEL);
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
1565void 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
1580size_t CsrWifiSmeWifiOnReqSizeof(void *msg)
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
1600u8* 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
1622void* CsrWifiSmeWifiOnReqDes(u8 *buffer, size_t length)
1623{
1624    CsrWifiSmeWifiOnReq *primitive = kmalloc(sizeof(CsrWifiSmeWifiOnReq), GFP_KERNEL);
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
1657void 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
1672size_t CsrWifiSmeCloakedSsidsSetReqSizeof(void *msg)
1673{
1674    CsrWifiSmeCloakedSsidsSetReq *primitive = (CsrWifiSmeCloakedSsidsSetReq *) msg;
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
1691u8* CsrWifiSmeCloakedSsidsSetReqSer(u8 *ptr, size_t *len, void *msg)
1692{
1693    CsrWifiSmeCloakedSsidsSetReq *primitive = (CsrWifiSmeCloakedSsidsSetReq *)msg;
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
1709void* CsrWifiSmeCloakedSsidsSetReqDes(u8 *buffer, size_t length)
1710{
1711    CsrWifiSmeCloakedSsidsSetReq *primitive = kmalloc(sizeof(CsrWifiSmeCloakedSsidsSetReq), GFP_KERNEL);
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    {
1720        primitive->cloakedSsids.cloakedSsids = kmalloc(sizeof(CsrWifiSsid) * primitive->cloakedSsids.cloakedSsidsCount, GFP_KERNEL);
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
1735void CsrWifiSmeCloakedSsidsSetReqSerFree(void *voidPrimitivePointer)
1736{
1737    CsrWifiSmeCloakedSsidsSetReq *primitive = (CsrWifiSmeCloakedSsidsSetReq *) voidPrimitivePointer;
1738    kfree(primitive->cloakedSsids.cloakedSsids);
1739    kfree(primitive);
1740}
1741
1742
1743size_t CsrWifiSmeSmeCommonConfigSetReqSizeof(void *msg)
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
1756u8* CsrWifiSmeSmeCommonConfigSetReqSer(u8 *ptr, size_t *len, void *msg)
1757{
1758    CsrWifiSmeSmeCommonConfigSetReq *primitive = (CsrWifiSmeSmeCommonConfigSetReq *)msg;
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
1769void* CsrWifiSmeSmeCommonConfigSetReqDes(u8 *buffer, size_t length)
1770{
1771    CsrWifiSmeSmeCommonConfigSetReq *primitive = kmalloc(sizeof(CsrWifiSmeSmeCommonConfigSetReq), GFP_KERNEL);
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
1785size_t CsrWifiSmeWpsConfigurationReqSizeof(void *msg)
1786{
1787    CsrWifiSmeWpsConfigurationReq *primitive = (CsrWifiSmeWpsConfigurationReq *) msg;
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
1818u8* CsrWifiSmeWpsConfigurationReqSer(u8 *ptr, size_t *len, void *msg)
1819{
1820    CsrWifiSmeWpsConfigurationReq *primitive = (CsrWifiSmeWpsConfigurationReq *)msg;
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
1850void* CsrWifiSmeWpsConfigurationReqDes(u8 *buffer, size_t length)
1851{
1852    CsrWifiSmeWpsConfigurationReq *primitive = kmalloc(sizeof(CsrWifiSmeWpsConfigurationReq), GFP_KERNEL);
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    {
1873        primitive->wpsConfig.secondaryDeviceType = kmalloc(sizeof(CsrWifiSmeWpsDeviceType) * primitive->wpsConfig.secondaryDeviceTypeCount, GFP_KERNEL);
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
1890void CsrWifiSmeWpsConfigurationReqSerFree(void *voidPrimitivePointer)
1891{
1892    CsrWifiSmeWpsConfigurationReq *primitive = (CsrWifiSmeWpsConfigurationReq *) voidPrimitivePointer;
1893    kfree(primitive->wpsConfig.secondaryDeviceType);
1894    kfree(primitive);
1895}
1896
1897
1898size_t CsrWifiSmeSetReqSizeof(void *msg)
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
1910u8* 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
1924void* CsrWifiSmeSetReqDes(u8 *buffer, size_t length)
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
1946void CsrWifiSmeSetReqSerFree(void *voidPrimitivePointer)
1947{
1948    CsrWifiSmeSetReq *primitive = (CsrWifiSmeSetReq *) voidPrimitivePointer;
1949    kfree(primitive->data);
1950    kfree(primitive);
1951}
1952
1953
1954size_t CsrWifiSmeAdhocConfigGetCfmSizeof(void *msg)
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
1968u8* CsrWifiSmeAdhocConfigGetCfmSer(u8 *ptr, size_t *len, void *msg)
1969{
1970    CsrWifiSmeAdhocConfigGetCfm *primitive = (CsrWifiSmeAdhocConfigGetCfm *)msg;
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
1982void* CsrWifiSmeAdhocConfigGetCfmDes(u8 *buffer, size_t length)
1983{
1984    CsrWifiSmeAdhocConfigGetCfm *primitive = kmalloc(sizeof(CsrWifiSmeAdhocConfigGetCfm), GFP_KERNEL);
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
1999size_t CsrWifiSmeAssociationCompleteIndSizeof(void *msg)
2000{
2001    CsrWifiSmeAssociationCompleteInd *primitive = (CsrWifiSmeAssociationCompleteInd *) msg;
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
2043u8* CsrWifiSmeAssociationCompleteIndSer(u8 *ptr, size_t *len, void *msg)
2044{
2045    CsrWifiSmeAssociationCompleteInd *primitive = (CsrWifiSmeAssociationCompleteInd *)msg;
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);
2069    if (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);
2074    if (primitive->connectionInfo.associationRspFrameLength)
2075    {
2076        CsrMemCpySer(ptr, len, (const void *) primitive->connectionInfo.associationRspFrame, ((u16) (primitive->connectionInfo.associationRspFrameLength)));
2077    }
2078    CsrUint16Ser(ptr, len, (u16) primitive->connectionInfo.assocScanInfoElementsLength);
2079    if (primitive->connectionInfo.assocScanInfoElementsLength)
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)));
2086    CsrUint16Ser(ptr, len, (u16) primitive->connectionInfo.assocReqInfoElementsLength);
2087    if (primitive->connectionInfo.assocReqInfoElementsLength)
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);
2094    CsrUint16Ser(ptr, len, (u16) primitive->connectionInfo.assocRspInfoElementsLength);
2095    if (primitive->connectionInfo.assocRspInfoElementsLength)
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
2104void* CsrWifiSmeAssociationCompleteIndDes(u8 *buffer, size_t length)
2105{
2106    CsrWifiSmeAssociationCompleteInd *primitive = kmalloc(sizeof(CsrWifiSmeAssociationCompleteInd), GFP_KERNEL);
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    {
2129        primitive->connectionInfo.beaconFrame = kmalloc(primitive->connectionInfo.beaconFrameLength, GFP_KERNEL);
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);
2137    if (primitive->connectionInfo.associationReqFrameLength)
2138    {
2139        primitive->connectionInfo.associationReqFrame = kmalloc(primitive->connectionInfo.associationReqFrameLength, GFP_KERNEL);
2140        CsrMemCpyDes(primitive->connectionInfo.associationReqFrame, buffer, &offset, ((u16) (primitive->connectionInfo.associationReqFrameLength)));
2141    }
2142    else
2143    {
2144        primitive->connectionInfo.associationReqFrame = NULL;
2145    }
2146    CsrUint16Des((u16 *) &primitive->connectionInfo.associationRspFrameLength, buffer, &offset);
2147    if (primitive->connectionInfo.associationRspFrameLength)
2148    {
2149        primitive->connectionInfo.associationRspFrame = kmalloc(primitive->connectionInfo.associationRspFrameLength, GFP_KERNEL);
2150        CsrMemCpyDes(primitive->connectionInfo.associationRspFrame, buffer, &offset, ((u16) (primitive->connectionInfo.associationRspFrameLength)));
2151    }
2152    else
2153    {
2154        primitive->connectionInfo.associationRspFrame = NULL;
2155    }
2156    CsrUint16Des((u16 *) &primitive->connectionInfo.assocScanInfoElementsLength, buffer, &offset);
2157    if (primitive->connectionInfo.assocScanInfoElementsLength)
2158    {
2159        primitive->connectionInfo.assocScanInfoElements = kmalloc(primitive->connectionInfo.assocScanInfoElementsLength, GFP_KERNEL);
2160        CsrMemCpyDes(primitive->connectionInfo.assocScanInfoElements, buffer, &offset, ((u16) (primitive->connectionInfo.assocScanInfoElementsLength)));
2161    }
2162    else
2163    {
2164        primitive->connectionInfo.assocScanInfoElements = NULL;
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);
2170    if (primitive->connectionInfo.assocReqInfoElementsLength)
2171    {
2172        primitive->connectionInfo.assocReqInfoElements = kmalloc(primitive->connectionInfo.assocReqInfoElementsLength, GFP_KERNEL);
2173        CsrMemCpyDes(primitive->connectionInfo.assocReqInfoElements, buffer, &offset, ((u16) (primitive->connectionInfo.assocReqInfoElementsLength)));
2174    }
2175    else
2176    {
2177        primitive->connectionInfo.assocReqInfoElements = NULL;
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);
2183    if (primitive->connectionInfo.assocRspInfoElementsLength)
2184    {
2185        primitive->connectionInfo.assocRspInfoElements = kmalloc(primitive->connectionInfo.assocRspInfoElementsLength, GFP_KERNEL);
2186        CsrMemCpyDes(primitive->connectionInfo.assocRspInfoElements, buffer, &offset, ((u16) (primitive->connectionInfo.assocRspInfoElementsLength)));
2187    }
2188    else
2189    {
2190        primitive->connectionInfo.assocRspInfoElements = NULL;
2191    }
2192    CsrUint16Des((u16 *) &primitive->deauthReason, buffer, &offset);
2193
2194    return primitive;
2195}
2196
2197
2198void CsrWifiSmeAssociationCompleteIndSerFree(void *voidPrimitivePointer)
2199{
2200    CsrWifiSmeAssociationCompleteInd *primitive = (CsrWifiSmeAssociationCompleteInd *) voidPrimitivePointer;
2201    kfree(primitive->connectionInfo.beaconFrame);
2202    kfree(primitive->connectionInfo.associationReqFrame);
2203    kfree(primitive->connectionInfo.associationRspFrame);
2204    kfree(primitive->connectionInfo.assocScanInfoElements);
2205    kfree(primitive->connectionInfo.assocReqInfoElements);
2206    kfree(primitive->connectionInfo.assocRspInfoElements);
2207    kfree(primitive);
2208}
2209
2210
2211size_t CsrWifiSmeAssociationStartIndSizeof(void *msg)
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
2224u8* CsrWifiSmeAssociationStartIndSer(u8 *ptr, size_t *len, void *msg)
2225{
2226    CsrWifiSmeAssociationStartInd *primitive = (CsrWifiSmeAssociationStartInd *)msg;
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
2237void* CsrWifiSmeAssociationStartIndDes(u8 *buffer, size_t length)
2238{
2239    CsrWifiSmeAssociationStartInd *primitive = kmalloc(sizeof(CsrWifiSmeAssociationStartInd), GFP_KERNEL);
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
2253size_t CsrWifiSmeBlacklistCfmSizeof(void *msg)
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
2274u8* 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
2294void* CsrWifiSmeBlacklistCfmDes(u8 *buffer, size_t length)
2295{
2296    CsrWifiSmeBlacklistCfm *primitive = kmalloc(sizeof(CsrWifiSmeBlacklistCfm), GFP_KERNEL);
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
2322void CsrWifiSmeBlacklistCfmSerFree(void *voidPrimitivePointer)
2323{
2324    CsrWifiSmeBlacklistCfm *primitive = (CsrWifiSmeBlacklistCfm *) voidPrimitivePointer;
2325    kfree(primitive->getAddresses);
2326    kfree(primitive);
2327}
2328
2329
2330size_t CsrWifiSmeCalibrationDataGetCfmSizeof(void *msg)
2331{
2332    CsrWifiSmeCalibrationDataGetCfm *primitive = (CsrWifiSmeCalibrationDataGetCfm *) msg;
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
2343u8* CsrWifiSmeCalibrationDataGetCfmSer(u8 *ptr, size_t *len, void *msg)
2344{
2345    CsrWifiSmeCalibrationDataGetCfm *primitive = (CsrWifiSmeCalibrationDataGetCfm *)msg;
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
2358void* CsrWifiSmeCalibrationDataGetCfmDes(u8 *buffer, size_t length)
2359{
2360    CsrWifiSmeCalibrationDataGetCfm *primitive = kmalloc(sizeof(CsrWifiSmeCalibrationDataGetCfm), GFP_KERNEL);
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
2381void CsrWifiSmeCalibrationDataGetCfmSerFree(void *voidPrimitivePointer)
2382{
2383    CsrWifiSmeCalibrationDataGetCfm *primitive = (CsrWifiSmeCalibrationDataGetCfm *) voidPrimitivePointer;
2384    kfree(primitive->calibrationData);
2385    kfree(primitive);
2386}
2387
2388
2389size_t CsrWifiSmeCcxConfigGetCfmSizeof(void *msg)
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
2404u8* CsrWifiSmeCcxConfigGetCfmSer(u8 *ptr, size_t *len, void *msg)
2405{
2406    CsrWifiSmeCcxConfigGetCfm *primitive = (CsrWifiSmeCcxConfigGetCfm *)msg;
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
2419void* CsrWifiSmeCcxConfigGetCfmDes(u8 *buffer, size_t length)
2420{
2421    CsrWifiSmeCcxConfigGetCfm *primitive = kmalloc(sizeof(CsrWifiSmeCcxConfigGetCfm), GFP_KERNEL);
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
2437size_t CsrWifiSmeCcxConfigSetCfmSizeof(void *msg)
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
2448u8* CsrWifiSmeCcxConfigSetCfmSer(u8 *ptr, size_t *len, void *msg)
2449{
2450    CsrWifiSmeCcxConfigSetCfm *primitive = (CsrWifiSmeCcxConfigSetCfm *)msg;
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
2459void* CsrWifiSmeCcxConfigSetCfmDes(u8 *buffer, size_t length)
2460{
2461    CsrWifiSmeCcxConfigSetCfm *primitive = kmalloc(sizeof(CsrWifiSmeCcxConfigSetCfm), GFP_KERNEL);
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
2473size_t CsrWifiSmeCoexConfigGetCfmSizeof(void *msg)
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
2497u8* CsrWifiSmeCoexConfigGetCfmSer(u8 *ptr, size_t *len, void *msg)
2498{
2499    CsrWifiSmeCoexConfigGetCfm *primitive = (CsrWifiSmeCoexConfigGetCfm *)msg;
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);
2506    CsrUint16Ser(ptr, len, (u16) primitive->coexConfig.coexTrafficContinuousLatencyMs);
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
2521void* CsrWifiSmeCoexConfigGetCfmDes(u8 *buffer, size_t length)
2522{
2523    CsrWifiSmeCoexConfigGetCfm *primitive = kmalloc(sizeof(CsrWifiSmeCoexConfigGetCfm), GFP_KERNEL);
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
2548size_t CsrWifiSmeCoexInfoGetCfmSizeof(void *msg)
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
2568u8* CsrWifiSmeCoexInfoGetCfmSer(u8 *ptr, size_t *len, void *msg)
2569{
2570    CsrWifiSmeCoexInfoGetCfm *primitive = (CsrWifiSmeCoexInfoGetCfm *)msg;
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
2588void* CsrWifiSmeCoexInfoGetCfmDes(u8 *buffer, size_t length)
2589{
2590    CsrWifiSmeCoexInfoGetCfm *primitive = kmalloc(sizeof(CsrWifiSmeCoexInfoGetCfm), GFP_KERNEL);
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
2611size_t CsrWifiSmeConnectCfmSizeof(void *msg)
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
2622u8* 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
2633void* CsrWifiSmeConnectCfmDes(u8 *buffer, size_t length)
2634{
2635    CsrWifiSmeConnectCfm *primitive = kmalloc(sizeof(CsrWifiSmeConnectCfm), GFP_KERNEL);
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
2647size_t CsrWifiSmeConnectionConfigGetCfmSizeof(void *msg)
2648{
2649    CsrWifiSmeConnectionConfigGetCfm *primitive = (CsrWifiSmeConnectionConfigGetCfm *) msg;
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
2672u8* CsrWifiSmeConnectionConfigGetCfmSer(u8 *ptr, size_t *len, void *msg)
2673{
2674    CsrWifiSmeConnectionConfigGetCfm *primitive = (CsrWifiSmeConnectionConfigGetCfm *)msg;
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);
2687    CsrUint16Ser(ptr, len, (u16) primitive->connectionConfig.mlmeAssociateReqInformationElementsLength);
2688    if (primitive->connectionConfig.mlmeAssociateReqInformationElementsLength)
2689    {
2690        CsrMemCpySer(ptr, len, (const void *) primitive->connectionConfig.mlmeAssociateReqInformationElements, ((u16) (primitive->connectionConfig.mlmeAssociateReqInformationElementsLength)));
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
2699void* CsrWifiSmeConnectionConfigGetCfmDes(u8 *buffer, size_t length)
2700{
2701    CsrWifiSmeConnectionConfigGetCfm *primitive = kmalloc(sizeof(CsrWifiSmeConnectionConfigGetCfm), GFP_KERNEL);
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);
2716    CsrUint16Des((u16 *) &primitive->connectionConfig.mlmeAssociateReqInformationElementsLength, buffer, &offset);
2717    if (primitive->connectionConfig.mlmeAssociateReqInformationElementsLength)
2718    {
2719        primitive->connectionConfig.mlmeAssociateReqInformationElements = kmalloc(primitive->connectionConfig.mlmeAssociateReqInformationElementsLength, GFP_KERNEL);
2720        CsrMemCpyDes(primitive->connectionConfig.mlmeAssociateReqInformationElements, buffer, &offset, ((u16) (primitive->connectionConfig.mlmeAssociateReqInformationElementsLength)));
2721    }
2722    else
2723    {
2724        primitive->connectionConfig.mlmeAssociateReqInformationElements = NULL;
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
2734void CsrWifiSmeConnectionConfigGetCfmSerFree(void *voidPrimitivePointer)
2735{
2736    CsrWifiSmeConnectionConfigGetCfm *primitive = (CsrWifiSmeConnectionConfigGetCfm *) voidPrimitivePointer;
2737    kfree(primitive->connectionConfig.mlmeAssociateReqInformationElements);
2738    kfree(primitive);
2739}
2740
2741
2742size_t CsrWifiSmeConnectionInfoGetCfmSizeof(void *msg)
2743{
2744    CsrWifiSmeConnectionInfoGetCfm *primitive = (CsrWifiSmeConnectionInfoGetCfm *) msg;
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
2785u8* CsrWifiSmeConnectionInfoGetCfmSer(u8 *ptr, size_t *len, void *msg)
2786{
2787    CsrWifiSmeConnectionInfoGetCfm *primitive = (CsrWifiSmeConnectionInfoGetCfm *)msg;
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);
2811    if (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);
2816    if (primitive->connectionInfo.associationRspFrameLength)
2817    {
2818        CsrMemCpySer(ptr, len, (const void *) primitive->connectionInfo.associationRspFrame, ((u16) (primitive->connectionInfo.associationRspFrameLength)));
2819    }
2820    CsrUint16Ser(ptr, len, (u16) primitive->connectionInfo.assocScanInfoElementsLength);
2821    if (primitive->connectionInfo.assocScanInfoElementsLength)
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)));
2828    CsrUint16Ser(ptr, len, (u16) primitive->connectionInfo.assocReqInfoElementsLength);
2829    if (primitive->connectionInfo.assocReqInfoElementsLength)
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);
2836    CsrUint16Ser(ptr, len, (u16) primitive->connectionInfo.assocRspInfoElementsLength);
2837    if (primitive->connectionInfo.assocRspInfoElementsLength)
2838    {
2839        CsrMemCpySer(ptr, len, (const void *) primitive->connectionInfo.assocRspInfoElements, ((u16) (primitive->connectionInfo.assocRspInfoElementsLength)));
2840    }
2841    return(ptr);
2842}
2843
2844
2845void* CsrWifiSmeConnectionInfoGetCfmDes(u8 *buffer, size_t length)
2846{
2847    CsrWifiSmeConnectionInfoGetCfm *primitive = kmalloc(sizeof(CsrWifiSmeConnectionInfoGetCfm), GFP_KERNEL);
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    {
2870        primitive->connectionInfo.beaconFrame = kmalloc(primitive->connectionInfo.beaconFrameLength, GFP_KERNEL);
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);
2878    if (primitive->connectionInfo.associationReqFrameLength)
2879    {
2880        primitive->connectionInfo.associationReqFrame = kmalloc(primitive->connectionInfo.associationReqFrameLength, GFP_KERNEL);
2881        CsrMemCpyDes(primitive->connectionInfo.associationReqFrame, buffer, &offset, ((u16) (primitive->connectionInfo.associationReqFrameLength)));
2882    }
2883    else
2884    {
2885        primitive->connectionInfo.associationReqFrame = NULL;
2886    }
2887    CsrUint16Des((u16 *) &primitive->connectionInfo.associationRspFrameLength, buffer, &offset);
2888    if (primitive->connectionInfo.associationRspFrameLength)
2889    {
2890        primitive->connectionInfo.associationRspFrame = kmalloc(primitive->connectionInfo.associationRspFrameLength, GFP_KERNEL);
2891        CsrMemCpyDes(primitive->connectionInfo.associationRspFrame, buffer, &offset, ((u16) (primitive->connectionInfo.associationRspFrameLength)));
2892    }
2893    else
2894    {
2895        primitive->connectionInfo.associationRspFrame = NULL;
2896    }
2897    CsrUint16Des((u16 *) &primitive->connectionInfo.assocScanInfoElementsLength, buffer, &offset);
2898    if (primitive->connectionInfo.assocScanInfoElementsLength)
2899    {
2900        primitive->connectionInfo.assocScanInfoElements = kmalloc(primitive->connectionInfo.assocScanInfoElementsLength, GFP_KERNEL);
2901        CsrMemCpyDes(primitive->connectionInfo.assocScanInfoElements, buffer, &offset, ((u16) (primitive->connectionInfo.assocScanInfoElementsLength)));
2902    }
2903    else
2904    {
2905        primitive->connectionInfo.assocScanInfoElements = NULL;
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);
2911    if (primitive->connectionInfo.assocReqInfoElementsLength)
2912    {
2913        primitive->connectionInfo.assocReqInfoElements = kmalloc(primitive->connectionInfo.assocReqInfoElementsLength, GFP_KERNEL);
2914        CsrMemCpyDes(primitive->connectionInfo.assocReqInfoElements, buffer, &offset, ((u16) (primitive->connectionInfo.assocReqInfoElementsLength)));
2915    }
2916    else
2917    {
2918        primitive->connectionInfo.assocReqInfoElements = NULL;
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);
2924    if (primitive->connectionInfo.assocRspInfoElementsLength)
2925    {
2926        primitive->connectionInfo.assocRspInfoElements = kmalloc(primitive->connectionInfo.assocRspInfoElementsLength, GFP_KERNEL);
2927        CsrMemCpyDes(primitive->connectionInfo.assocRspInfoElements, buffer, &offset, ((u16) (primitive->connectionInfo.assocRspInfoElementsLength)));
2928    }
2929    else
2930    {
2931        primitive->connectionInfo.assocRspInfoElements = NULL;
2932    }
2933
2934    return primitive;
2935}
2936
2937
2938void CsrWifiSmeConnectionInfoGetCfmSerFree(void *voidPrimitivePointer)
2939{
2940    CsrWifiSmeConnectionInfoGetCfm *primitive = (CsrWifiSmeConnectionInfoGetCfm *) voidPrimitivePointer;
2941    kfree(primitive->connectionInfo.beaconFrame);
2942    kfree(primitive->connectionInfo.associationReqFrame);
2943    kfree(primitive->connectionInfo.associationRspFrame);
2944    kfree(primitive->connectionInfo.assocScanInfoElements);
2945    kfree(primitive->connectionInfo.assocReqInfoElements);
2946    kfree(primitive->connectionInfo.assocRspInfoElements);
2947    kfree(primitive);
2948}
2949
2950
2951size_t CsrWifiSmeConnectionQualityIndSizeof(void *msg)
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
2963u8* CsrWifiSmeConnectionQualityIndSer(u8 *ptr, size_t *len, void *msg)
2964{
2965    CsrWifiSmeConnectionQualityInd *primitive = (CsrWifiSmeConnectionQualityInd *)msg;
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
2975void* CsrWifiSmeConnectionQualityIndDes(u8 *buffer, size_t length)
2976{
2977    CsrWifiSmeConnectionQualityInd *primitive = kmalloc(sizeof(CsrWifiSmeConnectionQualityInd), GFP_KERNEL);
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
2990size_t CsrWifiSmeConnectionStatsGetCfmSizeof(void *msg)
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
3026u8* CsrWifiSmeConnectionStatsGetCfmSer(u8 *ptr, size_t *len, void *msg)
3027{
3028    CsrWifiSmeConnectionStatsGetCfm *primitive = (CsrWifiSmeConnectionStatsGetCfm *)msg;
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);
3043    CsrUint32Ser(ptr, len, (u32) primitive->connectionStats.dot11TransmittedFragmentCount);
3044    CsrUint32Ser(ptr, len, (u32) primitive->connectionStats.dot11TransmittedFrameCount);
3045    CsrUint32Ser(ptr, len, (u32) primitive->connectionStats.dot11WepExcludedCount);
3046    CsrUint32Ser(ptr, len, (u32) primitive->connectionStats.dot11WepIcvErrorCount);
3047    CsrUint32Ser(ptr, len, (u32) primitive->connectionStats.dot11WepUndecryptableCount);
3048    CsrUint32Ser(ptr, len, (u32) primitive->connectionStats.dot11MulticastReceivedFrameCount);
3049    CsrUint32Ser(ptr, len, (u32) primitive->connectionStats.dot11MulticastTransmittedFrameCount);
3050    CsrUint32Ser(ptr, len, (u32) primitive->connectionStats.dot11ReceivedFragmentCount);
3051    CsrUint32Ser(ptr, len, (u32) primitive->connectionStats.dot11Rsna4WayHandshakeFailures);
3052    CsrUint32Ser(ptr, len, (u32) primitive->connectionStats.dot11RsnaTkipCounterMeasuresInvoked);
3053    CsrUint32Ser(ptr, len, (u32) primitive->connectionStats.dot11RsnaStatsTkipLocalMicFailures);
3054    CsrUint32Ser(ptr, len, (u32) primitive->connectionStats.dot11RsnaStatsTkipReplays);
3055    CsrUint32Ser(ptr, len, (u32) primitive->connectionStats.dot11RsnaStatsTkipIcvErrors);
3056    CsrUint32Ser(ptr, len, (u32) primitive->connectionStats.dot11RsnaStatsCcmpReplays);
3057    CsrUint32Ser(ptr, len, (u32) primitive->connectionStats.dot11RsnaStatsCcmpDecryptErrors);
3058    return(ptr);
3059}
3060
3061
3062void* CsrWifiSmeConnectionStatsGetCfmDes(u8 *buffer, size_t length)
3063{
3064    CsrWifiSmeConnectionStatsGetCfm *primitive = kmalloc(sizeof(CsrWifiSmeConnectionStatsGetCfm), GFP_KERNEL);
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
3101size_t CsrWifiSmeDisconnectCfmSizeof(void *msg)
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
3112u8* CsrWifiSmeDisconnectCfmSer(u8 *ptr, size_t *len, void *msg)
3113{
3114    CsrWifiSmeDisconnectCfm *primitive = (CsrWifiSmeDisconnectCfm *)msg;
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
3123void* CsrWifiSmeDisconnectCfmDes(u8 *buffer, size_t length)
3124{
3125    CsrWifiSmeDisconnectCfm *primitive = kmalloc(sizeof(CsrWifiSmeDisconnectCfm), GFP_KERNEL);
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
3137size_t CsrWifiSmeHostConfigGetCfmSizeof(void *msg)
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
3150u8* CsrWifiSmeHostConfigGetCfmSer(u8 *ptr, size_t *len, void *msg)
3151{
3152    CsrWifiSmeHostConfigGetCfm *primitive = (CsrWifiSmeHostConfigGetCfm *)msg;
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
3163void* CsrWifiSmeHostConfigGetCfmDes(u8 *buffer, size_t length)
3164{
3165    CsrWifiSmeHostConfigGetCfm *primitive = kmalloc(sizeof(CsrWifiSmeHostConfigGetCfm), GFP_KERNEL);
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
3179size_t CsrWifiSmeHostConfigSetCfmSizeof(void *msg)
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
3190u8* CsrWifiSmeHostConfigSetCfmSer(u8 *ptr, size_t *len, void *msg)
3191{
3192    CsrWifiSmeHostConfigSetCfm *primitive = (CsrWifiSmeHostConfigSetCfm *)msg;
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
3201void* CsrWifiSmeHostConfigSetCfmDes(u8 *buffer, size_t length)
3202{
3203    CsrWifiSmeHostConfigSetCfm *primitive = kmalloc(sizeof(CsrWifiSmeHostConfigSetCfm), GFP_KERNEL);
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
3215size_t CsrWifiSmeIbssStationIndSizeof(void *msg)
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
3226u8* CsrWifiSmeIbssStationIndSer(u8 *ptr, size_t *len, void *msg)
3227{
3228    CsrWifiSmeIbssStationInd *primitive = (CsrWifiSmeIbssStationInd *)msg;
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
3237void* CsrWifiSmeIbssStationIndDes(u8 *buffer, size_t length)
3238{
3239    CsrWifiSmeIbssStationInd *primitive = kmalloc(sizeof(CsrWifiSmeIbssStationInd), GFP_KERNEL);
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
3251size_t CsrWifiSmeKeyCfmSizeof(void *msg)
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
3265u8* 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
3279void* CsrWifiSmeKeyCfmDes(u8 *buffer, size_t length)
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
3296size_t CsrWifiSmeLinkQualityGetCfmSizeof(void *msg)
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
3309u8* CsrWifiSmeLinkQualityGetCfmSer(u8 *ptr, size_t *len, void *msg)
3310{
3311    CsrWifiSmeLinkQualityGetCfm *primitive = (CsrWifiSmeLinkQualityGetCfm *)msg;
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
3322void* CsrWifiSmeLinkQualityGetCfmDes(u8 *buffer, size_t length)
3323{
3324    CsrWifiSmeLinkQualityGetCfm *primitive = kmalloc(sizeof(CsrWifiSmeLinkQualityGetCfm), GFP_KERNEL);
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
3338size_t CsrWifiSmeMediaStatusIndSizeof(void *msg)
3339{
3340    CsrWifiSmeMediaStatusInd *primitive = (CsrWifiSmeMediaStatusInd *) msg;
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
3383u8* CsrWifiSmeMediaStatusIndSer(u8 *ptr, size_t *len, void *msg)
3384{
3385    CsrWifiSmeMediaStatusInd *primitive = (CsrWifiSmeMediaStatusInd *)msg;
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);
3409    if (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);
3414    if (primitive->connectionInfo.associationRspFrameLength)
3415    {
3416        CsrMemCpySer(ptr, len, (const void *) primitive->connectionInfo.associationRspFrame, ((u16) (primitive->connectionInfo.associationRspFrameLength)));
3417    }
3418    CsrUint16Ser(ptr, len, (u16) primitive->connectionInfo.assocScanInfoElementsLength);
3419    if (primitive->connectionInfo.assocScanInfoElementsLength)
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)));
3426    CsrUint16Ser(ptr, len, (u16) primitive->connectionInfo.assocReqInfoElementsLength);
3427    if (primitive->connectionInfo.assocReqInfoElementsLength)
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);
3434    CsrUint16Ser(ptr, len, (u16) primitive->connectionInfo.assocRspInfoElementsLength);
3435    if (primitive->connectionInfo.assocRspInfoElementsLength)
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
3445void* CsrWifiSmeMediaStatusIndDes(u8 *buffer, size_t length)
3446{
3447    CsrWifiSmeMediaStatusInd *primitive = kmalloc(sizeof(CsrWifiSmeMediaStatusInd), GFP_KERNEL);
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    {
3470        primitive->connectionInfo.beaconFrame = kmalloc(primitive->connectionInfo.beaconFrameLength, GFP_KERNEL);
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);
3478    if (primitive->connectionInfo.associationReqFrameLength)
3479    {
3480        primitive->connectionInfo.associationReqFrame = kmalloc(primitive->connectionInfo.associationReqFrameLength, GFP_KERNEL);
3481        CsrMemCpyDes(primitive->connectionInfo.associationReqFrame, buffer, &offset, ((u16) (primitive->connectionInfo.associationReqFrameLength)));
3482    }
3483    else
3484    {
3485        primitive->connectionInfo.associationReqFrame = NULL;
3486    }
3487    CsrUint16Des((u16 *) &primitive->connectionInfo.associationRspFrameLength, buffer, &offset);
3488    if (primitive->connectionInfo.associationRspFrameLength)
3489    {
3490        primitive->connectionInfo.associationRspFrame = kmalloc(primitive->connectionInfo.associationRspFrameLength, GFP_KERNEL);
3491        CsrMemCpyDes(primitive->connectionInfo.associationRspFrame, buffer, &offset, ((u16) (primitive->connectionInfo.associationRspFrameLength)));
3492    }
3493    else
3494    {
3495        primitive->connectionInfo.associationRspFrame = NULL;
3496    }
3497    CsrUint16Des((u16 *) &primitive->connectionInfo.assocScanInfoElementsLength, buffer, &offset);
3498    if (primitive->connectionInfo.assocScanInfoElementsLength)
3499    {
3500        primitive->connectionInfo.assocScanInfoElements = kmalloc(primitive->connectionInfo.assocScanInfoElementsLength, GFP_KERNEL);
3501        CsrMemCpyDes(primitive->connectionInfo.assocScanInfoElements, buffer, &offset, ((u16) (primitive->connectionInfo.assocScanInfoElementsLength)));
3502    }
3503    else
3504    {
3505        primitive->connectionInfo.assocScanInfoElements = NULL;
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);
3511    if (primitive->connectionInfo.assocReqInfoElementsLength)
3512    {
3513        primitive->connectionInfo.assocReqInfoElements = kmalloc(primitive->connectionInfo.assocReqInfoElementsLength, GFP_KERNEL);
3514        CsrMemCpyDes(primitive->connectionInfo.assocReqInfoElements, buffer, &offset, ((u16) (primitive->connectionInfo.assocReqInfoElementsLength)));
3515    }
3516    else
3517    {
3518        primitive->connectionInfo.assocReqInfoElements = NULL;
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);
3524    if (primitive->connectionInfo.assocRspInfoElementsLength)
3525    {
3526        primitive->connectionInfo.assocRspInfoElements = kmalloc(primitive->connectionInfo.assocRspInfoElementsLength, GFP_KERNEL);
3527        CsrMemCpyDes(primitive->connectionInfo.assocRspInfoElements, buffer, &offset, ((u16) (primitive->connectionInfo.assocRspInfoElementsLength)));
3528    }
3529    else
3530    {
3531        primitive->connectionInfo.assocRspInfoElements = NULL;
3532    }
3533    CsrUint16Des((u16 *) &primitive->disassocReason, buffer, &offset);
3534    CsrUint16Des((u16 *) &primitive->deauthReason, buffer, &offset);
3535
3536    return primitive;
3537}
3538
3539
3540void CsrWifiSmeMediaStatusIndSerFree(void *voidPrimitivePointer)
3541{
3542    CsrWifiSmeMediaStatusInd *primitive = (CsrWifiSmeMediaStatusInd *) voidPrimitivePointer;
3543    kfree(primitive->connectionInfo.beaconFrame);
3544    kfree(primitive->connectionInfo.associationReqFrame);
3545    kfree(primitive->connectionInfo.associationRspFrame);
3546    kfree(primitive->connectionInfo.assocScanInfoElements);
3547    kfree(primitive->connectionInfo.assocReqInfoElements);
3548    kfree(primitive->connectionInfo.assocRspInfoElements);
3549    kfree(primitive);
3550}
3551
3552
3553size_t CsrWifiSmeMibConfigGetCfmSizeof(void *msg)
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
3568u8* CsrWifiSmeMibConfigGetCfmSer(u8 *ptr, size_t *len, void *msg)
3569{
3570    CsrWifiSmeMibConfigGetCfm *primitive = (CsrWifiSmeMibConfigGetCfm *)msg;
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
3583void* CsrWifiSmeMibConfigGetCfmDes(u8 *buffer, size_t length)
3584{
3585    CsrWifiSmeMibConfigGetCfm *primitive = kmalloc(sizeof(CsrWifiSmeMibConfigGetCfm), GFP_KERNEL);
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
3601size_t CsrWifiSmeMibGetCfmSizeof(void *msg)
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
3614u8* 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
3629void* CsrWifiSmeMibGetCfmDes(u8 *buffer, size_t length)
3630{
3631    CsrWifiSmeMibGetCfm *primitive = kmalloc(sizeof(CsrWifiSmeMibGetCfm), GFP_KERNEL);
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
3652void CsrWifiSmeMibGetCfmSerFree(void *voidPrimitivePointer)
3653{
3654    CsrWifiSmeMibGetCfm *primitive = (CsrWifiSmeMibGetCfm *) voidPrimitivePointer;
3655    kfree(primitive->mibAttribute);
3656    kfree(primitive);
3657}
3658
3659
3660size_t CsrWifiSmeMibGetNextCfmSizeof(void *msg)
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
3673u8* CsrWifiSmeMibGetNextCfmSer(u8 *ptr, size_t *len, void *msg)
3674{
3675    CsrWifiSmeMibGetNextCfm *primitive = (CsrWifiSmeMibGetNextCfm *)msg;
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
3688void* CsrWifiSmeMibGetNextCfmDes(u8 *buffer, size_t length)
3689{
3690    CsrWifiSmeMibGetNextCfm *primitive = kmalloc(sizeof(CsrWifiSmeMibGetNextCfm), GFP_KERNEL);
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
3711void CsrWifiSmeMibGetNextCfmSerFree(void *voidPrimitivePointer)
3712{
3713    CsrWifiSmeMibGetNextCfm *primitive = (CsrWifiSmeMibGetNextCfm *) voidPrimitivePointer;
3714    kfree(primitive->mibAttribute);
3715    kfree(primitive);
3716}
3717
3718
3719size_t CsrWifiSmeMicFailureIndSizeof(void *msg)
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
3733u8* CsrWifiSmeMicFailureIndSer(u8 *ptr, size_t *len, void *msg)
3734{
3735    CsrWifiSmeMicFailureInd *primitive = (CsrWifiSmeMicFailureInd *)msg;
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
3747void* CsrWifiSmeMicFailureIndDes(u8 *buffer, size_t length)
3748{
3749    CsrWifiSmeMicFailureInd *primitive = kmalloc(sizeof(CsrWifiSmeMicFailureInd), GFP_KERNEL);
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
3764size_t CsrWifiSmeMulticastAddressCfmSizeof(void *msg)
3765{
3766    CsrWifiSmeMulticastAddressCfm *primitive = (CsrWifiSmeMulticastAddressCfm *) msg;
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
3785u8* CsrWifiSmeMulticastAddressCfmSer(u8 *ptr, size_t *len, void *msg)
3786{
3787    CsrWifiSmeMulticastAddressCfm *primitive = (CsrWifiSmeMulticastAddressCfm *)msg;
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
3805void* CsrWifiSmeMulticastAddressCfmDes(u8 *buffer, size_t length)
3806{
3807    CsrWifiSmeMulticastAddressCfm *primitive = kmalloc(sizeof(CsrWifiSmeMulticastAddressCfm), GFP_KERNEL);
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
3833void CsrWifiSmeMulticastAddressCfmSerFree(void *voidPrimitivePointer)
3834{
3835    CsrWifiSmeMulticastAddressCfm *primitive = (CsrWifiSmeMulticastAddressCfm *) voidPrimitivePointer;
3836    kfree(primitive->getAddresses);
3837    kfree(primitive);
3838}
3839
3840
3841size_t CsrWifiSmePacketFilterSetCfmSizeof(void *msg)
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
3852u8* CsrWifiSmePacketFilterSetCfmSer(u8 *ptr, size_t *len, void *msg)
3853{
3854    CsrWifiSmePacketFilterSetCfm *primitive = (CsrWifiSmePacketFilterSetCfm *)msg;
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
3863void* CsrWifiSmePacketFilterSetCfmDes(u8 *buffer, size_t length)
3864{
3865    CsrWifiSmePacketFilterSetCfm *primitive = kmalloc(sizeof(CsrWifiSmePacketFilterSetCfm), GFP_KERNEL);
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
3877size_t CsrWifiSmePermanentMacAddressGetCfmSizeof(void *msg)
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
3888u8* CsrWifiSmePermanentMacAddressGetCfmSer(u8 *ptr, size_t *len, void *msg)
3889{
3890    CsrWifiSmePermanentMacAddressGetCfm *primitive = (CsrWifiSmePermanentMacAddressGetCfm *)msg;
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
3899void* CsrWifiSmePermanentMacAddressGetCfmDes(u8 *buffer, size_t length)
3900{
3901    CsrWifiSmePermanentMacAddressGetCfm *primitive = kmalloc(sizeof(CsrWifiSmePermanentMacAddressGetCfm), GFP_KERNEL);
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
3913size_t CsrWifiSmePmkidCandidateListIndSizeof(void *msg)
3914{
3915    CsrWifiSmePmkidCandidateListInd *primitive = (CsrWifiSmePmkidCandidateListInd *) msg;
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
3933u8* CsrWifiSmePmkidCandidateListIndSer(u8 *ptr, size_t *len, void *msg)
3934{
3935    CsrWifiSmePmkidCandidateListInd *primitive = (CsrWifiSmePmkidCandidateListInd *)msg;
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
3952void* CsrWifiSmePmkidCandidateListIndDes(u8 *buffer, size_t length)
3953{
3954    CsrWifiSmePmkidCandidateListInd *primitive = kmalloc(sizeof(CsrWifiSmePmkidCandidateListInd), GFP_KERNEL);
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    {
3964        primitive->pmkidCandidates = kmalloc(sizeof(CsrWifiSmePmkidCandidate) * primitive->pmkidCandidatesCount, GFP_KERNEL);
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
3979void CsrWifiSmePmkidCandidateListIndSerFree(void *voidPrimitivePointer)
3980{
3981    CsrWifiSmePmkidCandidateListInd *primitive = (CsrWifiSmePmkidCandidateListInd *) voidPrimitivePointer;
3982    kfree(primitive->pmkidCandidates);
3983    kfree(primitive);
3984}
3985
3986
3987size_t CsrWifiSmePmkidCfmSizeof(void *msg)
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
4009u8* 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
4030void* CsrWifiSmePmkidCfmDes(u8 *buffer, size_t length)
4031{
4032    CsrWifiSmePmkidCfm *primitive = kmalloc(sizeof(CsrWifiSmePmkidCfm), GFP_KERNEL);
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
4059void CsrWifiSmePmkidCfmSerFree(void *voidPrimitivePointer)
4060{
4061    CsrWifiSmePmkidCfm *primitive = (CsrWifiSmePmkidCfm *) voidPrimitivePointer;
4062    kfree(primitive->getPmkids);
4063    kfree(primitive);
4064}
4065
4066
4067size_t CsrWifiSmePowerConfigGetCfmSizeof(void *msg)
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
4084u8* CsrWifiSmePowerConfigGetCfmSer(u8 *ptr, size_t *len, void *msg)
4085{
4086    CsrWifiSmePowerConfigGetCfm *primitive = (CsrWifiSmePowerConfigGetCfm *)msg;
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
4101void* CsrWifiSmePowerConfigGetCfmDes(u8 *buffer, size_t length)
4102{
4103    CsrWifiSmePowerConfigGetCfm *primitive = kmalloc(sizeof(CsrWifiSmePowerConfigGetCfm), GFP_KERNEL);
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
4121size_t CsrWifiSmeRegulatoryDomainInfoGetCfmSizeof(void *msg)
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
4135u8* CsrWifiSmeRegulatoryDomainInfoGetCfmSer(u8 *ptr, size_t *len, void *msg)
4136{
4137    CsrWifiSmeRegulatoryDomainInfoGetCfm *primitive = (CsrWifiSmeRegulatoryDomainInfoGetCfm *)msg;
4138    *len = 0;
4139    CsrUint16Ser(ptr, len, primitive->common.type);
4140    CsrUint16Ser(ptr, len, (u16) primitive->status);
4141    CsrUint8Ser(ptr, len, (u8) primitive->regDomInfo.dot11MultiDomainCapabilityImplemented);
4142    CsrUint8Ser(ptr, len, (u8) primitive->regDomInfo.dot11MultiDomainCapabilityEnabled);
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
4149void* CsrWifiSmeRegulatoryDomainInfoGetCfmDes(u8 *buffer, size_t length)
4150{
4151    CsrWifiSmeRegulatoryDomainInfoGetCfm *primitive = kmalloc(sizeof(CsrWifiSmeRegulatoryDomainInfoGetCfm), GFP_KERNEL);
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
4166size_t CsrWifiSmeRoamCompleteIndSizeof(void *msg)
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
4177u8* CsrWifiSmeRoamCompleteIndSer(u8 *ptr, size_t *len, void *msg)
4178{
4179    CsrWifiSmeRoamCompleteInd *primitive = (CsrWifiSmeRoamCompleteInd *)msg;
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
4188void* CsrWifiSmeRoamCompleteIndDes(u8 *buffer, size_t length)
4189{
4190    CsrWifiSmeRoamCompleteInd *primitive = kmalloc(sizeof(CsrWifiSmeRoamCompleteInd), GFP_KERNEL);
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
4202size_t CsrWifiSmeRoamStartIndSizeof(void *msg)
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
4214u8* 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
4226void* CsrWifiSmeRoamStartIndDes(u8 *buffer, size_t length)
4227{
4228    CsrWifiSmeRoamStartInd *primitive = kmalloc(sizeof(CsrWifiSmeRoamStartInd), GFP_KERNEL);
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
4241size_t CsrWifiSmeRoamingConfigGetCfmSizeof(void *msg)
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
4278u8* CsrWifiSmeRoamingConfigGetCfmSer(u8 *ptr, size_t *len, void *msg)
4279{
4280    CsrWifiSmeRoamingConfigGetCfm *primitive = (CsrWifiSmeRoamingConfigGetCfm *)msg;
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);
4307            CsrUint16Ser(ptr, len, (u16) primitive->roamingConfig.roamScanCfg[i2].minPassiveChannelTimeTu);
4308            CsrUint16Ser(ptr, len, (u16) primitive->roamingConfig.roamScanCfg[i2].maxPassiveChannelTimeTu);
4309        }
4310    }
4311    return(ptr);
4312}
4313
4314
4315void* CsrWifiSmeRoamingConfigGetCfmDes(u8 *buffer, size_t length)
4316{
4317    CsrWifiSmeRoamingConfigGetCfm *primitive = kmalloc(sizeof(CsrWifiSmeRoamingConfigGetCfm), GFP_KERNEL);
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
4355size_t CsrWifiSmeRoamingConfigSetCfmSizeof(void *msg)
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
4366u8* CsrWifiSmeRoamingConfigSetCfmSer(u8 *ptr, size_t *len, void *msg)
4367{
4368    CsrWifiSmeRoamingConfigSetCfm *primitive = (CsrWifiSmeRoamingConfigSetCfm *)msg;
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
4377void* CsrWifiSmeRoamingConfigSetCfmDes(u8 *buffer, size_t length)
4378{
4379    CsrWifiSmeRoamingConfigSetCfm *primitive = kmalloc(sizeof(CsrWifiSmeRoamingConfigSetCfm), GFP_KERNEL);
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
4391size_t CsrWifiSmeScanConfigGetCfmSizeof(void *msg)
4392{
4393    CsrWifiSmeScanConfigGetCfm *primitive = (CsrWifiSmeScanConfigGetCfm *) msg;
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
4424u8* CsrWifiSmeScanConfigGetCfmSer(u8 *ptr, size_t *len, void *msg)
4425{
4426    CsrWifiSmeScanConfigGetCfm *primitive = (CsrWifiSmeScanConfigGetCfm *)msg;
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
4459void* CsrWifiSmeScanConfigGetCfmDes(u8 *buffer, size_t length)
4460{
4461    CsrWifiSmeScanConfigGetCfm *primitive = kmalloc(sizeof(CsrWifiSmeScanConfigGetCfm), GFP_KERNEL);
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    {
4490        primitive->scanConfig.passiveChannelList = kmalloc(primitive->scanConfig.passiveChannelListCount, GFP_KERNEL);
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
4502void CsrWifiSmeScanConfigGetCfmSerFree(void *voidPrimitivePointer)
4503{
4504    CsrWifiSmeScanConfigGetCfm *primitive = (CsrWifiSmeScanConfigGetCfm *) voidPrimitivePointer;
4505    kfree(primitive->scanConfig.passiveChannelList);
4506    kfree(primitive);
4507}
4508
4509
4510size_t CsrWifiSmeScanResultIndSizeof(void *msg)
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    {
4535        case CSR_WIFI_SME_P2P_ROLE_CLI:
4536            bufferSize += 1; /* u8 primitive->result.deviceInfo.reservedCli.empty */
4537            break;
4538        case CSR_WIFI_SME_P2P_ROLE_GO:
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;
4564        case CSR_WIFI_SME_P2P_ROLE_NONE:
4565            bufferSize += 1; /* u8 primitive->result.deviceInfo.reservedNone.empty */
4566            break;
4567        case CSR_WIFI_SME_P2P_ROLE_STANDALONE:
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
4590u8* CsrWifiSmeScanResultIndSer(u8 *ptr, size_t *len, void *msg)
4591{
4592    CsrWifiSmeScanResultInd *primitive = (CsrWifiSmeScanResultInd *)msg;
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    {
4617        case CSR_WIFI_SME_P2P_ROLE_CLI:
4618            CsrUint8Ser(ptr, len, (u8) primitive->result.deviceInfo.reservedCli.empty);
4619            break;
4620        case CSR_WIFI_SME_P2P_ROLE_GO:
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)));
4630                    CsrUint16Ser(ptr, len, (u16) primitive->result.deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.configMethods);
4631                    CsrUint8Ser(ptr, len, (u8) primitive->result.deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.p2PDeviceCap);
4632                    CsrMemCpySer(ptr, len, (const void *) primitive->result.deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.primDeviceType.deviceDetails, ((u16) (8)));
4633                    CsrUint8Ser(ptr, len, (u8) primitive->result.deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.secondaryDeviceTypeCount);
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)));
4642                    CsrUint8Ser(ptr, len, (u8) primitive->result.deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.deviceNameLength);
4643                }
4644            }
4645            break;
4646        case CSR_WIFI_SME_P2P_ROLE_NONE:
4647            CsrUint8Ser(ptr, len, (u8) primitive->result.deviceInfo.reservedNone.empty);
4648            break;
4649        case CSR_WIFI_SME_P2P_ROLE_STANDALONE:
4650            CsrMemCpySer(ptr, len, (const void *) primitive->result.deviceInfo.standalonedevInfo.deviceAddress.a, ((u16) (6)));
4651            CsrUint16Ser(ptr, len, (u16) primitive->result.deviceInfo.standalonedevInfo.configMethods);
4652            CsrUint8Ser(ptr, len, (u8) primitive->result.deviceInfo.standalonedevInfo.p2PDeviceCap);
4653            CsrMemCpySer(ptr, len, (const void *) primitive->result.deviceInfo.standalonedevInfo.primDeviceType.deviceDetails, ((u16) (8)));
4654            CsrUint8Ser(ptr, len, (u8) primitive->result.deviceInfo.standalonedevInfo.secondaryDeviceTypeCount);
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)));
4663            CsrUint8Ser(ptr, len, (u8) primitive->result.deviceInfo.standalonedevInfo.deviceNameLength);
4664            break;
4665        default:
4666            break;
4667    }
4668    return(ptr);
4669}
4670
4671
4672void* CsrWifiSmeScanResultIndDes(u8 *buffer, size_t length)
4673{
4674    CsrWifiSmeScanResultInd *primitive = kmalloc(sizeof(CsrWifiSmeScanResultInd), GFP_KERNEL);
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    {
4696        primitive->result.informationElements = kmalloc(primitive->result.informationElementsLength, GFP_KERNEL);
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    {
4706        case CSR_WIFI_SME_P2P_ROLE_CLI:
4707            CsrUint8Des((u8 *) &primitive->result.deviceInfo.reservedCli.empty, buffer, &offset);
4708            break;
4709        case CSR_WIFI_SME_P2P_ROLE_GO:
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);
4713            primitive->result.deviceInfo.groupInfo.p2PClientInfo = NULL;
4714            if (primitive->result.deviceInfo.groupInfo.p2pClientInfoCount)
4715            {
4716                primitive->result.deviceInfo.groupInfo.p2PClientInfo = kmalloc(sizeof(CsrWifiSmeP2pClientInfoType) * primitive->result.deviceInfo.groupInfo.p2pClientInfoCount, GFP_KERNEL);
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)));
4724                    CsrUint16Des((u16 *) &primitive->result.deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.configMethods, buffer, &offset);
4725                    CsrUint8Des((u8 *) &primitive->result.deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.p2PDeviceCap, buffer, &offset);
4726                    CsrMemCpyDes(primitive->result.deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.primDeviceType.deviceDetails, buffer, &offset, ((u16) (8)));
4727                    CsrUint8Des((u8 *) &primitive->result.deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.secondaryDeviceTypeCount, buffer, &offset);
4728                    primitive->result.deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.secDeviceType = NULL;
4729                    if (primitive->result.deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.secondaryDeviceTypeCount)
4730                    {
4731                        primitive->result.deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.secDeviceType = kmalloc(sizeof(CsrWifiSmeWpsDeviceType) * primitive->result.deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.secondaryDeviceTypeCount, GFP_KERNEL);
4732                    }
4733                    {
4734                        u16 i6;
4735                        for (i6 = 0; i6 < primitive->result.deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.secondaryDeviceTypeCount; i6++)
4736                        {
4737                            CsrMemCpyDes(primitive->result.deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.secDeviceType[i6].deviceDetails, buffer, &offset, ((u16) (8)));
4738                        }
4739                    }
4740                    CsrMemCpyDes(primitive->result.deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.deviceName, buffer, &offset, ((u16) (32)));
4741                    CsrUint8Des((u8 *) &primitive->result.deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.deviceNameLength, buffer, &offset);
4742                }
4743            }
4744            break;
4745        case CSR_WIFI_SME_P2P_ROLE_NONE:
4746            CsrUint8Des((u8 *) &primitive->result.deviceInfo.reservedNone.empty, buffer, &offset);
4747            break;
4748        case CSR_WIFI_SME_P2P_ROLE_STANDALONE:
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);
4754            primitive->result.deviceInfo.standalonedevInfo.secDeviceType = NULL;
4755            if (primitive->result.deviceInfo.standalonedevInfo.secondaryDeviceTypeCount)
4756            {
4757                primitive->result.deviceInfo.standalonedevInfo.secDeviceType = kmalloc(sizeof(CsrWifiSmeWpsDeviceType) * primitive->result.deviceInfo.standalonedevInfo.secondaryDeviceTypeCount, GFP_KERNEL);
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
4777void CsrWifiSmeScanResultIndSerFree(void *voidPrimitivePointer)
4778{
4779    CsrWifiSmeScanResultInd *primitive = (CsrWifiSmeScanResultInd *) voidPrimitivePointer;
4780    kfree(primitive->result.informationElements);
4781    switch (primitive->result.p2pDeviceRole)
4782    {
4783        case CSR_WIFI_SME_P2P_ROLE_GO:
4784        {
4785            u16 i4;
4786            for (i4 = 0; i4 < primitive->result.deviceInfo.groupInfo.p2pClientInfoCount; i4++)
4787            {
4788                kfree(primitive->result.deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.secDeviceType);
4789            }
4790        }
4791            kfree(primitive->result.deviceInfo.groupInfo.p2PClientInfo);
4792            break;
4793        case CSR_WIFI_SME_P2P_ROLE_STANDALONE:
4794            kfree(primitive->result.deviceInfo.standalonedevInfo.secDeviceType);
4795            break;
4796        default:
4797            break;
4798    }
4799    kfree(primitive);
4800}
4801
4802
4803size_t CsrWifiSmeScanResultsGetCfmSizeof(void *msg)
4804{
4805    CsrWifiSmeScanResultsGetCfm *primitive = (CsrWifiSmeScanResultsGetCfm *) msg;
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            {
4834                case CSR_WIFI_SME_P2P_ROLE_CLI:
4835                    bufferSize += 1; /* u8 primitive->scanResults[i1].deviceInfo.reservedCli.empty */
4836                    break;
4837                case CSR_WIFI_SME_P2P_ROLE_GO:
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;
4863                case CSR_WIFI_SME_P2P_ROLE_NONE:
4864                    bufferSize += 1; /* u8 primitive->scanResults[i1].deviceInfo.reservedNone.empty */
4865                    break;
4866                case CSR_WIFI_SME_P2P_ROLE_STANDALONE:
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
4891u8* CsrWifiSmeScanResultsGetCfmSer(u8 *ptr, size_t *len, void *msg)
4892{
4893    CsrWifiSmeScanResultsGetCfm *primitive = (CsrWifiSmeScanResultsGetCfm *)msg;
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            {
4924                case CSR_WIFI_SME_P2P_ROLE_CLI:
4925                    CsrUint8Ser(ptr, len, (u8) primitive->scanResults[i1].deviceInfo.reservedCli.empty);
4926                    break;
4927                case CSR_WIFI_SME_P2P_ROLE_GO:
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)));
4937                            CsrUint16Ser(ptr, len, (u16) primitive->scanResults[i1].deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.configMethods);
4938                            CsrUint8Ser(ptr, len, (u8) primitive->scanResults[i1].deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.p2PDeviceCap);
4939                            CsrMemCpySer(ptr, len, (const void *) primitive->scanResults[i1].deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.primDeviceType.deviceDetails, ((u16) (8)));
4940                            CsrUint8Ser(ptr, len, (u8) primitive->scanResults[i1].deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.secondaryDeviceTypeCount);
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)));
4949                            CsrUint8Ser(ptr, len, (u8) primitive->scanResults[i1].deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.deviceNameLength);
4950                        }
4951                    }
4952                    break;
4953                case CSR_WIFI_SME_P2P_ROLE_NONE:
4954                    CsrUint8Ser(ptr, len, (u8) primitive->scanResults[i1].deviceInfo.reservedNone.empty);
4955                    break;
4956                case CSR_WIFI_SME_P2P_ROLE_STANDALONE:
4957                    CsrMemCpySer(ptr, len, (const void *) primitive->scanResults[i1].deviceInfo.standalonedevInfo.deviceAddress.a, ((u16) (6)));
4958                    CsrUint16Ser(ptr, len, (u16) primitive->scanResults[i1].deviceInfo.standalonedevInfo.configMethods);
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)));
4961                    CsrUint8Ser(ptr, len, (u8) primitive->scanResults[i1].deviceInfo.standalonedevInfo.secondaryDeviceTypeCount);
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)));
4970                    CsrUint8Ser(ptr, len, (u8) primitive->scanResults[i1].deviceInfo.standalonedevInfo.deviceNameLength);
4971                    break;
4972                default:
4973                    break;
4974            }
4975        }
4976    }
4977    return(ptr);
4978}
4979
4980
4981void* CsrWifiSmeScanResultsGetCfmDes(u8 *buffer, size_t length)
4982{
4983    CsrWifiSmeScanResultsGetCfm *primitive = kmalloc(sizeof(CsrWifiSmeScanResultsGetCfm), GFP_KERNEL);
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            {
5016                primitive->scanResults[i1].informationElements = kmalloc(primitive->scanResults[i1].informationElementsLength, GFP_KERNEL);
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            {
5026                case CSR_WIFI_SME_P2P_ROLE_CLI:
5027                    CsrUint8Des((u8 *) &primitive->scanResults[i1].deviceInfo.reservedCli.empty, buffer, &offset);
5028                    break;
5029                case CSR_WIFI_SME_P2P_ROLE_GO:
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);
5033                    primitive->scanResults[i1].deviceInfo.groupInfo.p2PClientInfo = NULL;
5034                    if (primitive->scanResults[i1].deviceInfo.groupInfo.p2pClientInfoCount)
5035                    {
5036                        primitive->scanResults[i1].deviceInfo.groupInfo.p2PClientInfo = kmalloc(sizeof(CsrWifiSmeP2pClientInfoType) * primitive->scanResults[i1].deviceInfo.groupInfo.p2pClientInfoCount, GFP_KERNEL);
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);
5046                            CsrMemCpyDes(primitive->scanResults[i1].deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.primDeviceType.deviceDetails, buffer, &offset, ((u16) (8)));
5047                            CsrUint8Des((u8 *) &primitive->scanResults[i1].deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.secondaryDeviceTypeCount, buffer, &offset);
5048                            primitive->scanResults[i1].deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.secDeviceType = NULL;
5049                            if (primitive->scanResults[i1].deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.secondaryDeviceTypeCount)
5050                            {
5051                                primitive->scanResults[i1].deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.secDeviceType = kmalloc(sizeof(CsrWifiSmeWpsDeviceType) * primitive->scanResults[i1].deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.secondaryDeviceTypeCount, GFP_KERNEL);
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)));
5061                            CsrUint8Des((u8 *) &primitive->scanResults[i1].deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.deviceNameLength, buffer, &offset);
5062                        }
5063                    }
5064                    break;
5065                case CSR_WIFI_SME_P2P_ROLE_NONE:
5066                    CsrUint8Des((u8 *) &primitive->scanResults[i1].deviceInfo.reservedNone.empty, buffer, &offset);
5067                    break;
5068                case CSR_WIFI_SME_P2P_ROLE_STANDALONE:
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);
5074                    primitive->scanResults[i1].deviceInfo.standalonedevInfo.secDeviceType = NULL;
5075                    if (primitive->scanResults[i1].deviceInfo.standalonedevInfo.secondaryDeviceTypeCount)
5076                    {
5077                        primitive->scanResults[i1].deviceInfo.standalonedevInfo.secDeviceType = kmalloc(sizeof(CsrWifiSmeWpsDeviceType) * primitive->scanResults[i1].deviceInfo.standalonedevInfo.secondaryDeviceTypeCount, GFP_KERNEL);
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
5099void 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            {
5109                case CSR_WIFI_SME_P2P_ROLE_GO:
5110                {
5111                    u16 i4;
5112                    for (i4 = 0; i4 < primitive->scanResults[i1].deviceInfo.groupInfo.p2pClientInfoCount; i4++)
5113                    {
5114                        kfree(primitive->scanResults[i1].deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.secDeviceType);
5115                    }
5116                }
5117                    kfree(primitive->scanResults[i1].deviceInfo.groupInfo.p2PClientInfo);
5118                    break;
5119                case CSR_WIFI_SME_P2P_ROLE_STANDALONE:
5120                    kfree(primitive->scanResults[i1].deviceInfo.standalonedevInfo.secDeviceType);
5121                    break;
5122                default:
5123                    break;
5124            }
5125        }
5126    }
5127    kfree(primitive->scanResults);
5128    kfree(primitive);
5129}
5130
5131
5132size_t CsrWifiSmeSmeStaConfigGetCfmSizeof(void *msg)
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
5149u8* CsrWifiSmeSmeStaConfigGetCfmSer(u8 *ptr, size_t *len, void *msg)
5150{
5151    CsrWifiSmeSmeStaConfigGetCfm *primitive = (CsrWifiSmeSmeStaConfigGetCfm *)msg;
5152    *len = 0;
5153    CsrUint16Ser(ptr, len, primitive->common.type);
5154    CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag);
5155    CsrUint16Ser(ptr, len, (u16) primitive->status);
5156    CsrUint8Ser(ptr, len, (u8) primitive->smeConfig.connectionQualityRssiChangeTrigger);
5157    CsrUint8Ser(ptr, len, (u8) primitive->smeConfig.connectionQualitySnrChangeTrigger);
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
5166void* CsrWifiSmeSmeStaConfigGetCfmDes(u8 *buffer, size_t length)
5167{
5168    CsrWifiSmeSmeStaConfigGetCfm *primitive = kmalloc(sizeof(CsrWifiSmeSmeStaConfigGetCfm), GFP_KERNEL);
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
5186size_t CsrWifiSmeSmeStaConfigSetCfmSizeof(void *msg)
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
5197u8* CsrWifiSmeSmeStaConfigSetCfmSer(u8 *ptr, size_t *len, void *msg)
5198{
5199    CsrWifiSmeSmeStaConfigSetCfm *primitive = (CsrWifiSmeSmeStaConfigSetCfm *)msg;
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
5208void* CsrWifiSmeSmeStaConfigSetCfmDes(u8 *buffer, size_t length)
5209{
5210    CsrWifiSmeSmeStaConfigSetCfm *primitive = kmalloc(sizeof(CsrWifiSmeSmeStaConfigSetCfm), GFP_KERNEL);
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
5222size_t CsrWifiSmeStationMacAddressGetCfmSizeof(void *msg)
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
5239u8* CsrWifiSmeStationMacAddressGetCfmSer(u8 *ptr, size_t *len, void *msg)
5240{
5241    CsrWifiSmeStationMacAddressGetCfm *primitive = (CsrWifiSmeStationMacAddressGetCfm *)msg;
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
5256void* CsrWifiSmeStationMacAddressGetCfmDes(u8 *buffer, size_t length)
5257{
5258    CsrWifiSmeStationMacAddressGetCfm *primitive = kmalloc(sizeof(CsrWifiSmeStationMacAddressGetCfm), GFP_KERNEL);
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
5276size_t CsrWifiSmeTspecIndSizeof(void *msg)
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
5291u8* 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
5308void* CsrWifiSmeTspecIndDes(u8 *buffer, size_t length)
5309{
5310    CsrWifiSmeTspecInd *primitive = kmalloc(sizeof(CsrWifiSmeTspecInd), GFP_KERNEL);
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);