2 * Copyright (C) 2014 The Android Open Source Project
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
25 #endif /* __cplusplus */
27 /*****************************************************************************
28 * NAN Discovery Service Structures and Functions
29 *****************************************************************************/
33 All multi-byte fields within all NAN protocol stack messages are assumed to be in Little Endian order.
36 typedef int NanVersion;
38 #define NAN_MAC_ADDR_LEN 6
39 #define NAN_COUNTRY_STRING_LEN 3
40 #define NAN_MAJOR_VERSION 1
41 #define NAN_MINOR_VERSION 0
42 #define NAN_MICRO_VERSION 0
44 /* NAN Maximum Lengths */
45 #define NAN_MAX_SERVICE_NAME_LEN 255
46 #define NAN_MAX_MATCH_FILTER_LEN 255
47 #define NAN_MAX_SERVICE_SPECIFIC_INFO_LEN 1024
50 Definition of various NanRequestType
53 NAN_REQUEST_ENABLE =0,
54 NAN_REQUEST_DISABLE =1,
55 NAN_REQUEST_PUBLISH =2,
56 NAN_REQUEST_PUBLISH_CANCEL =3,
57 NAN_REQUEST_TRANSMIT_FOLLOWUP =4,
58 NAN_REQUEST_SUBSCRIBE =5,
59 NAN_REQUEST_SUBSCRIBE_CANCEL =6,
61 NAN_REQUEST_CONFIG =8,
63 NAN_REQUEST_LAST =0xFFFF
67 Definition of various NanResponseType
70 NAN_RESPONSE_ENABLED =0,
71 NAN_RESPONSE_DISABLED =1,
72 NAN_RESPONSE_PUBLISH =2,
73 NAN_RESPONSE_PUBLISH_CANCEL =3,
74 NAN_RESPONSE_TRANSMIT_FOLLOWUP =4,
75 NAN_RESPONSE_SUBSCRIBE =5,
76 NAN_RESPONSE_SUBSCRIBE_CANCEL =6,
77 NAN_RESPONSE_STATS =7,
78 NAN_RESPONSE_CONFIG =8,
80 NAN_RESPONSE_ERROR =10,
81 NAN_RESPONSE_UNKNOWN =0xFFFF
85 Definition of various NanIndication(events)
88 NAN_INDICATION_PUBLISH_REPLIED =0,
89 NAN_INDICATION_PUBLISH_TERMINATED =1,
90 NAN_INDICATION_SUBSCRIBE_MATCH =2,
91 NAN_INDICATION_SUBSCRIBE_UNMATCH =3,
92 NAN_INDICATION_SUBSCRIBE_TERMINATED =4,
93 NAN_INDICATION_DE_EVENT =5,
94 NAN_INDICATION_FOLLOWUP =6,
95 NAN_INDICATION_DISABLED =7,
96 NAN_INDICATION_TCA =8,
97 NAN_INDICATION_UNKNOWN =0xFFFF
101 /* NAN Publish Types */
103 NAN_PUBLISH_TYPE_UNSOLICITED = 0,
104 NAN_PUBLISH_TYPE_SOLICITED,
105 NAN_PUBLISH_TYPE_UNSOLICITED_SOLICITED,
106 NAN_PUBLISH_TYPE_LAST,
109 /* NAN Transmit Priorities */
111 NAN_TX_PRIORITY_LOW = 0,
112 NAN_TX_PRIORITY_NORMAL,
113 NAN_TX_PRIORITY_HIGH,
117 /* NAN Statistics Request ID Codes */
120 NAN_STATS_ID_FIRST = 0,
121 NAN_STATS_ID_DE_PUBLISH = NAN_STATS_ID_FIRST,
122 NAN_STATS_ID_DE_SUBSCRIBE,
124 NAN_STATS_ID_DE_TIMING_SYNC,
130 /* NAN Protocol Event ID Codes */
133 NAN_EVENT_ID_FIRST = 0,
134 NAN_EVENT_ID_SELF_STA_MAC_ADDR = NAN_EVENT_ID_FIRST,
135 NAN_EVENT_ID_STARTED_CLUSTER,
136 NAN_EVENT_ID_JOINED_CLUSTER,
143 NAN_TCA_ID_FIRST = 0,
144 NAN_TCA_ID_CLUSTER_SIZE = NAN_TCA_ID_FIRST,
149 Various NAN Protocol Response code
153 /* NAN Protocol Response Codes */
154 NAN_STATUS_SUCCESS = 0,
156 NAN_STATUS_DE_FAILURE,
157 NAN_STATUS_INVALID_MSG_VERSION,
158 NAN_STATUS_INVALID_MSG_LEN,
159 NAN_STATUS_INVALID_MSG_ID,
160 NAN_STATUS_INVALID_HANDLE,
161 NAN_STATUS_NO_SPACE_AVAILABLE,
162 NAN_STATUS_INVALID_PUBLISH_TYPE,
163 NAN_STATUS_INVALID_TX_TYPE,
164 NAN_STATUS_INVALID_MATCH_ALGORITHM,
165 NAN_STATUS_DISABLE_IN_PROGRESS,
166 NAN_STATUS_INVALID_TLV_LEN,
167 NAN_STATUS_INVALID_TLV_TYPE,
168 NAN_STATUS_MISSING_TLV_TYPE,
169 NAN_STATUS_INVALID_TOTAL_TLVS_LEN,
170 NAN_STATUS_INVALID_MATCH_HANDLE,
171 NAN_STATUS_INVALID_TLV_VALUE,
172 NAN_STATUS_INVALID_TX_PRIORITY,
173 NAN_STATUS_INVALID_TCA_ID,
174 NAN_STATUS_INVALID_STATS_ID,
176 /* NAN Configuration Response codes */
177 NAN_STATUS_INVALID_RSSI_CLOSE_VALUE = 128,
178 NAN_STATUS_INVALID_RSSI_MEDIUM_VALUE,
179 NAN_STATUS_INVALID_HOP_COUNT_LIMIT,
180 NAN_STATUS_INVALID_CLUSTER_JOIN_COUNT,
181 NAN_STATUS_INVALID_MIN_WAKE_DW_DURATION_VALUE,
182 NAN_STATUS_INVALID_OFDM_DATA_RATE_VALUE,
183 NAN_STATUS_INVALID_RANDOM_FACTOR_UPDATE_TIME_VALUE,
184 NAN_STATUS_INVALID_MASTER_PREFERENCE_VALUE,
185 NAN_STATUS_INVALID_EARLY_DW_WAKE_INTERVAL_VALUE,
186 NAN_STATUS_INVALID_LOW_CLUSTER_ID_VALUE,
187 NAN_STATUS_INVALID_HIGH_CLUSTER_ID_VALUE,
188 NAN_STATUS_INVALID_INITIAL_SCAN_PERIOD,
189 NAN_STATUS_INVALID_ONGOING_SCAN_PERIOD,
190 NAN_STATUS_INVALID_RSSI_PROXIMITY_VALUE
194 Various NAN Terminated Indication Code
198 NAN_TERMINATED_REASON_INVALID = 0,
199 NAN_TERMINATED_REASON_TIMEOUT,
200 NAN_TERMINATED_REASON_USER_REQUEST,
201 NAN_TERMINATED_REASON_FAILURE,
202 NAN_TERMINATED_REASON_COUNT_REACHED,
203 NAN_TERMINATED_REASON_DE_SHUTDOWN,
204 NAN_TERMINATED_REASON_DISABLE_IN_PROGRESS
205 } NanTerminatedStatus;
207 /* NAN Transmit Types */
210 NAN_TX_TYPE_BROADCAST = 0,
215 /* NAN Subscribe Type Bit */
216 #define NAN_SUBSCRIBE_TYPE_PASSIVE 0
217 #define NAN_SUBSCRIBE_TYPE_ACTIVE 1
219 /* NAN Service Response Filter Attribute Bit */
220 #define NAN_SRF_ATTR_BLOOM_FILTER 0
221 #define NAN_SRF_ATTR_PARTIAL_MAC_ADDR 1
223 /* NAN Service Response Filter Include Bit */
224 #define NAN_SRF_INCLUDE_DO_NOT_RESPOND 0
225 #define NAN_SRF_INCLUDE_RESPOND 1
227 /* NAN Match Algorithms */
230 NAN_MATCH_ALG_FIRST = 0,
231 NAN_MATCH_ALG_MATCH_ONCE = NAN_MATCH_ALG_FIRST,
232 NAN_MATCH_ALG_MATCH_CONTINUOUS,
239 16-bit quantity which is allocated by the FW.
240 Pass the Handle as 0xFFFF if the Host would like to set up a new
241 Publish/Subscribe and the FW will pass back a valid handle in response msg.
242 To update an already opened Publish/Subscribe Host can pass a Handle
243 which has already been allocated by the FW.
248 16-bit quantity which is allocated in 2 contexts. For all Request
249 messages the TransactionId is allocated by the Service Layer and
250 passed down to the DE. In all Indication messages the TransactionId
251 field is allocated by the DE. There is no correlation between the
252 TransactionIds allocated by the Service Layer and those allocated by the DE
258 Enable Request Message Structure
259 The NanEnableReq message instructs the Discovery Engine to enter an operational state
263 u8 support_5g; /* default = 0 */
264 u16 cluster_low; /* default = 0 */
265 u16 cluster_high; /* default = 0 */
266 u8 sid_beacon; /* default = 0x80 */
267 u8 sync_disc_5g; /* default = 1 i.e 5G Discovery frames only*/
268 u8 rssi_close; /* default = 60 (-60 dBm) */
269 u8 rssi_middle; /* default = 70 (-70 dBm) */
270 u8 rssi_proximity; /* default = 70 (-70 dBm) */
271 u8 hop_count_limit; /* default = 2 */
272 u8 random_time; /* default = 120 (DWs) */
273 u8 master_pref; /* default = 0 */
274 u8 periodic_scan_interval; /* default = 20 seconds */
275 /* TBD: Google specific IE */
279 Disable Request Message Structure
280 The NanDisableReq message instructs the Discovery Engine to exit an operational state.
287 Publish Msg Structure
288 Message is used to request the DE to publish the Service Name
289 using the parameters passed into the Discovery Window
293 u16 ttl; /* how many seconds to run for. 0 means forever until canceled */
294 u16 period; /* periodicity of OTA unsolicited publish. Specified in increments of 500 ms */
295 u8 replied_event_flag; /* 1= RepliedEventInd needed, 0 = Not needed */
296 NanPublishType publish_type;/* 0= unsolicited, solicited = 1, 2= both */
297 NanTxType tx_type; /* 0 = broadcast, 1= unicast if solicited publish */
298 u8 publish_count; /* number of OTA Publish, 0 means forever until canceled */
299 u16 service_name_len; /* length of service name */
300 u8 service_name[NAN_MAX_SERVICE_NAME_LEN];/* UTF-8 encoded string identifying the service */
302 /* Sequence of values which should be conveyed to the Discovery Engine of a
303 NAN Device that has invoked a Subscribe method corresponding to this Publish method
305 u16 service_specific_info_len;
306 u8 service_specific_info[NAN_MAX_SERVICE_SPECIFIC_INFO_LEN];
308 /* Ordered sequence of <length, value> pairs which specify further response conditions
309 beyond the service name used to filter subscribe messages to respond to.
310 This is only needed when the PT is set to NAN_SOLICITED or NAN_SOLICITED_UNSOLICITED.
312 u16 rx_match_filter_len;
313 u8 rx_match_filter[NAN_MAX_MATCH_FILTER_LEN];
315 /* Ordered sequence of <length, value> pairs to be included in the Discovery Frame.
316 If present it is always sent in a Discovery Frame
318 u16 tx_match_filter_len;
319 u8 tx_match_filter[NAN_MAX_MATCH_FILTER_LEN];
323 Publish Cancel Msg Structure
324 The PublishServiceCancelReq Message is used to request the DE to stop publishing
325 the Service Name identified by the handle in the message.
329 }NanPublishCancelRequest;
332 NAN Subscribe Structure
333 The SubscribeServiceReq message is sent to the Discovery Engine
334 whenever the Upper layers would like to listen for a Service Name
338 u16 ttl; /* how many seconds to run for. 0 means forever until canceled */
339 u16 period;/* periodicity of OTA Active Subscribe. Units in increments of 500 ms , 0 = attempt every DW*/
341 /* Flag which specifies how the Subscribe request shall be processed. */
342 u8 subscribe_type; /* 0 - PASSIVE , 1- ACTIVE */
344 /* Flag which specifies on Active Subscribes how the Service Response Filter attribute is populated.*/
345 u8 serviceResponseFilter; /* 0 - Bloom Filter, 1 - MAC Addr */
347 /* Flag which specifies how the Service Response Filter Include bit is populated.*/
348 u8 serviceResponseInclude; /* 0=Do not respond if in the Address Set, 1= Respond */
350 /* Flag which specifies if the Service Response Filter should be used when creating Subscribes.*/
351 u8 useServiceResponseFilter; /* 0=Do not send the Service Response Filter,1= send */
353 /* Flag which specifies if the Service Specific Info is needed in the Publish message before creating the MatchIndication*/
354 u8 ssiRequiredForMatchIndication; /* 0=Not needed, 1= Required */
356 /* Field which allows the matching behavior to be controlled. */
357 NanMatchAlg subscribe_match; /* 0 - Match Once, 1 - Match continuous */
359 /* The number of Subscribe Matches which should occur before the Subscribe request is automatically terminated.*/
360 u8 subscribe_count; /* If this value is 0 this field is not used by the DE.*/
362 u16 service_name_len;/* length of service name */
363 u8 service_name[NAN_MAX_SERVICE_NAME_LEN]; /* UTF-8 encoded string identifying the service */
365 /* Sequence of values which further specify the published service beyond the service name*/
366 u16 service_specific_info_len;
367 u8 service_specific_info[NAN_MAX_SERVICE_SPECIFIC_INFO_LEN];
369 /* Ordered sequence of <length, value> pairs used to filter out received publish discovery messages.
370 This can be sent both for a Passive or an Active Subscribe
372 u16 rx_match_filter_len;
373 u8 rx_match_filter[NAN_MAX_MATCH_FILTER_LEN];
375 /* Ordered sequence of <length, value> pairs included in the Discovery Frame when an Active Subscribe is used.*/
376 u16 tx_match_filter_len;
377 u8 tx_match_filter[NAN_MAX_MATCH_FILTER_LEN];
378 }NanSubscribeRequest;
382 NAN Subscribe Cancel Structure
383 The SubscribeCancelReq Message is used to request the DE to stop looking for the Service Name.
387 }NanSubscribeCancelRequest;
391 Transmit follow up Structure
392 The TransmitFollowupReq message is sent to the DE to allow the sending of the Service_Specific_Info
393 to a particular MAC address.
397 u8 addr[NAN_MAC_ADDR_LEN]; /* Can be a broadcast/multicast or unicast address */
398 NanTxPriority priority; /* priority of the request 0 = low, 1=normal, 2=high */
399 u8 dw_or_faw; /* 0= send in a DW, 1=send in FAW */
401 /* Sequence of values which further specify the published service beyond the service name
402 Treated as service specific info in case dw_or_faw is set to 0
403 Treated as extended service specific info in case dw_or_faw is set to non-zero*/
404 u16 service_specific_info_len;
405 u8 service_specific_info[NAN_MAX_SERVICE_SPECIFIC_INFO_LEN];
406 }NanTransmitFollowupRequest;
409 Stats Request structure
410 The Discovery Engine can be queried at runtime by the Host processor for statistics
411 concerning various parts of the Discovery Engine.
415 NanStatsId stats_id; /* NAN Statistics Request ID Codes */
416 u8 clear; /* 0= Do not clear the stats and return the current contents , 1= Clear the associated stats */
421 The NanConfigurationReq message is sent by the Host to the
422 Discovery Engine in order to configure the Discovery Engine during runtime.
426 u8 sid_beacon; /* default = 0x80 */
427 u8 sync_disc_5g; /* default = 1 i.e 5G Discovery frames only*/
428 u8 rssi_proximity; /* default = 70 (-70 dBm) */
429 u8 random_time; /* default = 120 (DWs) */
430 u8 master_pref; /* default = 0 */
431 u8 periodic_scan_interval; /* default = 20 seconds */
432 /* The number of Additional Discovery Window slots in
433 increments of 16 ms. Since each DW is 512 TUs apart
434 and the DW takes up 1 slot, the maximum number of additional
435 slots which can be specified is 31. This is a hint to the
436 scheduler and there is no guarantee that all 31 slots will
437 be available because of MCC and BT Coexistence channel usage
439 u8 additional_disc_window_slots; /* default = 0.*/
444 The Discovery Engine can be configured to send up Events whenever a configured
445 Threshold Crossing Alert (TCA) Id crosses an integral threshold in a particular direction.
449 NanTcaId tca_id; /* Nan Protocol Threshold Crossing Alert (TCA) Codes */
451 /* flag which control whether or not an event is generated for the Rising direction */
452 u8 rising_direction_evt_flag; /* 0 - no event, 1 - event */
454 /* flag which control whether or not an event is generated for the Falling direction */
455 u8 falling_direction_evt_flag;/* 0 - no event, 1 - event */
457 /* flag which requests a previous TCA request to be cleared from the DE */
458 u8 clear;/*0= Do not clear the TCA, 1=Clear the TCA */
460 /* 32 bit value which represents the threshold to be used.*/
464 /* Publish statistics. */
467 u32 validPublishServiceReqMsgs;
468 u32 validPublishServiceRspMsgs;
469 u32 validPublishServiceCancelReqMsgs;
470 u32 validPublishServiceCancelRspMsgs;
471 u32 validPublishRepliedIndMsgs;
472 u32 validPublishTerminatedIndMsgs;
473 u32 validActiveSubscribes;
476 u32 invalidPublishServiceReqMsgs;
477 u32 invalidPublishServiceCancelReqMsgs;
478 u32 invalidActiveSubscribes;
480 u32 invalidFollowups;
484 /* Subscribe statistics. */
487 u32 validSubscribeServiceReqMsgs;
488 u32 validSubscribeServiceRspMsgs;
489 u32 validSubscribeServiceCancelReqMsgs;
490 u32 validSubscribeServiceCancelRspMsgs;
491 u32 validSubscribeTerminatedIndMsgs;
492 u32 validSubscribeMatchIndMsgs;
493 u32 validSubscribeUnmatchIndMsgs;
494 u32 validSolicitedPublishes;
497 u32 invalidSubscribeServiceReqMsgs;
498 u32 invalidSubscribeServiceCancelReqMsgs;
499 u32 invalidSubscribeFollowupReqMsgs;
500 u32 invalidSolicitedPublishes;
502 u32 invalidFollowups;
504 u32 bloomFilterIndex;
507 /* NAN MAC Statistics. Used for MAC and DW statistics. */
512 u32 validActionFrames;
513 u32 validBeaconFrames;
514 u32 ignoredActionFrames;
515 u32 ignoredBeaconFrames;
517 u32 invalidActionFrames;
518 u32 invalidBeaconFrames;
519 u32 invalidMacHeaders;
520 u32 invalidPafHeaders;
521 u32 nonNanBeaconFrames;
523 u32 earlyActionFrames;
524 u32 inDwActionFrames;
525 u32 lateActionFrames;
529 u32 totalTRSpUpdates;
531 u32 completeByTp75DW;
532 u32 completeByTendDW;
533 u32 lateActionFramesTx;
535 /* Misc stats - ignored for DW. */
540 u32 bloomFilterIndex;
543 /* NAN Sync Statistics*/
556 u64 timeSpentInCurrRole;
557 u64 totalTimeSpentAsMaster;
558 u64 totalTimeSpentAsNonMasterSync;
559 u64 totalTimeSpentAsNonMasterNonSync;
560 u32 transitionsToAnchorMaster;
561 u32 transitionsToMaster;
562 u32 transitionsToNonMasterSync;
563 u32 transitionsToNonMasterNonSync;
565 u32 amrUpdateRankChangedCount;
566 u32 amrUpdateBTTChangedCount;
567 u32 amrUpdateHcChangedCount;
568 u32 amrUpdateNewDeviceCount;
571 u32 beaconsAboveHcLimit;
572 u32 beaconsBelowRssiThresh;
573 u32 beaconsIgnoredNoSpace;
574 u32 beaconsForOurCluster;
575 u32 beaconsForOtherCluster;
576 u32 beaconCancelRequests;
577 u32 beaconCancelFailures;
578 u32 beaconUpdateRequests;
579 u32 beaconUpdateFailures;
580 u32 syncBeaconTxAttempts;
581 u32 discBeaconTxAttempts;
584 /* NAN Misc DE Statistics */
587 u32 validErrorRspMsgs;
588 u32 validTransmitFollowupReqMsgs;
589 u32 validTransmitFollowupRspMsgs;
590 u32 validFollowupIndMsgs;
591 u32 validConfigurationReqMsgs;
592 u32 validConfigurationRspMsgs;
593 u32 validStatsReqMsgs;
594 u32 validStatsRspMsgs;
595 u32 validEnableReqMsgs;
596 u32 validEnableRspMsgs;
597 u32 validDisableReqMsgs;
598 u32 validDisableRspMsgs;
599 u32 validDisableIndMsgs;
600 u32 validEventIndMsgs;
604 u32 invalidTransmitFollowupReqMsgs;
605 u32 invalidConfigurationReqMsgs;
606 u32 invalidStatsReqMsgs;
607 u32 invalidEnableReqMsgs;
608 u32 invalidDisableReqMsgs;
609 u32 invalidTcaReqMsgs;
613 Stats Response Message structure
614 The Discovery Engine response to a request by the Host for statistics.
619 NanPublishStats publish_stats;
620 NanSubscribeStats subscribe_stats;
621 NanMacStats mac_stats;
622 NanSyncStats sync_stats;
628 NAN Response messages
632 u16 status; /* contains the result code */
633 u16 value; /* For error returns the value is returned which was in error */
634 NanResponseType response_type; /* NanResponseType Definitions */
636 NanStatsResponse stats_response;
642 Publish Replied Indication
643 The PublishRepliedInd Message is sent by the DE when an Active Subscribe is
644 received over the air and it matches a Solicited PublishServiceReq which had
645 been created with the replied_event_flag set.
649 u8 addr[NAN_MAC_ADDR_LEN];
650 }NanPublishRepliedInd;
654 The PublishTerminatedInd message is sent by the DE whenever a Publish
655 terminates from a user-specified timeout or a unrecoverable error in the DE.
659 NanTerminatedStatus reason;
660 }NanPublishTerminatedInd;
663 Subscribe Match Indication
664 The SubscribeMatchInd message is sent once per responding MAC address whenever
665 the Discovery Engine detects a match for a previous SubscribeServiceReq.
670 /* a 16 bit Handle which is sent to the Application. This handle will be sent in any subsequent
671 UnmatchInd messages rather than resending the Match_Filter/Service_Specific_Info TLVs
672 The Match_Handle is a DE resource and it is of limited quantity. In the event that the DE
673 runs out of Match_Handles the DE will still send the SubscribeMatchInd message but will
674 set the Match_Handle to MATCH_HANDLE_MATCH_POOL_EXHAUSTED=0xFFFF
677 u8 addr[NAN_MAC_ADDR_LEN];
679 /* Sequence of octets which were received in a Discovery Frame matching this
681 u16 service_specific_info_len;
682 u8 service_specific_info[NAN_MAX_SERVICE_NAME_LEN];
684 /* Ordered sequence of <length, value> pairs received in the Discovery Frame
685 matching this Subscribe Request.*/
686 u16 sdf_match_filter_len;
687 u8 sdf_match_filter[NAN_MAX_MATCH_FILTER_LEN];
688 }NanSubscribeMatchInd;
692 The SubscribeUnmatchInd message is sent whenever the Discovery Engine detects that
693 a previously Matched Subscribed Service Name has been gone for too long.
694 If the previous SubscribeMatchInd message contained a Match_Handle equal to
695 MATCH_HANDLE_MATCH_POOL_EXHAUSTED then this message will not be sent to the Host.
699 /* 16 bit value sent by the DE in a previous SubscribeMatchInd to the application. */
701 }NanSubscribeUnmatchInd;
705 The SubscribeTerminatedInd message is sent by the DE whenever a
706 Subscribe terminates from a user-specified timeout or a unrecoverable error in the DE.
710 NanTerminatedStatus reason;
711 }NanSubscribeTerminatedInd;
714 Followup Indication Message
715 The FollowupInd message is sent by the DE to the Host whenever it receives a
716 Followup message from another peer.
720 u8 addr[NAN_MAC_ADDR_LEN];
722 /* Flag which the DE uses to decide if received in a DW or a FAW*/
723 u8 dw_or_faw; /* 0=Received in a DW, 1 = Received in a FAW*/
725 /* Sequence of values which further specify the published service beyond the service name
726 Service specific info in case dw_or_faw is set to 0
727 Extended service specific info in case dw_or_faw is set to non-zero*/
728 u16 service_specific_info_len;
729 u8 service_specific_info[NAN_MAX_SERVICE_SPECIFIC_INFO_LEN];
732 /* Selfstaevent data*/
734 u8 addr[NAN_MAC_ADDR_LEN];
737 /* joined or Started cluster data*/
739 u8 addr[NAN_MAC_ADDR_LEN];
740 }NanClusterEventData;
743 Discovery Engine Event Indication
744 The Discovery Engine can inform the Host when significant events occur
745 The data following the EventId is dependent upon the EventId type.
746 In other words, each new event defined will carry a different
747 structure of information back to the host.
751 NanEventId event_id; /* NAN Protocol Event Codes */
753 /* SelfStaEvent which will have 6 byte mac address
754 of the Discovery engine.*/
755 NanSelfStaEvent self_sta;
756 /* Cluster Event Data which will be obtained when the
757 device starts a new cluster or joins a cluster.
758 The event data will have 6 byte octet string of the
759 cluster started or joined.*/
760 NanClusterEventData cluster;
764 /* Cluster size TCA data*/
771 The Discovery Engine can inform the Host when significant events occur.
772 The data following the TcaId is dependent upon the TcaId type.
773 In other words, each new event defined will carry a different structure
774 of information back to the host.
780 /* This event in obtained when the cluser size threshold
781 is crossed. Event will have the cluster size */
782 NanTcaClusterData cluster;
787 NAN Disabled Indication
788 The NanDisableInd message indicates to the upper layers that the Discovery
789 Engine has flushed all state and has been shutdown. When this message is received
790 the DE is guaranteed to have left the NAN cluster it was part of and will have terminated
791 any in progress Publishes or Subscribes.
795 NanStatusType reason;
798 /* Response and Event Callbacks */
800 /* NotifyResponse invoked to notify the status of the Request */
801 void (*NotifyResponse)(NanResponseMsg* rsp_data);
802 /* Various Events Callback */
803 void (*EventPublishReplied)(NanPublishRepliedInd* event);
804 void (*EventPublishTerminated)(NanPublishTerminatedInd* event);
805 void (*EventSubscribeMatch) (NanSubscribeMatchInd* event);
806 void (*EventSubscribeUnMatch) (NanSubscribeUnmatchInd* event);
807 void (*EventSubscribeTerminated) (NanSubscribeTerminatedInd* event);
808 void (*EventFollowup) (NanFollowupInd* event);
809 void (*EventDiscEngEvent) (NanDiscEngEventInd* event);
810 void (*EventDisabled) (NanDisabledInd* event);
811 void (*EventTca) (NanTCAInd* event);
812 } NanCallbackHandler;
815 /* Function to send NAN request to the wifi driver.*/
816 wifi_error nan_enable_request(wifi_request_id id,
818 NanEnableRequest* msg);
820 /* Function to send NAN request to the wifi driver.*/
821 wifi_error nan_disable_request(wifi_request_id id,
823 NanDisableRequest* msg);
825 /* Function to send NAN request to the wifi driver.*/
826 wifi_error nan_publish_request(wifi_request_id id,
828 NanPublishRequest* msg);
830 /* Function to send NAN request to the wifi driver.*/
831 wifi_error nan_publish_cancel_request(wifi_request_id id,
833 NanPublishCancelRequest* msg);
835 /* Function to send NAN request to the wifi driver.*/
836 wifi_error nan_subscribe_request(wifi_request_id id,
838 NanSubscribeRequest* msg);
840 /* Function to send NAN request to the wifi driver.*/
841 wifi_error nan_subscribe_cancel_request(wifi_request_id id,
843 NanSubscribeCancelRequest* msg);
845 /* Function to send NAN request to the wifi driver.*/
846 wifi_error nan_transmit_followup_request(wifi_request_id id,
848 NanTransmitFollowupRequest* msg);
850 /* Function to send NAN statistics request to the wifi driver.*/
851 wifi_error nan_stats_request(wifi_request_id id,
853 NanStatsRequest* msg);
855 /* Function to send NAN configuration request to the wifi driver.*/
856 wifi_error nan_config_request(wifi_request_id id,
858 NanConfigRequest* msg);
860 /* Function to send NAN request to the wifi driver.*/
861 wifi_error nan_tca_request(wifi_request_id id,
865 /* Function to register NAN callback */
866 wifi_error nan_register_handler(wifi_handle handle,
867 NanCallbackHandler handlers);
869 /* Function to get version of the NAN HAL */
870 wifi_error nan_get_version(wifi_handle handle,
871 NanVersion* version);
875 #endif /* __cplusplus */
877 #endif /* __NAN_H__ */