1 /*****************************************************************************
3 (c) Cambridge Silicon Radio Limited 2011
4 All rights reserved and confidential information of CSR
6 Refer to LICENSE.txt included with this source for details
9 *****************************************************************************/
11 /* Note: this is an auto-generated file. */
13 #ifndef CSR_WIFI_NME_LIB_H__
14 #define CSR_WIFI_NME_LIB_H__
16 #include "csr_sched.h"
17 #include "csr_macro.h"
18 #include "csr_msg_transport.h"
20 #include "csr_wifi_lib.h"
22 #include "csr_wifi_nme_prim.h"
23 #include "csr_wifi_nme_task.h"
30 #ifndef CSR_WIFI_NME_ENABLE
31 #error CSR_WIFI_NME_ENABLE MUST be defined inorder to use csr_wifi_nme_lib.h
34 /*----------------------------------------------------------------------------*
35 * CsrWifiNmeFreeUpstreamMessageContents
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.
42 * Deallocates the resources in a CSR_WIFI_NME upstream message
43 *----------------------------------------------------------------------------*/
44 void CsrWifiNmeFreeUpstreamMessageContents(u16 eventClass, void *message);
46 /*----------------------------------------------------------------------------*
47 * CsrWifiNmeFreeDownstreamMessageContents
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.
54 * Deallocates the resources in a CSR_WIFI_NME downstream message
55 *----------------------------------------------------------------------------*/
56 void CsrWifiNmeFreeDownstreamMessageContents(u16 eventClass, void *message);
58 /*----------------------------------------------------------------------------*
59 * Enum to string functions
60 *----------------------------------------------------------------------------*/
61 const char* CsrWifiNmeAuthModeToString(CsrWifiNmeAuthMode value);
62 const char* CsrWifiNmeBssTypeToString(CsrWifiNmeBssType value);
63 const char* CsrWifiNmeCcxOptionsMaskToString(CsrWifiNmeCcxOptionsMask value);
64 const char* CsrWifiNmeConfigActionToString(CsrWifiNmeConfigAction value);
65 const char* CsrWifiNmeConnectionStatusToString(CsrWifiNmeConnectionStatus value);
66 const char* CsrWifiNmeCredentialTypeToString(CsrWifiNmeCredentialType value);
67 const char* CsrWifiNmeEapMethodToString(CsrWifiNmeEapMethod value);
68 const char* CsrWifiNmeEncryptionToString(CsrWifiNmeEncryption value);
69 const char* CsrWifiNmeIndicationsToString(CsrWifiNmeIndications value);
70 const char* CsrWifiNmeSecErrorToString(CsrWifiNmeSecError value);
71 const char* CsrWifiNmeSimCardTypeToString(CsrWifiNmeSimCardType value);
72 const char* CsrWifiNmeUmtsAuthResultToString(CsrWifiNmeUmtsAuthResult value);
73 const char* CsrWifiNmeWmmQosInfoToString(CsrWifiNmeWmmQosInfo value);
76 /*----------------------------------------------------------------------------*
77 * CsrPrim Type toString function.
78 * Converts a message type to the String name of the Message
79 *----------------------------------------------------------------------------*/
80 const char* CsrWifiNmePrimTypeToString(CsrPrim msgType);
82 /*----------------------------------------------------------------------------*
83 * Lookup arrays for PrimType name Strings
84 *----------------------------------------------------------------------------*/
85 extern const char *CsrWifiNmeUpstreamPrimNames[CSR_WIFI_NME_PRIM_UPSTREAM_COUNT];
86 extern const char *CsrWifiNmeDownstreamPrimNames[CSR_WIFI_NME_PRIM_DOWNSTREAM_COUNT];
88 /*******************************************************************************
91 CsrWifiNmeConnectionStatusGetReqSend
94 Requests the current connection status of the NME.
97 queue - Message Source Task Queue (Cfm's will be sent to this Queue)
98 interfaceTag - Interface Identifier; unique identifier of an interface
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__);
106 #define CsrWifiNmeConnectionStatusGetReqSendTo(dst__, src__, interfaceTag__) \
108 CsrWifiNmeConnectionStatusGetReq *msg__; \
109 CsrWifiNmeConnectionStatusGetReqCreate(msg__, dst__, src__, interfaceTag__); \
110 CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
113 #define CsrWifiNmeConnectionStatusGetReqSend(src__, interfaceTag__) \
114 CsrWifiNmeConnectionStatusGetReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, interfaceTag__)
116 /*******************************************************************************
119 CsrWifiNmeConnectionStatusGetCfmSend
122 Reports the connection status of the NME.
125 queue - Destination Task Queue
126 interfaceTag - Interface Identifier; unique identifier of an interface
127 status - Indicates the success or otherwise of the requested
129 connectionStatus - NME current connection status
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__);
139 #define CsrWifiNmeConnectionStatusGetCfmSendTo(dst__, src__, interfaceTag__, status__, connectionStatus__) \
141 CsrWifiNmeConnectionStatusGetCfm *msg__; \
142 CsrWifiNmeConnectionStatusGetCfmCreate(msg__, dst__, src__, interfaceTag__, status__, connectionStatus__); \
143 CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
146 #define CsrWifiNmeConnectionStatusGetCfmSend(dst__, interfaceTag__, status__, connectionStatus__) \
147 CsrWifiNmeConnectionStatusGetCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, interfaceTag__, status__, connectionStatus__)
149 /*******************************************************************************
152 CsrWifiNmeEventMaskSetReqSend
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.
161 queue - Message Source Task Queue (Cfm's will be sent to this Queue)
162 indMask - Set mask with values from CsrWifiNmeIndications
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__);
170 #define CsrWifiNmeEventMaskSetReqSendTo(dst__, src__, indMask__) \
172 CsrWifiNmeEventMaskSetReq *msg__; \
173 CsrWifiNmeEventMaskSetReqCreate(msg__, dst__, src__, indMask__); \
174 CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
177 #define CsrWifiNmeEventMaskSetReqSend(src__, indMask__) \
178 CsrWifiNmeEventMaskSetReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, indMask__)
180 /*******************************************************************************
183 CsrWifiNmeEventMaskSetCfmSend
186 The NME calls the primitive to report the result of the request
190 queue - Destination Task Queue
191 status - Reports the result of the request
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__);
199 #define CsrWifiNmeEventMaskSetCfmSendTo(dst__, src__, status__) \
201 CsrWifiNmeEventMaskSetCfm *msg__; \
202 CsrWifiNmeEventMaskSetCfmCreate(msg__, dst__, src__, status__); \
203 CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
206 #define CsrWifiNmeEventMaskSetCfmSend(dst__, status__) \
207 CsrWifiNmeEventMaskSetCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, status__)
209 /*******************************************************************************
212 CsrWifiNmeProfileConnectReqSend
215 Requests the NME to attempt to connect to the specified profile.
216 Overrides any current connection attempt.
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.
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__);
231 #define CsrWifiNmeProfileConnectReqSendTo(dst__, src__, interfaceTag__, profileIdentity__) \
233 CsrWifiNmeProfileConnectReq *msg__; \
234 CsrWifiNmeProfileConnectReqCreate(msg__, dst__, src__, interfaceTag__, profileIdentity__); \
235 CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
238 #define CsrWifiNmeProfileConnectReqSend(src__, interfaceTag__, profileIdentity__) \
239 CsrWifiNmeProfileConnectReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, interfaceTag__, profileIdentity__)
241 /*******************************************************************************
244 CsrWifiNmeProfileConnectCfmSend
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.
252 queue - Destination Task Queue
253 interfaceTag - Interface Identifier; unique identifier of an
255 status - Indicates the success or otherwise of the requested
257 connectAttemptsCount - This parameter is relevant only if
258 status!=CSR_WIFI_NME_STATUS_SUCCESS.
259 Number of connection attempt elements provided with
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.
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__);
278 #define CsrWifiNmeProfileConnectCfmSendTo(dst__, src__, interfaceTag__, status__, connectAttemptsCount__, connectAttempts__) \
280 CsrWifiNmeProfileConnectCfm *msg__; \
281 CsrWifiNmeProfileConnectCfmCreate(msg__, dst__, src__, interfaceTag__, status__, connectAttemptsCount__, connectAttempts__); \
282 CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
285 #define CsrWifiNmeProfileConnectCfmSend(dst__, interfaceTag__, status__, connectAttemptsCount__, connectAttempts__) \
286 CsrWifiNmeProfileConnectCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, interfaceTag__, status__, connectAttemptsCount__, connectAttempts__)
288 /*******************************************************************************
291 CsrWifiNmeProfileDeleteAllReqSend
294 Deletes all profiles present in the NME, but does NOT modify the
295 preferred profile list.
298 queue - Message Source Task Queue (Cfm's will be sent to this Queue)
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__);
305 #define CsrWifiNmeProfileDeleteAllReqSendTo(dst__, src__) \
307 CsrWifiNmeProfileDeleteAllReq *msg__; \
308 CsrWifiNmeProfileDeleteAllReqCreate(msg__, dst__, src__); \
309 CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
312 #define CsrWifiNmeProfileDeleteAllReqSend(src__) \
313 CsrWifiNmeProfileDeleteAllReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__)
315 /*******************************************************************************
318 CsrWifiNmeProfileDeleteAllCfmSend
321 Reports the status of the CSR_WIFI_NME_PROFILE_DELETE_ALL_REQ.
322 Returns always CSR_WIFI_NME_STATUS_SUCCESS.
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.
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__);
335 #define CsrWifiNmeProfileDeleteAllCfmSendTo(dst__, src__, status__) \
337 CsrWifiNmeProfileDeleteAllCfm *msg__; \
338 CsrWifiNmeProfileDeleteAllCfmCreate(msg__, dst__, src__, status__); \
339 CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
342 #define CsrWifiNmeProfileDeleteAllCfmSend(dst__, status__) \
343 CsrWifiNmeProfileDeleteAllCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, status__)
345 /*******************************************************************************
348 CsrWifiNmeProfileDeleteReqSend
351 Will delete the profile with a matching identity, but does NOT modify the
352 preferred profile list.
355 queue - Message Source Task Queue (Cfm's will be sent to this Queue)
356 profileIdentity - Identity (BSSID, SSID) of profile to be deleted.
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__);
364 #define CsrWifiNmeProfileDeleteReqSendTo(dst__, src__, profileIdentity__) \
366 CsrWifiNmeProfileDeleteReq *msg__; \
367 CsrWifiNmeProfileDeleteReqCreate(msg__, dst__, src__, profileIdentity__); \
368 CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
371 #define CsrWifiNmeProfileDeleteReqSend(src__, profileIdentity__) \
372 CsrWifiNmeProfileDeleteReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, profileIdentity__)
374 /*******************************************************************************
377 CsrWifiNmeProfileDeleteCfmSend
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.
384 queue - Destination Task Queue
385 status - Indicates the success or otherwise of the requested operation.
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__);
393 #define CsrWifiNmeProfileDeleteCfmSendTo(dst__, src__, status__) \
395 CsrWifiNmeProfileDeleteCfm *msg__; \
396 CsrWifiNmeProfileDeleteCfmCreate(msg__, dst__, src__, status__); \
397 CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
400 #define CsrWifiNmeProfileDeleteCfmSend(dst__, status__) \
401 CsrWifiNmeProfileDeleteCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, status__)
403 /*******************************************************************************
406 CsrWifiNmeProfileDisconnectIndSend
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.
416 queue - Destination Task Queue
417 interfaceTag - Interface Identifier; unique identifier of an
419 connectAttemptsCount - Number of connection attempt elements provided with
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.
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__);
435 #define CsrWifiNmeProfileDisconnectIndSendTo(dst__, src__, interfaceTag__, connectAttemptsCount__, connectAttempts__) \
437 CsrWifiNmeProfileDisconnectInd *msg__; \
438 CsrWifiNmeProfileDisconnectIndCreate(msg__, dst__, src__, interfaceTag__, connectAttemptsCount__, connectAttempts__); \
439 CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
442 #define CsrWifiNmeProfileDisconnectIndSend(dst__, interfaceTag__, connectAttemptsCount__, connectAttempts__) \
443 CsrWifiNmeProfileDisconnectIndSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, interfaceTag__, connectAttemptsCount__, connectAttempts__)
445 /*******************************************************************************
448 CsrWifiNmeProfileOrderSetReqSend
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
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
463 queue - Message Source Task Queue (Cfm's will be sent to this Queue)
464 interfaceTag - Interface Identifier; unique identifier of an
466 profileIdentitysCount - The number of profiles identities in the list.
467 profileIdentitys - Points to the list of profile identities.
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__);
477 #define CsrWifiNmeProfileOrderSetReqSendTo(dst__, src__, interfaceTag__, profileIdentitysCount__, profileIdentitys__) \
479 CsrWifiNmeProfileOrderSetReq *msg__; \
480 CsrWifiNmeProfileOrderSetReqCreate(msg__, dst__, src__, interfaceTag__, profileIdentitysCount__, profileIdentitys__); \
481 CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
484 #define CsrWifiNmeProfileOrderSetReqSend(src__, interfaceTag__, profileIdentitysCount__, profileIdentitys__) \
485 CsrWifiNmeProfileOrderSetReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, interfaceTag__, profileIdentitysCount__, profileIdentitys__)
487 /*******************************************************************************
490 CsrWifiNmeProfileOrderSetCfmSend
493 Confirmation to UNIFI_NME_PROFILE_ORDER_SET.request.
496 queue - Destination Task Queue
497 interfaceTag - Interface Identifier; unique identifier of an interface
498 status - Indicates the success or otherwise of the requested
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__);
508 #define CsrWifiNmeProfileOrderSetCfmSendTo(dst__, src__, interfaceTag__, status__) \
510 CsrWifiNmeProfileOrderSetCfm *msg__; \
511 CsrWifiNmeProfileOrderSetCfmCreate(msg__, dst__, src__, interfaceTag__, status__); \
512 CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
515 #define CsrWifiNmeProfileOrderSetCfmSend(dst__, interfaceTag__, status__) \
516 CsrWifiNmeProfileOrderSetCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, interfaceTag__, status__)
518 /*******************************************************************************
521 CsrWifiNmeProfileSetReqSend
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.
532 queue - Message Source Task Queue (Cfm's will be sent to this Queue)
533 profile - Specifies the identity and credentials of the network.
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__);
541 #define CsrWifiNmeProfileSetReqSendTo(dst__, src__, profile__) \
543 CsrWifiNmeProfileSetReq *msg__; \
544 CsrWifiNmeProfileSetReqCreate(msg__, dst__, src__, profile__); \
545 CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
548 #define CsrWifiNmeProfileSetReqSend(src__, profile__) \
549 CsrWifiNmeProfileSetReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, profile__)
551 /*******************************************************************************
554 CsrWifiNmeProfileSetCfmSend
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.
565 queue - Destination Task Queue
566 status - Indicates the success or otherwise of the requested operation.
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__);
574 #define CsrWifiNmeProfileSetCfmSendTo(dst__, src__, status__) \
576 CsrWifiNmeProfileSetCfm *msg__; \
577 CsrWifiNmeProfileSetCfmCreate(msg__, dst__, src__, status__); \
578 CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
581 #define CsrWifiNmeProfileSetCfmSend(dst__, status__) \
582 CsrWifiNmeProfileSetCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, status__)
584 /*******************************************************************************
587 CsrWifiNmeProfileUpdateIndSend
590 Indication generated from the NME (if an application subscribes to
591 receive it) that informs that application that the contained profile has
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
599 queue - Destination Task Queue
600 interfaceTag - Interface Identifier; unique identifier of an interface
601 profile - The identity and credentials of the network.
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__);
610 #define CsrWifiNmeProfileUpdateIndSendTo(dst__, src__, interfaceTag__, profile__) \
612 CsrWifiNmeProfileUpdateInd *msg__; \
613 CsrWifiNmeProfileUpdateIndCreate(msg__, dst__, src__, interfaceTag__, profile__); \
614 CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
617 #define CsrWifiNmeProfileUpdateIndSend(dst__, interfaceTag__, profile__) \
618 CsrWifiNmeProfileUpdateIndSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, interfaceTag__, profile__)
620 /*******************************************************************************
623 CsrWifiNmeSimGsmAuthIndSend
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.
637 queue - Destination Task Queue
638 randsLength - GSM RAND is 16 bytes long hence valid values are 32 (2 RANDS)
640 rands - 2 or 3 RANDs values.
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__);
649 #define CsrWifiNmeSimGsmAuthIndSendTo(dst__, src__, randsLength__, rands__) \
651 CsrWifiNmeSimGsmAuthInd *msg__; \
652 CsrWifiNmeSimGsmAuthIndCreate(msg__, dst__, src__, randsLength__, rands__); \
653 CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
656 #define CsrWifiNmeSimGsmAuthIndSend(dst__, randsLength__, rands__) \
657 CsrWifiNmeSimGsmAuthIndSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, randsLength__, rands__)
659 /*******************************************************************************
662 CsrWifiNmeSimGsmAuthResSend
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
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.
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__);
692 #define CsrWifiNmeSimGsmAuthResSendTo(dst__, src__, status__, kcsLength__, kcs__, sresLength__, sres__) \
694 CsrWifiNmeSimGsmAuthRes *msg__; \
695 CsrWifiNmeSimGsmAuthResCreate(msg__, dst__, src__, status__, kcsLength__, kcs__, sresLength__, sres__); \
696 CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
699 #define CsrWifiNmeSimGsmAuthResSend(src__, status__, kcsLength__, kcs__, sresLength__, sres__) \
700 CsrWifiNmeSimGsmAuthResSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, status__, kcsLength__, kcs__, sresLength__, sres__)
702 /*******************************************************************************
705 CsrWifiNmeSimImsiGetIndSend
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
717 queue - Destination Task Queue
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__);
724 #define CsrWifiNmeSimImsiGetIndSendTo(dst__, src__) \
726 CsrWifiNmeSimImsiGetInd *msg__; \
727 CsrWifiNmeSimImsiGetIndCreate(msg__, dst__, src__); \
728 CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
731 #define CsrWifiNmeSimImsiGetIndSend(dst__) \
732 CsrWifiNmeSimImsiGetIndSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE)
734 /*******************************************************************************
737 CsrWifiNmeSimImsiGetResSend
740 Response from the application that received the NME SIM IMSI GET IND.
743 status - Indicates the outcome of the requested operation: STATUS_SUCCESS
745 imsi - The value of the IMSI obtained from the UICC.
746 cardType - The UICC type (GSM only (SIM), UMTS only (USIM), Both).
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__);
756 #define CsrWifiNmeSimImsiGetResSendTo(dst__, src__, status__, imsi__, cardType__) \
758 CsrWifiNmeSimImsiGetRes *msg__; \
759 CsrWifiNmeSimImsiGetResCreate(msg__, dst__, src__, status__, imsi__, cardType__); \
760 CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
763 #define CsrWifiNmeSimImsiGetResSend(src__, status__, imsi__, cardType__) \
764 CsrWifiNmeSimImsiGetResSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, status__, imsi__, cardType__)
766 /*******************************************************************************
769 CsrWifiNmeSimUmtsAuthIndSend
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
783 queue - Destination Task Queue
784 rand - UMTS RAND value.
785 autn - UMTS AUTN value.
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);
794 #define CsrWifiNmeSimUmtsAuthIndSendTo(dst__, src__, rand__, autn__) \
796 CsrWifiNmeSimUmtsAuthInd *msg__; \
797 CsrWifiNmeSimUmtsAuthIndCreate(msg__, dst__, src__, rand__, autn__); \
798 CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
801 #define CsrWifiNmeSimUmtsAuthIndSend(dst__, rand__, autn__) \
802 CsrWifiNmeSimUmtsAuthIndSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, rand__, autn__)
804 /*******************************************************************************
807 CsrWifiNmeSimUmtsAuthResSend
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.
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
825 umtsIntegrityKey - The UMTS Integrity Key as calculated and returned by
827 resParameterLength - The length (in bytes) of the RES parameter (min=4; max
829 resParameter - The RES parameter as calculated and returned by the
831 auts - The AUTS parameter as calculated and returned by the
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);
846 #define CsrWifiNmeSimUmtsAuthResSendTo(dst__, src__, status__, result__, umtsCipherKey__, umtsIntegrityKey__, resParameterLength__, resParameter__, auts__) \
848 CsrWifiNmeSimUmtsAuthRes *msg__; \
849 CsrWifiNmeSimUmtsAuthResCreate(msg__, dst__, src__, status__, result__, umtsCipherKey__, umtsIntegrityKey__, resParameterLength__, resParameter__, auts__); \
850 CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
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__)
856 /*******************************************************************************
859 CsrWifiNmeWpsCancelReqSend
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
867 queue - Message Source Task Queue (Cfm's will be sent to this Queue)
868 interfaceTag - Interface Identifier; unique identifier of an interface
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__);
876 #define CsrWifiNmeWpsCancelReqSendTo(dst__, src__, interfaceTag__) \
878 CsrWifiNmeWpsCancelReq *msg__; \
879 CsrWifiNmeWpsCancelReqCreate(msg__, dst__, src__, interfaceTag__); \
880 CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
883 #define CsrWifiNmeWpsCancelReqSend(src__, interfaceTag__) \
884 CsrWifiNmeWpsCancelReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, interfaceTag__)
886 /*******************************************************************************
889 CsrWifiNmeWpsCancelCfmSend
892 Reports the status of the NME WPS REQ, the request is always SUCCESSFUL.
895 queue - Destination Task Queue
896 interfaceTag - Interface Identifier; unique identifier of an interface
897 status - Only returns CSR_WIFI_NME_STATUS_SUCCESS
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__);
906 #define CsrWifiNmeWpsCancelCfmSendTo(dst__, src__, interfaceTag__, status__) \
908 CsrWifiNmeWpsCancelCfm *msg__; \
909 CsrWifiNmeWpsCancelCfmCreate(msg__, dst__, src__, interfaceTag__, status__); \
910 CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
913 #define CsrWifiNmeWpsCancelCfmSend(dst__, interfaceTag__, status__) \
914 CsrWifiNmeWpsCancelCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, interfaceTag__, status__)
916 /*******************************************************************************
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.
927 queue - Destination Task Queue
928 interfaceTag - Interface Identifier; unique identifier of an interface
929 status - Indicates the success or otherwise of the requested
931 profile - This parameter is relevant only if
932 status==CSR_WIFI_NME_STATUS_SUCCESS.
933 The identity and credentials of the network.
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__);
943 #define CsrWifiNmeWpsCfmSendTo(dst__, src__, interfaceTag__, status__, profile__) \
945 CsrWifiNmeWpsCfm *msg__; \
946 CsrWifiNmeWpsCfmCreate(msg__, dst__, src__, interfaceTag__, status__, profile__); \
947 CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
950 #define CsrWifiNmeWpsCfmSend(dst__, interfaceTag__, status__, profile__) \
951 CsrWifiNmeWpsCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, interfaceTag__, status__, profile__)
953 /*******************************************************************************
956 CsrWifiNmeWpsConfigSetReqSend
959 This primitive passes the WPS information for the device to NME. This may
960 be accepted only if no interface is active.
963 queue - Message Source Task Queue (Cfm's will be sent to this Queue)
964 wpsConfig - WPS config.
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__);
972 #define CsrWifiNmeWpsConfigSetReqSendTo(dst__, src__, wpsConfig__) \
974 CsrWifiNmeWpsConfigSetReq *msg__; \
975 CsrWifiNmeWpsConfigSetReqCreate(msg__, dst__, src__, wpsConfig__); \
976 CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
979 #define CsrWifiNmeWpsConfigSetReqSend(src__, wpsConfig__) \
980 CsrWifiNmeWpsConfigSetReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, wpsConfig__)
982 /*******************************************************************************
985 CsrWifiNmeWpsConfigSetCfmSend
991 queue - Destination Task Queue
992 status - Status of the request.
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__);
1000 #define CsrWifiNmeWpsConfigSetCfmSendTo(dst__, src__, status__) \
1002 CsrWifiNmeWpsConfigSetCfm *msg__; \
1003 CsrWifiNmeWpsConfigSetCfmCreate(msg__, dst__, src__, status__); \
1004 CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
1007 #define CsrWifiNmeWpsConfigSetCfmSend(dst__, status__) \
1008 CsrWifiNmeWpsConfigSetCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, status__)
1010 /*******************************************************************************
1013 CsrWifiNmeWpsReqSend
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 '-'.
1023 queue - Message Source Task Queue (Cfm's will be sent to this Queue)
1024 interfaceTag - Interface Identifier; unique identifier of an interface
1026 ssid - Service Set identifier
1027 bssid - ID of Basic Service Set for which a WPS connection attempt is
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__);
1039 #define CsrWifiNmeWpsReqSendTo(dst__, src__, interfaceTag__, pin__, ssid__, bssid__) \
1041 CsrWifiNmeWpsReq *msg__; \
1042 CsrWifiNmeWpsReqCreate(msg__, dst__, src__, interfaceTag__, pin__, ssid__, bssid__); \
1043 CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
1046 #define CsrWifiNmeWpsReqSend(src__, interfaceTag__, pin__, ssid__, bssid__) \
1047 CsrWifiNmeWpsReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, interfaceTag__, pin__, ssid__, bssid__)
1054 #endif /* CSR_WIFI_NME_LIB_H__ */