Go to the documentation of this file.
13 #ifndef CSR_WIFI_NME_AP_LIB_H__
14 #define CSR_WIFI_NME_AP_LIB_H__
30 #ifndef CSR_WIFI_NME_ENABLE
31 #error CSR_WIFI_NME_ENABLE MUST be defined inorder to use csr_wifi_nme_ap_lib.h
33 #ifndef CSR_WIFI_AP_ENABLE
34 #error CSR_WIFI_AP_ENABLE MUST be defined inorder to use csr_wifi_nme_ap_lib.h
96 #define CsrWifiNmeApConfigSetReqCreate(msg__, dst__, src__, apConfig__, apMacConfig__) \
97 msg__ = kmalloc(sizeof(CsrWifiNmeApConfigSetReq), GFP_KERNEL); \
98 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_AP_PRIM, CSR_WIFI_NME_AP_CONFIG_SET_REQ, dst__, src__); \
99 msg__->apConfig = (apConfig__); \
100 msg__->apMacConfig = (apMacConfig__);
102 #define CsrWifiNmeApConfigSetReqSendTo(dst__, src__, apConfig__, apMacConfig__) \
104 CsrWifiNmeApConfigSetReq *msg__; \
105 CsrWifiNmeApConfigSetReqCreate(msg__, dst__, src__, apConfig__, apMacConfig__); \
106 CsrMsgTransport(dst__, CSR_WIFI_NME_AP_PRIM, msg__); \
109 #define CsrWifiNmeApConfigSetReqSend(src__, apConfig__, apMacConfig__) \
110 CsrWifiNmeApConfigSetReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, apConfig__, apMacConfig__)
125 #define CsrWifiNmeApConfigSetCfmCreate(msg__, dst__, src__, status__) \
126 msg__ = kmalloc(sizeof(CsrWifiNmeApConfigSetCfm), GFP_KERNEL); \
127 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_AP_PRIM, CSR_WIFI_NME_AP_CONFIG_SET_CFM, dst__, src__); \
128 msg__->status = (status__);
130 #define CsrWifiNmeApConfigSetCfmSendTo(dst__, src__, status__) \
132 CsrWifiNmeApConfigSetCfm *msg__; \
133 CsrWifiNmeApConfigSetCfmCreate(msg__, dst__, src__, status__); \
134 CsrSchedMessagePut(dst__, CSR_WIFI_NME_AP_PRIM, msg__); \
137 #define CsrWifiNmeApConfigSetCfmSend(dst__, status__) \
138 CsrWifiNmeApConfigSetCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, status__)
160 #define CsrWifiNmeApStaRemoveReqCreate(msg__, dst__, src__, interfaceTag__, staMacAddress__, keepBlocking__) \
161 msg__ = kmalloc(sizeof(CsrWifiNmeApStaRemoveReq), GFP_KERNEL); \
162 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_AP_PRIM, CSR_WIFI_NME_AP_STA_REMOVE_REQ, dst__, src__); \
163 msg__->interfaceTag = (interfaceTag__); \
164 msg__->staMacAddress = (staMacAddress__); \
165 msg__->keepBlocking = (keepBlocking__);
167 #define CsrWifiNmeApStaRemoveReqSendTo(dst__, src__, interfaceTag__, staMacAddress__, keepBlocking__) \
169 CsrWifiNmeApStaRemoveReq *msg__; \
170 CsrWifiNmeApStaRemoveReqCreate(msg__, dst__, src__, interfaceTag__, staMacAddress__, keepBlocking__); \
171 CsrMsgTransport(dst__, CSR_WIFI_NME_AP_PRIM, msg__); \
174 #define CsrWifiNmeApStaRemoveReqSend(src__, interfaceTag__, staMacAddress__, keepBlocking__) \
175 CsrWifiNmeApStaRemoveReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, interfaceTag__, staMacAddress__, keepBlocking__)
200 #define CsrWifiNmeApStartReqCreate(msg__, dst__, src__, interfaceTag__, apType__, cloakSsid__, ssid__, ifIndex__, channel__, apCredentials__, maxConnections__, p2pGoParam__, wpsEnabled__) \
201 msg__ = kmalloc(sizeof(CsrWifiNmeApStartReq), GFP_KERNEL); \
202 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_AP_PRIM, CSR_WIFI_NME_AP_START_REQ, dst__, src__); \
203 msg__->interfaceTag = (interfaceTag__); \
204 msg__->apType = (apType__); \
205 msg__->cloakSsid = (cloakSsid__); \
206 msg__->ssid = (ssid__); \
207 msg__->ifIndex = (ifIndex__); \
208 msg__->channel = (channel__); \
209 msg__->apCredentials = (apCredentials__); \
210 msg__->maxConnections = (maxConnections__); \
211 msg__->p2pGoParam = (p2pGoParam__); \
212 msg__->wpsEnabled = (wpsEnabled__);
214 #define CsrWifiNmeApStartReqSendTo(dst__, src__, interfaceTag__, apType__, cloakSsid__, ssid__, ifIndex__, channel__, apCredentials__, maxConnections__, p2pGoParam__, wpsEnabled__) \
216 CsrWifiNmeApStartReq *msg__; \
217 CsrWifiNmeApStartReqCreate(msg__, dst__, src__, interfaceTag__, apType__, cloakSsid__, ssid__, ifIndex__, channel__, apCredentials__, maxConnections__, p2pGoParam__, wpsEnabled__); \
218 CsrMsgTransport(dst__, CSR_WIFI_NME_AP_PRIM, msg__); \
221 #define CsrWifiNmeApStartReqSend(src__, interfaceTag__, apType__, cloakSsid__, ssid__, ifIndex__, channel__, apCredentials__, maxConnections__, p2pGoParam__, wpsEnabled__) \
222 CsrWifiNmeApStartReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, interfaceTag__, apType__, cloakSsid__, ssid__, ifIndex__, channel__, apCredentials__, maxConnections__, p2pGoParam__, wpsEnabled__)
239 #define CsrWifiNmeApStartCfmCreate(msg__, dst__, src__, interfaceTag__, status__, ssid__) \
240 msg__ = kmalloc(sizeof(CsrWifiNmeApStartCfm), GFP_KERNEL); \
241 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_AP_PRIM, CSR_WIFI_NME_AP_START_CFM, dst__, src__); \
242 msg__->interfaceTag = (interfaceTag__); \
243 msg__->status = (status__); \
244 msg__->ssid = (ssid__);
246 #define CsrWifiNmeApStartCfmSendTo(dst__, src__, interfaceTag__, status__, ssid__) \
248 CsrWifiNmeApStartCfm *msg__; \
249 CsrWifiNmeApStartCfmCreate(msg__, dst__, src__, interfaceTag__, status__, ssid__); \
250 CsrSchedMessagePut(dst__, CSR_WIFI_NME_AP_PRIM, msg__); \
253 #define CsrWifiNmeApStartCfmSend(dst__, interfaceTag__, status__, ssid__) \
254 CsrWifiNmeApStartCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, interfaceTag__, status__, ssid__)
274 #define CsrWifiNmeApStationIndCreate(msg__, dst__, src__, interfaceTag__, mediaStatus__, peerMacAddress__, peerDeviceAddress__) \
275 msg__ = kmalloc(sizeof(CsrWifiNmeApStationInd), GFP_KERNEL); \
276 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_AP_PRIM, CSR_WIFI_NME_AP_STATION_IND, dst__, src__); \
277 msg__->interfaceTag = (interfaceTag__); \
278 msg__->mediaStatus = (mediaStatus__); \
279 msg__->peerMacAddress = (peerMacAddress__); \
280 msg__->peerDeviceAddress = (peerDeviceAddress__);
282 #define CsrWifiNmeApStationIndSendTo(dst__, src__, interfaceTag__, mediaStatus__, peerMacAddress__, peerDeviceAddress__) \
284 CsrWifiNmeApStationInd *msg__; \
285 CsrWifiNmeApStationIndCreate(msg__, dst__, src__, interfaceTag__, mediaStatus__, peerMacAddress__, peerDeviceAddress__); \
286 CsrSchedMessagePut(dst__, CSR_WIFI_NME_AP_PRIM, msg__); \
289 #define CsrWifiNmeApStationIndSend(dst__, interfaceTag__, mediaStatus__, peerMacAddress__, peerDeviceAddress__) \
290 CsrWifiNmeApStationIndSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, interfaceTag__, mediaStatus__, peerMacAddress__, peerDeviceAddress__)
305 #define CsrWifiNmeApStopReqCreate(msg__, dst__, src__, interfaceTag__) \
306 msg__ = kmalloc(sizeof(CsrWifiNmeApStopReq), GFP_KERNEL); \
307 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_AP_PRIM, CSR_WIFI_NME_AP_STOP_REQ, dst__, src__); \
308 msg__->interfaceTag = (interfaceTag__);
310 #define CsrWifiNmeApStopReqSendTo(dst__, src__, interfaceTag__) \
312 CsrWifiNmeApStopReq *msg__; \
313 CsrWifiNmeApStopReqCreate(msg__, dst__, src__, interfaceTag__); \
314 CsrMsgTransport(dst__, CSR_WIFI_NME_AP_PRIM, msg__); \
317 #define CsrWifiNmeApStopReqSend(src__, interfaceTag__) \
318 CsrWifiNmeApStopReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, interfaceTag__)
337 #define CsrWifiNmeApStopIndCreate(msg__, dst__, src__, interfaceTag__, apType__, status__) \
338 msg__ = kmalloc(sizeof(CsrWifiNmeApStopInd), GFP_KERNEL); \
339 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_AP_PRIM, CSR_WIFI_NME_AP_STOP_IND, dst__, src__); \
340 msg__->interfaceTag = (interfaceTag__); \
341 msg__->apType = (apType__); \
342 msg__->status = (status__);
344 #define CsrWifiNmeApStopIndSendTo(dst__, src__, interfaceTag__, apType__, status__) \
346 CsrWifiNmeApStopInd *msg__; \
347 CsrWifiNmeApStopIndCreate(msg__, dst__, src__, interfaceTag__, apType__, status__); \
348 CsrSchedMessagePut(dst__, CSR_WIFI_NME_AP_PRIM, msg__); \
351 #define CsrWifiNmeApStopIndSend(dst__, interfaceTag__, apType__, status__) \
352 CsrWifiNmeApStopIndSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, interfaceTag__, apType__, status__)
370 #define CsrWifiNmeApStopCfmCreate(msg__, dst__, src__, interfaceTag__, status__) \
371 msg__ = kmalloc(sizeof(CsrWifiNmeApStopCfm), GFP_KERNEL); \
372 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_AP_PRIM, CSR_WIFI_NME_AP_STOP_CFM, dst__, src__); \
373 msg__->interfaceTag = (interfaceTag__); \
374 msg__->status = (status__);
376 #define CsrWifiNmeApStopCfmSendTo(dst__, src__, interfaceTag__, status__) \
378 CsrWifiNmeApStopCfm *msg__; \
379 CsrWifiNmeApStopCfmCreate(msg__, dst__, src__, interfaceTag__, status__); \
380 CsrSchedMessagePut(dst__, CSR_WIFI_NME_AP_PRIM, msg__); \
383 #define CsrWifiNmeApStopCfmSend(dst__, interfaceTag__, status__) \
384 CsrWifiNmeApStopCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, interfaceTag__, status__)
403 #define CsrWifiNmeApWmmParamUpdateReqCreate(msg__, dst__, src__, wmmApParams__, wmmApBcParams__) \
404 msg__ = kmalloc(sizeof(CsrWifiNmeApWmmParamUpdateReq), GFP_KERNEL); \
405 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_AP_PRIM, CSR_WIFI_NME_AP_WMM_PARAM_UPDATE_REQ, dst__, src__); \
406 memcpy(msg__->wmmApParams, (wmmApParams__), sizeof(CsrWifiSmeWmmAcParams) * 4); \
407 memcpy(msg__->wmmApBcParams, (wmmApBcParams__), sizeof(CsrWifiSmeWmmAcParams) * 4);
409 #define CsrWifiNmeApWmmParamUpdateReqSendTo(dst__, src__, wmmApParams__, wmmApBcParams__) \
411 CsrWifiNmeApWmmParamUpdateReq *msg__; \
412 CsrWifiNmeApWmmParamUpdateReqCreate(msg__, dst__, src__, wmmApParams__, wmmApBcParams__); \
413 CsrMsgTransport(dst__, CSR_WIFI_NME_AP_PRIM, msg__); \
416 #define CsrWifiNmeApWmmParamUpdateReqSend(src__, wmmApParams__, wmmApBcParams__) \
417 CsrWifiNmeApWmmParamUpdateReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, wmmApParams__, wmmApBcParams__)
432 #define CsrWifiNmeApWmmParamUpdateCfmCreate(msg__, dst__, src__, status__) \
433 msg__ = kmalloc(sizeof(CsrWifiNmeApWmmParamUpdateCfm), GFP_KERNEL); \
434 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_AP_PRIM, CSR_WIFI_NME_AP_WMM_PARAM_UPDATE_CFM, dst__, src__); \
435 msg__->status = (status__);
437 #define CsrWifiNmeApWmmParamUpdateCfmSendTo(dst__, src__, status__) \
439 CsrWifiNmeApWmmParamUpdateCfm *msg__; \
440 CsrWifiNmeApWmmParamUpdateCfmCreate(msg__, dst__, src__, status__); \
441 CsrSchedMessagePut(dst__, CSR_WIFI_NME_AP_PRIM, msg__); \
444 #define CsrWifiNmeApWmmParamUpdateCfmSend(dst__, status__) \
445 CsrWifiNmeApWmmParamUpdateCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, status__)
470 #define CsrWifiNmeApWpsRegisterReqCreate(msg__, dst__, src__, interfaceTag__, selectedDevicePasswordId__, selectedConfigMethod__, pin__) \
471 msg__ = kmalloc(sizeof(CsrWifiNmeApWpsRegisterReq), GFP_KERNEL); \
472 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_AP_PRIM, CSR_WIFI_NME_AP_WPS_REGISTER_REQ, dst__, src__); \
473 msg__->interfaceTag = (interfaceTag__); \
474 msg__->selectedDevicePasswordId = (selectedDevicePasswordId__); \
475 msg__->selectedConfigMethod = (selectedConfigMethod__); \
476 memcpy(msg__->pin, (pin__), sizeof(u8) * 8);
478 #define CsrWifiNmeApWpsRegisterReqSendTo(dst__, src__, interfaceTag__, selectedDevicePasswordId__, selectedConfigMethod__, pin__) \
480 CsrWifiNmeApWpsRegisterReq *msg__; \
481 CsrWifiNmeApWpsRegisterReqCreate(msg__, dst__, src__, interfaceTag__, selectedDevicePasswordId__, selectedConfigMethod__, pin__); \
482 CsrMsgTransport(dst__, CSR_WIFI_NME_AP_PRIM, msg__); \
485 #define CsrWifiNmeApWpsRegisterReqSend(src__, interfaceTag__, selectedDevicePasswordId__, selectedConfigMethod__, pin__) \
486 CsrWifiNmeApWpsRegisterReqSendTo(CSR_WIFI_NME_IFACEQUEUE, src__, interfaceTag__, selectedDevicePasswordId__, selectedConfigMethod__, pin__)
502 #define CsrWifiNmeApWpsRegisterCfmCreate(msg__, dst__, src__, interfaceTag__, status__) \
503 msg__ = kmalloc(sizeof(CsrWifiNmeApWpsRegisterCfm), GFP_KERNEL); \
504 CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_AP_PRIM, CSR_WIFI_NME_AP_WPS_REGISTER_CFM, dst__, src__); \
505 msg__->interfaceTag = (interfaceTag__); \
506 msg__->status = (status__);
508 #define CsrWifiNmeApWpsRegisterCfmSendTo(dst__, src__, interfaceTag__, status__) \
510 CsrWifiNmeApWpsRegisterCfm *msg__; \
511 CsrWifiNmeApWpsRegisterCfmCreate(msg__, dst__, src__, interfaceTag__, status__); \
512 CsrSchedMessagePut(dst__, CSR_WIFI_NME_AP_PRIM, msg__); \
515 #define CsrWifiNmeApWpsRegisterCfmSend(dst__, interfaceTag__, status__) \
516 CsrWifiNmeApWpsRegisterCfmSendTo(dst__, CSR_WIFI_NME_IFACEQUEUE, interfaceTag__, status__)