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 /*******************************************************************************
33 CsrWifiNmeConnectionStatusGetReqSend
36 Requests the current connection status of the NME.
39 queue - Message Source Task Queue (Cfm's will be sent to this Queue)
40 interfaceTag - Interface Identifier; unique identifier of an interface
42 *******************************************************************************/
43 #define CsrWifiNmeConnectionStatusGetReqCreate(msg__, dst__, src__, interfaceTag__) \
44 msg__ = kmalloc(sizeof(CsrWifiNmeConnectionStatusGetReq), GFP_KERNEL); \
45 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_CONNECTION_STATUS_GET_REQ, dst__, src__); \
46 msg__->interfaceTag = (interfaceTag__);
48 #define CsrWifiNmeConnectionStatusGetReqSendTo(dst__, src__, interfaceTag__) \
50 CsrWifiNmeConnectionStatusGetReq *msg__; \
51 CsrWifiNmeConnectionStatusGetReqCreate(msg__, dst__, src__, interfaceTag__); \
52 CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
55 #define CsrWifiNmeConnectionStatusGetReqSend(src__, interfaceTag__) \
56 CsrWifiNmeConnectionStatusGetReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, interfaceTag__)
58 /*******************************************************************************
61 CsrWifiNmeConnectionStatusGetCfmSend
64 Reports the connection status of the NME.
67 queue - Destination Task Queue
68 interfaceTag - Interface Identifier; unique identifier of an interface
69 status - Indicates the success or otherwise of the requested
71 connectionStatus - NME current connection status
73 *******************************************************************************/
74 #define CsrWifiNmeConnectionStatusGetCfmCreate(msg__, dst__, src__, interfaceTag__, status__, connectionStatus__) \
75 msg__ = kmalloc(sizeof(CsrWifiNmeConnectionStatusGetCfm), GFP_KERNEL); \
76 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_CONNECTION_STATUS_GET_CFM, dst__, src__); \
77 msg__->interfaceTag = (interfaceTag__); \
78 msg__->status = (status__); \
79 msg__->connectionStatus = (connectionStatus__);
81 #define CsrWifiNmeConnectionStatusGetCfmSendTo(dst__, src__, interfaceTag__, status__, connectionStatus__) \
83 CsrWifiNmeConnectionStatusGetCfm *msg__; \
84 CsrWifiNmeConnectionStatusGetCfmCreate(msg__, dst__, src__, interfaceTag__, status__, connectionStatus__); \
85 CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
88 #define CsrWifiNmeConnectionStatusGetCfmSend(dst__, interfaceTag__, status__, connectionStatus__) \
89 CsrWifiNmeConnectionStatusGetCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, interfaceTag__, status__, connectionStatus__)
91 /*******************************************************************************
94 CsrWifiNmeEventMaskSetReqSend
97 The wireless manager application may register with the NME to receive
98 notification of interesting events. Indications will be sent only if the
99 wireless manager explicitly registers to be notified of that event.
100 indMask is a bit mask of values defined in CsrWifiNmeIndicationsMask.
103 queue - Message Source Task Queue (Cfm's will be sent to this Queue)
104 indMask - Set mask with values from CsrWifiNmeIndications
106 *******************************************************************************/
107 #define CsrWifiNmeEventMaskSetReqCreate(msg__, dst__, src__, indMask__) \
108 msg__ = kmalloc(sizeof(CsrWifiNmeEventMaskSetReq), GFP_KERNEL); \
109 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_EVENT_MASK_SET_REQ, dst__, src__); \
110 msg__->indMask = (indMask__);
112 #define CsrWifiNmeEventMaskSetReqSendTo(dst__, src__, indMask__) \
114 CsrWifiNmeEventMaskSetReq *msg__; \
115 CsrWifiNmeEventMaskSetReqCreate(msg__, dst__, src__, indMask__); \
116 CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
119 #define CsrWifiNmeEventMaskSetReqSend(src__, indMask__) \
120 CsrWifiNmeEventMaskSetReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, indMask__)
122 /*******************************************************************************
125 CsrWifiNmeEventMaskSetCfmSend
128 The NME calls the primitive to report the result of the request
132 queue - Destination Task Queue
133 status - Reports the result of the request
135 *******************************************************************************/
136 #define CsrWifiNmeEventMaskSetCfmCreate(msg__, dst__, src__, status__) \
137 msg__ = kmalloc(sizeof(CsrWifiNmeEventMaskSetCfm), GFP_KERNEL); \
138 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_EVENT_MASK_SET_CFM, dst__, src__); \
139 msg__->status = (status__);
141 #define CsrWifiNmeEventMaskSetCfmSendTo(dst__, src__, status__) \
143 CsrWifiNmeEventMaskSetCfm *msg__; \
144 CsrWifiNmeEventMaskSetCfmCreate(msg__, dst__, src__, status__); \
145 CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
148 #define CsrWifiNmeEventMaskSetCfmSend(dst__, status__) \
149 CsrWifiNmeEventMaskSetCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, status__)
151 /*******************************************************************************
154 CsrWifiNmeProfileConnectReqSend
157 Requests the NME to attempt to connect to the specified profile.
158 Overrides any current connection attempt.
161 queue - Message Source Task Queue (Cfm's will be sent to this Queue)
162 interfaceTag - Interface Identifier; unique identifier of an interface
163 profileIdentity - Identity (BSSID, SSID) of profile to be connected to.
164 It must match an existing profile in the NME.
166 *******************************************************************************/
167 #define CsrWifiNmeProfileConnectReqCreate(msg__, dst__, src__, interfaceTag__, profileIdentity__) \
168 msg__ = kmalloc(sizeof(CsrWifiNmeProfileConnectReq), GFP_KERNEL); \
169 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_PROFILE_CONNECT_REQ, dst__, src__); \
170 msg__->interfaceTag = (interfaceTag__); \
171 msg__->profileIdentity = (profileIdentity__);
173 #define CsrWifiNmeProfileConnectReqSendTo(dst__, src__, interfaceTag__, profileIdentity__) \
175 CsrWifiNmeProfileConnectReq *msg__; \
176 CsrWifiNmeProfileConnectReqCreate(msg__, dst__, src__, interfaceTag__, profileIdentity__); \
177 CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
180 #define CsrWifiNmeProfileConnectReqSend(src__, interfaceTag__, profileIdentity__) \
181 CsrWifiNmeProfileConnectReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, interfaceTag__, profileIdentity__)
183 /*******************************************************************************
186 CsrWifiNmeProfileConnectCfmSend
189 Reports the status of the NME PROFILE CONNECT REQ. If unsuccessful the
190 connectAttempt parameters contain details of the APs that the NME
191 attempted to connect to before reporting the failure of the request.
194 queue - Destination Task Queue
195 interfaceTag - Interface Identifier; unique identifier of an
197 status - Indicates the success or otherwise of the requested
199 connectAttemptsCount - This parameter is relevant only if
200 status!=CSR_WIFI_NME_STATUS_SUCCESS.
201 Number of connection attempt elements provided with
203 connectAttempts - This parameter is relevant only if
204 status!=CSR_WIFI_NME_STATUS_SUCCESS.
205 Points to the list of connection attempt elements
206 provided with this primitive
207 Each element of the list provides information about
208 an AP on which the connection attempt was made and
209 the error that occurred during the attempt.
211 *******************************************************************************/
212 #define CsrWifiNmeProfileConnectCfmCreate(msg__, dst__, src__, interfaceTag__, status__, connectAttemptsCount__, connectAttempts__) \
213 msg__ = kmalloc(sizeof(CsrWifiNmeProfileConnectCfm), GFP_KERNEL); \
214 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_PROFILE_CONNECT_CFM, dst__, src__); \
215 msg__->interfaceTag = (interfaceTag__); \
216 msg__->status = (status__); \
217 msg__->connectAttemptsCount = (connectAttemptsCount__); \
218 msg__->connectAttempts = (connectAttempts__);
220 #define CsrWifiNmeProfileConnectCfmSendTo(dst__, src__, interfaceTag__, status__, connectAttemptsCount__, connectAttempts__) \
222 CsrWifiNmeProfileConnectCfm *msg__; \
223 CsrWifiNmeProfileConnectCfmCreate(msg__, dst__, src__, interfaceTag__, status__, connectAttemptsCount__, connectAttempts__); \
224 CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
227 #define CsrWifiNmeProfileConnectCfmSend(dst__, interfaceTag__, status__, connectAttemptsCount__, connectAttempts__) \
228 CsrWifiNmeProfileConnectCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, interfaceTag__, status__, connectAttemptsCount__, connectAttempts__)
230 /*******************************************************************************
233 CsrWifiNmeProfileDeleteAllReqSend
236 Deletes all profiles present in the NME, but does NOT modify the
237 preferred profile list.
240 queue - Message Source Task Queue (Cfm's will be sent to this Queue)
242 *******************************************************************************/
243 #define CsrWifiNmeProfileDeleteAllReqCreate(msg__, dst__, src__) \
244 msg__ = kmalloc(sizeof(CsrWifiNmeProfileDeleteAllReq), GFP_KERNEL); \
245 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_PROFILE_DELETE_ALL_REQ, dst__, src__);
247 #define CsrWifiNmeProfileDeleteAllReqSendTo(dst__, src__) \
249 CsrWifiNmeProfileDeleteAllReq *msg__; \
250 CsrWifiNmeProfileDeleteAllReqCreate(msg__, dst__, src__); \
251 CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
254 #define CsrWifiNmeProfileDeleteAllReqSend(src__) \
255 CsrWifiNmeProfileDeleteAllReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__)
257 /*******************************************************************************
260 CsrWifiNmeProfileDeleteAllCfmSend
263 Reports the status of the CSR_WIFI_NME_PROFILE_DELETE_ALL_REQ.
264 Returns always CSR_WIFI_NME_STATUS_SUCCESS.
267 queue - Destination Task Queue
268 status - Indicates the success or otherwise of the requested operation, but
269 in this case it always set to success.
271 *******************************************************************************/
272 #define CsrWifiNmeProfileDeleteAllCfmCreate(msg__, dst__, src__, status__) \
273 msg__ = kmalloc(sizeof(CsrWifiNmeProfileDeleteAllCfm), GFP_KERNEL); \
274 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_PROFILE_DELETE_ALL_CFM, dst__, src__); \
275 msg__->status = (status__);
277 #define CsrWifiNmeProfileDeleteAllCfmSendTo(dst__, src__, status__) \
279 CsrWifiNmeProfileDeleteAllCfm *msg__; \
280 CsrWifiNmeProfileDeleteAllCfmCreate(msg__, dst__, src__, status__); \
281 CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
284 #define CsrWifiNmeProfileDeleteAllCfmSend(dst__, status__) \
285 CsrWifiNmeProfileDeleteAllCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, status__)
287 /*******************************************************************************
290 CsrWifiNmeProfileDeleteReqSend
293 Will delete the profile with a matching identity, but does NOT modify the
294 preferred profile list.
297 queue - Message Source Task Queue (Cfm's will be sent to this Queue)
298 profileIdentity - Identity (BSSID, SSID) of profile to be deleted.
300 *******************************************************************************/
301 #define CsrWifiNmeProfileDeleteReqCreate(msg__, dst__, src__, profileIdentity__) \
302 msg__ = kmalloc(sizeof(CsrWifiNmeProfileDeleteReq), GFP_KERNEL); \
303 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_PROFILE_DELETE_REQ, dst__, src__); \
304 msg__->profileIdentity = (profileIdentity__);
306 #define CsrWifiNmeProfileDeleteReqSendTo(dst__, src__, profileIdentity__) \
308 CsrWifiNmeProfileDeleteReq *msg__; \
309 CsrWifiNmeProfileDeleteReqCreate(msg__, dst__, src__, profileIdentity__); \
310 CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
313 #define CsrWifiNmeProfileDeleteReqSend(src__, profileIdentity__) \
314 CsrWifiNmeProfileDeleteReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, profileIdentity__)
316 /*******************************************************************************
319 CsrWifiNmeProfileDeleteCfmSend
322 Reports the status of the CSR_WIFI_NME_PROFILE_DELETE_REQ.
323 Returns CSR_WIFI_NME_STATUS_NOT_FOUND if there is no matching profile.
326 queue - Destination Task Queue
327 status - Indicates the success or otherwise of the requested operation.
329 *******************************************************************************/
330 #define CsrWifiNmeProfileDeleteCfmCreate(msg__, dst__, src__, status__) \
331 msg__ = kmalloc(sizeof(CsrWifiNmeProfileDeleteCfm), GFP_KERNEL); \
332 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_PROFILE_DELETE_CFM, dst__, src__); \
333 msg__->status = (status__);
335 #define CsrWifiNmeProfileDeleteCfmSendTo(dst__, src__, status__) \
337 CsrWifiNmeProfileDeleteCfm *msg__; \
338 CsrWifiNmeProfileDeleteCfmCreate(msg__, dst__, src__, status__); \
339 CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
342 #define CsrWifiNmeProfileDeleteCfmSend(dst__, status__) \
343 CsrWifiNmeProfileDeleteCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, status__)
345 /*******************************************************************************
348 CsrWifiNmeProfileDisconnectIndSend
351 Indication generated from the NME (if an application subscribes to
352 receive it) that informs that application that the current profile
353 connection has disconnected. The indication will contain information
354 about APs that it attempted to maintain the connection via i.e. in the
355 case of failed roaming.
358 queue - Destination Task Queue
359 interfaceTag - Interface Identifier; unique identifier of an
361 connectAttemptsCount - Number of connection attempt elements provided with
363 connectAttempts - Points to the list of connection attempt elements
364 provided with this primitive
365 Each element of the list provides information about
366 an AP on which the connection attempt was made and
367 the error occurred during the attempt.
369 *******************************************************************************/
370 #define CsrWifiNmeProfileDisconnectIndCreate(msg__, dst__, src__, interfaceTag__, connectAttemptsCount__, connectAttempts__) \
371 msg__ = kmalloc(sizeof(CsrWifiNmeProfileDisconnectInd), GFP_KERNEL); \
372 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_PROFILE_DISCONNECT_IND, dst__, src__); \
373 msg__->interfaceTag = (interfaceTag__); \
374 msg__->connectAttemptsCount = (connectAttemptsCount__); \
375 msg__->connectAttempts = (connectAttempts__);
377 #define CsrWifiNmeProfileDisconnectIndSendTo(dst__, src__, interfaceTag__, connectAttemptsCount__, connectAttempts__) \
379 CsrWifiNmeProfileDisconnectInd *msg__; \
380 CsrWifiNmeProfileDisconnectIndCreate(msg__, dst__, src__, interfaceTag__, connectAttemptsCount__, connectAttempts__); \
381 CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
384 #define CsrWifiNmeProfileDisconnectIndSend(dst__, interfaceTag__, connectAttemptsCount__, connectAttempts__) \
385 CsrWifiNmeProfileDisconnectIndSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, interfaceTag__, connectAttemptsCount__, connectAttempts__)
387 /*******************************************************************************
390 CsrWifiNmeProfileOrderSetReqSend
393 Defines the preferred order that profiles present in the NME should be
394 used during the NME auto-connect behaviour.
395 If profileIdentitysCount == 0, it removes any existing preferred profile
396 list already present in the NME, effectively disabling the auto-connect
398 NOTE: Profile identities that do not match any profile stored in the NME
399 are ignored during the auto-connect procedure.
400 NOTE: during auto-connect the NME will only attempt to join an existing
401 adhoc network and it will never attempt to host an adhoc network; for
402 hosting and adhoc network, use CSR_WIFI_NME_PROFILE_CONNECT_REQ
405 queue - Message Source Task Queue (Cfm's will be sent to this Queue)
406 interfaceTag - Interface Identifier; unique identifier of an
408 profileIdentitysCount - The number of profiles identities in the list.
409 profileIdentitys - Points to the list of profile identities.
411 *******************************************************************************/
412 #define CsrWifiNmeProfileOrderSetReqCreate(msg__, dst__, src__, interfaceTag__, profileIdentitysCount__, profileIdentitys__) \
413 msg__ = kmalloc(sizeof(CsrWifiNmeProfileOrderSetReq), GFP_KERNEL); \
414 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_PROFILE_ORDER_SET_REQ, dst__, src__); \
415 msg__->interfaceTag = (interfaceTag__); \
416 msg__->profileIdentitysCount = (profileIdentitysCount__); \
417 msg__->profileIdentitys = (profileIdentitys__);
419 #define CsrWifiNmeProfileOrderSetReqSendTo(dst__, src__, interfaceTag__, profileIdentitysCount__, profileIdentitys__) \
421 CsrWifiNmeProfileOrderSetReq *msg__; \
422 CsrWifiNmeProfileOrderSetReqCreate(msg__, dst__, src__, interfaceTag__, profileIdentitysCount__, profileIdentitys__); \
423 CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
426 #define CsrWifiNmeProfileOrderSetReqSend(src__, interfaceTag__, profileIdentitysCount__, profileIdentitys__) \
427 CsrWifiNmeProfileOrderSetReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, interfaceTag__, profileIdentitysCount__, profileIdentitys__)
429 /*******************************************************************************
432 CsrWifiNmeProfileOrderSetCfmSend
435 Confirmation to UNIFI_NME_PROFILE_ORDER_SET.request.
438 queue - Destination Task Queue
439 interfaceTag - Interface Identifier; unique identifier of an interface
440 status - Indicates the success or otherwise of the requested
443 *******************************************************************************/
444 #define CsrWifiNmeProfileOrderSetCfmCreate(msg__, dst__, src__, interfaceTag__, status__) \
445 msg__ = kmalloc(sizeof(CsrWifiNmeProfileOrderSetCfm), GFP_KERNEL); \
446 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_PROFILE_ORDER_SET_CFM, dst__, src__); \
447 msg__->interfaceTag = (interfaceTag__); \
448 msg__->status = (status__);
450 #define CsrWifiNmeProfileOrderSetCfmSendTo(dst__, src__, interfaceTag__, status__) \
452 CsrWifiNmeProfileOrderSetCfm *msg__; \
453 CsrWifiNmeProfileOrderSetCfmCreate(msg__, dst__, src__, interfaceTag__, status__); \
454 CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
457 #define CsrWifiNmeProfileOrderSetCfmSend(dst__, interfaceTag__, status__) \
458 CsrWifiNmeProfileOrderSetCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, interfaceTag__, status__)
460 /*******************************************************************************
463 CsrWifiNmeProfileSetReqSend
466 Creates or updates an existing profile in the NME that matches the unique
467 identity of the profile. Each profile is identified by the combination of
468 BSSID and SSID. The profile contains all the required credentials for
469 attempting to connect to the network. Creating or updating a profile via
470 the NME PROFILE SET REQ does NOT add the profile to the preferred profile
471 list within the NME used for the NME auto-connect behaviour.
474 queue - Message Source Task Queue (Cfm's will be sent to this Queue)
475 profile - Specifies the identity and credentials of the network.
477 *******************************************************************************/
478 #define CsrWifiNmeProfileSetReqCreate(msg__, dst__, src__, profile__) \
479 msg__ = kmalloc(sizeof(CsrWifiNmeProfileSetReq), GFP_KERNEL); \
480 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_PROFILE_SET_REQ, dst__, src__); \
481 msg__->profile = (profile__);
483 #define CsrWifiNmeProfileSetReqSendTo(dst__, src__, profile__) \
485 CsrWifiNmeProfileSetReq *msg__; \
486 CsrWifiNmeProfileSetReqCreate(msg__, dst__, src__, profile__); \
487 CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
490 #define CsrWifiNmeProfileSetReqSend(src__, profile__) \
491 CsrWifiNmeProfileSetReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, profile__)
493 /*******************************************************************************
496 CsrWifiNmeProfileSetCfmSend
499 Reports the status of the NME PROFILE SET REQ; the request will only fail
500 if the details specified in the profile contains an invalid combination
501 of parameters for example specifying the profile as cloaked but not
502 specifying the SSID. The NME doesn't limit the number of profiles that
503 may be created. The NME assumes that the entity configuring it is aware
504 of the appropriate limits.
507 queue - Destination Task Queue
508 status - Indicates the success or otherwise of the requested operation.
510 *******************************************************************************/
511 #define CsrWifiNmeProfileSetCfmCreate(msg__, dst__, src__, status__) \
512 msg__ = kmalloc(sizeof(CsrWifiNmeProfileSetCfm), GFP_KERNEL); \
513 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_PROFILE_SET_CFM, dst__, src__); \
514 msg__->status = (status__);
516 #define CsrWifiNmeProfileSetCfmSendTo(dst__, src__, status__) \
518 CsrWifiNmeProfileSetCfm *msg__; \
519 CsrWifiNmeProfileSetCfmCreate(msg__, dst__, src__, status__); \
520 CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
523 #define CsrWifiNmeProfileSetCfmSend(dst__, status__) \
524 CsrWifiNmeProfileSetCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, status__)
526 /*******************************************************************************
529 CsrWifiNmeProfileUpdateIndSend
532 Indication generated from the NME (if an application subscribes to
533 receive it) that informs that application that the contained profile has
535 For example, either the credentials EAP-FAST PAC file or the session data
536 within the profile has changed.
537 It is up to the application whether it stores this updated profile or
541 queue - Destination Task Queue
542 interfaceTag - Interface Identifier; unique identifier of an interface
543 profile - The identity and credentials of the network.
545 *******************************************************************************/
546 #define CsrWifiNmeProfileUpdateIndCreate(msg__, dst__, src__, interfaceTag__, profile__) \
547 msg__ = kmalloc(sizeof(CsrWifiNmeProfileUpdateInd), GFP_KERNEL); \
548 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_PROFILE_UPDATE_IND, dst__, src__); \
549 msg__->interfaceTag = (interfaceTag__); \
550 msg__->profile = (profile__);
552 #define CsrWifiNmeProfileUpdateIndSendTo(dst__, src__, interfaceTag__, profile__) \
554 CsrWifiNmeProfileUpdateInd *msg__; \
555 CsrWifiNmeProfileUpdateIndCreate(msg__, dst__, src__, interfaceTag__, profile__); \
556 CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
559 #define CsrWifiNmeProfileUpdateIndSend(dst__, interfaceTag__, profile__) \
560 CsrWifiNmeProfileUpdateIndSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, interfaceTag__, profile__)
562 /*******************************************************************************
565 CsrWifiNmeSimGsmAuthIndSend
568 Indication generated from the NME (if an application subscribes to
569 receive it) that requests the UICC Manager to perform a GSM
570 authentication on behalf of the NME. This indication is generated when
571 the NME is attempting to connect to a profile configured for EAP-SIM. An
572 application MUST register to receive this indication for the NME to
573 support the EAP-SIM credential types. Otherwise the NME has no route to
574 obtain the information from the UICC. EAP-SIM authentication requires 2
575 or 3 GSM authentication rounds and therefore 2 or 3 RANDS (GSM Random
576 Challenges) are included.
579 queue - Destination Task Queue
580 randsLength - GSM RAND is 16 bytes long hence valid values are 32 (2 RANDS)
582 rands - 2 or 3 RANDs values.
584 *******************************************************************************/
585 #define CsrWifiNmeSimGsmAuthIndCreate(msg__, dst__, src__, randsLength__, rands__) \
586 msg__ = kmalloc(sizeof(CsrWifiNmeSimGsmAuthInd), GFP_KERNEL); \
587 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_SIM_GSM_AUTH_IND, dst__, src__); \
588 msg__->randsLength = (randsLength__); \
589 msg__->rands = (rands__);
591 #define CsrWifiNmeSimGsmAuthIndSendTo(dst__, src__, randsLength__, rands__) \
593 CsrWifiNmeSimGsmAuthInd *msg__; \
594 CsrWifiNmeSimGsmAuthIndCreate(msg__, dst__, src__, randsLength__, rands__); \
595 CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
598 #define CsrWifiNmeSimGsmAuthIndSend(dst__, randsLength__, rands__) \
599 CsrWifiNmeSimGsmAuthIndSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, randsLength__, rands__)
601 /*******************************************************************************
604 CsrWifiNmeSimGsmAuthResSend
607 Response from the application that received the NME SIM GSM AUTH IND. For
608 each GSM authentication round a GSM Ciphering key (Kc) and a signed
609 response (SRES) are produced. Since 2 or 3 GSM authentication rounds are
610 used the 2 or 3 Kc's obtained respectively are combined into one buffer
611 and similarly the 2 or 3 SRES's obtained are combined into another
612 buffer. The order of Kc values (SRES values respectively) in their buffer
613 is the same as that of their corresponding RAND values in the incoming
617 status - Indicates the outcome of the requested operation:
618 STATUS_SUCCESS or STATUS_ERROR
619 kcsLength - Length in Bytes of Kc buffer. Legal values are: 16 or 24.
620 kcs - Kc buffer holding 2 or 3 Kc values.
621 sresLength - Length in Bytes of SRES buffer. Legal values are: 8 or 12.
622 sres - SRES buffer holding 2 or 3 SRES values.
624 *******************************************************************************/
625 #define CsrWifiNmeSimGsmAuthResCreate(msg__, dst__, src__, status__, kcsLength__, kcs__, sresLength__, sres__) \
626 msg__ = kmalloc(sizeof(CsrWifiNmeSimGsmAuthRes), GFP_KERNEL); \
627 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_SIM_GSM_AUTH_RES, dst__, src__); \
628 msg__->status = (status__); \
629 msg__->kcsLength = (kcsLength__); \
630 msg__->kcs = (kcs__); \
631 msg__->sresLength = (sresLength__); \
632 msg__->sres = (sres__);
634 #define CsrWifiNmeSimGsmAuthResSendTo(dst__, src__, status__, kcsLength__, kcs__, sresLength__, sres__) \
636 CsrWifiNmeSimGsmAuthRes *msg__; \
637 CsrWifiNmeSimGsmAuthResCreate(msg__, dst__, src__, status__, kcsLength__, kcs__, sresLength__, sres__); \
638 CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
641 #define CsrWifiNmeSimGsmAuthResSend(src__, status__, kcsLength__, kcs__, sresLength__, sres__) \
642 CsrWifiNmeSimGsmAuthResSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, status__, kcsLength__, kcs__, sresLength__, sres__)
644 /*******************************************************************************
647 CsrWifiNmeSimImsiGetIndSend
650 Indication generated from the NME (if an application subscribes to
651 receive it) that requests the IMSI and UICC type from the UICC Manager.
652 This indication is generated when the NME is attempting to connect to a
653 profile configured for EAP-SIM/AKA. An application MUST register to
654 receive this indication for the NME to support the EAP-SIM/AKA credential
655 types. Otherwise the NME has no route to obtain the information from the
659 queue - Destination Task Queue
661 *******************************************************************************/
662 #define CsrWifiNmeSimImsiGetIndCreate(msg__, dst__, src__) \
663 msg__ = kmalloc(sizeof(CsrWifiNmeSimImsiGetInd), GFP_KERNEL); \
664 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_SIM_IMSI_GET_IND, dst__, src__);
666 #define CsrWifiNmeSimImsiGetIndSendTo(dst__, src__) \
668 CsrWifiNmeSimImsiGetInd *msg__; \
669 CsrWifiNmeSimImsiGetIndCreate(msg__, dst__, src__); \
670 CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
673 #define CsrWifiNmeSimImsiGetIndSend(dst__) \
674 CsrWifiNmeSimImsiGetIndSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE)
676 /*******************************************************************************
679 CsrWifiNmeSimImsiGetResSend
682 Response from the application that received the NME SIM IMSI GET IND.
685 status - Indicates the outcome of the requested operation: STATUS_SUCCESS
687 imsi - The value of the IMSI obtained from the UICC.
688 cardType - The UICC type (GSM only (SIM), UMTS only (USIM), Both).
690 *******************************************************************************/
691 #define CsrWifiNmeSimImsiGetResCreate(msg__, dst__, src__, status__, imsi__, cardType__) \
692 msg__ = kmalloc(sizeof(CsrWifiNmeSimImsiGetRes), GFP_KERNEL); \
693 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_SIM_IMSI_GET_RES, dst__, src__); \
694 msg__->status = (status__); \
695 msg__->imsi = (imsi__); \
696 msg__->cardType = (cardType__);
698 #define CsrWifiNmeSimImsiGetResSendTo(dst__, src__, status__, imsi__, cardType__) \
700 CsrWifiNmeSimImsiGetRes *msg__; \
701 CsrWifiNmeSimImsiGetResCreate(msg__, dst__, src__, status__, imsi__, cardType__); \
702 CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
705 #define CsrWifiNmeSimImsiGetResSend(src__, status__, imsi__, cardType__) \
706 CsrWifiNmeSimImsiGetResSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, status__, imsi__, cardType__)
708 /*******************************************************************************
711 CsrWifiNmeSimUmtsAuthIndSend
714 Indication generated from the NME (if an application subscribes to
715 receive it) that requests the UICC Manager to perform a UMTS
716 authentication on behalf of the NME. This indication is generated when
717 the NME is attempting to connect to a profile configured for EAP-AKA. An
718 application MUST register to receive this indication for the NME to
719 support the EAP-AKA credential types. Otherwise the NME has no route to
720 obtain the information from the USIM. EAP-AKA requires one UMTS
721 authentication round and therefore only one RAND and one AUTN values are
725 queue - Destination Task Queue
726 rand - UMTS RAND value.
727 autn - UMTS AUTN value.
729 *******************************************************************************/
730 #define CsrWifiNmeSimUmtsAuthIndCreate(msg__, dst__, src__, rand__, autn__) \
731 msg__ = kmalloc(sizeof(CsrWifiNmeSimUmtsAuthInd), GFP_KERNEL); \
732 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_SIM_UMTS_AUTH_IND, dst__, src__); \
733 memcpy(msg__->rand, (rand__), sizeof(u8) * 16); \
734 memcpy(msg__->autn, (autn__), sizeof(u8) * 16);
736 #define CsrWifiNmeSimUmtsAuthIndSendTo(dst__, src__, rand__, autn__) \
738 CsrWifiNmeSimUmtsAuthInd *msg__; \
739 CsrWifiNmeSimUmtsAuthIndCreate(msg__, dst__, src__, rand__, autn__); \
740 CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
743 #define CsrWifiNmeSimUmtsAuthIndSend(dst__, rand__, autn__) \
744 CsrWifiNmeSimUmtsAuthIndSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, rand__, autn__)
746 /*******************************************************************************
749 CsrWifiNmeSimUmtsAuthResSend
752 Response from the application that received the NME SIM UMTS AUTH IND.
753 The values of umtsCipherKey, umtsIntegrityKey, resParameterLength and
754 resParameter are only meanigful when result = UMTS_AUTH_RESULT_SUCCESS.
755 The value of auts is only meaningful when
756 result=UMTS_AUTH_RESULT_SYNC_FAIL.
759 status - Indicates the outcome of the requested operation:
760 STATUS_SUCCESS or STATUS_ERROR.
761 result - The result of UMTS authentication as performed by the
762 UICC which could be: Success, Authentication Reject or
763 Synchronisation Failure. For all these 3 outcomes the
764 value of status is success.
765 umtsCipherKey - The UMTS Cipher Key as calculated and returned by the
767 umtsIntegrityKey - The UMTS Integrity Key as calculated and returned by
769 resParameterLength - The length (in bytes) of the RES parameter (min=4; max
771 resParameter - The RES parameter as calculated and returned by the
773 auts - The AUTS parameter as calculated and returned by the
776 *******************************************************************************/
777 #define CsrWifiNmeSimUmtsAuthResCreate(msg__, dst__, src__, status__, result__, umtsCipherKey__, umtsIntegrityKey__, resParameterLength__, resParameter__, auts__) \
778 msg__ = kmalloc(sizeof(CsrWifiNmeSimUmtsAuthRes), GFP_KERNEL); \
779 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_SIM_UMTS_AUTH_RES, dst__, src__); \
780 msg__->status = (status__); \
781 msg__->result = (result__); \
782 memcpy(msg__->umtsCipherKey, (umtsCipherKey__), sizeof(u8) * 16); \
783 memcpy(msg__->umtsIntegrityKey, (umtsIntegrityKey__), sizeof(u8) * 16); \
784 msg__->resParameterLength = (resParameterLength__); \
785 msg__->resParameter = (resParameter__); \
786 memcpy(msg__->auts, (auts__), sizeof(u8) * 14);
788 #define CsrWifiNmeSimUmtsAuthResSendTo(dst__, src__, status__, result__, umtsCipherKey__, umtsIntegrityKey__, resParameterLength__, resParameter__, auts__) \
790 CsrWifiNmeSimUmtsAuthRes *msg__; \
791 CsrWifiNmeSimUmtsAuthResCreate(msg__, dst__, src__, status__, result__, umtsCipherKey__, umtsIntegrityKey__, resParameterLength__, resParameter__, auts__); \
792 CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
795 #define CsrWifiNmeSimUmtsAuthResSend(src__, status__, result__, umtsCipherKey__, umtsIntegrityKey__, resParameterLength__, resParameter__, auts__) \
796 CsrWifiNmeSimUmtsAuthResSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, status__, result__, umtsCipherKey__, umtsIntegrityKey__, resParameterLength__, resParameter__, auts__)
798 /*******************************************************************************
801 CsrWifiNmeWpsCancelReqSend
804 Requests the NME to cancel any WPS procedure that it is currently
805 performing. This includes WPS registrar activities started because of
806 CSR_WIFI_NME_AP_REGISTER.request
809 queue - Message Source Task Queue (Cfm's will be sent to this Queue)
810 interfaceTag - Interface Identifier; unique identifier of an interface
812 *******************************************************************************/
813 #define CsrWifiNmeWpsCancelReqCreate(msg__, dst__, src__, interfaceTag__) \
814 msg__ = kmalloc(sizeof(CsrWifiNmeWpsCancelReq), GFP_KERNEL); \
815 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_WPS_CANCEL_REQ, dst__, src__); \
816 msg__->interfaceTag = (interfaceTag__);
818 #define CsrWifiNmeWpsCancelReqSendTo(dst__, src__, interfaceTag__) \
820 CsrWifiNmeWpsCancelReq *msg__; \
821 CsrWifiNmeWpsCancelReqCreate(msg__, dst__, src__, interfaceTag__); \
822 CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
825 #define CsrWifiNmeWpsCancelReqSend(src__, interfaceTag__) \
826 CsrWifiNmeWpsCancelReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, interfaceTag__)
828 /*******************************************************************************
831 CsrWifiNmeWpsCancelCfmSend
834 Reports the status of the NME WPS REQ, the request is always SUCCESSFUL.
837 queue - Destination Task Queue
838 interfaceTag - Interface Identifier; unique identifier of an interface
839 status - Only returns CSR_WIFI_NME_STATUS_SUCCESS
841 *******************************************************************************/
842 #define CsrWifiNmeWpsCancelCfmCreate(msg__, dst__, src__, interfaceTag__, status__) \
843 msg__ = kmalloc(sizeof(CsrWifiNmeWpsCancelCfm), GFP_KERNEL); \
844 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_WPS_CANCEL_CFM, dst__, src__); \
845 msg__->interfaceTag = (interfaceTag__); \
846 msg__->status = (status__);
848 #define CsrWifiNmeWpsCancelCfmSendTo(dst__, src__, interfaceTag__, status__) \
850 CsrWifiNmeWpsCancelCfm *msg__; \
851 CsrWifiNmeWpsCancelCfmCreate(msg__, dst__, src__, interfaceTag__, status__); \
852 CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
855 #define CsrWifiNmeWpsCancelCfmSend(dst__, interfaceTag__, status__) \
856 CsrWifiNmeWpsCancelCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, interfaceTag__, status__)
858 /*******************************************************************************
864 Reports the status of the NME WPS REQ.
865 If CSR_WIFI_NME_STATUS_SUCCESS, the profile parameter contains the
866 identity and credentials of the AP.
869 queue - Destination Task Queue
870 interfaceTag - Interface Identifier; unique identifier of an interface
871 status - Indicates the success or otherwise of the requested
873 profile - This parameter is relevant only if
874 status==CSR_WIFI_NME_STATUS_SUCCESS.
875 The identity and credentials of the network.
877 *******************************************************************************/
878 #define CsrWifiNmeWpsCfmCreate(msg__, dst__, src__, interfaceTag__, status__, profile__) \
879 msg__ = kmalloc(sizeof(CsrWifiNmeWpsCfm), GFP_KERNEL); \
880 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_WPS_CFM, dst__, src__); \
881 msg__->interfaceTag = (interfaceTag__); \
882 msg__->status = (status__); \
883 msg__->profile = (profile__);
885 #define CsrWifiNmeWpsCfmSendTo(dst__, src__, interfaceTag__, status__, profile__) \
887 CsrWifiNmeWpsCfm *msg__; \
888 CsrWifiNmeWpsCfmCreate(msg__, dst__, src__, interfaceTag__, status__, profile__); \
889 CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
892 #define CsrWifiNmeWpsCfmSend(dst__, interfaceTag__, status__, profile__) \
893 CsrWifiNmeWpsCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, interfaceTag__, status__, profile__)
895 /*******************************************************************************
898 CsrWifiNmeWpsConfigSetReqSend
901 This primitive passes the WPS information for the device to NME. This may
902 be accepted only if no interface is active.
905 queue - Message Source Task Queue (Cfm's will be sent to this Queue)
906 wpsConfig - WPS config.
908 *******************************************************************************/
909 #define CsrWifiNmeWpsConfigSetReqCreate(msg__, dst__, src__, wpsConfig__) \
910 msg__ = kmalloc(sizeof(CsrWifiNmeWpsConfigSetReq), GFP_KERNEL); \
911 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_WPS_CONFIG_SET_REQ, dst__, src__); \
912 msg__->wpsConfig = (wpsConfig__);
914 #define CsrWifiNmeWpsConfigSetReqSendTo(dst__, src__, wpsConfig__) \
916 CsrWifiNmeWpsConfigSetReq *msg__; \
917 CsrWifiNmeWpsConfigSetReqCreate(msg__, dst__, src__, wpsConfig__); \
918 CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
921 #define CsrWifiNmeWpsConfigSetReqSend(src__, wpsConfig__) \
922 CsrWifiNmeWpsConfigSetReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, wpsConfig__)
924 /*******************************************************************************
927 CsrWifiNmeWpsConfigSetCfmSend
933 queue - Destination Task Queue
934 status - Status of the request.
936 *******************************************************************************/
937 #define CsrWifiNmeWpsConfigSetCfmCreate(msg__, dst__, src__, status__) \
938 msg__ = kmalloc(sizeof(CsrWifiNmeWpsConfigSetCfm), GFP_KERNEL); \
939 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_WPS_CONFIG_SET_CFM, dst__, src__); \
940 msg__->status = (status__);
942 #define CsrWifiNmeWpsConfigSetCfmSendTo(dst__, src__, status__) \
944 CsrWifiNmeWpsConfigSetCfm *msg__; \
945 CsrWifiNmeWpsConfigSetCfmCreate(msg__, dst__, src__, status__); \
946 CsrSchedMessagePut(dst__, CSR_WIFI_NME_PRIM, msg__); \
949 #define CsrWifiNmeWpsConfigSetCfmSend(dst__, status__) \
950 CsrWifiNmeWpsConfigSetCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, status__)
952 /*******************************************************************************
958 Requests the NME to look for WPS enabled APs and attempt to perform WPS
959 to determine the appropriate security credentials to connect to the AP.
960 If the PIN == '00000000' then 'push button mode' is indicated, otherwise
961 the PIN has to match that of the AP. 4 digit pin is passed by sending the
962 pin digits in pin[0]..pin[3] and rest of the contents filled with '-'.
965 queue - Message Source Task Queue (Cfm's will be sent to this Queue)
966 interfaceTag - Interface Identifier; unique identifier of an interface
968 ssid - Service Set identifier
969 bssid - ID of Basic Service Set for which a WPS connection attempt is
972 *******************************************************************************/
973 #define CsrWifiNmeWpsReqCreate(msg__, dst__, src__, interfaceTag__, pin__, ssid__, bssid__) \
974 msg__ = kmalloc(sizeof(CsrWifiNmeWpsReq), GFP_KERNEL); \
975 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_PRIM, CSR_WIFI_NME_WPS_REQ, dst__, src__); \
976 msg__->interfaceTag = (interfaceTag__); \
977 memcpy(msg__->pin, (pin__), sizeof(u8) * 8); \
978 msg__->ssid = (ssid__); \
979 msg__->bssid = (bssid__);
981 #define CsrWifiNmeWpsReqSendTo(dst__, src__, interfaceTag__, pin__, ssid__, bssid__) \
983 CsrWifiNmeWpsReq *msg__; \
984 CsrWifiNmeWpsReqCreate(msg__, dst__, src__, interfaceTag__, pin__, ssid__, bssid__); \
985 CsrMsgTransport(dst__, CSR_WIFI_NME_PRIM, msg__); \
988 #define CsrWifiNmeWpsReqSend(src__, interfaceTag__, pin__, ssid__, bssid__) \
989 CsrWifiNmeWpsReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, interfaceTag__, pin__, ssid__, bssid__)
991 #endif /* CSR_WIFI_NME_LIB_H__ */