]> git.kernelconcepts.de Git - karo-tx-linux.git/blob - drivers/staging/csr/csr_wifi_sme_lib.h
5b1b8638d8ce444497f88646a7c074de7eba0b4f
[karo-tx-linux.git] / drivers / staging / csr / csr_wifi_sme_lib.h
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
13 #ifndef CSR_WIFI_SME_LIB_H__
14 #define CSR_WIFI_SME_LIB_H__
15
16 #include "csr_pmem.h"
17 #include "csr_sched.h"
18 #include "csr_util.h"
19 #include "csr_msg_transport.h"
20
21 #include "csr_wifi_lib.h"
22
23 #include "csr_wifi_sme_prim.h"
24 #include "csr_wifi_sme_task.h"
25
26
27 #ifndef CSR_WIFI_SME_LIB_DESTINATION_QUEUE
28 # ifdef CSR_WIFI_NME_ENABLE
29 # include "csr_wifi_nme_task.h"
30 # define CSR_WIFI_SME_LIB_DESTINATION_QUEUE CSR_WIFI_NME_IFACEQUEUE
31 # else
32 # define CSR_WIFI_SME_LIB_DESTINATION_QUEUE CSR_WIFI_SME_IFACEQUEUE
33 # endif
34 #endif
35
36
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40
41 /*----------------------------------------------------------------------------*
42  *  CsrWifiSmeFreeUpstreamMessageContents
43  *
44  *  DESCRIPTION
45  *      Free the allocated memory in a CSR_WIFI_SME upstream message. Does not
46  *      free the message itself, and can only be used for upstream messages.
47  *
48  *  PARAMETERS
49  *      Deallocates the resources in a CSR_WIFI_SME upstream message
50  *----------------------------------------------------------------------------*/
51 void CsrWifiSmeFreeUpstreamMessageContents(u16 eventClass, void *message);
52
53 /*----------------------------------------------------------------------------*
54  *  CsrWifiSmeFreeDownstreamMessageContents
55  *
56  *  DESCRIPTION
57  *      Free the allocated memory in a CSR_WIFI_SME downstream message. Does not
58  *      free the message itself, and can only be used for downstream messages.
59  *
60  *  PARAMETERS
61  *      Deallocates the resources in a CSR_WIFI_SME downstream message
62  *----------------------------------------------------------------------------*/
63 void CsrWifiSmeFreeDownstreamMessageContents(u16 eventClass, void *message);
64
65 /*----------------------------------------------------------------------------*
66  * Enum to string functions
67  *----------------------------------------------------------------------------*/
68 const char* CsrWifiSme80211NetworkTypeToString(CsrWifiSme80211NetworkType value);
69 const char* CsrWifiSme80211PrivacyModeToString(CsrWifiSme80211PrivacyMode value);
70 const char* CsrWifiSme80211dTrustLevelToString(CsrWifiSme80211dTrustLevel value);
71 const char* CsrWifiSmeAmpStatusToString(CsrWifiSmeAmpStatus value);
72 const char* CsrWifiSmeAuthModeToString(CsrWifiSmeAuthMode value);
73 const char* CsrWifiSmeBasicUsabilityToString(CsrWifiSmeBasicUsability value);
74 const char* CsrWifiSmeBssTypeToString(CsrWifiSmeBssType value);
75 const char* CsrWifiSmeCoexSchemeToString(CsrWifiSmeCoexScheme value);
76 const char* CsrWifiSmeControlIndicationToString(CsrWifiSmeControlIndication value);
77 const char* CsrWifiSmeCtsProtectionTypeToString(CsrWifiSmeCtsProtectionType value);
78 const char* CsrWifiSmeD3AutoScanModeToString(CsrWifiSmeD3AutoScanMode value);
79 const char* CsrWifiSmeEncryptionToString(CsrWifiSmeEncryption value);
80 const char* CsrWifiSmeFirmwareDriverInterfaceToString(CsrWifiSmeFirmwareDriverInterface value);
81 const char* CsrWifiSmeHostPowerModeToString(CsrWifiSmeHostPowerMode value);
82 const char* CsrWifiSmeIEEE80211ReasonToString(CsrWifiSmeIEEE80211Reason value);
83 const char* CsrWifiSmeIEEE80211ResultToString(CsrWifiSmeIEEE80211Result value);
84 const char* CsrWifiSmeIndicationsToString(CsrWifiSmeIndications value);
85 const char* CsrWifiSmeKeyTypeToString(CsrWifiSmeKeyType value);
86 const char* CsrWifiSmeListActionToString(CsrWifiSmeListAction value);
87 const char* CsrWifiSmeMediaStatusToString(CsrWifiSmeMediaStatus value);
88 const char* CsrWifiSmeP2pCapabilityToString(CsrWifiSmeP2pCapability value);
89 const char* CsrWifiSmeP2pGroupCapabilityToString(CsrWifiSmeP2pGroupCapability value);
90 const char* CsrWifiSmeP2pNoaConfigMethodToString(CsrWifiSmeP2pNoaConfigMethod value);
91 const char* CsrWifiSmeP2pRoleToString(CsrWifiSmeP2pRole value);
92 const char* CsrWifiSmeP2pStatusToString(CsrWifiSmeP2pStatus value);
93 const char* CsrWifiSmePacketFilterModeToString(CsrWifiSmePacketFilterMode value);
94 const char* CsrWifiSmePowerSaveLevelToString(CsrWifiSmePowerSaveLevel value);
95 const char* CsrWifiSmePreambleTypeToString(CsrWifiSmePreambleType value);
96 const char* CsrWifiSmeRadioIFToString(CsrWifiSmeRadioIF value);
97 const char* CsrWifiSmeRegulatoryDomainToString(CsrWifiSmeRegulatoryDomain value);
98 const char* CsrWifiSmeRoamReasonToString(CsrWifiSmeRoamReason value);
99 const char* CsrWifiSmeScanTypeToString(CsrWifiSmeScanType value);
100 const char* CsrWifiSmeTrafficTypeToString(CsrWifiSmeTrafficType value);
101 const char* CsrWifiSmeTspecCtrlToString(CsrWifiSmeTspecCtrl value);
102 const char* CsrWifiSmeTspecResultCodeToString(CsrWifiSmeTspecResultCode value);
103 const char* CsrWifiSmeWepAuthModeToString(CsrWifiSmeWepAuthMode value);
104 const char* CsrWifiSmeWepCredentialTypeToString(CsrWifiSmeWepCredentialType value);
105 const char* CsrWifiSmeWmmModeToString(CsrWifiSmeWmmMode value);
106 const char* CsrWifiSmeWmmQosInfoToString(CsrWifiSmeWmmQosInfo value);
107 const char* CsrWifiSmeWpsConfigTypeToString(CsrWifiSmeWpsConfigType value);
108 const char* CsrWifiSmeWpsDeviceCategoryToString(CsrWifiSmeWpsDeviceCategory value);
109 const char* CsrWifiSmeWpsDeviceSubCategoryToString(CsrWifiSmeWpsDeviceSubCategory value);
110 const char* CsrWifiSmeWpsDpidToString(CsrWifiSmeWpsDpid value);
111 const char* CsrWifiSmeWpsRegistrationToString(CsrWifiSmeWpsRegistration value);
112
113
114 /*----------------------------------------------------------------------------*
115  * CsrPrim Type toString function.
116  * Converts a message type to the String name of the Message
117  *----------------------------------------------------------------------------*/
118 const char* CsrWifiSmePrimTypeToString(CsrPrim msgType);
119
120 /*----------------------------------------------------------------------------*
121  * Lookup arrays for PrimType name Strings
122  *----------------------------------------------------------------------------*/
123 extern const char *CsrWifiSmeUpstreamPrimNames[CSR_WIFI_SME_PRIM_UPSTREAM_COUNT];
124 extern const char *CsrWifiSmeDownstreamPrimNames[CSR_WIFI_SME_PRIM_DOWNSTREAM_COUNT];
125
126 /*******************************************************************************
127
128   NAME
129     CsrWifiSmeActivateReqSend
130
131   DESCRIPTION
132     The WMA sends this primitive to activate the SME.
133     The WMA must activate the SME before it can send any other primitive.
134
135   PARAMETERS
136     queue  - Message Source Task Queue (Cfm's will be sent to this Queue)
137
138 *******************************************************************************/
139 #define CsrWifiSmeActivateReqCreate(msg__, dst__, src__) \
140     msg__ = (CsrWifiSmeActivateReq *) CsrPmemAlloc(sizeof(CsrWifiSmeActivateReq)); \
141     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_ACTIVATE_REQ, dst__, src__);
142
143 #define CsrWifiSmeActivateReqSendTo(dst__, src__) \
144     { \
145         CsrWifiSmeActivateReq *msg__; \
146         CsrWifiSmeActivateReqCreate(msg__, dst__, src__); \
147         CsrMsgTransport(dst__, CSR_WIFI_SME_PRIM, msg__); \
148     }
149
150 #define CsrWifiSmeActivateReqSend(src__) \
151     CsrWifiSmeActivateReqSendTo(CSR_WIFI_SME_LIB_DESTINATION_QUEUE, src__)
152
153 /*******************************************************************************
154
155   NAME
156     CsrWifiSmeActivateCfmSend
157
158   DESCRIPTION
159     The SME sends this primitive when the activation is complete.
160
161   PARAMETERS
162     queue  - Destination Task Queue
163     status - Reports the result of the request
164
165 *******************************************************************************/
166 #define CsrWifiSmeActivateCfmCreate(msg__, dst__, src__, status__) \
167     msg__ = (CsrWifiSmeActivateCfm *) CsrPmemAlloc(sizeof(CsrWifiSmeActivateCfm)); \
168     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_ACTIVATE_CFM, dst__, src__); \
169     msg__->status = (status__);
170
171 #define CsrWifiSmeActivateCfmSendTo(dst__, src__, status__) \
172     { \
173         CsrWifiSmeActivateCfm *msg__; \
174         CsrWifiSmeActivateCfmCreate(msg__, dst__, src__, status__); \
175         CsrSchedMessagePut(dst__, CSR_WIFI_SME_PRIM, msg__); \
176     }
177
178 #define CsrWifiSmeActivateCfmSend(dst__, status__) \
179     CsrWifiSmeActivateCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, status__)
180
181 /*******************************************************************************
182
183   NAME
184     CsrWifiSmeAdhocConfigGetReqSend
185
186   DESCRIPTION
187     This primitive gets the value of the adHocConfig parameter.
188
189   PARAMETERS
190     queue  - Message Source Task Queue (Cfm's will be sent to this Queue)
191
192 *******************************************************************************/
193 #define CsrWifiSmeAdhocConfigGetReqCreate(msg__, dst__, src__) \
194     msg__ = (CsrWifiSmeAdhocConfigGetReq *) CsrPmemAlloc(sizeof(CsrWifiSmeAdhocConfigGetReq)); \
195     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_ADHOC_CONFIG_GET_REQ, dst__, src__);
196
197 #define CsrWifiSmeAdhocConfigGetReqSendTo(dst__, src__) \
198     { \
199         CsrWifiSmeAdhocConfigGetReq *msg__; \
200         CsrWifiSmeAdhocConfigGetReqCreate(msg__, dst__, src__); \
201         CsrMsgTransport(dst__, CSR_WIFI_SME_PRIM, msg__); \
202     }
203
204 #define CsrWifiSmeAdhocConfigGetReqSend(src__) \
205     CsrWifiSmeAdhocConfigGetReqSendTo(CSR_WIFI_SME_LIB_DESTINATION_QUEUE, src__)
206
207 /*******************************************************************************
208
209   NAME
210     CsrWifiSmeAdhocConfigGetCfmSend
211
212   DESCRIPTION
213     This primitive reports the result of the request.
214
215   PARAMETERS
216     queue       - Destination Task Queue
217     status      - Reports the result of the request
218     adHocConfig - Contains the values used when starting an Ad-hoc (IBSS)
219                   connection.
220
221 *******************************************************************************/
222 #define CsrWifiSmeAdhocConfigGetCfmCreate(msg__, dst__, src__, status__, adHocConfig__) \
223     msg__ = (CsrWifiSmeAdhocConfigGetCfm *) CsrPmemAlloc(sizeof(CsrWifiSmeAdhocConfigGetCfm)); \
224     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_ADHOC_CONFIG_GET_CFM, dst__, src__); \
225     msg__->status = (status__); \
226     msg__->adHocConfig = (adHocConfig__);
227
228 #define CsrWifiSmeAdhocConfigGetCfmSendTo(dst__, src__, status__, adHocConfig__) \
229     { \
230         CsrWifiSmeAdhocConfigGetCfm *msg__; \
231         CsrWifiSmeAdhocConfigGetCfmCreate(msg__, dst__, src__, status__, adHocConfig__); \
232         CsrSchedMessagePut(dst__, CSR_WIFI_SME_PRIM, msg__); \
233     }
234
235 #define CsrWifiSmeAdhocConfigGetCfmSend(dst__, status__, adHocConfig__) \
236     CsrWifiSmeAdhocConfigGetCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, status__, adHocConfig__)
237
238 /*******************************************************************************
239
240   NAME
241     CsrWifiSmeAdhocConfigSetReqSend
242
243   DESCRIPTION
244     This primitive sets the value of the adHocConfig parameter.
245
246   PARAMETERS
247     queue       - Message Source Task Queue (Cfm's will be sent to this Queue)
248     adHocConfig - Sets the values to use when starting an ad hoc network.
249
250 *******************************************************************************/
251 #define CsrWifiSmeAdhocConfigSetReqCreate(msg__, dst__, src__, adHocConfig__) \
252     msg__ = (CsrWifiSmeAdhocConfigSetReq *) CsrPmemAlloc(sizeof(CsrWifiSmeAdhocConfigSetReq)); \
253     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_ADHOC_CONFIG_SET_REQ, dst__, src__); \
254     msg__->adHocConfig = (adHocConfig__);
255
256 #define CsrWifiSmeAdhocConfigSetReqSendTo(dst__, src__, adHocConfig__) \
257     { \
258         CsrWifiSmeAdhocConfigSetReq *msg__; \
259         CsrWifiSmeAdhocConfigSetReqCreate(msg__, dst__, src__, adHocConfig__); \
260         CsrMsgTransport(dst__, CSR_WIFI_SME_PRIM, msg__); \
261     }
262
263 #define CsrWifiSmeAdhocConfigSetReqSend(src__, adHocConfig__) \
264     CsrWifiSmeAdhocConfigSetReqSendTo(CSR_WIFI_SME_LIB_DESTINATION_QUEUE, src__, adHocConfig__)
265
266 /*******************************************************************************
267
268   NAME
269     CsrWifiSmeAdhocConfigSetCfmSend
270
271   DESCRIPTION
272     This primitive reports the result of the request.
273
274   PARAMETERS
275     queue  - Destination Task Queue
276     status - Reports the result of the request
277
278 *******************************************************************************/
279 #define CsrWifiSmeAdhocConfigSetCfmCreate(msg__, dst__, src__, status__) \
280     msg__ = (CsrWifiSmeAdhocConfigSetCfm *) CsrPmemAlloc(sizeof(CsrWifiSmeAdhocConfigSetCfm)); \
281     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_ADHOC_CONFIG_SET_CFM, dst__, src__); \
282     msg__->status = (status__);
283
284 #define CsrWifiSmeAdhocConfigSetCfmSendTo(dst__, src__, status__) \
285     { \
286         CsrWifiSmeAdhocConfigSetCfm *msg__; \
287         CsrWifiSmeAdhocConfigSetCfmCreate(msg__, dst__, src__, status__); \
288         CsrSchedMessagePut(dst__, CSR_WIFI_SME_PRIM, msg__); \
289     }
290
291 #define CsrWifiSmeAdhocConfigSetCfmSend(dst__, status__) \
292     CsrWifiSmeAdhocConfigSetCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, status__)
293
294 /*******************************************************************************
295
296   NAME
297     CsrWifiSmeAmpStatusChangeIndSend
298
299   DESCRIPTION
300     Indication of change to AMP activity.
301
302   PARAMETERS
303     queue        - Destination Task Queue
304     interfaceTag - Interface on which the AMP activity changed.
305     ampStatus    - The new status of AMP activity.Range: {AMP_ACTIVE,
306                    AMP_INACTIVE}.
307
308 *******************************************************************************/
309 #define CsrWifiSmeAmpStatusChangeIndCreate(msg__, dst__, src__, interfaceTag__, ampStatus__) \
310     msg__ = (CsrWifiSmeAmpStatusChangeInd *) CsrPmemAlloc(sizeof(CsrWifiSmeAmpStatusChangeInd)); \
311     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_AMP_STATUS_CHANGE_IND, dst__, src__); \
312     msg__->interfaceTag = (interfaceTag__); \
313     msg__->ampStatus = (ampStatus__);
314
315 #define CsrWifiSmeAmpStatusChangeIndSendTo(dst__, src__, interfaceTag__, ampStatus__) \
316     { \
317         CsrWifiSmeAmpStatusChangeInd *msg__; \
318         CsrWifiSmeAmpStatusChangeIndCreate(msg__, dst__, src__, interfaceTag__, ampStatus__); \
319         CsrSchedMessagePut(dst__, CSR_WIFI_SME_PRIM, msg__); \
320     }
321
322 #define CsrWifiSmeAmpStatusChangeIndSend(dst__, interfaceTag__, ampStatus__) \
323     CsrWifiSmeAmpStatusChangeIndSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, interfaceTag__, ampStatus__)
324
325 /*******************************************************************************
326
327   NAME
328     CsrWifiSmeAssociationCompleteIndSend
329
330   DESCRIPTION
331     The SME will send this primitive to all the tasks that have registered to
332     receive it whenever it completes an attempt to associate with an AP. If
333     the association was successful, status will be set to
334     CSR_WIFI_SME_STATUS_SUCCESS, otherwise status and deauthReason shall be
335     set to appropriate error codes.
336
337   PARAMETERS
338     queue          - Destination Task Queue
339     interfaceTag   - Interface Identifier; unique identifier of an interface
340     status         - Reports the result of the association procedure
341     connectionInfo - This parameter is relevant only if result is
342                      CSR_WIFI_SME_STATUS_SUCCESS:
343                      it points to the connection information for the new network
344     deauthReason   - This parameter is relevant only if result is not
345                      CSR_WIFI_SME_STATUS_SUCCESS:
346                      if the AP deauthorised the station, it gives the reason of
347                      the deauthorization
348
349 *******************************************************************************/
350 #define CsrWifiSmeAssociationCompleteIndCreate(msg__, dst__, src__, interfaceTag__, status__, connectionInfo__, deauthReason__) \
351     msg__ = (CsrWifiSmeAssociationCompleteInd *) CsrPmemAlloc(sizeof(CsrWifiSmeAssociationCompleteInd)); \
352     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_ASSOCIATION_COMPLETE_IND, dst__, src__); \
353     msg__->interfaceTag = (interfaceTag__); \
354     msg__->status = (status__); \
355     msg__->connectionInfo = (connectionInfo__); \
356     msg__->deauthReason = (deauthReason__);
357
358 #define CsrWifiSmeAssociationCompleteIndSendTo(dst__, src__, interfaceTag__, status__, connectionInfo__, deauthReason__) \
359     { \
360         CsrWifiSmeAssociationCompleteInd *msg__; \
361         CsrWifiSmeAssociationCompleteIndCreate(msg__, dst__, src__, interfaceTag__, status__, connectionInfo__, deauthReason__); \
362         CsrSchedMessagePut(dst__, CSR_WIFI_SME_PRIM, msg__); \
363     }
364
365 #define CsrWifiSmeAssociationCompleteIndSend(dst__, interfaceTag__, status__, connectionInfo__, deauthReason__) \
366     CsrWifiSmeAssociationCompleteIndSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, interfaceTag__, status__, connectionInfo__, deauthReason__)
367
368 /*******************************************************************************
369
370   NAME
371     CsrWifiSmeAssociationStartIndSend
372
373   DESCRIPTION
374     The SME will send this primitive to all the tasks that have registered to
375     receive it whenever it begins an attempt to associate with an AP.
376
377   PARAMETERS
378     queue        - Destination Task Queue
379     interfaceTag - Interface Identifier; unique identifier of an interface
380     address      - BSSID of the associating network
381     ssid         - Service Set identifier of the associating network
382
383 *******************************************************************************/
384 #define CsrWifiSmeAssociationStartIndCreate(msg__, dst__, src__, interfaceTag__, address__, ssid__) \
385     msg__ = (CsrWifiSmeAssociationStartInd *) CsrPmemAlloc(sizeof(CsrWifiSmeAssociationStartInd)); \
386     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_ASSOCIATION_START_IND, dst__, src__); \
387     msg__->interfaceTag = (interfaceTag__); \
388     msg__->address = (address__); \
389     msg__->ssid = (ssid__);
390
391 #define CsrWifiSmeAssociationStartIndSendTo(dst__, src__, interfaceTag__, address__, ssid__) \
392     { \
393         CsrWifiSmeAssociationStartInd *msg__; \
394         CsrWifiSmeAssociationStartIndCreate(msg__, dst__, src__, interfaceTag__, address__, ssid__); \
395         CsrSchedMessagePut(dst__, CSR_WIFI_SME_PRIM, msg__); \
396     }
397
398 #define CsrWifiSmeAssociationStartIndSend(dst__, interfaceTag__, address__, ssid__) \
399     CsrWifiSmeAssociationStartIndSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, interfaceTag__, address__, ssid__)
400
401 /*******************************************************************************
402
403   NAME
404     CsrWifiSmeBlacklistReqSend
405
406   DESCRIPTION
407     The wireless manager application should call this primitive to notify the
408     driver of any networks that should not be connected to. The interface
409     allows the wireless manager application to query, add, remove, and flush
410     the BSSIDs that the driver may not connect or roam to.
411     When this primitive adds to the black list the BSSID to which the SME is
412     currently connected, the SME will try to roam, if applicable, to another
413     BSSID in the same ESS; if the roaming procedure fails, the SME will
414     disconnect.
415
416   PARAMETERS
417     queue           - Message Source Task Queue (Cfm's will be sent to this Queue)
418     interfaceTag    - Interface Identifier; unique identifier of an interface
419     action          - The value of the CsrWifiSmeListAction parameter instructs
420                       the driver to modify or provide the list of blacklisted
421                       networks.
422     setAddressCount - Number of BSSIDs sent with this primitive
423     setAddresses    - Pointer to the list of BBSIDs sent with the primitive, set
424                       to NULL if none is sent.
425
426 *******************************************************************************/
427 #define CsrWifiSmeBlacklistReqCreate(msg__, dst__, src__, interfaceTag__, action__, setAddressCount__, setAddresses__) \
428     msg__ = (CsrWifiSmeBlacklistReq *) CsrPmemAlloc(sizeof(CsrWifiSmeBlacklistReq)); \
429     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_BLACKLIST_REQ, dst__, src__); \
430     msg__->interfaceTag = (interfaceTag__); \
431     msg__->action = (action__); \
432     msg__->setAddressCount = (setAddressCount__); \
433     msg__->setAddresses = (setAddresses__);
434
435 #define CsrWifiSmeBlacklistReqSendTo(dst__, src__, interfaceTag__, action__, setAddressCount__, setAddresses__) \
436     { \
437         CsrWifiSmeBlacklistReq *msg__; \
438         CsrWifiSmeBlacklistReqCreate(msg__, dst__, src__, interfaceTag__, action__, setAddressCount__, setAddresses__); \
439         CsrMsgTransport(dst__, CSR_WIFI_SME_PRIM, msg__); \
440     }
441
442 #define CsrWifiSmeBlacklistReqSend(src__, interfaceTag__, action__, setAddressCount__, setAddresses__) \
443     CsrWifiSmeBlacklistReqSendTo(CSR_WIFI_SME_LIB_DESTINATION_QUEUE, src__, interfaceTag__, action__, setAddressCount__, setAddresses__)
444
445 /*******************************************************************************
446
447   NAME
448     CsrWifiSmeBlacklistCfmSend
449
450   DESCRIPTION
451     The SME will call this primitive when the action on the blacklist has
452     completed. For a GET action, this primitive also reports the list of
453     BBSIDs in the blacklist.
454
455   PARAMETERS
456     queue           - Destination Task Queue
457     interfaceTag    - Interface Identifier; unique identifier of an interface
458     status          - Reports the result of the request
459     action          - Action in the request
460     getAddressCount - This parameter is only relevant if action is
461                       CSR_WIFI_SME_LIST_ACTION_GET:
462                       number of BSSIDs sent with this primitive
463     getAddresses    - Pointer to the list of BBSIDs sent with the primitive, set
464                       to NULL if none is sent.
465
466 *******************************************************************************/
467 #define CsrWifiSmeBlacklistCfmCreate(msg__, dst__, src__, interfaceTag__, status__, action__, getAddressCount__, getAddresses__) \
468     msg__ = (CsrWifiSmeBlacklistCfm *) CsrPmemAlloc(sizeof(CsrWifiSmeBlacklistCfm)); \
469     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_BLACKLIST_CFM, dst__, src__); \
470     msg__->interfaceTag = (interfaceTag__); \
471     msg__->status = (status__); \
472     msg__->action = (action__); \
473     msg__->getAddressCount = (getAddressCount__); \
474     msg__->getAddresses = (getAddresses__);
475
476 #define CsrWifiSmeBlacklistCfmSendTo(dst__, src__, interfaceTag__, status__, action__, getAddressCount__, getAddresses__) \
477     { \
478         CsrWifiSmeBlacklistCfm *msg__; \
479         CsrWifiSmeBlacklistCfmCreate(msg__, dst__, src__, interfaceTag__, status__, action__, getAddressCount__, getAddresses__); \
480         CsrSchedMessagePut(dst__, CSR_WIFI_SME_PRIM, msg__); \
481     }
482
483 #define CsrWifiSmeBlacklistCfmSend(dst__, interfaceTag__, status__, action__, getAddressCount__, getAddresses__) \
484     CsrWifiSmeBlacklistCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, interfaceTag__, status__, action__, getAddressCount__, getAddresses__)
485
486 /*******************************************************************************
487
488   NAME
489     CsrWifiSmeCalibrationDataGetReqSend
490
491   DESCRIPTION
492     This primitive retrieves the Wi-Fi radio calibration data.
493
494   PARAMETERS
495     queue  - Message Source Task Queue (Cfm's will be sent to this Queue)
496
497 *******************************************************************************/
498 #define CsrWifiSmeCalibrationDataGetReqCreate(msg__, dst__, src__) \
499     msg__ = (CsrWifiSmeCalibrationDataGetReq *) CsrPmemAlloc(sizeof(CsrWifiSmeCalibrationDataGetReq)); \
500     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_CALIBRATION_DATA_GET_REQ, dst__, src__);
501
502 #define CsrWifiSmeCalibrationDataGetReqSendTo(dst__, src__) \
503     { \
504         CsrWifiSmeCalibrationDataGetReq *msg__; \
505         CsrWifiSmeCalibrationDataGetReqCreate(msg__, dst__, src__); \
506         CsrMsgTransport(dst__, CSR_WIFI_SME_PRIM, msg__); \
507     }
508
509 #define CsrWifiSmeCalibrationDataGetReqSend(src__) \
510     CsrWifiSmeCalibrationDataGetReqSendTo(CSR_WIFI_SME_LIB_DESTINATION_QUEUE, src__)
511
512 /*******************************************************************************
513
514   NAME
515     CsrWifiSmeCalibrationDataGetCfmSend
516
517   DESCRIPTION
518     This primitive reports the result of the request.
519
520   PARAMETERS
521     queue                 - Destination Task Queue
522     status                - Reports the result of the request
523     calibrationDataLength - Number of bytes in the buffer pointed by
524                             calibrationData
525     calibrationData       - Pointer to a buffer of length calibrationDataLength
526                             containing the calibration data
527
528 *******************************************************************************/
529 #define CsrWifiSmeCalibrationDataGetCfmCreate(msg__, dst__, src__, status__, calibrationDataLength__, calibrationData__) \
530     msg__ = (CsrWifiSmeCalibrationDataGetCfm *) CsrPmemAlloc(sizeof(CsrWifiSmeCalibrationDataGetCfm)); \
531     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_CALIBRATION_DATA_GET_CFM, dst__, src__); \
532     msg__->status = (status__); \
533     msg__->calibrationDataLength = (calibrationDataLength__); \
534     msg__->calibrationData = (calibrationData__);
535
536 #define CsrWifiSmeCalibrationDataGetCfmSendTo(dst__, src__, status__, calibrationDataLength__, calibrationData__) \
537     { \
538         CsrWifiSmeCalibrationDataGetCfm *msg__; \
539         CsrWifiSmeCalibrationDataGetCfmCreate(msg__, dst__, src__, status__, calibrationDataLength__, calibrationData__); \
540         CsrSchedMessagePut(dst__, CSR_WIFI_SME_PRIM, msg__); \
541     }
542
543 #define CsrWifiSmeCalibrationDataGetCfmSend(dst__, status__, calibrationDataLength__, calibrationData__) \
544     CsrWifiSmeCalibrationDataGetCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, status__, calibrationDataLength__, calibrationData__)
545
546 /*******************************************************************************
547
548   NAME
549     CsrWifiSmeCalibrationDataSetReqSend
550
551   DESCRIPTION
552     This primitive sets the Wi-Fi radio calibration data.
553     The usage of the primitive with proper calibration data will avoid
554     time-consuming configuration after power-up.
555
556   PARAMETERS
557     queue                 - Message Source Task Queue (Cfm's will be sent to this Queue)
558     calibrationDataLength - Number of bytes in the buffer pointed by
559                             calibrationData
560     calibrationData       - Pointer to a buffer of length calibrationDataLength
561                             containing the calibration data
562
563 *******************************************************************************/
564 #define CsrWifiSmeCalibrationDataSetReqCreate(msg__, dst__, src__, calibrationDataLength__, calibrationData__) \
565     msg__ = (CsrWifiSmeCalibrationDataSetReq *) CsrPmemAlloc(sizeof(CsrWifiSmeCalibrationDataSetReq)); \
566     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_CALIBRATION_DATA_SET_REQ, dst__, src__); \
567     msg__->calibrationDataLength = (calibrationDataLength__); \
568     msg__->calibrationData = (calibrationData__);
569
570 #define CsrWifiSmeCalibrationDataSetReqSendTo(dst__, src__, calibrationDataLength__, calibrationData__) \
571     { \
572         CsrWifiSmeCalibrationDataSetReq *msg__; \
573         CsrWifiSmeCalibrationDataSetReqCreate(msg__, dst__, src__, calibrationDataLength__, calibrationData__); \
574         CsrMsgTransport(dst__, CSR_WIFI_SME_PRIM, msg__); \
575     }
576
577 #define CsrWifiSmeCalibrationDataSetReqSend(src__, calibrationDataLength__, calibrationData__) \
578     CsrWifiSmeCalibrationDataSetReqSendTo(CSR_WIFI_SME_LIB_DESTINATION_QUEUE, src__, calibrationDataLength__, calibrationData__)
579
580 /*******************************************************************************
581
582   NAME
583     CsrWifiSmeCalibrationDataSetCfmSend
584
585   DESCRIPTION
586     This primitive reports the result of the request.
587
588   PARAMETERS
589     queue  - Destination Task Queue
590     status - Reports the result of the request
591
592 *******************************************************************************/
593 #define CsrWifiSmeCalibrationDataSetCfmCreate(msg__, dst__, src__, status__) \
594     msg__ = (CsrWifiSmeCalibrationDataSetCfm *) CsrPmemAlloc(sizeof(CsrWifiSmeCalibrationDataSetCfm)); \
595     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_CALIBRATION_DATA_SET_CFM, dst__, src__); \
596     msg__->status = (status__);
597
598 #define CsrWifiSmeCalibrationDataSetCfmSendTo(dst__, src__, status__) \
599     { \
600         CsrWifiSmeCalibrationDataSetCfm *msg__; \
601         CsrWifiSmeCalibrationDataSetCfmCreate(msg__, dst__, src__, status__); \
602         CsrSchedMessagePut(dst__, CSR_WIFI_SME_PRIM, msg__); \
603     }
604
605 #define CsrWifiSmeCalibrationDataSetCfmSend(dst__, status__) \
606     CsrWifiSmeCalibrationDataSetCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, status__)
607
608 /*******************************************************************************
609
610   NAME
611     CsrWifiSmeCcxConfigGetReqSend
612
613   DESCRIPTION
614     This primitive gets the value of the CcxConfig parameter.
615     CURRENTLY NOT SUPPORTED.
616
617   PARAMETERS
618     queue        - Message Source Task Queue (Cfm's will be sent to this Queue)
619     interfaceTag - Interface Identifier; unique identifier of an interface
620
621 *******************************************************************************/
622 #define CsrWifiSmeCcxConfigGetReqCreate(msg__, dst__, src__, interfaceTag__) \
623     msg__ = (CsrWifiSmeCcxConfigGetReq *) CsrPmemAlloc(sizeof(CsrWifiSmeCcxConfigGetReq)); \
624     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_CCX_CONFIG_GET_REQ, dst__, src__); \
625     msg__->interfaceTag = (interfaceTag__);
626
627 #define CsrWifiSmeCcxConfigGetReqSendTo(dst__, src__, interfaceTag__) \
628     { \
629         CsrWifiSmeCcxConfigGetReq *msg__; \
630         CsrWifiSmeCcxConfigGetReqCreate(msg__, dst__, src__, interfaceTag__); \
631         CsrMsgTransport(dst__, CSR_WIFI_SME_PRIM, msg__); \
632     }
633
634 #define CsrWifiSmeCcxConfigGetReqSend(src__, interfaceTag__) \
635     CsrWifiSmeCcxConfigGetReqSendTo(CSR_WIFI_SME_LIB_DESTINATION_QUEUE, src__, interfaceTag__)
636
637 /*******************************************************************************
638
639   NAME
640     CsrWifiSmeCcxConfigGetCfmSend
641
642   DESCRIPTION
643     This primitive reports the result of the request.
644
645   PARAMETERS
646     queue        - Destination Task Queue
647     interfaceTag - Interface Identifier; unique identifier of an interface
648     status       - Reports the result of the request
649     ccxConfig    - Currently not supported
650
651 *******************************************************************************/
652 #define CsrWifiSmeCcxConfigGetCfmCreate(msg__, dst__, src__, interfaceTag__, status__, ccxConfig__) \
653     msg__ = (CsrWifiSmeCcxConfigGetCfm *) CsrPmemAlloc(sizeof(CsrWifiSmeCcxConfigGetCfm)); \
654     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_CCX_CONFIG_GET_CFM, dst__, src__); \
655     msg__->interfaceTag = (interfaceTag__); \
656     msg__->status = (status__); \
657     msg__->ccxConfig = (ccxConfig__);
658
659 #define CsrWifiSmeCcxConfigGetCfmSendTo(dst__, src__, interfaceTag__, status__, ccxConfig__) \
660     { \
661         CsrWifiSmeCcxConfigGetCfm *msg__; \
662         CsrWifiSmeCcxConfigGetCfmCreate(msg__, dst__, src__, interfaceTag__, status__, ccxConfig__); \
663         CsrSchedMessagePut(dst__, CSR_WIFI_SME_PRIM, msg__); \
664     }
665
666 #define CsrWifiSmeCcxConfigGetCfmSend(dst__, interfaceTag__, status__, ccxConfig__) \
667     CsrWifiSmeCcxConfigGetCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, interfaceTag__, status__, ccxConfig__)
668
669 /*******************************************************************************
670
671   NAME
672     CsrWifiSmeCcxConfigSetReqSend
673
674   DESCRIPTION
675     This primitive sets the value of the CcxConfig parameter.
676     CURRENTLY NOT SUPPORTED.
677
678   PARAMETERS
679     queue        - Message Source Task Queue (Cfm's will be sent to this Queue)
680     interfaceTag - Interface Identifier; unique identifier of an interface
681     ccxConfig    - Currently not supported
682
683 *******************************************************************************/
684 #define CsrWifiSmeCcxConfigSetReqCreate(msg__, dst__, src__, interfaceTag__, ccxConfig__) \
685     msg__ = (CsrWifiSmeCcxConfigSetReq *) CsrPmemAlloc(sizeof(CsrWifiSmeCcxConfigSetReq)); \
686     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_CCX_CONFIG_SET_REQ, dst__, src__); \
687     msg__->interfaceTag = (interfaceTag__); \
688     msg__->ccxConfig = (ccxConfig__);
689
690 #define CsrWifiSmeCcxConfigSetReqSendTo(dst__, src__, interfaceTag__, ccxConfig__) \
691     { \
692         CsrWifiSmeCcxConfigSetReq *msg__; \
693         CsrWifiSmeCcxConfigSetReqCreate(msg__, dst__, src__, interfaceTag__, ccxConfig__); \
694         CsrMsgTransport(dst__, CSR_WIFI_SME_PRIM, msg__); \
695     }
696
697 #define CsrWifiSmeCcxConfigSetReqSend(src__, interfaceTag__, ccxConfig__) \
698     CsrWifiSmeCcxConfigSetReqSendTo(CSR_WIFI_SME_LIB_DESTINATION_QUEUE, src__, interfaceTag__, ccxConfig__)
699
700 /*******************************************************************************
701
702   NAME
703     CsrWifiSmeCcxConfigSetCfmSend
704
705   DESCRIPTION
706     This primitive reports the result of the request.
707
708   PARAMETERS
709     queue        - Destination Task Queue
710     interfaceTag - Interface Identifier; unique identifier of an interface
711     status       - Reports the result of the request
712
713 *******************************************************************************/
714 #define CsrWifiSmeCcxConfigSetCfmCreate(msg__, dst__, src__, interfaceTag__, status__) \
715     msg__ = (CsrWifiSmeCcxConfigSetCfm *) CsrPmemAlloc(sizeof(CsrWifiSmeCcxConfigSetCfm)); \
716     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_CCX_CONFIG_SET_CFM, dst__, src__); \
717     msg__->interfaceTag = (interfaceTag__); \
718     msg__->status = (status__);
719
720 #define CsrWifiSmeCcxConfigSetCfmSendTo(dst__, src__, interfaceTag__, status__) \
721     { \
722         CsrWifiSmeCcxConfigSetCfm *msg__; \
723         CsrWifiSmeCcxConfigSetCfmCreate(msg__, dst__, src__, interfaceTag__, status__); \
724         CsrSchedMessagePut(dst__, CSR_WIFI_SME_PRIM, msg__); \
725     }
726
727 #define CsrWifiSmeCcxConfigSetCfmSend(dst__, interfaceTag__, status__) \
728     CsrWifiSmeCcxConfigSetCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, interfaceTag__, status__)
729
730 /*******************************************************************************
731
732   NAME
733     CsrWifiSmeCloakedSsidsGetReqSend
734
735   DESCRIPTION
736     This primitive gets the value of the CloakedSsids parameter.
737
738   PARAMETERS
739     queue  - Message Source Task Queue (Cfm's will be sent to this Queue)
740
741 *******************************************************************************/
742 #define CsrWifiSmeCloakedSsidsGetReqCreate(msg__, dst__, src__) \
743     msg__ = (CsrWifiSmeCloakedSsidsGetReq *) CsrPmemAlloc(sizeof(CsrWifiSmeCloakedSsidsGetReq)); \
744     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_CLOAKED_SSIDS_GET_REQ, dst__, src__);
745
746 #define CsrWifiSmeCloakedSsidsGetReqSendTo(dst__, src__) \
747     { \
748         CsrWifiSmeCloakedSsidsGetReq *msg__; \
749         CsrWifiSmeCloakedSsidsGetReqCreate(msg__, dst__, src__); \
750         CsrMsgTransport(dst__, CSR_WIFI_SME_PRIM, msg__); \
751     }
752
753 #define CsrWifiSmeCloakedSsidsGetReqSend(src__) \
754     CsrWifiSmeCloakedSsidsGetReqSendTo(CSR_WIFI_SME_LIB_DESTINATION_QUEUE, src__)
755
756 /*******************************************************************************
757
758   NAME
759     CsrWifiSmeCloakedSsidsGetCfmSend
760
761   DESCRIPTION
762     This primitive reports the result of the request.
763
764   PARAMETERS
765     queue        - Destination Task Queue
766     status       - Reports the result of the request
767     cloakedSsids - Reports list of cloaked SSIDs that are explicitly scanned for
768                    by the driver
769
770 *******************************************************************************/
771 #define CsrWifiSmeCloakedSsidsGetCfmCreate(msg__, dst__, src__, status__, cloakedSsids__) \
772     msg__ = (CsrWifiSmeCloakedSsidsGetCfm *) CsrPmemAlloc(sizeof(CsrWifiSmeCloakedSsidsGetCfm)); \
773     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_CLOAKED_SSIDS_GET_CFM, dst__, src__); \
774     msg__->status = (status__); \
775     msg__->cloakedSsids = (cloakedSsids__);
776
777 #define CsrWifiSmeCloakedSsidsGetCfmSendTo(dst__, src__, status__, cloakedSsids__) \
778     { \
779         CsrWifiSmeCloakedSsidsGetCfm *msg__; \
780         CsrWifiSmeCloakedSsidsGetCfmCreate(msg__, dst__, src__, status__, cloakedSsids__); \
781         CsrSchedMessagePut(dst__, CSR_WIFI_SME_PRIM, msg__); \
782     }
783
784 #define CsrWifiSmeCloakedSsidsGetCfmSend(dst__, status__, cloakedSsids__) \
785     CsrWifiSmeCloakedSsidsGetCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, status__, cloakedSsids__)
786
787 /*******************************************************************************
788
789   NAME
790     CsrWifiSmeCloakedSsidsSetReqSend
791
792   DESCRIPTION
793     This primitive sets the list of cloaked SSIDs for which the WMA possesses
794     profiles.
795     When the driver detects a cloaked AP, the SME will explicitly scan for it
796     using the list of cloaked SSIDs provided it, and, if the scan succeeds,
797     it will report the AP to the WMA either via CSR_WIFI_SME_SCAN_RESULT_IND
798     (if registered) or via CSR_WIFI_SCAN_RESULT_GET_CFM.
799
800   PARAMETERS
801     queue        - Message Source Task Queue (Cfm's will be sent to this Queue)
802     cloakedSsids - Sets the list of cloaked SSIDs
803
804 *******************************************************************************/
805 #define CsrWifiSmeCloakedSsidsSetReqCreate(msg__, dst__, src__, cloakedSsids__) \
806     msg__ = (CsrWifiSmeCloakedSsidsSetReq *) CsrPmemAlloc(sizeof(CsrWifiSmeCloakedSsidsSetReq)); \
807     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_CLOAKED_SSIDS_SET_REQ, dst__, src__); \
808     msg__->cloakedSsids = (cloakedSsids__);
809
810 #define CsrWifiSmeCloakedSsidsSetReqSendTo(dst__, src__, cloakedSsids__) \
811     { \
812         CsrWifiSmeCloakedSsidsSetReq *msg__; \
813         CsrWifiSmeCloakedSsidsSetReqCreate(msg__, dst__, src__, cloakedSsids__); \
814         CsrMsgTransport(dst__, CSR_WIFI_SME_PRIM, msg__); \
815     }
816
817 #define CsrWifiSmeCloakedSsidsSetReqSend(src__, cloakedSsids__) \
818     CsrWifiSmeCloakedSsidsSetReqSendTo(CSR_WIFI_SME_LIB_DESTINATION_QUEUE, src__, cloakedSsids__)
819
820 /*******************************************************************************
821
822   NAME
823     CsrWifiSmeCloakedSsidsSetCfmSend
824
825   DESCRIPTION
826     This primitive reports the result of the request.
827
828   PARAMETERS
829     queue  - Destination Task Queue
830     status - Reports the result of the request
831
832 *******************************************************************************/
833 #define CsrWifiSmeCloakedSsidsSetCfmCreate(msg__, dst__, src__, status__) \
834     msg__ = (CsrWifiSmeCloakedSsidsSetCfm *) CsrPmemAlloc(sizeof(CsrWifiSmeCloakedSsidsSetCfm)); \
835     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_CLOAKED_SSIDS_SET_CFM, dst__, src__); \
836     msg__->status = (status__);
837
838 #define CsrWifiSmeCloakedSsidsSetCfmSendTo(dst__, src__, status__) \
839     { \
840         CsrWifiSmeCloakedSsidsSetCfm *msg__; \
841         CsrWifiSmeCloakedSsidsSetCfmCreate(msg__, dst__, src__, status__); \
842         CsrSchedMessagePut(dst__, CSR_WIFI_SME_PRIM, msg__); \
843     }
844
845 #define CsrWifiSmeCloakedSsidsSetCfmSend(dst__, status__) \
846     CsrWifiSmeCloakedSsidsSetCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, status__)
847
848 /*******************************************************************************
849
850   NAME
851     CsrWifiSmeCoexConfigGetReqSend
852
853   DESCRIPTION
854     This primitive gets the value of the CoexConfig parameter.
855
856   PARAMETERS
857     queue  - Message Source Task Queue (Cfm's will be sent to this Queue)
858
859 *******************************************************************************/
860 #define CsrWifiSmeCoexConfigGetReqCreate(msg__, dst__, src__) \
861     msg__ = (CsrWifiSmeCoexConfigGetReq *) CsrPmemAlloc(sizeof(CsrWifiSmeCoexConfigGetReq)); \
862     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_COEX_CONFIG_GET_REQ, dst__, src__);
863
864 #define CsrWifiSmeCoexConfigGetReqSendTo(dst__, src__) \
865     { \
866         CsrWifiSmeCoexConfigGetReq *msg__; \
867         CsrWifiSmeCoexConfigGetReqCreate(msg__, dst__, src__); \
868         CsrMsgTransport(dst__, CSR_WIFI_SME_PRIM, msg__); \
869     }
870
871 #define CsrWifiSmeCoexConfigGetReqSend(src__) \
872     CsrWifiSmeCoexConfigGetReqSendTo(CSR_WIFI_SME_LIB_DESTINATION_QUEUE, src__)
873
874 /*******************************************************************************
875
876   NAME
877     CsrWifiSmeCoexConfigGetCfmSend
878
879   DESCRIPTION
880     This primitive reports the result of the request.
881
882   PARAMETERS
883     queue      - Destination Task Queue
884     status     - Reports the result of the request
885     coexConfig - Reports the parameters used to configure the coexistence
886                  behaviour
887
888 *******************************************************************************/
889 #define CsrWifiSmeCoexConfigGetCfmCreate(msg__, dst__, src__, status__, coexConfig__) \
890     msg__ = (CsrWifiSmeCoexConfigGetCfm *) CsrPmemAlloc(sizeof(CsrWifiSmeCoexConfigGetCfm)); \
891     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_COEX_CONFIG_GET_CFM, dst__, src__); \
892     msg__->status = (status__); \
893     msg__->coexConfig = (coexConfig__);
894
895 #define CsrWifiSmeCoexConfigGetCfmSendTo(dst__, src__, status__, coexConfig__) \
896     { \
897         CsrWifiSmeCoexConfigGetCfm *msg__; \
898         CsrWifiSmeCoexConfigGetCfmCreate(msg__, dst__, src__, status__, coexConfig__); \
899         CsrSchedMessagePut(dst__, CSR_WIFI_SME_PRIM, msg__); \
900     }
901
902 #define CsrWifiSmeCoexConfigGetCfmSend(dst__, status__, coexConfig__) \
903     CsrWifiSmeCoexConfigGetCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, status__, coexConfig__)
904
905 /*******************************************************************************
906
907   NAME
908     CsrWifiSmeCoexConfigSetReqSend
909
910   DESCRIPTION
911     This primitive sets the value of the CoexConfig parameter.
912
913   PARAMETERS
914     queue      - Message Source Task Queue (Cfm's will be sent to this Queue)
915     coexConfig - Configures the coexistence behaviour
916
917 *******************************************************************************/
918 #define CsrWifiSmeCoexConfigSetReqCreate(msg__, dst__, src__, coexConfig__) \
919     msg__ = (CsrWifiSmeCoexConfigSetReq *) CsrPmemAlloc(sizeof(CsrWifiSmeCoexConfigSetReq)); \
920     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_COEX_CONFIG_SET_REQ, dst__, src__); \
921     msg__->coexConfig = (coexConfig__);
922
923 #define CsrWifiSmeCoexConfigSetReqSendTo(dst__, src__, coexConfig__) \
924     { \
925         CsrWifiSmeCoexConfigSetReq *msg__; \
926         CsrWifiSmeCoexConfigSetReqCreate(msg__, dst__, src__, coexConfig__); \
927         CsrMsgTransport(dst__, CSR_WIFI_SME_PRIM, msg__); \
928     }
929
930 #define CsrWifiSmeCoexConfigSetReqSend(src__, coexConfig__) \
931     CsrWifiSmeCoexConfigSetReqSendTo(CSR_WIFI_SME_LIB_DESTINATION_QUEUE, src__, coexConfig__)
932
933 /*******************************************************************************
934
935   NAME
936     CsrWifiSmeCoexConfigSetCfmSend
937
938   DESCRIPTION
939     This primitive reports the result of the request.
940
941   PARAMETERS
942     queue  - Destination Task Queue
943     status - Reports the result of the request
944
945 *******************************************************************************/
946 #define CsrWifiSmeCoexConfigSetCfmCreate(msg__, dst__, src__, status__) \
947     msg__ = (CsrWifiSmeCoexConfigSetCfm *) CsrPmemAlloc(sizeof(CsrWifiSmeCoexConfigSetCfm)); \
948     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_COEX_CONFIG_SET_CFM, dst__, src__); \
949     msg__->status = (status__);
950
951 #define CsrWifiSmeCoexConfigSetCfmSendTo(dst__, src__, status__) \
952     { \
953         CsrWifiSmeCoexConfigSetCfm *msg__; \
954         CsrWifiSmeCoexConfigSetCfmCreate(msg__, dst__, src__, status__); \
955         CsrSchedMessagePut(dst__, CSR_WIFI_SME_PRIM, msg__); \
956     }
957
958 #define CsrWifiSmeCoexConfigSetCfmSend(dst__, status__) \
959     CsrWifiSmeCoexConfigSetCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, status__)
960
961 /*******************************************************************************
962
963   NAME
964     CsrWifiSmeCoexInfoGetReqSend
965
966   DESCRIPTION
967     This primitive gets the value of the CoexInfo parameter.
968
969   PARAMETERS
970     queue  - Message Source Task Queue (Cfm's will be sent to this Queue)
971
972 *******************************************************************************/
973 #define CsrWifiSmeCoexInfoGetReqCreate(msg__, dst__, src__) \
974     msg__ = (CsrWifiSmeCoexInfoGetReq *) CsrPmemAlloc(sizeof(CsrWifiSmeCoexInfoGetReq)); \
975     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_COEX_INFO_GET_REQ, dst__, src__);
976
977 #define CsrWifiSmeCoexInfoGetReqSendTo(dst__, src__) \
978     { \
979         CsrWifiSmeCoexInfoGetReq *msg__; \
980         CsrWifiSmeCoexInfoGetReqCreate(msg__, dst__, src__); \
981         CsrMsgTransport(dst__, CSR_WIFI_SME_PRIM, msg__); \
982     }
983
984 #define CsrWifiSmeCoexInfoGetReqSend(src__) \
985     CsrWifiSmeCoexInfoGetReqSendTo(CSR_WIFI_SME_LIB_DESTINATION_QUEUE, src__)
986
987 /*******************************************************************************
988
989   NAME
990     CsrWifiSmeCoexInfoGetCfmSend
991
992   DESCRIPTION
993     This primitive reports the result of the request.
994
995   PARAMETERS
996     queue    - Destination Task Queue
997     status   - Reports the result of the request
998     coexInfo - Reports information and state related to coexistence.
999
1000 *******************************************************************************/
1001 #define CsrWifiSmeCoexInfoGetCfmCreate(msg__, dst__, src__, status__, coexInfo__) \
1002     msg__ = (CsrWifiSmeCoexInfoGetCfm *) CsrPmemAlloc(sizeof(CsrWifiSmeCoexInfoGetCfm)); \
1003     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_COEX_INFO_GET_CFM, dst__, src__); \
1004     msg__->status = (status__); \
1005     msg__->coexInfo = (coexInfo__);
1006
1007 #define CsrWifiSmeCoexInfoGetCfmSendTo(dst__, src__, status__, coexInfo__) \
1008     { \
1009         CsrWifiSmeCoexInfoGetCfm *msg__; \
1010         CsrWifiSmeCoexInfoGetCfmCreate(msg__, dst__, src__, status__, coexInfo__); \
1011         CsrSchedMessagePut(dst__, CSR_WIFI_SME_PRIM, msg__); \
1012     }
1013
1014 #define CsrWifiSmeCoexInfoGetCfmSend(dst__, status__, coexInfo__) \
1015     CsrWifiSmeCoexInfoGetCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, status__, coexInfo__)
1016
1017 /*******************************************************************************
1018
1019   NAME
1020     CsrWifiSmeConnectReqSend
1021
1022   DESCRIPTION
1023     The wireless manager application calls this primitive to start the
1024     process of joining an 802.11 wireless network or to start an ad hoc
1025     network.
1026     The structure pointed by connectionConfig contains parameters describing
1027     the network to join or, in case of an ad hoc network, to host or join.
1028     The SME will select a network, perform the IEEE 802.11 Join, Authenticate
1029     and Associate exchanges.
1030     The SME selects the networks from the current scan list that match both
1031     the SSID and BSSID, however either or both of these may be the wildcard
1032     value. Using this rule, the following operations are possible:
1033       * To connect to a network by name, specify the SSID and set the BSSID to
1034         0xFF 0xFF 0xFF 0xFF 0xFF 0xFF. If there are two or more networks visible,
1035         the SME will select the one with the strongest signal.
1036       * To connect to a specific network, specify the BSSID. The SSID is
1037         optional, but if given it must match the SSID of the network. An empty
1038         SSID may be specified by setting the SSID length to zero. Please note
1039         that if the BSSID is specified (i.e. not equal to 0xFF 0xFF 0xFF 0xFF
1040         0xFF 0xFF), the SME will not attempt to roam if signal conditions become
1041         poor, even if there is an alternative AP with an SSID that matches the
1042         current network SSID.
1043       * To connect to any network matching the other parameters (i.e. security,
1044         etc), set the SSID length to zero and set the BSSID to 0xFF 0xFF 0xFF
1045         0xFF 0xFF 0xFF. In this case, the SME will order all available networks
1046         by their signal strengths and will iterate through this list until it
1047         successfully connects.
1048     NOTE: Specifying the BSSID will restrict the selection to one specific
1049     network. If SSID and BSSID are given, they must both match the network
1050     for it to be selected. To select a network based on the SSID only, the
1051     wireless manager application must set the BSSID to 0xFF 0xFF 0xFF 0xFF
1052     0xFF 0xFF.
1053     The SME will try to connect to each network that matches the provided
1054     parameters, one by one, until it succeeds or has tried unsuccessfully
1055     with all the matching networks.
1056     If there is no network that matches the parameters and the request allows
1057     to host an ad hoc network, the SME will advertise a new ad hoc network
1058     instead.
1059     If the SME cannot connect, it will notify the failure in the confirm.
1060
1061   PARAMETERS
1062     queue            - Message Source Task Queue (Cfm's will be sent to this Queue)
1063     interfaceTag     - Interface Identifier; unique identifier of an interface
1064     connectionConfig - Describes the candidate network to join or to host.
1065
1066 *******************************************************************************/
1067 #define CsrWifiSmeConnectReqCreate(msg__, dst__, src__, interfaceTag__, connectionConfig__) \
1068     msg__ = (CsrWifiSmeConnectReq *) CsrPmemAlloc(sizeof(CsrWifiSmeConnectReq)); \
1069     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_CONNECT_REQ, dst__, src__); \
1070     msg__->interfaceTag = (interfaceTag__); \
1071     msg__->connectionConfig = (connectionConfig__);
1072
1073 #define CsrWifiSmeConnectReqSendTo(dst__, src__, interfaceTag__, connectionConfig__) \
1074     { \
1075         CsrWifiSmeConnectReq *msg__; \
1076         CsrWifiSmeConnectReqCreate(msg__, dst__, src__, interfaceTag__, connectionConfig__); \
1077         CsrMsgTransport(dst__, CSR_WIFI_SME_PRIM, msg__); \
1078     }
1079
1080 #define CsrWifiSmeConnectReqSend(src__, interfaceTag__, connectionConfig__) \
1081     CsrWifiSmeConnectReqSendTo(CSR_WIFI_SME_LIB_DESTINATION_QUEUE, src__, interfaceTag__, connectionConfig__)
1082
1083 /*******************************************************************************
1084
1085   NAME
1086     CsrWifiSmeConnectCfmSend
1087
1088   DESCRIPTION
1089     The SME calls this primitive when the connection exchange is complete or
1090     all connection attempts fail.
1091
1092   PARAMETERS
1093     queue        - Destination Task Queue
1094     interfaceTag - Interface Identifier; unique identifier of an interface
1095     status       - Reports the result of the request.
1096                    CSR_WIFI_SME_STATUS_NOT_FOUND: all attempts by the SME to
1097                    locate the requested AP failed
1098
1099 *******************************************************************************/
1100 #define CsrWifiSmeConnectCfmCreate(msg__, dst__, src__, interfaceTag__, status__) \
1101     msg__ = (CsrWifiSmeConnectCfm *) CsrPmemAlloc(sizeof(CsrWifiSmeConnectCfm)); \
1102     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_CONNECT_CFM, dst__, src__); \
1103     msg__->interfaceTag = (interfaceTag__); \
1104     msg__->status = (status__);
1105
1106 #define CsrWifiSmeConnectCfmSendTo(dst__, src__, interfaceTag__, status__) \
1107     { \
1108         CsrWifiSmeConnectCfm *msg__; \
1109         CsrWifiSmeConnectCfmCreate(msg__, dst__, src__, interfaceTag__, status__); \
1110         CsrSchedMessagePut(dst__, CSR_WIFI_SME_PRIM, msg__); \
1111     }
1112
1113 #define CsrWifiSmeConnectCfmSend(dst__, interfaceTag__, status__) \
1114     CsrWifiSmeConnectCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, interfaceTag__, status__)
1115
1116 /*******************************************************************************
1117
1118   NAME
1119     CsrWifiSmeConnectionConfigGetReqSend
1120
1121   DESCRIPTION
1122     This primitive gets the value of the ConnectionConfig parameter.
1123
1124   PARAMETERS
1125     queue        - Message Source Task Queue (Cfm's will be sent to this Queue)
1126     interfaceTag - Interface Identifier; unique identifier of an interface
1127
1128 *******************************************************************************/
1129 #define CsrWifiSmeConnectionConfigGetReqCreate(msg__, dst__, src__, interfaceTag__) \
1130     msg__ = (CsrWifiSmeConnectionConfigGetReq *) CsrPmemAlloc(sizeof(CsrWifiSmeConnectionConfigGetReq)); \
1131     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_CONNECTION_CONFIG_GET_REQ, dst__, src__); \
1132     msg__->interfaceTag = (interfaceTag__);
1133
1134 #define CsrWifiSmeConnectionConfigGetReqSendTo(dst__, src__, interfaceTag__) \
1135     { \
1136         CsrWifiSmeConnectionConfigGetReq *msg__; \
1137         CsrWifiSmeConnectionConfigGetReqCreate(msg__, dst__, src__, interfaceTag__); \
1138         CsrMsgTransport(dst__, CSR_WIFI_SME_PRIM, msg__); \
1139     }
1140
1141 #define CsrWifiSmeConnectionConfigGetReqSend(src__, interfaceTag__) \
1142     CsrWifiSmeConnectionConfigGetReqSendTo(CSR_WIFI_SME_LIB_DESTINATION_QUEUE, src__, interfaceTag__)
1143
1144 /*******************************************************************************
1145
1146   NAME
1147     CsrWifiSmeConnectionConfigGetCfmSend
1148
1149   DESCRIPTION
1150     This primitive reports the result of the request.
1151
1152   PARAMETERS
1153     queue            - Destination Task Queue
1154     interfaceTag     - Interface Identifier; unique identifier of an interface
1155     status           - Reports the result of the request
1156     connectionConfig - Parameters used by the SME for selecting a network
1157
1158 *******************************************************************************/
1159 #define CsrWifiSmeConnectionConfigGetCfmCreate(msg__, dst__, src__, interfaceTag__, status__, connectionConfig__) \
1160     msg__ = (CsrWifiSmeConnectionConfigGetCfm *) CsrPmemAlloc(sizeof(CsrWifiSmeConnectionConfigGetCfm)); \
1161     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_CONNECTION_CONFIG_GET_CFM, dst__, src__); \
1162     msg__->interfaceTag = (interfaceTag__); \
1163     msg__->status = (status__); \
1164     msg__->connectionConfig = (connectionConfig__);
1165
1166 #define CsrWifiSmeConnectionConfigGetCfmSendTo(dst__, src__, interfaceTag__, status__, connectionConfig__) \
1167     { \
1168         CsrWifiSmeConnectionConfigGetCfm *msg__; \
1169         CsrWifiSmeConnectionConfigGetCfmCreate(msg__, dst__, src__, interfaceTag__, status__, connectionConfig__); \
1170         CsrSchedMessagePut(dst__, CSR_WIFI_SME_PRIM, msg__); \
1171     }
1172
1173 #define CsrWifiSmeConnectionConfigGetCfmSend(dst__, interfaceTag__, status__, connectionConfig__) \
1174     CsrWifiSmeConnectionConfigGetCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, interfaceTag__, status__, connectionConfig__)
1175
1176 /*******************************************************************************
1177
1178   NAME
1179     CsrWifiSmeConnectionInfoGetReqSend
1180
1181   DESCRIPTION
1182     This primitive gets the value of the ConnectionInfo parameter.
1183
1184   PARAMETERS
1185     queue        - Message Source Task Queue (Cfm's will be sent to this Queue)
1186     interfaceTag - Interface Identifier; unique identifier of an interface
1187
1188 *******************************************************************************/
1189 #define CsrWifiSmeConnectionInfoGetReqCreate(msg__, dst__, src__, interfaceTag__) \
1190     msg__ = (CsrWifiSmeConnectionInfoGetReq *) CsrPmemAlloc(sizeof(CsrWifiSmeConnectionInfoGetReq)); \
1191     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_CONNECTION_INFO_GET_REQ, dst__, src__); \
1192     msg__->interfaceTag = (interfaceTag__);
1193
1194 #define CsrWifiSmeConnectionInfoGetReqSendTo(dst__, src__, interfaceTag__) \
1195     { \
1196         CsrWifiSmeConnectionInfoGetReq *msg__; \
1197         CsrWifiSmeConnectionInfoGetReqCreate(msg__, dst__, src__, interfaceTag__); \
1198         CsrMsgTransport(dst__, CSR_WIFI_SME_PRIM, msg__); \
1199     }
1200
1201 #define CsrWifiSmeConnectionInfoGetReqSend(src__, interfaceTag__) \
1202     CsrWifiSmeConnectionInfoGetReqSendTo(CSR_WIFI_SME_LIB_DESTINATION_QUEUE, src__, interfaceTag__)
1203
1204 /*******************************************************************************
1205
1206   NAME
1207     CsrWifiSmeConnectionInfoGetCfmSend
1208
1209   DESCRIPTION
1210     This primitive reports the result of the request.
1211
1212   PARAMETERS
1213     queue          - Destination Task Queue
1214     interfaceTag   - Interface Identifier; unique identifier of an interface
1215     status         - Reports the result of the request
1216     connectionInfo - Information about the current connection
1217
1218 *******************************************************************************/
1219 #define CsrWifiSmeConnectionInfoGetCfmCreate(msg__, dst__, src__, interfaceTag__, status__, connectionInfo__) \
1220     msg__ = (CsrWifiSmeConnectionInfoGetCfm *) CsrPmemAlloc(sizeof(CsrWifiSmeConnectionInfoGetCfm)); \
1221     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_CONNECTION_INFO_GET_CFM, dst__, src__); \
1222     msg__->interfaceTag = (interfaceTag__); \
1223     msg__->status = (status__); \
1224     msg__->connectionInfo = (connectionInfo__);
1225
1226 #define CsrWifiSmeConnectionInfoGetCfmSendTo(dst__, src__, interfaceTag__, status__, connectionInfo__) \
1227     { \
1228         CsrWifiSmeConnectionInfoGetCfm *msg__; \
1229         CsrWifiSmeConnectionInfoGetCfmCreate(msg__, dst__, src__, interfaceTag__, status__, connectionInfo__); \
1230         CsrSchedMessagePut(dst__, CSR_WIFI_SME_PRIM, msg__); \
1231     }
1232
1233 #define CsrWifiSmeConnectionInfoGetCfmSend(dst__, interfaceTag__, status__, connectionInfo__) \
1234     CsrWifiSmeConnectionInfoGetCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, interfaceTag__, status__, connectionInfo__)
1235
1236 /*******************************************************************************
1237
1238   NAME
1239     CsrWifiSmeConnectionQualityIndSend
1240
1241   DESCRIPTION
1242     The SME sends this primitive to all the tasks that have registered to
1243     receive it whenever the value of the current connection quality
1244     parameters change by more than a certain configurable amount.
1245     The wireless manager application may configure the trigger thresholds for
1246     this indication using the field in smeConfig parameter of
1247     CSR_WIFI_SME_SME_CONFIG_SET_REQ.
1248     Connection quality messages can be suppressed by setting both thresholds
1249     to zero.
1250
1251   PARAMETERS
1252     queue        - Destination Task Queue
1253     interfaceTag - Interface Identifier; unique identifier of an interface
1254     linkQuality  - Indicates the quality of the link
1255
1256 *******************************************************************************/
1257 #define CsrWifiSmeConnectionQualityIndCreate(msg__, dst__, src__, interfaceTag__, linkQuality__) \
1258     msg__ = (CsrWifiSmeConnectionQualityInd *) CsrPmemAlloc(sizeof(CsrWifiSmeConnectionQualityInd)); \
1259     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_CONNECTION_QUALITY_IND, dst__, src__); \
1260     msg__->interfaceTag = (interfaceTag__); \
1261     msg__->linkQuality = (linkQuality__);
1262
1263 #define CsrWifiSmeConnectionQualityIndSendTo(dst__, src__, interfaceTag__, linkQuality__) \
1264     { \
1265         CsrWifiSmeConnectionQualityInd *msg__; \
1266         CsrWifiSmeConnectionQualityIndCreate(msg__, dst__, src__, interfaceTag__, linkQuality__); \
1267         CsrSchedMessagePut(dst__, CSR_WIFI_SME_PRIM, msg__); \
1268     }
1269
1270 #define CsrWifiSmeConnectionQualityIndSend(dst__, interfaceTag__, linkQuality__) \
1271     CsrWifiSmeConnectionQualityIndSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, interfaceTag__, linkQuality__)
1272
1273 /*******************************************************************************
1274
1275   NAME
1276     CsrWifiSmeConnectionStatsGetReqSend
1277
1278   DESCRIPTION
1279     This primitive gets the value of the ConnectionStats parameter.
1280
1281   PARAMETERS
1282     queue        - Message Source Task Queue (Cfm's will be sent to this Queue)
1283     interfaceTag - Interface Identifier; unique identifier of an interface
1284
1285 *******************************************************************************/
1286 #define CsrWifiSmeConnectionStatsGetReqCreate(msg__, dst__, src__, interfaceTag__) \
1287     msg__ = (CsrWifiSmeConnectionStatsGetReq *) CsrPmemAlloc(sizeof(CsrWifiSmeConnectionStatsGetReq)); \
1288     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_CONNECTION_STATS_GET_REQ, dst__, src__); \
1289     msg__->interfaceTag = (interfaceTag__);
1290
1291 #define CsrWifiSmeConnectionStatsGetReqSendTo(dst__, src__, interfaceTag__) \
1292     { \
1293         CsrWifiSmeConnectionStatsGetReq *msg__; \
1294         CsrWifiSmeConnectionStatsGetReqCreate(msg__, dst__, src__, interfaceTag__); \
1295         CsrMsgTransport(dst__, CSR_WIFI_SME_PRIM, msg__); \
1296     }
1297
1298 #define CsrWifiSmeConnectionStatsGetReqSend(src__, interfaceTag__) \
1299     CsrWifiSmeConnectionStatsGetReqSendTo(CSR_WIFI_SME_LIB_DESTINATION_QUEUE, src__, interfaceTag__)
1300
1301 /*******************************************************************************
1302
1303   NAME
1304     CsrWifiSmeConnectionStatsGetCfmSend
1305
1306   DESCRIPTION
1307     This primitive reports the result of the request.
1308
1309   PARAMETERS
1310     queue           - Destination Task Queue
1311     interfaceTag    - Interface Identifier; unique identifier of an interface
1312     status          - Reports the result of the request
1313     connectionStats - Statistics for current connection.
1314
1315 *******************************************************************************/
1316 #define CsrWifiSmeConnectionStatsGetCfmCreate(msg__, dst__, src__, interfaceTag__, status__, connectionStats__) \
1317     msg__ = (CsrWifiSmeConnectionStatsGetCfm *) CsrPmemAlloc(sizeof(CsrWifiSmeConnectionStatsGetCfm)); \
1318     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_CONNECTION_STATS_GET_CFM, dst__, src__); \
1319     msg__->interfaceTag = (interfaceTag__); \
1320     msg__->status = (status__); \
1321     msg__->connectionStats = (connectionStats__);
1322
1323 #define CsrWifiSmeConnectionStatsGetCfmSendTo(dst__, src__, interfaceTag__, status__, connectionStats__) \
1324     { \
1325         CsrWifiSmeConnectionStatsGetCfm *msg__; \
1326         CsrWifiSmeConnectionStatsGetCfmCreate(msg__, dst__, src__, interfaceTag__, status__, connectionStats__); \
1327         CsrSchedMessagePut(dst__, CSR_WIFI_SME_PRIM, msg__); \
1328     }
1329
1330 #define CsrWifiSmeConnectionStatsGetCfmSend(dst__, interfaceTag__, status__, connectionStats__) \
1331     CsrWifiSmeConnectionStatsGetCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, interfaceTag__, status__, connectionStats__)
1332
1333 /*******************************************************************************
1334
1335   NAME
1336     CsrWifiSmeCoreDumpIndSend
1337
1338   DESCRIPTION
1339     The SME will send this primitive to all the tasks that have registered to
1340     receive Wi-Fi Chip core dump data.
1341     The core dump data may be fragmented and sent using more than one
1342     indication.
1343     To indicate that all the data has been sent, the last indication contains
1344     a 'length' of 0 and 'data' of NULL.
1345
1346   PARAMETERS
1347     queue      - Destination Task Queue
1348     dataLength - Number of bytes in the buffer pointed to by 'data'
1349     data       - Pointer to the buffer containing 'dataLength' bytes of core
1350                  dump data
1351
1352 *******************************************************************************/
1353 #define CsrWifiSmeCoreDumpIndCreate(msg__, dst__, src__, dataLength__, data__) \
1354     msg__ = (CsrWifiSmeCoreDumpInd *) CsrPmemAlloc(sizeof(CsrWifiSmeCoreDumpInd)); \
1355     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_CORE_DUMP_IND, dst__, src__); \
1356     msg__->dataLength = (dataLength__); \
1357     msg__->data = (data__);
1358
1359 #define CsrWifiSmeCoreDumpIndSendTo(dst__, src__, dataLength__, data__) \
1360     { \
1361         CsrWifiSmeCoreDumpInd *msg__; \
1362         CsrWifiSmeCoreDumpIndCreate(msg__, dst__, src__, dataLength__, data__); \
1363         CsrSchedMessagePut(dst__, CSR_WIFI_SME_PRIM, msg__); \
1364     }
1365
1366 #define CsrWifiSmeCoreDumpIndSend(dst__, dataLength__, data__) \
1367     CsrWifiSmeCoreDumpIndSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, dataLength__, data__)
1368
1369 /*******************************************************************************
1370
1371   NAME
1372     CsrWifiSmeDeactivateReqSend
1373
1374   DESCRIPTION
1375     The WMA sends this primitive to deactivate the SME.
1376
1377   PARAMETERS
1378     queue  - Message Source Task Queue (Cfm's will be sent to this Queue)
1379
1380 *******************************************************************************/
1381 #define CsrWifiSmeDeactivateReqCreate(msg__, dst__, src__) \
1382     msg__ = (CsrWifiSmeDeactivateReq *) CsrPmemAlloc(sizeof(CsrWifiSmeDeactivateReq)); \
1383     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_DEACTIVATE_REQ, dst__, src__);
1384
1385 #define CsrWifiSmeDeactivateReqSendTo(dst__, src__) \
1386     { \
1387         CsrWifiSmeDeactivateReq *msg__; \
1388         CsrWifiSmeDeactivateReqCreate(msg__, dst__, src__); \
1389         CsrMsgTransport(dst__, CSR_WIFI_SME_PRIM, msg__); \
1390     }
1391
1392 #define CsrWifiSmeDeactivateReqSend(src__) \
1393     CsrWifiSmeDeactivateReqSendTo(CSR_WIFI_SME_LIB_DESTINATION_QUEUE, src__)
1394
1395 /*******************************************************************************
1396
1397   NAME
1398     CsrWifiSmeDeactivateCfmSend
1399
1400   DESCRIPTION
1401     The SME sends this primitive when the deactivation is complete.
1402     The WMA cannot send any more primitives until it actives the SME again
1403     sending another CSR_WIFI_SME_ACTIVATE_REQ.
1404
1405   PARAMETERS
1406     queue  - Destination Task Queue
1407     status - Reports the result of the request
1408
1409 *******************************************************************************/
1410 #define CsrWifiSmeDeactivateCfmCreate(msg__, dst__, src__, status__) \
1411     msg__ = (CsrWifiSmeDeactivateCfm *) CsrPmemAlloc(sizeof(CsrWifiSmeDeactivateCfm)); \
1412     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_DEACTIVATE_CFM, dst__, src__); \
1413     msg__->status = (status__);
1414
1415 #define CsrWifiSmeDeactivateCfmSendTo(dst__, src__, status__) \
1416     { \
1417         CsrWifiSmeDeactivateCfm *msg__; \
1418         CsrWifiSmeDeactivateCfmCreate(msg__, dst__, src__, status__); \
1419         CsrSchedMessagePut(dst__, CSR_WIFI_SME_PRIM, msg__); \
1420     }
1421
1422 #define CsrWifiSmeDeactivateCfmSend(dst__, status__) \
1423     CsrWifiSmeDeactivateCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, status__)
1424
1425 /*******************************************************************************
1426
1427   NAME
1428     CsrWifiSmeDisconnectReqSend
1429
1430   DESCRIPTION
1431     The wireless manager application may disconnect from the current network
1432     by calling this primitive
1433
1434   PARAMETERS
1435     queue        - Message Source Task Queue (Cfm's will be sent to this Queue)
1436     interfaceTag - Interface Identifier; unique identifier of an interface
1437
1438 *******************************************************************************/
1439 #define CsrWifiSmeDisconnectReqCreate(msg__, dst__, src__, interfaceTag__) \
1440     msg__ = (CsrWifiSmeDisconnectReq *) CsrPmemAlloc(sizeof(CsrWifiSmeDisconnectReq)); \
1441     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_DISCONNECT_REQ, dst__, src__); \
1442     msg__->interfaceTag = (interfaceTag__);
1443
1444 #define CsrWifiSmeDisconnectReqSendTo(dst__, src__, interfaceTag__) \
1445     { \
1446         CsrWifiSmeDisconnectReq *msg__; \
1447         CsrWifiSmeDisconnectReqCreate(msg__, dst__, src__, interfaceTag__); \
1448         CsrMsgTransport(dst__, CSR_WIFI_SME_PRIM, msg__); \
1449     }
1450
1451 #define CsrWifiSmeDisconnectReqSend(src__, interfaceTag__) \
1452     CsrWifiSmeDisconnectReqSendTo(CSR_WIFI_SME_LIB_DESTINATION_QUEUE, src__, interfaceTag__)
1453
1454 /*******************************************************************************
1455
1456   NAME
1457     CsrWifiSmeDisconnectCfmSend
1458
1459   DESCRIPTION
1460     On reception of CSR_WIFI_SME_DISCONNECT_REQ the SME will perform a
1461     disconnect operation, sending a CsrWifiSmeMediaStatusInd with
1462     CSR_WIFI_SME_MEDIA_STATUS_DISCONNECTED and then call this primitive when
1463     disconnection is complete.
1464
1465   PARAMETERS
1466     queue        - Destination Task Queue
1467     interfaceTag - Interface Identifier; unique identifier of an interface
1468     status       - Reports the result of the request
1469
1470 *******************************************************************************/
1471 #define CsrWifiSmeDisconnectCfmCreate(msg__, dst__, src__, interfaceTag__, status__) \
1472     msg__ = (CsrWifiSmeDisconnectCfm *) CsrPmemAlloc(sizeof(CsrWifiSmeDisconnectCfm)); \
1473     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_DISCONNECT_CFM, dst__, src__); \
1474     msg__->interfaceTag = (interfaceTag__); \
1475     msg__->status = (status__);
1476
1477 #define CsrWifiSmeDisconnectCfmSendTo(dst__, src__, interfaceTag__, status__) \
1478     { \
1479         CsrWifiSmeDisconnectCfm *msg__; \
1480         CsrWifiSmeDisconnectCfmCreate(msg__, dst__, src__, interfaceTag__, status__); \
1481         CsrSchedMessagePut(dst__, CSR_WIFI_SME_PRIM, msg__); \
1482     }
1483
1484 #define CsrWifiSmeDisconnectCfmSend(dst__, interfaceTag__, status__) \
1485     CsrWifiSmeDisconnectCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, interfaceTag__, status__)
1486
1487 /*******************************************************************************
1488
1489   NAME
1490     CsrWifiSmeErrorIndSend
1491
1492   DESCRIPTION
1493     Important error message indicating a error of some importance
1494
1495   PARAMETERS
1496     queue        - Destination Task Queue
1497     errorMessage - Contains the error message.
1498
1499 *******************************************************************************/
1500 #define CsrWifiSmeErrorIndCreate(msg__, dst__, src__, errorMessage__) \
1501     msg__ = (CsrWifiSmeErrorInd *) CsrPmemAlloc(sizeof(CsrWifiSmeErrorInd)); \
1502     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_ERROR_IND, dst__, src__); \
1503     msg__->errorMessage = (errorMessage__);
1504
1505 #define CsrWifiSmeErrorIndSendTo(dst__, src__, errorMessage__) \
1506     { \
1507         CsrWifiSmeErrorInd *msg__; \
1508         CsrWifiSmeErrorIndCreate(msg__, dst__, src__, errorMessage__); \
1509         CsrSchedMessagePut(dst__, CSR_WIFI_SME_PRIM, msg__); \
1510     }
1511
1512 #define CsrWifiSmeErrorIndSend(dst__, errorMessage__) \
1513     CsrWifiSmeErrorIndSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, errorMessage__)
1514
1515 /*******************************************************************************
1516
1517   NAME
1518     CsrWifiSmeEventMaskSetReqSend
1519
1520   DESCRIPTION
1521     The wireless manager application may register with the SME to receive
1522     notification of interesting events. Indications will be sent only if the
1523     wireless manager explicitly registers to be notified of that event.
1524     indMask is a bit mask of values defined in CsrWifiSmeIndicationsMask.
1525
1526   PARAMETERS
1527     queue   - Message Source Task Queue (Cfm's will be sent to this Queue)
1528     indMask - Set mask with values from CsrWifiSmeIndications
1529
1530 *******************************************************************************/
1531 #define CsrWifiSmeEventMaskSetReqCreate(msg__, dst__, src__, indMask__) \
1532     msg__ = (CsrWifiSmeEventMaskSetReq *) CsrPmemAlloc(sizeof(CsrWifiSmeEventMaskSetReq)); \
1533     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_EVENT_MASK_SET_REQ, dst__, src__); \
1534     msg__->indMask = (indMask__);
1535
1536 #define CsrWifiSmeEventMaskSetReqSendTo(dst__, src__, indMask__) \
1537     { \
1538         CsrWifiSmeEventMaskSetReq *msg__; \
1539         CsrWifiSmeEventMaskSetReqCreate(msg__, dst__, src__, indMask__); \
1540         CsrMsgTransport(dst__, CSR_WIFI_SME_PRIM, msg__); \
1541     }
1542
1543 #define CsrWifiSmeEventMaskSetReqSend(src__, indMask__) \
1544     CsrWifiSmeEventMaskSetReqSendTo(CSR_WIFI_SME_LIB_DESTINATION_QUEUE, src__, indMask__)
1545
1546 /*******************************************************************************
1547
1548   NAME
1549     CsrWifiSmeEventMaskSetCfmSend
1550
1551   DESCRIPTION
1552     The SME calls the primitive to report the result of the request
1553     primitive.
1554
1555   PARAMETERS
1556     queue  - Destination Task Queue
1557     status - Reports the result of the request
1558
1559 *******************************************************************************/
1560 #define CsrWifiSmeEventMaskSetCfmCreate(msg__, dst__, src__, status__) \
1561     msg__ = (CsrWifiSmeEventMaskSetCfm *) CsrPmemAlloc(sizeof(CsrWifiSmeEventMaskSetCfm)); \
1562     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_EVENT_MASK_SET_CFM, dst__, src__); \
1563     msg__->status = (status__);
1564
1565 #define CsrWifiSmeEventMaskSetCfmSendTo(dst__, src__, status__) \
1566     { \
1567         CsrWifiSmeEventMaskSetCfm *msg__; \
1568         CsrWifiSmeEventMaskSetCfmCreate(msg__, dst__, src__, status__); \
1569         CsrSchedMessagePut(dst__, CSR_WIFI_SME_PRIM, msg__); \
1570     }
1571
1572 #define CsrWifiSmeEventMaskSetCfmSend(dst__, status__) \
1573     CsrWifiSmeEventMaskSetCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, status__)
1574
1575 /*******************************************************************************
1576
1577   NAME
1578     CsrWifiSmeHostConfigGetReqSend
1579
1580   DESCRIPTION
1581     This primitive gets the value of the hostConfig parameter.
1582
1583   PARAMETERS
1584     queue        - Message Source Task Queue (Cfm's will be sent to this Queue)
1585     interfaceTag - Interface Identifier; unique identifier of an interface
1586
1587 *******************************************************************************/
1588 #define CsrWifiSmeHostConfigGetReqCreate(msg__, dst__, src__, interfaceTag__) \
1589     msg__ = (CsrWifiSmeHostConfigGetReq *) CsrPmemAlloc(sizeof(CsrWifiSmeHostConfigGetReq)); \
1590     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_HOST_CONFIG_GET_REQ, dst__, src__); \
1591     msg__->interfaceTag = (interfaceTag__);
1592
1593 #define CsrWifiSmeHostConfigGetReqSendTo(dst__, src__, interfaceTag__) \
1594     { \
1595         CsrWifiSmeHostConfigGetReq *msg__; \
1596         CsrWifiSmeHostConfigGetReqCreate(msg__, dst__, src__, interfaceTag__); \
1597         CsrMsgTransport(dst__, CSR_WIFI_SME_PRIM, msg__); \
1598     }
1599
1600 #define CsrWifiSmeHostConfigGetReqSend(src__, interfaceTag__) \
1601     CsrWifiSmeHostConfigGetReqSendTo(CSR_WIFI_SME_LIB_DESTINATION_QUEUE, src__, interfaceTag__)
1602
1603 /*******************************************************************************
1604
1605   NAME
1606     CsrWifiSmeHostConfigGetCfmSend
1607
1608   DESCRIPTION
1609     This primitive reports the result of the request.
1610
1611   PARAMETERS
1612     queue        - Destination Task Queue
1613     interfaceTag - Interface Identifier; unique identifier of an interface
1614     status       - Reports the result of the request
1615     hostConfig   - Current host power state.
1616
1617 *******************************************************************************/
1618 #define CsrWifiSmeHostConfigGetCfmCreate(msg__, dst__, src__, interfaceTag__, status__, hostConfig__) \
1619     msg__ = (CsrWifiSmeHostConfigGetCfm *) CsrPmemAlloc(sizeof(CsrWifiSmeHostConfigGetCfm)); \
1620     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_HOST_CONFIG_GET_CFM, dst__, src__); \
1621     msg__->interfaceTag = (interfaceTag__); \
1622     msg__->status = (status__); \
1623     msg__->hostConfig = (hostConfig__);
1624
1625 #define CsrWifiSmeHostConfigGetCfmSendTo(dst__, src__, interfaceTag__, status__, hostConfig__) \
1626     { \
1627         CsrWifiSmeHostConfigGetCfm *msg__; \
1628         CsrWifiSmeHostConfigGetCfmCreate(msg__, dst__, src__, interfaceTag__, status__, hostConfig__); \
1629         CsrSchedMessagePut(dst__, CSR_WIFI_SME_PRIM, msg__); \
1630     }
1631
1632 #define CsrWifiSmeHostConfigGetCfmSend(dst__, interfaceTag__, status__, hostConfig__) \
1633     CsrWifiSmeHostConfigGetCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, interfaceTag__, status__, hostConfig__)
1634
1635 /*******************************************************************************
1636
1637   NAME
1638     CsrWifiSmeHostConfigSetReqSend
1639
1640   DESCRIPTION
1641     This primitive sets the value of the hostConfig parameter.
1642
1643   PARAMETERS
1644     queue        - Message Source Task Queue (Cfm's will be sent to this Queue)
1645     interfaceTag - Interface Identifier; unique identifier of an interface
1646     hostConfig   - Communicates a change of host power state (for example, on
1647                    mains power, on battery power etc) and of the periodicity of
1648                    traffic data
1649
1650 *******************************************************************************/
1651 #define CsrWifiSmeHostConfigSetReqCreate(msg__, dst__, src__, interfaceTag__, hostConfig__) \
1652     msg__ = (CsrWifiSmeHostConfigSetReq *) CsrPmemAlloc(sizeof(CsrWifiSmeHostConfigSetReq)); \
1653     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_HOST_CONFIG_SET_REQ, dst__, src__); \
1654     msg__->interfaceTag = (interfaceTag__); \
1655     msg__->hostConfig = (hostConfig__);
1656
1657 #define CsrWifiSmeHostConfigSetReqSendTo(dst__, src__, interfaceTag__, hostConfig__) \
1658     { \
1659         CsrWifiSmeHostConfigSetReq *msg__; \
1660         CsrWifiSmeHostConfigSetReqCreate(msg__, dst__, src__, interfaceTag__, hostConfig__); \
1661         CsrMsgTransport(dst__, CSR_WIFI_SME_PRIM, msg__); \
1662     }
1663
1664 #define CsrWifiSmeHostConfigSetReqSend(src__, interfaceTag__, hostConfig__) \
1665     CsrWifiSmeHostConfigSetReqSendTo(CSR_WIFI_SME_LIB_DESTINATION_QUEUE, src__, interfaceTag__, hostConfig__)
1666
1667 /*******************************************************************************
1668
1669   NAME
1670     CsrWifiSmeHostConfigSetCfmSend
1671
1672   DESCRIPTION
1673     This primitive reports the result of the request.
1674
1675   PARAMETERS
1676     queue        - Destination Task Queue
1677     interfaceTag - Interface Identifier; unique identifier of an interface
1678     status       - Reports the result of the request
1679
1680 *******************************************************************************/
1681 #define CsrWifiSmeHostConfigSetCfmCreate(msg__, dst__, src__, interfaceTag__, status__) \
1682     msg__ = (CsrWifiSmeHostConfigSetCfm *) CsrPmemAlloc(sizeof(CsrWifiSmeHostConfigSetCfm)); \
1683     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_HOST_CONFIG_SET_CFM, dst__, src__); \
1684     msg__->interfaceTag = (interfaceTag__); \
1685     msg__->status = (status__);
1686
1687 #define CsrWifiSmeHostConfigSetCfmSendTo(dst__, src__, interfaceTag__, status__) \
1688     { \
1689         CsrWifiSmeHostConfigSetCfm *msg__; \
1690         CsrWifiSmeHostConfigSetCfmCreate(msg__, dst__, src__, interfaceTag__, status__); \
1691         CsrSchedMessagePut(dst__, CSR_WIFI_SME_PRIM, msg__); \
1692     }
1693
1694 #define CsrWifiSmeHostConfigSetCfmSend(dst__, interfaceTag__, status__) \
1695     CsrWifiSmeHostConfigSetCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, interfaceTag__, status__)
1696
1697 /*******************************************************************************
1698
1699   NAME
1700     CsrWifiSmeIbssStationIndSend
1701
1702   DESCRIPTION
1703     The SME will send this primitive to indicate that a station has joined or
1704     left the ad-hoc network.
1705
1706   PARAMETERS
1707     queue       - Destination Task Queue
1708     address     - MAC address of the station that has joined or left
1709     isconnected - TRUE if the station joined, FALSE if the station left
1710
1711 *******************************************************************************/
1712 #define CsrWifiSmeIbssStationIndCreate(msg__, dst__, src__, address__, isconnected__) \
1713     msg__ = (CsrWifiSmeIbssStationInd *) CsrPmemAlloc(sizeof(CsrWifiSmeIbssStationInd)); \
1714     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_IBSS_STATION_IND, dst__, src__); \
1715     msg__->address = (address__); \
1716     msg__->isconnected = (isconnected__);
1717
1718 #define CsrWifiSmeIbssStationIndSendTo(dst__, src__, address__, isconnected__) \
1719     { \
1720         CsrWifiSmeIbssStationInd *msg__; \
1721         CsrWifiSmeIbssStationIndCreate(msg__, dst__, src__, address__, isconnected__); \
1722         CsrSchedMessagePut(dst__, CSR_WIFI_SME_PRIM, msg__); \
1723     }
1724
1725 #define CsrWifiSmeIbssStationIndSend(dst__, address__, isconnected__) \
1726     CsrWifiSmeIbssStationIndSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, address__, isconnected__)
1727
1728 /*******************************************************************************
1729
1730   NAME
1731     CsrWifiSmeInfoIndSend
1732
1733   DESCRIPTION
1734     Message indicating a some info about current activity. Mostly of interest
1735     in testing but may be useful in the field.
1736
1737   PARAMETERS
1738     queue       - Destination Task Queue
1739     infoMessage - Contains the message.
1740
1741 *******************************************************************************/
1742 #define CsrWifiSmeInfoIndCreate(msg__, dst__, src__, infoMessage__) \
1743     msg__ = (CsrWifiSmeInfoInd *) CsrPmemAlloc(sizeof(CsrWifiSmeInfoInd)); \
1744     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_INFO_IND, dst__, src__); \
1745     msg__->infoMessage = (infoMessage__);
1746
1747 #define CsrWifiSmeInfoIndSendTo(dst__, src__, infoMessage__) \
1748     { \
1749         CsrWifiSmeInfoInd *msg__; \
1750         CsrWifiSmeInfoIndCreate(msg__, dst__, src__, infoMessage__); \
1751         CsrSchedMessagePut(dst__, CSR_WIFI_SME_PRIM, msg__); \
1752     }
1753
1754 #define CsrWifiSmeInfoIndSend(dst__, infoMessage__) \
1755     CsrWifiSmeInfoIndSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, infoMessage__)
1756
1757 /*******************************************************************************
1758
1759   NAME
1760     CsrWifiSmeInterfaceCapabilityGetReqSend
1761
1762   DESCRIPTION
1763     The Wireless Manager calls this primitive to ask the SME for the
1764     capabilities of the supported interfaces
1765
1766   PARAMETERS
1767     queue  - Message Source Task Queue (Cfm's will be sent to this Queue)
1768
1769 *******************************************************************************/
1770 #define CsrWifiSmeInterfaceCapabilityGetReqCreate(msg__, dst__, src__) \
1771     msg__ = (CsrWifiSmeInterfaceCapabilityGetReq *) CsrPmemAlloc(sizeof(CsrWifiSmeInterfaceCapabilityGetReq)); \
1772     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_INTERFACE_CAPABILITY_GET_REQ, dst__, src__);
1773
1774 #define CsrWifiSmeInterfaceCapabilityGetReqSendTo(dst__, src__) \
1775     { \
1776         CsrWifiSmeInterfaceCapabilityGetReq *msg__; \
1777         CsrWifiSmeInterfaceCapabilityGetReqCreate(msg__, dst__, src__); \
1778         CsrMsgTransport(dst__, CSR_WIFI_SME_PRIM, msg__); \
1779     }
1780
1781 #define CsrWifiSmeInterfaceCapabilityGetReqSend(src__) \
1782     CsrWifiSmeInterfaceCapabilityGetReqSendTo(CSR_WIFI_SME_LIB_DESTINATION_QUEUE, src__)
1783
1784 /*******************************************************************************
1785
1786   NAME
1787     CsrWifiSmeInterfaceCapabilityGetCfmSend
1788
1789   DESCRIPTION
1790     This primitive reports the result of the request.
1791
1792   PARAMETERS
1793     queue         - Destination Task Queue
1794     status        - Result of the request
1795     numInterfaces - Number of the interfaces supported
1796     capBitmap     - Points to the list of capabilities bitmaps provided for each
1797                     interface.
1798                     The bits represent the following capabilities:
1799                     -bits 7 to 4-Reserved
1800                     -bit 3-AMP
1801                     -bit 2-P2P
1802                     -bit 1-AP
1803                     -bit 0-STA
1804
1805 *******************************************************************************/
1806 #define CsrWifiSmeInterfaceCapabilityGetCfmCreate(msg__, dst__, src__, status__, numInterfaces__, capBitmap__) \
1807     msg__ = (CsrWifiSmeInterfaceCapabilityGetCfm *) CsrPmemAlloc(sizeof(CsrWifiSmeInterfaceCapabilityGetCfm)); \
1808     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_INTERFACE_CAPABILITY_GET_CFM, dst__, src__); \
1809     msg__->status = (status__); \
1810     msg__->numInterfaces = (numInterfaces__); \
1811     memcpy(msg__->capBitmap, (capBitmap__), sizeof(u8) * 2);
1812
1813 #define CsrWifiSmeInterfaceCapabilityGetCfmSendTo(dst__, src__, status__, numInterfaces__, capBitmap__) \
1814     { \
1815         CsrWifiSmeInterfaceCapabilityGetCfm *msg__; \
1816         CsrWifiSmeInterfaceCapabilityGetCfmCreate(msg__, dst__, src__, status__, numInterfaces__, capBitmap__); \
1817         CsrSchedMessagePut(dst__, CSR_WIFI_SME_PRIM, msg__); \
1818     }
1819
1820 #define CsrWifiSmeInterfaceCapabilityGetCfmSend(dst__, status__, numInterfaces__, capBitmap__) \
1821     CsrWifiSmeInterfaceCapabilityGetCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, status__, numInterfaces__, capBitmap__)
1822
1823 /*******************************************************************************
1824
1825   NAME
1826     CsrWifiSmeKeyReqSend
1827
1828   DESCRIPTION
1829     The wireless manager application calls this primitive to add or remove
1830     keys that the chip should use for encryption of data.
1831     The interface allows the wireless manager application to add and remove
1832     keys according to the specified action.
1833
1834   PARAMETERS
1835     queue        - Message Source Task Queue (Cfm's will be sent to this Queue)
1836     interfaceTag - Interface Identifier; unique identifier of an interface
1837     action       - The value of the CsrWifiSmeListAction parameter instructs the
1838                    driver to modify or provide the list of keys.
1839                    CSR_WIFI_SME_LIST_ACTION_GET is not supported here.
1840     key          - Key to be added or removed
1841
1842 *******************************************************************************/
1843 #define CsrWifiSmeKeyReqCreate(msg__, dst__, src__, interfaceTag__, action__, key__) \
1844     msg__ = (CsrWifiSmeKeyReq *) CsrPmemAlloc(sizeof(CsrWifiSmeKeyReq)); \
1845     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_KEY_REQ, dst__, src__); \
1846     msg__->interfaceTag = (interfaceTag__); \
1847     msg__->action = (action__); \
1848     msg__->key = (key__);
1849
1850 #define CsrWifiSmeKeyReqSendTo(dst__, src__, interfaceTag__, action__, key__) \
1851     { \
1852         CsrWifiSmeKeyReq *msg__; \
1853         CsrWifiSmeKeyReqCreate(msg__, dst__, src__, interfaceTag__, action__, key__); \
1854         CsrMsgTransport(dst__, CSR_WIFI_SME_PRIM, msg__); \
1855     }
1856
1857 #define CsrWifiSmeKeyReqSend(src__, interfaceTag__, action__, key__) \
1858     CsrWifiSmeKeyReqSendTo(CSR_WIFI_SME_LIB_DESTINATION_QUEUE, src__, interfaceTag__, action__, key__)
1859
1860 /*******************************************************************************
1861
1862   NAME
1863     CsrWifiSmeKeyCfmSend
1864
1865   DESCRIPTION
1866     The SME calls the primitive to report the result of the request
1867     primitive.
1868
1869   PARAMETERS
1870     queue          - Destination Task Queue
1871     interfaceTag   - Interface Identifier; unique identifier of an interface
1872     status         - Reports the result of the request
1873     action         - Action in the request
1874     keyType        - Type of the key added/deleted
1875     peerMacAddress - Peer MAC Address of the key added/deleted
1876
1877 *******************************************************************************/
1878 #define CsrWifiSmeKeyCfmCreate(msg__, dst__, src__, interfaceTag__, status__, action__, keyType__, peerMacAddress__) \
1879     msg__ = (CsrWifiSmeKeyCfm *) CsrPmemAlloc(sizeof(CsrWifiSmeKeyCfm)); \
1880     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_KEY_CFM, dst__, src__); \
1881     msg__->interfaceTag = (interfaceTag__); \
1882     msg__->status = (status__); \
1883     msg__->action = (action__); \
1884     msg__->keyType = (keyType__); \
1885     msg__->peerMacAddress = (peerMacAddress__);
1886
1887 #define CsrWifiSmeKeyCfmSendTo(dst__, src__, interfaceTag__, status__, action__, keyType__, peerMacAddress__) \
1888     { \
1889         CsrWifiSmeKeyCfm *msg__; \
1890         CsrWifiSmeKeyCfmCreate(msg__, dst__, src__, interfaceTag__, status__, action__, keyType__, peerMacAddress__); \
1891         CsrSchedMessagePut(dst__, CSR_WIFI_SME_PRIM, msg__); \
1892     }
1893
1894 #define CsrWifiSmeKeyCfmSend(dst__, interfaceTag__, status__, action__, keyType__, peerMacAddress__) \
1895     CsrWifiSmeKeyCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, interfaceTag__, status__, action__, keyType__, peerMacAddress__)
1896
1897 /*******************************************************************************
1898
1899   NAME
1900     CsrWifiSmeLinkQualityGetReqSend
1901
1902   DESCRIPTION
1903     This primitive gets the value of the LinkQuality parameter.
1904
1905   PARAMETERS
1906     queue        - Message Source Task Queue (Cfm's will be sent to this Queue)
1907     interfaceTag - Interface Identifier; unique identifier of an interface
1908
1909 *******************************************************************************/
1910 #define CsrWifiSmeLinkQualityGetReqCreate(msg__, dst__, src__, interfaceTag__) \
1911     msg__ = (CsrWifiSmeLinkQualityGetReq *) CsrPmemAlloc(sizeof(CsrWifiSmeLinkQualityGetReq)); \
1912     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_LINK_QUALITY_GET_REQ, dst__, src__); \
1913     msg__->interfaceTag = (interfaceTag__);
1914
1915 #define CsrWifiSmeLinkQualityGetReqSendTo(dst__, src__, interfaceTag__) \
1916     { \
1917         CsrWifiSmeLinkQualityGetReq *msg__; \
1918         CsrWifiSmeLinkQualityGetReqCreate(msg__, dst__, src__, interfaceTag__); \
1919         CsrMsgTransport(dst__, CSR_WIFI_SME_PRIM, msg__); \
1920     }
1921
1922 #define CsrWifiSmeLinkQualityGetReqSend(src__, interfaceTag__) \
1923     CsrWifiSmeLinkQualityGetReqSendTo(CSR_WIFI_SME_LIB_DESTINATION_QUEUE, src__, interfaceTag__)
1924
1925 /*******************************************************************************
1926
1927   NAME
1928     CsrWifiSmeLinkQualityGetCfmSend
1929
1930   DESCRIPTION
1931     This primitive reports the result of the request.
1932
1933   PARAMETERS
1934     queue        - Destination Task Queue
1935     interfaceTag - Interface Identifier; unique identifier of an interface
1936     status       - Reports the result of the request
1937     linkQuality  - Indicates the quality of the link
1938
1939 *******************************************************************************/
1940 #define CsrWifiSmeLinkQualityGetCfmCreate(msg__, dst__, src__, interfaceTag__, status__, linkQuality__) \
1941     msg__ = (CsrWifiSmeLinkQualityGetCfm *) CsrPmemAlloc(sizeof(CsrWifiSmeLinkQualityGetCfm)); \
1942     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_LINK_QUALITY_GET_CFM, dst__, src__); \
1943     msg__->interfaceTag = (interfaceTag__); \
1944     msg__->status = (status__); \
1945     msg__->linkQuality = (linkQuality__);
1946
1947 #define CsrWifiSmeLinkQualityGetCfmSendTo(dst__, src__, interfaceTag__, status__, linkQuality__) \
1948     { \
1949         CsrWifiSmeLinkQualityGetCfm *msg__; \
1950         CsrWifiSmeLinkQualityGetCfmCreate(msg__, dst__, src__, interfaceTag__, status__, linkQuality__); \
1951         CsrSchedMessagePut(dst__, CSR_WIFI_SME_PRIM, msg__); \
1952     }
1953
1954 #define CsrWifiSmeLinkQualityGetCfmSend(dst__, interfaceTag__, status__, linkQuality__) \
1955     CsrWifiSmeLinkQualityGetCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, interfaceTag__, status__, linkQuality__)
1956
1957 /*******************************************************************************
1958
1959   NAME
1960     CsrWifiSmeMediaStatusIndSend
1961
1962   DESCRIPTION
1963     The SME sends this primitive to all the tasks that have registered to
1964     receive it when a network connection is established, lost or has moved to
1965     another AP.
1966
1967   PARAMETERS
1968     queue          - Destination Task Queue
1969     interfaceTag   - Interface Identifier; unique identifier of an interface
1970     mediaStatus    - Indicates the media status
1971     connectionInfo - This parameter is relevant only if the mediaStatus is
1972                      CSR_WIFI_SME_MEDIA_STATUS_CONNECTED:
1973                      it points to the connection information for the new network
1974     disassocReason - This parameter is relevant only if the mediaStatus is
1975                      CSR_WIFI_SME_MEDIA_STATUS_DISCONNECTED:
1976                      if a disassociation has occurred it gives the reason of the
1977                      disassociation
1978     deauthReason   - This parameter is relevant only if the mediaStatus is
1979                      CSR_WIFI_SME_MEDIA_STATUS_DISCONNECTED:
1980                      if a deauthentication has occurred it gives the reason of
1981                      the deauthentication
1982
1983 *******************************************************************************/
1984 #define CsrWifiSmeMediaStatusIndCreate(msg__, dst__, src__, interfaceTag__, mediaStatus__, connectionInfo__, disassocReason__, deauthReason__) \
1985     msg__ = (CsrWifiSmeMediaStatusInd *) CsrPmemAlloc(sizeof(CsrWifiSmeMediaStatusInd)); \
1986     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_MEDIA_STATUS_IND, dst__, src__); \
1987     msg__->interfaceTag = (interfaceTag__); \
1988     msg__->mediaStatus = (mediaStatus__); \
1989     msg__->connectionInfo = (connectionInfo__); \
1990     msg__->disassocReason = (disassocReason__); \
1991     msg__->deauthReason = (deauthReason__);
1992
1993 #define CsrWifiSmeMediaStatusIndSendTo(dst__, src__, interfaceTag__, mediaStatus__, connectionInfo__, disassocReason__, deauthReason__) \
1994     { \
1995         CsrWifiSmeMediaStatusInd *msg__; \
1996         CsrWifiSmeMediaStatusIndCreate(msg__, dst__, src__, interfaceTag__, mediaStatus__, connectionInfo__, disassocReason__, deauthReason__); \
1997         CsrSchedMessagePut(dst__, CSR_WIFI_SME_PRIM, msg__); \
1998     }
1999
2000 #define CsrWifiSmeMediaStatusIndSend(dst__, interfaceTag__, mediaStatus__, connectionInfo__, disassocReason__, deauthReason__) \
2001     CsrWifiSmeMediaStatusIndSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, interfaceTag__, mediaStatus__, connectionInfo__, disassocReason__, deauthReason__)
2002
2003 /*******************************************************************************
2004
2005   NAME
2006     CsrWifiSmeMibConfigGetReqSend
2007
2008   DESCRIPTION
2009     This primitive gets the value of the MibConfig parameter.
2010
2011   PARAMETERS
2012     queue  - Message Source Task Queue (Cfm's will be sent to this Queue)
2013
2014 *******************************************************************************/
2015 #define CsrWifiSmeMibConfigGetReqCreate(msg__, dst__, src__) \
2016     msg__ = (CsrWifiSmeMibConfigGetReq *) CsrPmemAlloc(sizeof(CsrWifiSmeMibConfigGetReq)); \
2017     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_MIB_CONFIG_GET_REQ, dst__, src__);
2018
2019 #define CsrWifiSmeMibConfigGetReqSendTo(dst__, src__) \
2020     { \
2021         CsrWifiSmeMibConfigGetReq *msg__; \
2022         CsrWifiSmeMibConfigGetReqCreate(msg__, dst__, src__); \
2023         CsrMsgTransport(dst__, CSR_WIFI_SME_PRIM, msg__); \
2024     }
2025
2026 #define CsrWifiSmeMibConfigGetReqSend(src__) \
2027     CsrWifiSmeMibConfigGetReqSendTo(CSR_WIFI_SME_LIB_DESTINATION_QUEUE, src__)
2028
2029 /*******************************************************************************
2030
2031   NAME
2032     CsrWifiSmeMibConfigGetCfmSend
2033
2034   DESCRIPTION
2035     This primitive reports the result of the request.
2036
2037   PARAMETERS
2038     queue     - Destination Task Queue
2039     status    - Reports the result of the request
2040     mibConfig - Reports various IEEE 802.11 attributes as currently configured
2041
2042 *******************************************************************************/
2043 #define CsrWifiSmeMibConfigGetCfmCreate(msg__, dst__, src__, status__, mibConfig__) \
2044     msg__ = (CsrWifiSmeMibConfigGetCfm *) CsrPmemAlloc(sizeof(CsrWifiSmeMibConfigGetCfm)); \
2045     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_MIB_CONFIG_GET_CFM, dst__, src__); \
2046     msg__->status = (status__); \
2047     msg__->mibConfig = (mibConfig__);
2048
2049 #define CsrWifiSmeMibConfigGetCfmSendTo(dst__, src__, status__, mibConfig__) \
2050     { \
2051         CsrWifiSmeMibConfigGetCfm *msg__; \
2052         CsrWifiSmeMibConfigGetCfmCreate(msg__, dst__, src__, status__, mibConfig__); \
2053         CsrSchedMessagePut(dst__, CSR_WIFI_SME_PRIM, msg__); \
2054     }
2055
2056 #define CsrWifiSmeMibConfigGetCfmSend(dst__, status__, mibConfig__) \
2057     CsrWifiSmeMibConfigGetCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, status__, mibConfig__)
2058
2059 /*******************************************************************************
2060
2061   NAME
2062     CsrWifiSmeMibConfigSetReqSend
2063
2064   DESCRIPTION
2065     This primitive sets the value of the MibConfig parameter.
2066
2067   PARAMETERS
2068     queue     - Message Source Task Queue (Cfm's will be sent to this Queue)
2069     mibConfig - Conveys the desired value of various IEEE 802.11 attributes as
2070                 currently configured
2071
2072 *******************************************************************************/
2073 #define CsrWifiSmeMibConfigSetReqCreate(msg__, dst__, src__, mibConfig__) \
2074     msg__ = (CsrWifiSmeMibConfigSetReq *) CsrPmemAlloc(sizeof(CsrWifiSmeMibConfigSetReq)); \
2075     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_MIB_CONFIG_SET_REQ, dst__, src__); \
2076     msg__->mibConfig = (mibConfig__);
2077
2078 #define CsrWifiSmeMibConfigSetReqSendTo(dst__, src__, mibConfig__) \
2079     { \
2080         CsrWifiSmeMibConfigSetReq *msg__; \
2081         CsrWifiSmeMibConfigSetReqCreate(msg__, dst__, src__, mibConfig__); \
2082         CsrMsgTransport(dst__, CSR_WIFI_SME_PRIM, msg__); \
2083     }
2084
2085 #define CsrWifiSmeMibConfigSetReqSend(src__, mibConfig__) \
2086     CsrWifiSmeMibConfigSetReqSendTo(CSR_WIFI_SME_LIB_DESTINATION_QUEUE, src__, mibConfig__)
2087
2088 /*******************************************************************************
2089
2090   NAME
2091     CsrWifiSmeMibConfigSetCfmSend
2092
2093   DESCRIPTION
2094     This primitive reports the result of the request.
2095
2096   PARAMETERS
2097     queue  - Destination Task Queue
2098     status - Reports the result of the request
2099
2100 *******************************************************************************/
2101 #define CsrWifiSmeMibConfigSetCfmCreate(msg__, dst__, src__, status__) \
2102     msg__ = (CsrWifiSmeMibConfigSetCfm *) CsrPmemAlloc(sizeof(CsrWifiSmeMibConfigSetCfm)); \
2103     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_MIB_CONFIG_SET_CFM, dst__, src__); \
2104     msg__->status = (status__);
2105
2106 #define CsrWifiSmeMibConfigSetCfmSendTo(dst__, src__, status__) \
2107     { \
2108         CsrWifiSmeMibConfigSetCfm *msg__; \
2109         CsrWifiSmeMibConfigSetCfmCreate(msg__, dst__, src__, status__); \
2110         CsrSchedMessagePut(dst__, CSR_WIFI_SME_PRIM, msg__); \
2111     }
2112
2113 #define CsrWifiSmeMibConfigSetCfmSend(dst__, status__) \
2114     CsrWifiSmeMibConfigSetCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, status__)
2115
2116 /*******************************************************************************
2117
2118   NAME
2119     CsrWifiSmeMibGetCfmSend
2120
2121   DESCRIPTION
2122     The SME calls this primitive to return the requested MIB variable values.
2123
2124   PARAMETERS
2125     queue              - Destination Task Queue
2126     status             - Reports the result of the request
2127     mibAttributeLength - Length of mibAttribute
2128     mibAttribute       - Points to the VarBind or VarBindList containing the
2129                          names and values of the MIB variables requested
2130
2131 *******************************************************************************/
2132 #define CsrWifiSmeMibGetCfmCreate(msg__, dst__, src__, status__, mibAttributeLength__, mibAttribute__) \
2133     msg__ = (CsrWifiSmeMibGetCfm *) CsrPmemAlloc(sizeof(CsrWifiSmeMibGetCfm)); \
2134     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_MIB_GET_CFM, dst__, src__); \
2135     msg__->status = (status__); \
2136     msg__->mibAttributeLength = (mibAttributeLength__); \
2137     msg__->mibAttribute = (mibAttribute__);
2138
2139 #define CsrWifiSmeMibGetCfmSendTo(dst__, src__, status__, mibAttributeLength__, mibAttribute__) \
2140     { \
2141         CsrWifiSmeMibGetCfm *msg__; \
2142         CsrWifiSmeMibGetCfmCreate(msg__, dst__, src__, status__, mibAttributeLength__, mibAttribute__); \
2143         CsrSchedMessagePut(dst__, CSR_WIFI_SME_PRIM, msg__); \
2144     }
2145
2146 #define CsrWifiSmeMibGetCfmSend(dst__, status__, mibAttributeLength__, mibAttribute__) \
2147     CsrWifiSmeMibGetCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, status__, mibAttributeLength__, mibAttribute__)
2148
2149 /*******************************************************************************
2150
2151   NAME
2152     CsrWifiSmeMibGetNextReqSend
2153
2154   DESCRIPTION
2155     To read a sequence of MIB parameters, for example a table, call this
2156     primitive to find the name of the next MIB variable
2157
2158   PARAMETERS
2159     queue              - Message Source Task Queue (Cfm's will be sent to this Queue)
2160     mibAttributeLength - Length of mibAttribute
2161     mibAttribute       - Points to a VarBind or VarBindList containing the
2162                          name(s) of the MIB variable(s) to search from.
2163
2164 *******************************************************************************/
2165 #define CsrWifiSmeMibGetNextReqCreate(msg__, dst__, src__, mibAttributeLength__, mibAttribute__) \
2166     msg__ = (CsrWifiSmeMibGetNextReq *) CsrPmemAlloc(sizeof(CsrWifiSmeMibGetNextReq)); \
2167     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_MIB_GET_NEXT_REQ, dst__, src__); \
2168     msg__->mibAttributeLength = (mibAttributeLength__); \
2169     msg__->mibAttribute = (mibAttribute__);
2170
2171 #define CsrWifiSmeMibGetNextReqSendTo(dst__, src__, mibAttributeLength__, mibAttribute__) \
2172     { \
2173         CsrWifiSmeMibGetNextReq *msg__; \
2174         CsrWifiSmeMibGetNextReqCreate(msg__, dst__, src__, mibAttributeLength__, mibAttribute__); \
2175         CsrMsgTransport(dst__, CSR_WIFI_SME_PRIM, msg__); \
2176     }
2177
2178 #define CsrWifiSmeMibGetNextReqSend(src__, mibAttributeLength__, mibAttribute__) \
2179     CsrWifiSmeMibGetNextReqSendTo(CSR_WIFI_SME_LIB_DESTINATION_QUEUE, src__, mibAttributeLength__, mibAttribute__)
2180
2181 /*******************************************************************************
2182
2183   NAME
2184     CsrWifiSmeMibGetNextCfmSend
2185
2186   DESCRIPTION
2187     The SME calls this primitive to return the requested MIB name(s).
2188     The wireless manager application can then read the value of the MIB
2189     variable using CSR_WIFI_SME_MIB_GET_REQ, using the names provided.
2190
2191   PARAMETERS
2192     queue              - Destination Task Queue
2193     status             - Reports the result of the request
2194     mibAttributeLength - Length of mibAttribute
2195     mibAttribute       - Points to a VarBind or VarBindList containing the
2196                          name(s) of the MIB variable(s) lexicographically
2197                          following the name(s) given in the request
2198
2199 *******************************************************************************/
2200 #define CsrWifiSmeMibGetNextCfmCreate(msg__, dst__, src__, status__, mibAttributeLength__, mibAttribute__) \
2201     msg__ = (CsrWifiSmeMibGetNextCfm *) CsrPmemAlloc(sizeof(CsrWifiSmeMibGetNextCfm)); \
2202     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_MIB_GET_NEXT_CFM, dst__, src__); \
2203     msg__->status = (status__); \
2204     msg__->mibAttributeLength = (mibAttributeLength__); \
2205     msg__->mibAttribute = (mibAttribute__);
2206
2207 #define CsrWifiSmeMibGetNextCfmSendTo(dst__, src__, status__, mibAttributeLength__, mibAttribute__) \
2208     { \
2209         CsrWifiSmeMibGetNextCfm *msg__; \
2210         CsrWifiSmeMibGetNextCfmCreate(msg__, dst__, src__, status__, mibAttributeLength__, mibAttribute__); \
2211         CsrSchedMessagePut(dst__, CSR_WIFI_SME_PRIM, msg__); \
2212     }
2213
2214 #define CsrWifiSmeMibGetNextCfmSend(dst__, status__, mibAttributeLength__, mibAttribute__) \
2215     CsrWifiSmeMibGetNextCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, status__, mibAttributeLength__, mibAttribute__)
2216
2217 /*******************************************************************************
2218
2219   NAME
2220     CsrWifiSmeMibGetReqSend
2221
2222   DESCRIPTION
2223     The wireless manager application calls this primitive to retrieve one or
2224     more MIB variables.
2225
2226   PARAMETERS
2227     queue              - Message Source Task Queue (Cfm's will be sent to this Queue)
2228     mibAttributeLength - Length of mibAttribute
2229     mibAttribute       - Points to the VarBind or VarBindList containing the
2230                          names of the MIB variables to be retrieved
2231
2232 *******************************************************************************/
2233 #define CsrWifiSmeMibGetReqCreate(msg__, dst__, src__, mibAttributeLength__, mibAttribute__) \
2234     msg__ = (CsrWifiSmeMibGetReq *) CsrPmemAlloc(sizeof(CsrWifiSmeMibGetReq)); \
2235     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_MIB_GET_REQ, dst__, src__); \
2236     msg__->mibAttributeLength = (mibAttributeLength__); \
2237     msg__->mibAttribute = (mibAttribute__);
2238
2239 #define CsrWifiSmeMibGetReqSendTo(dst__, src__, mibAttributeLength__, mibAttribute__) \
2240     { \
2241         CsrWifiSmeMibGetReq *msg__; \
2242         CsrWifiSmeMibGetReqCreate(msg__, dst__, src__, mibAttributeLength__, mibAttribute__); \
2243         CsrMsgTransport(dst__, CSR_WIFI_SME_PRIM, msg__); \
2244     }
2245
2246 #define CsrWifiSmeMibGetReqSend(src__, mibAttributeLength__, mibAttribute__) \
2247     CsrWifiSmeMibGetReqSendTo(CSR_WIFI_SME_LIB_DESTINATION_QUEUE, src__, mibAttributeLength__, mibAttribute__)
2248
2249 /*******************************************************************************
2250
2251   NAME
2252     CsrWifiSmeMibSetReqSend
2253
2254   DESCRIPTION
2255     The SME provides raw access to the MIB on the chip, which may be used by
2256     some configuration or diagnostic utilities, but is not normally needed by
2257     the wireless manager application.
2258     The MIB access functions use BER encoded names (OID) of the MIB
2259     parameters and BER encoded values, as described in the chip Host
2260     Interface Protocol Specification.
2261     The MIB parameters are described in 'Wi-Fi 5.0.0 Management Information
2262     Base Reference Guide'.
2263     The wireless manager application calls this primitive to set one or more
2264     MIB variables
2265
2266   PARAMETERS
2267     queue              - Message Source Task Queue (Cfm's will be sent to this Queue)
2268     mibAttributeLength - Length of mibAttribute
2269     mibAttribute       - Points to the VarBind or VarBindList containing the
2270                          names and values of the MIB variables to set
2271
2272 *******************************************************************************/
2273 #define CsrWifiSmeMibSetReqCreate(msg__, dst__, src__, mibAttributeLength__, mibAttribute__) \
2274     msg__ = (CsrWifiSmeMibSetReq *) CsrPmemAlloc(sizeof(CsrWifiSmeMibSetReq)); \
2275     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_MIB_SET_REQ, dst__, src__); \
2276     msg__->mibAttributeLength = (mibAttributeLength__); \
2277     msg__->mibAttribute = (mibAttribute__);
2278
2279 #define CsrWifiSmeMibSetReqSendTo(dst__, src__, mibAttributeLength__, mibAttribute__) \
2280     { \
2281         CsrWifiSmeMibSetReq *msg__; \
2282         CsrWifiSmeMibSetReqCreate(msg__, dst__, src__, mibAttributeLength__, mibAttribute__); \
2283         CsrMsgTransport(dst__, CSR_WIFI_SME_PRIM, msg__); \
2284     }
2285
2286 #define CsrWifiSmeMibSetReqSend(src__, mibAttributeLength__, mibAttribute__) \
2287     CsrWifiSmeMibSetReqSendTo(CSR_WIFI_SME_LIB_DESTINATION_QUEUE, src__, mibAttributeLength__, mibAttribute__)
2288
2289 /*******************************************************************************
2290
2291   NAME
2292     CsrWifiSmeMibSetCfmSend
2293
2294   DESCRIPTION
2295     The SME calls the primitive to report the result of the set primitive.
2296
2297   PARAMETERS
2298     queue  - Destination Task Queue
2299     status - Reports the result of the request
2300
2301 *******************************************************************************/
2302 #define CsrWifiSmeMibSetCfmCreate(msg__, dst__, src__, status__) \
2303     msg__ = (CsrWifiSmeMibSetCfm *) CsrPmemAlloc(sizeof(CsrWifiSmeMibSetCfm)); \
2304     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_MIB_SET_CFM, dst__, src__); \
2305     msg__->status = (status__);
2306
2307 #define CsrWifiSmeMibSetCfmSendTo(dst__, src__, status__) \
2308     { \
2309         CsrWifiSmeMibSetCfm *msg__; \
2310         CsrWifiSmeMibSetCfmCreate(msg__, dst__, src__, status__); \
2311         CsrSchedMessagePut(dst__, CSR_WIFI_SME_PRIM, msg__); \
2312     }
2313
2314 #define CsrWifiSmeMibSetCfmSend(dst__, status__) \
2315     CsrWifiSmeMibSetCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, status__)
2316
2317 /*******************************************************************************
2318
2319   NAME
2320     CsrWifiSmeMicFailureIndSend
2321
2322   DESCRIPTION
2323     The SME sends this primitive to all the tasks that have registered to
2324     receive it whenever the chip firmware reports a MIC failure.
2325
2326   PARAMETERS
2327     queue         - Destination Task Queue
2328     interfaceTag  - Interface Identifier; unique identifier of an interface
2329     secondFailure - TRUE if this indication is for a second failure in 60
2330                     seconds
2331     count         - The number of MIC failure events since the connection was
2332                     established
2333     address       - MAC address of the transmitter that caused the MIC failure
2334     keyType       - Type of key for which the failure occurred
2335
2336 *******************************************************************************/
2337 #define CsrWifiSmeMicFailureIndCreate(msg__, dst__, src__, interfaceTag__, secondFailure__, count__, address__, keyType__) \
2338     msg__ = (CsrWifiSmeMicFailureInd *) CsrPmemAlloc(sizeof(CsrWifiSmeMicFailureInd)); \
2339     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_MIC_FAILURE_IND, dst__, src__); \
2340     msg__->interfaceTag = (interfaceTag__); \
2341     msg__->secondFailure = (secondFailure__); \
2342     msg__->count = (count__); \
2343     msg__->address = (address__); \
2344     msg__->keyType = (keyType__);
2345
2346 #define CsrWifiSmeMicFailureIndSendTo(dst__, src__, interfaceTag__, secondFailure__, count__, address__, keyType__) \
2347     { \
2348         CsrWifiSmeMicFailureInd *msg__; \
2349         CsrWifiSmeMicFailureIndCreate(msg__, dst__, src__, interfaceTag__, secondFailure__, count__, address__, keyType__); \
2350         CsrSchedMessagePut(dst__, CSR_WIFI_SME_PRIM, msg__); \
2351     }
2352
2353 #define CsrWifiSmeMicFailureIndSend(dst__, interfaceTag__, secondFailure__, count__, address__, keyType__) \
2354     CsrWifiSmeMicFailureIndSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, interfaceTag__, secondFailure__, count__, address__, keyType__)
2355
2356 /*******************************************************************************
2357
2358   NAME
2359     CsrWifiSmeMulticastAddressReqSend
2360
2361   DESCRIPTION
2362     The wireless manager application calls this primitive to specify the
2363     multicast addresses which the chip should recognise. The interface allows
2364     the wireless manager application to query, add, remove and flush the
2365     multicast addresses for the network interface according to the specified
2366     action.
2367
2368   PARAMETERS
2369     queue             - Message Source Task Queue (Cfm's will be sent to this Queue)
2370     interfaceTag      - Interface Identifier; unique identifier of an interface
2371     action            - The value of the CsrWifiSmeListAction parameter
2372                         instructs the driver to modify or provide the list of
2373                         MAC addresses.
2374     setAddressesCount - Number of MAC addresses sent with the primitive
2375     setAddresses      - Pointer to the list of MAC Addresses sent with the
2376                         primitive, set to NULL if none is sent.
2377
2378 *******************************************************************************/
2379 #define CsrWifiSmeMulticastAddressReqCreate(msg__, dst__, src__, interfaceTag__, action__, setAddressesCount__, setAddresses__) \
2380     msg__ = (CsrWifiSmeMulticastAddressReq *) CsrPmemAlloc(sizeof(CsrWifiSmeMulticastAddressReq)); \
2381     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_MULTICAST_ADDRESS_REQ, dst__, src__); \
2382     msg__->interfaceTag = (interfaceTag__); \
2383     msg__->action = (action__); \
2384     msg__->setAddressesCount = (setAddressesCount__); \
2385     msg__->setAddresses = (setAddresses__);
2386
2387 #define CsrWifiSmeMulticastAddressReqSendTo(dst__, src__, interfaceTag__, action__, setAddressesCount__, setAddresses__) \
2388     { \
2389         CsrWifiSmeMulticastAddressReq *msg__; \
2390         CsrWifiSmeMulticastAddressReqCreate(msg__, dst__, src__, interfaceTag__, action__, setAddressesCount__, setAddresses__); \
2391         CsrMsgTransport(dst__, CSR_WIFI_SME_PRIM, msg__); \
2392     }
2393
2394 #define CsrWifiSmeMulticastAddressReqSend(src__, interfaceTag__, action__, setAddressesCount__, setAddresses__) \
2395     CsrWifiSmeMulticastAddressReqSendTo(CSR_WIFI_SME_LIB_DESTINATION_QUEUE, src__, interfaceTag__, action__, setAddressesCount__, setAddresses__)
2396
2397 /*******************************************************************************
2398
2399   NAME
2400     CsrWifiSmeMulticastAddressCfmSend
2401
2402   DESCRIPTION
2403     The SME will call this primitive when the operation is complete. For a
2404     GET action, this primitive reports the current list of MAC addresses.
2405
2406   PARAMETERS
2407     queue             - Destination Task Queue
2408     interfaceTag      - Interface Identifier; unique identifier of an interface
2409     status            - Reports the result of the request
2410     action            - Action in the request
2411     getAddressesCount - This parameter is only relevant if action is
2412                         CSR_WIFI_SME_LIST_ACTION_GET:
2413                         number of MAC addresses sent with the primitive
2414     getAddresses      - Pointer to the list of MAC Addresses sent with the
2415                         primitive, set to NULL if none is sent.
2416
2417 *******************************************************************************/
2418 #define CsrWifiSmeMulticastAddressCfmCreate(msg__, dst__, src__, interfaceTag__, status__, action__, getAddressesCount__, getAddresses__) \
2419     msg__ = (CsrWifiSmeMulticastAddressCfm *) CsrPmemAlloc(sizeof(CsrWifiSmeMulticastAddressCfm)); \
2420     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_MULTICAST_ADDRESS_CFM, dst__, src__); \
2421     msg__->interfaceTag = (interfaceTag__); \
2422     msg__->status = (status__); \
2423     msg__->action = (action__); \
2424     msg__->getAddressesCount = (getAddressesCount__); \
2425     msg__->getAddresses = (getAddresses__);
2426
2427 #define CsrWifiSmeMulticastAddressCfmSendTo(dst__, src__, interfaceTag__, status__, action__, getAddressesCount__, getAddresses__) \
2428     { \
2429         CsrWifiSmeMulticastAddressCfm *msg__; \
2430         CsrWifiSmeMulticastAddressCfmCreate(msg__, dst__, src__, interfaceTag__, status__, action__, getAddressesCount__, getAddresses__); \
2431         CsrSchedMessagePut(dst__, CSR_WIFI_SME_PRIM, msg__); \
2432     }
2433
2434 #define CsrWifiSmeMulticastAddressCfmSend(dst__, interfaceTag__, status__, action__, getAddressesCount__, getAddresses__) \
2435     CsrWifiSmeMulticastAddressCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, interfaceTag__, status__, action__, getAddressesCount__, getAddresses__)
2436
2437 /*******************************************************************************
2438
2439   NAME
2440     CsrWifiSmePacketFilterSetReqSend
2441
2442   DESCRIPTION
2443     The wireless manager application should call this primitive to enable or
2444     disable filtering of broadcast packets: uninteresting broadcast packets
2445     will be dropped by the Wi-Fi chip, instead of passing them up to the
2446     host.
2447     This has the advantage of saving power in the host application processor
2448     as it removes the need to process unwanted packets.
2449     All broadcast packets are filtered according to the filter and the filter
2450     mode provided, except ARP packets, which are filtered using
2451     arpFilterAddress.
2452     Filters are not cumulative: only the parameters specified in the most
2453     recent successful request are significant.
2454     For more information, see 'UniFi Firmware API Specification'.
2455
2456   PARAMETERS
2457     queue            - Message Source Task Queue (Cfm's will be sent to this Queue)
2458     interfaceTag     - Interface Identifier; unique identifier of an interface
2459     filterLength     - Length of the filter in bytes.
2460                        filterLength=0 disables the filter previously set
2461     filter           - Points to the first byte of the filter provided, if any.
2462                        This shall include zero or more instance of the
2463                        information elements of one of these types
2464                          * Traffic Classification (TCLAS) elements
2465                          * WMM-SA TCLAS elements
2466     mode             - Specifies whether the filter selects or excludes packets
2467                        matching the filter
2468     arpFilterAddress - IPv4 address to be used for filtering the ARP packets.
2469                          * If the specified address is the IPv4 broadcast address
2470                            (255.255.255.255), all ARP packets are reported to the
2471                            host,
2472                          * If the specified address is NOT the IPv4 broadcast
2473                            address, only ARP packets with the specified address in
2474                            the Source or Target Protocol Address fields are reported
2475                            to the host
2476
2477 *******************************************************************************/
2478 #define CsrWifiSmePacketFilterSetReqCreate(msg__, dst__, src__, interfaceTag__, filterLength__, filter__, mode__, arpFilterAddress__) \
2479     msg__ = (CsrWifiSmePacketFilterSetReq *) CsrPmemAlloc(sizeof(CsrWifiSmePacketFilterSetReq)); \
2480     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_PACKET_FILTER_SET_REQ, dst__, src__); \
2481     msg__->interfaceTag = (interfaceTag__); \
2482     msg__->filterLength = (filterLength__); \
2483     msg__->filter = (filter__); \
2484     msg__->mode = (mode__); \
2485     msg__->arpFilterAddress = (arpFilterAddress__);
2486
2487 #define CsrWifiSmePacketFilterSetReqSendTo(dst__, src__, interfaceTag__, filterLength__, filter__, mode__, arpFilterAddress__) \
2488     { \
2489         CsrWifiSmePacketFilterSetReq *msg__; \
2490         CsrWifiSmePacketFilterSetReqCreate(msg__, dst__, src__, interfaceTag__, filterLength__, filter__, mode__, arpFilterAddress__); \
2491         CsrMsgTransport(dst__, CSR_WIFI_SME_PRIM, msg__); \
2492     }
2493
2494 #define CsrWifiSmePacketFilterSetReqSend(src__, interfaceTag__, filterLength__, filter__, mode__, arpFilterAddress__) \
2495     CsrWifiSmePacketFilterSetReqSendTo(CSR_WIFI_SME_LIB_DESTINATION_QUEUE, src__, interfaceTag__, filterLength__, filter__, mode__, arpFilterAddress__)
2496
2497 /*******************************************************************************
2498
2499   NAME
2500     CsrWifiSmePacketFilterSetCfmSend
2501
2502   DESCRIPTION
2503     The SME calls the primitive to report the result of the set primitive.
2504
2505   PARAMETERS
2506     queue        - Destination Task Queue
2507     interfaceTag - Interface Identifier; unique identifier of an interface
2508     status       - Reports the result of the request
2509
2510 *******************************************************************************/
2511 #define CsrWifiSmePacketFilterSetCfmCreate(msg__, dst__, src__, interfaceTag__, status__) \
2512     msg__ = (CsrWifiSmePacketFilterSetCfm *) CsrPmemAlloc(sizeof(CsrWifiSmePacketFilterSetCfm)); \
2513     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_PACKET_FILTER_SET_CFM, dst__, src__); \
2514     msg__->interfaceTag = (interfaceTag__); \
2515     msg__->status = (status__);
2516
2517 #define CsrWifiSmePacketFilterSetCfmSendTo(dst__, src__, interfaceTag__, status__) \
2518     { \
2519         CsrWifiSmePacketFilterSetCfm *msg__; \
2520         CsrWifiSmePacketFilterSetCfmCreate(msg__, dst__, src__, interfaceTag__, status__); \
2521         CsrSchedMessagePut(dst__, CSR_WIFI_SME_PRIM, msg__); \
2522     }
2523
2524 #define CsrWifiSmePacketFilterSetCfmSend(dst__, interfaceTag__, status__) \
2525     CsrWifiSmePacketFilterSetCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, interfaceTag__, status__)
2526
2527 /*******************************************************************************
2528
2529   NAME
2530     CsrWifiSmePermanentMacAddressGetReqSend
2531
2532   DESCRIPTION
2533     This primitive retrieves the MAC address stored in EEPROM
2534
2535   PARAMETERS
2536     queue  - Message Source Task Queue (Cfm's will be sent to this Queue)
2537
2538 *******************************************************************************/
2539 #define CsrWifiSmePermanentMacAddressGetReqCreate(msg__, dst__, src__) \
2540     msg__ = (CsrWifiSmePermanentMacAddressGetReq *) CsrPmemAlloc(sizeof(CsrWifiSmePermanentMacAddressGetReq)); \
2541     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_PERMANENT_MAC_ADDRESS_GET_REQ, dst__, src__);
2542
2543 #define CsrWifiSmePermanentMacAddressGetReqSendTo(dst__, src__) \
2544     { \
2545         CsrWifiSmePermanentMacAddressGetReq *msg__; \
2546         CsrWifiSmePermanentMacAddressGetReqCreate(msg__, dst__, src__); \
2547         CsrMsgTransport(dst__, CSR_WIFI_SME_PRIM, msg__); \
2548     }
2549
2550 #define CsrWifiSmePermanentMacAddressGetReqSend(src__) \
2551     CsrWifiSmePermanentMacAddressGetReqSendTo(CSR_WIFI_SME_LIB_DESTINATION_QUEUE, src__)
2552
2553 /*******************************************************************************
2554
2555   NAME
2556     CsrWifiSmePermanentMacAddressGetCfmSend
2557
2558   DESCRIPTION
2559     This primitive reports the result of the request.
2560
2561   PARAMETERS
2562     queue               - Destination Task Queue
2563     status              - Reports the result of the request
2564     permanentMacAddress - MAC address stored in the EEPROM
2565
2566 *******************************************************************************/
2567 #define CsrWifiSmePermanentMacAddressGetCfmCreate(msg__, dst__, src__, status__, permanentMacAddress__) \
2568     msg__ = (CsrWifiSmePermanentMacAddressGetCfm *) CsrPmemAlloc(sizeof(CsrWifiSmePermanentMacAddressGetCfm)); \
2569     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_PERMANENT_MAC_ADDRESS_GET_CFM, dst__, src__); \
2570     msg__->status = (status__); \
2571     msg__->permanentMacAddress = (permanentMacAddress__);
2572
2573 #define CsrWifiSmePermanentMacAddressGetCfmSendTo(dst__, src__, status__, permanentMacAddress__) \
2574     { \
2575         CsrWifiSmePermanentMacAddressGetCfm *msg__; \
2576         CsrWifiSmePermanentMacAddressGetCfmCreate(msg__, dst__, src__, status__, permanentMacAddress__); \
2577         CsrSchedMessagePut(dst__, CSR_WIFI_SME_PRIM, msg__); \
2578     }
2579
2580 #define CsrWifiSmePermanentMacAddressGetCfmSend(dst__, status__, permanentMacAddress__) \
2581     CsrWifiSmePermanentMacAddressGetCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, status__, permanentMacAddress__)
2582
2583 /*******************************************************************************
2584
2585   NAME
2586     CsrWifiSmePmkidCandidateListIndSend
2587
2588   DESCRIPTION
2589     The SME will send this primitive to all the tasks that have registered to
2590     receive it when a new network supporting preauthentication and/or PMK
2591     caching is seen.
2592
2593   PARAMETERS
2594     queue                - Destination Task Queue
2595     interfaceTag         - Interface Identifier; unique identifier of an
2596                            interface
2597     pmkidCandidatesCount - Number of PMKID candidates provided
2598     pmkidCandidates      - Points to the first PMKID candidate
2599
2600 *******************************************************************************/
2601 #define CsrWifiSmePmkidCandidateListIndCreate(msg__, dst__, src__, interfaceTag__, pmkidCandidatesCount__, pmkidCandidates__) \
2602     msg__ = (CsrWifiSmePmkidCandidateListInd *) CsrPmemAlloc(sizeof(CsrWifiSmePmkidCandidateListInd)); \
2603     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_PMKID_CANDIDATE_LIST_IND, dst__, src__); \
2604     msg__->interfaceTag = (interfaceTag__); \
2605     msg__->pmkidCandidatesCount = (pmkidCandidatesCount__); \
2606     msg__->pmkidCandidates = (pmkidCandidates__);
2607
2608 #define CsrWifiSmePmkidCandidateListIndSendTo(dst__, src__, interfaceTag__, pmkidCandidatesCount__, pmkidCandidates__) \
2609     { \
2610         CsrWifiSmePmkidCandidateListInd *msg__; \
2611         CsrWifiSmePmkidCandidateListIndCreate(msg__, dst__, src__, interfaceTag__, pmkidCandidatesCount__, pmkidCandidates__); \
2612         CsrSchedMessagePut(dst__, CSR_WIFI_SME_PRIM, msg__); \
2613     }
2614
2615 #define CsrWifiSmePmkidCandidateListIndSend(dst__, interfaceTag__, pmkidCandidatesCount__, pmkidCandidates__) \
2616     CsrWifiSmePmkidCandidateListIndSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, interfaceTag__, pmkidCandidatesCount__, pmkidCandidates__)
2617
2618 /*******************************************************************************
2619
2620   NAME
2621     CsrWifiSmePmkidReqSend
2622
2623   DESCRIPTION
2624     The wireless manager application calls this primitive to request an
2625     operation on the SME PMKID list.
2626     The action argument specifies the operation to perform.
2627     When the connection is complete, the wireless manager application may
2628     then send and receive EAPOL packets to complete WPA or WPA2
2629     authentication if appropriate.
2630     The wireless manager application can then pass the resulting encryption
2631     keys using this primitive.
2632
2633   PARAMETERS
2634     queue          - Message Source Task Queue (Cfm's will be sent to this Queue)
2635     interfaceTag   - Interface Identifier; unique identifier of an interface
2636     action         - The value of the CsrWifiSmeListAction parameter instructs
2637                      the driver to modify or provide the list of PMKIDs.
2638     setPmkidsCount - Number of PMKIDs sent with the primitive
2639     setPmkids      - Pointer to the list of PMKIDs sent with the primitive, set
2640                      to NULL if none is sent.
2641
2642 *******************************************************************************/
2643 #define CsrWifiSmePmkidReqCreate(msg__, dst__, src__, interfaceTag__, action__, setPmkidsCount__, setPmkids__) \
2644     msg__ = (CsrWifiSmePmkidReq *) CsrPmemAlloc(sizeof(CsrWifiSmePmkidReq)); \
2645     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_PMKID_REQ, dst__, src__); \
2646     msg__->interfaceTag = (interfaceTag__); \
2647     msg__->action = (action__); \
2648     msg__->setPmkidsCount = (setPmkidsCount__); \
2649     msg__->setPmkids = (setPmkids__);
2650
2651 #define CsrWifiSmePmkidReqSendTo(dst__, src__, interfaceTag__, action__, setPmkidsCount__, setPmkids__) \
2652     { \
2653         CsrWifiSmePmkidReq *msg__; \
2654         CsrWifiSmePmkidReqCreate(msg__, dst__, src__, interfaceTag__, action__, setPmkidsCount__, setPmkids__); \
2655         CsrMsgTransport(dst__, CSR_WIFI_SME_PRIM, msg__); \
2656     }
2657
2658 #define CsrWifiSmePmkidReqSend(src__, interfaceTag__, action__, setPmkidsCount__, setPmkids__) \
2659     CsrWifiSmePmkidReqSendTo(CSR_WIFI_SME_LIB_DESTINATION_QUEUE, src__, interfaceTag__, action__, setPmkidsCount__, setPmkids__)
2660
2661 /*******************************************************************************
2662
2663   NAME
2664     CsrWifiSmePmkidCfmSend
2665
2666   DESCRIPTION
2667     The SME will call this primitive when the operation is complete. For a
2668     GET action, this primitive reports the current list of PMKIDs
2669
2670   PARAMETERS
2671     queue          - Destination Task Queue
2672     interfaceTag   - Interface Identifier; unique identifier of an interface
2673     status         - Reports the result of the request
2674     action         - Action in the request
2675     getPmkidsCount - This parameter is only relevant if action is
2676                      CSR_WIFI_SME_LIST_ACTION_GET:
2677                      number of PMKIDs sent with the primitive
2678     getPmkids      - Pointer to the list of PMKIDs sent with the primitive, set
2679                      to NULL if none is sent.
2680
2681 *******************************************************************************/
2682 #define CsrWifiSmePmkidCfmCreate(msg__, dst__, src__, interfaceTag__, status__, action__, getPmkidsCount__, getPmkids__) \
2683     msg__ = (CsrWifiSmePmkidCfm *) CsrPmemAlloc(sizeof(CsrWifiSmePmkidCfm)); \
2684     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_PMKID_CFM, dst__, src__); \
2685     msg__->interfaceTag = (interfaceTag__); \
2686     msg__->status = (status__); \
2687     msg__->action = (action__); \
2688     msg__->getPmkidsCount = (getPmkidsCount__); \
2689     msg__->getPmkids = (getPmkids__);
2690
2691 #define CsrWifiSmePmkidCfmSendTo(dst__, src__, interfaceTag__, status__, action__, getPmkidsCount__, getPmkids__) \
2692     { \
2693         CsrWifiSmePmkidCfm *msg__; \
2694         CsrWifiSmePmkidCfmCreate(msg__, dst__, src__, interfaceTag__, status__, action__, getPmkidsCount__, getPmkids__); \
2695         CsrSchedMessagePut(dst__, CSR_WIFI_SME_PRIM, msg__); \
2696     }
2697
2698 #define CsrWifiSmePmkidCfmSend(dst__, interfaceTag__, status__, action__, getPmkidsCount__, getPmkids__) \
2699     CsrWifiSmePmkidCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, interfaceTag__, status__, action__, getPmkidsCount__, getPmkids__)
2700
2701 /*******************************************************************************
2702
2703   NAME
2704     CsrWifiSmePowerConfigGetReqSend
2705
2706   DESCRIPTION
2707     This primitive gets the value of the PowerConfig parameter.
2708
2709   PARAMETERS
2710     queue  - Message Source Task Queue (Cfm's will be sent to this Queue)
2711
2712 *******************************************************************************/
2713 #define CsrWifiSmePowerConfigGetReqCreate(msg__, dst__, src__) \
2714     msg__ = (CsrWifiSmePowerConfigGetReq *) CsrPmemAlloc(sizeof(CsrWifiSmePowerConfigGetReq)); \
2715     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_POWER_CONFIG_GET_REQ, dst__, src__);
2716
2717 #define CsrWifiSmePowerConfigGetReqSendTo(dst__, src__) \
2718     { \
2719         CsrWifiSmePowerConfigGetReq *msg__; \
2720         CsrWifiSmePowerConfigGetReqCreate(msg__, dst__, src__); \
2721         CsrMsgTransport(dst__, CSR_WIFI_SME_PRIM, msg__); \
2722     }
2723
2724 #define CsrWifiSmePowerConfigGetReqSend(src__) \
2725     CsrWifiSmePowerConfigGetReqSendTo(CSR_WIFI_SME_LIB_DESTINATION_QUEUE, src__)
2726
2727 /*******************************************************************************
2728
2729   NAME
2730     CsrWifiSmePowerConfigGetCfmSend
2731
2732   DESCRIPTION
2733     This primitive reports the result of the request.
2734
2735   PARAMETERS
2736     queue       - Destination Task Queue
2737     status      - Reports the result of the request
2738     powerConfig - Returns the current parameters for the power configuration of
2739                   the firmware
2740
2741 *******************************************************************************/
2742 #define CsrWifiSmePowerConfigGetCfmCreate(msg__, dst__, src__, status__, powerConfig__) \
2743     msg__ = (CsrWifiSmePowerConfigGetCfm *) CsrPmemAlloc(sizeof(CsrWifiSmePowerConfigGetCfm)); \
2744     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_POWER_CONFIG_GET_CFM, dst__, src__); \
2745     msg__->status = (status__); \
2746     msg__->powerConfig = (powerConfig__);
2747
2748 #define CsrWifiSmePowerConfigGetCfmSendTo(dst__, src__, status__, powerConfig__) \
2749     { \
2750         CsrWifiSmePowerConfigGetCfm *msg__; \
2751         CsrWifiSmePowerConfigGetCfmCreate(msg__, dst__, src__, status__, powerConfig__); \
2752         CsrSchedMessagePut(dst__, CSR_WIFI_SME_PRIM, msg__); \
2753     }
2754
2755 #define CsrWifiSmePowerConfigGetCfmSend(dst__, status__, powerConfig__) \
2756     CsrWifiSmePowerConfigGetCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, status__, powerConfig__)
2757
2758 /*******************************************************************************
2759
2760   NAME
2761     CsrWifiSmePowerConfigSetReqSend
2762
2763   DESCRIPTION
2764     This primitive sets the value of the PowerConfig parameter.
2765
2766   PARAMETERS
2767     queue       - Message Source Task Queue (Cfm's will be sent to this Queue)
2768     powerConfig - Power saving configuration
2769
2770 *******************************************************************************/
2771 #define CsrWifiSmePowerConfigSetReqCreate(msg__, dst__, src__, powerConfig__) \
2772     msg__ = (CsrWifiSmePowerConfigSetReq *) CsrPmemAlloc(sizeof(CsrWifiSmePowerConfigSetReq)); \
2773     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_POWER_CONFIG_SET_REQ, dst__, src__); \
2774     msg__->powerConfig = (powerConfig__);
2775
2776 #define CsrWifiSmePowerConfigSetReqSendTo(dst__, src__, powerConfig__) \
2777     { \
2778         CsrWifiSmePowerConfigSetReq *msg__; \
2779         CsrWifiSmePowerConfigSetReqCreate(msg__, dst__, src__, powerConfig__); \
2780         CsrMsgTransport(dst__, CSR_WIFI_SME_PRIM, msg__); \
2781     }
2782
2783 #define CsrWifiSmePowerConfigSetReqSend(src__, powerConfig__) \
2784     CsrWifiSmePowerConfigSetReqSendTo(CSR_WIFI_SME_LIB_DESTINATION_QUEUE, src__, powerConfig__)
2785
2786 /*******************************************************************************
2787
2788   NAME
2789     CsrWifiSmePowerConfigSetCfmSend
2790
2791   DESCRIPTION
2792     This primitive reports the result of the request.
2793
2794   PARAMETERS
2795     queue  - Destination Task Queue
2796     status - Reports the result of the request
2797
2798 *******************************************************************************/
2799 #define CsrWifiSmePowerConfigSetCfmCreate(msg__, dst__, src__, status__) \
2800     msg__ = (CsrWifiSmePowerConfigSetCfm *) CsrPmemAlloc(sizeof(CsrWifiSmePowerConfigSetCfm)); \
2801     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_POWER_CONFIG_SET_CFM, dst__, src__); \
2802     msg__->status = (status__);
2803
2804 #define CsrWifiSmePowerConfigSetCfmSendTo(dst__, src__, status__) \
2805     { \
2806         CsrWifiSmePowerConfigSetCfm *msg__; \
2807         CsrWifiSmePowerConfigSetCfmCreate(msg__, dst__, src__, status__); \
2808         CsrSchedMessagePut(dst__, CSR_WIFI_SME_PRIM, msg__); \
2809     }
2810
2811 #define CsrWifiSmePowerConfigSetCfmSend(dst__, status__) \
2812     CsrWifiSmePowerConfigSetCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, status__)
2813
2814 /*******************************************************************************
2815
2816   NAME
2817     CsrWifiSmeRegulatoryDomainInfoGetReqSend
2818
2819   DESCRIPTION
2820     This primitive gets the value of the RegulatoryDomainInfo parameter.
2821
2822   PARAMETERS
2823     queue  - Message Source Task Queue (Cfm's will be sent to this Queue)
2824
2825 *******************************************************************************/
2826 #define CsrWifiSmeRegulatoryDomainInfoGetReqCreate(msg__, dst__, src__) \
2827     msg__ = (CsrWifiSmeRegulatoryDomainInfoGetReq *) CsrPmemAlloc(sizeof(CsrWifiSmeRegulatoryDomainInfoGetReq)); \
2828     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_REGULATORY_DOMAIN_INFO_GET_REQ, dst__, src__);
2829
2830 #define CsrWifiSmeRegulatoryDomainInfoGetReqSendTo(dst__, src__) \
2831     { \
2832         CsrWifiSmeRegulatoryDomainInfoGetReq *msg__; \
2833         CsrWifiSmeRegulatoryDomainInfoGetReqCreate(msg__, dst__, src__); \
2834         CsrMsgTransport(dst__, CSR_WIFI_SME_PRIM, msg__); \
2835     }
2836
2837 #define CsrWifiSmeRegulatoryDomainInfoGetReqSend(src__) \
2838     CsrWifiSmeRegulatoryDomainInfoGetReqSendTo(CSR_WIFI_SME_LIB_DESTINATION_QUEUE, src__)
2839
2840 /*******************************************************************************
2841
2842   NAME
2843     CsrWifiSmeRegulatoryDomainInfoGetCfmSend
2844
2845   DESCRIPTION
2846     This primitive reports the result of the request.
2847
2848   PARAMETERS
2849     queue      - Destination Task Queue
2850     status     - Reports the result of the request
2851     regDomInfo - Reports information and state related to regulatory domain
2852                  operation.
2853
2854 *******************************************************************************/
2855 #define CsrWifiSmeRegulatoryDomainInfoGetCfmCreate(msg__, dst__, src__, status__, regDomInfo__) \
2856     msg__ = (CsrWifiSmeRegulatoryDomainInfoGetCfm *) CsrPmemAlloc(sizeof(CsrWifiSmeRegulatoryDomainInfoGetCfm)); \
2857     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_REGULATORY_DOMAIN_INFO_GET_CFM, dst__, src__); \
2858     msg__->status = (status__); \
2859     msg__->regDomInfo = (regDomInfo__);
2860
2861 #define CsrWifiSmeRegulatoryDomainInfoGetCfmSendTo(dst__, src__, status__, regDomInfo__) \
2862     { \
2863         CsrWifiSmeRegulatoryDomainInfoGetCfm *msg__; \
2864         CsrWifiSmeRegulatoryDomainInfoGetCfmCreate(msg__, dst__, src__, status__, regDomInfo__); \
2865         CsrSchedMessagePut(dst__, CSR_WIFI_SME_PRIM, msg__); \
2866     }
2867
2868 #define CsrWifiSmeRegulatoryDomainInfoGetCfmSend(dst__, status__, regDomInfo__) \
2869     CsrWifiSmeRegulatoryDomainInfoGetCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, status__, regDomInfo__)
2870
2871 /*******************************************************************************
2872
2873   NAME
2874     CsrWifiSmeRoamCompleteIndSend
2875
2876   DESCRIPTION
2877     The SME will send this primitive to all the tasks that have registered to
2878     receive it whenever it completes an attempt to roam to an AP. If the roam
2879     attempt was successful, status will be set to CSR_WIFI_SME_SUCCESS,
2880     otherwise it shall be set to the appropriate error code.
2881
2882   PARAMETERS
2883     queue        - Destination Task Queue
2884     interfaceTag - Interface Identifier; unique identifier of an interface
2885     status       - Reports the result of the roaming procedure
2886
2887 *******************************************************************************/
2888 #define CsrWifiSmeRoamCompleteIndCreate(msg__, dst__, src__, interfaceTag__, status__) \
2889     msg__ = (CsrWifiSmeRoamCompleteInd *) CsrPmemAlloc(sizeof(CsrWifiSmeRoamCompleteInd)); \
2890     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_ROAM_COMPLETE_IND, dst__, src__); \
2891     msg__->interfaceTag = (interfaceTag__); \
2892     msg__->status = (status__);
2893
2894 #define CsrWifiSmeRoamCompleteIndSendTo(dst__, src__, interfaceTag__, status__) \
2895     { \
2896         CsrWifiSmeRoamCompleteInd *msg__; \
2897         CsrWifiSmeRoamCompleteIndCreate(msg__, dst__, src__, interfaceTag__, status__); \
2898         CsrSchedMessagePut(dst__, CSR_WIFI_SME_PRIM, msg__); \
2899     }
2900
2901 #define CsrWifiSmeRoamCompleteIndSend(dst__, interfaceTag__, status__) \
2902     CsrWifiSmeRoamCompleteIndSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, interfaceTag__, status__)
2903
2904 /*******************************************************************************
2905
2906   NAME
2907     CsrWifiSmeRoamStartIndSend
2908
2909   DESCRIPTION
2910     The SME will send this primitive to all the tasks that have registered to
2911     receive it whenever it begins an attempt to roam to an AP.
2912     If the wireless manager application connect request specified the SSID
2913     and the BSSID was set to the broadcast address (0xFF 0xFF 0xFF 0xFF 0xFF
2914     0xFF), the SME monitors the signal quality and maintains a list of
2915     candidates to roam to. When the signal quality of the current connection
2916     falls below a threshold, and there is a candidate with better quality,
2917     the SME will attempt to the candidate AP.
2918     If the roaming procedure succeeds, the SME will also issue a Media
2919     Connect indication to inform the wireless manager application of the
2920     change.
2921     NOTE: to prevent the SME from initiating roaming the WMA must specify the
2922     BSSID in the connection request; this forces the SME to connect only to
2923     that AP.
2924     The wireless manager application can obtain statistics for roaming
2925     purposes using CSR_WIFI_SME_CONNECTION_QUALITY_IND and
2926     CSR_WIFI_SME_CONNECTION_STATS_GET_REQ.
2927     When the wireless manager application wishes to roam to another AP, it
2928     must issue a connection request specifying the BSSID of the desired AP.
2929
2930   PARAMETERS
2931     queue        - Destination Task Queue
2932     interfaceTag - Interface Identifier; unique identifier of an interface
2933     roamReason   - Indicates the reason for starting the roaming procedure
2934     reason80211  - Indicates the reason for deauthentication or disassociation
2935
2936 *******************************************************************************/
2937 #define CsrWifiSmeRoamStartIndCreate(msg__, dst__, src__, interfaceTag__, roamReason__, reason80211__) \
2938     msg__ = (CsrWifiSmeRoamStartInd *) CsrPmemAlloc(sizeof(CsrWifiSmeRoamStartInd)); \
2939     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_ROAM_START_IND, dst__, src__); \
2940     msg__->interfaceTag = (interfaceTag__); \
2941     msg__->roamReason = (roamReason__); \
2942     msg__->reason80211 = (reason80211__);
2943
2944 #define CsrWifiSmeRoamStartIndSendTo(dst__, src__, interfaceTag__, roamReason__, reason80211__) \
2945     { \
2946         CsrWifiSmeRoamStartInd *msg__; \
2947         CsrWifiSmeRoamStartIndCreate(msg__, dst__, src__, interfaceTag__, roamReason__, reason80211__); \
2948         CsrSchedMessagePut(dst__, CSR_WIFI_SME_PRIM, msg__); \
2949     }
2950
2951 #define CsrWifiSmeRoamStartIndSend(dst__, interfaceTag__, roamReason__, reason80211__) \
2952     CsrWifiSmeRoamStartIndSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, interfaceTag__, roamReason__, reason80211__)
2953
2954 /*******************************************************************************
2955
2956   NAME
2957     CsrWifiSmeRoamingConfigGetReqSend
2958
2959   DESCRIPTION
2960     This primitive gets the value of the RoamingConfig parameter.
2961
2962   PARAMETERS
2963     queue        - Message Source Task Queue (Cfm's will be sent to this Queue)
2964     interfaceTag - Interface Identifier; unique identifier of an interface
2965
2966 *******************************************************************************/
2967 #define CsrWifiSmeRoamingConfigGetReqCreate(msg__, dst__, src__, interfaceTag__) \
2968     msg__ = (CsrWifiSmeRoamingConfigGetReq *) CsrPmemAlloc(sizeof(CsrWifiSmeRoamingConfigGetReq)); \
2969     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_ROAMING_CONFIG_GET_REQ, dst__, src__); \
2970     msg__->interfaceTag = (interfaceTag__);
2971
2972 #define CsrWifiSmeRoamingConfigGetReqSendTo(dst__, src__, interfaceTag__) \
2973     { \
2974         CsrWifiSmeRoamingConfigGetReq *msg__; \
2975         CsrWifiSmeRoamingConfigGetReqCreate(msg__, dst__, src__, interfaceTag__); \
2976         CsrMsgTransport(dst__, CSR_WIFI_SME_PRIM, msg__); \
2977     }
2978
2979 #define CsrWifiSmeRoamingConfigGetReqSend(src__, interfaceTag__) \
2980     CsrWifiSmeRoamingConfigGetReqSendTo(CSR_WIFI_SME_LIB_DESTINATION_QUEUE, src__, interfaceTag__)
2981
2982 /*******************************************************************************
2983
2984   NAME
2985     CsrWifiSmeRoamingConfigGetCfmSend
2986
2987   DESCRIPTION
2988     This primitive reports the result of the request.
2989
2990   PARAMETERS
2991     queue         - Destination Task Queue
2992     interfaceTag  - Interface Identifier; unique identifier of an interface
2993     status        - Reports the result of the request
2994     roamingConfig - Reports the roaming behaviour of the driver and firmware
2995
2996 *******************************************************************************/
2997 #define CsrWifiSmeRoamingConfigGetCfmCreate(msg__, dst__, src__, interfaceTag__, status__, roamingConfig__) \
2998     msg__ = (CsrWifiSmeRoamingConfigGetCfm *) CsrPmemAlloc(sizeof(CsrWifiSmeRoamingConfigGetCfm)); \
2999     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_ROAMING_CONFIG_GET_CFM, dst__, src__); \
3000     msg__->interfaceTag = (interfaceTag__); \
3001     msg__->status = (status__); \
3002     msg__->roamingConfig = (roamingConfig__);
3003
3004 #define CsrWifiSmeRoamingConfigGetCfmSendTo(dst__, src__, interfaceTag__, status__, roamingConfig__) \
3005     { \
3006         CsrWifiSmeRoamingConfigGetCfm *msg__; \
3007         CsrWifiSmeRoamingConfigGetCfmCreate(msg__, dst__, src__, interfaceTag__, status__, roamingConfig__); \
3008         CsrSchedMessagePut(dst__, CSR_WIFI_SME_PRIM, msg__); \
3009     }
3010
3011 #define CsrWifiSmeRoamingConfigGetCfmSend(dst__, interfaceTag__, status__, roamingConfig__) \
3012     CsrWifiSmeRoamingConfigGetCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, interfaceTag__, status__, roamingConfig__)
3013
3014 /*******************************************************************************
3015
3016   NAME
3017     CsrWifiSmeRoamingConfigSetReqSend
3018
3019   DESCRIPTION
3020     This primitive sets the value of the RoamingConfig parameter.
3021
3022   PARAMETERS
3023     queue         - Message Source Task Queue (Cfm's will be sent to this Queue)
3024     interfaceTag  - Interface Identifier; unique identifier of an interface
3025     roamingConfig - Desired roaming behaviour values
3026
3027 *******************************************************************************/
3028 #define CsrWifiSmeRoamingConfigSetReqCreate(msg__, dst__, src__, interfaceTag__, roamingConfig__) \
3029     msg__ = (CsrWifiSmeRoamingConfigSetReq *) CsrPmemAlloc(sizeof(CsrWifiSmeRoamingConfigSetReq)); \
3030     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_ROAMING_CONFIG_SET_REQ, dst__, src__); \
3031     msg__->interfaceTag = (interfaceTag__); \
3032     msg__->roamingConfig = (roamingConfig__);
3033
3034 #define CsrWifiSmeRoamingConfigSetReqSendTo(dst__, src__, interfaceTag__, roamingConfig__) \
3035     { \
3036         CsrWifiSmeRoamingConfigSetReq *msg__; \
3037         CsrWifiSmeRoamingConfigSetReqCreate(msg__, dst__, src__, interfaceTag__, roamingConfig__); \
3038         CsrMsgTransport(dst__, CSR_WIFI_SME_PRIM, msg__); \
3039     }
3040
3041 #define CsrWifiSmeRoamingConfigSetReqSend(src__, interfaceTag__, roamingConfig__) \
3042     CsrWifiSmeRoamingConfigSetReqSendTo(CSR_WIFI_SME_LIB_DESTINATION_QUEUE, src__, interfaceTag__, roamingConfig__)
3043
3044 /*******************************************************************************
3045
3046   NAME
3047     CsrWifiSmeRoamingConfigSetCfmSend
3048
3049   DESCRIPTION
3050     This primitive sets the value of the RoamingConfig parameter.
3051
3052   PARAMETERS
3053     queue        - Destination Task Queue
3054     interfaceTag - Interface Identifier; unique identifier of an interface
3055     status       - Reports the result of the request
3056
3057 *******************************************************************************/
3058 #define CsrWifiSmeRoamingConfigSetCfmCreate(msg__, dst__, src__, interfaceTag__, status__) \
3059     msg__ = (CsrWifiSmeRoamingConfigSetCfm *) CsrPmemAlloc(sizeof(CsrWifiSmeRoamingConfigSetCfm)); \
3060     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_ROAMING_CONFIG_SET_CFM, dst__, src__); \
3061     msg__->interfaceTag = (interfaceTag__); \
3062     msg__->status = (status__);
3063
3064 #define CsrWifiSmeRoamingConfigSetCfmSendTo(dst__, src__, interfaceTag__, status__) \
3065     { \
3066         CsrWifiSmeRoamingConfigSetCfm *msg__; \
3067         CsrWifiSmeRoamingConfigSetCfmCreate(msg__, dst__, src__, interfaceTag__, status__); \
3068         CsrSchedMessagePut(dst__, CSR_WIFI_SME_PRIM, msg__); \
3069     }
3070
3071 #define CsrWifiSmeRoamingConfigSetCfmSend(dst__, interfaceTag__, status__) \
3072     CsrWifiSmeRoamingConfigSetCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, interfaceTag__, status__)
3073
3074 /*******************************************************************************
3075
3076   NAME
3077     CsrWifiSmeScanConfigGetReqSend
3078
3079   DESCRIPTION
3080     This primitive gets the value of the ScanConfig parameter.
3081
3082   PARAMETERS
3083     queue  - Message Source Task Queue (Cfm's will be sent to this Queue)
3084
3085 *******************************************************************************/
3086 #define CsrWifiSmeScanConfigGetReqCreate(msg__, dst__, src__) \
3087     msg__ = (CsrWifiSmeScanConfigGetReq *) CsrPmemAlloc(sizeof(CsrWifiSmeScanConfigGetReq)); \
3088     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_SCAN_CONFIG_GET_REQ, dst__, src__);
3089
3090 #define CsrWifiSmeScanConfigGetReqSendTo(dst__, src__) \
3091     { \
3092         CsrWifiSmeScanConfigGetReq *msg__; \
3093         CsrWifiSmeScanConfigGetReqCreate(msg__, dst__, src__); \
3094         CsrMsgTransport(dst__, CSR_WIFI_SME_PRIM, msg__); \
3095     }
3096
3097 #define CsrWifiSmeScanConfigGetReqSend(src__) \
3098     CsrWifiSmeScanConfigGetReqSendTo(CSR_WIFI_SME_LIB_DESTINATION_QUEUE, src__)
3099
3100 /*******************************************************************************
3101
3102   NAME
3103     CsrWifiSmeScanConfigGetCfmSend
3104
3105   DESCRIPTION
3106     This primitive reports the result of the request.
3107
3108   PARAMETERS
3109     queue      - Destination Task Queue
3110     status     - Reports the result of the request
3111     scanConfig - Returns the current parameters for the autonomous scanning
3112                  behaviour of the firmware
3113
3114 *******************************************************************************/
3115 #define CsrWifiSmeScanConfigGetCfmCreate(msg__, dst__, src__, status__, scanConfig__) \
3116     msg__ = (CsrWifiSmeScanConfigGetCfm *) CsrPmemAlloc(sizeof(CsrWifiSmeScanConfigGetCfm)); \
3117     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_SCAN_CONFIG_GET_CFM, dst__, src__); \
3118     msg__->status = (status__); \
3119     msg__->scanConfig = (scanConfig__);
3120
3121 #define CsrWifiSmeScanConfigGetCfmSendTo(dst__, src__, status__, scanConfig__) \
3122     { \
3123         CsrWifiSmeScanConfigGetCfm *msg__; \
3124         CsrWifiSmeScanConfigGetCfmCreate(msg__, dst__, src__, status__, scanConfig__); \
3125         CsrSchedMessagePut(dst__, CSR_WIFI_SME_PRIM, msg__); \
3126     }
3127
3128 #define CsrWifiSmeScanConfigGetCfmSend(dst__, status__, scanConfig__) \
3129     CsrWifiSmeScanConfigGetCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, status__, scanConfig__)
3130
3131 /*******************************************************************************
3132
3133   NAME
3134     CsrWifiSmeScanConfigSetReqSend
3135
3136   DESCRIPTION
3137     This primitive sets the value of the ScanConfig parameter.
3138     The SME normally configures the firmware to perform autonomous scanning
3139     without involving the host.
3140     The firmware passes beacon / probe response or indicates loss of beacon
3141     on certain changes of state, for example:
3142       * A new AP is seen for the first time
3143       * An AP is no longer visible
3144       * The signal strength of an AP changes by more than a certain amount, as
3145         configured by the thresholds in the scanConfig parameter
3146     In addition to the autonomous scan, the wireless manager application may
3147     request a scan at any time using CSR_WIFI_SME_SCAN_FULL_REQ.
3148
3149   PARAMETERS
3150     queue      - Message Source Task Queue (Cfm's will be sent to this Queue)
3151     scanConfig - Reports the configuration for the autonomous scanning behaviour
3152                  of the firmware
3153
3154 *******************************************************************************/
3155 #define CsrWifiSmeScanConfigSetReqCreate(msg__, dst__, src__, scanConfig__) \
3156     msg__ = (CsrWifiSmeScanConfigSetReq *) CsrPmemAlloc(sizeof(CsrWifiSmeScanConfigSetReq)); \
3157     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_SCAN_CONFIG_SET_REQ, dst__, src__); \
3158     msg__->scanConfig = (scanConfig__);
3159
3160 #define CsrWifiSmeScanConfigSetReqSendTo(dst__, src__, scanConfig__) \
3161     { \
3162         CsrWifiSmeScanConfigSetReq *msg__; \
3163         CsrWifiSmeScanConfigSetReqCreate(msg__, dst__, src__, scanConfig__); \
3164         CsrMsgTransport(dst__, CSR_WIFI_SME_PRIM, msg__); \
3165     }
3166
3167 #define CsrWifiSmeScanConfigSetReqSend(src__, scanConfig__) \
3168     CsrWifiSmeScanConfigSetReqSendTo(CSR_WIFI_SME_LIB_DESTINATION_QUEUE, src__, scanConfig__)
3169
3170 /*******************************************************************************
3171
3172   NAME
3173     CsrWifiSmeScanConfigSetCfmSend
3174
3175   DESCRIPTION
3176     This primitive reports the result of the request.
3177
3178   PARAMETERS
3179     queue  - Destination Task Queue
3180     status - Reports the result of the request
3181
3182 *******************************************************************************/
3183 #define CsrWifiSmeScanConfigSetCfmCreate(msg__, dst__, src__, status__) \
3184     msg__ = (CsrWifiSmeScanConfigSetCfm *) CsrPmemAlloc(sizeof(CsrWifiSmeScanConfigSetCfm)); \
3185     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_SCAN_CONFIG_SET_CFM, dst__, src__); \
3186     msg__->status = (status__);
3187
3188 #define CsrWifiSmeScanConfigSetCfmSendTo(dst__, src__, status__) \
3189     { \
3190         CsrWifiSmeScanConfigSetCfm *msg__; \
3191         CsrWifiSmeScanConfigSetCfmCreate(msg__, dst__, src__, status__); \
3192         CsrSchedMessagePut(dst__, CSR_WIFI_SME_PRIM, msg__); \
3193     }
3194
3195 #define CsrWifiSmeScanConfigSetCfmSend(dst__, status__) \
3196     CsrWifiSmeScanConfigSetCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, status__)
3197
3198 /*******************************************************************************
3199
3200   NAME
3201     CsrWifiSmeScanFullReqSend
3202
3203   DESCRIPTION
3204     The wireless manager application should call this primitive to request a
3205     full scan.
3206     Channels are scanned actively or passively according to the requirement
3207     set by regulatory domain.
3208     If the SME receives this primitive while a full scan is going on, the new
3209     request is buffered and it will be served after the current full scan is
3210     completed.
3211
3212   PARAMETERS
3213     queue            - Message Source Task Queue (Cfm's will be sent to this Queue)
3214     ssidCount        - Number of SSIDs provided.
3215                        If it is 0, the SME will attempt to detect any network
3216     ssid             - Points to the first SSID provided, if any.
3217     bssid            - BSS identifier.
3218                        If it is equal to FF-FF-FF-FF-FF, the SME will listen for
3219                        messages from any BSS.
3220                        If it is different from FF-FF-FF-FF-FF and any SSID is
3221                        provided, one SSID must match the network of the BSS.
3222     forceScan        - Forces the scan even if the SME is in a state which would
3223                        normally prevent it (e.g. autonomous scan is running).
3224     bssType          - Type of BSS to scan for
3225     scanType         - Type of scan to perform
3226     channelListCount - Number of channels provided.
3227                        If it is 0, the SME will initiate a scan of all the
3228                        supported channels that are permitted by the current
3229                        regulatory domain.
3230     channelList      - Points to the first channel , or NULL if channelListCount
3231                        is zero.
3232     probeIeLength    - Length of the information element in bytes to be sent
3233                        with the probe message.
3234     probeIe          - Points to the first byte of the information element to be
3235                        sent with the probe message.
3236
3237 *******************************************************************************/
3238 #define CsrWifiSmeScanFullReqCreate(msg__, dst__, src__, ssidCount__, ssid__, bssid__, forceScan__, bssType__, scanType__, channelListCount__, channelList__, probeIeLength__, probeIe__) \
3239     msg__ = (CsrWifiSmeScanFullReq *) CsrPmemAlloc(sizeof(CsrWifiSmeScanFullReq)); \
3240     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_SCAN_FULL_REQ, dst__, src__); \
3241     msg__->ssidCount = (ssidCount__); \
3242     msg__->ssid = (ssid__); \
3243     msg__->bssid = (bssid__); \
3244     msg__->forceScan = (forceScan__); \
3245     msg__->bssType = (bssType__); \
3246     msg__->scanType = (scanType__); \
3247     msg__->channelListCount = (channelListCount__); \
3248     msg__->channelList = (channelList__); \
3249     msg__->probeIeLength = (probeIeLength__); \
3250     msg__->probeIe = (probeIe__);
3251
3252 #define CsrWifiSmeScanFullReqSendTo(dst__, src__, ssidCount__, ssid__, bssid__, forceScan__, bssType__, scanType__, channelListCount__, channelList__, probeIeLength__, probeIe__) \
3253     { \
3254         CsrWifiSmeScanFullReq *msg__; \
3255         CsrWifiSmeScanFullReqCreate(msg__, dst__, src__, ssidCount__, ssid__, bssid__, forceScan__, bssType__, scanType__, channelListCount__, channelList__, probeIeLength__, probeIe__); \
3256         CsrMsgTransport(dst__, CSR_WIFI_SME_PRIM, msg__); \
3257     }
3258
3259 #define CsrWifiSmeScanFullReqSend(src__, ssidCount__, ssid__, bssid__, forceScan__, bssType__, scanType__, channelListCount__, channelList__, probeIeLength__, probeIe__) \
3260     CsrWifiSmeScanFullReqSendTo(CSR_WIFI_SME_LIB_DESTINATION_QUEUE, src__, ssidCount__, ssid__, bssid__, forceScan__, bssType__, scanType__, channelListCount__, channelList__, probeIeLength__, probeIe__)
3261
3262 /*******************************************************************************
3263
3264   NAME
3265     CsrWifiSmeScanFullCfmSend
3266
3267   DESCRIPTION
3268     The SME calls this primitive when the results from the scan are
3269     available.
3270
3271   PARAMETERS
3272     queue  - Destination Task Queue
3273     status - Reports the result of the request
3274
3275 *******************************************************************************/
3276 #define CsrWifiSmeScanFullCfmCreate(msg__, dst__, src__, status__) \
3277     msg__ = (CsrWifiSmeScanFullCfm *) CsrPmemAlloc(sizeof(CsrWifiSmeScanFullCfm)); \
3278     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_SCAN_FULL_CFM, dst__, src__); \
3279     msg__->status = (status__);
3280
3281 #define CsrWifiSmeScanFullCfmSendTo(dst__, src__, status__) \
3282     { \
3283         CsrWifiSmeScanFullCfm *msg__; \
3284         CsrWifiSmeScanFullCfmCreate(msg__, dst__, src__, status__); \
3285         CsrSchedMessagePut(dst__, CSR_WIFI_SME_PRIM, msg__); \
3286     }
3287
3288 #define CsrWifiSmeScanFullCfmSend(dst__, status__) \
3289     CsrWifiSmeScanFullCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, status__)
3290
3291 /*******************************************************************************
3292
3293   NAME
3294     CsrWifiSmeScanResultIndSend
3295
3296   DESCRIPTION
3297     The SME sends this primitive to all the tasks that have registered to
3298     receive it whenever a scan indication is received from the firmware.
3299
3300   PARAMETERS
3301     queue  - Destination Task Queue
3302     result - Points to a buffer containing a scan result.
3303
3304 *******************************************************************************/
3305 #define CsrWifiSmeScanResultIndCreate(msg__, dst__, src__, result__) \
3306     msg__ = (CsrWifiSmeScanResultInd *) CsrPmemAlloc(sizeof(CsrWifiSmeScanResultInd)); \
3307     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_SCAN_RESULT_IND, dst__, src__); \
3308     msg__->result = (result__);
3309
3310 #define CsrWifiSmeScanResultIndSendTo(dst__, src__, result__) \
3311     { \
3312         CsrWifiSmeScanResultInd *msg__; \
3313         CsrWifiSmeScanResultIndCreate(msg__, dst__, src__, result__); \
3314         CsrSchedMessagePut(dst__, CSR_WIFI_SME_PRIM, msg__); \
3315     }
3316
3317 #define CsrWifiSmeScanResultIndSend(dst__, result__) \
3318     CsrWifiSmeScanResultIndSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, result__)
3319
3320 /*******************************************************************************
3321
3322   NAME
3323     CsrWifiSmeScanResultsFlushReqSend
3324
3325   DESCRIPTION
3326     The Wireless Manager calls this primitive to ask the SME to delete all
3327     scan results from its cache, except for the scan result of any currently
3328     connected network.
3329     As scan results are received by the SME from the firmware, they are
3330     cached in the SME memory.
3331     Any time the Wireless Manager requests scan results, they are returned
3332     from the SME internal cache.
3333     For some applications it may be desirable to clear this cache prior to
3334     requesting that a scan be performed; this will ensure that the cache then
3335     only contains the networks detected in the most recent scan.
3336
3337   PARAMETERS
3338     queue  - Message Source Task Queue (Cfm's will be sent to this Queue)
3339
3340 *******************************************************************************/
3341 #define CsrWifiSmeScanResultsFlushReqCreate(msg__, dst__, src__) \
3342     msg__ = (CsrWifiSmeScanResultsFlushReq *) CsrPmemAlloc(sizeof(CsrWifiSmeScanResultsFlushReq)); \
3343     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_SCAN_RESULTS_FLUSH_REQ, dst__, src__);
3344
3345 #define CsrWifiSmeScanResultsFlushReqSendTo(dst__, src__) \
3346     { \
3347         CsrWifiSmeScanResultsFlushReq *msg__; \
3348         CsrWifiSmeScanResultsFlushReqCreate(msg__, dst__, src__); \
3349         CsrMsgTransport(dst__, CSR_WIFI_SME_PRIM, msg__); \
3350     }
3351
3352 #define CsrWifiSmeScanResultsFlushReqSend(src__) \
3353     CsrWifiSmeScanResultsFlushReqSendTo(CSR_WIFI_SME_LIB_DESTINATION_QUEUE, src__)
3354
3355 /*******************************************************************************
3356
3357   NAME
3358     CsrWifiSmeScanResultsFlushCfmSend
3359
3360   DESCRIPTION
3361     The SME will call this primitive when the cache has been cleared.
3362
3363   PARAMETERS
3364     queue  - Destination Task Queue
3365     status - Reports the result of the request
3366
3367 *******************************************************************************/
3368 #define CsrWifiSmeScanResultsFlushCfmCreate(msg__, dst__, src__, status__) \
3369     msg__ = (CsrWifiSmeScanResultsFlushCfm *) CsrPmemAlloc(sizeof(CsrWifiSmeScanResultsFlushCfm)); \
3370     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_SCAN_RESULTS_FLUSH_CFM, dst__, src__); \
3371     msg__->status = (status__);
3372
3373 #define CsrWifiSmeScanResultsFlushCfmSendTo(dst__, src__, status__) \
3374     { \
3375         CsrWifiSmeScanResultsFlushCfm *msg__; \
3376         CsrWifiSmeScanResultsFlushCfmCreate(msg__, dst__, src__, status__); \
3377         CsrSchedMessagePut(dst__, CSR_WIFI_SME_PRIM, msg__); \
3378     }
3379
3380 #define CsrWifiSmeScanResultsFlushCfmSend(dst__, status__) \
3381     CsrWifiSmeScanResultsFlushCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, status__)
3382
3383 /*******************************************************************************
3384
3385   NAME
3386     CsrWifiSmeScanResultsGetReqSend
3387
3388   DESCRIPTION
3389     The wireless manager application calls this primitive to retrieve the
3390     current set of scan results, either after receiving a successful
3391     CSR_WIFI_SME_SCAN_FULL_CFM, or to get autonomous scan results.
3392
3393   PARAMETERS
3394     queue  - Message Source Task Queue (Cfm's will be sent to this Queue)
3395
3396 *******************************************************************************/
3397 #define CsrWifiSmeScanResultsGetReqCreate(msg__, dst__, src__) \
3398     msg__ = (CsrWifiSmeScanResultsGetReq *) CsrPmemAlloc(sizeof(CsrWifiSmeScanResultsGetReq)); \
3399     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_SCAN_RESULTS_GET_REQ, dst__, src__);
3400
3401 #define CsrWifiSmeScanResultsGetReqSendTo(dst__, src__) \
3402     { \
3403         CsrWifiSmeScanResultsGetReq *msg__; \
3404         CsrWifiSmeScanResultsGetReqCreate(msg__, dst__, src__); \
3405         CsrMsgTransport(dst__, CSR_WIFI_SME_PRIM, msg__); \
3406     }
3407
3408 #define CsrWifiSmeScanResultsGetReqSend(src__) \
3409     CsrWifiSmeScanResultsGetReqSendTo(CSR_WIFI_SME_LIB_DESTINATION_QUEUE, src__)
3410
3411 /*******************************************************************************
3412
3413   NAME
3414     CsrWifiSmeScanResultsGetCfmSend
3415
3416   DESCRIPTION
3417     The SME sends this primitive to provide the current set of scan results.
3418
3419   PARAMETERS
3420     queue            - Destination Task Queue
3421     status           - Reports the result of the request
3422     scanResultsCount - Number of scan results
3423     scanResults      - Points to a buffer containing an array of
3424                        CsrWifiSmeScanResult structures.
3425
3426 *******************************************************************************/
3427 #define CsrWifiSmeScanResultsGetCfmCreate(msg__, dst__, src__, status__, scanResultsCount__, scanResults__) \
3428     msg__ = (CsrWifiSmeScanResultsGetCfm *) CsrPmemAlloc(sizeof(CsrWifiSmeScanResultsGetCfm)); \
3429     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_SCAN_RESULTS_GET_CFM, dst__, src__); \
3430     msg__->status = (status__); \
3431     msg__->scanResultsCount = (scanResultsCount__); \
3432     msg__->scanResults = (scanResults__);
3433
3434 #define CsrWifiSmeScanResultsGetCfmSendTo(dst__, src__, status__, scanResultsCount__, scanResults__) \
3435     { \
3436         CsrWifiSmeScanResultsGetCfm *msg__; \
3437         CsrWifiSmeScanResultsGetCfmCreate(msg__, dst__, src__, status__, scanResultsCount__, scanResults__); \
3438         CsrSchedMessagePut(dst__, CSR_WIFI_SME_PRIM, msg__); \
3439     }
3440
3441 #define CsrWifiSmeScanResultsGetCfmSend(dst__, status__, scanResultsCount__, scanResults__) \
3442     CsrWifiSmeScanResultsGetCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, status__, scanResultsCount__, scanResults__)
3443
3444 /*******************************************************************************
3445
3446   NAME
3447     CsrWifiSmeSetReqSend
3448
3449   DESCRIPTION
3450     Used to pass custom data to the SME. Format is the same as 802.11 Info
3451     Elements => | Id | Length | Data
3452     1) Cmanr Test Mode "Id:0 Length:1 Data:0x00 = OFF 0x01 = ON" "0x00 0x01
3453     (0x00|0x01)"
3454
3455   PARAMETERS
3456     queue      - Message Source Task Queue (Cfm's will be sent to this Queue)
3457     dataLength - Number of bytes in the buffer pointed to by 'data'
3458     data       - Pointer to the buffer containing 'dataLength' bytes
3459
3460 *******************************************************************************/
3461 #define CsrWifiSmeSetReqCreate(msg__, dst__, src__, dataLength__, data__) \
3462     msg__ = (CsrWifiSmeSetReq *) CsrPmemAlloc(sizeof(CsrWifiSmeSetReq)); \
3463     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_SET_REQ, dst__, src__); \
3464     msg__->dataLength = (dataLength__); \
3465     msg__->data = (data__);
3466
3467 #define CsrWifiSmeSetReqSendTo(dst__, src__, dataLength__, data__) \
3468     { \
3469         CsrWifiSmeSetReq *msg__; \
3470         CsrWifiSmeSetReqCreate(msg__, dst__, src__, dataLength__, data__); \
3471         CsrMsgTransport(dst__, CSR_WIFI_SME_PRIM, msg__); \
3472     }
3473
3474 #define CsrWifiSmeSetReqSend(src__, dataLength__, data__) \
3475     CsrWifiSmeSetReqSendTo(CSR_WIFI_SME_LIB_DESTINATION_QUEUE, src__, dataLength__, data__)
3476
3477 /*******************************************************************************
3478
3479   NAME
3480     CsrWifiSmeSmeCommonConfigGetReqSend
3481
3482   DESCRIPTION
3483     This primitive gets the value of the Sme common parameter.
3484
3485   PARAMETERS
3486     queue  - Message Source Task Queue (Cfm's will be sent to this Queue)
3487
3488 *******************************************************************************/
3489 #define CsrWifiSmeSmeCommonConfigGetReqCreate(msg__, dst__, src__) \
3490     msg__ = (CsrWifiSmeSmeCommonConfigGetReq *) CsrPmemAlloc(sizeof(CsrWifiSmeSmeCommonConfigGetReq)); \
3491     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_SME_COMMON_CONFIG_GET_REQ, dst__, src__);
3492
3493 #define CsrWifiSmeSmeCommonConfigGetReqSendTo(dst__, src__) \
3494     { \
3495         CsrWifiSmeSmeCommonConfigGetReq *msg__; \
3496         CsrWifiSmeSmeCommonConfigGetReqCreate(msg__, dst__, src__); \
3497         CsrMsgTransport(dst__, CSR_WIFI_SME_PRIM, msg__); \
3498     }
3499
3500 #define CsrWifiSmeSmeCommonConfigGetReqSend(src__) \
3501     CsrWifiSmeSmeCommonConfigGetReqSendTo(CSR_WIFI_SME_LIB_DESTINATION_QUEUE, src__)
3502
3503 /*******************************************************************************
3504
3505   NAME
3506     CsrWifiSmeSmeCommonConfigGetCfmSend
3507
3508   DESCRIPTION
3509     This primitive reports the result of the request.
3510
3511   PARAMETERS
3512     queue        - Destination Task Queue
3513     status       - Reports the result of the request
3514     deviceConfig - Configuration options in the SME
3515
3516 *******************************************************************************/
3517 #define CsrWifiSmeSmeCommonConfigGetCfmCreate(msg__, dst__, src__, status__, deviceConfig__) \
3518     msg__ = (CsrWifiSmeSmeCommonConfigGetCfm *) CsrPmemAlloc(sizeof(CsrWifiSmeSmeCommonConfigGetCfm)); \
3519     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_SME_COMMON_CONFIG_GET_CFM, dst__, src__); \
3520     msg__->status = (status__); \
3521     msg__->deviceConfig = (deviceConfig__);
3522
3523 #define CsrWifiSmeSmeCommonConfigGetCfmSendTo(dst__, src__, status__, deviceConfig__) \
3524     { \
3525         CsrWifiSmeSmeCommonConfigGetCfm *msg__; \
3526         CsrWifiSmeSmeCommonConfigGetCfmCreate(msg__, dst__, src__, status__, deviceConfig__); \
3527         CsrSchedMessagePut(dst__, CSR_WIFI_SME_PRIM, msg__); \
3528     }
3529
3530 #define CsrWifiSmeSmeCommonConfigGetCfmSend(dst__, status__, deviceConfig__) \
3531     CsrWifiSmeSmeCommonConfigGetCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, status__, deviceConfig__)
3532
3533 /*******************************************************************************
3534
3535   NAME
3536     CsrWifiSmeSmeCommonConfigSetReqSend
3537
3538   DESCRIPTION
3539     This primitive sets the value of the Sme common.
3540
3541   PARAMETERS
3542     queue        - Message Source Task Queue (Cfm's will be sent to this Queue)
3543     deviceConfig - Configuration options in the SME
3544
3545 *******************************************************************************/
3546 #define CsrWifiSmeSmeCommonConfigSetReqCreate(msg__, dst__, src__, deviceConfig__) \
3547     msg__ = (CsrWifiSmeSmeCommonConfigSetReq *) CsrPmemAlloc(sizeof(CsrWifiSmeSmeCommonConfigSetReq)); \
3548     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_SME_COMMON_CONFIG_SET_REQ, dst__, src__); \
3549     msg__->deviceConfig = (deviceConfig__);
3550
3551 #define CsrWifiSmeSmeCommonConfigSetReqSendTo(dst__, src__, deviceConfig__) \
3552     { \
3553         CsrWifiSmeSmeCommonConfigSetReq *msg__; \
3554         CsrWifiSmeSmeCommonConfigSetReqCreate(msg__, dst__, src__, deviceConfig__); \
3555         CsrMsgTransport(dst__, CSR_WIFI_SME_PRIM, msg__); \
3556     }
3557
3558 #define CsrWifiSmeSmeCommonConfigSetReqSend(src__, deviceConfig__) \
3559     CsrWifiSmeSmeCommonConfigSetReqSendTo(CSR_WIFI_SME_LIB_DESTINATION_QUEUE, src__, deviceConfig__)
3560
3561 /*******************************************************************************
3562
3563   NAME
3564     CsrWifiSmeSmeCommonConfigSetCfmSend
3565
3566   DESCRIPTION
3567     Reports the result of the request
3568
3569   PARAMETERS
3570     queue  - Destination Task Queue
3571     status - Reports the result of the request
3572
3573 *******************************************************************************/
3574 #define CsrWifiSmeSmeCommonConfigSetCfmCreate(msg__, dst__, src__, status__) \
3575     msg__ = (CsrWifiSmeSmeCommonConfigSetCfm *) CsrPmemAlloc(sizeof(CsrWifiSmeSmeCommonConfigSetCfm)); \
3576     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_SME_COMMON_CONFIG_SET_CFM, dst__, src__); \
3577     msg__->status = (status__);
3578
3579 #define CsrWifiSmeSmeCommonConfigSetCfmSendTo(dst__, src__, status__) \
3580     { \
3581         CsrWifiSmeSmeCommonConfigSetCfm *msg__; \
3582         CsrWifiSmeSmeCommonConfigSetCfmCreate(msg__, dst__, src__, status__); \
3583         CsrSchedMessagePut(dst__, CSR_WIFI_SME_PRIM, msg__); \
3584     }
3585
3586 #define CsrWifiSmeSmeCommonConfigSetCfmSend(dst__, status__) \
3587     CsrWifiSmeSmeCommonConfigSetCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, status__)
3588
3589 /*******************************************************************************
3590
3591   NAME
3592     CsrWifiSmeSmeStaConfigGetReqSend
3593
3594   DESCRIPTION
3595     This primitive gets the value of the SmeStaConfig parameter.
3596
3597   PARAMETERS
3598     queue        - Message Source Task Queue (Cfm's will be sent to this Queue)
3599     interfaceTag - Interface Identifier; unique identifier of an interface
3600
3601 *******************************************************************************/
3602 #define CsrWifiSmeSmeStaConfigGetReqCreate(msg__, dst__, src__, interfaceTag__) \
3603     msg__ = (CsrWifiSmeSmeStaConfigGetReq *) CsrPmemAlloc(sizeof(CsrWifiSmeSmeStaConfigGetReq)); \
3604     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_SME_STA_CONFIG_GET_REQ, dst__, src__); \
3605     msg__->interfaceTag = (interfaceTag__);
3606
3607 #define CsrWifiSmeSmeStaConfigGetReqSendTo(dst__, src__, interfaceTag__) \
3608     { \
3609         CsrWifiSmeSmeStaConfigGetReq *msg__; \
3610         CsrWifiSmeSmeStaConfigGetReqCreate(msg__, dst__, src__, interfaceTag__); \
3611         CsrMsgTransport(dst__, CSR_WIFI_SME_PRIM, msg__); \
3612     }
3613
3614 #define CsrWifiSmeSmeStaConfigGetReqSend(src__, interfaceTag__) \
3615     CsrWifiSmeSmeStaConfigGetReqSendTo(CSR_WIFI_SME_LIB_DESTINATION_QUEUE, src__, interfaceTag__)
3616
3617 /*******************************************************************************
3618
3619   NAME
3620     CsrWifiSmeSmeStaConfigGetCfmSend
3621
3622   DESCRIPTION
3623     This primitive reports the result of the request.
3624
3625   PARAMETERS
3626     queue        - Destination Task Queue
3627     interfaceTag - Interface Identifier; unique identifier of an interface
3628     status       - Reports the result of the request
3629     smeConfig    - Current SME Station Parameters
3630
3631 *******************************************************************************/
3632 #define CsrWifiSmeSmeStaConfigGetCfmCreate(msg__, dst__, src__, interfaceTag__, status__, smeConfig__) \
3633     msg__ = (CsrWifiSmeSmeStaConfigGetCfm *) CsrPmemAlloc(sizeof(CsrWifiSmeSmeStaConfigGetCfm)); \
3634     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_SME_STA_CONFIG_GET_CFM, dst__, src__); \
3635     msg__->interfaceTag = (interfaceTag__); \
3636     msg__->status = (status__); \
3637     msg__->smeConfig = (smeConfig__);
3638
3639 #define CsrWifiSmeSmeStaConfigGetCfmSendTo(dst__, src__, interfaceTag__, status__, smeConfig__) \
3640     { \
3641         CsrWifiSmeSmeStaConfigGetCfm *msg__; \
3642         CsrWifiSmeSmeStaConfigGetCfmCreate(msg__, dst__, src__, interfaceTag__, status__, smeConfig__); \
3643         CsrSchedMessagePut(dst__, CSR_WIFI_SME_PRIM, msg__); \
3644     }
3645
3646 #define CsrWifiSmeSmeStaConfigGetCfmSend(dst__, interfaceTag__, status__, smeConfig__) \
3647     CsrWifiSmeSmeStaConfigGetCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, interfaceTag__, status__, smeConfig__)
3648
3649 /*******************************************************************************
3650
3651   NAME
3652     CsrWifiSmeSmeStaConfigSetReqSend
3653
3654   DESCRIPTION
3655     This primitive sets the value of the SmeConfig parameter.
3656
3657   PARAMETERS
3658     queue        - Message Source Task Queue (Cfm's will be sent to this Queue)
3659     interfaceTag - Interface Identifier; unique identifier of an interface
3660     smeConfig    - SME Station Parameters to be set
3661
3662 *******************************************************************************/
3663 #define CsrWifiSmeSmeStaConfigSetReqCreate(msg__, dst__, src__, interfaceTag__, smeConfig__) \
3664     msg__ = (CsrWifiSmeSmeStaConfigSetReq *) CsrPmemAlloc(sizeof(CsrWifiSmeSmeStaConfigSetReq)); \
3665     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_SME_STA_CONFIG_SET_REQ, dst__, src__); \
3666     msg__->interfaceTag = (interfaceTag__); \
3667     msg__->smeConfig = (smeConfig__);
3668
3669 #define CsrWifiSmeSmeStaConfigSetReqSendTo(dst__, src__, interfaceTag__, smeConfig__) \
3670     { \
3671         CsrWifiSmeSmeStaConfigSetReq *msg__; \
3672         CsrWifiSmeSmeStaConfigSetReqCreate(msg__, dst__, src__, interfaceTag__, smeConfig__); \
3673         CsrMsgTransport(dst__, CSR_WIFI_SME_PRIM, msg__); \
3674     }
3675
3676 #define CsrWifiSmeSmeStaConfigSetReqSend(src__, interfaceTag__, smeConfig__) \
3677     CsrWifiSmeSmeStaConfigSetReqSendTo(CSR_WIFI_SME_LIB_DESTINATION_QUEUE, src__, interfaceTag__, smeConfig__)
3678
3679 /*******************************************************************************
3680
3681   NAME
3682     CsrWifiSmeSmeStaConfigSetCfmSend
3683
3684   DESCRIPTION
3685     This primitive reports the result of the request.
3686
3687   PARAMETERS
3688     queue        - Destination Task Queue
3689     interfaceTag - Interface Identifier; unique identifier of an interface
3690     status       - Reports the result of the request
3691
3692 *******************************************************************************/
3693 #define CsrWifiSmeSmeStaConfigSetCfmCreate(msg__, dst__, src__, interfaceTag__, status__) \
3694     msg__ = (CsrWifiSmeSmeStaConfigSetCfm *) CsrPmemAlloc(sizeof(CsrWifiSmeSmeStaConfigSetCfm)); \
3695     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_SME_STA_CONFIG_SET_CFM, dst__, src__); \
3696     msg__->interfaceTag = (interfaceTag__); \
3697     msg__->status = (status__);
3698
3699 #define CsrWifiSmeSmeStaConfigSetCfmSendTo(dst__, src__, interfaceTag__, status__) \
3700     { \
3701         CsrWifiSmeSmeStaConfigSetCfm *msg__; \
3702         CsrWifiSmeSmeStaConfigSetCfmCreate(msg__, dst__, src__, interfaceTag__, status__); \
3703         CsrSchedMessagePut(dst__, CSR_WIFI_SME_PRIM, msg__); \
3704     }
3705
3706 #define CsrWifiSmeSmeStaConfigSetCfmSend(dst__, interfaceTag__, status__) \
3707     CsrWifiSmeSmeStaConfigSetCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, interfaceTag__, status__)
3708
3709 /*******************************************************************************
3710
3711   NAME
3712     CsrWifiSmeStationMacAddressGetReqSend
3713
3714   DESCRIPTION
3715     This primitives is used to retrieve the current MAC address used by the
3716     station.
3717
3718   PARAMETERS
3719     queue  - Message Source Task Queue (Cfm's will be sent to this Queue)
3720
3721 *******************************************************************************/
3722 #define CsrWifiSmeStationMacAddressGetReqCreate(msg__, dst__, src__) \
3723     msg__ = (CsrWifiSmeStationMacAddressGetReq *) CsrPmemAlloc(sizeof(CsrWifiSmeStationMacAddressGetReq)); \
3724     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_STATION_MAC_ADDRESS_GET_REQ, dst__, src__);
3725
3726 #define CsrWifiSmeStationMacAddressGetReqSendTo(dst__, src__) \
3727     { \
3728         CsrWifiSmeStationMacAddressGetReq *msg__; \
3729         CsrWifiSmeStationMacAddressGetReqCreate(msg__, dst__, src__); \
3730         CsrMsgTransport(dst__, CSR_WIFI_SME_PRIM, msg__); \
3731     }
3732
3733 #define CsrWifiSmeStationMacAddressGetReqSend(src__) \
3734     CsrWifiSmeStationMacAddressGetReqSendTo(CSR_WIFI_SME_LIB_DESTINATION_QUEUE, src__)
3735
3736 /*******************************************************************************
3737
3738   NAME
3739     CsrWifiSmeStationMacAddressGetCfmSend
3740
3741   DESCRIPTION
3742     This primitive reports the result of the request.
3743
3744   PARAMETERS
3745     queue             - Destination Task Queue
3746     status            - Reports the result of the request
3747     stationMacAddress - Current MAC address of the station.
3748
3749 *******************************************************************************/
3750 #define CsrWifiSmeStationMacAddressGetCfmCreate(msg__, dst__, src__, status__, stationMacAddress__) \
3751     msg__ = (CsrWifiSmeStationMacAddressGetCfm *) CsrPmemAlloc(sizeof(CsrWifiSmeStationMacAddressGetCfm)); \
3752     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_STATION_MAC_ADDRESS_GET_CFM, dst__, src__); \
3753     msg__->status = (status__); \
3754     memcpy(msg__->stationMacAddress, (stationMacAddress__), sizeof(CsrWifiMacAddress) * 2);
3755
3756 #define CsrWifiSmeStationMacAddressGetCfmSendTo(dst__, src__, status__, stationMacAddress__) \
3757     { \
3758         CsrWifiSmeStationMacAddressGetCfm *msg__; \
3759         CsrWifiSmeStationMacAddressGetCfmCreate(msg__, dst__, src__, status__, stationMacAddress__); \
3760         CsrSchedMessagePut(dst__, CSR_WIFI_SME_PRIM, msg__); \
3761     }
3762
3763 #define CsrWifiSmeStationMacAddressGetCfmSend(dst__, status__, stationMacAddress__) \
3764     CsrWifiSmeStationMacAddressGetCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, status__, stationMacAddress__)
3765
3766 /*******************************************************************************
3767
3768   NAME
3769     CsrWifiSmeTspecReqSend
3770
3771   DESCRIPTION
3772     The wireless manager application should call this primitive to use the
3773     TSPEC feature.
3774     The chip supports the use of TSPECs and TCLAS for the use of IEEE
3775     802.11/WMM Quality of Service features.
3776     The API allows the wireless manager application to supply a correctly
3777     formatted TSPEC and TCLAS pair to the driver.
3778     After performing basic validation, the driver negotiates the installation
3779     of the TSPEC with the AP as defined by the 802.11 specification.
3780     The driver retains all TSPEC and TCLAS pairs until they are specifically
3781     removed.
3782     It is not compulsory for a TSPEC to have a TCLAS (NULL is used to
3783     indicate that no TCLAS is supplied), while a TCLASS always require a
3784     TSPEC.
3785     The format of the TSPEC element is specified in 'WMM (including WMM Power
3786     Save) Specification - Version 1.1' and 'ANSI/IEEE Std 802.11-REVmb/D3.0'.
3787     For more information, see 'UniFi Configuring WMM and WMM-PS'.
3788
3789   PARAMETERS
3790     queue         - Message Source Task Queue (Cfm's will be sent to this Queue)
3791     interfaceTag  - Interface Identifier; unique identifier of an interface
3792     action        - Specifies the action to be carried out on the list of TSPECs.
3793                     CSR_WIFI_SME_LIST_ACTION_FLUSH is not applicable here.
3794     transactionId - Unique Transaction ID for the TSPEC, as assigned by the
3795                     driver
3796     strict        - If it set to false, allows the SME to perform automatic
3797                     TSPEC negotiation
3798     ctrlMask      - Additional TSPEC configuration for CCX.
3799                     Set mask with values from CsrWifiSmeTspecCtrl.
3800                     CURRENTLY NOT SUPPORTED
3801     tspecLength   - Length of the TSPEC.
3802     tspec         - Points to the first byte of the TSPEC
3803     tclasLength   - Length of the TCLAS.
3804                     If it is equal to 0, no TCLASS is provided for the TSPEC
3805     tclas         - Points to the first byte of the TCLAS, if any.
3806
3807 *******************************************************************************/
3808 #define CsrWifiSmeTspecReqCreate(msg__, dst__, src__, interfaceTag__, action__, transactionId__, strict__, ctrlMask__, tspecLength__, tspec__, tclasLength__, tclas__) \
3809     msg__ = (CsrWifiSmeTspecReq *) CsrPmemAlloc(sizeof(CsrWifiSmeTspecReq)); \
3810     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_TSPEC_REQ, dst__, src__); \
3811     msg__->interfaceTag = (interfaceTag__); \
3812     msg__->action = (action__); \
3813     msg__->transactionId = (transactionId__); \
3814     msg__->strict = (strict__); \
3815     msg__->ctrlMask = (ctrlMask__); \
3816     msg__->tspecLength = (tspecLength__); \
3817     msg__->tspec = (tspec__); \
3818     msg__->tclasLength = (tclasLength__); \
3819     msg__->tclas = (tclas__);
3820
3821 #define CsrWifiSmeTspecReqSendTo(dst__, src__, interfaceTag__, action__, transactionId__, strict__, ctrlMask__, tspecLength__, tspec__, tclasLength__, tclas__) \
3822     { \
3823         CsrWifiSmeTspecReq *msg__; \
3824         CsrWifiSmeTspecReqCreate(msg__, dst__, src__, interfaceTag__, action__, transactionId__, strict__, ctrlMask__, tspecLength__, tspec__, tclasLength__, tclas__); \
3825         CsrMsgTransport(dst__, CSR_WIFI_SME_PRIM, msg__); \
3826     }
3827
3828 #define CsrWifiSmeTspecReqSend(src__, interfaceTag__, action__, transactionId__, strict__, ctrlMask__, tspecLength__, tspec__, tclasLength__, tclas__) \
3829     CsrWifiSmeTspecReqSendTo(CSR_WIFI_SME_LIB_DESTINATION_QUEUE, src__, interfaceTag__, action__, transactionId__, strict__, ctrlMask__, tspecLength__, tspec__, tclasLength__, tclas__)
3830
3831 /*******************************************************************************
3832
3833   NAME
3834     CsrWifiSmeTspecIndSend
3835
3836   DESCRIPTION
3837     The SME will send this primitive to all the task that have registered to
3838     receive it when a status change in the TSPEC occurs.
3839
3840   PARAMETERS
3841     queue           - Destination Task Queue
3842     interfaceTag    - Interface Identifier; unique identifier of an interface
3843     transactionId   - Unique Transaction ID for the TSPEC, as assigned by the
3844                       driver
3845     tspecResultCode - Specifies the TSPEC operation requested by the peer
3846                       station
3847     tspecLength     - Length of the TSPEC.
3848     tspec           - Points to the first byte of the TSPEC
3849
3850 *******************************************************************************/
3851 #define CsrWifiSmeTspecIndCreate(msg__, dst__, src__, interfaceTag__, transactionId__, tspecResultCode__, tspecLength__, tspec__) \
3852     msg__ = (CsrWifiSmeTspecInd *) CsrPmemAlloc(sizeof(CsrWifiSmeTspecInd)); \
3853     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_TSPEC_IND, dst__, src__); \
3854     msg__->interfaceTag = (interfaceTag__); \
3855     msg__->transactionId = (transactionId__); \
3856     msg__->tspecResultCode = (tspecResultCode__); \
3857     msg__->tspecLength = (tspecLength__); \
3858     msg__->tspec = (tspec__);
3859
3860 #define CsrWifiSmeTspecIndSendTo(dst__, src__, interfaceTag__, transactionId__, tspecResultCode__, tspecLength__, tspec__) \
3861     { \
3862         CsrWifiSmeTspecInd *msg__; \
3863         CsrWifiSmeTspecIndCreate(msg__, dst__, src__, interfaceTag__, transactionId__, tspecResultCode__, tspecLength__, tspec__); \
3864         CsrSchedMessagePut(dst__, CSR_WIFI_SME_PRIM, msg__); \
3865     }
3866
3867 #define CsrWifiSmeTspecIndSend(dst__, interfaceTag__, transactionId__, tspecResultCode__, tspecLength__, tspec__) \
3868     CsrWifiSmeTspecIndSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, interfaceTag__, transactionId__, tspecResultCode__, tspecLength__, tspec__)
3869
3870 /*******************************************************************************
3871
3872   NAME
3873     CsrWifiSmeTspecCfmSend
3874
3875   DESCRIPTION
3876     The SME calls the primitive to report the result of the TSpec primitive
3877     request.
3878
3879   PARAMETERS
3880     queue           - Destination Task Queue
3881     interfaceTag    - Interface Identifier; unique identifier of an interface
3882     status          - Reports the result of the request
3883     transactionId   - Unique Transaction ID for the TSPEC, as assigned by the
3884                       driver
3885     tspecResultCode - Specifies the result of the negotiated TSPEC operation
3886     tspecLength     - Length of the TSPEC.
3887     tspec           - Points to the first byte of the TSPEC
3888
3889 *******************************************************************************/
3890 #define CsrWifiSmeTspecCfmCreate(msg__, dst__, src__, interfaceTag__, status__, transactionId__, tspecResultCode__, tspecLength__, tspec__) \
3891     msg__ = (CsrWifiSmeTspecCfm *) CsrPmemAlloc(sizeof(CsrWifiSmeTspecCfm)); \
3892     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_TSPEC_CFM, dst__, src__); \
3893     msg__->interfaceTag = (interfaceTag__); \
3894     msg__->status = (status__); \
3895     msg__->transactionId = (transactionId__); \
3896     msg__->tspecResultCode = (tspecResultCode__); \
3897     msg__->tspecLength = (tspecLength__); \
3898     msg__->tspec = (tspec__);
3899
3900 #define CsrWifiSmeTspecCfmSendTo(dst__, src__, interfaceTag__, status__, transactionId__, tspecResultCode__, tspecLength__, tspec__) \
3901     { \
3902         CsrWifiSmeTspecCfm *msg__; \
3903         CsrWifiSmeTspecCfmCreate(msg__, dst__, src__, interfaceTag__, status__, transactionId__, tspecResultCode__, tspecLength__, tspec__); \
3904         CsrSchedMessagePut(dst__, CSR_WIFI_SME_PRIM, msg__); \
3905     }
3906
3907 #define CsrWifiSmeTspecCfmSend(dst__, interfaceTag__, status__, transactionId__, tspecResultCode__, tspecLength__, tspec__) \
3908     CsrWifiSmeTspecCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, interfaceTag__, status__, transactionId__, tspecResultCode__, tspecLength__, tspec__)
3909
3910 /*******************************************************************************
3911
3912   NAME
3913     CsrWifiSmeVersionsGetReqSend
3914
3915   DESCRIPTION
3916     This primitive gets the value of the Versions parameter.
3917
3918   PARAMETERS
3919     queue  - Message Source Task Queue (Cfm's will be sent to this Queue)
3920
3921 *******************************************************************************/
3922 #define CsrWifiSmeVersionsGetReqCreate(msg__, dst__, src__) \
3923     msg__ = (CsrWifiSmeVersionsGetReq *) CsrPmemAlloc(sizeof(CsrWifiSmeVersionsGetReq)); \
3924     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_VERSIONS_GET_REQ, dst__, src__);
3925
3926 #define CsrWifiSmeVersionsGetReqSendTo(dst__, src__) \
3927     { \
3928         CsrWifiSmeVersionsGetReq *msg__; \
3929         CsrWifiSmeVersionsGetReqCreate(msg__, dst__, src__); \
3930         CsrMsgTransport(dst__, CSR_WIFI_SME_PRIM, msg__); \
3931     }
3932
3933 #define CsrWifiSmeVersionsGetReqSend(src__) \
3934     CsrWifiSmeVersionsGetReqSendTo(CSR_WIFI_SME_LIB_DESTINATION_QUEUE, src__)
3935
3936 /*******************************************************************************
3937
3938   NAME
3939     CsrWifiSmeVersionsGetCfmSend
3940
3941   DESCRIPTION
3942     This primitive reports the result of the request.
3943
3944   PARAMETERS
3945     queue    - Destination Task Queue
3946     status   - Reports the result of the request
3947     versions - Version IDs of the product
3948
3949 *******************************************************************************/
3950 #define CsrWifiSmeVersionsGetCfmCreate(msg__, dst__, src__, status__, versions__) \
3951     msg__ = (CsrWifiSmeVersionsGetCfm *) CsrPmemAlloc(sizeof(CsrWifiSmeVersionsGetCfm)); \
3952     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_VERSIONS_GET_CFM, dst__, src__); \
3953     msg__->status = (status__); \
3954     msg__->versions = (versions__);
3955
3956 #define CsrWifiSmeVersionsGetCfmSendTo(dst__, src__, status__, versions__) \
3957     { \
3958         CsrWifiSmeVersionsGetCfm *msg__; \
3959         CsrWifiSmeVersionsGetCfmCreate(msg__, dst__, src__, status__, versions__); \
3960         CsrSchedMessagePut(dst__, CSR_WIFI_SME_PRIM, msg__); \
3961     }
3962
3963 #define CsrWifiSmeVersionsGetCfmSend(dst__, status__, versions__) \
3964     CsrWifiSmeVersionsGetCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, status__, versions__)
3965
3966 /*******************************************************************************
3967
3968   NAME
3969     CsrWifiSmeWifiFlightmodeReqSend
3970
3971   DESCRIPTION
3972     The wireless manager application may call this primitive on boot-up of
3973     the platform to ensure that the chip is placed in a mode that prevents
3974     any emission of RF energy.
3975     This primitive is an alternative to CSR_WIFI_SME_WIFI_ON_REQ.
3976     As in CSR_WIFI_SME_WIFI_ON_REQ, it causes the download of the patch file
3977     (if any) and the programming of the initial MIB settings (if supplied by
3978     the WMA), but it also ensures that the chip is left in its lowest
3979     possible power-mode with the radio subsystems disabled.
3980     This feature is useful on platforms where power cannot be removed from
3981     the chip (leaving the chip not initialised will cause it to consume more
3982     power so calling this function ensures that the chip is initialised into
3983     a low power mode but without entering a state where it could emit any RF
3984     energy).
3985     NOTE: this primitive does not cause the Wi-Fi to change state: Wi-Fi
3986     stays conceptually off. Configuration primitives can be sent after
3987     CSR_WIFI_SME_WIFI_FLIGHTMODE_REQ and the configuration will be maintained.
3988     Requests that require the state of the Wi-Fi to be ON will return
3989     CSR_WIFI_SME_STATUS_WIFI_OFF in their confirms.
3990
3991   PARAMETERS
3992     queue         - Message Source Task Queue (Cfm's will be sent to this Queue)
3993     address       - Optionally specifies a station MAC address.
3994                     In normal use, the manager should set the address to 0xFF
3995                     0xFF 0xFF 0xFF 0xFF 0xFF, which will cause the chip to use
3996                     the MAC address in the MIB.
3997     mibFilesCount - Number of provided data blocks with initial MIB values
3998     mibFiles      - Points to the first data block with initial MIB values.
3999                     These data blocks are typically the contents of the provided
4000                     files ufmib.dat and localmib.dat, available from the host
4001                     file system, if they exist.
4002                     These files typically contain radio tuning and calibration
4003                     values.
4004                     More values can be created using the Host Tools.
4005
4006 *******************************************************************************/
4007 #define CsrWifiSmeWifiFlightmodeReqCreate(msg__, dst__, src__, address__, mibFilesCount__, mibFiles__) \
4008     msg__ = (CsrWifiSmeWifiFlightmodeReq *) CsrPmemAlloc(sizeof(CsrWifiSmeWifiFlightmodeReq)); \
4009     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_WIFI_FLIGHTMODE_REQ, dst__, src__); \
4010     msg__->address = (address__); \
4011     msg__->mibFilesCount = (mibFilesCount__); \
4012     msg__->mibFiles = (mibFiles__);
4013
4014 #define CsrWifiSmeWifiFlightmodeReqSendTo(dst__, src__, address__, mibFilesCount__, mibFiles__) \
4015     { \
4016         CsrWifiSmeWifiFlightmodeReq *msg__; \
4017         CsrWifiSmeWifiFlightmodeReqCreate(msg__, dst__, src__, address__, mibFilesCount__, mibFiles__); \
4018         CsrMsgTransport(dst__, CSR_WIFI_SME_PRIM, msg__); \
4019     }
4020
4021 #define CsrWifiSmeWifiFlightmodeReqSend(src__, address__, mibFilesCount__, mibFiles__) \
4022     CsrWifiSmeWifiFlightmodeReqSendTo(CSR_WIFI_SME_LIB_DESTINATION_QUEUE, src__, address__, mibFilesCount__, mibFiles__)
4023
4024 /*******************************************************************************
4025
4026   NAME
4027     CsrWifiSmeWifiFlightmodeCfmSend
4028
4029   DESCRIPTION
4030     The SME calls this primitive when the chip is initialised for low power
4031     mode and with the radio subsystem disabled. To leave flight mode, and
4032     enable Wi-Fi, the wireless manager application should call
4033     CSR_WIFI_SME_WIFI_ON_REQ.
4034
4035   PARAMETERS
4036     queue  - Destination Task Queue
4037     status - Reports the result of the request
4038
4039 *******************************************************************************/
4040 #define CsrWifiSmeWifiFlightmodeCfmCreate(msg__, dst__, src__, status__) \
4041     msg__ = (CsrWifiSmeWifiFlightmodeCfm *) CsrPmemAlloc(sizeof(CsrWifiSmeWifiFlightmodeCfm)); \
4042     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_WIFI_FLIGHTMODE_CFM, dst__, src__); \
4043     msg__->status = (status__);
4044
4045 #define CsrWifiSmeWifiFlightmodeCfmSendTo(dst__, src__, status__) \
4046     { \
4047         CsrWifiSmeWifiFlightmodeCfm *msg__; \
4048         CsrWifiSmeWifiFlightmodeCfmCreate(msg__, dst__, src__, status__); \
4049         CsrSchedMessagePut(dst__, CSR_WIFI_SME_PRIM, msg__); \
4050     }
4051
4052 #define CsrWifiSmeWifiFlightmodeCfmSend(dst__, status__) \
4053     CsrWifiSmeWifiFlightmodeCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, status__)
4054
4055 /*******************************************************************************
4056
4057   NAME
4058     CsrWifiSmeWifiOffReqSend
4059
4060   DESCRIPTION
4061     The wireless manager application calls this primitive to turn off the
4062     chip, thus saving power when Wi-Fi is not in use.
4063
4064   PARAMETERS
4065     queue  - Message Source Task Queue (Cfm's will be sent to this Queue)
4066
4067 *******************************************************************************/
4068 #define CsrWifiSmeWifiOffReqCreate(msg__, dst__, src__) \
4069     msg__ = (CsrWifiSmeWifiOffReq *) CsrPmemAlloc(sizeof(CsrWifiSmeWifiOffReq)); \
4070     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_WIFI_OFF_REQ, dst__, src__);
4071
4072 #define CsrWifiSmeWifiOffReqSendTo(dst__, src__) \
4073     { \
4074         CsrWifiSmeWifiOffReq *msg__; \
4075         CsrWifiSmeWifiOffReqCreate(msg__, dst__, src__); \
4076         CsrMsgTransport(dst__, CSR_WIFI_SME_PRIM, msg__); \
4077     }
4078
4079 #define CsrWifiSmeWifiOffReqSend(src__) \
4080     CsrWifiSmeWifiOffReqSendTo(CSR_WIFI_SME_LIB_DESTINATION_QUEUE, src__)
4081
4082 /*******************************************************************************
4083
4084   NAME
4085     CsrWifiSmeWifiOffIndSend
4086
4087   DESCRIPTION
4088     The SME sends this primitive to all the tasks that have registered to
4089     receive it to report that the chip has been turned off.
4090
4091   PARAMETERS
4092     queue  - Destination Task Queue
4093     reason - Indicates the reason why the Wi-Fi has been switched off.
4094
4095 *******************************************************************************/
4096 #define CsrWifiSmeWifiOffIndCreate(msg__, dst__, src__, reason__) \
4097     msg__ = (CsrWifiSmeWifiOffInd *) CsrPmemAlloc(sizeof(CsrWifiSmeWifiOffInd)); \
4098     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_WIFI_OFF_IND, dst__, src__); \
4099     msg__->reason = (reason__);
4100
4101 #define CsrWifiSmeWifiOffIndSendTo(dst__, src__, reason__) \
4102     { \
4103         CsrWifiSmeWifiOffInd *msg__; \
4104         CsrWifiSmeWifiOffIndCreate(msg__, dst__, src__, reason__); \
4105         CsrSchedMessagePut(dst__, CSR_WIFI_SME_PRIM, msg__); \
4106     }
4107
4108 #define CsrWifiSmeWifiOffIndSend(dst__, reason__) \
4109     CsrWifiSmeWifiOffIndSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, reason__)
4110
4111 /*******************************************************************************
4112
4113   NAME
4114     CsrWifiSmeWifiOffCfmSend
4115
4116   DESCRIPTION
4117     After receiving CSR_WIFI_SME_WIFI_OFF_REQ, if the chip is connected to a
4118     network, the SME will perform a disconnect operation, will send a
4119     CSR_WIFI_SME_MEDIA_STATUS_IND with
4120     CSR_WIFI_SME_MEDIA_STATUS_DISCONNECTED, and then will call
4121     CSR_WIFI_SME_WIFI_OFF_CFM when the chip is off.
4122
4123   PARAMETERS
4124     queue  - Destination Task Queue
4125     status - Reports the result of the request
4126
4127 *******************************************************************************/
4128 #define CsrWifiSmeWifiOffCfmCreate(msg__, dst__, src__, status__) \
4129     msg__ = (CsrWifiSmeWifiOffCfm *) CsrPmemAlloc(sizeof(CsrWifiSmeWifiOffCfm)); \
4130     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_WIFI_OFF_CFM, dst__, src__); \
4131     msg__->status = (status__);
4132
4133 #define CsrWifiSmeWifiOffCfmSendTo(dst__, src__, status__) \
4134     { \
4135         CsrWifiSmeWifiOffCfm *msg__; \
4136         CsrWifiSmeWifiOffCfmCreate(msg__, dst__, src__, status__); \
4137         CsrSchedMessagePut(dst__, CSR_WIFI_SME_PRIM, msg__); \
4138     }
4139
4140 #define CsrWifiSmeWifiOffCfmSend(dst__, status__) \
4141     CsrWifiSmeWifiOffCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, status__)
4142
4143 /*******************************************************************************
4144
4145   NAME
4146     CsrWifiSmeWifiOnReqSend
4147
4148   DESCRIPTION
4149     The wireless manager application calls this primitive to turn on the
4150     Wi-Fi chip.
4151     If the Wi-Fi chip is currently off, the SME turns the Wi-Fi chip on,
4152     downloads the patch file (if any), and programs the initial MIB settings
4153     (if supplied by the WMA).
4154     The patch file is not provided with the SME API; its downloading is
4155     automatic and handled internally by the system.
4156     The MIB settings, when provided, override the default values that the
4157     firmware loads from EEPROM.
4158     If the Wi-Fi chip is already on, the SME takes no action and returns a
4159     successful status in the confirm.
4160
4161   PARAMETERS
4162     queue         - Message Source Task Queue (Cfm's will be sent to this Queue)
4163     address       - Optionally specifies a station MAC address.
4164                     In normal use, the manager should set the address to 0xFF
4165                     0xFF 0xFF 0xFF 0xFF 0xFF, which will cause the chip to use
4166                     the MAC address in the MIB
4167     mibFilesCount - Number of provided data blocks with initial MIB values
4168     mibFiles      - Points to the first data block with initial MIB values.
4169                     These data blocks are typically the contents of the provided
4170                     files ufmib.dat and localmib.dat, available from the host
4171                     file system, if they exist.
4172                     These files typically contain radio tuning and calibration
4173                     values.
4174                     More values can be created using the Host Tools.
4175
4176 *******************************************************************************/
4177 #define CsrWifiSmeWifiOnReqCreate(msg__, dst__, src__, address__, mibFilesCount__, mibFiles__) \
4178     msg__ = (CsrWifiSmeWifiOnReq *) CsrPmemAlloc(sizeof(CsrWifiSmeWifiOnReq)); \
4179     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_WIFI_ON_REQ, dst__, src__); \
4180     msg__->address = (address__); \
4181     msg__->mibFilesCount = (mibFilesCount__); \
4182     msg__->mibFiles = (mibFiles__);
4183
4184 #define CsrWifiSmeWifiOnReqSendTo(dst__, src__, address__, mibFilesCount__, mibFiles__) \
4185     { \
4186         CsrWifiSmeWifiOnReq *msg__; \
4187         CsrWifiSmeWifiOnReqCreate(msg__, dst__, src__, address__, mibFilesCount__, mibFiles__); \
4188         CsrMsgTransport(dst__, CSR_WIFI_SME_PRIM, msg__); \
4189     }
4190
4191 #define CsrWifiSmeWifiOnReqSend(src__, address__, mibFilesCount__, mibFiles__) \
4192     CsrWifiSmeWifiOnReqSendTo(CSR_WIFI_SME_LIB_DESTINATION_QUEUE, src__, address__, mibFilesCount__, mibFiles__)
4193
4194 /*******************************************************************************
4195
4196   NAME
4197     CsrWifiSmeWifiOnIndSend
4198
4199   DESCRIPTION
4200     The SME sends this primitive to all tasks that have registered to receive
4201     it once the chip becomes available and ready to use.
4202
4203   PARAMETERS
4204     queue   - Destination Task Queue
4205     address - Current MAC address
4206
4207 *******************************************************************************/
4208 #define CsrWifiSmeWifiOnIndCreate(msg__, dst__, src__, address__) \
4209     msg__ = (CsrWifiSmeWifiOnInd *) CsrPmemAlloc(sizeof(CsrWifiSmeWifiOnInd)); \
4210     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_WIFI_ON_IND, dst__, src__); \
4211     msg__->address = (address__);
4212
4213 #define CsrWifiSmeWifiOnIndSendTo(dst__, src__, address__) \
4214     { \
4215         CsrWifiSmeWifiOnInd *msg__; \
4216         CsrWifiSmeWifiOnIndCreate(msg__, dst__, src__, address__); \
4217         CsrSchedMessagePut(dst__, CSR_WIFI_SME_PRIM, msg__); \
4218     }
4219
4220 #define CsrWifiSmeWifiOnIndSend(dst__, address__) \
4221     CsrWifiSmeWifiOnIndSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, address__)
4222
4223 /*******************************************************************************
4224
4225   NAME
4226     CsrWifiSmeWifiOnCfmSend
4227
4228   DESCRIPTION
4229     The SME sends this primitive to the task that has sent the request once
4230     the chip has been initialised and is available for use.
4231
4232   PARAMETERS
4233     queue  - Destination Task Queue
4234     status - Reports the result of the request
4235
4236 *******************************************************************************/
4237 #define CsrWifiSmeWifiOnCfmCreate(msg__, dst__, src__, status__) \
4238     msg__ = (CsrWifiSmeWifiOnCfm *) CsrPmemAlloc(sizeof(CsrWifiSmeWifiOnCfm)); \
4239     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_WIFI_ON_CFM, dst__, src__); \
4240     msg__->status = (status__);
4241
4242 #define CsrWifiSmeWifiOnCfmSendTo(dst__, src__, status__) \
4243     { \
4244         CsrWifiSmeWifiOnCfm *msg__; \
4245         CsrWifiSmeWifiOnCfmCreate(msg__, dst__, src__, status__); \
4246         CsrSchedMessagePut(dst__, CSR_WIFI_SME_PRIM, msg__); \
4247     }
4248
4249 #define CsrWifiSmeWifiOnCfmSend(dst__, status__) \
4250     CsrWifiSmeWifiOnCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, status__)
4251
4252 /*******************************************************************************
4253
4254   NAME
4255     CsrWifiSmeWpsConfigurationReqSend
4256
4257   DESCRIPTION
4258     This primitive passes the WPS information for the device to SME. This may
4259     be accepted only if no interface is active.
4260
4261   PARAMETERS
4262     queue     - Message Source Task Queue (Cfm's will be sent to this Queue)
4263     wpsConfig - WPS config.
4264
4265 *******************************************************************************/
4266 #define CsrWifiSmeWpsConfigurationReqCreate(msg__, dst__, src__, wpsConfig__) \
4267     msg__ = (CsrWifiSmeWpsConfigurationReq *) CsrPmemAlloc(sizeof(CsrWifiSmeWpsConfigurationReq)); \
4268     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_WPS_CONFIGURATION_REQ, dst__, src__); \
4269     msg__->wpsConfig = (wpsConfig__);
4270
4271 #define CsrWifiSmeWpsConfigurationReqSendTo(dst__, src__, wpsConfig__) \
4272     { \
4273         CsrWifiSmeWpsConfigurationReq *msg__; \
4274         CsrWifiSmeWpsConfigurationReqCreate(msg__, dst__, src__, wpsConfig__); \
4275         CsrMsgTransport(dst__, CSR_WIFI_SME_PRIM, msg__); \
4276     }
4277
4278 #define CsrWifiSmeWpsConfigurationReqSend(src__, wpsConfig__) \
4279     CsrWifiSmeWpsConfigurationReqSendTo(CSR_WIFI_SME_LIB_DESTINATION_QUEUE, src__, wpsConfig__)
4280
4281 /*******************************************************************************
4282
4283   NAME
4284     CsrWifiSmeWpsConfigurationCfmSend
4285
4286   DESCRIPTION
4287     Confirm.
4288
4289   PARAMETERS
4290     queue  - Destination Task Queue
4291     status - Status of the request.
4292
4293 *******************************************************************************/
4294 #define CsrWifiSmeWpsConfigurationCfmCreate(msg__, dst__, src__, status__) \
4295     msg__ = (CsrWifiSmeWpsConfigurationCfm *) CsrPmemAlloc(sizeof(CsrWifiSmeWpsConfigurationCfm)); \
4296     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_PRIM, CSR_WIFI_SME_WPS_CONFIGURATION_CFM, dst__, src__); \
4297     msg__->status = (status__);
4298
4299 #define CsrWifiSmeWpsConfigurationCfmSendTo(dst__, src__, status__) \
4300     { \
4301         CsrWifiSmeWpsConfigurationCfm *msg__; \
4302         CsrWifiSmeWpsConfigurationCfmCreate(msg__, dst__, src__, status__); \
4303         CsrSchedMessagePut(dst__, CSR_WIFI_SME_PRIM, msg__); \
4304     }
4305
4306 #define CsrWifiSmeWpsConfigurationCfmSend(dst__, status__) \
4307     CsrWifiSmeWpsConfigurationCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, status__)
4308
4309
4310 #ifdef __cplusplus
4311 }
4312 #endif
4313
4314 #endif /* CSR_WIFI_SME_LIB_H__ */