2 * Copyright (C) 2016 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 * Neighbour Aware Network 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;
37 typedef u16 transaction_id;
39 #define NAN_MAC_ADDR_LEN 6
40 #define NAN_MAJOR_VERSION 2
41 #define NAN_MINOR_VERSION 0
42 #define NAN_MICRO_VERSION 0
43 #define NAN_MAX_SOCIAL_CHANNELS 3
45 /* NAN Maximum Lengths */
46 #define NAN_MAX_SERVICE_NAME_LEN 255
47 #define NAN_MAX_MATCH_FILTER_LEN 255
48 #define NAN_MAX_SERVICE_SPECIFIC_INFO_LEN 1024
49 #define NAN_MAX_VSA_DATA_LEN 1024
50 #define NAN_MAX_MESH_DATA_LEN 32
51 #define NAN_MAX_INFRA_DATA_LEN 32
52 #define NAN_MAX_CLUSTER_ATTRIBUTE_LEN 255
53 #define NAN_MAX_SUBSCRIBE_MAX_ADDRESS 42
54 #define NAN_MAX_FAM_CHANNELS 32
55 #define NAN_MAX_POSTDISCOVERY_LEN 5
56 #define NAN_MAX_FRAME_DATA_LEN 504
59 Definition of various NanResponseType
62 NAN_RESPONSE_ENABLED = 0,
63 NAN_RESPONSE_DISABLED = 1,
64 NAN_RESPONSE_PUBLISH = 2,
65 NAN_RESPONSE_PUBLISH_CANCEL = 3,
66 NAN_RESPONSE_TRANSMIT_FOLLOWUP = 4,
67 NAN_RESPONSE_SUBSCRIBE = 5,
68 NAN_RESPONSE_SUBSCRIBE_CANCEL = 6,
69 NAN_RESPONSE_STATS = 7,
70 NAN_RESPONSE_CONFIG = 8,
72 NAN_RESPONSE_ERROR = 10,
73 NAN_RESPONSE_BEACON_SDF_PAYLOAD = 11,
74 NAN_GET_CAPABILITIES = 12
77 /* NAN Publish Types */
79 NAN_PUBLISH_TYPE_UNSOLICITED = 0,
80 NAN_PUBLISH_TYPE_SOLICITED,
81 NAN_PUBLISH_TYPE_UNSOLICITED_SOLICITED
84 /* NAN Transmit Priorities */
86 NAN_TX_PRIORITY_NORMAL = 0,
90 /* NAN Statistics Request ID Codes */
92 NAN_STATS_ID_DE_PUBLISH = 0,
93 NAN_STATS_ID_DE_SUBSCRIBE,
95 NAN_STATS_ID_DE_TIMING_SYNC,
100 /* NAN Protocol Event ID Codes */
102 NAN_EVENT_ID_DISC_MAC_ADDR = 0,
103 NAN_EVENT_ID_STARTED_CLUSTER,
104 NAN_EVENT_ID_JOINED_CLUSTER
105 } NanDiscEngEventType;
109 NAN_TCA_ID_CLUSTER_SIZE = 0
113 Various NAN Protocol Response code
116 /* NAN Protocol Response Codes */
117 NAN_STATUS_SUCCESS = 0,
118 NAN_STATUS_TIMEOUT = 1,
119 NAN_STATUS_DE_FAILURE = 2,
120 NAN_STATUS_INVALID_MSG_VERSION = 3,
121 NAN_STATUS_INVALID_MSG_LEN = 4,
122 NAN_STATUS_INVALID_MSG_ID = 5,
123 NAN_STATUS_INVALID_HANDLE = 6,
124 NAN_STATUS_NO_SPACE_AVAILABLE = 7,
125 NAN_STATUS_INVALID_PUBLISH_TYPE = 8,
126 NAN_STATUS_INVALID_TX_TYPE = 9,
127 NAN_STATUS_INVALID_MATCH_ALGORITHM = 10,
128 NAN_STATUS_DISABLE_IN_PROGRESS = 11,
129 NAN_STATUS_INVALID_TLV_LEN = 12,
130 NAN_STATUS_INVALID_TLV_TYPE = 13,
131 NAN_STATUS_MISSING_TLV_TYPE = 14,
132 NAN_STATUS_INVALID_TOTAL_TLVS_LEN = 15,
133 NAN_STATUS_INVALID_MATCH_HANDLE= 16,
134 NAN_STATUS_INVALID_TLV_VALUE = 17,
135 NAN_STATUS_INVALID_TX_PRIORITY = 18,
136 NAN_STATUS_INVALID_CONNECTION_MAP = 19,
137 NAN_STATUS_INVALID_TCA_ID = 20,
138 NAN_STATUS_INVALID_STATS_ID = 21,
139 NAN_STATUS_NAN_NOT_ALLOWED = 22,
140 NAN_STATUS_NO_OTA_ACK = 23,
141 NAN_STATUS_TX_FAIL = 24,
142 /* 25-4095 Reserved */
143 /* NAN Configuration Response codes */
144 NAN_STATUS_INVALID_RSSI_CLOSE_VALUE = 4096,
145 NAN_STATUS_INVALID_RSSI_MIDDLE_VALUE = 4097,
146 NAN_STATUS_INVALID_HOP_COUNT_LIMIT = 4098,
147 NAN_STATUS_INVALID_MASTER_PREFERENCE_VALUE = 4099,
148 NAN_STATUS_INVALID_LOW_CLUSTER_ID_VALUE = 4100,
149 NAN_STATUS_INVALID_HIGH_CLUSTER_ID_VALUE = 4101,
150 NAN_STATUS_INVALID_BACKGROUND_SCAN_PERIOD = 4102,
151 NAN_STATUS_INVALID_RSSI_PROXIMITY_VALUE = 4103,
152 NAN_STATUS_INVALID_SCAN_CHANNEL = 4104,
153 NAN_STATUS_INVALID_POST_NAN_CONNECTIVITY_CAPABILITIES_BITMAP = 4105,
154 NAN_STATUS_INVALID_FURTHER_AVAILABILITY_MAP_NUMCHAN_VALUE = 4106,
155 NAN_STATUS_INVALID_FURTHER_AVAILABILITY_MAP_DURATION_VALUE = 4107,
156 NAN_STATUS_INVALID_FURTHER_AVAILABILITY_MAP_CLASS_VALUE = 4108,
157 NAN_STATUS_INVALID_FURTHER_AVAILABILITY_MAP_CHANNEL_VALUE = 4109,
158 NAN_STATUS_INVALID_FURTHER_AVAILABILITY_MAP_AVAILABILITY_INTERVAL_BITMAP_VALUE = 4110,
159 NAN_STATUS_INVALID_FURTHER_AVAILABILITY_MAP_MAP_ID = 4111,
160 NAN_STATUS_INVALID_POST_NAN_DISCOVERY_CONN_TYPE_VALUE = 4112,
161 NAN_STATUS_INVALID_POST_NAN_DISCOVERY_DEVICE_ROLE_VALUE = 4113,
162 NAN_STATUS_INVALID_POST_NAN_DISCOVERY_DURATION_VALUE = 4114,
163 NAN_STATUS_INVALID_POST_NAN_DISCOVERY_BITMAP_VALUE = 4115,
164 NAN_STATUS_MISSING_FUTHER_AVAILABILITY_MAP = 4116,
165 NAN_STATUS_INVALID_BAND_CONFIG_FLAGS = 4117,
166 NAN_STATUS_INVALID_RANDOM_FACTOR_UPDATE_TIME_VALUE = 4118,
167 NAN_STATUS_INVALID_ONGOING_SCAN_PERIOD = 4119,
168 NAN_STATUS_INVALID_DW_INTERVAL_VALUE = 4120,
169 NAN_STATUS_INVALID_DB_INTERVAL_VALUE = 4121,
170 /* 4122-8191 RESERVED */
171 NAN_TERMINATED_REASON_INVALID = 8192,
172 NAN_TERMINATED_REASON_TIMEOUT = 8193,
173 NAN_TERMINATED_REASON_USER_REQUEST = 8194,
174 NAN_TERMINATED_REASON_FAILURE = 8195,
175 NAN_TERMINATED_REASON_COUNT_REACHED = 8196,
176 NAN_TERMINATED_REASON_DE_SHUTDOWN = 8197,
177 NAN_TERMINATED_REASON_DISABLE_IN_PROGRESS = 8198,
178 NAN_TERMINATED_REASON_POST_DISC_ATTR_EXPIRED = 8199,
179 NAN_TERMINATED_REASON_POST_DISC_LEN_EXCEEDED = 8200,
180 NAN_TERMINATED_REASON_FURTHER_AVAIL_MAP_EMPTY = 8201
183 /* NAN Transmit Types */
185 NAN_TX_TYPE_BROADCAST = 0,
189 /* NAN Subscribe Type */
191 NAN_SUBSCRIBE_TYPE_PASSIVE = 0,
192 NAN_SUBSCRIBE_TYPE_ACTIVE
195 /* NAN Service Response Filter Attribute Bit */
197 NAN_SRF_ATTR_BLOOM_FILTER = 0,
198 NAN_SRF_ATTR_PARTIAL_MAC_ADDR
201 /* NAN Service Response Filter Include Bit */
203 NAN_SRF_INCLUDE_DO_NOT_RESPOND = 0,
204 NAN_SRF_INCLUDE_RESPOND
207 /* NAN Match indication type */
209 NAN_MATCH_ALG_MATCH_ONCE = 0,
210 NAN_MATCH_ALG_MATCH_CONTINUOUS,
211 NAN_MATCH_ALG_MATCH_NEVER
214 /* NAN Transmit Window Type */
216 NAN_TRANSMIT_IN_DW = 0,
218 } NanTransmitWindowType;
220 /* NAN SRF State in Subscribe */
226 /* NAN Include SSI in MatchInd */
228 NAN_SSI_NOT_REQUIRED_IN_MATCH_IND = 0,
229 NAN_SSI_REQUIRED_IN_MATCH_IND
232 /* Nan/NDP Capabilites info */
234 u32 max_concurrent_nan_clusters;
237 u32 max_service_name_len;
238 u32 max_match_filter_len;
239 u32 max_total_match_filter_len;
240 u32 max_service_specific_info_len;
241 u32 max_vsa_data_len;
242 u32 max_mesh_data_len;
243 u32 max_ndi_interfaces;
244 u32 max_ndp_sessions;
245 u32 max_app_info_len;
249 Host can send Vendor specific attributes which the Discovery Engine can
250 enclose in Beacons and/or Service Discovery frames transmitted.
251 Below structure is used to populate that.
255 0 = transmit only in the next discovery window
256 1 = transmit in next 16 discovery window
258 u8 payload_transmit_flag;
260 Below flags will determine in which all frames
261 the vendor specific attributes should be included
263 u8 tx_in_discovery_beacon;
264 u8 tx_in_sync_beacon;
265 u8 tx_in_service_discovery;
266 /* Organizationally Unique Identifier */
269 vendor specific attribute to be transmitted
270 vsa_len : Length of the vsa data.
273 u8 vsa[NAN_MAX_VSA_DATA_LEN];
274 } NanTransmitVendorSpecificAttribute;
278 Discovery Engine will forward any Vendor Specific Attributes
279 which it received as part of this structure.
281 /* Mask to determine on which frames attribute was received */
282 #define RX_DISCOVERY_BEACON_MASK 0x01
283 #define RX_SYNC_BEACON_MASK 0x02
284 #define RX_SERVICE_DISCOVERY_MASK 0x04
287 Frames on which this vendor specific attribute
288 was received. Mask defined above
291 /* Organizationally Unique Identifier */
293 /* vendor specific attribute */
295 u8 vsa[NAN_MAX_VSA_DATA_LEN];
296 } NanReceiveVendorSpecificAttribute;
299 NAN Beacon SDF Payload Received structure
300 Discovery engine sends the details of received Beacon or
301 Service Discovery Frames as part of this structure.
306 u8 frame_data[NAN_MAX_FRAME_DATA_LEN];
307 } NanBeaconSdfPayloadReceive;
310 Host can set the Periodic scan parameters for each of the
311 3(6, 44, 149) Social channels. Only these channels are allowed
312 any other channels are rejected
315 NAN_CHANNEL_24G_BAND = 0,
316 NAN_CHANNEL_5G_BAND_LOW,
317 NAN_CHANNEL_5G_BAND_HIGH
321 Structure to set the Social Channel Scan parameters
322 passed as part of NanEnableRequest/NanConfigRequest
326 Dwell time of each social channel in milliseconds
327 NanChannelIndex corresponds to the respective channel
328 If time set to 0 then the FW default time will be used.
330 u8 dwell_time[NAN_MAX_SOCIAL_CHANNELS];
333 Scan period of each social channel in seconds
334 NanChannelIndex corresponds to the respective channel
335 If time set to 0 then the FW default time will be used.
337 u16 scan_period[NAN_MAX_SOCIAL_CHANNELS];
338 } NanSocialChannelScanParams;
341 Host can send Post Connectivity Capability attributes
342 to be included in Service Discovery frames transmitted
343 as part of this structure.
347 0 = transmit only in the next discovery window
348 1 = transmit in next 16 discovery window
350 u8 payload_transmit_flag;
351 /* 1 - Wifi Direct supported 0 - Not supported */
353 /* 1 - Wifi Direct Services supported 0 - Not supported */
354 u8 is_wfds_supported;
355 /* 1 - TDLS supported 0 - Not supported */
356 u8 is_tdls_supported;
357 /* 1 - IBSS supported 0 - Not supported */
358 u8 is_ibss_supported;
359 /* 1 - Mesh supported 0 - Not supported */
360 u8 is_mesh_supported;
362 1 - NAN Device currently connect to WLAN Infra AP
366 } NanTransmitPostConnectivityCapability;
369 Discovery engine providing the post connectivity capability
373 /* 1 - Wifi Direct supported 0 - Not supported */
375 /* 1 - Wifi Direct Services supported 0 - Not supported */
376 u8 is_wfds_supported;
377 /* 1 - TDLS supported 0 - Not supported */
378 u8 is_tdls_supported;
379 /* 1 - IBSS supported 0 - Not supported */
380 u8 is_ibss_supported;
381 /* 1 - Mesh supported 0 - Not supported */
382 u8 is_mesh_supported;
384 1 - NAN Device currently connect to WLAN Infra AP
388 } NanReceivePostConnectivityCapability;
391 Indicates the availability interval duration associated with the
392 Availability Intervals Bitmap field
395 NAN_DURATION_16MS = 0,
396 NAN_DURATION_32MS = 1,
397 NAN_DURATION_64MS = 2
400 /* Further availability per channel information */
403 NanAvailDuration entry_control;
405 1 byte field indicating the frequency band the NAN Device
406 will be available as defined in IEEE Std. 802.11-2012
407 Annex E Table E-4 Global Operating Classes
411 1 byte field indicating the channel the NAN Device
416 Map Id - 4 bit field which identifies the Further
417 availability map attribute.
421 divides the time between the beginnings of consecutive Discovery
422 Windows of a given NAN cluster into consecutive time intervals
423 of equal durations. The time interval duration is specified by
424 the Availability Interval Duration subfield of the Entry Control
427 A Nan device that sets the i-th bit of the Availability
428 Intervals Bitmap to 1 shall be present during the corresponding
429 i-th time interval in the operation channel indicated by the
430 Operating Class and Channel Number fields in the same Availability Entry.
432 A Nan device that sets the i-th bit of the Availability Intervals Bitmap to
433 0 may be present during the corresponding i-th time interval in the operation
434 channel indicated by the Operating Class and Channel Number fields in the same
437 The size of the Bitmap is dependent upon the Availability Interval Duration
438 chosen in the Entry Control Field. The size can be either 1, 2 or 4 bytes long
440 - Duration field is equal to 0, only AIB[0] is valid
441 - Duration field is equal to 1, only AIB [0] and AIB [1] is valid
442 - Duration field is equal to 2, AIB [0], AIB [1], AIB [2] and AIB [3] are valid
444 u32 avail_interval_bitmap;
445 } NanFurtherAvailabilityChannel;
448 Further availability map which can be sent and received from
453 Number of channels indicates the number of channel
454 entries which is part of fam
457 NanFurtherAvailabilityChannel famchan[NAN_MAX_FAM_CHANNELS];
458 } NanFurtherAvailabilityMap;
461 Host can send Post-Nan Discovery attributes which the Discovery Engine can
462 enclose in Service Discovery frames
464 /* Possible connection types in Post NAN Discovery attributes */
466 NAN_CONN_WLAN_INFRA = 0,
467 NAN_CONN_P2P_OPER = 1,
468 NAN_CONN_WLAN_IBSS = 2,
469 NAN_CONN_WLAN_MESH = 3,
470 NAN_CONN_FURTHER_SERVICE_AVAILABILITY = 4,
471 NAN_CONN_WLAN_RANGING = 5
474 /* Possible device roles in Post NAN Discovery attributes */
476 NAN_WLAN_INFRA_AP = 0,
477 NAN_WLAN_INFRA_STA = 1,
479 NAN_P2P_OPER_DEV = 3,
483 /* Structure of Post NAN Discovery attribute */
485 /* Connection type of the host */
486 NanConnectionType type;
488 Device role of the host based on
493 Flag to send the information as a single shot or repeated
494 for next 16 discovery windows
496 1 - next 16 discovery windows
499 /* Duration of the availability bitmask */
500 NanAvailDuration duration;
501 /* Availability interval bitmap based on duration */
502 u32 avail_interval_bitmap;
504 Mac address depending on the conn type and device role
505 --------------------------------------------------
506 | Conn Type | Device Role | Mac address Usage |
507 --------------------------------------------------
508 | WLAN_INFRA | AP/STA | BSSID of the AP |
509 --------------------------------------------------
510 | P2P_OPER | GO | GO's address |
511 --------------------------------------------------
512 | P2P_OPER | P2P_DEVICE | Address of who |
513 | | | would become GO |
514 --------------------------------------------------
515 | WLAN_IBSS | NA | BSSID |
516 --------------------------------------------------
517 | WLAN_MESH | NA | BSSID |
518 --------------------------------------------------
520 u8 addr[NAN_MAC_ADDR_LEN];
522 Mandatory mesh id value if connection type is WLAN_MESH
523 Mesh id contains 0-32 octet identifier and should be
524 as per IEEE Std.802.11-2012 spec.
527 u8 mesh_id[NAN_MAX_MESH_DATA_LEN];
529 Optional infrastructure SSID if conn_type is set to
532 u16 infrastructure_ssid_len;
533 u8 infrastructure_ssid_val[NAN_MAX_INFRA_DATA_LEN];
534 } NanTransmitPostDiscovery;
537 Discovery engine providing the structure of Post NAN
541 /* Connection type of the host */
542 NanConnectionType type;
544 Device role of the host based on
548 /* Duration of the availability bitmask */
549 NanAvailDuration duration;
550 /* Availability interval bitmap based on duration */
551 u32 avail_interval_bitmap;
553 Map Id - 4 bit field which identifies the Further
554 availability map attribute.
558 Mac address depending on the conn type and device role
559 --------------------------------------------------
560 | Conn Type | Device Role | Mac address Usage |
561 --------------------------------------------------
562 | WLAN_INFRA | AP/STA | BSSID of the AP |
563 --------------------------------------------------
564 | P2P_OPER | GO | GO's address |
565 --------------------------------------------------
566 | P2P_OPER | P2P_DEVICE | Address of who |
567 | | | would become GO |
568 --------------------------------------------------
569 | WLAN_IBSS | NA | BSSID |
570 --------------------------------------------------
571 | WLAN_MESH | NA | BSSID |
572 --------------------------------------------------
574 u8 addr[NAN_MAC_ADDR_LEN];
576 Mandatory mesh id value if connection type is WLAN_MESH
577 Mesh id contains 0-32 octet identifier and should be
578 as per IEEE Std.802.11-2012 spec.
581 u8 mesh_id[NAN_MAX_MESH_DATA_LEN];
583 Optional infrastructure SSID if conn_type is set to
586 u16 infrastructure_ssid_len;
587 u8 infrastructure_ssid_val[NAN_MAX_INFRA_DATA_LEN];
588 } NanReceivePostDiscovery;
591 Enable Request Message Structure
592 The NanEnableReq message instructs the Discovery Engine to enter an operational state
595 /* Mandatory parameters below */
598 A cluster_low value matching cluster_high indicates a request to join
599 a cluster with that value. If the requested cluster is not found the
600 device will start its own cluster.
606 Optional configuration of Enable request.
607 Each of the optional parameters have configure flag which
608 determine whether configuration is to be passed or not.
610 u8 config_support_5g;
613 BIT 0 is used to specify to include Service IDs in Sync/Discovery beacons
614 0 - Do not include SIDs in any beacons
615 1 - Include SIDs in all beacons.
616 Rest 7 bits are count field which allows control over the number of SIDs
617 included in the Beacon. 0 means to include as many SIDs that fit into
618 the maximum allow Beacon frame size
620 u8 config_sid_beacon;
623 The rssi values below should be specified without sign.
624 For eg: -70dBm should be specified as 70.
626 u8 config_2dot4g_rssi_close;
627 u8 rssi_close_2dot4g_val;
629 u8 config_2dot4g_rssi_middle;
630 u8 rssi_middle_2dot4g_val;
632 u8 config_2dot4g_rssi_proximity;
633 u8 rssi_proximity_2dot4g_val;
635 u8 config_hop_count_limit;
636 u8 hop_count_limit_val;
639 Defines 2.4G channel access support
643 u8 config_2dot4g_support;
644 u8 support_2dot4g_val;
646 Defines 2.4G channels will be used for sync/discovery beacons
647 0 - 2.4G channels not used for beacons
648 1 - 2.4G channels used for beacons
650 u8 config_2dot4g_beacons;
651 u8 beacon_2dot4g_val;
653 Defines 2.4G channels will be used for Service Discovery frames
654 0 - 2.4G channels not used for Service Discovery frames
655 1 - 2.4G channels used for Service Discovery frames
657 u8 config_2dot4g_sdf;
660 Defines 5G channels will be used for sync/discovery beacons
661 0 - 5G channels not used for beacons
662 1 - 5G channels used for beacons
664 u8 config_5g_beacons;
667 Defines 5G channels will be used for Service Discovery frames
668 0 - 5G channels not used for Service Discovery frames
669 1 - 5G channels used for Service Discovery frames
674 1 byte value which defines the RSSI in
675 dBm for a close by Peer in 5 Ghz channels.
676 The rssi values should be specified without sign.
677 For eg: -70dBm should be specified as 70.
679 u8 config_5g_rssi_close;
680 u8 rssi_close_5g_val;
682 1 byte value which defines the RSSI value in
683 dBm for a close by Peer in 5 Ghz channels.
684 The rssi values should be specified without sign.
685 For eg: -70dBm should be specified as 70.
688 u8 config_5g_rssi_middle;
689 u8 rssi_middle_5g_val;
691 1 byte value which defines the RSSI filter
692 threshold. Any Service Descriptors received above this
693 value that are configured for RSSI filtering will be dropped.
694 The rssi values should be specified without sign.
695 For eg: -70dBm should be specified as 70.
697 u8 config_5g_rssi_close_proximity;
698 u8 rssi_close_proximity_5g_val;
700 1 byte quantity which defines the window size over
701 which the
\93average RSSI
\94 will be calculated over.
703 u8 config_rssi_window_size;
704 u8 rssi_window_size_val;
706 The 24 bit Organizationally Unique ID + the 8 bit Network Id.
711 NAN Interface Address, If not configured the Discovery Engine
712 will generate a 6 byte Random MAC.
715 u8 intf_addr_val[NAN_MAC_ADDR_LEN];
717 If set to 1, the Discovery Engine will enclose the Cluster
718 Attribute only sent in Beacons in a Vendor Specific Attribute
719 and transmit in a Service Descriptor Frame.
721 u8 config_cluster_attribute_val;
723 The periodicity in seconds between full scan
\92s to find any new
724 clusters available in the area. A Full scan should not be done
725 more than every 10 seconds and should not be done less than every
728 u8 config_scan_params;
729 NanSocialChannelScanParams scan_params_val;
731 1 byte quantity which forces the Random Factor to a particular
732 value for all transmitted Sync/Discovery beacons
734 u8 config_random_factor_force;
735 u8 random_factor_force_val;
737 1 byte quantity which forces the HC for all transmitted Sync and
738 Discovery Beacon NO matter the real HC being received over the
741 u8 config_hop_count_force;
742 u8 hop_count_force_val;
744 /* channel frequency in MHz to enable Nan on */
745 u8 config_24g_channel;
746 wifi_channel channel_24g_val;
748 u8 config_5g_channel;
749 wifi_channel channel_5g_val;
753 Publish Msg Structure
754 Message is used to request the DE to publish the Service Name
755 using the parameters passed into the Discovery Window
758 u16 publish_id;/* id 0 means new publish, any other id is existing publish */
759 u16 ttl; /* how many seconds to run for. 0 means forever until canceled */
760 u16 period; /* periodicity of OTA unsolicited publish. Specified in increments of 500 ms */
761 NanPublishType publish_type;/* 0= unsolicited, solicited = 1, 2= both */
762 NanTxType tx_type; /* 0 = broadcast, 1= unicast if solicited publish */
763 u8 publish_count; /* number of OTA Publish, 0 means forever until canceled */
764 u16 service_name_len; /* length of service name */
765 u8 service_name[NAN_MAX_SERVICE_NAME_LEN];/* UTF-8 encoded string identifying the service */
767 Field which specifies how the matching indication to host is controlled.
768 0 - Match and Indicate Once
769 1 - Match and Indicate continuous
770 2 - Match and Indicate never. This means don't indicate the match to the host.
773 NanMatchAlg publish_match_indicator;
777 NAN Device that has invoked a Subscribe method corresponding to this Publish method
779 u16 service_specific_info_len;
780 u8 service_specific_info[NAN_MAX_SERVICE_SPECIFIC_INFO_LEN];
783 Ordered sequence of <length, value> pairs which specify further response conditions
784 beyond the service name used to filter subscribe messages to respond to.
785 This is only needed when the PT is set to NAN_SOLICITED or NAN_SOLICITED_UNSOLICITED.
787 u16 rx_match_filter_len;
788 u8 rx_match_filter[NAN_MAX_MATCH_FILTER_LEN];
791 Ordered sequence of <length, value> pairs to be included in the Discovery Frame.
792 If present it is always sent in a Discovery Frame
794 u16 tx_match_filter_len;
795 u8 tx_match_filter[NAN_MAX_MATCH_FILTER_LEN];
798 flag which specifies that the Publish should use the configured RSSI
799 threshold and the received RSSI in order to filter requests
800 0
\96 ignore the configured RSSI threshold when running a Service
801 Descriptor attribute or Service ID List Attribute through the DE matching logic.
802 1
\96 use the configured RSSI threshold when running a Service
803 Descriptor attribute or Service ID List Attribute through the DE matching logic.
806 u8 rssi_threshold_flag;
809 8-bit bitmap which allows the Host to associate this publish
810 with a particular Post-NAN Connectivity attribute
811 which has been sent down in a NanConfigureRequest/NanEnableRequest
812 message. If the DE fails to find a configured Post-NAN
813 connectivity attributes referenced by the bitmap,
814 the DE will return an error code to the Host.
815 If the Publish is configured to use a Post-NAN Connectivity
816 attribute and the Host does not refresh the Post-NAN Connectivity
817 attribute the Publish will be canceled and the Host will be sent
818 a PublishTerminatedIndication message.
822 Set/Enable corresponding bits to disable any indications that follow a publish.
823 BIT0 - Disable publish termination indication.
824 BIT1 - Disable match expired indication.
825 BIT2 - Disable followUp indication received (OTA).
827 u8 recv_indication_cfg;
831 Publish Cancel Msg Structure
832 The PublishServiceCancelReq Message is used to request the DE to stop publishing
833 the Service Name identified by the Publish Id in the message.
837 } NanPublishCancelRequest;
840 NAN Subscribe Structure
841 The SubscribeServiceReq message is sent to the Discovery Engine
842 whenever the Upper layers would like to listen for a Service Name
845 u16 subscribe_id; /* id 0 means new subscribe, non zero is existing subscribe */
846 u16 ttl; /* how many seconds to run for. 0 means forever until canceled */
847 u16 period;/* periodicity of OTA Active Subscribe. Units in increments of 500 ms , 0 = attempt every DW*/
849 /* Flag which specifies how the Subscribe request shall be processed. */
850 NanSubscribeType subscribe_type; /* 0 - PASSIVE , 1- ACTIVE */
852 /* Flag which specifies on Active Subscribes how the Service Response Filter attribute is populated.*/
853 NanSRFType serviceResponseFilter; /* 0 - Bloom Filter, 1 - MAC Addr */
855 /* Flag which specifies how the Service Response Filter Include bit is populated.*/
856 NanSRFIncludeType serviceResponseInclude; /* 0=Do not respond if in the Address Set, 1= Respond */
858 /* Flag which specifies if the Service Response Filter should be used when creating Subscribes.*/
859 NanSRFState useServiceResponseFilter; /* 0=Do not send the Service Response Filter,1= send */
862 Flag which specifies if the Service Specific Info is needed in
863 the Publish message before creating the MatchIndication
865 NanSsiInMatchInd ssiRequiredForMatchIndication; /* 0=Not needed, 1= Required */
868 Field which specifies how the matching indication to host is controlled.
869 0 - Match and Indicate Once
870 1 - Match and Indicate continuous
871 2 - Match and Indicate never. This means don't indicate the match to the host.
874 NanMatchAlg subscribe_match_indicator;
877 The number of Subscribe Matches which should occur
878 before the Subscribe request is automatically terminated.
880 u8 subscribe_count; /* If this value is 0 this field is not used by the DE.*/
882 u16 service_name_len;/* length of service name */
883 u8 service_name[NAN_MAX_SERVICE_NAME_LEN]; /* UTF-8 encoded string identifying the service */
885 /* Sequence of values which further specify the published service beyond the service name*/
886 u16 service_specific_info_len;
887 u8 service_specific_info[NAN_MAX_SERVICE_SPECIFIC_INFO_LEN];
890 Ordered sequence of <length, value> pairs used to filter out received publish discovery messages.
891 This can be sent both for a Passive or an Active Subscribe
893 u16 rx_match_filter_len;
894 u8 rx_match_filter[NAN_MAX_MATCH_FILTER_LEN];
897 Ordered sequence of <length, value> pairs included in the
898 Discovery Frame when an Active Subscribe is used.
900 u16 tx_match_filter_len;
901 u8 tx_match_filter[NAN_MAX_MATCH_FILTER_LEN];
904 Flag which specifies that the Subscribe should use the configured RSSI
905 threshold and the received RSSI in order to filter requests
906 0
\96 ignore the configured RSSI threshold when running a Service
907 Descriptor attribute or Service ID List Attribute through the DE matching logic.
908 1
\96 use the configured RSSI threshold when running a Service
909 Descriptor attribute or Service ID List Attribute through the DE matching logic.
912 u8 rssi_threshold_flag;
915 8-bit bitmap which allows the Host to associate this Active
916 Subscribe with a particular Post-NAN Connectivity attribute
917 which has been sent down in a NanConfigureRequest/NanEnableRequest
918 message. If the DE fails to find a configured Post-NAN
919 connectivity attributes referenced by the bitmap,
920 the DE will return an error code to the Host.
921 If the Subscribe is configured to use a Post-NAN Connectivity
922 attribute and the Host does not refresh the Post-NAN Connectivity
923 attribute the Subscribe will be canceled and the Host will be sent
924 a SubscribeTerminatedIndication message.
928 NAN Interface Address, conforming to the format as described in
929 8.2.4.3.2 of IEEE Std. 802.11-2012.
931 u8 num_intf_addr_present;
932 u8 intf_addr[NAN_MAX_SUBSCRIBE_MAX_ADDRESS][NAN_MAC_ADDR_LEN];
934 Set/Enable corresponding bits to disable indications that follow a subscribe.
935 BIT0 - Disable subscribe termination indication.
936 BIT1 - Disable match expired indication.
937 BIT2 - Disable followUp indication received (OTA).
939 u8 recv_indication_cfg;
940 } NanSubscribeRequest;
943 NAN Subscribe Cancel Structure
944 The SubscribeCancelReq Message is used to request the DE to stop looking for the Service Name.
948 } NanSubscribeCancelRequest;
951 Transmit follow up Structure
952 The TransmitFollowupReq message is sent to the DE to allow the sending of the Service_Specific_Info
953 to a particular MAC address.
956 /* Publish or Subscribe Id of an earlier Publish/Subscribe */
957 u16 publish_subscribe_id;
960 This Id is the Requestor Instance that is passed as
961 part of earlier MatchInd/FollowupInd message.
963 u32 requestor_instance_id;
964 u8 addr[NAN_MAC_ADDR_LEN]; /* Unicast address */
965 NanTxPriority priority; /* priority of the request 2=high */
966 NanTransmitWindowType dw_or_faw; /* 0= send in a DW, 1=send in FAW */
969 Sequence of values which further specify the published service beyond
972 u16 service_specific_info_len;
973 u8 service_specific_info[NAN_MAX_SERVICE_SPECIFIC_INFO_LEN];
975 Set/Enable corresponding bits to disable responses after followUp.
976 BIT0 - Disable followUp response from FW.
978 u8 recv_indication_cfg;
979 } NanTransmitFollowupRequest;
982 Stats Request structure
983 The Discovery Engine can be queried at runtime by the Host processor for statistics
984 concerning various parts of the Discovery Engine.
987 NanStatsType stats_type; /* NAN Statistics Request Type */
988 u8 clear; /* 0= Do not clear the stats and return the current contents , 1= Clear the associated stats */
993 The NanConfigurationReq message is sent by the Host to the
994 Discovery Engine in order to configure the Discovery Engine during runtime.
997 u8 config_sid_beacon;
999 u8 config_rssi_proximity;
1001 u8 config_master_pref;
1004 1 byte value which defines the RSSI filter threshold.
1005 Any Service Descriptors received above this value
1006 that are configured for RSSI filtering will be dropped.
1007 The rssi values should be specified without sign.
1008 For eg: -70dBm should be specified as 70.
1010 u8 config_5g_rssi_close_proximity;
1011 u8 rssi_close_proximity_5g_val;
1013 Optional configuration of Configure request.
1014 Each of the optional parameters have configure flag which
1015 determine whether configuration is to be passed or not.
1018 2 byte quantity which defines the window size over
1019 which the
\93average RSSI
\94 will be calculated over.
1021 u8 config_rssi_window_size;
1022 u16 rssi_window_size_val;
1024 If set to 1, the Discovery Engine will enclose the Cluster
1025 Attribute only sent in Beacons in a Vendor Specific Attribute
1026 and transmit in a Service Descriptor Frame.
1028 u8 config_cluster_attribute_val;
1030 The periodicity in seconds between full scan
\92s to find any new
1031 clusters available in the area. A Full scan should not be done
1032 more than every 10 seconds and should not be done less than every
1035 u8 config_scan_params;
1036 NanSocialChannelScanParams scan_params_val;
1038 1 byte quantity which forces the Random Factor to a particular
1039 value for all transmitted Sync/Discovery beacons
1041 u8 config_random_factor_force;
1042 u8 random_factor_force_val;
1044 1 byte quantity which forces the HC for all transmitted Sync and
1045 Discovery Beacon NO matter the real HC being received over the
1048 u8 config_hop_count_force;
1049 u8 hop_count_force_val;
1050 /* NAN Post Connectivity Capability */
1051 u8 config_conn_capability;
1052 NanTransmitPostConnectivityCapability conn_capability_val;
1053 /* NAN Post Discover Capability */
1054 u8 num_config_discovery_attr;
1055 NanTransmitPostDiscovery discovery_attr_val[NAN_MAX_POSTDISCOVERY_LEN];
1056 /* NAN Further availability Map */
1058 NanFurtherAvailabilityMap fam_val;
1063 The Discovery Engine can be configured to send up Events whenever a configured
1064 Threshold Crossing Alert (TCA) Type crosses an integral threshold in a particular direction.
1067 NanTcaType tca_type; /* Nan Protocol Threshold Crossing Alert (TCA) Codes */
1069 /* flag which control whether or not an event is generated for the Rising direction */
1070 u8 rising_direction_evt_flag; /* 0 - no event, 1 - event */
1072 /* flag which control whether or not an event is generated for the Falling direction */
1073 u8 falling_direction_evt_flag;/* 0 - no event, 1 - event */
1075 /* flag which requests a previous TCA request to be cleared from the DE */
1076 u8 clear;/*0= Do not clear the TCA, 1=Clear the TCA */
1078 /* 32 bit value which represents the threshold to be used.*/
1083 Beacon Sdf Payload Structure
1084 The Discovery Engine can be configured to publish vendor specific attributes as part of
1085 beacon or service discovery frame transmitted as part of this request..
1089 NanVendorAttribute will have the Vendor Specific Attribute which the
1090 vendor wants to publish as part of Discovery or Sync or Service discovery frame
1092 NanTransmitVendorSpecificAttribute vsa;
1093 } NanBeaconSdfPayloadRequest;
1095 /* Publish statistics. */
1098 u32 validPublishServiceReqMsgs;
1099 u32 validPublishServiceRspMsgs;
1100 u32 validPublishServiceCancelReqMsgs;
1101 u32 validPublishServiceCancelRspMsgs;
1102 u32 validPublishRepliedIndMsgs;
1103 u32 validPublishTerminatedIndMsgs;
1104 u32 validActiveSubscribes;
1107 u32 invalidPublishServiceReqMsgs;
1108 u32 invalidPublishServiceCancelReqMsgs;
1109 u32 invalidActiveSubscribes;
1111 u32 invalidFollowups;
1113 u32 publishNewMatchCount;
1114 u32 pubsubGlobalNewMatchCount;
1117 /* Subscribe statistics. */
1120 u32 validSubscribeServiceReqMsgs;
1121 u32 validSubscribeServiceRspMsgs;
1122 u32 validSubscribeServiceCancelReqMsgs;
1123 u32 validSubscribeServiceCancelRspMsgs;
1124 u32 validSubscribeTerminatedIndMsgs;
1125 u32 validSubscribeMatchIndMsgs;
1126 u32 validSubscribeUnmatchIndMsgs;
1127 u32 validSolicitedPublishes;
1130 u32 invalidSubscribeServiceReqMsgs;
1131 u32 invalidSubscribeServiceCancelReqMsgs;
1132 u32 invalidSubscribeFollowupReqMsgs;
1133 u32 invalidSolicitedPublishes;
1135 u32 invalidFollowups;
1137 u32 bloomFilterIndex;
1138 u32 subscribeNewMatchCount;
1139 u32 pubsubGlobalNewMatchCount;
1140 } NanSubscribeStats;
1142 /* NAN DW Statistics*/
1147 u32 validActionFrames;
1148 u32 validBeaconFrames;
1149 u32 ignoredActionFrames;
1150 u32 ignoredBeaconFrames;
1152 u32 invalidActionFrames;
1153 u32 invalidBeaconFrames;
1154 u32 invalidMacHeaders;
1155 u32 invalidPafHeaders;
1156 u32 nonNanBeaconFrames;
1158 u32 earlyActionFrames;
1159 u32 inDwActionFrames;
1160 u32 lateActionFrames;
1164 u32 totalTRSpUpdates;
1166 u32 completeByTp75DW;
1167 u32 completeByTendDW;
1168 u32 lateActionFramesTx;
1171 /* NAN MAC Statistics. */
1176 u32 validActionFrames;
1177 u32 validBeaconFrames;
1178 u32 ignoredActionFrames;
1179 u32 ignoredBeaconFrames;
1181 u32 invalidActionFrames;
1182 u32 invalidBeaconFrames;
1183 u32 invalidMacHeaders;
1184 u32 invalidPafHeaders;
1185 u32 nonNanBeaconFrames;
1187 u32 earlyActionFrames;
1188 u32 inDwActionFrames;
1189 u32 lateActionFrames;
1193 u32 totalTRSpUpdates;
1195 u32 completeByTp75DW;
1196 u32 completeByTendDW;
1197 u32 lateActionFramesTx;
1203 u32 bloomFilterIndex;
1206 /* NAN Sync Statistics*/
1219 u64 timeSpentInCurrRole;
1220 u64 totalTimeSpentAsMaster;
1221 u64 totalTimeSpentAsNonMasterSync;
1222 u64 totalTimeSpentAsNonMasterNonSync;
1223 u32 transitionsToAnchorMaster;
1224 u32 transitionsToMaster;
1225 u32 transitionsToNonMasterSync;
1226 u32 transitionsToNonMasterNonSync;
1228 u32 amrUpdateRankChangedCount;
1229 u32 amrUpdateBTTChangedCount;
1230 u32 amrUpdateHcChangedCount;
1231 u32 amrUpdateNewDeviceCount;
1234 u32 beaconsAboveHcLimit;
1235 u32 beaconsBelowRssiThresh;
1236 u32 beaconsIgnoredNoSpace;
1237 u32 beaconsForOurCluster;
1238 u32 beaconsForOtherCluster;
1239 u32 beaconCancelRequests;
1240 u32 beaconCancelFailures;
1241 u32 beaconUpdateRequests;
1242 u32 beaconUpdateFailures;
1243 u32 syncBeaconTxAttempts;
1244 u32 syncBeaconTxFailures;
1245 u32 discBeaconTxAttempts;
1246 u32 discBeaconTxFailures;
1247 u32 amHopCountExpireCount;
1250 /* NAN Misc DE Statistics */
1253 u32 validErrorRspMsgs;
1254 u32 validTransmitFollowupReqMsgs;
1255 u32 validTransmitFollowupRspMsgs;
1256 u32 validFollowupIndMsgs;
1257 u32 validConfigurationReqMsgs;
1258 u32 validConfigurationRspMsgs;
1259 u32 validStatsReqMsgs;
1260 u32 validStatsRspMsgs;
1261 u32 validEnableReqMsgs;
1262 u32 validEnableRspMsgs;
1263 u32 validDisableReqMsgs;
1264 u32 validDisableRspMsgs;
1265 u32 validDisableIndMsgs;
1266 u32 validEventIndMsgs;
1267 u32 validTcaReqMsgs;
1268 u32 validTcaRspMsgs;
1269 u32 validTcaIndMsgs;
1270 u32 invalidTransmitFollowupReqMsgs;
1271 u32 invalidConfigurationReqMsgs;
1272 u32 invalidStatsReqMsgs;
1273 u32 invalidEnableReqMsgs;
1274 u32 invalidDisableReqMsgs;
1275 u32 invalidTcaReqMsgs;
1278 /* Publish Response Message structure */
1281 } NanPublishResponse;
1283 /* Subscribe Response Message structure */
1286 } NanSubscribeResponse;
1289 Stats Response Message structure
1290 The Discovery Engine response to a request by the Host for statistics.
1293 NanStatsType stats_type;
1295 NanPublishStats publish_stats;
1296 NanSubscribeStats subscribe_stats;
1297 NanMacStats mac_stats;
1298 NanSyncStats sync_stats;
1299 NanDeStats de_stats;
1300 NanDWStats dw_stats;
1305 NAN Response messages
1308 NanStatusType status; /* contains the result code */
1309 u32 value; /* For error returns the value is returned which was in error */
1310 NanResponseType response_type; /* NanResponseType Definitions */
1312 NanPublishResponse publish_response;
1313 NanSubscribeResponse subscribe_response;
1314 NanStatsResponse stats_response;
1315 NanCapabilities nan_capabilities;
1321 The PublishTerminatedInd message is sent by the DE whenever a Publish
1322 terminates from a user-specified timeout or a unrecoverable error in the DE.
1325 /* Id returned during the initial Publish */
1327 NanStatusType reason;
1328 } NanPublishTerminatedInd;
1332 The MatchInd message is sent once per responding MAC address whenever
1333 the Discovery Engine detects a match for a previous SubscribeServiceReq
1334 or PublishServiceReq.
1337 /* Publish or Subscribe Id of an earlier Publish/Subscribe */
1338 u16 publish_subscribe_id;
1340 A 32 bit Requestor Instance Id which is sent to the Application.
1341 This Id will be sent in any subsequent UnmatchInd/FollowupInd
1344 u32 requestor_instance_id;
1345 u8 addr[NAN_MAC_ADDR_LEN];
1348 Sequence of octets which were received in a Discovery Frame matching the
1351 u16 service_specific_info_len;
1352 u8 service_specific_info[NAN_MAX_SERVICE_SPECIFIC_INFO_LEN];
1355 Ordered sequence of <length, value> pairs received in the Discovery Frame
1356 matching the Subscribe Request.
1358 u16 sdf_match_filter_len;
1359 u8 sdf_match_filter[NAN_MAX_MATCH_FILTER_LEN];
1362 flag to indicate if the Match occurred in a Beacon Frame or in a
1363 Service Discovery Frame.
1364 0 - Match occured in a Service Discovery Frame
1365 1 - Match occured in a Beacon Frame
1367 u8 match_occured_flag;
1370 flag to indicate FW is out of resource and that it can no longer
1371 track this Service Name. The Host still need to send the received
1372 Match_Handle but duplicate MatchInd messages may be received on
1373 this Handle until the resource frees up.
1374 0 - FW is caching this match
1375 1 - FW is unable to cache this match
1377 u8 out_of_resource_flag;
1380 If RSSI filtering was configured in NanSubscribeRequest then this
1381 field will contain the received RSSI value. 0 if not.
1382 All rssi values should be specified without sign.
1383 For eg: -70dBm should be specified as 70.
1388 optional attributes. Each optional attribute is associated with a flag
1389 which specifies whether the attribute is valid or not
1391 /* NAN Post Connectivity Capability received */
1392 u8 is_conn_capability_valid;
1393 NanReceivePostConnectivityCapability conn_capability;
1395 /* NAN Post Discover Capability */
1396 u8 num_rx_discovery_attr;
1397 NanReceivePostDiscovery discovery_attr[NAN_MAX_POSTDISCOVERY_LEN];
1399 /* NAN Further availability Map */
1401 NanFurtherAvailabilityChannel famchan[NAN_MAX_FAM_CHANNELS];
1403 /* NAN Cluster Attribute */
1404 u8 cluster_attribute_len;
1405 u8 cluster_attribute[NAN_MAX_CLUSTER_ATTRIBUTE_LEN];
1409 MatchExpired Indication
1410 The MatchExpiredInd message is sent whenever the Discovery Engine detects that
1411 a previously Matched Service has been gone for too long. If the previous
1412 MatchInd message for this Publish/Subscribe Id had the out_of_resource_flag
1413 set then this message will not be received
1416 /* Publish or Subscribe Id of an earlier Publish/Subscribe */
1417 u16 publish_subscribe_id;
1419 32 bit value sent by the DE in a previous
1420 MatchInd/FollowupInd to the application.
1422 u32 requestor_instance_id;
1423 } NanMatchExpiredInd;
1426 Subscribe Terminated
1427 The SubscribeTerminatedInd message is sent by the DE whenever a
1428 Subscribe terminates from a user-specified timeout or a unrecoverable error in the DE.
1431 /* Id returned during initial Subscribe */
1433 NanStatusType reason;
1434 } NanSubscribeTerminatedInd;
1437 Followup Indication Message
1438 The FollowupInd message is sent by the DE to the Host whenever it receives a
1439 Followup message from another peer.
1442 /* Publish or Subscribe Id of an earlier Publish/Subscribe */
1443 u16 publish_subscribe_id;
1445 A 32 bit Requestor instance Id which is sent to the Application.
1446 This Id will be used in subsequent UnmatchInd/FollowupInd messages.
1448 u32 requestor_instance_id;
1449 u8 addr[NAN_MAC_ADDR_LEN];
1451 /* Flag which the DE uses to decide if received in a DW or a FAW*/
1452 u8 dw_or_faw; /* 0=Received in a DW, 1 = Received in a FAW*/
1455 Sequence of values which further specify the published service beyond
1458 u16 service_specific_info_len;
1459 u8 service_specific_info[NAN_MAX_SERVICE_SPECIFIC_INFO_LEN];
1463 Event data notifying the Mac address of the Discovery engine.
1464 which is reported as one of the Discovery engine event
1467 u8 addr[NAN_MAC_ADDR_LEN];
1468 } NanMacAddressEvent;
1471 Event data notifying the Cluster address of the cluster
1472 which is reported as one of the Discovery engine event
1475 u8 addr[NAN_MAC_ADDR_LEN];
1479 Discovery Engine Event Indication
1480 The Discovery Engine can inform the Host when significant events occur
1481 The data following the EventId is dependent upon the EventId type.
1482 In other words, each new event defined will carry a different
1483 structure of information back to the host.
1486 NanDiscEngEventType event_type; /* NAN Protocol Event Codes */
1489 MacAddressEvent which will have 6 byte mac address
1490 of the Discovery engine.
1492 NanMacAddressEvent mac_addr;
1494 Cluster Event Data which will be obtained when the
1495 device starts a new cluster or joins a cluster.
1496 The event data will have 6 byte octet string of the
1497 cluster started or joined.
1499 NanClusterEvent cluster;
1501 } NanDiscEngEventInd;
1503 /* Cluster size TCA event*/
1505 /* size of the cluster*/
1507 } NanTcaClusterEvent;
1511 The Discovery Engine can inform the Host when significant events occur.
1512 The data following the TcaId is dependent upon the TcaId type.
1513 In other words, each new event defined will carry a different structure
1514 of information back to the host.
1517 NanTcaType tca_type;
1518 /* flag which defines if the configured Threshold has risen above the threshold */
1519 u8 rising_direction_evt_flag; /* 0 - no event, 1 - event */
1521 /* flag which defines if the configured Threshold has fallen below the threshold */
1522 u8 falling_direction_evt_flag;/* 0 - no event, 1 - event */
1525 This event in obtained when the cluser size threshold
1526 is crossed. Event will have the cluster size
1528 NanTcaClusterEvent cluster;
1533 NAN Disabled Indication
1534 The NanDisableInd message indicates to the upper layers that the Discovery
1535 Engine has flushed all state and has been shutdown. When this message is received
1536 the DE is guaranteed to have left the NAN cluster it was part of and will have terminated
1537 any in progress Publishes or Subscribes.
1540 NanStatusType reason;
1544 NAN Beacon or SDF Payload Indication
1545 The NanBeaconSdfPayloadInd message indicates to the upper layers that information
1546 elements were received either in a Beacon or SDF which needs to be delivered
1547 outside of a Publish/Subscribe Handle.
1550 /* The MAC address of the peer which sent the attributes.*/
1551 u8 addr[NAN_MAC_ADDR_LEN];
1553 Optional attributes. Each optional attribute is associated with a flag
1554 which specifies whether the attribute is valid or not
1556 /* NAN Receive Vendor Specific Attribute*/
1558 NanReceiveVendorSpecificAttribute vsa;
1560 /* NAN Beacon or SDF Payload Received*/
1561 u8 is_beacon_sdf_payload_received;
1562 NanBeaconSdfPayloadReceive data;
1563 } NanBeaconSdfPayloadInd;
1565 /* Response and Event Callbacks */
1567 /* NotifyResponse invoked to notify the status of the Request */
1568 void (*NotifyResponse)(transaction_id id, NanResponseMsg* rsp_data);
1569 /* Callbacks for various Events */
1570 void (*EventPublishTerminated)(NanPublishTerminatedInd* event);
1571 void (*EventMatch) (NanMatchInd* event);
1572 void (*EventMatchExpired) (NanMatchExpiredInd* event);
1573 void (*EventSubscribeTerminated) (NanSubscribeTerminatedInd* event);
1574 void (*EventFollowup) (NanFollowupInd* event);
1575 void (*EventDiscEngEvent) (NanDiscEngEventInd* event);
1576 void (*EventDisabled) (NanDisabledInd* event);
1577 void (*EventTca) (NanTCAInd* event);
1578 void (*EventBeaconSdfPayload) (NanBeaconSdfPayloadInd* event);
1579 } NanCallbackHandler;
1581 /* Enable NAN functionality. */
1582 wifi_error nan_enable_request(transaction_id id,
1583 wifi_interface_handle iface,
1584 NanEnableRequest* msg);
1586 /* Disable NAN functionality. */
1587 wifi_error nan_disable_request(transaction_id id,
1588 wifi_interface_handle iface);
1590 /* Publish request to advertize a service. */
1591 wifi_error nan_publish_request(transaction_id id,
1592 wifi_interface_handle iface,
1593 NanPublishRequest* msg);
1595 /* Cancel previous publish requests. */
1596 wifi_error nan_publish_cancel_request(transaction_id id,
1597 wifi_interface_handle iface,
1598 NanPublishCancelRequest* msg);
1600 /* Subscribe request to search for a service. */
1601 wifi_error nan_subscribe_request(transaction_id id,
1602 wifi_interface_handle iface,
1603 NanSubscribeRequest* msg);
1605 /* Cancel previous subscribe requests. */
1606 wifi_error nan_subscribe_cancel_request(transaction_id id,
1607 wifi_interface_handle iface,
1608 NanSubscribeCancelRequest* msg);
1610 /* NAN transmit follow up request. */
1611 wifi_error nan_transmit_followup_request(transaction_id id,
1612 wifi_interface_handle iface,
1613 NanTransmitFollowupRequest* msg);
1615 /* Request NAN statistics from Discovery Engine. */
1616 wifi_error nan_stats_request(transaction_id id,
1617 wifi_interface_handle iface,
1618 NanStatsRequest* msg);
1620 /* NAN configuration request. */
1621 wifi_error nan_config_request(transaction_id id,
1622 wifi_interface_handle iface,
1623 NanConfigRequest* msg);
1625 /* Configure the various Threshold crossing alerts. */
1626 wifi_error nan_tca_request(transaction_id id,
1627 wifi_interface_handle iface,
1628 NanTCARequest* msg);
1631 Set NAN Beacon or sdf payload to discovery engine.
1632 This instructs the Discovery Engine to begin publishing the
1633 received payload in any Beacon or Service Discovery Frame
1636 wifi_error nan_beacon_sdf_payload_request(transaction_id id,
1637 wifi_interface_handle iface,
1638 NanBeaconSdfPayloadRequest* msg);
1640 /* Register NAN callbacks. */
1641 wifi_error nan_register_handler(wifi_interface_handle iface,
1642 NanCallbackHandler handlers);
1644 /* Get NAN HAL version. */
1645 wifi_error nan_get_version(wifi_handle handle,
1646 NanVersion* version);
1648 /* Get NAN capabilities. */
1649 wifi_error nan_get_capabilities(transaction_id id,
1650 wifi_interface_handle iface);
1653 #endif /* __cplusplus */
1655 #endif /* __NAN_H__ */