]> Pileus Git - ~andy/linux/blob - drivers/staging/csr/csr_wifi_nme_ap_lib.h
Merge branch 'usb-midi-fix-3.7' of git://git.alsa-project.org/alsa-kprivate into...
[~andy/linux] / drivers / staging / csr / csr_wifi_nme_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_NME_AP_LIB_H__
14 #define CSR_WIFI_NME_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_nme_ap_prim.h"
23 #include "csr_wifi_nme_task.h"
24
25
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29
30 #ifndef CSR_WIFI_NME_ENABLE
31 #error CSR_WIFI_NME_ENABLE MUST be defined inorder to use csr_wifi_nme_ap_lib.h
32 #endif
33 #ifndef CSR_WIFI_AP_ENABLE
34 #error CSR_WIFI_AP_ENABLE MUST be defined inorder to use csr_wifi_nme_ap_lib.h
35 #endif
36
37 /*----------------------------------------------------------------------------*
38  *  CsrWifiNmeApFreeUpstreamMessageContents
39  *
40  *  DESCRIPTION
41  *      Free the allocated memory in a CSR_WIFI_NME_AP upstream message. Does not
42  *      free the message itself, and can only be used for upstream messages.
43  *
44  *  PARAMETERS
45  *      Deallocates the resources in a CSR_WIFI_NME_AP upstream message
46  *----------------------------------------------------------------------------*/
47 void CsrWifiNmeApFreeUpstreamMessageContents(u16 eventClass, void *message);
48
49 /*----------------------------------------------------------------------------*
50  *  CsrWifiNmeApFreeDownstreamMessageContents
51  *
52  *  DESCRIPTION
53  *      Free the allocated memory in a CSR_WIFI_NME_AP downstream message. Does not
54  *      free the message itself, and can only be used for downstream messages.
55  *
56  *  PARAMETERS
57  *      Deallocates the resources in a CSR_WIFI_NME_AP downstream message
58  *----------------------------------------------------------------------------*/
59 void CsrWifiNmeApFreeDownstreamMessageContents(u16 eventClass, void *message);
60
61 /*----------------------------------------------------------------------------*
62  * Enum to string functions
63  *----------------------------------------------------------------------------*/
64 const char* CsrWifiNmeApPersCredentialTypeToString(CsrWifiNmeApPersCredentialType value);
65
66
67 /*----------------------------------------------------------------------------*
68  * CsrPrim Type toString function.
69  * Converts a message type to the String name of the Message
70  *----------------------------------------------------------------------------*/
71 const char* CsrWifiNmeApPrimTypeToString(CsrPrim msgType);
72
73 /*----------------------------------------------------------------------------*
74  * Lookup arrays for PrimType name Strings
75  *----------------------------------------------------------------------------*/
76 extern const char *CsrWifiNmeApUpstreamPrimNames[CSR_WIFI_NME_AP_PRIM_UPSTREAM_COUNT];
77 extern const char *CsrWifiNmeApDownstreamPrimNames[CSR_WIFI_NME_AP_PRIM_DOWNSTREAM_COUNT];
78
79 /*******************************************************************************
80
81   NAME
82     CsrWifiNmeApConfigSetReqSend
83
84   DESCRIPTION
85     This primitive passes AP configuration info for NME. This can be sent at
86     any time but will be acted upon when the AP is started again. This
87     information is common to both P2P GO and AP
88
89   PARAMETERS
90     queue       - Message Source Task Queue (Cfm's will be sent to this Queue)
91     apConfig    - AP configuration for the NME.
92     apMacConfig - MAC configuration to be acted on when
93                   CSR_WIFI_NME_AP_START.request is sent.
94
95 *******************************************************************************/
96 #define CsrWifiNmeApConfigSetReqCreate(msg__, dst__, src__, apConfig__, apMacConfig__) \
97     msg__ = kmalloc(sizeof(CsrWifiNmeApConfigSetReq), GFP_KERNEL); \
98     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_AP_PRIM, CSR_WIFI_NME_AP_CONFIG_SET_REQ, dst__, src__); \
99     msg__->apConfig = (apConfig__); \
100     msg__->apMacConfig = (apMacConfig__);
101
102 #define CsrWifiNmeApConfigSetReqSendTo(dst__, src__, apConfig__, apMacConfig__) \
103     { \
104         CsrWifiNmeApConfigSetReq *msg__; \
105         CsrWifiNmeApConfigSetReqCreate(msg__, dst__, src__, apConfig__, apMacConfig__); \
106         CsrMsgTransport(dst__, CSR_WIFI_NME_AP_PRIM, msg__); \
107     }
108
109 #define CsrWifiNmeApConfigSetReqSend(src__, apConfig__, apMacConfig__) \
110     CsrWifiNmeApConfigSetReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, apConfig__, apMacConfig__)
111
112 /*******************************************************************************
113
114   NAME
115     CsrWifiNmeApConfigSetCfmSend
116
117   DESCRIPTION
118     This primitive reports the result of the request.
119
120   PARAMETERS
121     queue  - Destination Task Queue
122     status - Status of the request.
123
124 *******************************************************************************/
125 #define CsrWifiNmeApConfigSetCfmCreate(msg__, dst__, src__, status__) \
126     msg__ = kmalloc(sizeof(CsrWifiNmeApConfigSetCfm), GFP_KERNEL); \
127     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_AP_PRIM, CSR_WIFI_NME_AP_CONFIG_SET_CFM, dst__, src__); \
128     msg__->status = (status__);
129
130 #define CsrWifiNmeApConfigSetCfmSendTo(dst__, src__, status__) \
131     { \
132         CsrWifiNmeApConfigSetCfm *msg__; \
133         CsrWifiNmeApConfigSetCfmCreate(msg__, dst__, src__, status__); \
134         CsrSchedMessagePut(dst__, CSR_WIFI_NME_AP_PRIM, msg__); \
135     }
136
137 #define CsrWifiNmeApConfigSetCfmSend(dst__, status__) \
138     CsrWifiNmeApConfigSetCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, status__)
139
140 /*******************************************************************************
141
142   NAME
143     CsrWifiNmeApStaRemoveReqSend
144
145   DESCRIPTION
146     This primitive disconnects a connected station. If keepBlocking is set to
147     TRUE, the station with the specified MAC address is not allowed to
148     connect. If the requested station is not already connected,it may be
149     blocked based on keepBlocking parameter.
150
151   PARAMETERS
152     queue         - Message Source Task Queue (Cfm's will be sent to this Queue)
153     interfaceTag  - Interface Identifier; unique identifier of an interface
154     staMacAddress - Mac Address of the station to be disconnected or blocked
155     keepBlocking  - If TRUE, the station is blocked. If FALSE and the station is
156                     connected, disconnect the station. If FALSE and the station
157                     is not connected, no action is taken.
158
159 *******************************************************************************/
160 #define CsrWifiNmeApStaRemoveReqCreate(msg__, dst__, src__, interfaceTag__, staMacAddress__, keepBlocking__) \
161     msg__ = kmalloc(sizeof(CsrWifiNmeApStaRemoveReq), GFP_KERNEL); \
162     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_AP_PRIM, CSR_WIFI_NME_AP_STA_REMOVE_REQ, dst__, src__); \
163     msg__->interfaceTag = (interfaceTag__); \
164     msg__->staMacAddress = (staMacAddress__); \
165     msg__->keepBlocking = (keepBlocking__);
166
167 #define CsrWifiNmeApStaRemoveReqSendTo(dst__, src__, interfaceTag__, staMacAddress__, keepBlocking__) \
168     { \
169         CsrWifiNmeApStaRemoveReq *msg__; \
170         CsrWifiNmeApStaRemoveReqCreate(msg__, dst__, src__, interfaceTag__, staMacAddress__, keepBlocking__); \
171         CsrMsgTransport(dst__, CSR_WIFI_NME_AP_PRIM, msg__); \
172     }
173
174 #define CsrWifiNmeApStaRemoveReqSend(src__, interfaceTag__, staMacAddress__, keepBlocking__) \
175     CsrWifiNmeApStaRemoveReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, interfaceTag__, staMacAddress__, keepBlocking__)
176
177 /*******************************************************************************
178
179   NAME
180     CsrWifiNmeApStartReqSend
181
182   DESCRIPTION
183     This primitive requests NME to started the AP operation.
184
185   PARAMETERS
186     queue          - Message Source Task Queue (Cfm's will be sent to this Queue)
187     interfaceTag   - Interface identifier; unique identifier of an interface
188     apType         - AP Type specifies the Legacy AP or P2P GO operation
189     cloakSsid      - Indicates whether the SSID should be cloaked (hidden and
190                      not broadcast in beacon) or not
191     ssid           - Service Set Identifier
192     ifIndex        - Radio interface
193     channel        - Channel number of the channel to use
194     apCredentials  - Security credential configuration.
195     maxConnections - Maximum number of stations/P2P clients allowed
196     p2pGoParam     - P2P specific GO parameters.
197     wpsEnabled     - Indicates whether WPS should be enabled or not
198
199 *******************************************************************************/
200 #define CsrWifiNmeApStartReqCreate(msg__, dst__, src__, interfaceTag__, apType__, cloakSsid__, ssid__, ifIndex__, channel__, apCredentials__, maxConnections__, p2pGoParam__, wpsEnabled__) \
201     msg__ = kmalloc(sizeof(CsrWifiNmeApStartReq), GFP_KERNEL); \
202     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_AP_PRIM, CSR_WIFI_NME_AP_START_REQ, dst__, src__); \
203     msg__->interfaceTag = (interfaceTag__); \
204     msg__->apType = (apType__); \
205     msg__->cloakSsid = (cloakSsid__); \
206     msg__->ssid = (ssid__); \
207     msg__->ifIndex = (ifIndex__); \
208     msg__->channel = (channel__); \
209     msg__->apCredentials = (apCredentials__); \
210     msg__->maxConnections = (maxConnections__); \
211     msg__->p2pGoParam = (p2pGoParam__); \
212     msg__->wpsEnabled = (wpsEnabled__);
213
214 #define CsrWifiNmeApStartReqSendTo(dst__, src__, interfaceTag__, apType__, cloakSsid__, ssid__, ifIndex__, channel__, apCredentials__, maxConnections__, p2pGoParam__, wpsEnabled__) \
215     { \
216         CsrWifiNmeApStartReq *msg__; \
217         CsrWifiNmeApStartReqCreate(msg__, dst__, src__, interfaceTag__, apType__, cloakSsid__, ssid__, ifIndex__, channel__, apCredentials__, maxConnections__, p2pGoParam__, wpsEnabled__); \
218         CsrMsgTransport(dst__, CSR_WIFI_NME_AP_PRIM, msg__); \
219     }
220
221 #define CsrWifiNmeApStartReqSend(src__, interfaceTag__, apType__, cloakSsid__, ssid__, ifIndex__, channel__, apCredentials__, maxConnections__, p2pGoParam__, wpsEnabled__) \
222     CsrWifiNmeApStartReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, interfaceTag__, apType__, cloakSsid__, ssid__, ifIndex__, channel__, apCredentials__, maxConnections__, p2pGoParam__, wpsEnabled__)
223
224 /*******************************************************************************
225
226   NAME
227     CsrWifiNmeApStartCfmSend
228
229   DESCRIPTION
230     This primitive reports the result of CSR_WIFI_NME_AP_START.request.
231
232   PARAMETERS
233     queue        - Destination Task Queue
234     interfaceTag - Interface identifier; unique identifier of an interface
235     status       - Status of the request.
236     ssid         - Service Set Identifier
237
238 *******************************************************************************/
239 #define CsrWifiNmeApStartCfmCreate(msg__, dst__, src__, interfaceTag__, status__, ssid__) \
240     msg__ = kmalloc(sizeof(CsrWifiNmeApStartCfm), GFP_KERNEL); \
241     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_AP_PRIM, CSR_WIFI_NME_AP_START_CFM, dst__, src__); \
242     msg__->interfaceTag = (interfaceTag__); \
243     msg__->status = (status__); \
244     msg__->ssid = (ssid__);
245
246 #define CsrWifiNmeApStartCfmSendTo(dst__, src__, interfaceTag__, status__, ssid__) \
247     { \
248         CsrWifiNmeApStartCfm *msg__; \
249         CsrWifiNmeApStartCfmCreate(msg__, dst__, src__, interfaceTag__, status__, ssid__); \
250         CsrSchedMessagePut(dst__, CSR_WIFI_NME_AP_PRIM, msg__); \
251     }
252
253 #define CsrWifiNmeApStartCfmSend(dst__, interfaceTag__, status__, ssid__) \
254     CsrWifiNmeApStartCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, interfaceTag__, status__, ssid__)
255
256 /*******************************************************************************
257
258   NAME
259     CsrWifiNmeApStationIndSend
260
261   DESCRIPTION
262     This primitive indicates that a station has joined or a previously joined
263     station has left the BSS/group
264
265   PARAMETERS
266     queue             - Destination Task Queue
267     interfaceTag      - Interface Identifier; unique identifier of an interface
268     mediaStatus       - Indicates whether the station is connected or
269                         disconnected
270     peerMacAddress    - MAC address of the station
271     peerDeviceAddress - P2P Device Address
272
273 *******************************************************************************/
274 #define CsrWifiNmeApStationIndCreate(msg__, dst__, src__, interfaceTag__, mediaStatus__, peerMacAddress__, peerDeviceAddress__) \
275     msg__ = kmalloc(sizeof(CsrWifiNmeApStationInd), GFP_KERNEL); \
276     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_AP_PRIM, CSR_WIFI_NME_AP_STATION_IND, dst__, src__); \
277     msg__->interfaceTag = (interfaceTag__); \
278     msg__->mediaStatus = (mediaStatus__); \
279     msg__->peerMacAddress = (peerMacAddress__); \
280     msg__->peerDeviceAddress = (peerDeviceAddress__);
281
282 #define CsrWifiNmeApStationIndSendTo(dst__, src__, interfaceTag__, mediaStatus__, peerMacAddress__, peerDeviceAddress__) \
283     { \
284         CsrWifiNmeApStationInd *msg__; \
285         CsrWifiNmeApStationIndCreate(msg__, dst__, src__, interfaceTag__, mediaStatus__, peerMacAddress__, peerDeviceAddress__); \
286         CsrSchedMessagePut(dst__, CSR_WIFI_NME_AP_PRIM, msg__); \
287     }
288
289 #define CsrWifiNmeApStationIndSend(dst__, interfaceTag__, mediaStatus__, peerMacAddress__, peerDeviceAddress__) \
290     CsrWifiNmeApStationIndSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, interfaceTag__, mediaStatus__, peerMacAddress__, peerDeviceAddress__)
291
292 /*******************************************************************************
293
294   NAME
295     CsrWifiNmeApStopReqSend
296
297   DESCRIPTION
298     This primitive requests NME to stop the AP operation.
299
300   PARAMETERS
301     queue        - Message Source Task Queue (Cfm's will be sent to this Queue)
302     interfaceTag - Interface identifier; unique identifier of an interface
303
304 *******************************************************************************/
305 #define CsrWifiNmeApStopReqCreate(msg__, dst__, src__, interfaceTag__) \
306     msg__ = kmalloc(sizeof(CsrWifiNmeApStopReq), GFP_KERNEL); \
307     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_AP_PRIM, CSR_WIFI_NME_AP_STOP_REQ, dst__, src__); \
308     msg__->interfaceTag = (interfaceTag__);
309
310 #define CsrWifiNmeApStopReqSendTo(dst__, src__, interfaceTag__) \
311     { \
312         CsrWifiNmeApStopReq *msg__; \
313         CsrWifiNmeApStopReqCreate(msg__, dst__, src__, interfaceTag__); \
314         CsrMsgTransport(dst__, CSR_WIFI_NME_AP_PRIM, msg__); \
315     }
316
317 #define CsrWifiNmeApStopReqSend(src__, interfaceTag__) \
318     CsrWifiNmeApStopReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, interfaceTag__)
319
320 /*******************************************************************************
321
322   NAME
323     CsrWifiNmeApStopIndSend
324
325   DESCRIPTION
326     Indicates that AP operation had stopped because of some unrecoverable
327     error after AP operation was started successfully. NME sends this signal
328     after failing to restart the AP operation internally following an error
329
330   PARAMETERS
331     queue        - Destination Task Queue
332     interfaceTag - Interface Identifier; unique identifier of an interface
333     apType       - Reports AP Type (P2PGO or AP)
334     status       - Error Status
335
336 *******************************************************************************/
337 #define CsrWifiNmeApStopIndCreate(msg__, dst__, src__, interfaceTag__, apType__, status__) \
338     msg__ = kmalloc(sizeof(CsrWifiNmeApStopInd), GFP_KERNEL); \
339     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_AP_PRIM, CSR_WIFI_NME_AP_STOP_IND, dst__, src__); \
340     msg__->interfaceTag = (interfaceTag__); \
341     msg__->apType = (apType__); \
342     msg__->status = (status__);
343
344 #define CsrWifiNmeApStopIndSendTo(dst__, src__, interfaceTag__, apType__, status__) \
345     { \
346         CsrWifiNmeApStopInd *msg__; \
347         CsrWifiNmeApStopIndCreate(msg__, dst__, src__, interfaceTag__, apType__, status__); \
348         CsrSchedMessagePut(dst__, CSR_WIFI_NME_AP_PRIM, msg__); \
349     }
350
351 #define CsrWifiNmeApStopIndSend(dst__, interfaceTag__, apType__, status__) \
352     CsrWifiNmeApStopIndSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, interfaceTag__, apType__, status__)
353
354 /*******************************************************************************
355
356   NAME
357     CsrWifiNmeApStopCfmSend
358
359   DESCRIPTION
360     This primitive confirms that the AP operation is stopped. NME shall send
361     this primitive in response to the request even if AP operation has
362     already been stopped
363
364   PARAMETERS
365     queue        - Destination Task Queue
366     interfaceTag - Interface identifier; unique identifier of an interface
367     status       - Status of the request.
368
369 *******************************************************************************/
370 #define CsrWifiNmeApStopCfmCreate(msg__, dst__, src__, interfaceTag__, status__) \
371     msg__ = kmalloc(sizeof(CsrWifiNmeApStopCfm), GFP_KERNEL); \
372     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_AP_PRIM, CSR_WIFI_NME_AP_STOP_CFM, dst__, src__); \
373     msg__->interfaceTag = (interfaceTag__); \
374     msg__->status = (status__);
375
376 #define CsrWifiNmeApStopCfmSendTo(dst__, src__, interfaceTag__, status__) \
377     { \
378         CsrWifiNmeApStopCfm *msg__; \
379         CsrWifiNmeApStopCfmCreate(msg__, dst__, src__, interfaceTag__, status__); \
380         CsrSchedMessagePut(dst__, CSR_WIFI_NME_AP_PRIM, msg__); \
381     }
382
383 #define CsrWifiNmeApStopCfmSend(dst__, interfaceTag__, status__) \
384     CsrWifiNmeApStopCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, interfaceTag__, status__)
385
386 /*******************************************************************************
387
388   NAME
389     CsrWifiNmeApWmmParamUpdateReqSend
390
391   DESCRIPTION
392     Application uses this primitive to update the WMM parameters
393
394   PARAMETERS
395     queue         - Message Source Task Queue (Cfm's will be sent to this Queue)
396     wmmApParams   - WMM Access point parameters per access category. The array
397                     index corresponds to the ACI
398     wmmApBcParams - WMM station parameters per access category to be advertised
399                     in the beacons and probe response The array index
400                     corresponds to the ACI
401
402 *******************************************************************************/
403 #define CsrWifiNmeApWmmParamUpdateReqCreate(msg__, dst__, src__, wmmApParams__, wmmApBcParams__) \
404     msg__ = kmalloc(sizeof(CsrWifiNmeApWmmParamUpdateReq), GFP_KERNEL); \
405     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_AP_PRIM, CSR_WIFI_NME_AP_WMM_PARAM_UPDATE_REQ, dst__, src__); \
406     memcpy(msg__->wmmApParams, (wmmApParams__), sizeof(CsrWifiSmeWmmAcParams) * 4); \
407     memcpy(msg__->wmmApBcParams, (wmmApBcParams__), sizeof(CsrWifiSmeWmmAcParams) * 4);
408
409 #define CsrWifiNmeApWmmParamUpdateReqSendTo(dst__, src__, wmmApParams__, wmmApBcParams__) \
410     { \
411         CsrWifiNmeApWmmParamUpdateReq *msg__; \
412         CsrWifiNmeApWmmParamUpdateReqCreate(msg__, dst__, src__, wmmApParams__, wmmApBcParams__); \
413         CsrMsgTransport(dst__, CSR_WIFI_NME_AP_PRIM, msg__); \
414     }
415
416 #define CsrWifiNmeApWmmParamUpdateReqSend(src__, wmmApParams__, wmmApBcParams__) \
417     CsrWifiNmeApWmmParamUpdateReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, wmmApParams__, wmmApBcParams__)
418
419 /*******************************************************************************
420
421   NAME
422     CsrWifiNmeApWmmParamUpdateCfmSend
423
424   DESCRIPTION
425     A confirm for for the WMM parameters update
426
427   PARAMETERS
428     queue  - Destination Task Queue
429     status - Status of the request.
430
431 *******************************************************************************/
432 #define CsrWifiNmeApWmmParamUpdateCfmCreate(msg__, dst__, src__, status__) \
433     msg__ = kmalloc(sizeof(CsrWifiNmeApWmmParamUpdateCfm), GFP_KERNEL); \
434     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_AP_PRIM, CSR_WIFI_NME_AP_WMM_PARAM_UPDATE_CFM, dst__, src__); \
435     msg__->status = (status__);
436
437 #define CsrWifiNmeApWmmParamUpdateCfmSendTo(dst__, src__, status__) \
438     { \
439         CsrWifiNmeApWmmParamUpdateCfm *msg__; \
440         CsrWifiNmeApWmmParamUpdateCfmCreate(msg__, dst__, src__, status__); \
441         CsrSchedMessagePut(dst__, CSR_WIFI_NME_AP_PRIM, msg__); \
442     }
443
444 #define CsrWifiNmeApWmmParamUpdateCfmSend(dst__, status__) \
445     CsrWifiNmeApWmmParamUpdateCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, status__)
446
447 /*******************************************************************************
448
449   NAME
450     CsrWifiNmeApWpsRegisterReqSend
451
452   DESCRIPTION
453     This primitive allows the NME to accept the WPS registration from an
454     enrollee. Such registration procedure can be cancelled by sending
455     CSR_WIFI_NME_WPS_CANCEL.request.
456
457   PARAMETERS
458     queue                    - Message Source Task Queue (Cfm's will be sent to this Queue)
459     interfaceTag             - Interface Identifier; unique identifier of an
460                                interface
461     selectedDevicePasswordId - Selected password type
462     selectedConfigMethod     - Selected WPS configuration method type
463     pin                      - PIN value.
464                                Relevant if selected device password ID is PIN.4
465                                digit pin is passed by sending the pin digits in
466                                pin[0]..pin[3] and rest of the contents filled
467                                with '-'.
468
469 *******************************************************************************/
470 #define CsrWifiNmeApWpsRegisterReqCreate(msg__, dst__, src__, interfaceTag__, selectedDevicePasswordId__, selectedConfigMethod__, pin__) \
471     msg__ = kmalloc(sizeof(CsrWifiNmeApWpsRegisterReq), GFP_KERNEL); \
472     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_AP_PRIM, CSR_WIFI_NME_AP_WPS_REGISTER_REQ, dst__, src__); \
473     msg__->interfaceTag = (interfaceTag__); \
474     msg__->selectedDevicePasswordId = (selectedDevicePasswordId__); \
475     msg__->selectedConfigMethod = (selectedConfigMethod__); \
476     memcpy(msg__->pin, (pin__), sizeof(u8) * 8);
477
478 #define CsrWifiNmeApWpsRegisterReqSendTo(dst__, src__, interfaceTag__, selectedDevicePasswordId__, selectedConfigMethod__, pin__) \
479     { \
480         CsrWifiNmeApWpsRegisterReq *msg__; \
481         CsrWifiNmeApWpsRegisterReqCreate(msg__, dst__, src__, interfaceTag__, selectedDevicePasswordId__, selectedConfigMethod__, pin__); \
482         CsrMsgTransport(dst__, CSR_WIFI_NME_AP_PRIM, msg__); \
483     }
484
485 #define CsrWifiNmeApWpsRegisterReqSend(src__, interfaceTag__, selectedDevicePasswordId__, selectedConfigMethod__, pin__) \
486     CsrWifiNmeApWpsRegisterReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, interfaceTag__, selectedDevicePasswordId__, selectedConfigMethod__, pin__)
487
488 /*******************************************************************************
489
490   NAME
491     CsrWifiNmeApWpsRegisterCfmSend
492
493   DESCRIPTION
494     This primitive reports the result of WPS procedure.
495
496   PARAMETERS
497     queue        - Destination Task Queue
498     interfaceTag - Interface identifier; unique identifier of an interface
499     status       - Status of the request.
500
501 *******************************************************************************/
502 #define CsrWifiNmeApWpsRegisterCfmCreate(msg__, dst__, src__, interfaceTag__, status__) \
503     msg__ = kmalloc(sizeof(CsrWifiNmeApWpsRegisterCfm), GFP_KERNEL); \
504     CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_AP_PRIM, CSR_WIFI_NME_AP_WPS_REGISTER_CFM, dst__, src__); \
505     msg__->interfaceTag = (interfaceTag__); \
506     msg__->status = (status__);
507
508 #define CsrWifiNmeApWpsRegisterCfmSendTo(dst__, src__, interfaceTag__, status__) \
509     { \
510         CsrWifiNmeApWpsRegisterCfm *msg__; \
511         CsrWifiNmeApWpsRegisterCfmCreate(msg__, dst__, src__, interfaceTag__, status__); \
512         CsrSchedMessagePut(dst__, CSR_WIFI_NME_AP_PRIM, msg__); \
513     }
514
515 #define CsrWifiNmeApWpsRegisterCfmSend(dst__, interfaceTag__, status__) \
516     CsrWifiNmeApWpsRegisterCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, interfaceTag__, status__)
517
518
519 #ifdef __cplusplus
520 }
521 #endif
522
523 #endif /* CSR_WIFI_NME_AP_LIB_H__ */