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__
17 #include "csr_sched.h"
18 #include "csr_macro.h"
19 #include "csr_msg_transport.h"
21 #include "csr_wifi_lib.h"
23 #include "csr_wifi_nme_prim.h"
24 #include "csr_wifi_nme_task.h"
31 #ifndef CSR_WIFI_NME_ENABLE
32 #error CSR_WIFI_NME_ENABLE MUST be defined inorder to use csr_wifi_nme_lib.h
35 /*----------------------------------------------------------------------------*
36 * CsrWifiNmeFreeUpstreamMessageContents
39 * Free the allocated memory in a CSR_WIFI_NME upstream message. Does not
40 * free the message itself, and can only be used for upstream messages.
43 * Deallocates the resources in a CSR_WIFI_NME upstream message
44 *----------------------------------------------------------------------------*/
45 void CsrWifiNmeFreeUpstreamMessageContents(u16 eventClass, void *message);
47 /*----------------------------------------------------------------------------*
48 * CsrWifiNmeFreeDownstreamMessageContents
51 * Free the allocated memory in a CSR_WIFI_NME downstream message. Does not
52 * free the message itself, and can only be used for downstream messages.
55 * Deallocates the resources in a CSR_WIFI_NME downstream message
56 *----------------------------------------------------------------------------*/
57 void CsrWifiNmeFreeDownstreamMessageContents(u16 eventClass, void *message);
59 /*----------------------------------------------------------------------------*
60 * Enum to string functions
61 *----------------------------------------------------------------------------*/
62 const char* CsrWifiNmeAuthModeToString(CsrWifiNmeAuthMode value);
63 const char* CsrWifiNmeBssTypeToString(CsrWifiNmeBssType value);
64 const char* CsrWifiNmeCcxOptionsMaskToString(CsrWifiNmeCcxOptionsMask value);
65 const char* CsrWifiNmeConfigActionToString(CsrWifiNmeConfigAction value);
66 const char* CsrWifiNmeConnectionStatusToString(CsrWifiNmeConnectionStatus value);
67 const char* CsrWifiNmeCredentialTypeToString(CsrWifiNmeCredentialType value);
68 const char* CsrWifiNmeEapMethodToString(CsrWifiNmeEapMethod value);
69 const char* CsrWifiNmeEncryptionToString(CsrWifiNmeEncryption value);
70 const char* CsrWifiNmeIndicationsToString(CsrWifiNmeIndications value);
71 const char* CsrWifiNmeSecErrorToString(CsrWifiNmeSecError value);
72 const char* CsrWifiNmeSimCardTypeToString(CsrWifiNmeSimCardType value);
73 const char* CsrWifiNmeUmtsAuthResultToString(CsrWifiNmeUmtsAuthResult value);
74 const char* CsrWifiNmeWmmQosInfoToString(CsrWifiNmeWmmQosInfo value);
77 /*----------------------------------------------------------------------------*
78 * CsrPrim Type toString function.
79 * Converts a message type to the String name of the Message
80 *----------------------------------------------------------------------------*/
81 const char* CsrWifiNmePrimTypeToString(CsrPrim msgType);
83 /*----------------------------------------------------------------------------*
84 * Lookup arrays for PrimType name Strings
85 *----------------------------------------------------------------------------*/
86 extern const char *CsrWifiNmeUpstreamPrimNames[CSR_WIFI_NME_PRIM_UPSTREAM_COUNT];
87 extern const char *CsrWifiNmeDownstreamPrimNames[CSR_WIFI_NME_PRIM_DOWNSTREAM_COUNT];
89 /*******************************************************************************
92 CsrWifiNmeConnectionStatusGetReqSend
95 Requests the current connection status of the NME.
98 queue - Message Source Task Queue (Cfm's will be sent to this Queue)
99 interfaceTag - Interface Identifier; unique identifier of an interface
101 *******************************************************************************/
102 #define CsrWifiNmeConnectionStatusGetReqCreate(msg__, dst__, src__, interfaceTag__) \
103 msg__ = kmalloc(sizeof(CsrWifiNmeConnectionStatusGetReq), GFP_KERNEL); \
104 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_CONNECTION_STATUS_GET_REQ, dst__, src__); \
105 msg__->interfaceTag = (interfaceTag__);
107 #define CsrWifiNmeConnectionStatusGetReqSendTo(dst__, src__, interfaceTag__) \
109 CsrWifiNmeConnectionStatusGetReq *msg__; \
110 CsrWifiNmeConnectionStatusGetReqCreate(msg__, dst__, src__, interfaceTag__); \
111 CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
114 #define CsrWifiNmeConnectionStatusGetReqSend(src__, interfaceTag__) \
115 CsrWifiNmeConnectionStatusGetReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, interfaceTag__)
117 /*******************************************************************************
120 CsrWifiNmeConnectionStatusGetCfmSend
123 Reports the connection status of the NME.
126 queue - Destination Task Queue
127 interfaceTag - Interface Identifier; unique identifier of an interface
128 status - Indicates the success or otherwise of the requested
130 connectionStatus - NME current connection status
132 *******************************************************************************/
133 #define CsrWifiNmeConnectionStatusGetCfmCreate(msg__, dst__, src__, interfaceTag__, status__, connectionStatus__) \
134 msg__ = kmalloc(sizeof(CsrWifiNmeConnectionStatusGetCfm), GFP_KERNEL); \
135 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_CONNECTION_STATUS_GET_CFM, dst__, src__); \
136 msg__->interfaceTag = (interfaceTag__); \
137 msg__->status = (status__); \
138 msg__->connectionStatus = (connectionStatus__);
140 #define CsrWifiNmeConnectionStatusGetCfmSendTo(dst__, src__, interfaceTag__, status__, connectionStatus__) \
142 CsrWifiNmeConnectionStatusGetCfm *msg__; \
143 CsrWifiNmeConnectionStatusGetCfmCreate(msg__, dst__, src__, interfaceTag__, status__, connectionStatus__); \
144 CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
147 #define CsrWifiNmeConnectionStatusGetCfmSend(dst__, interfaceTag__, status__, connectionStatus__) \
148 CsrWifiNmeConnectionStatusGetCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, interfaceTag__, status__, connectionStatus__)
150 /*******************************************************************************
153 CsrWifiNmeEventMaskSetReqSend
156 The wireless manager application may register with the NME to receive
157 notification of interesting events. Indications will be sent only if the
158 wireless manager explicitly registers to be notified of that event.
159 indMask is a bit mask of values defined in CsrWifiNmeIndicationsMask.
162 queue - Message Source Task Queue (Cfm's will be sent to this Queue)
163 indMask - Set mask with values from CsrWifiNmeIndications
165 *******************************************************************************/
166 #define CsrWifiNmeEventMaskSetReqCreate(msg__, dst__, src__, indMask__) \
167 msg__ = kmalloc(sizeof(CsrWifiNmeEventMaskSetReq), GFP_KERNEL); \
168 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_EVENT_MASK_SET_REQ, dst__, src__); \
169 msg__->indMask = (indMask__);
171 #define CsrWifiNmeEventMaskSetReqSendTo(dst__, src__, indMask__) \
173 CsrWifiNmeEventMaskSetReq *msg__; \
174 CsrWifiNmeEventMaskSetReqCreate(msg__, dst__, src__, indMask__); \
175 CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
178 #define CsrWifiNmeEventMaskSetReqSend(src__, indMask__) \
179 CsrWifiNmeEventMaskSetReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, indMask__)
181 /*******************************************************************************
184 CsrWifiNmeEventMaskSetCfmSend
187 The NME calls the primitive to report the result of the request
191 queue - Destination Task Queue
192 status - Reports the result of the request
194 *******************************************************************************/
195 #define CsrWifiNmeEventMaskSetCfmCreate(msg__, dst__, src__, status__) \
196 msg__ = kmalloc(sizeof(CsrWifiNmeEventMaskSetCfm), GFP_KERNEL); \
197 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_EVENT_MASK_SET_CFM, dst__, src__); \
198 msg__->status = (status__);
200 #define CsrWifiNmeEventMaskSetCfmSendTo(dst__, src__, status__) \
202 CsrWifiNmeEventMaskSetCfm *msg__; \
203 CsrWifiNmeEventMaskSetCfmCreate(msg__, dst__, src__, status__); \
204 CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
207 #define CsrWifiNmeEventMaskSetCfmSend(dst__, status__) \
208 CsrWifiNmeEventMaskSetCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, status__)
210 /*******************************************************************************
213 CsrWifiNmeProfileConnectReqSend
216 Requests the NME to attempt to connect to the specified profile.
217 Overrides any current connection attempt.
220 queue - Message Source Task Queue (Cfm's will be sent to this Queue)
221 interfaceTag - Interface Identifier; unique identifier of an interface
222 profileIdentity - Identity (BSSID, SSID) of profile to be connected to.
223 It must match an existing profile in the NME.
225 *******************************************************************************/
226 #define CsrWifiNmeProfileConnectReqCreate(msg__, dst__, src__, interfaceTag__, profileIdentity__) \
227 msg__ = kmalloc(sizeof(CsrWifiNmeProfileConnectReq), GFP_KERNEL); \
228 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_PROFILE_CONNECT_REQ, dst__, src__); \
229 msg__->interfaceTag = (interfaceTag__); \
230 msg__->profileIdentity = (profileIdentity__);
232 #define CsrWifiNmeProfileConnectReqSendTo(dst__, src__, interfaceTag__, profileIdentity__) \
234 CsrWifiNmeProfileConnectReq *msg__; \
235 CsrWifiNmeProfileConnectReqCreate(msg__, dst__, src__, interfaceTag__, profileIdentity__); \
236 CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
239 #define CsrWifiNmeProfileConnectReqSend(src__, interfaceTag__, profileIdentity__) \
240 CsrWifiNmeProfileConnectReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, interfaceTag__, profileIdentity__)
242 /*******************************************************************************
245 CsrWifiNmeProfileConnectCfmSend
248 Reports the status of the NME PROFILE CONNECT REQ. If unsuccessful the
249 connectAttempt parameters contain details of the APs that the NME
250 attempted to connect to before reporting the failure of the request.
253 queue - Destination Task Queue
254 interfaceTag - Interface Identifier; unique identifier of an
256 status - Indicates the success or otherwise of the requested
258 connectAttemptsCount - This parameter is relevant only if
259 status!=CSR_WIFI_NME_STATUS_SUCCESS.
260 Number of connection attempt elements provided with
262 connectAttempts - This parameter is relevant only if
263 status!=CSR_WIFI_NME_STATUS_SUCCESS.
264 Points to the list of connection attempt elements
265 provided with this primitive
266 Each element of the list provides information about
267 an AP on which the connection attempt was made and
268 the error that occurred during the attempt.
270 *******************************************************************************/
271 #define CsrWifiNmeProfileConnectCfmCreate(msg__, dst__, src__, interfaceTag__, status__, connectAttemptsCount__, connectAttempts__) \
272 msg__ = kmalloc(sizeof(CsrWifiNmeProfileConnectCfm), GFP_KERNEL); \
273 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_PROFILE_CONNECT_CFM, dst__, src__); \
274 msg__->interfaceTag = (interfaceTag__); \
275 msg__->status = (status__); \
276 msg__->connectAttemptsCount = (connectAttemptsCount__); \
277 msg__->connectAttempts = (connectAttempts__);
279 #define CsrWifiNmeProfileConnectCfmSendTo(dst__, src__, interfaceTag__, status__, connectAttemptsCount__, connectAttempts__) \
281 CsrWifiNmeProfileConnectCfm *msg__; \
282 CsrWifiNmeProfileConnectCfmCreate(msg__, dst__, src__, interfaceTag__, status__, connectAttemptsCount__, connectAttempts__); \
283 CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
286 #define CsrWifiNmeProfileConnectCfmSend(dst__, interfaceTag__, status__, connectAttemptsCount__, connectAttempts__) \
287 CsrWifiNmeProfileConnectCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, interfaceTag__, status__, connectAttemptsCount__, connectAttempts__)
289 /*******************************************************************************
292 CsrWifiNmeProfileDeleteAllReqSend
295 Deletes all profiles present in the NME, but does NOT modify the
296 preferred profile list.
299 queue - Message Source Task Queue (Cfm's will be sent to this Queue)
301 *******************************************************************************/
302 #define CsrWifiNmeProfileDeleteAllReqCreate(msg__, dst__, src__) \
303 msg__ = kmalloc(sizeof(CsrWifiNmeProfileDeleteAllReq), GFP_KERNEL); \
304 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_PROFILE_DELETE_ALL_REQ, dst__, src__);
306 #define CsrWifiNmeProfileDeleteAllReqSendTo(dst__, src__) \
308 CsrWifiNmeProfileDeleteAllReq *msg__; \
309 CsrWifiNmeProfileDeleteAllReqCreate(msg__, dst__, src__); \
310 CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
313 #define CsrWifiNmeProfileDeleteAllReqSend(src__) \
314 CsrWifiNmeProfileDeleteAllReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__)
316 /*******************************************************************************
319 CsrWifiNmeProfileDeleteAllCfmSend
322 Reports the status of the CSR_WIFI_NME_PROFILE_DELETE_ALL_REQ.
323 Returns always CSR_WIFI_NME_STATUS_SUCCESS.
326 queue - Destination Task Queue
327 status - Indicates the success or otherwise of the requested operation, but
328 in this case it always set to success.
330 *******************************************************************************/
331 #define CsrWifiNmeProfileDeleteAllCfmCreate(msg__, dst__, src__, status__) \
332 msg__ = kmalloc(sizeof(CsrWifiNmeProfileDeleteAllCfm), GFP_KERNEL); \
333 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_PROFILE_DELETE_ALL_CFM, dst__, src__); \
334 msg__->status = (status__);
336 #define CsrWifiNmeProfileDeleteAllCfmSendTo(dst__, src__, status__) \
338 CsrWifiNmeProfileDeleteAllCfm *msg__; \
339 CsrWifiNmeProfileDeleteAllCfmCreate(msg__, dst__, src__, status__); \
340 CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
343 #define CsrWifiNmeProfileDeleteAllCfmSend(dst__, status__) \
344 CsrWifiNmeProfileDeleteAllCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, status__)
346 /*******************************************************************************
349 CsrWifiNmeProfileDeleteReqSend
352 Will delete the profile with a matching identity, but does NOT modify the
353 preferred profile list.
356 queue - Message Source Task Queue (Cfm's will be sent to this Queue)
357 profileIdentity - Identity (BSSID, SSID) of profile to be deleted.
359 *******************************************************************************/
360 #define CsrWifiNmeProfileDeleteReqCreate(msg__, dst__, src__, profileIdentity__) \
361 msg__ = kmalloc(sizeof(CsrWifiNmeProfileDeleteReq), GFP_KERNEL); \
362 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_PROFILE_DELETE_REQ, dst__, src__); \
363 msg__->profileIdentity = (profileIdentity__);
365 #define CsrWifiNmeProfileDeleteReqSendTo(dst__, src__, profileIdentity__) \
367 CsrWifiNmeProfileDeleteReq *msg__; \
368 CsrWifiNmeProfileDeleteReqCreate(msg__, dst__, src__, profileIdentity__); \
369 CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
372 #define CsrWifiNmeProfileDeleteReqSend(src__, profileIdentity__) \
373 CsrWifiNmeProfileDeleteReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, profileIdentity__)
375 /*******************************************************************************
378 CsrWifiNmeProfileDeleteCfmSend
381 Reports the status of the CSR_WIFI_NME_PROFILE_DELETE_REQ.
382 Returns CSR_WIFI_NME_STATUS_NOT_FOUND if there is no matching profile.
385 queue - Destination Task Queue
386 status - Indicates the success or otherwise of the requested operation.
388 *******************************************************************************/
389 #define CsrWifiNmeProfileDeleteCfmCreate(msg__, dst__, src__, status__) \
390 msg__ = kmalloc(sizeof(CsrWifiNmeProfileDeleteCfm), GFP_KERNEL); \
391 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_PROFILE_DELETE_CFM, dst__, src__); \
392 msg__->status = (status__);
394 #define CsrWifiNmeProfileDeleteCfmSendTo(dst__, src__, status__) \
396 CsrWifiNmeProfileDeleteCfm *msg__; \
397 CsrWifiNmeProfileDeleteCfmCreate(msg__, dst__, src__, status__); \
398 CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
401 #define CsrWifiNmeProfileDeleteCfmSend(dst__, status__) \
402 CsrWifiNmeProfileDeleteCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, status__)
404 /*******************************************************************************
407 CsrWifiNmeProfileDisconnectIndSend
410 Indication generated from the NME (if an application subscribes to
411 receive it) that informs that application that the current profile
412 connection has disconnected. The indication will contain information
413 about APs that it attempted to maintain the connection via i.e. in the
414 case of failed roaming.
417 queue - Destination Task Queue
418 interfaceTag - Interface Identifier; unique identifier of an
420 connectAttemptsCount - Number of connection attempt elements provided with
422 connectAttempts - Points to the list of connection attempt elements
423 provided with this primitive
424 Each element of the list provides information about
425 an AP on which the connection attempt was made and
426 the error occurred during the attempt.
428 *******************************************************************************/
429 #define CsrWifiNmeProfileDisconnectIndCreate(msg__, dst__, src__, interfaceTag__, connectAttemptsCount__, connectAttempts__) \
430 msg__ = kmalloc(sizeof(CsrWifiNmeProfileDisconnectInd), GFP_KERNEL); \
431 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_PROFILE_DISCONNECT_IND, dst__, src__); \
432 msg__->interfaceTag = (interfaceTag__); \
433 msg__->connectAttemptsCount = (connectAttemptsCount__); \
434 msg__->connectAttempts = (connectAttempts__);
436 #define CsrWifiNmeProfileDisconnectIndSendTo(dst__, src__, interfaceTag__, connectAttemptsCount__, connectAttempts__) \
438 CsrWifiNmeProfileDisconnectInd *msg__; \
439 CsrWifiNmeProfileDisconnectIndCreate(msg__, dst__, src__, interfaceTag__, connectAttemptsCount__, connectAttempts__); \
440 CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
443 #define CsrWifiNmeProfileDisconnectIndSend(dst__, interfaceTag__, connectAttemptsCount__, connectAttempts__) \
444 CsrWifiNmeProfileDisconnectIndSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, interfaceTag__, connectAttemptsCount__, connectAttempts__)
446 /*******************************************************************************
449 CsrWifiNmeProfileOrderSetReqSend
452 Defines the preferred order that profiles present in the NME should be
453 used during the NME auto-connect behaviour.
454 If profileIdentitysCount == 0, it removes any existing preferred profile
455 list already present in the NME, effectively disabling the auto-connect
457 NOTE: Profile identities that do not match any profile stored in the NME
458 are ignored during the auto-connect procedure.
459 NOTE: during auto-connect the NME will only attempt to join an existing
460 adhoc network and it will never attempt to host an adhoc network; for
461 hosting and adhoc network, use CSR_WIFI_NME_PROFILE_CONNECT_REQ
464 queue - Message Source Task Queue (Cfm's will be sent to this Queue)
465 interfaceTag - Interface Identifier; unique identifier of an
467 profileIdentitysCount - The number of profiles identities in the list.
468 profileIdentitys - Points to the list of profile identities.
470 *******************************************************************************/
471 #define CsrWifiNmeProfileOrderSetReqCreate(msg__, dst__, src__, interfaceTag__, profileIdentitysCount__, profileIdentitys__) \
472 msg__ = kmalloc(sizeof(CsrWifiNmeProfileOrderSetReq), GFP_KERNEL); \
473 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_PROFILE_ORDER_SET_REQ, dst__, src__); \
474 msg__->interfaceTag = (interfaceTag__); \
475 msg__->profileIdentitysCount = (profileIdentitysCount__); \
476 msg__->profileIdentitys = (profileIdentitys__);
478 #define CsrWifiNmeProfileOrderSetReqSendTo(dst__, src__, interfaceTag__, profileIdentitysCount__, profileIdentitys__) \
480 CsrWifiNmeProfileOrderSetReq *msg__; \
481 CsrWifiNmeProfileOrderSetReqCreate(msg__, dst__, src__, interfaceTag__, profileIdentitysCount__, profileIdentitys__); \
482 CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
485 #define CsrWifiNmeProfileOrderSetReqSend(src__, interfaceTag__, profileIdentitysCount__, profileIdentitys__) \
486 CsrWifiNmeProfileOrderSetReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, interfaceTag__, profileIdentitysCount__, profileIdentitys__)
488 /*******************************************************************************
491 CsrWifiNmeProfileOrderSetCfmSend
494 Confirmation to UNIFI_NME_PROFILE_ORDER_SET.request.
497 queue - Destination Task Queue
498 interfaceTag - Interface Identifier; unique identifier of an interface
499 status - Indicates the success or otherwise of the requested
502 *******************************************************************************/
503 #define CsrWifiNmeProfileOrderSetCfmCreate(msg__, dst__, src__, interfaceTag__, status__) \
504 msg__ = kmalloc(sizeof(CsrWifiNmeProfileOrderSetCfm), GFP_KERNEL); \
505 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_PROFILE_ORDER_SET_CFM, dst__, src__); \
506 msg__->interfaceTag = (interfaceTag__); \
507 msg__->status = (status__);
509 #define CsrWifiNmeProfileOrderSetCfmSendTo(dst__, src__, interfaceTag__, status__) \
511 CsrWifiNmeProfileOrderSetCfm *msg__; \
512 CsrWifiNmeProfileOrderSetCfmCreate(msg__, dst__, src__, interfaceTag__, status__); \
513 CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
516 #define CsrWifiNmeProfileOrderSetCfmSend(dst__, interfaceTag__, status__) \
517 CsrWifiNmeProfileOrderSetCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, interfaceTag__, status__)
519 /*******************************************************************************
522 CsrWifiNmeProfileSetReqSend
525 Creates or updates an existing profile in the NME that matches the unique
526 identity of the profile. Each profile is identified by the combination of
527 BSSID and SSID. The profile contains all the required credentials for
528 attempting to connect to the network. Creating or updating a profile via
529 the NME PROFILE SET REQ does NOT add the profile to the preferred profile
530 list within the NME used for the NME auto-connect behaviour.
533 queue - Message Source Task Queue (Cfm's will be sent to this Queue)
534 profile - Specifies the identity and credentials of the network.
536 *******************************************************************************/
537 #define CsrWifiNmeProfileSetReqCreate(msg__, dst__, src__, profile__) \
538 msg__ = kmalloc(sizeof(CsrWifiNmeProfileSetReq), GFP_KERNEL); \
539 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_PROFILE_SET_REQ, dst__, src__); \
540 msg__->profile = (profile__);
542 #define CsrWifiNmeProfileSetReqSendTo(dst__, src__, profile__) \
544 CsrWifiNmeProfileSetReq *msg__; \
545 CsrWifiNmeProfileSetReqCreate(msg__, dst__, src__, profile__); \
546 CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
549 #define CsrWifiNmeProfileSetReqSend(src__, profile__) \
550 CsrWifiNmeProfileSetReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, profile__)
552 /*******************************************************************************
555 CsrWifiNmeProfileSetCfmSend
558 Reports the status of the NME PROFILE SET REQ; the request will only fail
559 if the details specified in the profile contains an invalid combination
560 of parameters for example specifying the profile as cloaked but not
561 specifying the SSID. The NME doesn't limit the number of profiles that
562 may be created. The NME assumes that the entity configuring it is aware
563 of the appropriate limits.
566 queue - Destination Task Queue
567 status - Indicates the success or otherwise of the requested operation.
569 *******************************************************************************/
570 #define CsrWifiNmeProfileSetCfmCreate(msg__, dst__, src__, status__) \
571 msg__ = kmalloc(sizeof(CsrWifiNmeProfileSetCfm), GFP_KERNEL); \
572 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_PROFILE_SET_CFM, dst__, src__); \
573 msg__->status = (status__);
575 #define CsrWifiNmeProfileSetCfmSendTo(dst__, src__, status__) \
577 CsrWifiNmeProfileSetCfm *msg__; \
578 CsrWifiNmeProfileSetCfmCreate(msg__, dst__, src__, status__); \
579 CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
582 #define CsrWifiNmeProfileSetCfmSend(dst__, status__) \
583 CsrWifiNmeProfileSetCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, status__)
585 /*******************************************************************************
588 CsrWifiNmeProfileUpdateIndSend
591 Indication generated from the NME (if an application subscribes to
592 receive it) that informs that application that the contained profile has
594 For example, either the credentials EAP-FAST PAC file or the session data
595 within the profile has changed.
596 It is up to the application whether it stores this updated profile or
600 queue - Destination Task Queue
601 interfaceTag - Interface Identifier; unique identifier of an interface
602 profile - The identity and credentials of the network.
604 *******************************************************************************/
605 #define CsrWifiNmeProfileUpdateIndCreate(msg__, dst__, src__, interfaceTag__, profile__) \
606 msg__ = kmalloc(sizeof(CsrWifiNmeProfileUpdateInd), GFP_KERNEL); \
607 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_PROFILE_UPDATE_IND, dst__, src__); \
608 msg__->interfaceTag = (interfaceTag__); \
609 msg__->profile = (profile__);
611 #define CsrWifiNmeProfileUpdateIndSendTo(dst__, src__, interfaceTag__, profile__) \
613 CsrWifiNmeProfileUpdateInd *msg__; \
614 CsrWifiNmeProfileUpdateIndCreate(msg__, dst__, src__, interfaceTag__, profile__); \
615 CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
618 #define CsrWifiNmeProfileUpdateIndSend(dst__, interfaceTag__, profile__) \
619 CsrWifiNmeProfileUpdateIndSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, interfaceTag__, profile__)
621 /*******************************************************************************
624 CsrWifiNmeSimGsmAuthIndSend
627 Indication generated from the NME (if an application subscribes to
628 receive it) that requests the UICC Manager to perform a GSM
629 authentication on behalf of the NME. This indication is generated when
630 the NME is attempting to connect to a profile configured for EAP-SIM. An
631 application MUST register to receive this indication for the NME to
632 support the EAP-SIM credential types. Otherwise the NME has no route to
633 obtain the information from the UICC. EAP-SIM authentication requires 2
634 or 3 GSM authentication rounds and therefore 2 or 3 RANDS (GSM Random
635 Challenges) are included.
638 queue - Destination Task Queue
639 randsLength - GSM RAND is 16 bytes long hence valid values are 32 (2 RANDS)
641 rands - 2 or 3 RANDs values.
643 *******************************************************************************/
644 #define CsrWifiNmeSimGsmAuthIndCreate(msg__, dst__, src__, randsLength__, rands__) \
645 msg__ = kmalloc(sizeof(CsrWifiNmeSimGsmAuthInd), GFP_KERNEL); \
646 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_SIM_GSM_AUTH_IND, dst__, src__); \
647 msg__->randsLength = (randsLength__); \
648 msg__->rands = (rands__);
650 #define CsrWifiNmeSimGsmAuthIndSendTo(dst__, src__, randsLength__, rands__) \
652 CsrWifiNmeSimGsmAuthInd *msg__; \
653 CsrWifiNmeSimGsmAuthIndCreate(msg__, dst__, src__, randsLength__, rands__); \
654 CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
657 #define CsrWifiNmeSimGsmAuthIndSend(dst__, randsLength__, rands__) \
658 CsrWifiNmeSimGsmAuthIndSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, randsLength__, rands__)
660 /*******************************************************************************
663 CsrWifiNmeSimGsmAuthResSend
666 Response from the application that received the NME SIM GSM AUTH IND. For
667 each GSM authentication round a GSM Ciphering key (Kc) and a signed
668 response (SRES) are produced. Since 2 or 3 GSM authentication rounds are
669 used the 2 or 3 Kc's obtained respectively are combined into one buffer
670 and similarly the 2 or 3 SRES's obtained are combined into another
671 buffer. The order of Kc values (SRES values respectively) in their buffer
672 is the same as that of their corresponding RAND values in the incoming
676 status - Indicates the outcome of the requested operation:
677 STATUS_SUCCESS or STATUS_ERROR
678 kcsLength - Length in Bytes of Kc buffer. Legal values are: 16 or 24.
679 kcs - Kc buffer holding 2 or 3 Kc values.
680 sresLength - Length in Bytes of SRES buffer. Legal values are: 8 or 12.
681 sres - SRES buffer holding 2 or 3 SRES values.
683 *******************************************************************************/
684 #define CsrWifiNmeSimGsmAuthResCreate(msg__, dst__, src__, status__, kcsLength__, kcs__, sresLength__, sres__) \
685 msg__ = kmalloc(sizeof(CsrWifiNmeSimGsmAuthRes), GFP_KERNEL); \
686 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_SIM_GSM_AUTH_RES, dst__, src__); \
687 msg__->status = (status__); \
688 msg__->kcsLength = (kcsLength__); \
689 msg__->kcs = (kcs__); \
690 msg__->sresLength = (sresLength__); \
691 msg__->sres = (sres__);
693 #define CsrWifiNmeSimGsmAuthResSendTo(dst__, src__, status__, kcsLength__, kcs__, sresLength__, sres__) \
695 CsrWifiNmeSimGsmAuthRes *msg__; \
696 CsrWifiNmeSimGsmAuthResCreate(msg__, dst__, src__, status__, kcsLength__, kcs__, sresLength__, sres__); \
697 CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
700 #define CsrWifiNmeSimGsmAuthResSend(src__, status__, kcsLength__, kcs__, sresLength__, sres__) \
701 CsrWifiNmeSimGsmAuthResSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, status__, kcsLength__, kcs__, sresLength__, sres__)
703 /*******************************************************************************
706 CsrWifiNmeSimImsiGetIndSend
709 Indication generated from the NME (if an application subscribes to
710 receive it) that requests the IMSI and UICC type from the UICC Manager.
711 This indication is generated when the NME is attempting to connect to a
712 profile configured for EAP-SIM/AKA. An application MUST register to
713 receive this indication for the NME to support the EAP-SIM/AKA credential
714 types. Otherwise the NME has no route to obtain the information from the
718 queue - Destination Task Queue
720 *******************************************************************************/
721 #define CsrWifiNmeSimImsiGetIndCreate(msg__, dst__, src__) \
722 msg__ = kmalloc(sizeof(CsrWifiNmeSimImsiGetInd), GFP_KERNEL); \
723 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_SIM_IMSI_GET_IND, dst__, src__);
725 #define CsrWifiNmeSimImsiGetIndSendTo(dst__, src__) \
727 CsrWifiNmeSimImsiGetInd *msg__; \
728 CsrWifiNmeSimImsiGetIndCreate(msg__, dst__, src__); \
729 CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
732 #define CsrWifiNmeSimImsiGetIndSend(dst__) \
733 CsrWifiNmeSimImsiGetIndSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE)
735 /*******************************************************************************
738 CsrWifiNmeSimImsiGetResSend
741 Response from the application that received the NME SIM IMSI GET IND.
744 status - Indicates the outcome of the requested operation: STATUS_SUCCESS
746 imsi - The value of the IMSI obtained from the UICC.
747 cardType - The UICC type (GSM only (SIM), UMTS only (USIM), Both).
749 *******************************************************************************/
750 #define CsrWifiNmeSimImsiGetResCreate(msg__, dst__, src__, status__, imsi__, cardType__) \
751 msg__ = kmalloc(sizeof(CsrWifiNmeSimImsiGetRes), GFP_KERNEL); \
752 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_SIM_IMSI_GET_RES, dst__, src__); \
753 msg__->status = (status__); \
754 msg__->imsi = (imsi__); \
755 msg__->cardType = (cardType__);
757 #define CsrWifiNmeSimImsiGetResSendTo(dst__, src__, status__, imsi__, cardType__) \
759 CsrWifiNmeSimImsiGetRes *msg__; \
760 CsrWifiNmeSimImsiGetResCreate(msg__, dst__, src__, status__, imsi__, cardType__); \
761 CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
764 #define CsrWifiNmeSimImsiGetResSend(src__, status__, imsi__, cardType__) \
765 CsrWifiNmeSimImsiGetResSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, status__, imsi__, cardType__)
767 /*******************************************************************************
770 CsrWifiNmeSimUmtsAuthIndSend
773 Indication generated from the NME (if an application subscribes to
774 receive it) that requests the UICC Manager to perform a UMTS
775 authentication on behalf of the NME. This indication is generated when
776 the NME is attempting to connect to a profile configured for EAP-AKA. An
777 application MUST register to receive this indication for the NME to
778 support the EAP-AKA credential types. Otherwise the NME has no route to
779 obtain the information from the USIM. EAP-AKA requires one UMTS
780 authentication round and therefore only one RAND and one AUTN values are
784 queue - Destination Task Queue
785 rand - UMTS RAND value.
786 autn - UMTS AUTN value.
788 *******************************************************************************/
789 #define CsrWifiNmeSimUmtsAuthIndCreate(msg__, dst__, src__, rand__, autn__) \
790 msg__ = kmalloc(sizeof(CsrWifiNmeSimUmtsAuthInd), GFP_KERNEL); \
791 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_SIM_UMTS_AUTH_IND, dst__, src__); \
792 memcpy(msg__->rand, (rand__), sizeof(u8) * 16); \
793 memcpy(msg__->autn, (autn__), sizeof(u8) * 16);
795 #define CsrWifiNmeSimUmtsAuthIndSendTo(dst__, src__, rand__, autn__) \
797 CsrWifiNmeSimUmtsAuthInd *msg__; \
798 CsrWifiNmeSimUmtsAuthIndCreate(msg__, dst__, src__, rand__, autn__); \
799 CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
802 #define CsrWifiNmeSimUmtsAuthIndSend(dst__, rand__, autn__) \
803 CsrWifiNmeSimUmtsAuthIndSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, rand__, autn__)
805 /*******************************************************************************
808 CsrWifiNmeSimUmtsAuthResSend
811 Response from the application that received the NME SIM UMTS AUTH IND.
812 The values of umtsCipherKey, umtsIntegrityKey, resParameterLength and
813 resParameter are only meanigful when result = UMTS_AUTH_RESULT_SUCCESS.
814 The value of auts is only meaningful when
815 result=UMTS_AUTH_RESULT_SYNC_FAIL.
818 status - Indicates the outcome of the requested operation:
819 STATUS_SUCCESS or STATUS_ERROR.
820 result - The result of UMTS authentication as performed by the
821 UICC which could be: Success, Authentication Reject or
822 Synchronisation Failure. For all these 3 outcomes the
823 value of status is success.
824 umtsCipherKey - The UMTS Cipher Key as calculated and returned by the
826 umtsIntegrityKey - The UMTS Integrity Key as calculated and returned by
828 resParameterLength - The length (in bytes) of the RES parameter (min=4; max
830 resParameter - The RES parameter as calculated and returned by the
832 auts - The AUTS parameter as calculated and returned by the
835 *******************************************************************************/
836 #define CsrWifiNmeSimUmtsAuthResCreate(msg__, dst__, src__, status__, result__, umtsCipherKey__, umtsIntegrityKey__, resParameterLength__, resParameter__, auts__) \
837 msg__ = kmalloc(sizeof(CsrWifiNmeSimUmtsAuthRes), GFP_KERNEL); \
838 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_SIM_UMTS_AUTH_RES, dst__, src__); \
839 msg__->status = (status__); \
840 msg__->result = (result__); \
841 memcpy(msg__->umtsCipherKey, (umtsCipherKey__), sizeof(u8) * 16); \
842 memcpy(msg__->umtsIntegrityKey, (umtsIntegrityKey__), sizeof(u8) * 16); \
843 msg__->resParameterLength = (resParameterLength__); \
844 msg__->resParameter = (resParameter__); \
845 memcpy(msg__->auts, (auts__), sizeof(u8) * 14);
847 #define CsrWifiNmeSimUmtsAuthResSendTo(dst__, src__, status__, result__, umtsCipherKey__, umtsIntegrityKey__, resParameterLength__, resParameter__, auts__) \
849 CsrWifiNmeSimUmtsAuthRes *msg__; \
850 CsrWifiNmeSimUmtsAuthResCreate(msg__, dst__, src__, status__, result__, umtsCipherKey__, umtsIntegrityKey__, resParameterLength__, resParameter__, auts__); \
851 CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
854 #define CsrWifiNmeSimUmtsAuthResSend(src__, status__, result__, umtsCipherKey__, umtsIntegrityKey__, resParameterLength__, resParameter__, auts__) \
855 CsrWifiNmeSimUmtsAuthResSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, status__, result__, umtsCipherKey__, umtsIntegrityKey__, resParameterLength__, resParameter__, auts__)
857 /*******************************************************************************
860 CsrWifiNmeWpsCancelReqSend
863 Requests the NME to cancel any WPS procedure that it is currently
864 performing. This includes WPS registrar activities started because of
865 CSR_WIFI_NME_AP_REGISTER.request
868 queue - Message Source Task Queue (Cfm's will be sent to this Queue)
869 interfaceTag - Interface Identifier; unique identifier of an interface
871 *******************************************************************************/
872 #define CsrWifiNmeWpsCancelReqCreate(msg__, dst__, src__, interfaceTag__) \
873 msg__ = kmalloc(sizeof(CsrWifiNmeWpsCancelReq), GFP_KERNEL); \
874 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_WPS_CANCEL_REQ, dst__, src__); \
875 msg__->interfaceTag = (interfaceTag__);
877 #define CsrWifiNmeWpsCancelReqSendTo(dst__, src__, interfaceTag__) \
879 CsrWifiNmeWpsCancelReq *msg__; \
880 CsrWifiNmeWpsCancelReqCreate(msg__, dst__, src__, interfaceTag__); \
881 CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
884 #define CsrWifiNmeWpsCancelReqSend(src__, interfaceTag__) \
885 CsrWifiNmeWpsCancelReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, interfaceTag__)
887 /*******************************************************************************
890 CsrWifiNmeWpsCancelCfmSend
893 Reports the status of the NME WPS REQ, the request is always SUCCESSFUL.
896 queue - Destination Task Queue
897 interfaceTag - Interface Identifier; unique identifier of an interface
898 status - Only returns CSR_WIFI_NME_STATUS_SUCCESS
900 *******************************************************************************/
901 #define CsrWifiNmeWpsCancelCfmCreate(msg__, dst__, src__, interfaceTag__, status__) \
902 msg__ = kmalloc(sizeof(CsrWifiNmeWpsCancelCfm), GFP_KERNEL); \
903 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_WPS_CANCEL_CFM, dst__, src__); \
904 msg__->interfaceTag = (interfaceTag__); \
905 msg__->status = (status__);
907 #define CsrWifiNmeWpsCancelCfmSendTo(dst__, src__, interfaceTag__, status__) \
909 CsrWifiNmeWpsCancelCfm *msg__; \
910 CsrWifiNmeWpsCancelCfmCreate(msg__, dst__, src__, interfaceTag__, status__); \
911 CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
914 #define CsrWifiNmeWpsCancelCfmSend(dst__, interfaceTag__, status__) \
915 CsrWifiNmeWpsCancelCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, interfaceTag__, status__)
917 /*******************************************************************************
923 Reports the status of the NME WPS REQ.
924 If CSR_WIFI_NME_STATUS_SUCCESS, the profile parameter contains the
925 identity and credentials of the AP.
928 queue - Destination Task Queue
929 interfaceTag - Interface Identifier; unique identifier of an interface
930 status - Indicates the success or otherwise of the requested
932 profile - This parameter is relevant only if
933 status==CSR_WIFI_NME_STATUS_SUCCESS.
934 The identity and credentials of the network.
936 *******************************************************************************/
937 #define CsrWifiNmeWpsCfmCreate(msg__, dst__, src__, interfaceTag__, status__, profile__) \
938 msg__ = kmalloc(sizeof(CsrWifiNmeWpsCfm), GFP_KERNEL); \
939 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_WPS_CFM, dst__, src__); \
940 msg__->interfaceTag = (interfaceTag__); \
941 msg__->status = (status__); \
942 msg__->profile = (profile__);
944 #define CsrWifiNmeWpsCfmSendTo(dst__, src__, interfaceTag__, status__, profile__) \
946 CsrWifiNmeWpsCfm *msg__; \
947 CsrWifiNmeWpsCfmCreate(msg__, dst__, src__, interfaceTag__, status__, profile__); \
948 CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
951 #define CsrWifiNmeWpsCfmSend(dst__, interfaceTag__, status__, profile__) \
952 CsrWifiNmeWpsCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, interfaceTag__, status__, profile__)
954 /*******************************************************************************
957 CsrWifiNmeWpsConfigSetReqSend
960 This primitive passes the WPS information for the device to NME. This may
961 be accepted only if no interface is active.
964 queue - Message Source Task Queue (Cfm's will be sent to this Queue)
965 wpsConfig - WPS config.
967 *******************************************************************************/
968 #define CsrWifiNmeWpsConfigSetReqCreate(msg__, dst__, src__, wpsConfig__) \
969 msg__ = kmalloc(sizeof(CsrWifiNmeWpsConfigSetReq), GFP_KERNEL); \
970 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_WPS_CONFIG_SET_REQ, dst__, src__); \
971 msg__->wpsConfig = (wpsConfig__);
973 #define CsrWifiNmeWpsConfigSetReqSendTo(dst__, src__, wpsConfig__) \
975 CsrWifiNmeWpsConfigSetReq *msg__; \
976 CsrWifiNmeWpsConfigSetReqCreate(msg__, dst__, src__, wpsConfig__); \
977 CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
980 #define CsrWifiNmeWpsConfigSetReqSend(src__, wpsConfig__) \
981 CsrWifiNmeWpsConfigSetReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, wpsConfig__)
983 /*******************************************************************************
986 CsrWifiNmeWpsConfigSetCfmSend
992 queue - Destination Task Queue
993 status - Status of the request.
995 *******************************************************************************/
996 #define CsrWifiNmeWpsConfigSetCfmCreate(msg__, dst__, src__, status__) \
997 msg__ = kmalloc(sizeof(CsrWifiNmeWpsConfigSetCfm), GFP_KERNEL); \
998 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_WPS_CONFIG_SET_CFM, dst__, src__); \
999 msg__->status = (status__);
1001 #define CsrWifiNmeWpsConfigSetCfmSendTo(dst__, src__, status__) \
1003 CsrWifiNmeWpsConfigSetCfm *msg__; \
1004 CsrWifiNmeWpsConfigSetCfmCreate(msg__, dst__, src__, status__); \
1005 CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
1008 #define CsrWifiNmeWpsConfigSetCfmSend(dst__, status__) \
1009 CsrWifiNmeWpsConfigSetCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, status__)
1011 /*******************************************************************************
1014 CsrWifiNmeWpsReqSend
1017 Requests the NME to look for WPS enabled APs and attempt to perform WPS
1018 to determine the appropriate security credentials to connect to the AP.
1019 If the PIN == '00000000' then 'push button mode' is indicated, otherwise
1020 the PIN has to match that of the AP. 4 digit pin is passed by sending the
1021 pin digits in pin[0]..pin[3] and rest of the contents filled with '-'.
1024 queue - Message Source Task Queue (Cfm's will be sent to this Queue)
1025 interfaceTag - Interface Identifier; unique identifier of an interface
1027 ssid - Service Set identifier
1028 bssid - ID of Basic Service Set for which a WPS connection attempt is
1031 *******************************************************************************/
1032 #define CsrWifiNmeWpsReqCreate(msg__, dst__, src__, interfaceTag__, pin__, ssid__, bssid__) \
1033 msg__ = kmalloc(sizeof(CsrWifiNmeWpsReq), GFP_KERNEL); \
1034 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_WPS_REQ, dst__, src__); \
1035 msg__->interfaceTag = (interfaceTag__); \
1036 memcpy(msg__->pin, (pin__), sizeof(u8) * 8); \
1037 msg__->ssid = (ssid__); \
1038 msg__->bssid = (bssid__);
1040 #define CsrWifiNmeWpsReqSendTo(dst__, src__, interfaceTag__, pin__, ssid__, bssid__) \
1042 CsrWifiNmeWpsReq *msg__; \
1043 CsrWifiNmeWpsReqCreate(msg__, dst__, src__, interfaceTag__, pin__, ssid__, bssid__); \
1044 CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
1047 #define CsrWifiNmeWpsReqSend(src__, interfaceTag__, pin__, ssid__, bssid__) \
1048 CsrWifiNmeWpsReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, interfaceTag__, pin__, ssid__, bssid__)
1055 #endif /* CSR_WIFI_NME_LIB_H__ */