]> Pileus Git - ~andy/linux/blob - drivers/staging/csr/csr_wifi_sme_ap_lib.h
Merge branch 'for-linus-37rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml
[~andy/linux] / drivers / staging / csr / csr_wifi_sme_ap_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_AP_LIB_H__
14 #define CSR_WIFI_SME_AP_LIB_H__
15
16 #include "csr_sched.h"
17 #include "csr_macro.h"
18 #include "csr_msg_transport.h"
19
20 #include "csr_wifi_lib.h"
21
22 #include "csr_wifi_sme_ap_prim.h"
23 #include "csr_wifi_sme_task.h"
24
25
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29
30 #ifndef CSR_WIFI_AP_ENABLE
31 #error CSR_WIFI_AP_ENABLE MUST be defined inorder to use csr_wifi_sme_ap_lib.h
32 #endif
33
34 /*----------------------------------------------------------------------------*
35  *  CsrWifiSmeApFreeUpstreamMessageContents
36  *
37  *  DESCRIPTION
38  *      Free the allocated memory in a CSR_WIFI_SME_AP upstream message. Does not
39  *      free the message itself, and can only be used for upstream messages.
40  *
41  *  PARAMETERS
42  *      Deallocates the resources in a CSR_WIFI_SME_AP upstream message
43  *----------------------------------------------------------------------------*/
44 void CsrWifiSmeApFreeUpstreamMessageContents(u16 eventClass, void *message);
45
46 /*----------------------------------------------------------------------------*
47  *  CsrWifiSmeApFreeDownstreamMessageContents
48  *
49  *  DESCRIPTION
50  *      Free the allocated memory in a CSR_WIFI_SME_AP downstream message. Does not
51  *      free the message itself, and can only be used for downstream messages.
52  *
53  *  PARAMETERS
54  *      Deallocates the resources in a CSR_WIFI_SME_AP downstream message
55  *----------------------------------------------------------------------------*/
56 void CsrWifiSmeApFreeDownstreamMessageContents(u16 eventClass, void *message);
57
58 /*----------------------------------------------------------------------------*
59  * Enum to string functions
60  *----------------------------------------------------------------------------*/
61 const char* CsrWifiSmeApAccessTypeToString(CsrWifiSmeApAccessType value);
62 const char* CsrWifiSmeApAuthSupportToString(CsrWifiSmeApAuthSupport value);
63 const char* CsrWifiSmeApAuthTypeToString(CsrWifiSmeApAuthType value);
64 const char* CsrWifiSmeApDirectionToString(CsrWifiSmeApDirection value);
65 const char* CsrWifiSmeApPhySupportToString(CsrWifiSmeApPhySupport value);
66 const char* CsrWifiSmeApTypeToString(CsrWifiSmeApType value);
67
68
69 /*----------------------------------------------------------------------------*
70  * CsrPrim Type toString function.
71  * Converts a message type to the String name of the Message
72  *----------------------------------------------------------------------------*/
73 const char* CsrWifiSmeApPrimTypeToString(CsrPrim msgType);
74
75 /*----------------------------------------------------------------------------*
76  * Lookup arrays for PrimType name Strings
77  *----------------------------------------------------------------------------*/
78 extern const char *CsrWifiSmeApUpstreamPrimNames[CSR_WIFI_SME_AP_PRIM_UPSTREAM_COUNT];
79 extern const char *CsrWifiSmeApDownstreamPrimNames[CSR_WIFI_SME_AP_PRIM_DOWNSTREAM_COUNT];
80
81 /*******************************************************************************
82
83   NAME
84     CsrWifiSmeApActiveBaGetReqSend
85
86   DESCRIPTION
87     This primitive used to retrieve information related to the active block
88     ack sessions
89
90   PARAMETERS
91     queue        - Message Source Task Queue (Cfm's will be sent to this Queue)
92     interfaceTag -
93
94 *******************************************************************************/
95 #define CsrWifiSmeApActiveBaGetReqCreate(msg__, dst__, src__, interfaceTag__) \
96     msg__ = kmalloc(sizeof(CsrWifiSmeApActiveBaGetReq), GFP_KERNEL); \
97     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_AP_PRIM, CSR_WIFI_SME_AP_ACTIVE_BA_GET_REQ, dst__, src__); \
98     msg__->interfaceTag = (interfaceTag__);
99
100 #define CsrWifiSmeApActiveBaGetReqSendTo(dst__, src__, interfaceTag__) \
101     { \
102         CsrWifiSmeApActiveBaGetReq *msg__; \
103         CsrWifiSmeApActiveBaGetReqCreate(msg__, dst__, src__, interfaceTag__); \
104         CsrMsgTransport(dst__, CSR_WIFI_SME_AP_PRIM, msg__); \
105     }
106
107 #define CsrWifiSmeApActiveBaGetReqSend(src__, interfaceTag__) \
108     CsrWifiSmeApActiveBaGetReqSendTo(CSR_WIFI_SME_IFACEQUEUE, src__, interfaceTag__)
109
110 /*******************************************************************************
111
112   NAME
113     CsrWifiSmeApActiveBaGetCfmSend
114
115   DESCRIPTION
116     This primitive carries the information related to the active ba sessions
117
118   PARAMETERS
119     queue            - Destination Task Queue
120     interfaceTag     -
121     status           - Reports the result of the request
122     activeBaCount    - Number of active block ack session
123     activeBaSessions - Points to a buffer containing an array of
124                        CsrWifiSmeApBaSession structures.
125
126 *******************************************************************************/
127 #define CsrWifiSmeApActiveBaGetCfmCreate(msg__, dst__, src__, interfaceTag__, status__, activeBaCount__, activeBaSessions__) \
128     msg__ = kmalloc(sizeof(CsrWifiSmeApActiveBaGetCfm), GFP_KERNEL); \
129     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_AP_PRIM, CSR_WIFI_SME_AP_ACTIVE_BA_GET_CFM, dst__, src__); \
130     msg__->interfaceTag = (interfaceTag__); \
131     msg__->status = (status__); \
132     msg__->activeBaCount = (activeBaCount__); \
133     msg__->activeBaSessions = (activeBaSessions__);
134
135 #define CsrWifiSmeApActiveBaGetCfmSendTo(dst__, src__, interfaceTag__, status__, activeBaCount__, activeBaSessions__) \
136     { \
137         CsrWifiSmeApActiveBaGetCfm *msg__; \
138         CsrWifiSmeApActiveBaGetCfmCreate(msg__, dst__, src__, interfaceTag__, status__, activeBaCount__, activeBaSessions__); \
139         CsrSchedMessagePut(dst__, CSR_WIFI_SME_AP_PRIM, msg__); \
140     }
141
142 #define CsrWifiSmeApActiveBaGetCfmSend(dst__, interfaceTag__, status__, activeBaCount__, activeBaSessions__) \
143     CsrWifiSmeApActiveBaGetCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, interfaceTag__, status__, activeBaCount__, activeBaSessions__)
144
145 /*******************************************************************************
146
147   NAME
148     CsrWifiSmeApBaDeleteReqSend
149
150   DESCRIPTION
151     This primitive is used to delete an active block ack session
152
153   PARAMETERS
154     queue        - Message Source Task Queue (Cfm's will be sent to this Queue)
155     interfaceTag -
156     reason       -
157     baSession    - BA session to be deleted
158
159 *******************************************************************************/
160 #define CsrWifiSmeApBaDeleteReqCreate(msg__, dst__, src__, interfaceTag__, reason__, baSession__) \
161     msg__ = kmalloc(sizeof(CsrWifiSmeApBaDeleteReq), GFP_KERNEL); \
162     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_AP_PRIM, CSR_WIFI_SME_AP_BA_DELETE_REQ, dst__, src__); \
163     msg__->interfaceTag = (interfaceTag__); \
164     msg__->reason = (reason__); \
165     msg__->baSession = (baSession__);
166
167 #define CsrWifiSmeApBaDeleteReqSendTo(dst__, src__, interfaceTag__, reason__, baSession__) \
168     { \
169         CsrWifiSmeApBaDeleteReq *msg__; \
170         CsrWifiSmeApBaDeleteReqCreate(msg__, dst__, src__, interfaceTag__, reason__, baSession__); \
171         CsrMsgTransport(dst__, CSR_WIFI_SME_AP_PRIM, msg__); \
172     }
173
174 #define CsrWifiSmeApBaDeleteReqSend(src__, interfaceTag__, reason__, baSession__) \
175     CsrWifiSmeApBaDeleteReqSendTo(CSR_WIFI_SME_IFACEQUEUE, src__, interfaceTag__, reason__, baSession__)
176
177 /*******************************************************************************
178
179   NAME
180     CsrWifiSmeApBaDeleteCfmSend
181
182   DESCRIPTION
183     This primitive confirms the BA is deleted
184
185   PARAMETERS
186     queue        - Destination Task Queue
187     interfaceTag -
188     status       - Reports the result of the request
189     baSession    - deleted BA session
190
191 *******************************************************************************/
192 #define CsrWifiSmeApBaDeleteCfmCreate(msg__, dst__, src__, interfaceTag__, status__, baSession__) \
193     msg__ = kmalloc(sizeof(CsrWifiSmeApBaDeleteCfm), GFP_KERNEL); \
194     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_AP_PRIM, CSR_WIFI_SME_AP_BA_DELETE_CFM, dst__, src__); \
195     msg__->interfaceTag = (interfaceTag__); \
196     msg__->status = (status__); \
197     msg__->baSession = (baSession__);
198
199 #define CsrWifiSmeApBaDeleteCfmSendTo(dst__, src__, interfaceTag__, status__, baSession__) \
200     { \
201         CsrWifiSmeApBaDeleteCfm *msg__; \
202         CsrWifiSmeApBaDeleteCfmCreate(msg__, dst__, src__, interfaceTag__, status__, baSession__); \
203         CsrSchedMessagePut(dst__, CSR_WIFI_SME_AP_PRIM, msg__); \
204     }
205
206 #define CsrWifiSmeApBaDeleteCfmSend(dst__, interfaceTag__, status__, baSession__) \
207     CsrWifiSmeApBaDeleteCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, interfaceTag__, status__, baSession__)
208
209 /*******************************************************************************
210
211   NAME
212     CsrWifiSmeApBeaconingStartReqSend
213
214   DESCRIPTION
215     This primitive requests the SME to start AP or GO functionality
216
217   PARAMETERS
218     queue           - Message Source Task Queue (Cfm's will be sent to this Queue)
219     interfaceTag    -
220     initialPresence - Set to 0, if Not in a group fomration phase, set to 1 ,
221                       during group formation phase
222     apType          - apType : Legacy AP or P2PGO
223     cloakSsid       - cloakSsid flag.
224     ssid            - ssid.
225     ifIndex         - Radio Interface
226     channel         - channel.
227     maxConnections  - Maximum Stations + P2PClients allowed
228     apCredentials   - AP security credeitals used to advertise in beacon /probe
229                       response
230     smeApConfig     - AP configuration
231     p2pGoParam      - P2P specific GO parameters. Ignored if it is a leagacy AP
232
233 *******************************************************************************/
234 #define CsrWifiSmeApBeaconingStartReqCreate(msg__, dst__, src__, interfaceTag__, initialPresence__, apType__, cloakSsid__, ssid__, ifIndex__, channel__, maxConnections__, apCredentials__, smeApConfig__, p2pGoParam__) \
235     msg__ = kmalloc(sizeof(CsrWifiSmeApBeaconingStartReq), GFP_KERNEL); \
236     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_AP_PRIM, CSR_WIFI_SME_AP_BEACONING_START_REQ, dst__, src__); \
237     msg__->interfaceTag = (interfaceTag__); \
238     msg__->initialPresence = (initialPresence__); \
239     msg__->apType = (apType__); \
240     msg__->cloakSsid = (cloakSsid__); \
241     msg__->ssid = (ssid__); \
242     msg__->ifIndex = (ifIndex__); \
243     msg__->channel = (channel__); \
244     msg__->maxConnections = (maxConnections__); \
245     msg__->apCredentials = (apCredentials__); \
246     msg__->smeApConfig = (smeApConfig__); \
247     msg__->p2pGoParam = (p2pGoParam__);
248
249 #define CsrWifiSmeApBeaconingStartReqSendTo(dst__, src__, interfaceTag__, initialPresence__, apType__, cloakSsid__, ssid__, ifIndex__, channel__, maxConnections__, apCredentials__, smeApConfig__, p2pGoParam__) \
250     { \
251         CsrWifiSmeApBeaconingStartReq *msg__; \
252         CsrWifiSmeApBeaconingStartReqCreate(msg__, dst__, src__, interfaceTag__, initialPresence__, apType__, cloakSsid__, ssid__, ifIndex__, channel__, maxConnections__, apCredentials__, smeApConfig__, p2pGoParam__); \
253         CsrMsgTransport(dst__, CSR_WIFI_SME_AP_PRIM, msg__); \
254     }
255
256 #define CsrWifiSmeApBeaconingStartReqSend(src__, interfaceTag__, initialPresence__, apType__, cloakSsid__, ssid__, ifIndex__, channel__, maxConnections__, apCredentials__, smeApConfig__, p2pGoParam__) \
257     CsrWifiSmeApBeaconingStartReqSendTo(CSR_WIFI_SME_IFACEQUEUE, src__, interfaceTag__, initialPresence__, apType__, cloakSsid__, ssid__, ifIndex__, channel__, maxConnections__, apCredentials__, smeApConfig__, p2pGoParam__)
258
259 /*******************************************************************************
260
261   NAME
262     CsrWifiSmeApBeaconingStartCfmSend
263
264   DESCRIPTION
265     This primitive confirms the completion of the request along with the
266     status
267
268   PARAMETERS
269     queue        - Destination Task Queue
270     interfaceTag -
271     status       -
272     secIeLength  -
273     secIe        -
274
275 *******************************************************************************/
276 #define CsrWifiSmeApBeaconingStartCfmCreate(msg__, dst__, src__, interfaceTag__, status__, secIeLength__, secIe__) \
277     msg__ = kmalloc(sizeof(CsrWifiSmeApBeaconingStartCfm), GFP_KERNEL); \
278     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_AP_PRIM, CSR_WIFI_SME_AP_BEACONING_START_CFM, dst__, src__); \
279     msg__->interfaceTag = (interfaceTag__); \
280     msg__->status = (status__); \
281     msg__->secIeLength = (secIeLength__); \
282     msg__->secIe = (secIe__);
283
284 #define CsrWifiSmeApBeaconingStartCfmSendTo(dst__, src__, interfaceTag__, status__, secIeLength__, secIe__) \
285     { \
286         CsrWifiSmeApBeaconingStartCfm *msg__; \
287         CsrWifiSmeApBeaconingStartCfmCreate(msg__, dst__, src__, interfaceTag__, status__, secIeLength__, secIe__); \
288         CsrSchedMessagePut(dst__, CSR_WIFI_SME_AP_PRIM, msg__); \
289     }
290
291 #define CsrWifiSmeApBeaconingStartCfmSend(dst__, interfaceTag__, status__, secIeLength__, secIe__) \
292     CsrWifiSmeApBeaconingStartCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, interfaceTag__, status__, secIeLength__, secIe__)
293
294 /*******************************************************************************
295
296   NAME
297     CsrWifiSmeApBeaconingStopReqSend
298
299   DESCRIPTION
300     This primitive requests the SME to STOP AP or P2PGO operation
301
302   PARAMETERS
303     queue        - Message Source Task Queue (Cfm's will be sent to this Queue)
304     interfaceTag -
305
306 *******************************************************************************/
307 #define CsrWifiSmeApBeaconingStopReqCreate(msg__, dst__, src__, interfaceTag__) \
308     msg__ = kmalloc(sizeof(CsrWifiSmeApBeaconingStopReq), GFP_KERNEL); \
309     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_AP_PRIM, CSR_WIFI_SME_AP_BEACONING_STOP_REQ, dst__, src__); \
310     msg__->interfaceTag = (interfaceTag__);
311
312 #define CsrWifiSmeApBeaconingStopReqSendTo(dst__, src__, interfaceTag__) \
313     { \
314         CsrWifiSmeApBeaconingStopReq *msg__; \
315         CsrWifiSmeApBeaconingStopReqCreate(msg__, dst__, src__, interfaceTag__); \
316         CsrMsgTransport(dst__, CSR_WIFI_SME_AP_PRIM, msg__); \
317     }
318
319 #define CsrWifiSmeApBeaconingStopReqSend(src__, interfaceTag__) \
320     CsrWifiSmeApBeaconingStopReqSendTo(CSR_WIFI_SME_IFACEQUEUE, src__, interfaceTag__)
321
322 /*******************************************************************************
323
324   NAME
325     CsrWifiSmeApBeaconingStopCfmSend
326
327   DESCRIPTION
328     This primitive confirms AP or P2PGO operation is terminated
329
330   PARAMETERS
331     queue        - Destination Task Queue
332     interfaceTag -
333     status       -
334
335 *******************************************************************************/
336 #define CsrWifiSmeApBeaconingStopCfmCreate(msg__, dst__, src__, interfaceTag__, status__) \
337     msg__ = kmalloc(sizeof(CsrWifiSmeApBeaconingStopCfm), GFP_KERNEL); \
338     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_AP_PRIM, CSR_WIFI_SME_AP_BEACONING_STOP_CFM, dst__, src__); \
339     msg__->interfaceTag = (interfaceTag__); \
340     msg__->status = (status__);
341
342 #define CsrWifiSmeApBeaconingStopCfmSendTo(dst__, src__, interfaceTag__, status__) \
343     { \
344         CsrWifiSmeApBeaconingStopCfm *msg__; \
345         CsrWifiSmeApBeaconingStopCfmCreate(msg__, dst__, src__, interfaceTag__, status__); \
346         CsrSchedMessagePut(dst__, CSR_WIFI_SME_AP_PRIM, msg__); \
347     }
348
349 #define CsrWifiSmeApBeaconingStopCfmSend(dst__, interfaceTag__, status__) \
350     CsrWifiSmeApBeaconingStopCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, interfaceTag__, status__)
351
352 /*******************************************************************************
353
354   NAME
355     CsrWifiSmeApErrorIndSend
356
357   DESCRIPTION
358     This primitve is sent by SME to indicate some error in AP operationi
359     after AP operations were started successfully and continuing the AP
360     operation may lead to undesired behaviour. It is the responsibility of
361     the upper layers to stop AP operation if needed
362
363   PARAMETERS
364     queue        - Destination Task Queue
365     interfaceTag - Range 0-1
366     apType       -
367     status       - Contains the error status
368
369 *******************************************************************************/
370 #define CsrWifiSmeApErrorIndCreate(msg__, dst__, src__, interfaceTag__, apType__, status__) \
371     msg__ = kmalloc(sizeof(CsrWifiSmeApErrorInd), GFP_KERNEL); \
372     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_AP_PRIM, CSR_WIFI_SME_AP_ERROR_IND, dst__, src__); \
373     msg__->interfaceTag = (interfaceTag__); \
374     msg__->apType = (apType__); \
375     msg__->status = (status__);
376
377 #define CsrWifiSmeApErrorIndSendTo(dst__, src__, interfaceTag__, apType__, status__) \
378     { \
379         CsrWifiSmeApErrorInd *msg__; \
380         CsrWifiSmeApErrorIndCreate(msg__, dst__, src__, interfaceTag__, apType__, status__); \
381         CsrSchedMessagePut(dst__, CSR_WIFI_SME_AP_PRIM, msg__); \
382     }
383
384 #define CsrWifiSmeApErrorIndSend(dst__, interfaceTag__, apType__, status__) \
385     CsrWifiSmeApErrorIndSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, interfaceTag__, apType__, status__)
386
387 /*******************************************************************************
388
389   NAME
390     CsrWifiSmeApStaConnectStartIndSend
391
392   DESCRIPTION
393     This primitive indicates that a stations request to join the group/BSS is
394     accepted
395
396   PARAMETERS
397     queue          - Destination Task Queue
398     interfaceTag   -
399     peerMacAddress -
400
401 *******************************************************************************/
402 #define CsrWifiSmeApStaConnectStartIndCreate(msg__, dst__, src__, interfaceTag__, peerMacAddress__) \
403     msg__ = kmalloc(sizeof(CsrWifiSmeApStaConnectStartInd), GFP_KERNEL); \
404     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_AP_PRIM, CSR_WIFI_SME_AP_STA_CONNECT_START_IND, dst__, src__); \
405     msg__->interfaceTag = (interfaceTag__); \
406     msg__->peerMacAddress = (peerMacAddress__);
407
408 #define CsrWifiSmeApStaConnectStartIndSendTo(dst__, src__, interfaceTag__, peerMacAddress__) \
409     { \
410         CsrWifiSmeApStaConnectStartInd *msg__; \
411         CsrWifiSmeApStaConnectStartIndCreate(msg__, dst__, src__, interfaceTag__, peerMacAddress__); \
412         CsrSchedMessagePut(dst__, CSR_WIFI_SME_AP_PRIM, msg__); \
413     }
414
415 #define CsrWifiSmeApStaConnectStartIndSend(dst__, interfaceTag__, peerMacAddress__) \
416     CsrWifiSmeApStaConnectStartIndSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, interfaceTag__, peerMacAddress__)
417
418 /*******************************************************************************
419
420   NAME
421     CsrWifiSmeApStaDisconnectReqSend
422
423   DESCRIPTION
424     This primitive tells SME to deauth ot disassociate a particular station
425     within BSS
426
427   PARAMETERS
428     queue          - Message Source Task Queue (Cfm's will be sent to this Queue)
429     interfaceTag   -
430     deauthReason   -
431     disassocReason -
432     peerMacaddress -
433     keepBlocking   - If TRUE, the station is blocked. If FALSE and the station
434                      is connected, disconnect the station. If FALSE and the
435                      station is not connected, no action is taken.
436
437 *******************************************************************************/
438 #define CsrWifiSmeApStaDisconnectReqCreate(msg__, dst__, src__, interfaceTag__, deauthReason__, disassocReason__, peerMacaddress__, keepBlocking__) \
439     msg__ = kmalloc(sizeof(CsrWifiSmeApStaDisconnectReq), GFP_KERNEL); \
440     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_AP_PRIM, CSR_WIFI_SME_AP_STA_DISCONNECT_REQ, dst__, src__); \
441     msg__->interfaceTag = (interfaceTag__); \
442     msg__->deauthReason = (deauthReason__); \
443     msg__->disassocReason = (disassocReason__); \
444     msg__->peerMacaddress = (peerMacaddress__); \
445     msg__->keepBlocking = (keepBlocking__);
446
447 #define CsrWifiSmeApStaDisconnectReqSendTo(dst__, src__, interfaceTag__, deauthReason__, disassocReason__, peerMacaddress__, keepBlocking__) \
448     { \
449         CsrWifiSmeApStaDisconnectReq *msg__; \
450         CsrWifiSmeApStaDisconnectReqCreate(msg__, dst__, src__, interfaceTag__, deauthReason__, disassocReason__, peerMacaddress__, keepBlocking__); \
451         CsrMsgTransport(dst__, CSR_WIFI_SME_AP_PRIM, msg__); \
452     }
453
454 #define CsrWifiSmeApStaDisconnectReqSend(src__, interfaceTag__, deauthReason__, disassocReason__, peerMacaddress__, keepBlocking__) \
455     CsrWifiSmeApStaDisconnectReqSendTo(CSR_WIFI_SME_IFACEQUEUE, src__, interfaceTag__, deauthReason__, disassocReason__, peerMacaddress__, keepBlocking__)
456
457 /*******************************************************************************
458
459   NAME
460     CsrWifiSmeApStaDisconnectCfmSend
461
462   DESCRIPTION
463     This primitive confirms the station is disconnected
464
465   PARAMETERS
466     queue          - Destination Task Queue
467     interfaceTag   -
468     status         -
469     peerMacaddress -
470
471 *******************************************************************************/
472 #define CsrWifiSmeApStaDisconnectCfmCreate(msg__, dst__, src__, interfaceTag__, status__, peerMacaddress__) \
473     msg__ = kmalloc(sizeof(CsrWifiSmeApStaDisconnectCfm), GFP_KERNEL); \
474     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_AP_PRIM, CSR_WIFI_SME_AP_STA_DISCONNECT_CFM, dst__, src__); \
475     msg__->interfaceTag = (interfaceTag__); \
476     msg__->status = (status__); \
477     msg__->peerMacaddress = (peerMacaddress__);
478
479 #define CsrWifiSmeApStaDisconnectCfmSendTo(dst__, src__, interfaceTag__, status__, peerMacaddress__) \
480     { \
481         CsrWifiSmeApStaDisconnectCfm *msg__; \
482         CsrWifiSmeApStaDisconnectCfmCreate(msg__, dst__, src__, interfaceTag__, status__, peerMacaddress__); \
483         CsrSchedMessagePut(dst__, CSR_WIFI_SME_AP_PRIM, msg__); \
484     }
485
486 #define CsrWifiSmeApStaDisconnectCfmSend(dst__, interfaceTag__, status__, peerMacaddress__) \
487     CsrWifiSmeApStaDisconnectCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, interfaceTag__, status__, peerMacaddress__)
488
489 /*******************************************************************************
490
491   NAME
492     CsrWifiSmeApStaNotifyIndSend
493
494   DESCRIPTION
495     This primitive indicates that a station has joined or a previously joined
496     station has left the BSS/group
497
498   PARAMETERS
499     queue             - Destination Task Queue
500     interfaceTag      -
501     mediaStatus       -
502     peerMacAddress    -
503     peerDeviceAddress -
504     disassocReason    -
505     deauthReason      -
506     WpsRegistration   -
507     secIeLength       -
508     secIe             -
509     groupKeyId        -
510     seqNumber         -
511
512 *******************************************************************************/
513 #define CsrWifiSmeApStaNotifyIndCreate(msg__, dst__, src__, interfaceTag__, mediaStatus__, peerMacAddress__, peerDeviceAddress__, disassocReason__, deauthReason__, WpsRegistration__, secIeLength__, secIe__, groupKeyId__, seqNumber__) \
514     msg__ = kmalloc(sizeof(CsrWifiSmeApStaNotifyInd), GFP_KERNEL); \
515     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_AP_PRIM, CSR_WIFI_SME_AP_STA_NOTIFY_IND, dst__, src__); \
516     msg__->interfaceTag = (interfaceTag__); \
517     msg__->mediaStatus = (mediaStatus__); \
518     msg__->peerMacAddress = (peerMacAddress__); \
519     msg__->peerDeviceAddress = (peerDeviceAddress__); \
520     msg__->disassocReason = (disassocReason__); \
521     msg__->deauthReason = (deauthReason__); \
522     msg__->WpsRegistration = (WpsRegistration__); \
523     msg__->secIeLength = (secIeLength__); \
524     msg__->secIe = (secIe__); \
525     msg__->groupKeyId = (groupKeyId__); \
526     memcpy(msg__->seqNumber, (seqNumber__), sizeof(u16) * 8);
527
528 #define CsrWifiSmeApStaNotifyIndSendTo(dst__, src__, interfaceTag__, mediaStatus__, peerMacAddress__, peerDeviceAddress__, disassocReason__, deauthReason__, WpsRegistration__, secIeLength__, secIe__, groupKeyId__, seqNumber__) \
529     { \
530         CsrWifiSmeApStaNotifyInd *msg__; \
531         CsrWifiSmeApStaNotifyIndCreate(msg__, dst__, src__, interfaceTag__, mediaStatus__, peerMacAddress__, peerDeviceAddress__, disassocReason__, deauthReason__, WpsRegistration__, secIeLength__, secIe__, groupKeyId__, seqNumber__); \
532         CsrSchedMessagePut(dst__, CSR_WIFI_SME_AP_PRIM, msg__); \
533     }
534
535 #define CsrWifiSmeApStaNotifyIndSend(dst__, interfaceTag__, mediaStatus__, peerMacAddress__, peerDeviceAddress__, disassocReason__, deauthReason__, WpsRegistration__, secIeLength__, secIe__, groupKeyId__, seqNumber__) \
536     CsrWifiSmeApStaNotifyIndSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, interfaceTag__, mediaStatus__, peerMacAddress__, peerDeviceAddress__, disassocReason__, deauthReason__, WpsRegistration__, secIeLength__, secIe__, groupKeyId__, seqNumber__)
537
538 /*******************************************************************************
539
540   NAME
541     CsrWifiSmeApWmmParamUpdateReqSend
542
543   DESCRIPTION
544     Application uses this primitive to update the WMM parameters on the fly
545
546   PARAMETERS
547     queue         - Message Source Task Queue (Cfm's will be sent to this Queue)
548     interfaceTag  -
549     wmmApParams   - WMM parameters to be used for local firmware queue
550                     configuration
551     wmmApBcParams - WMM parameters to be advertised in beacon/probe response
552
553 *******************************************************************************/
554 #define CsrWifiSmeApWmmParamUpdateReqCreate(msg__, dst__, src__, interfaceTag__, wmmApParams__, wmmApBcParams__) \
555     msg__ = kmalloc(sizeof(CsrWifiSmeApWmmParamUpdateReq), GFP_KERNEL); \
556     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_AP_PRIM, CSR_WIFI_SME_AP_WMM_PARAM_UPDATE_REQ, dst__, src__); \
557     msg__->interfaceTag = (interfaceTag__); \
558     memcpy(msg__->wmmApParams, (wmmApParams__), sizeof(CsrWifiSmeWmmAcParams) * 4); \
559     memcpy(msg__->wmmApBcParams, (wmmApBcParams__), sizeof(CsrWifiSmeWmmAcParams) * 4);
560
561 #define CsrWifiSmeApWmmParamUpdateReqSendTo(dst__, src__, interfaceTag__, wmmApParams__, wmmApBcParams__) \
562     { \
563         CsrWifiSmeApWmmParamUpdateReq *msg__; \
564         CsrWifiSmeApWmmParamUpdateReqCreate(msg__, dst__, src__, interfaceTag__, wmmApParams__, wmmApBcParams__); \
565         CsrMsgTransport(dst__, CSR_WIFI_SME_AP_PRIM, msg__); \
566     }
567
568 #define CsrWifiSmeApWmmParamUpdateReqSend(src__, interfaceTag__, wmmApParams__, wmmApBcParams__) \
569     CsrWifiSmeApWmmParamUpdateReqSendTo(CSR_WIFI_SME_IFACEQUEUE, src__, interfaceTag__, wmmApParams__, wmmApBcParams__)
570
571 /*******************************************************************************
572
573   NAME
574     CsrWifiSmeApWmmParamUpdateCfmSend
575
576   DESCRIPTION
577     A confirm for CSR_WIFI_SME_AP_WMM_PARAM_UPDATE.request
578
579   PARAMETERS
580     queue        - Destination Task Queue
581     interfaceTag -
582     status       -
583
584 *******************************************************************************/
585 #define CsrWifiSmeApWmmParamUpdateCfmCreate(msg__, dst__, src__, interfaceTag__, status__) \
586     msg__ = kmalloc(sizeof(CsrWifiSmeApWmmParamUpdateCfm), GFP_KERNEL); \
587     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_AP_PRIM, CSR_WIFI_SME_AP_WMM_PARAM_UPDATE_CFM, dst__, src__); \
588     msg__->interfaceTag = (interfaceTag__); \
589     msg__->status = (status__);
590
591 #define CsrWifiSmeApWmmParamUpdateCfmSendTo(dst__, src__, interfaceTag__, status__) \
592     { \
593         CsrWifiSmeApWmmParamUpdateCfm *msg__; \
594         CsrWifiSmeApWmmParamUpdateCfmCreate(msg__, dst__, src__, interfaceTag__, status__); \
595         CsrSchedMessagePut(dst__, CSR_WIFI_SME_AP_PRIM, msg__); \
596     }
597
598 #define CsrWifiSmeApWmmParamUpdateCfmSend(dst__, interfaceTag__, status__) \
599     CsrWifiSmeApWmmParamUpdateCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, interfaceTag__, status__)
600
601 /*******************************************************************************
602
603   NAME
604     CsrWifiSmeApWpsConfigurationReqSend
605
606   DESCRIPTION
607     This primitive passes the WPS information for the device to SME. This may
608     be accepted only if no interface is active.
609
610   PARAMETERS
611     queue     - Message Source Task Queue (Cfm's will be sent to this Queue)
612     wpsConfig - WPS config.
613
614 *******************************************************************************/
615 #define CsrWifiSmeApWpsConfigurationReqCreate(msg__, dst__, src__, wpsConfig__) \
616     msg__ = kmalloc(sizeof(CsrWifiSmeApWpsConfigurationReq), GFP_KERNEL); \
617     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_AP_PRIM, CSR_WIFI_SME_AP_WPS_CONFIGURATION_REQ, dst__, src__); \
618     msg__->wpsConfig = (wpsConfig__);
619
620 #define CsrWifiSmeApWpsConfigurationReqSendTo(dst__, src__, wpsConfig__) \
621     { \
622         CsrWifiSmeApWpsConfigurationReq *msg__; \
623         CsrWifiSmeApWpsConfigurationReqCreate(msg__, dst__, src__, wpsConfig__); \
624         CsrMsgTransport(dst__, CSR_WIFI_SME_AP_PRIM, msg__); \
625     }
626
627 #define CsrWifiSmeApWpsConfigurationReqSend(src__, wpsConfig__) \
628     CsrWifiSmeApWpsConfigurationReqSendTo(CSR_WIFI_SME_IFACEQUEUE, src__, wpsConfig__)
629
630 /*******************************************************************************
631
632   NAME
633     CsrWifiSmeApWpsConfigurationCfmSend
634
635   DESCRIPTION
636     Confirm.
637
638   PARAMETERS
639     queue  - Destination Task Queue
640     status - Status of the request.
641
642 *******************************************************************************/
643 #define CsrWifiSmeApWpsConfigurationCfmCreate(msg__, dst__, src__, status__) \
644     msg__ = kmalloc(sizeof(CsrWifiSmeApWpsConfigurationCfm), GFP_KERNEL); \
645     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_AP_PRIM, CSR_WIFI_SME_AP_WPS_CONFIGURATION_CFM, dst__, src__); \
646     msg__->status = (status__);
647
648 #define CsrWifiSmeApWpsConfigurationCfmSendTo(dst__, src__, status__) \
649     { \
650         CsrWifiSmeApWpsConfigurationCfm *msg__; \
651         CsrWifiSmeApWpsConfigurationCfmCreate(msg__, dst__, src__, status__); \
652         CsrSchedMessagePut(dst__, CSR_WIFI_SME_AP_PRIM, msg__); \
653     }
654
655 #define CsrWifiSmeApWpsConfigurationCfmSend(dst__, status__) \
656     CsrWifiSmeApWpsConfigurationCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, status__)
657
658 /*******************************************************************************
659
660   NAME
661     CsrWifiSmeApWpsRegistrationFinishedReqSend
662
663   DESCRIPTION
664     This primitive tells SME that WPS registration procedure has finished
665
666   PARAMETERS
667     queue        - Message Source Task Queue (Cfm's will be sent to this Queue)
668     interfaceTag -
669
670 *******************************************************************************/
671 #define CsrWifiSmeApWpsRegistrationFinishedReqCreate(msg__, dst__, src__, interfaceTag__) \
672     msg__ = kmalloc(sizeof(CsrWifiSmeApWpsRegistrationFinishedReq), GFP_KERNEL); \
673     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_AP_PRIM, CSR_WIFI_SME_AP_WPS_REGISTRATION_FINISHED_REQ, dst__, src__); \
674     msg__->interfaceTag = (interfaceTag__);
675
676 #define CsrWifiSmeApWpsRegistrationFinishedReqSendTo(dst__, src__, interfaceTag__) \
677     { \
678         CsrWifiSmeApWpsRegistrationFinishedReq *msg__; \
679         CsrWifiSmeApWpsRegistrationFinishedReqCreate(msg__, dst__, src__, interfaceTag__); \
680         CsrMsgTransport(dst__, CSR_WIFI_SME_AP_PRIM, msg__); \
681     }
682
683 #define CsrWifiSmeApWpsRegistrationFinishedReqSend(src__, interfaceTag__) \
684     CsrWifiSmeApWpsRegistrationFinishedReqSendTo(CSR_WIFI_SME_IFACEQUEUE, src__, interfaceTag__)
685
686 /*******************************************************************************
687
688   NAME
689     CsrWifiSmeApWpsRegistrationFinishedCfmSend
690
691   DESCRIPTION
692     A confirm for UNIFI_MGT_AP_WPS_REGISTRATION_FINISHED.request
693
694   PARAMETERS
695     queue        - Destination Task Queue
696     interfaceTag -
697     status       -
698
699 *******************************************************************************/
700 #define CsrWifiSmeApWpsRegistrationFinishedCfmCreate(msg__, dst__, src__, interfaceTag__, status__) \
701     msg__ = kmalloc(sizeof(CsrWifiSmeApWpsRegistrationFinishedCfm), GFP_KERNEL); \
702     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_AP_PRIM, CSR_WIFI_SME_AP_WPS_REGISTRATION_FINISHED_CFM, dst__, src__); \
703     msg__->interfaceTag = (interfaceTag__); \
704     msg__->status = (status__);
705
706 #define CsrWifiSmeApWpsRegistrationFinishedCfmSendTo(dst__, src__, interfaceTag__, status__) \
707     { \
708         CsrWifiSmeApWpsRegistrationFinishedCfm *msg__; \
709         CsrWifiSmeApWpsRegistrationFinishedCfmCreate(msg__, dst__, src__, interfaceTag__, status__); \
710         CsrSchedMessagePut(dst__, CSR_WIFI_SME_AP_PRIM, msg__); \
711     }
712
713 #define CsrWifiSmeApWpsRegistrationFinishedCfmSend(dst__, interfaceTag__, status__) \
714     CsrWifiSmeApWpsRegistrationFinishedCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, interfaceTag__, status__)
715
716 /*******************************************************************************
717
718   NAME
719     CsrWifiSmeApWpsRegistrationStartedReqSend
720
721   DESCRIPTION
722     This primitive tells SME that WPS registration procedure has started
723
724   PARAMETERS
725     queue                    - Message Source Task Queue (Cfm's will be sent to this Queue)
726     interfaceTag             -
727     SelectedDevicePasswordId -
728     SelectedconfigMethod     -
729
730 *******************************************************************************/
731 #define CsrWifiSmeApWpsRegistrationStartedReqCreate(msg__, dst__, src__, interfaceTag__, SelectedDevicePasswordId__, SelectedconfigMethod__) \
732     msg__ = kmalloc(sizeof(CsrWifiSmeApWpsRegistrationStartedReq), GFP_KERNEL); \
733     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_AP_PRIM, CSR_WIFI_SME_AP_WPS_REGISTRATION_STARTED_REQ, dst__, src__); \
734     msg__->interfaceTag = (interfaceTag__); \
735     msg__->SelectedDevicePasswordId = (SelectedDevicePasswordId__); \
736     msg__->SelectedconfigMethod = (SelectedconfigMethod__);
737
738 #define CsrWifiSmeApWpsRegistrationStartedReqSendTo(dst__, src__, interfaceTag__, SelectedDevicePasswordId__, SelectedconfigMethod__) \
739     { \
740         CsrWifiSmeApWpsRegistrationStartedReq *msg__; \
741         CsrWifiSmeApWpsRegistrationStartedReqCreate(msg__, dst__, src__, interfaceTag__, SelectedDevicePasswordId__, SelectedconfigMethod__); \
742         CsrMsgTransport(dst__, CSR_WIFI_SME_AP_PRIM, msg__); \
743     }
744
745 #define CsrWifiSmeApWpsRegistrationStartedReqSend(src__, interfaceTag__, SelectedDevicePasswordId__, SelectedconfigMethod__) \
746     CsrWifiSmeApWpsRegistrationStartedReqSendTo(CSR_WIFI_SME_IFACEQUEUE, src__, interfaceTag__, SelectedDevicePasswordId__, SelectedconfigMethod__)
747
748 /*******************************************************************************
749
750   NAME
751     CsrWifiSmeApWpsRegistrationStartedCfmSend
752
753   DESCRIPTION
754     A confirm for UNIFI_MGT_AP_WPS_REGISTRATION_STARTED.request
755
756   PARAMETERS
757     queue        - Destination Task Queue
758     interfaceTag -
759     status       -
760
761 *******************************************************************************/
762 #define CsrWifiSmeApWpsRegistrationStartedCfmCreate(msg__, dst__, src__, interfaceTag__, status__) \
763     msg__ = kmalloc(sizeof(CsrWifiSmeApWpsRegistrationStartedCfm), GFP_KERNEL); \
764     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_SME_AP_PRIM, CSR_WIFI_SME_AP_WPS_REGISTRATION_STARTED_CFM, dst__, src__); \
765     msg__->interfaceTag = (interfaceTag__); \
766     msg__->status = (status__);
767
768 #define CsrWifiSmeApWpsRegistrationStartedCfmSendTo(dst__, src__, interfaceTag__, status__) \
769     { \
770         CsrWifiSmeApWpsRegistrationStartedCfm *msg__; \
771         CsrWifiSmeApWpsRegistrationStartedCfmCreate(msg__, dst__, src__, interfaceTag__, status__); \
772         CsrSchedMessagePut(dst__, CSR_WIFI_SME_AP_PRIM, msg__); \
773     }
774
775 #define CsrWifiSmeApWpsRegistrationStartedCfmSend(dst__, interfaceTag__, status__) \
776     CsrWifiSmeApWpsRegistrationStartedCfmSendTo(dst__, CSR_WIFI_SME_IFACEQUEUE, interfaceTag__, status__)
777
778
779 #ifdef __cplusplus
780 }
781 #endif
782
783 #endif /* CSR_WIFI_SME_AP_LIB_H__ */