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"
26 #ifndef CSR_WIFI_NME_ENABLE
27 #error CSR_WIFI_NME_ENABLE MUST be defined inorder to use csr_wifi_nme_lib.h
30 /*----------------------------------------------------------------------------*
31 * CsrWifiNmeFreeUpstreamMessageContents
34 * Free the allocated memory in a CSR_WIFI_NME upstream message. Does not
35 * free the message itself, and can only be used for upstream messages.
38 * Deallocates the resources in a CSR_WIFI_NME upstream message
39 *----------------------------------------------------------------------------*/
40 void CsrWifiNmeFreeUpstreamMessageContents(u16 eventClass, void *message);
42 /*----------------------------------------------------------------------------*
43 * CsrWifiNmeFreeDownstreamMessageContents
46 * Free the allocated memory in a CSR_WIFI_NME downstream message. Does not
47 * free the message itself, and can only be used for downstream messages.
50 * Deallocates the resources in a CSR_WIFI_NME downstream message
51 *----------------------------------------------------------------------------*/
52 void CsrWifiNmeFreeDownstreamMessageContents(u16 eventClass, void *message);
54 /*----------------------------------------------------------------------------*
55 * Enum to string functions
56 *----------------------------------------------------------------------------*/
57 const char* CsrWifiNmeAuthModeToString(CsrWifiNmeAuthMode value);
58 const char* CsrWifiNmeBssTypeToString(CsrWifiNmeBssType value);
59 const char* CsrWifiNmeCcxOptionsMaskToString(CsrWifiNmeCcxOptionsMask value);
60 const char* CsrWifiNmeConfigActionToString(CsrWifiNmeConfigAction value);
61 const char* CsrWifiNmeConnectionStatusToString(CsrWifiNmeConnectionStatus value);
62 const char* CsrWifiNmeCredentialTypeToString(CsrWifiNmeCredentialType value);
63 const char* CsrWifiNmeEapMethodToString(CsrWifiNmeEapMethod value);
64 const char* CsrWifiNmeEncryptionToString(CsrWifiNmeEncryption value);
65 const char* CsrWifiNmeIndicationsToString(CsrWifiNmeIndications value);
66 const char* CsrWifiNmeSecErrorToString(CsrWifiNmeSecError value);
67 const char* CsrWifiNmeSimCardTypeToString(CsrWifiNmeSimCardType value);
68 const char* CsrWifiNmeUmtsAuthResultToString(CsrWifiNmeUmtsAuthResult value);
69 const char* CsrWifiNmeWmmQosInfoToString(CsrWifiNmeWmmQosInfo value);
72 /*----------------------------------------------------------------------------*
73 * CsrPrim Type toString function.
74 * Converts a message type to the String name of the Message
75 *----------------------------------------------------------------------------*/
76 const char* CsrWifiNmePrimTypeToString(CsrPrim msgType);
78 /*----------------------------------------------------------------------------*
79 * Lookup arrays for PrimType name Strings
80 *----------------------------------------------------------------------------*/
81 extern const char *CsrWifiNmeUpstreamPrimNames[CSR_WIFI_NME_PRIM_UPSTREAM_COUNT];
82 extern const char *CsrWifiNmeDownstreamPrimNames[CSR_WIFI_NME_PRIM_DOWNSTREAM_COUNT];
84 /*******************************************************************************
87 CsrWifiNmeConnectionStatusGetReqSend
90 Requests the current connection status of the NME.
93 queue - Message Source Task Queue (Cfm's will be sent to this Queue)
94 interfaceTag - Interface Identifier; unique identifier of an interface
96 *******************************************************************************/
97 #define CsrWifiNmeConnectionStatusGetReqCreate(msg__, dst__, src__, interfaceTag__) \
98 msg__ = kmalloc(sizeof(CsrWifiNmeConnectionStatusGetReq), GFP_KERNEL); \
99 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_CONNECTION_STATUS_GET_REQ, dst__, src__); \
100 msg__->interfaceTag = (interfaceTag__);
102 #define CsrWifiNmeConnectionStatusGetReqSendTo(dst__, src__, interfaceTag__) \
104 CsrWifiNmeConnectionStatusGetReq *msg__; \
105 CsrWifiNmeConnectionStatusGetReqCreate(msg__, dst__, src__, interfaceTag__); \
106 CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
109 #define CsrWifiNmeConnectionStatusGetReqSend(src__, interfaceTag__) \
110 CsrWifiNmeConnectionStatusGetReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, interfaceTag__)
112 /*******************************************************************************
115 CsrWifiNmeConnectionStatusGetCfmSend
118 Reports the connection status of the NME.
121 queue - Destination Task Queue
122 interfaceTag - Interface Identifier; unique identifier of an interface
123 status - Indicates the success or otherwise of the requested
125 connectionStatus - NME current connection status
127 *******************************************************************************/
128 #define CsrWifiNmeConnectionStatusGetCfmCreate(msg__, dst__, src__, interfaceTag__, status__, connectionStatus__) \
129 msg__ = kmalloc(sizeof(CsrWifiNmeConnectionStatusGetCfm), GFP_KERNEL); \
130 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_CONNECTION_STATUS_GET_CFM, dst__, src__); \
131 msg__->interfaceTag = (interfaceTag__); \
132 msg__->status = (status__); \
133 msg__->connectionStatus = (connectionStatus__);
135 #define CsrWifiNmeConnectionStatusGetCfmSendTo(dst__, src__, interfaceTag__, status__, connectionStatus__) \
137 CsrWifiNmeConnectionStatusGetCfm *msg__; \
138 CsrWifiNmeConnectionStatusGetCfmCreate(msg__, dst__, src__, interfaceTag__, status__, connectionStatus__); \
139 CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
142 #define CsrWifiNmeConnectionStatusGetCfmSend(dst__, interfaceTag__, status__, connectionStatus__) \
143 CsrWifiNmeConnectionStatusGetCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, interfaceTag__, status__, connectionStatus__)
145 /*******************************************************************************
148 CsrWifiNmeEventMaskSetReqSend
151 The wireless manager application may register with the NME to receive
152 notification of interesting events. Indications will be sent only if the
153 wireless manager explicitly registers to be notified of that event.
154 indMask is a bit mask of values defined in CsrWifiNmeIndicationsMask.
157 queue - Message Source Task Queue (Cfm's will be sent to this Queue)
158 indMask - Set mask with values from CsrWifiNmeIndications
160 *******************************************************************************/
161 #define CsrWifiNmeEventMaskSetReqCreate(msg__, dst__, src__, indMask__) \
162 msg__ = kmalloc(sizeof(CsrWifiNmeEventMaskSetReq), GFP_KERNEL); \
163 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_EVENT_MASK_SET_REQ, dst__, src__); \
164 msg__->indMask = (indMask__);
166 #define CsrWifiNmeEventMaskSetReqSendTo(dst__, src__, indMask__) \
168 CsrWifiNmeEventMaskSetReq *msg__; \
169 CsrWifiNmeEventMaskSetReqCreate(msg__, dst__, src__, indMask__); \
170 CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
173 #define CsrWifiNmeEventMaskSetReqSend(src__, indMask__) \
174 CsrWifiNmeEventMaskSetReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, indMask__)
176 /*******************************************************************************
179 CsrWifiNmeEventMaskSetCfmSend
182 The NME calls the primitive to report the result of the request
186 queue - Destination Task Queue
187 status - Reports the result of the request
189 *******************************************************************************/
190 #define CsrWifiNmeEventMaskSetCfmCreate(msg__, dst__, src__, status__) \
191 msg__ = kmalloc(sizeof(CsrWifiNmeEventMaskSetCfm), GFP_KERNEL); \
192 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_EVENT_MASK_SET_CFM, dst__, src__); \
193 msg__->status = (status__);
195 #define CsrWifiNmeEventMaskSetCfmSendTo(dst__, src__, status__) \
197 CsrWifiNmeEventMaskSetCfm *msg__; \
198 CsrWifiNmeEventMaskSetCfmCreate(msg__, dst__, src__, status__); \
199 CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
202 #define CsrWifiNmeEventMaskSetCfmSend(dst__, status__) \
203 CsrWifiNmeEventMaskSetCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, status__)
205 /*******************************************************************************
208 CsrWifiNmeProfileConnectReqSend
211 Requests the NME to attempt to connect to the specified profile.
212 Overrides any current connection attempt.
215 queue - Message Source Task Queue (Cfm's will be sent to this Queue)
216 interfaceTag - Interface Identifier; unique identifier of an interface
217 profileIdentity - Identity (BSSID, SSID) of profile to be connected to.
218 It must match an existing profile in the NME.
220 *******************************************************************************/
221 #define CsrWifiNmeProfileConnectReqCreate(msg__, dst__, src__, interfaceTag__, profileIdentity__) \
222 msg__ = kmalloc(sizeof(CsrWifiNmeProfileConnectReq), GFP_KERNEL); \
223 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_PROFILE_CONNECT_REQ, dst__, src__); \
224 msg__->interfaceTag = (interfaceTag__); \
225 msg__->profileIdentity = (profileIdentity__);
227 #define CsrWifiNmeProfileConnectReqSendTo(dst__, src__, interfaceTag__, profileIdentity__) \
229 CsrWifiNmeProfileConnectReq *msg__; \
230 CsrWifiNmeProfileConnectReqCreate(msg__, dst__, src__, interfaceTag__, profileIdentity__); \
231 CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
234 #define CsrWifiNmeProfileConnectReqSend(src__, interfaceTag__, profileIdentity__) \
235 CsrWifiNmeProfileConnectReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, interfaceTag__, profileIdentity__)
237 /*******************************************************************************
240 CsrWifiNmeProfileConnectCfmSend
243 Reports the status of the NME PROFILE CONNECT REQ. If unsuccessful the
244 connectAttempt parameters contain details of the APs that the NME
245 attempted to connect to before reporting the failure of the request.
248 queue - Destination Task Queue
249 interfaceTag - Interface Identifier; unique identifier of an
251 status - Indicates the success or otherwise of the requested
253 connectAttemptsCount - This parameter is relevant only if
254 status!=CSR_WIFI_NME_STATUS_SUCCESS.
255 Number of connection attempt elements provided with
257 connectAttempts - This parameter is relevant only if
258 status!=CSR_WIFI_NME_STATUS_SUCCESS.
259 Points to the list of connection attempt elements
260 provided with this primitive
261 Each element of the list provides information about
262 an AP on which the connection attempt was made and
263 the error that occurred during the attempt.
265 *******************************************************************************/
266 #define CsrWifiNmeProfileConnectCfmCreate(msg__, dst__, src__, interfaceTag__, status__, connectAttemptsCount__, connectAttempts__) \
267 msg__ = kmalloc(sizeof(CsrWifiNmeProfileConnectCfm), GFP_KERNEL); \
268 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_PROFILE_CONNECT_CFM, dst__, src__); \
269 msg__->interfaceTag = (interfaceTag__); \
270 msg__->status = (status__); \
271 msg__->connectAttemptsCount = (connectAttemptsCount__); \
272 msg__->connectAttempts = (connectAttempts__);
274 #define CsrWifiNmeProfileConnectCfmSendTo(dst__, src__, interfaceTag__, status__, connectAttemptsCount__, connectAttempts__) \
276 CsrWifiNmeProfileConnectCfm *msg__; \
277 CsrWifiNmeProfileConnectCfmCreate(msg__, dst__, src__, interfaceTag__, status__, connectAttemptsCount__, connectAttempts__); \
278 CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
281 #define CsrWifiNmeProfileConnectCfmSend(dst__, interfaceTag__, status__, connectAttemptsCount__, connectAttempts__) \
282 CsrWifiNmeProfileConnectCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, interfaceTag__, status__, connectAttemptsCount__, connectAttempts__)
284 /*******************************************************************************
287 CsrWifiNmeProfileDeleteAllReqSend
290 Deletes all profiles present in the NME, but does NOT modify the
291 preferred profile list.
294 queue - Message Source Task Queue (Cfm's will be sent to this Queue)
296 *******************************************************************************/
297 #define CsrWifiNmeProfileDeleteAllReqCreate(msg__, dst__, src__) \
298 msg__ = kmalloc(sizeof(CsrWifiNmeProfileDeleteAllReq), GFP_KERNEL); \
299 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_PROFILE_DELETE_ALL_REQ, dst__, src__);
301 #define CsrWifiNmeProfileDeleteAllReqSendTo(dst__, src__) \
303 CsrWifiNmeProfileDeleteAllReq *msg__; \
304 CsrWifiNmeProfileDeleteAllReqCreate(msg__, dst__, src__); \
305 CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
308 #define CsrWifiNmeProfileDeleteAllReqSend(src__) \
309 CsrWifiNmeProfileDeleteAllReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__)
311 /*******************************************************************************
314 CsrWifiNmeProfileDeleteAllCfmSend
317 Reports the status of the CSR_WIFI_NME_PROFILE_DELETE_ALL_REQ.
318 Returns always CSR_WIFI_NME_STATUS_SUCCESS.
321 queue - Destination Task Queue
322 status - Indicates the success or otherwise of the requested operation, but
323 in this case it always set to success.
325 *******************************************************************************/
326 #define CsrWifiNmeProfileDeleteAllCfmCreate(msg__, dst__, src__, status__) \
327 msg__ = kmalloc(sizeof(CsrWifiNmeProfileDeleteAllCfm), GFP_KERNEL); \
328 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_PROFILE_DELETE_ALL_CFM, dst__, src__); \
329 msg__->status = (status__);
331 #define CsrWifiNmeProfileDeleteAllCfmSendTo(dst__, src__, status__) \
333 CsrWifiNmeProfileDeleteAllCfm *msg__; \
334 CsrWifiNmeProfileDeleteAllCfmCreate(msg__, dst__, src__, status__); \
335 CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
338 #define CsrWifiNmeProfileDeleteAllCfmSend(dst__, status__) \
339 CsrWifiNmeProfileDeleteAllCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, status__)
341 /*******************************************************************************
344 CsrWifiNmeProfileDeleteReqSend
347 Will delete the profile with a matching identity, but does NOT modify the
348 preferred profile list.
351 queue - Message Source Task Queue (Cfm's will be sent to this Queue)
352 profileIdentity - Identity (BSSID, SSID) of profile to be deleted.
354 *******************************************************************************/
355 #define CsrWifiNmeProfileDeleteReqCreate(msg__, dst__, src__, profileIdentity__) \
356 msg__ = kmalloc(sizeof(CsrWifiNmeProfileDeleteReq), GFP_KERNEL); \
357 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_PROFILE_DELETE_REQ, dst__, src__); \
358 msg__->profileIdentity = (profileIdentity__);
360 #define CsrWifiNmeProfileDeleteReqSendTo(dst__, src__, profileIdentity__) \
362 CsrWifiNmeProfileDeleteReq *msg__; \
363 CsrWifiNmeProfileDeleteReqCreate(msg__, dst__, src__, profileIdentity__); \
364 CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
367 #define CsrWifiNmeProfileDeleteReqSend(src__, profileIdentity__) \
368 CsrWifiNmeProfileDeleteReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, profileIdentity__)
370 /*******************************************************************************
373 CsrWifiNmeProfileDeleteCfmSend
376 Reports the status of the CSR_WIFI_NME_PROFILE_DELETE_REQ.
377 Returns CSR_WIFI_NME_STATUS_NOT_FOUND if there is no matching profile.
380 queue - Destination Task Queue
381 status - Indicates the success or otherwise of the requested operation.
383 *******************************************************************************/
384 #define CsrWifiNmeProfileDeleteCfmCreate(msg__, dst__, src__, status__) \
385 msg__ = kmalloc(sizeof(CsrWifiNmeProfileDeleteCfm), GFP_KERNEL); \
386 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_PROFILE_DELETE_CFM, dst__, src__); \
387 msg__->status = (status__);
389 #define CsrWifiNmeProfileDeleteCfmSendTo(dst__, src__, status__) \
391 CsrWifiNmeProfileDeleteCfm *msg__; \
392 CsrWifiNmeProfileDeleteCfmCreate(msg__, dst__, src__, status__); \
393 CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
396 #define CsrWifiNmeProfileDeleteCfmSend(dst__, status__) \
397 CsrWifiNmeProfileDeleteCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, status__)
399 /*******************************************************************************
402 CsrWifiNmeProfileDisconnectIndSend
405 Indication generated from the NME (if an application subscribes to
406 receive it) that informs that application that the current profile
407 connection has disconnected. The indication will contain information
408 about APs that it attempted to maintain the connection via i.e. in the
409 case of failed roaming.
412 queue - Destination Task Queue
413 interfaceTag - Interface Identifier; unique identifier of an
415 connectAttemptsCount - Number of connection attempt elements provided with
417 connectAttempts - Points to the list of connection attempt elements
418 provided with this primitive
419 Each element of the list provides information about
420 an AP on which the connection attempt was made and
421 the error occurred during the attempt.
423 *******************************************************************************/
424 #define CsrWifiNmeProfileDisconnectIndCreate(msg__, dst__, src__, interfaceTag__, connectAttemptsCount__, connectAttempts__) \
425 msg__ = kmalloc(sizeof(CsrWifiNmeProfileDisconnectInd), GFP_KERNEL); \
426 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_PROFILE_DISCONNECT_IND, dst__, src__); \
427 msg__->interfaceTag = (interfaceTag__); \
428 msg__->connectAttemptsCount = (connectAttemptsCount__); \
429 msg__->connectAttempts = (connectAttempts__);
431 #define CsrWifiNmeProfileDisconnectIndSendTo(dst__, src__, interfaceTag__, connectAttemptsCount__, connectAttempts__) \
433 CsrWifiNmeProfileDisconnectInd *msg__; \
434 CsrWifiNmeProfileDisconnectIndCreate(msg__, dst__, src__, interfaceTag__, connectAttemptsCount__, connectAttempts__); \
435 CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
438 #define CsrWifiNmeProfileDisconnectIndSend(dst__, interfaceTag__, connectAttemptsCount__, connectAttempts__) \
439 CsrWifiNmeProfileDisconnectIndSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, interfaceTag__, connectAttemptsCount__, connectAttempts__)
441 /*******************************************************************************
444 CsrWifiNmeProfileOrderSetReqSend
447 Defines the preferred order that profiles present in the NME should be
448 used during the NME auto-connect behaviour.
449 If profileIdentitysCount == 0, it removes any existing preferred profile
450 list already present in the NME, effectively disabling the auto-connect
452 NOTE: Profile identities that do not match any profile stored in the NME
453 are ignored during the auto-connect procedure.
454 NOTE: during auto-connect the NME will only attempt to join an existing
455 adhoc network and it will never attempt to host an adhoc network; for
456 hosting and adhoc network, use CSR_WIFI_NME_PROFILE_CONNECT_REQ
459 queue - Message Source Task Queue (Cfm's will be sent to this Queue)
460 interfaceTag - Interface Identifier; unique identifier of an
462 profileIdentitysCount - The number of profiles identities in the list.
463 profileIdentitys - Points to the list of profile identities.
465 *******************************************************************************/
466 #define CsrWifiNmeProfileOrderSetReqCreate(msg__, dst__, src__, interfaceTag__, profileIdentitysCount__, profileIdentitys__) \
467 msg__ = kmalloc(sizeof(CsrWifiNmeProfileOrderSetReq), GFP_KERNEL); \
468 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_PROFILE_ORDER_SET_REQ, dst__, src__); \
469 msg__->interfaceTag = (interfaceTag__); \
470 msg__->profileIdentitysCount = (profileIdentitysCount__); \
471 msg__->profileIdentitys = (profileIdentitys__);
473 #define CsrWifiNmeProfileOrderSetReqSendTo(dst__, src__, interfaceTag__, profileIdentitysCount__, profileIdentitys__) \
475 CsrWifiNmeProfileOrderSetReq *msg__; \
476 CsrWifiNmeProfileOrderSetReqCreate(msg__, dst__, src__, interfaceTag__, profileIdentitysCount__, profileIdentitys__); \
477 CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
480 #define CsrWifiNmeProfileOrderSetReqSend(src__, interfaceTag__, profileIdentitysCount__, profileIdentitys__) \
481 CsrWifiNmeProfileOrderSetReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, interfaceTag__, profileIdentitysCount__, profileIdentitys__)
483 /*******************************************************************************
486 CsrWifiNmeProfileOrderSetCfmSend
489 Confirmation to UNIFI_NME_PROFILE_ORDER_SET.request.
492 queue - Destination Task Queue
493 interfaceTag - Interface Identifier; unique identifier of an interface
494 status - Indicates the success or otherwise of the requested
497 *******************************************************************************/
498 #define CsrWifiNmeProfileOrderSetCfmCreate(msg__, dst__, src__, interfaceTag__, status__) \
499 msg__ = kmalloc(sizeof(CsrWifiNmeProfileOrderSetCfm), GFP_KERNEL); \
500 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_PROFILE_ORDER_SET_CFM, dst__, src__); \
501 msg__->interfaceTag = (interfaceTag__); \
502 msg__->status = (status__);
504 #define CsrWifiNmeProfileOrderSetCfmSendTo(dst__, src__, interfaceTag__, status__) \
506 CsrWifiNmeProfileOrderSetCfm *msg__; \
507 CsrWifiNmeProfileOrderSetCfmCreate(msg__, dst__, src__, interfaceTag__, status__); \
508 CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
511 #define CsrWifiNmeProfileOrderSetCfmSend(dst__, interfaceTag__, status__) \
512 CsrWifiNmeProfileOrderSetCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, interfaceTag__, status__)
514 /*******************************************************************************
517 CsrWifiNmeProfileSetReqSend
520 Creates or updates an existing profile in the NME that matches the unique
521 identity of the profile. Each profile is identified by the combination of
522 BSSID and SSID. The profile contains all the required credentials for
523 attempting to connect to the network. Creating or updating a profile via
524 the NME PROFILE SET REQ does NOT add the profile to the preferred profile
525 list within the NME used for the NME auto-connect behaviour.
528 queue - Message Source Task Queue (Cfm's will be sent to this Queue)
529 profile - Specifies the identity and credentials of the network.
531 *******************************************************************************/
532 #define CsrWifiNmeProfileSetReqCreate(msg__, dst__, src__, profile__) \
533 msg__ = kmalloc(sizeof(CsrWifiNmeProfileSetReq), GFP_KERNEL); \
534 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_PROFILE_SET_REQ, dst__, src__); \
535 msg__->profile = (profile__);
537 #define CsrWifiNmeProfileSetReqSendTo(dst__, src__, profile__) \
539 CsrWifiNmeProfileSetReq *msg__; \
540 CsrWifiNmeProfileSetReqCreate(msg__, dst__, src__, profile__); \
541 CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
544 #define CsrWifiNmeProfileSetReqSend(src__, profile__) \
545 CsrWifiNmeProfileSetReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, profile__)
547 /*******************************************************************************
550 CsrWifiNmeProfileSetCfmSend
553 Reports the status of the NME PROFILE SET REQ; the request will only fail
554 if the details specified in the profile contains an invalid combination
555 of parameters for example specifying the profile as cloaked but not
556 specifying the SSID. The NME doesn't limit the number of profiles that
557 may be created. The NME assumes that the entity configuring it is aware
558 of the appropriate limits.
561 queue - Destination Task Queue
562 status - Indicates the success or otherwise of the requested operation.
564 *******************************************************************************/
565 #define CsrWifiNmeProfileSetCfmCreate(msg__, dst__, src__, status__) \
566 msg__ = kmalloc(sizeof(CsrWifiNmeProfileSetCfm), GFP_KERNEL); \
567 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_PROFILE_SET_CFM, dst__, src__); \
568 msg__->status = (status__);
570 #define CsrWifiNmeProfileSetCfmSendTo(dst__, src__, status__) \
572 CsrWifiNmeProfileSetCfm *msg__; \
573 CsrWifiNmeProfileSetCfmCreate(msg__, dst__, src__, status__); \
574 CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
577 #define CsrWifiNmeProfileSetCfmSend(dst__, status__) \
578 CsrWifiNmeProfileSetCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, status__)
580 /*******************************************************************************
583 CsrWifiNmeProfileUpdateIndSend
586 Indication generated from the NME (if an application subscribes to
587 receive it) that informs that application that the contained profile has
589 For example, either the credentials EAP-FAST PAC file or the session data
590 within the profile has changed.
591 It is up to the application whether it stores this updated profile or
595 queue - Destination Task Queue
596 interfaceTag - Interface Identifier; unique identifier of an interface
597 profile - The identity and credentials of the network.
599 *******************************************************************************/
600 #define CsrWifiNmeProfileUpdateIndCreate(msg__, dst__, src__, interfaceTag__, profile__) \
601 msg__ = kmalloc(sizeof(CsrWifiNmeProfileUpdateInd), GFP_KERNEL); \
602 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_PROFILE_UPDATE_IND, dst__, src__); \
603 msg__->interfaceTag = (interfaceTag__); \
604 msg__->profile = (profile__);
606 #define CsrWifiNmeProfileUpdateIndSendTo(dst__, src__, interfaceTag__, profile__) \
608 CsrWifiNmeProfileUpdateInd *msg__; \
609 CsrWifiNmeProfileUpdateIndCreate(msg__, dst__, src__, interfaceTag__, profile__); \
610 CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
613 #define CsrWifiNmeProfileUpdateIndSend(dst__, interfaceTag__, profile__) \
614 CsrWifiNmeProfileUpdateIndSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, interfaceTag__, profile__)
616 /*******************************************************************************
619 CsrWifiNmeSimGsmAuthIndSend
622 Indication generated from the NME (if an application subscribes to
623 receive it) that requests the UICC Manager to perform a GSM
624 authentication on behalf of the NME. This indication is generated when
625 the NME is attempting to connect to a profile configured for EAP-SIM. An
626 application MUST register to receive this indication for the NME to
627 support the EAP-SIM credential types. Otherwise the NME has no route to
628 obtain the information from the UICC. EAP-SIM authentication requires 2
629 or 3 GSM authentication rounds and therefore 2 or 3 RANDS (GSM Random
630 Challenges) are included.
633 queue - Destination Task Queue
634 randsLength - GSM RAND is 16 bytes long hence valid values are 32 (2 RANDS)
636 rands - 2 or 3 RANDs values.
638 *******************************************************************************/
639 #define CsrWifiNmeSimGsmAuthIndCreate(msg__, dst__, src__, randsLength__, rands__) \
640 msg__ = kmalloc(sizeof(CsrWifiNmeSimGsmAuthInd), GFP_KERNEL); \
641 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_SIM_GSM_AUTH_IND, dst__, src__); \
642 msg__->randsLength = (randsLength__); \
643 msg__->rands = (rands__);
645 #define CsrWifiNmeSimGsmAuthIndSendTo(dst__, src__, randsLength__, rands__) \
647 CsrWifiNmeSimGsmAuthInd *msg__; \
648 CsrWifiNmeSimGsmAuthIndCreate(msg__, dst__, src__, randsLength__, rands__); \
649 CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
652 #define CsrWifiNmeSimGsmAuthIndSend(dst__, randsLength__, rands__) \
653 CsrWifiNmeSimGsmAuthIndSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, randsLength__, rands__)
655 /*******************************************************************************
658 CsrWifiNmeSimGsmAuthResSend
661 Response from the application that received the NME SIM GSM AUTH IND. For
662 each GSM authentication round a GSM Ciphering key (Kc) and a signed
663 response (SRES) are produced. Since 2 or 3 GSM authentication rounds are
664 used the 2 or 3 Kc's obtained respectively are combined into one buffer
665 and similarly the 2 or 3 SRES's obtained are combined into another
666 buffer. The order of Kc values (SRES values respectively) in their buffer
667 is the same as that of their corresponding RAND values in the incoming
671 status - Indicates the outcome of the requested operation:
672 STATUS_SUCCESS or STATUS_ERROR
673 kcsLength - Length in Bytes of Kc buffer. Legal values are: 16 or 24.
674 kcs - Kc buffer holding 2 or 3 Kc values.
675 sresLength - Length in Bytes of SRES buffer. Legal values are: 8 or 12.
676 sres - SRES buffer holding 2 or 3 SRES values.
678 *******************************************************************************/
679 #define CsrWifiNmeSimGsmAuthResCreate(msg__, dst__, src__, status__, kcsLength__, kcs__, sresLength__, sres__) \
680 msg__ = kmalloc(sizeof(CsrWifiNmeSimGsmAuthRes), GFP_KERNEL); \
681 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_SIM_GSM_AUTH_RES, dst__, src__); \
682 msg__->status = (status__); \
683 msg__->kcsLength = (kcsLength__); \
684 msg__->kcs = (kcs__); \
685 msg__->sresLength = (sresLength__); \
686 msg__->sres = (sres__);
688 #define CsrWifiNmeSimGsmAuthResSendTo(dst__, src__, status__, kcsLength__, kcs__, sresLength__, sres__) \
690 CsrWifiNmeSimGsmAuthRes *msg__; \
691 CsrWifiNmeSimGsmAuthResCreate(msg__, dst__, src__, status__, kcsLength__, kcs__, sresLength__, sres__); \
692 CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
695 #define CsrWifiNmeSimGsmAuthResSend(src__, status__, kcsLength__, kcs__, sresLength__, sres__) \
696 CsrWifiNmeSimGsmAuthResSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, status__, kcsLength__, kcs__, sresLength__, sres__)
698 /*******************************************************************************
701 CsrWifiNmeSimImsiGetIndSend
704 Indication generated from the NME (if an application subscribes to
705 receive it) that requests the IMSI and UICC type from the UICC Manager.
706 This indication is generated when the NME is attempting to connect to a
707 profile configured for EAP-SIM/AKA. An application MUST register to
708 receive this indication for the NME to support the EAP-SIM/AKA credential
709 types. Otherwise the NME has no route to obtain the information from the
713 queue - Destination Task Queue
715 *******************************************************************************/
716 #define CsrWifiNmeSimImsiGetIndCreate(msg__, dst__, src__) \
717 msg__ = kmalloc(sizeof(CsrWifiNmeSimImsiGetInd), GFP_KERNEL); \
718 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_SIM_IMSI_GET_IND, dst__, src__);
720 #define CsrWifiNmeSimImsiGetIndSendTo(dst__, src__) \
722 CsrWifiNmeSimImsiGetInd *msg__; \
723 CsrWifiNmeSimImsiGetIndCreate(msg__, dst__, src__); \
724 CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
727 #define CsrWifiNmeSimImsiGetIndSend(dst__) \
728 CsrWifiNmeSimImsiGetIndSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE)
730 /*******************************************************************************
733 CsrWifiNmeSimImsiGetResSend
736 Response from the application that received the NME SIM IMSI GET IND.
739 status - Indicates the outcome of the requested operation: STATUS_SUCCESS
741 imsi - The value of the IMSI obtained from the UICC.
742 cardType - The UICC type (GSM only (SIM), UMTS only (USIM), Both).
744 *******************************************************************************/
745 #define CsrWifiNmeSimImsiGetResCreate(msg__, dst__, src__, status__, imsi__, cardType__) \
746 msg__ = kmalloc(sizeof(CsrWifiNmeSimImsiGetRes), GFP_KERNEL); \
747 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_SIM_IMSI_GET_RES, dst__, src__); \
748 msg__->status = (status__); \
749 msg__->imsi = (imsi__); \
750 msg__->cardType = (cardType__);
752 #define CsrWifiNmeSimImsiGetResSendTo(dst__, src__, status__, imsi__, cardType__) \
754 CsrWifiNmeSimImsiGetRes *msg__; \
755 CsrWifiNmeSimImsiGetResCreate(msg__, dst__, src__, status__, imsi__, cardType__); \
756 CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
759 #define CsrWifiNmeSimImsiGetResSend(src__, status__, imsi__, cardType__) \
760 CsrWifiNmeSimImsiGetResSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, status__, imsi__, cardType__)
762 /*******************************************************************************
765 CsrWifiNmeSimUmtsAuthIndSend
768 Indication generated from the NME (if an application subscribes to
769 receive it) that requests the UICC Manager to perform a UMTS
770 authentication on behalf of the NME. This indication is generated when
771 the NME is attempting to connect to a profile configured for EAP-AKA. An
772 application MUST register to receive this indication for the NME to
773 support the EAP-AKA credential types. Otherwise the NME has no route to
774 obtain the information from the USIM. EAP-AKA requires one UMTS
775 authentication round and therefore only one RAND and one AUTN values are
779 queue - Destination Task Queue
780 rand - UMTS RAND value.
781 autn - UMTS AUTN value.
783 *******************************************************************************/
784 #define CsrWifiNmeSimUmtsAuthIndCreate(msg__, dst__, src__, rand__, autn__) \
785 msg__ = kmalloc(sizeof(CsrWifiNmeSimUmtsAuthInd), GFP_KERNEL); \
786 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_SIM_UMTS_AUTH_IND, dst__, src__); \
787 memcpy(msg__->rand, (rand__), sizeof(u8) * 16); \
788 memcpy(msg__->autn, (autn__), sizeof(u8) * 16);
790 #define CsrWifiNmeSimUmtsAuthIndSendTo(dst__, src__, rand__, autn__) \
792 CsrWifiNmeSimUmtsAuthInd *msg__; \
793 CsrWifiNmeSimUmtsAuthIndCreate(msg__, dst__, src__, rand__, autn__); \
794 CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
797 #define CsrWifiNmeSimUmtsAuthIndSend(dst__, rand__, autn__) \
798 CsrWifiNmeSimUmtsAuthIndSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, rand__, autn__)
800 /*******************************************************************************
803 CsrWifiNmeSimUmtsAuthResSend
806 Response from the application that received the NME SIM UMTS AUTH IND.
807 The values of umtsCipherKey, umtsIntegrityKey, resParameterLength and
808 resParameter are only meanigful when result = UMTS_AUTH_RESULT_SUCCESS.
809 The value of auts is only meaningful when
810 result=UMTS_AUTH_RESULT_SYNC_FAIL.
813 status - Indicates the outcome of the requested operation:
814 STATUS_SUCCESS or STATUS_ERROR.
815 result - The result of UMTS authentication as performed by the
816 UICC which could be: Success, Authentication Reject or
817 Synchronisation Failure. For all these 3 outcomes the
818 value of status is success.
819 umtsCipherKey - The UMTS Cipher Key as calculated and returned by the
821 umtsIntegrityKey - The UMTS Integrity Key as calculated and returned by
823 resParameterLength - The length (in bytes) of the RES parameter (min=4; max
825 resParameter - The RES parameter as calculated and returned by the
827 auts - The AUTS parameter as calculated and returned by the
830 *******************************************************************************/
831 #define CsrWifiNmeSimUmtsAuthResCreate(msg__, dst__, src__, status__, result__, umtsCipherKey__, umtsIntegrityKey__, resParameterLength__, resParameter__, auts__) \
832 msg__ = kmalloc(sizeof(CsrWifiNmeSimUmtsAuthRes), GFP_KERNEL); \
833 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_SIM_UMTS_AUTH_RES, dst__, src__); \
834 msg__->status = (status__); \
835 msg__->result = (result__); \
836 memcpy(msg__->umtsCipherKey, (umtsCipherKey__), sizeof(u8) * 16); \
837 memcpy(msg__->umtsIntegrityKey, (umtsIntegrityKey__), sizeof(u8) * 16); \
838 msg__->resParameterLength = (resParameterLength__); \
839 msg__->resParameter = (resParameter__); \
840 memcpy(msg__->auts, (auts__), sizeof(u8) * 14);
842 #define CsrWifiNmeSimUmtsAuthResSendTo(dst__, src__, status__, result__, umtsCipherKey__, umtsIntegrityKey__, resParameterLength__, resParameter__, auts__) \
844 CsrWifiNmeSimUmtsAuthRes *msg__; \
845 CsrWifiNmeSimUmtsAuthResCreate(msg__, dst__, src__, status__, result__, umtsCipherKey__, umtsIntegrityKey__, resParameterLength__, resParameter__, auts__); \
846 CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
849 #define CsrWifiNmeSimUmtsAuthResSend(src__, status__, result__, umtsCipherKey__, umtsIntegrityKey__, resParameterLength__, resParameter__, auts__) \
850 CsrWifiNmeSimUmtsAuthResSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, status__, result__, umtsCipherKey__, umtsIntegrityKey__, resParameterLength__, resParameter__, auts__)
852 /*******************************************************************************
855 CsrWifiNmeWpsCancelReqSend
858 Requests the NME to cancel any WPS procedure that it is currently
859 performing. This includes WPS registrar activities started because of
860 CSR_WIFI_NME_AP_REGISTER.request
863 queue - Message Source Task Queue (Cfm's will be sent to this Queue)
864 interfaceTag - Interface Identifier; unique identifier of an interface
866 *******************************************************************************/
867 #define CsrWifiNmeWpsCancelReqCreate(msg__, dst__, src__, interfaceTag__) \
868 msg__ = kmalloc(sizeof(CsrWifiNmeWpsCancelReq), GFP_KERNEL); \
869 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_WPS_CANCEL_REQ, dst__, src__); \
870 msg__->interfaceTag = (interfaceTag__);
872 #define CsrWifiNmeWpsCancelReqSendTo(dst__, src__, interfaceTag__) \
874 CsrWifiNmeWpsCancelReq *msg__; \
875 CsrWifiNmeWpsCancelReqCreate(msg__, dst__, src__, interfaceTag__); \
876 CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
879 #define CsrWifiNmeWpsCancelReqSend(src__, interfaceTag__) \
880 CsrWifiNmeWpsCancelReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, interfaceTag__)
882 /*******************************************************************************
885 CsrWifiNmeWpsCancelCfmSend
888 Reports the status of the NME WPS REQ, the request is always SUCCESSFUL.
891 queue - Destination Task Queue
892 interfaceTag - Interface Identifier; unique identifier of an interface
893 status - Only returns CSR_WIFI_NME_STATUS_SUCCESS
895 *******************************************************************************/
896 #define CsrWifiNmeWpsCancelCfmCreate(msg__, dst__, src__, interfaceTag__, status__) \
897 msg__ = kmalloc(sizeof(CsrWifiNmeWpsCancelCfm), GFP_KERNEL); \
898 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_WPS_CANCEL_CFM, dst__, src__); \
899 msg__->interfaceTag = (interfaceTag__); \
900 msg__->status = (status__);
902 #define CsrWifiNmeWpsCancelCfmSendTo(dst__, src__, interfaceTag__, status__) \
904 CsrWifiNmeWpsCancelCfm *msg__; \
905 CsrWifiNmeWpsCancelCfmCreate(msg__, dst__, src__, interfaceTag__, status__); \
906 CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
909 #define CsrWifiNmeWpsCancelCfmSend(dst__, interfaceTag__, status__) \
910 CsrWifiNmeWpsCancelCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, interfaceTag__, status__)
912 /*******************************************************************************
918 Reports the status of the NME WPS REQ.
919 If CSR_WIFI_NME_STATUS_SUCCESS, the profile parameter contains the
920 identity and credentials of the AP.
923 queue - Destination Task Queue
924 interfaceTag - Interface Identifier; unique identifier of an interface
925 status - Indicates the success or otherwise of the requested
927 profile - This parameter is relevant only if
928 status==CSR_WIFI_NME_STATUS_SUCCESS.
929 The identity and credentials of the network.
931 *******************************************************************************/
932 #define CsrWifiNmeWpsCfmCreate(msg__, dst__, src__, interfaceTag__, status__, profile__) \
933 msg__ = kmalloc(sizeof(CsrWifiNmeWpsCfm), GFP_KERNEL); \
934 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_WPS_CFM, dst__, src__); \
935 msg__->interfaceTag = (interfaceTag__); \
936 msg__->status = (status__); \
937 msg__->profile = (profile__);
939 #define CsrWifiNmeWpsCfmSendTo(dst__, src__, interfaceTag__, status__, profile__) \
941 CsrWifiNmeWpsCfm *msg__; \
942 CsrWifiNmeWpsCfmCreate(msg__, dst__, src__, interfaceTag__, status__, profile__); \
943 CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
946 #define CsrWifiNmeWpsCfmSend(dst__, interfaceTag__, status__, profile__) \
947 CsrWifiNmeWpsCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, interfaceTag__, status__, profile__)
949 /*******************************************************************************
952 CsrWifiNmeWpsConfigSetReqSend
955 This primitive passes the WPS information for the device to NME. This may
956 be accepted only if no interface is active.
959 queue - Message Source Task Queue (Cfm's will be sent to this Queue)
960 wpsConfig - WPS config.
962 *******************************************************************************/
963 #define CsrWifiNmeWpsConfigSetReqCreate(msg__, dst__, src__, wpsConfig__) \
964 msg__ = kmalloc(sizeof(CsrWifiNmeWpsConfigSetReq), GFP_KERNEL); \
965 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_WPS_CONFIG_SET_REQ, dst__, src__); \
966 msg__->wpsConfig = (wpsConfig__);
968 #define CsrWifiNmeWpsConfigSetReqSendTo(dst__, src__, wpsConfig__) \
970 CsrWifiNmeWpsConfigSetReq *msg__; \
971 CsrWifiNmeWpsConfigSetReqCreate(msg__, dst__, src__, wpsConfig__); \
972 CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
975 #define CsrWifiNmeWpsConfigSetReqSend(src__, wpsConfig__) \
976 CsrWifiNmeWpsConfigSetReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, wpsConfig__)
978 /*******************************************************************************
981 CsrWifiNmeWpsConfigSetCfmSend
987 queue - Destination Task Queue
988 status - Status of the request.
990 *******************************************************************************/
991 #define CsrWifiNmeWpsConfigSetCfmCreate(msg__, dst__, src__, status__) \
992 msg__ = kmalloc(sizeof(CsrWifiNmeWpsConfigSetCfm), GFP_KERNEL); \
993 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_WPS_CONFIG_SET_CFM, dst__, src__); \
994 msg__->status = (status__);
996 #define CsrWifiNmeWpsConfigSetCfmSendTo(dst__, src__, status__) \
998 CsrWifiNmeWpsConfigSetCfm *msg__; \
999 CsrWifiNmeWpsConfigSetCfmCreate(msg__, dst__, src__, status__); \
1000 CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
1003 #define CsrWifiNmeWpsConfigSetCfmSend(dst__, status__) \
1004 CsrWifiNmeWpsConfigSetCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, status__)
1006 /*******************************************************************************
1009 CsrWifiNmeWpsReqSend
1012 Requests the NME to look for WPS enabled APs and attempt to perform WPS
1013 to determine the appropriate security credentials to connect to the AP.
1014 If the PIN == '00000000' then 'push button mode' is indicated, otherwise
1015 the PIN has to match that of the AP. 4 digit pin is passed by sending the
1016 pin digits in pin[0]..pin[3] and rest of the contents filled with '-'.
1019 queue - Message Source Task Queue (Cfm's will be sent to this Queue)
1020 interfaceTag - Interface Identifier; unique identifier of an interface
1022 ssid - Service Set identifier
1023 bssid - ID of Basic Service Set for which a WPS connection attempt is
1026 *******************************************************************************/
1027 #define CsrWifiNmeWpsReqCreate(msg__, dst__, src__, interfaceTag__, pin__, ssid__, bssid__) \
1028 msg__ = kmalloc(sizeof(CsrWifiNmeWpsReq), GFP_KERNEL); \
1029 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_WPS_REQ, dst__, src__); \
1030 msg__->interfaceTag = (interfaceTag__); \
1031 memcpy(msg__->pin, (pin__), sizeof(u8) * 8); \
1032 msg__->ssid = (ssid__); \
1033 msg__->bssid = (bssid__);
1035 #define CsrWifiNmeWpsReqSendTo(dst__, src__, interfaceTag__, pin__, ssid__, bssid__) \
1037 CsrWifiNmeWpsReq *msg__; \
1038 CsrWifiNmeWpsReqCreate(msg__, dst__, src__, interfaceTag__, pin__, ssid__, bssid__); \
1039 CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
1042 #define CsrWifiNmeWpsReqSend(src__, interfaceTag__, pin__, ssid__, bssid__) \
1043 CsrWifiNmeWpsReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, interfaceTag__, pin__, ssid__, bssid__)
1045 #endif /* CSR_WIFI_NME_LIB_H__ */