Root/drivers/staging/csr/csr_wifi_nme_lib.h

1/*****************************************************************************
2
3            (c) Cambridge Silicon Radio Limited 2011
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_LIB_H__
14#define CSR_WIFI_NME_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_prim.h"
23#include "csr_wifi_nme_task.h"
24
25
26#ifdef __cplusplus
27extern "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_lib.h
32#endif
33
34/*----------------------------------------------------------------------------*
35 * CsrWifiNmeFreeUpstreamMessageContents
36 *
37 * DESCRIPTION
38 * Free the allocated memory in a CSR_WIFI_NME 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_NME upstream message
43 *----------------------------------------------------------------------------*/
44void CsrWifiNmeFreeUpstreamMessageContents(u16 eventClass, void *message);
45
46/*----------------------------------------------------------------------------*
47 * CsrWifiNmeFreeDownstreamMessageContents
48 *
49 * DESCRIPTION
50 * Free the allocated memory in a CSR_WIFI_NME 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_NME downstream message
55 *----------------------------------------------------------------------------*/
56void CsrWifiNmeFreeDownstreamMessageContents(u16 eventClass, void *message);
57
58/*----------------------------------------------------------------------------*
59 * Enum to string functions
60 *----------------------------------------------------------------------------*/
61const char* CsrWifiNmeAuthModeToString(CsrWifiNmeAuthMode value);
62const char* CsrWifiNmeBssTypeToString(CsrWifiNmeBssType value);
63const char* CsrWifiNmeCcxOptionsMaskToString(CsrWifiNmeCcxOptionsMask value);
64const char* CsrWifiNmeConfigActionToString(CsrWifiNmeConfigAction value);
65const char* CsrWifiNmeConnectionStatusToString(CsrWifiNmeConnectionStatus value);
66const char* CsrWifiNmeCredentialTypeToString(CsrWifiNmeCredentialType value);
67const char* CsrWifiNmeEapMethodToString(CsrWifiNmeEapMethod value);
68const char* CsrWifiNmeEncryptionToString(CsrWifiNmeEncryption value);
69const char* CsrWifiNmeIndicationsToString(CsrWifiNmeIndications value);
70const char* CsrWifiNmeSecErrorToString(CsrWifiNmeSecError value);
71const char* CsrWifiNmeSimCardTypeToString(CsrWifiNmeSimCardType value);
72const char* CsrWifiNmeUmtsAuthResultToString(CsrWifiNmeUmtsAuthResult value);
73const char* CsrWifiNmeWmmQosInfoToString(CsrWifiNmeWmmQosInfo value);
74
75
76/*----------------------------------------------------------------------------*
77 * CsrPrim Type toString function.
78 * Converts a message type to the String name of the Message
79 *----------------------------------------------------------------------------*/
80const char* CsrWifiNmePrimTypeToString(CsrPrim msgType);
81
82/*----------------------------------------------------------------------------*
83 * Lookup arrays for PrimType name Strings
84 *----------------------------------------------------------------------------*/
85extern const char *CsrWifiNmeUpstreamPrimNames[CSR_WIFI_NME_PRIM_UPSTREAM_COUNT];
86extern const char *CsrWifiNmeDownstreamPrimNames[CSR_WIFI_NME_PRIM_DOWNSTREAM_COUNT];
87
88/*******************************************************************************
89
90  NAME
91    CsrWifiNmeConnectionStatusGetReqSend
92
93  DESCRIPTION
94    Requests the current connection status of the NME.
95
96  PARAMETERS
97    queue - Message Source Task Queue (Cfm's will be sent to this Queue)
98    interfaceTag - Interface Identifier; unique identifier of an interface
99
100*******************************************************************************/
101#define CsrWifiNmeConnectionStatusGetReqCreate(msg__, dst__, src__, interfaceTag__) \
102    msg__ = kmalloc(sizeof(CsrWifiNmeConnectionStatusGetReq), GFP_KERNEL); \
103    CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_CONNECTION_STATUS_GET_REQ, dst__, src__); \
104    msg__->interfaceTag = (interfaceTag__);
105
106#define CsrWifiNmeConnectionStatusGetReqSendTo(dst__, src__, interfaceTag__) \
107    { \
108        CsrWifiNmeConnectionStatusGetReq *msg__; \
109        CsrWifiNmeConnectionStatusGetReqCreate(msg__, dst__, src__, interfaceTag__); \
110        CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
111    }
112
113#define CsrWifiNmeConnectionStatusGetReqSend(src__, interfaceTag__) \
114    CsrWifiNmeConnectionStatusGetReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, interfaceTag__)
115
116/*******************************************************************************
117
118  NAME
119    CsrWifiNmeConnectionStatusGetCfmSend
120
121  DESCRIPTION
122    Reports the connection status of the NME.
123
124  PARAMETERS
125    queue - Destination Task Queue
126    interfaceTag - Interface Identifier; unique identifier of an interface
127    status - Indicates the success or otherwise of the requested
128                       operation.
129    connectionStatus - NME current connection status
130
131*******************************************************************************/
132#define CsrWifiNmeConnectionStatusGetCfmCreate(msg__, dst__, src__, interfaceTag__, status__, connectionStatus__) \
133    msg__ = kmalloc(sizeof(CsrWifiNmeConnectionStatusGetCfm), GFP_KERNEL); \
134    CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_CONNECTION_STATUS_GET_CFM, dst__, src__); \
135    msg__->interfaceTag = (interfaceTag__); \
136    msg__->status = (status__); \
137    msg__->connectionStatus = (connectionStatus__);
138
139#define CsrWifiNmeConnectionStatusGetCfmSendTo(dst__, src__, interfaceTag__, status__, connectionStatus__) \
140    { \
141        CsrWifiNmeConnectionStatusGetCfm *msg__; \
142        CsrWifiNmeConnectionStatusGetCfmCreate(msg__, dst__, src__, interfaceTag__, status__, connectionStatus__); \
143        CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
144    }
145
146#define CsrWifiNmeConnectionStatusGetCfmSend(dst__, interfaceTag__, status__, connectionStatus__) \
147    CsrWifiNmeConnectionStatusGetCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, interfaceTag__, status__, connectionStatus__)
148
149/*******************************************************************************
150
151  NAME
152    CsrWifiNmeEventMaskSetReqSend
153
154  DESCRIPTION
155    The wireless manager application may register with the NME to receive
156    notification of interesting events. Indications will be sent only if the
157    wireless manager explicitly registers to be notified of that event.
158    indMask is a bit mask of values defined in CsrWifiNmeIndicationsMask.
159
160  PARAMETERS
161    queue - Message Source Task Queue (Cfm's will be sent to this Queue)
162    indMask - Set mask with values from CsrWifiNmeIndications
163
164*******************************************************************************/
165#define CsrWifiNmeEventMaskSetReqCreate(msg__, dst__, src__, indMask__) \
166    msg__ = kmalloc(sizeof(CsrWifiNmeEventMaskSetReq), GFP_KERNEL); \
167    CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_EVENT_MASK_SET_REQ, dst__, src__); \
168    msg__->indMask = (indMask__);
169
170#define CsrWifiNmeEventMaskSetReqSendTo(dst__, src__, indMask__) \
171    { \
172        CsrWifiNmeEventMaskSetReq *msg__; \
173        CsrWifiNmeEventMaskSetReqCreate(msg__, dst__, src__, indMask__); \
174        CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
175    }
176
177#define CsrWifiNmeEventMaskSetReqSend(src__, indMask__) \
178    CsrWifiNmeEventMaskSetReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, indMask__)
179
180/*******************************************************************************
181
182  NAME
183    CsrWifiNmeEventMaskSetCfmSend
184
185  DESCRIPTION
186    The NME calls the primitive to report the result of the request
187    primitive.
188
189  PARAMETERS
190    queue - Destination Task Queue
191    status - Reports the result of the request
192
193*******************************************************************************/
194#define CsrWifiNmeEventMaskSetCfmCreate(msg__, dst__, src__, status__) \
195    msg__ = kmalloc(sizeof(CsrWifiNmeEventMaskSetCfm), GFP_KERNEL); \
196    CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_EVENT_MASK_SET_CFM, dst__, src__); \
197    msg__->status = (status__);
198
199#define CsrWifiNmeEventMaskSetCfmSendTo(dst__, src__, status__) \
200    { \
201        CsrWifiNmeEventMaskSetCfm *msg__; \
202        CsrWifiNmeEventMaskSetCfmCreate(msg__, dst__, src__, status__); \
203        CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
204    }
205
206#define CsrWifiNmeEventMaskSetCfmSend(dst__, status__) \
207    CsrWifiNmeEventMaskSetCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, status__)
208
209/*******************************************************************************
210
211  NAME
212    CsrWifiNmeProfileConnectReqSend
213
214  DESCRIPTION
215    Requests the NME to attempt to connect to the specified profile.
216    Overrides any current connection attempt.
217
218  PARAMETERS
219    queue - Message Source Task Queue (Cfm's will be sent to this Queue)
220    interfaceTag - Interface Identifier; unique identifier of an interface
221    profileIdentity - Identity (BSSID, SSID) of profile to be connected to.
222                      It must match an existing profile in the NME.
223
224*******************************************************************************/
225#define CsrWifiNmeProfileConnectReqCreate(msg__, dst__, src__, interfaceTag__, profileIdentity__) \
226    msg__ = kmalloc(sizeof(CsrWifiNmeProfileConnectReq), GFP_KERNEL); \
227    CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_PROFILE_CONNECT_REQ, dst__, src__); \
228    msg__->interfaceTag = (interfaceTag__); \
229    msg__->profileIdentity = (profileIdentity__);
230
231#define CsrWifiNmeProfileConnectReqSendTo(dst__, src__, interfaceTag__, profileIdentity__) \
232    { \
233        CsrWifiNmeProfileConnectReq *msg__; \
234        CsrWifiNmeProfileConnectReqCreate(msg__, dst__, src__, interfaceTag__, profileIdentity__); \
235        CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
236    }
237
238#define CsrWifiNmeProfileConnectReqSend(src__, interfaceTag__, profileIdentity__) \
239    CsrWifiNmeProfileConnectReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, interfaceTag__, profileIdentity__)
240
241/*******************************************************************************
242
243  NAME
244    CsrWifiNmeProfileConnectCfmSend
245
246  DESCRIPTION
247    Reports the status of the NME PROFILE CONNECT REQ. If unsuccessful the
248    connectAttempt parameters contain details of the APs that the NME
249    attempted to connect to before reporting the failure of the request.
250
251  PARAMETERS
252    queue - Destination Task Queue
253    interfaceTag - Interface Identifier; unique identifier of an
254                           interface
255    status - Indicates the success or otherwise of the requested
256                           operation.
257    connectAttemptsCount - This parameter is relevant only if
258                           status!=CSR_WIFI_NME_STATUS_SUCCESS.
259                           Number of connection attempt elements provided with
260                           this primitive
261    connectAttempts - This parameter is relevant only if
262                           status!=CSR_WIFI_NME_STATUS_SUCCESS.
263                           Points to the list of connection attempt elements
264                           provided with this primitive
265                           Each element of the list provides information about
266                           an AP on which the connection attempt was made and
267                           the error that occurred during the attempt.
268
269*******************************************************************************/
270#define CsrWifiNmeProfileConnectCfmCreate(msg__, dst__, src__, interfaceTag__, status__, connectAttemptsCount__, connectAttempts__) \
271    msg__ = kmalloc(sizeof(CsrWifiNmeProfileConnectCfm), GFP_KERNEL); \
272    CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_PROFILE_CONNECT_CFM, dst__, src__); \
273    msg__->interfaceTag = (interfaceTag__); \
274    msg__->status = (status__); \
275    msg__->connectAttemptsCount = (connectAttemptsCount__); \
276    msg__->connectAttempts = (connectAttempts__);
277
278#define CsrWifiNmeProfileConnectCfmSendTo(dst__, src__, interfaceTag__, status__, connectAttemptsCount__, connectAttempts__) \
279    { \
280        CsrWifiNmeProfileConnectCfm *msg__; \
281        CsrWifiNmeProfileConnectCfmCreate(msg__, dst__, src__, interfaceTag__, status__, connectAttemptsCount__, connectAttempts__); \
282        CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
283    }
284
285#define CsrWifiNmeProfileConnectCfmSend(dst__, interfaceTag__, status__, connectAttemptsCount__, connectAttempts__) \
286    CsrWifiNmeProfileConnectCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, interfaceTag__, status__, connectAttemptsCount__, connectAttempts__)
287
288/*******************************************************************************
289
290  NAME
291    CsrWifiNmeProfileDeleteAllReqSend
292
293  DESCRIPTION
294    Deletes all profiles present in the NME, but does NOT modify the
295    preferred profile list.
296
297  PARAMETERS
298    queue - Message Source Task Queue (Cfm's will be sent to this Queue)
299
300*******************************************************************************/
301#define CsrWifiNmeProfileDeleteAllReqCreate(msg__, dst__, src__) \
302    msg__ = kmalloc(sizeof(CsrWifiNmeProfileDeleteAllReq), GFP_KERNEL); \
303    CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_PROFILE_DELETE_ALL_REQ, dst__, src__);
304
305#define CsrWifiNmeProfileDeleteAllReqSendTo(dst__, src__) \
306    { \
307        CsrWifiNmeProfileDeleteAllReq *msg__; \
308        CsrWifiNmeProfileDeleteAllReqCreate(msg__, dst__, src__); \
309        CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
310    }
311
312#define CsrWifiNmeProfileDeleteAllReqSend(src__) \
313    CsrWifiNmeProfileDeleteAllReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__)
314
315/*******************************************************************************
316
317  NAME
318    CsrWifiNmeProfileDeleteAllCfmSend
319
320  DESCRIPTION
321    Reports the status of the CSR_WIFI_NME_PROFILE_DELETE_ALL_REQ.
322    Returns always CSR_WIFI_NME_STATUS_SUCCESS.
323
324  PARAMETERS
325    queue - Destination Task Queue
326    status - Indicates the success or otherwise of the requested operation, but
327             in this case it always set to success.
328
329*******************************************************************************/
330#define CsrWifiNmeProfileDeleteAllCfmCreate(msg__, dst__, src__, status__) \
331    msg__ = kmalloc(sizeof(CsrWifiNmeProfileDeleteAllCfm), GFP_KERNEL); \
332    CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_PROFILE_DELETE_ALL_CFM, dst__, src__); \
333    msg__->status = (status__);
334
335#define CsrWifiNmeProfileDeleteAllCfmSendTo(dst__, src__, status__) \
336    { \
337        CsrWifiNmeProfileDeleteAllCfm *msg__; \
338        CsrWifiNmeProfileDeleteAllCfmCreate(msg__, dst__, src__, status__); \
339        CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
340    }
341
342#define CsrWifiNmeProfileDeleteAllCfmSend(dst__, status__) \
343    CsrWifiNmeProfileDeleteAllCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, status__)
344
345/*******************************************************************************
346
347  NAME
348    CsrWifiNmeProfileDeleteReqSend
349
350  DESCRIPTION
351    Will delete the profile with a matching identity, but does NOT modify the
352    preferred profile list.
353
354  PARAMETERS
355    queue - Message Source Task Queue (Cfm's will be sent to this Queue)
356    profileIdentity - Identity (BSSID, SSID) of profile to be deleted.
357
358*******************************************************************************/
359#define CsrWifiNmeProfileDeleteReqCreate(msg__, dst__, src__, profileIdentity__) \
360    msg__ = kmalloc(sizeof(CsrWifiNmeProfileDeleteReq), GFP_KERNEL); \
361    CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_PROFILE_DELETE_REQ, dst__, src__); \
362    msg__->profileIdentity = (profileIdentity__);
363
364#define CsrWifiNmeProfileDeleteReqSendTo(dst__, src__, profileIdentity__) \
365    { \
366        CsrWifiNmeProfileDeleteReq *msg__; \
367        CsrWifiNmeProfileDeleteReqCreate(msg__, dst__, src__, profileIdentity__); \
368        CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
369    }
370
371#define CsrWifiNmeProfileDeleteReqSend(src__, profileIdentity__) \
372    CsrWifiNmeProfileDeleteReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, profileIdentity__)
373
374/*******************************************************************************
375
376  NAME
377    CsrWifiNmeProfileDeleteCfmSend
378
379  DESCRIPTION
380    Reports the status of the CSR_WIFI_NME_PROFILE_DELETE_REQ.
381    Returns CSR_WIFI_NME_STATUS_NOT_FOUND if there is no matching profile.
382
383  PARAMETERS
384    queue - Destination Task Queue
385    status - Indicates the success or otherwise of the requested operation.
386
387*******************************************************************************/
388#define CsrWifiNmeProfileDeleteCfmCreate(msg__, dst__, src__, status__) \
389    msg__ = kmalloc(sizeof(CsrWifiNmeProfileDeleteCfm), GFP_KERNEL); \
390    CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_PROFILE_DELETE_CFM, dst__, src__); \
391    msg__->status = (status__);
392
393#define CsrWifiNmeProfileDeleteCfmSendTo(dst__, src__, status__) \
394    { \
395        CsrWifiNmeProfileDeleteCfm *msg__; \
396        CsrWifiNmeProfileDeleteCfmCreate(msg__, dst__, src__, status__); \
397        CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
398    }
399
400#define CsrWifiNmeProfileDeleteCfmSend(dst__, status__) \
401    CsrWifiNmeProfileDeleteCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, status__)
402
403/*******************************************************************************
404
405  NAME
406    CsrWifiNmeProfileDisconnectIndSend
407
408  DESCRIPTION
409    Indication generated from the NME (if an application subscribes to
410    receive it) that informs that application that the current profile
411    connection has disconnected. The indication will contain information
412    about APs that it attempted to maintain the connection via i.e. in the
413    case of failed roaming.
414
415  PARAMETERS
416    queue - Destination Task Queue
417    interfaceTag - Interface Identifier; unique identifier of an
418                           interface
419    connectAttemptsCount - Number of connection attempt elements provided with
420                           this primitive
421    connectAttempts - Points to the list of connection attempt elements
422                           provided with this primitive
423                           Each element of the list provides information about
424                           an AP on which the connection attempt was made and
425                           the error occurred during the attempt.
426
427*******************************************************************************/
428#define CsrWifiNmeProfileDisconnectIndCreate(msg__, dst__, src__, interfaceTag__, connectAttemptsCount__, connectAttempts__) \
429    msg__ = kmalloc(sizeof(CsrWifiNmeProfileDisconnectInd), GFP_KERNEL); \
430    CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_PROFILE_DISCONNECT_IND, dst__, src__); \
431    msg__->interfaceTag = (interfaceTag__); \
432    msg__->connectAttemptsCount = (connectAttemptsCount__); \
433    msg__->connectAttempts = (connectAttempts__);
434
435#define CsrWifiNmeProfileDisconnectIndSendTo(dst__, src__, interfaceTag__, connectAttemptsCount__, connectAttempts__) \
436    { \
437        CsrWifiNmeProfileDisconnectInd *msg__; \
438        CsrWifiNmeProfileDisconnectIndCreate(msg__, dst__, src__, interfaceTag__, connectAttemptsCount__, connectAttempts__); \
439        CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
440    }
441
442#define CsrWifiNmeProfileDisconnectIndSend(dst__, interfaceTag__, connectAttemptsCount__, connectAttempts__) \
443    CsrWifiNmeProfileDisconnectIndSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, interfaceTag__, connectAttemptsCount__, connectAttempts__)
444
445/*******************************************************************************
446
447  NAME
448    CsrWifiNmeProfileOrderSetReqSend
449
450  DESCRIPTION
451    Defines the preferred order that profiles present in the NME should be
452    used during the NME auto-connect behaviour.
453    If profileIdentitysCount == 0, it removes any existing preferred profile
454    list already present in the NME, effectively disabling the auto-connect
455    behaviour.
456    NOTE: Profile identities that do not match any profile stored in the NME
457    are ignored during the auto-connect procedure.
458    NOTE: during auto-connect the NME will only attempt to join an existing
459    adhoc network and it will never attempt to host an adhoc network; for
460    hosting and adhoc network, use CSR_WIFI_NME_PROFILE_CONNECT_REQ
461
462  PARAMETERS
463    queue - Message Source Task Queue (Cfm's will be sent to this Queue)
464    interfaceTag - Interface Identifier; unique identifier of an
465                            interface
466    profileIdentitysCount - The number of profiles identities in the list.
467    profileIdentitys - Points to the list of profile identities.
468
469*******************************************************************************/
470#define CsrWifiNmeProfileOrderSetReqCreate(msg__, dst__, src__, interfaceTag__, profileIdentitysCount__, profileIdentitys__) \
471    msg__ = kmalloc(sizeof(CsrWifiNmeProfileOrderSetReq), GFP_KERNEL); \
472    CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_PROFILE_ORDER_SET_REQ, dst__, src__); \
473    msg__->interfaceTag = (interfaceTag__); \
474    msg__->profileIdentitysCount = (profileIdentitysCount__); \
475    msg__->profileIdentitys = (profileIdentitys__);
476
477#define CsrWifiNmeProfileOrderSetReqSendTo(dst__, src__, interfaceTag__, profileIdentitysCount__, profileIdentitys__) \
478    { \
479        CsrWifiNmeProfileOrderSetReq *msg__; \
480        CsrWifiNmeProfileOrderSetReqCreate(msg__, dst__, src__, interfaceTag__, profileIdentitysCount__, profileIdentitys__); \
481        CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
482    }
483
484#define CsrWifiNmeProfileOrderSetReqSend(src__, interfaceTag__, profileIdentitysCount__, profileIdentitys__) \
485    CsrWifiNmeProfileOrderSetReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, interfaceTag__, profileIdentitysCount__, profileIdentitys__)
486
487/*******************************************************************************
488
489  NAME
490    CsrWifiNmeProfileOrderSetCfmSend
491
492  DESCRIPTION
493    Confirmation to UNIFI_NME_PROFILE_ORDER_SET.request.
494
495  PARAMETERS
496    queue - Destination Task Queue
497    interfaceTag - Interface Identifier; unique identifier of an interface
498    status - Indicates the success or otherwise of the requested
499                   operation.
500
501*******************************************************************************/
502#define CsrWifiNmeProfileOrderSetCfmCreate(msg__, dst__, src__, interfaceTag__, status__) \
503    msg__ = kmalloc(sizeof(CsrWifiNmeProfileOrderSetCfm), GFP_KERNEL); \
504    CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_PROFILE_ORDER_SET_CFM, dst__, src__); \
505    msg__->interfaceTag = (interfaceTag__); \
506    msg__->status = (status__);
507
508#define CsrWifiNmeProfileOrderSetCfmSendTo(dst__, src__, interfaceTag__, status__) \
509    { \
510        CsrWifiNmeProfileOrderSetCfm *msg__; \
511        CsrWifiNmeProfileOrderSetCfmCreate(msg__, dst__, src__, interfaceTag__, status__); \
512        CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
513    }
514
515#define CsrWifiNmeProfileOrderSetCfmSend(dst__, interfaceTag__, status__) \
516    CsrWifiNmeProfileOrderSetCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, interfaceTag__, status__)
517
518/*******************************************************************************
519
520  NAME
521    CsrWifiNmeProfileSetReqSend
522
523  DESCRIPTION
524    Creates or updates an existing profile in the NME that matches the unique
525    identity of the profile. Each profile is identified by the combination of
526    BSSID and SSID. The profile contains all the required credentials for
527    attempting to connect to the network. Creating or updating a profile via
528    the NME PROFILE SET REQ does NOT add the profile to the preferred profile
529    list within the NME used for the NME auto-connect behaviour.
530
531  PARAMETERS
532    queue - Message Source Task Queue (Cfm's will be sent to this Queue)
533    profile - Specifies the identity and credentials of the network.
534
535*******************************************************************************/
536#define CsrWifiNmeProfileSetReqCreate(msg__, dst__, src__, profile__) \
537    msg__ = kmalloc(sizeof(CsrWifiNmeProfileSetReq), GFP_KERNEL); \
538    CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_PROFILE_SET_REQ, dst__, src__); \
539    msg__->profile = (profile__);
540
541#define CsrWifiNmeProfileSetReqSendTo(dst__, src__, profile__) \
542    { \
543        CsrWifiNmeProfileSetReq *msg__; \
544        CsrWifiNmeProfileSetReqCreate(msg__, dst__, src__, profile__); \
545        CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
546    }
547
548#define CsrWifiNmeProfileSetReqSend(src__, profile__) \
549    CsrWifiNmeProfileSetReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, profile__)
550
551/*******************************************************************************
552
553  NAME
554    CsrWifiNmeProfileSetCfmSend
555
556  DESCRIPTION
557    Reports the status of the NME PROFILE SET REQ; the request will only fail
558    if the details specified in the profile contains an invalid combination
559    of parameters for example specifying the profile as cloaked but not
560    specifying the SSID. The NME doesn't limit the number of profiles that
561    may be created. The NME assumes that the entity configuring it is aware
562    of the appropriate limits.
563
564  PARAMETERS
565    queue - Destination Task Queue
566    status - Indicates the success or otherwise of the requested operation.
567
568*******************************************************************************/
569#define CsrWifiNmeProfileSetCfmCreate(msg__, dst__, src__, status__) \
570    msg__ = kmalloc(sizeof(CsrWifiNmeProfileSetCfm), GFP_KERNEL); \
571    CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_PROFILE_SET_CFM, dst__, src__); \
572    msg__->status = (status__);
573
574#define CsrWifiNmeProfileSetCfmSendTo(dst__, src__, status__) \
575    { \
576        CsrWifiNmeProfileSetCfm *msg__; \
577        CsrWifiNmeProfileSetCfmCreate(msg__, dst__, src__, status__); \
578        CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
579    }
580
581#define CsrWifiNmeProfileSetCfmSend(dst__, status__) \
582    CsrWifiNmeProfileSetCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, status__)
583
584/*******************************************************************************
585
586  NAME
587    CsrWifiNmeProfileUpdateIndSend
588
589  DESCRIPTION
590    Indication generated from the NME (if an application subscribes to
591    receive it) that informs that application that the contained profile has
592    changed.
593    For example, either the credentials EAP-FAST PAC file or the session data
594    within the profile has changed.
595    It is up to the application whether it stores this updated profile or
596    not.
597
598  PARAMETERS
599    queue - Destination Task Queue
600    interfaceTag - Interface Identifier; unique identifier of an interface
601    profile - The identity and credentials of the network.
602
603*******************************************************************************/
604#define CsrWifiNmeProfileUpdateIndCreate(msg__, dst__, src__, interfaceTag__, profile__) \
605    msg__ = kmalloc(sizeof(CsrWifiNmeProfileUpdateInd), GFP_KERNEL); \
606    CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_PROFILE_UPDATE_IND, dst__, src__); \
607    msg__->interfaceTag = (interfaceTag__); \
608    msg__->profile = (profile__);
609
610#define CsrWifiNmeProfileUpdateIndSendTo(dst__, src__, interfaceTag__, profile__) \
611    { \
612        CsrWifiNmeProfileUpdateInd *msg__; \
613        CsrWifiNmeProfileUpdateIndCreate(msg__, dst__, src__, interfaceTag__, profile__); \
614        CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
615    }
616
617#define CsrWifiNmeProfileUpdateIndSend(dst__, interfaceTag__, profile__) \
618    CsrWifiNmeProfileUpdateIndSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, interfaceTag__, profile__)
619
620/*******************************************************************************
621
622  NAME
623    CsrWifiNmeSimGsmAuthIndSend
624
625  DESCRIPTION
626    Indication generated from the NME (if an application subscribes to
627    receive it) that requests the UICC Manager to perform a GSM
628    authentication on behalf of the NME. This indication is generated when
629    the NME is attempting to connect to a profile configured for EAP-SIM. An
630    application MUST register to receive this indication for the NME to
631    support the EAP-SIM credential types. Otherwise the NME has no route to
632    obtain the information from the UICC. EAP-SIM authentication requires 2
633    or 3 GSM authentication rounds and therefore 2 or 3 RANDS (GSM Random
634    Challenges) are included.
635
636  PARAMETERS
637    queue - Destination Task Queue
638    randsLength - GSM RAND is 16 bytes long hence valid values are 32 (2 RANDS)
639                  or 48 (3 RANDs).
640    rands - 2 or 3 RANDs values.
641
642*******************************************************************************/
643#define CsrWifiNmeSimGsmAuthIndCreate(msg__, dst__, src__, randsLength__, rands__) \
644    msg__ = kmalloc(sizeof(CsrWifiNmeSimGsmAuthInd), GFP_KERNEL); \
645    CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_SIM_GSM_AUTH_IND, dst__, src__); \
646    msg__->randsLength = (randsLength__); \
647    msg__->rands = (rands__);
648
649#define CsrWifiNmeSimGsmAuthIndSendTo(dst__, src__, randsLength__, rands__) \
650    { \
651        CsrWifiNmeSimGsmAuthInd *msg__; \
652        CsrWifiNmeSimGsmAuthIndCreate(msg__, dst__, src__, randsLength__, rands__); \
653        CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
654    }
655
656#define CsrWifiNmeSimGsmAuthIndSend(dst__, randsLength__, rands__) \
657    CsrWifiNmeSimGsmAuthIndSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, randsLength__, rands__)
658
659/*******************************************************************************
660
661  NAME
662    CsrWifiNmeSimGsmAuthResSend
663
664  DESCRIPTION
665    Response from the application that received the NME SIM GSM AUTH IND. For
666    each GSM authentication round a GSM Ciphering key (Kc) and a signed
667    response (SRES) are produced. Since 2 or 3 GSM authentication rounds are
668    used the 2 or 3 Kc's obtained respectively are combined into one buffer
669    and similarly the 2 or 3 SRES's obtained are combined into another
670    buffer. The order of Kc values (SRES values respectively) in their buffer
671    is the same as that of their corresponding RAND values in the incoming
672    indication.
673
674  PARAMETERS
675    status - Indicates the outcome of the requested operation:
676                 STATUS_SUCCESS or STATUS_ERROR
677    kcsLength - Length in Bytes of Kc buffer. Legal values are: 16 or 24.
678    kcs - Kc buffer holding 2 or 3 Kc values.
679    sresLength - Length in Bytes of SRES buffer. Legal values are: 8 or 12.
680    sres - SRES buffer holding 2 or 3 SRES values.
681
682*******************************************************************************/
683#define CsrWifiNmeSimGsmAuthResCreate(msg__, dst__, src__, status__, kcsLength__, kcs__, sresLength__, sres__) \
684    msg__ = kmalloc(sizeof(CsrWifiNmeSimGsmAuthRes), GFP_KERNEL); \
685    CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_SIM_GSM_AUTH_RES, dst__, src__); \
686    msg__->status = (status__); \
687    msg__->kcsLength = (kcsLength__); \
688    msg__->kcs = (kcs__); \
689    msg__->sresLength = (sresLength__); \
690    msg__->sres = (sres__);
691
692#define CsrWifiNmeSimGsmAuthResSendTo(dst__, src__, status__, kcsLength__, kcs__, sresLength__, sres__) \
693    { \
694        CsrWifiNmeSimGsmAuthRes *msg__; \
695        CsrWifiNmeSimGsmAuthResCreate(msg__, dst__, src__, status__, kcsLength__, kcs__, sresLength__, sres__); \
696        CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
697    }
698
699#define CsrWifiNmeSimGsmAuthResSend(src__, status__, kcsLength__, kcs__, sresLength__, sres__) \
700    CsrWifiNmeSimGsmAuthResSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, status__, kcsLength__, kcs__, sresLength__, sres__)
701
702/*******************************************************************************
703
704  NAME
705    CsrWifiNmeSimImsiGetIndSend
706
707  DESCRIPTION
708    Indication generated from the NME (if an application subscribes to
709    receive it) that requests the IMSI and UICC type from the UICC Manager.
710    This indication is generated when the NME is attempting to connect to a
711    profile configured for EAP-SIM/AKA. An application MUST register to
712    receive this indication for the NME to support the EAP-SIM/AKA credential
713    types. Otherwise the NME has no route to obtain the information from the
714    UICC.
715
716  PARAMETERS
717    queue - Destination Task Queue
718
719*******************************************************************************/
720#define CsrWifiNmeSimImsiGetIndCreate(msg__, dst__, src__) \
721    msg__ = kmalloc(sizeof(CsrWifiNmeSimImsiGetInd), GFP_KERNEL); \
722    CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_SIM_IMSI_GET_IND, dst__, src__);
723
724#define CsrWifiNmeSimImsiGetIndSendTo(dst__, src__) \
725    { \
726        CsrWifiNmeSimImsiGetInd *msg__; \
727        CsrWifiNmeSimImsiGetIndCreate(msg__, dst__, src__); \
728        CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
729    }
730
731#define CsrWifiNmeSimImsiGetIndSend(dst__) \
732    CsrWifiNmeSimImsiGetIndSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE)
733
734/*******************************************************************************
735
736  NAME
737    CsrWifiNmeSimImsiGetResSend
738
739  DESCRIPTION
740    Response from the application that received the NME SIM IMSI GET IND.
741
742  PARAMETERS
743    status - Indicates the outcome of the requested operation: STATUS_SUCCESS
744               or STATUS_ERROR.
745    imsi - The value of the IMSI obtained from the UICC.
746    cardType - The UICC type (GSM only (SIM), UMTS only (USIM), Both).
747
748*******************************************************************************/
749#define CsrWifiNmeSimImsiGetResCreate(msg__, dst__, src__, status__, imsi__, cardType__) \
750    msg__ = kmalloc(sizeof(CsrWifiNmeSimImsiGetRes), GFP_KERNEL); \
751    CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_SIM_IMSI_GET_RES, dst__, src__); \
752    msg__->status = (status__); \
753    msg__->imsi = (imsi__); \
754    msg__->cardType = (cardType__);
755
756#define CsrWifiNmeSimImsiGetResSendTo(dst__, src__, status__, imsi__, cardType__) \
757    { \
758        CsrWifiNmeSimImsiGetRes *msg__; \
759        CsrWifiNmeSimImsiGetResCreate(msg__, dst__, src__, status__, imsi__, cardType__); \
760        CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
761    }
762
763#define CsrWifiNmeSimImsiGetResSend(src__, status__, imsi__, cardType__) \
764    CsrWifiNmeSimImsiGetResSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, status__, imsi__, cardType__)
765
766/*******************************************************************************
767
768  NAME
769    CsrWifiNmeSimUmtsAuthIndSend
770
771  DESCRIPTION
772    Indication generated from the NME (if an application subscribes to
773    receive it) that requests the UICC Manager to perform a UMTS
774    authentication on behalf of the NME. This indication is generated when
775    the NME is attempting to connect to a profile configured for EAP-AKA. An
776    application MUST register to receive this indication for the NME to
777    support the EAP-AKA credential types. Otherwise the NME has no route to
778    obtain the information from the USIM. EAP-AKA requires one UMTS
779    authentication round and therefore only one RAND and one AUTN values are
780    included.
781
782  PARAMETERS
783    queue - Destination Task Queue
784    rand - UMTS RAND value.
785    autn - UMTS AUTN value.
786
787*******************************************************************************/
788#define CsrWifiNmeSimUmtsAuthIndCreate(msg__, dst__, src__, rand__, autn__) \
789    msg__ = kmalloc(sizeof(CsrWifiNmeSimUmtsAuthInd), GFP_KERNEL); \
790    CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_SIM_UMTS_AUTH_IND, dst__, src__); \
791    memcpy(msg__->rand, (rand__), sizeof(u8) * 16); \
792    memcpy(msg__->autn, (autn__), sizeof(u8) * 16);
793
794#define CsrWifiNmeSimUmtsAuthIndSendTo(dst__, src__, rand__, autn__) \
795    { \
796        CsrWifiNmeSimUmtsAuthInd *msg__; \
797        CsrWifiNmeSimUmtsAuthIndCreate(msg__, dst__, src__, rand__, autn__); \
798        CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
799    }
800
801#define CsrWifiNmeSimUmtsAuthIndSend(dst__, rand__, autn__) \
802    CsrWifiNmeSimUmtsAuthIndSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, rand__, autn__)
803
804/*******************************************************************************
805
806  NAME
807    CsrWifiNmeSimUmtsAuthResSend
808
809  DESCRIPTION
810    Response from the application that received the NME SIM UMTS AUTH IND.
811    The values of umtsCipherKey, umtsIntegrityKey, resParameterLength and
812    resParameter are only meanigful when result = UMTS_AUTH_RESULT_SUCCESS.
813    The value of auts is only meaningful when
814    result=UMTS_AUTH_RESULT_SYNC_FAIL.
815
816  PARAMETERS
817    status - Indicates the outcome of the requested operation:
818                         STATUS_SUCCESS or STATUS_ERROR.
819    result - The result of UMTS authentication as performed by the
820                         UICC which could be: Success, Authentication Reject or
821                         Synchronisation Failure. For all these 3 outcomes the
822                         value of status is success.
823    umtsCipherKey - The UMTS Cipher Key as calculated and returned by the
824                         UICC.
825    umtsIntegrityKey - The UMTS Integrity Key as calculated and returned by
826                         the UICC.
827    resParameterLength - The length (in bytes) of the RES parameter (min=4; max
828                         = 16).
829    resParameter - The RES parameter as calculated and returned by the
830                         UICC.
831    auts - The AUTS parameter as calculated and returned by the
832                         UICC.
833
834*******************************************************************************/
835#define CsrWifiNmeSimUmtsAuthResCreate(msg__, dst__, src__, status__, result__, umtsCipherKey__, umtsIntegrityKey__, resParameterLength__, resParameter__, auts__) \
836    msg__ = kmalloc(sizeof(CsrWifiNmeSimUmtsAuthRes), GFP_KERNEL); \
837    CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_SIM_UMTS_AUTH_RES, dst__, src__); \
838    msg__->status = (status__); \
839    msg__->result = (result__); \
840    memcpy(msg__->umtsCipherKey, (umtsCipherKey__), sizeof(u8) * 16); \
841    memcpy(msg__->umtsIntegrityKey, (umtsIntegrityKey__), sizeof(u8) * 16); \
842    msg__->resParameterLength = (resParameterLength__); \
843    msg__->resParameter = (resParameter__); \
844    memcpy(msg__->auts, (auts__), sizeof(u8) * 14);
845
846#define CsrWifiNmeSimUmtsAuthResSendTo(dst__, src__, status__, result__, umtsCipherKey__, umtsIntegrityKey__, resParameterLength__, resParameter__, auts__) \
847    { \
848        CsrWifiNmeSimUmtsAuthRes *msg__; \
849        CsrWifiNmeSimUmtsAuthResCreate(msg__, dst__, src__, status__, result__, umtsCipherKey__, umtsIntegrityKey__, resParameterLength__, resParameter__, auts__); \
850        CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
851    }
852
853#define CsrWifiNmeSimUmtsAuthResSend(src__, status__, result__, umtsCipherKey__, umtsIntegrityKey__, resParameterLength__, resParameter__, auts__) \
854    CsrWifiNmeSimUmtsAuthResSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, status__, result__, umtsCipherKey__, umtsIntegrityKey__, resParameterLength__, resParameter__, auts__)
855
856/*******************************************************************************
857
858  NAME
859    CsrWifiNmeWpsCancelReqSend
860
861  DESCRIPTION
862    Requests the NME to cancel any WPS procedure that it is currently
863    performing. This includes WPS registrar activities started because of
864    CSR_WIFI_NME_AP_REGISTER.request
865
866  PARAMETERS
867    queue - Message Source Task Queue (Cfm's will be sent to this Queue)
868    interfaceTag - Interface Identifier; unique identifier of an interface
869
870*******************************************************************************/
871#define CsrWifiNmeWpsCancelReqCreate(msg__, dst__, src__, interfaceTag__) \
872    msg__ = kmalloc(sizeof(CsrWifiNmeWpsCancelReq), GFP_KERNEL); \
873    CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_WPS_CANCEL_REQ, dst__, src__); \
874    msg__->interfaceTag = (interfaceTag__);
875
876#define CsrWifiNmeWpsCancelReqSendTo(dst__, src__, interfaceTag__) \
877    { \
878        CsrWifiNmeWpsCancelReq *msg__; \
879        CsrWifiNmeWpsCancelReqCreate(msg__, dst__, src__, interfaceTag__); \
880        CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
881    }
882
883#define CsrWifiNmeWpsCancelReqSend(src__, interfaceTag__) \
884    CsrWifiNmeWpsCancelReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, interfaceTag__)
885
886/*******************************************************************************
887
888  NAME
889    CsrWifiNmeWpsCancelCfmSend
890
891  DESCRIPTION
892    Reports the status of the NME WPS REQ, the request is always SUCCESSFUL.
893
894  PARAMETERS
895    queue - Destination Task Queue
896    interfaceTag - Interface Identifier; unique identifier of an interface
897    status - Only returns CSR_WIFI_NME_STATUS_SUCCESS
898
899*******************************************************************************/
900#define CsrWifiNmeWpsCancelCfmCreate(msg__, dst__, src__, interfaceTag__, status__) \
901    msg__ = kmalloc(sizeof(CsrWifiNmeWpsCancelCfm), GFP_KERNEL); \
902    CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_WPS_CANCEL_CFM, dst__, src__); \
903    msg__->interfaceTag = (interfaceTag__); \
904    msg__->status = (status__);
905
906#define CsrWifiNmeWpsCancelCfmSendTo(dst__, src__, interfaceTag__, status__) \
907    { \
908        CsrWifiNmeWpsCancelCfm *msg__; \
909        CsrWifiNmeWpsCancelCfmCreate(msg__, dst__, src__, interfaceTag__, status__); \
910        CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
911    }
912
913#define CsrWifiNmeWpsCancelCfmSend(dst__, interfaceTag__, status__) \
914    CsrWifiNmeWpsCancelCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, interfaceTag__, status__)
915
916/*******************************************************************************
917
918  NAME
919    CsrWifiNmeWpsCfmSend
920
921  DESCRIPTION
922    Reports the status of the NME WPS REQ.
923    If CSR_WIFI_NME_STATUS_SUCCESS, the profile parameter contains the
924    identity and credentials of the AP.
925
926  PARAMETERS
927    queue - Destination Task Queue
928    interfaceTag - Interface Identifier; unique identifier of an interface
929    status - Indicates the success or otherwise of the requested
930                   operation.
931    profile - This parameter is relevant only if
932                   status==CSR_WIFI_NME_STATUS_SUCCESS.
933                   The identity and credentials of the network.
934
935*******************************************************************************/
936#define CsrWifiNmeWpsCfmCreate(msg__, dst__, src__, interfaceTag__, status__, profile__) \
937    msg__ = kmalloc(sizeof(CsrWifiNmeWpsCfm), GFP_KERNEL); \
938    CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_WPS_CFM, dst__, src__); \
939    msg__->interfaceTag = (interfaceTag__); \
940    msg__->status = (status__); \
941    msg__->profile = (profile__);
942
943#define CsrWifiNmeWpsCfmSendTo(dst__, src__, interfaceTag__, status__, profile__) \
944    { \
945        CsrWifiNmeWpsCfm *msg__; \
946        CsrWifiNmeWpsCfmCreate(msg__, dst__, src__, interfaceTag__, status__, profile__); \
947        CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
948    }
949
950#define CsrWifiNmeWpsCfmSend(dst__, interfaceTag__, status__, profile__) \
951    CsrWifiNmeWpsCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, interfaceTag__, status__, profile__)
952
953/*******************************************************************************
954
955  NAME
956    CsrWifiNmeWpsConfigSetReqSend
957
958  DESCRIPTION
959    This primitive passes the WPS information for the device to NME. This may
960    be accepted only if no interface is active.
961
962  PARAMETERS
963    queue - Message Source Task Queue (Cfm's will be sent to this Queue)
964    wpsConfig - WPS config.
965
966*******************************************************************************/
967#define CsrWifiNmeWpsConfigSetReqCreate(msg__, dst__, src__, wpsConfig__) \
968    msg__ = kmalloc(sizeof(CsrWifiNmeWpsConfigSetReq), GFP_KERNEL); \
969    CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_WPS_CONFIG_SET_REQ, dst__, src__); \
970    msg__->wpsConfig = (wpsConfig__);
971
972#define CsrWifiNmeWpsConfigSetReqSendTo(dst__, src__, wpsConfig__) \
973    { \
974        CsrWifiNmeWpsConfigSetReq *msg__; \
975        CsrWifiNmeWpsConfigSetReqCreate(msg__, dst__, src__, wpsConfig__); \
976        CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
977    }
978
979#define CsrWifiNmeWpsConfigSetReqSend(src__, wpsConfig__) \
980    CsrWifiNmeWpsConfigSetReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, wpsConfig__)
981
982/*******************************************************************************
983
984  NAME
985    CsrWifiNmeWpsConfigSetCfmSend
986
987  DESCRIPTION
988    Confirm.
989
990  PARAMETERS
991    queue - Destination Task Queue
992    status - Status of the request.
993
994*******************************************************************************/
995#define CsrWifiNmeWpsConfigSetCfmCreate(msg__, dst__, src__, status__) \
996    msg__ = kmalloc(sizeof(CsrWifiNmeWpsConfigSetCfm), GFP_KERNEL); \
997    CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_WPS_CONFIG_SET_CFM, dst__, src__); \
998    msg__->status = (status__);
999
1000#define CsrWifiNmeWpsConfigSetCfmSendTo(dst__, src__, status__) \
1001    { \
1002        CsrWifiNmeWpsConfigSetCfm *msg__; \
1003        CsrWifiNmeWpsConfigSetCfmCreate(msg__, dst__, src__, status__); \
1004        CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
1005    }
1006
1007#define CsrWifiNmeWpsConfigSetCfmSend(dst__, status__) \
1008    CsrWifiNmeWpsConfigSetCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, status__)
1009
1010/*******************************************************************************
1011
1012  NAME
1013    CsrWifiNmeWpsReqSend
1014
1015  DESCRIPTION
1016    Requests the NME to look for WPS enabled APs and attempt to perform WPS
1017    to determine the appropriate security credentials to connect to the AP.
1018    If the PIN == '00000000' then 'push button mode' is indicated, otherwise
1019    the PIN has to match that of the AP. 4 digit pin is passed by sending the
1020    pin digits in pin[0]..pin[3] and rest of the contents filled with '-'.
1021
1022  PARAMETERS
1023    queue - Message Source Task Queue (Cfm's will be sent to this Queue)
1024    interfaceTag - Interface Identifier; unique identifier of an interface
1025    pin - PIN value.
1026    ssid - Service Set identifier
1027    bssid - ID of Basic Service Set for which a WPS connection attempt is
1028                   being made.
1029
1030*******************************************************************************/
1031#define CsrWifiNmeWpsReqCreate(msg__, dst__, src__, interfaceTag__, pin__, ssid__, bssid__) \
1032    msg__ = kmalloc(sizeof(CsrWifiNmeWpsReq), GFP_KERNEL); \
1033    CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_WPS_REQ, dst__, src__); \
1034    msg__->interfaceTag = (interfaceTag__); \
1035    memcpy(msg__->pin, (pin__), sizeof(u8) * 8); \
1036    msg__->ssid = (ssid__); \
1037    msg__->bssid = (bssid__);
1038
1039#define CsrWifiNmeWpsReqSendTo(dst__, src__, interfaceTag__, pin__, ssid__, bssid__) \
1040    { \
1041        CsrWifiNmeWpsReq *msg__; \
1042        CsrWifiNmeWpsReqCreate(msg__, dst__, src__, interfaceTag__, pin__, ssid__, bssid__); \
1043        CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
1044    }
1045
1046#define CsrWifiNmeWpsReqSend(src__, interfaceTag__, pin__, ssid__, bssid__) \
1047    CsrWifiNmeWpsReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, interfaceTag__, pin__, ssid__, bssid__)
1048
1049
1050#ifdef __cplusplus
1051}
1052#endif
1053
1054#endif /* CSR_WIFI_NME_LIB_H__ */
1055

Archive Download this file



interactive