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.
26 #endif /* __cplusplus */
28 /*****************************************************************************
29 * Neighbour Aware Network Service Structures and Functions
30 *****************************************************************************/
34 All multi-byte fields within all NAN protocol stack messages are assumed to be in Little Endian order.
37 typedef int NanVersion;
38 typedef u16 transaction_id;
39 typedef u32 NanDataPathId;
41 #define NAN_MAC_ADDR_LEN 6
42 #define NAN_MAJOR_VERSION 2
43 #define NAN_MINOR_VERSION 0
44 #define NAN_MICRO_VERSION 0
45 #define NAN_MAX_SOCIAL_CHANNELS 3
47 /* NAN Maximum Lengths */
48 #define NAN_MAX_SERVICE_NAME_LEN 255
49 #define NAN_MAX_MATCH_FILTER_LEN 255
50 #define NAN_MAX_SERVICE_SPECIFIC_INFO_LEN 1024
51 #define NAN_MAX_VSA_DATA_LEN 1024
52 #define NAN_MAX_MESH_DATA_LEN 32
53 #define NAN_MAX_INFRA_DATA_LEN 32
54 #define NAN_MAX_CLUSTER_ATTRIBUTE_LEN 255
55 #define NAN_MAX_SUBSCRIBE_MAX_ADDRESS 42
56 #define NAN_MAX_FAM_CHANNELS 32
57 #define NAN_MAX_POSTDISCOVERY_LEN 5
58 #define NAN_MAX_FRAME_DATA_LEN 504
59 #define NAN_DP_MAX_APP_INFO_LEN 512
60 #define NAN_ERROR_STR_LEN 255
61 #define NAN_PMK_INFO_LEN 32
62 #define NAN_MAX_SCID_BUF_LEN 1024
63 #define NAN_MAX_SDEA_SERVICE_SPECIFIC_INFO_LEN 1024
66 Definition of various NanResponseType
69 NAN_RESPONSE_ENABLED = 0,
70 NAN_RESPONSE_DISABLED = 1,
71 NAN_RESPONSE_PUBLISH = 2,
72 NAN_RESPONSE_PUBLISH_CANCEL = 3,
73 NAN_RESPONSE_TRANSMIT_FOLLOWUP = 4,
74 NAN_RESPONSE_SUBSCRIBE = 5,
75 NAN_RESPONSE_SUBSCRIBE_CANCEL = 6,
76 NAN_RESPONSE_STATS = 7,
77 NAN_RESPONSE_CONFIG = 8,
79 NAN_RESPONSE_ERROR = 10,
80 NAN_RESPONSE_BEACON_SDF_PAYLOAD = 11,
81 NAN_GET_CAPABILITIES = 12,
82 NAN_DP_INTERFACE_CREATE = 13,
83 NAN_DP_INTERFACE_DELETE = 14,
84 NAN_DP_INITIATOR_RESPONSE = 15,
85 NAN_DP_RESPONDER_RESPONSE = 16,
89 /* NAN Publish Types */
91 NAN_PUBLISH_TYPE_UNSOLICITED = 0,
92 NAN_PUBLISH_TYPE_SOLICITED,
93 NAN_PUBLISH_TYPE_UNSOLICITED_SOLICITED
96 /* NAN Transmit Priorities */
98 NAN_TX_PRIORITY_NORMAL = 0,
102 /* NAN Statistics Request ID Codes */
104 NAN_STATS_ID_DE_PUBLISH = 0,
105 NAN_STATS_ID_DE_SUBSCRIBE,
107 NAN_STATS_ID_DE_TIMING_SYNC,
112 /* NAN Protocol Event ID Codes */
114 NAN_EVENT_ID_DISC_MAC_ADDR = 0,
115 NAN_EVENT_ID_STARTED_CLUSTER,
116 NAN_EVENT_ID_JOINED_CLUSTER
117 } NanDiscEngEventType;
119 /* NAN Data Path type */
121 NAN_DATA_PATH_UNICAST_MSG = 0,
122 NAN_DATA_PATH_MULTICAST_MSG
125 /* NAN Ranging Configuration */
127 NAN_RANGING_DISABLE = 0,
133 NAN_TCA_ID_CLUSTER_SIZE = 0
137 Various NAN Protocol Response code
140 /* NAN Protocol Response Codes */
141 NAN_STATUS_SUCCESS = 0,
142 /* NAN Discovery Engine/Host driver failures */
143 NAN_STATUS_INTERNAL_FAILURE = 1,
144 /* NAN OTA failures */
145 NAN_STATUS_PROTOCOL_FAILURE = 2,
146 /* if the publish/subscribe id is invalid */
147 NAN_STATUS_INVALID_PUBLISH_SUBSCRIBE_ID = 3,
148 /* If we run out of resources allocated */
149 NAN_STATUS_NO_RESOURCE_AVAILABLE = 4,
150 /* if invalid params are passed */
151 NAN_STATUS_INVALID_PARAM = 5,
152 /* if the requestor instance id is invalid */
153 NAN_STATUS_INVALID_REQUESTOR_INSTANCE_ID = 6,
154 /* if the ndp id is invalid */
155 NAN_STATUS_INVALID_NDP_ID = 7,
156 /* if NAN is enabled when wifi is turned off */
157 NAN_STATUS_NAN_NOT_ALLOWED = 8,
158 /* if over the air ack is not received */
159 NAN_STATUS_NO_OTA_ACK = 9,
160 /* If NAN is already enabled and we are try to re-enable the same */
161 NAN_STATUS_ALREADY_ENABLED = 10,
162 /* If followup message internal queue is full */
163 NAN_STATUS_FOLLOWUP_QUEUE_FULL = 11,
164 /* Unsupported concurrency session enabled, NAN disabled notified */
165 NAN_STATUS_UNSUPPORTED_CONCURRENCY_NAN_DISABLED = 12
168 /* NAN Transmit Types */
170 NAN_TX_TYPE_BROADCAST = 0,
174 /* NAN Subscribe Type */
176 NAN_SUBSCRIBE_TYPE_PASSIVE = 0,
177 NAN_SUBSCRIBE_TYPE_ACTIVE
180 /* NAN Service Response Filter Attribute Bit */
182 NAN_SRF_ATTR_BLOOM_FILTER = 0,
183 NAN_SRF_ATTR_PARTIAL_MAC_ADDR
186 /* NAN Service Response Filter Include Bit */
188 NAN_SRF_INCLUDE_DO_NOT_RESPOND = 0,
189 NAN_SRF_INCLUDE_RESPOND
192 /* NAN Match indication type */
194 NAN_MATCH_ALG_MATCH_ONCE = 0,
195 NAN_MATCH_ALG_MATCH_CONTINUOUS,
196 NAN_MATCH_ALG_MATCH_NEVER
199 /* NAN Transmit Window Type */
201 NAN_TRANSMIT_IN_DW = 0,
203 } NanTransmitWindowType;
205 /* NAN SRF State in Subscribe */
207 NAN_DO_NOT_USE_SRF = 0,
211 /* NAN Include SSI in MatchInd */
213 NAN_SSI_NOT_REQUIRED_IN_MATCH_IND = 0,
214 NAN_SSI_REQUIRED_IN_MATCH_IND
217 /* NAN DP security Configuration */
219 NAN_DP_CONFIG_NO_SECURITY = 0,
220 NAN_DP_CONFIG_SECURITY
221 } NanDataPathSecurityCfgStatus;
223 /* Data request Responder's response */
225 NAN_DP_REQUEST_ACCEPT = 0,
226 NAN_DP_REQUEST_REJECT
227 } NanDataPathResponseCode;
229 /* NAN DP channel config options */
231 NAN_DP_CHANNEL_NOT_REQUESTED = 0,
232 NAN_DP_REQUEST_CHANNEL_SETUP,
233 NAN_DP_FORCE_CHANNEL_SETUP
234 } NanDataPathChannelCfg;
236 /* Enable/Disable NAN Ranging Auto response */
238 NAN_RANGING_AUTO_RESPONSE_ENABLE = 1,
239 NAN_RANGING_AUTO_RESPONSE_DISABLE
240 } NanRangingAutoResponse;
242 /* Enable/Disable NAN service range report */
244 NAN_DISABLE_RANGE_REPORT = 1,
245 NAN_ENABLE_RANGE_REPORT
248 /* NAN Range Response */
250 NAN_RANGE_REQUEST_ACCEPT = 1,
251 NAN_RANGE_REQUEST_REJECT,
252 NAN_RANGE_REQUEST_CANCEL
255 /* NAN Shared Key Security Cipher Suites Mask */
256 #define NAN_CIPHER_SUITE_SHARED_KEY_NONE 0x00
257 #define NAN_CIPHER_SUITE_SHARED_KEY_128_MASK 0x01
258 #define NAN_CIPHER_SUITE_SHARED_KEY_256_MASK 0x02
260 /* NAN ranging indication condition MASKS */
261 #define NAN_RANGING_INDICATE_CONTINUOUS_MASK 0x01
262 #define NAN_RANGING_INDICATE_INGRESS_MET_MASK 0x02
263 #define NAN_RANGING_INDICATE_EGRESS_MET_MASK 0x04
266 Structure to set the Service Descriptor Extension
267 Attribute (SDEA) passed as part of NanPublishRequest/
268 NanSubscribeRequest/NanMatchInd.
272 Optional configuration of Data Path Enable request.
273 configure flag determines whether configuration needs
276 u8 config_nan_data_path;
279 NAN secuirty required flag to indicate
280 if the security is enabled or disabled
282 NanDataPathSecurityCfgStatus security_cfg;
284 NAN ranging required flag to indicate
285 if ranging is enabled on disabled
287 NanRangingState ranging_state;
289 Enable/Disable Ranging report,
290 when configured NanRangeReportInd received
292 NanRangeReport range_report;
296 Nan Ranging Peer Info in MatchInd
300 Distance to the NAN device with the MAC address indicated
301 with ranged mac address.
303 u32 range_measurement_cm;
304 /* Ranging event matching the configuration of continuous/ingress/egress. */
305 u32 ranging_event_type;
308 /* Nan/NDP Capabilites info */
310 u32 max_concurrent_nan_clusters;
313 u32 max_service_name_len;
314 u32 max_match_filter_len;
315 u32 max_total_match_filter_len;
316 u32 max_service_specific_info_len;
317 u32 max_vsa_data_len;
318 u32 max_mesh_data_len;
319 u32 max_ndi_interfaces;
320 u32 max_ndp_sessions;
321 u32 max_app_info_len;
322 u32 max_queued_transmit_followup_msgs;
323 u32 cipher_suites_supported;
324 u32 max_subscribe_address;
325 u32 max_sdea_service_specific_info_len;
329 Nan accept policy: Per service basis policy
330 Based on this policy(ALL/NONE), responder side
331 will send ACCEPT/REJECT
334 NAN_SERVICE_ACCEPT_POLICY_NONE = 0,
336 NAN_SERVICE_ACCEPT_POLICY_ALL
337 } NanServiceAcceptPolicy;
340 Host can send Vendor specific attributes which the Discovery Engine can
341 enclose in Beacons and/or Service Discovery frames transmitted.
342 Below structure is used to populate that.
346 0 = transmit only in the next discovery window
347 1 = transmit in next 16 discovery window
349 u8 payload_transmit_flag;
351 Below flags will determine in which all frames
352 the vendor specific attributes should be included
354 u8 tx_in_discovery_beacon;
355 u8 tx_in_sync_beacon;
356 u8 tx_in_service_discovery;
357 /* Organizationally Unique Identifier */
360 vendor specific attribute to be transmitted
361 vsa_len : Length of the vsa data.
364 u8 vsa[NAN_MAX_VSA_DATA_LEN];
365 } NanTransmitVendorSpecificAttribute;
369 Discovery Engine will forward any Vendor Specific Attributes
370 which it received as part of this structure.
372 /* Mask to determine on which frames attribute was received */
373 #define RX_DISCOVERY_BEACON_MASK 0x01
374 #define RX_SYNC_BEACON_MASK 0x02
375 #define RX_SERVICE_DISCOVERY_MASK 0x04
378 Frames on which this vendor specific attribute
379 was received. Mask defined above
382 /* Organizationally Unique Identifier */
384 /* vendor specific attribute */
386 u8 vsa[NAN_MAX_VSA_DATA_LEN];
387 } NanReceiveVendorSpecificAttribute;
390 NAN Beacon SDF Payload Received structure
391 Discovery engine sends the details of received Beacon or
392 Service Discovery Frames as part of this structure.
397 u8 frame_data[NAN_MAX_FRAME_DATA_LEN];
398 } NanBeaconSdfPayloadReceive;
401 Host can set the Periodic scan parameters for each of the
402 3(6, 44, 149) Social channels. Only these channels are allowed
403 any other channels are rejected
406 NAN_CHANNEL_24G_BAND = 0,
407 NAN_CHANNEL_5G_BAND_LOW,
408 NAN_CHANNEL_5G_BAND_HIGH
412 Structure to set the Social Channel Scan parameters
413 passed as part of NanEnableRequest/NanConfigRequest
417 Dwell time of each social channel in milliseconds
418 NanChannelIndex corresponds to the respective channel
419 If time set to 0 then the FW default time will be used.
421 u8 dwell_time[NAN_MAX_SOCIAL_CHANNELS]; // default value 200 msec
424 Scan period of each social channel in seconds
425 NanChannelIndex corresponds to the respective channel
426 If time set to 0 then the FW default time will be used.
428 u16 scan_period[NAN_MAX_SOCIAL_CHANNELS]; // default value 20 sec
429 } NanSocialChannelScanParams;
432 Host can send Post Connectivity Capability attributes
433 to be included in Service Discovery frames transmitted
434 as part of this structure.
438 0 = transmit only in the next discovery window
439 1 = transmit in next 16 discovery window
441 u8 payload_transmit_flag;
442 /* 1 - Wifi Direct supported 0 - Not supported */
444 /* 1 - Wifi Direct Services supported 0 - Not supported */
445 u8 is_wfds_supported;
446 /* 1 - TDLS supported 0 - Not supported */
447 u8 is_tdls_supported;
448 /* 1 - IBSS supported 0 - Not supported */
449 u8 is_ibss_supported;
450 /* 1 - Mesh supported 0 - Not supported */
451 u8 is_mesh_supported;
453 1 - NAN Device currently connect to WLAN Infra AP
457 } NanTransmitPostConnectivityCapability;
460 Discovery engine providing the post connectivity capability
464 /* 1 - Wifi Direct supported 0 - Not supported */
466 /* 1 - Wifi Direct Services supported 0 - Not supported */
467 u8 is_wfds_supported;
468 /* 1 - TDLS supported 0 - Not supported */
469 u8 is_tdls_supported;
470 /* 1 - IBSS supported 0 - Not supported */
471 u8 is_ibss_supported;
472 /* 1 - Mesh supported 0 - Not supported */
473 u8 is_mesh_supported;
475 1 - NAN Device currently connect to WLAN Infra AP
479 } NanReceivePostConnectivityCapability;
482 Indicates the availability interval duration associated with the
483 Availability Intervals Bitmap field
486 NAN_DURATION_16MS = 0,
487 NAN_DURATION_32MS = 1,
488 NAN_DURATION_64MS = 2
491 /* Further availability per channel information */
494 NanAvailDuration entry_control;
496 1 byte field indicating the frequency band the NAN Device
497 will be available as defined in IEEE Std. 802.11-2012
498 Annex E Table E-4 Global Operating Classes
502 1 byte field indicating the channel the NAN Device
507 Map Id - 4 bit field which identifies the Further
508 availability map attribute.
512 divides the time between the beginnings of consecutive Discovery
513 Windows of a given NAN cluster into consecutive time intervals
514 of equal durations. The time interval duration is specified by
515 the Availability Interval Duration subfield of the Entry Control
518 A Nan device that sets the i-th bit of the Availability
519 Intervals Bitmap to 1 shall be present during the corresponding
520 i-th time interval in the operation channel indicated by the
521 Operating Class and Channel Number fields in the same Availability Entry.
523 A Nan device that sets the i-th bit of the Availability Intervals Bitmap to
524 0 may be present during the corresponding i-th time interval in the operation
525 channel indicated by the Operating Class and Channel Number fields in the same
528 The size of the Bitmap is dependent upon the Availability Interval Duration
529 chosen in the Entry Control Field. The size can be either 1, 2 or 4 bytes long
531 - Duration field is equal to 0, only AIB[0] is valid
532 - Duration field is equal to 1, only AIB [0] and AIB [1] is valid
533 - Duration field is equal to 2, AIB [0], AIB [1], AIB [2] and AIB [3] are valid
535 u32 avail_interval_bitmap;
536 } NanFurtherAvailabilityChannel;
539 Further availability map which can be sent and received from
544 Number of channels indicates the number of channel
545 entries which is part of fam
548 NanFurtherAvailabilityChannel famchan[NAN_MAX_FAM_CHANNELS];
549 } NanFurtherAvailabilityMap;
552 Host can send Post-Nan Discovery attributes which the Discovery Engine can
553 enclose in Service Discovery frames
555 /* Possible connection types in Post NAN Discovery attributes */
557 NAN_CONN_WLAN_INFRA = 0,
558 NAN_CONN_P2P_OPER = 1,
559 NAN_CONN_WLAN_IBSS = 2,
560 NAN_CONN_WLAN_MESH = 3,
561 NAN_CONN_FURTHER_SERVICE_AVAILABILITY = 4,
562 NAN_CONN_WLAN_RANGING = 5
565 /* Possible device roles in Post NAN Discovery attributes */
567 NAN_WLAN_INFRA_AP = 0,
568 NAN_WLAN_INFRA_STA = 1,
570 NAN_P2P_OPER_DEV = 3,
574 /* Configuration params of NAN Ranging */
577 Interval in milli sec between two ranging measurements.
578 If the Awake DW intervals in NanEnable/Config are larger
579 than the ranging intervals priority is given to Awake DW
580 Intervals. Only on a match the ranging is initiated for the
583 u32 ranging_interval_msec;
585 Flags indicating the type of ranging event to be notified
586 NAN_RANGING_INDICATE_ MASKS are used to set these.
587 BIT0 - Continuous Ranging event notification.
588 BIT1 - Ingress distance is <=.
589 BIT2 - Egress distance is >=.
591 u32 config_ranging_indications;
592 /* Ingress distance in centimeters (optional) */
593 u32 distance_ingress_cm;
594 /* Egress distance in centimeters (optional) */
595 u32 distance_egress_cm;
598 /* NAN Ranging request's response */
600 /* Publish Id of an earlier Publisher */
603 A 32 bit Requestor instance Id which is sent to the Application.
604 This Id will be used in subsequent RangeResponse on Subscribe side.
606 u32 requestor_instance_id;
607 /* Peer MAC addr of Range Requestor */
608 u8 peer_addr[NAN_MAC_ADDR_LEN];
609 /* Response indicating ACCEPT/REJECT/CANCEL of Range Request */
610 NanRangeResponse ranging_response;
611 } NanRangeResponseCfg;
613 /* Structure of Post NAN Discovery attribute */
615 /* Connection type of the host */
616 NanConnectionType type;
618 Device role of the host based on
623 Flag to send the information as a single shot or repeated
624 for next 16 discovery windows
626 1 - next 16 discovery windows
629 /* Duration of the availability bitmask */
630 NanAvailDuration duration;
631 /* Availability interval bitmap based on duration */
632 u32 avail_interval_bitmap;
634 Mac address depending on the conn type and device role
635 --------------------------------------------------
636 | Conn Type | Device Role | Mac address Usage |
637 --------------------------------------------------
638 | WLAN_INFRA | AP/STA | BSSID of the AP |
639 --------------------------------------------------
640 | P2P_OPER | GO | GO's address |
641 --------------------------------------------------
642 | P2P_OPER | P2P_DEVICE | Address of who |
643 | | | would become GO |
644 --------------------------------------------------
645 | WLAN_IBSS | NA | BSSID |
646 --------------------------------------------------
647 | WLAN_MESH | NA | BSSID |
648 --------------------------------------------------
650 u8 addr[NAN_MAC_ADDR_LEN];
652 Mandatory mesh id value if connection type is WLAN_MESH
653 Mesh id contains 0-32 octet identifier and should be
654 as per IEEE Std.802.11-2012 spec.
657 u8 mesh_id[NAN_MAX_MESH_DATA_LEN];
659 Optional infrastructure SSID if conn_type is set to
662 u16 infrastructure_ssid_len;
663 u8 infrastructure_ssid_val[NAN_MAX_INFRA_DATA_LEN];
664 } NanTransmitPostDiscovery;
667 Discovery engine providing the structure of Post NAN
671 /* Connection type of the host */
672 NanConnectionType type;
674 Device role of the host based on
678 /* Duration of the availability bitmask */
679 NanAvailDuration duration;
680 /* Availability interval bitmap based on duration */
681 u32 avail_interval_bitmap;
683 Map Id - 4 bit field which identifies the Further
684 availability map attribute.
688 Mac address depending on the conn type and device role
689 --------------------------------------------------
690 | Conn Type | Device Role | Mac address Usage |
691 --------------------------------------------------
692 | WLAN_INFRA | AP/STA | BSSID of the AP |
693 --------------------------------------------------
694 | P2P_OPER | GO | GO's address |
695 --------------------------------------------------
696 | P2P_OPER | P2P_DEVICE | Address of who |
697 | | | would become GO |
698 --------------------------------------------------
699 | WLAN_IBSS | NA | BSSID |
700 --------------------------------------------------
701 | WLAN_MESH | NA | BSSID |
702 --------------------------------------------------
704 u8 addr[NAN_MAC_ADDR_LEN];
706 Mandatory mesh id value if connection type is WLAN_MESH
707 Mesh id contains 0-32 octet identifier and should be
708 as per IEEE Std.802.11-2012 spec.
711 u8 mesh_id[NAN_MAX_MESH_DATA_LEN];
713 Optional infrastructure SSID if conn_type is set to
716 u16 infrastructure_ssid_len;
717 u8 infrastructure_ssid_val[NAN_MAX_INFRA_DATA_LEN];
718 } NanReceivePostDiscovery;
721 NAN device level configuration of SDF and Sync beacons in both
725 /* Configure 2.4GHz DW Band */
726 u8 config_2dot4g_dw_band;
728 Indicates the interval for Sync beacons and SDF's in 2.4GHz band.
729 Valid values of DW Interval are: 1, 2, 3, 4 and 5, 0 is reserved.
730 The SDF includes in OTA when enabled. The publish/subscribe period
731 values don't override the device level configurations.
733 u32 dw_2dot4g_interval_val; // default value 1
734 /* Configure 5GHz DW Band */
735 u8 config_5g_dw_band;
737 Indicates the interval for Sync beacons and SDF's in 5GHz band
738 Valid values of DW Interval are: 1, 2, 3, 4 and 5, 0 no wake up for
739 any interval. The SDF includes in OTA when enabled. The publish/subscribe
740 period values don't override the device level configurations.
742 u32 dw_5g_interval_val; // default value 1 when 5G is enabled
746 Enable Request Message Structure
747 The NanEnableReq message instructs the Discovery Engine to enter an operational state
750 /* Mandatory parameters below */
751 u8 master_pref; // default value 0x02
753 A cluster_low value matching cluster_high indicates a request to join
754 a cluster with that value. If the requested cluster is not found the
755 device will start its own cluster.
757 u16 cluster_low; // default value 0
758 u16 cluster_high; // default value 0xFFFF
761 Optional configuration of Enable request.
762 Each of the optional parameters have configure flag which
763 determine whether configuration is to be passed or not.
765 u8 config_support_5g;
766 u8 support_5g_val; // default value 0; turned off by default
768 BIT 0 is used to specify to include Service IDs in Sync/Discovery beacons
769 0 - Do not include SIDs in any beacons
770 1 - Include SIDs in all beacons.
771 Rest 7 bits are count field which allows control over the number of SIDs
772 included in the Beacon. 0 means to include as many SIDs that fit into
773 the maximum allow Beacon frame size
775 u8 config_sid_beacon;
776 u8 sid_beacon_val; // default value 0x01
778 The rssi values below should be specified without sign.
779 For eg: -70dBm should be specified as 70.
781 u8 config_2dot4g_rssi_close;
782 u8 rssi_close_2dot4g_val; // default value -60 dBm
784 u8 config_2dot4g_rssi_middle;
785 u8 rssi_middle_2dot4g_val; // default value -70 dBm
787 u8 config_2dot4g_rssi_proximity;
788 u8 rssi_proximity_2dot4g_val;// default value -60dBm
790 u8 config_hop_count_limit;
791 u8 hop_count_limit_val; // default value 0x02
794 Defines 2.4G channel access support
798 u8 config_2dot4g_support;
799 u8 support_2dot4g_val; // default value 0x01
801 Defines 2.4G channels will be used for sync/discovery beacons
802 0 - 2.4G channels not used for beacons
803 1 - 2.4G channels used for beacons
805 u8 config_2dot4g_beacons;
806 u8 beacon_2dot4g_val; // default value 1
808 Defines 2.4G channels will be used for Service Discovery frames
809 0 - 2.4G channels not used for Service Discovery frames
810 1 - 2.4G channels used for Service Discovery frames
812 u8 config_2dot4g_sdf;
813 u8 sdf_2dot4g_val; // default value 1
815 Defines 5G channels will be used for sync/discovery beacons
816 0 - 5G channels not used for beacons
817 1 - 5G channels used for beacons
819 u8 config_5g_beacons;
820 u8 beacon_5g_val; // default value 1 when 5G is enabled
822 Defines 5G channels will be used for Service Discovery frames
823 0 - 5G channels not used for Service Discovery frames
824 1 - 5G channels used for Service Discovery frames
827 u8 sdf_5g_val; // default value is 0 when 5G is enabled
829 1 byte value which defines the RSSI in
830 dBm for a close by Peer in 5 Ghz channels.
831 The rssi values should be specified without sign.
832 For eg: -70dBm should be specified as 70.
834 u8 config_5g_rssi_close;
835 u8 rssi_close_5g_val; // default value -60dBm when 5G is enabled
837 1 byte value which defines the RSSI value in
838 dBm for a close by Peer in 5 Ghz channels.
839 The rssi values should be specified without sign.
840 For eg: -70dBm should be specified as 70.
842 u8 config_5g_rssi_middle;
843 u8 rssi_middle_5g_val; // default value -75dBm when 5G is enabled
845 1 byte value which defines the RSSI filter
846 threshold. Any Service Descriptors received above this
847 value that are configured for RSSI filtering will be dropped.
848 The rssi values should be specified without sign.
849 For eg: -70dBm should be specified as 70.
851 u8 config_5g_rssi_close_proximity;
852 u8 rssi_close_proximity_5g_val; // default value -60dBm when 5G is enabled
854 1 byte quantity which defines the window size over
855 which the “average RSSI” will be calculated over.
857 u8 config_rssi_window_size;
858 u8 rssi_window_size_val; // default value 0x08
860 The 24 bit Organizationally Unique ID + the 8 bit Network Id.
863 u32 oui_val; // default value {0x51, 0x6F, 0x9A, 0x01, 0x00, 0x00}
865 NAN Interface Address, If not configured the Discovery Engine
866 will generate a 6 byte Random MAC.
869 u8 intf_addr_val[NAN_MAC_ADDR_LEN];
871 If set to 1, the Discovery Engine will enclose the Cluster
872 Attribute only sent in Beacons in a Vendor Specific Attribute
873 and transmit in a Service Descriptor Frame.
875 u8 config_cluster_attribute_val;
877 The periodicity in seconds between full scan’s to find any new
878 clusters available in the area. A Full scan should not be done
879 more than every 10 seconds and should not be done less than every
882 u8 config_scan_params;
883 NanSocialChannelScanParams scan_params_val;
885 1 byte quantity which forces the Random Factor to a particular
886 value for all transmitted Sync/Discovery beacons
888 u8 config_random_factor_force;
889 u8 random_factor_force_val; // default value off and set to 0x00
891 1 byte quantity which forces the HC for all transmitted Sync and
892 Discovery Beacon NO matter the real HC being received over the
895 u8 config_hop_count_force;
896 u8 hop_count_force_val; // default value 0x00
898 /* channel frequency in MHz to enable Nan on */
899 u8 config_24g_channel;
900 wifi_channel channel_24g_val; // default value channel 0x6
902 u8 config_5g_channel;
903 wifi_channel channel_5g_val; // default value channel 44 or 149 regulatory
905 /* Configure 2.4/5GHz DW */
906 NanConfigDW config_dw;
909 By default discovery MAC address randomization is enabled
910 and default interval value is 30 minutes i.e. 1800 seconds.
911 The value 0 is used to disable MAC addr randomization.
913 u8 config_disc_mac_addr_randomization;
914 u32 disc_mac_addr_rand_interval_sec; // default value 1800 sec
917 Set/Enable corresponding bits to disable Discovery indications:
918 BIT0 - Disable Discovery MAC Address Event.
919 BIT1 - Disable Started Cluster Event.
920 BIT2 - Disable Joined Cluster Event.
922 u8 discovery_indication_cfg; // default value 0x0
926 Publish Msg Structure
927 Message is used to request the DE to publish the Service Name
928 using the parameters passed into the Discovery Window
931 u16 publish_id;/* id 0 means new publish, any other id is existing publish */
932 u16 ttl; /* how many seconds to run for. 0 means forever until canceled */
934 period: Awake DW Interval for publish(service)
935 Indicates the interval between two Discovery Windows in which
936 the device supporting the service is awake to transmit or
937 receive the Service Discovery frames.
938 Valid values of Awake DW Interval are: 1, 2, 4, 8 and 16, value 0 will
942 NanPublishType publish_type;/* 0= unsolicited, solicited = 1, 2= both */
943 NanTxType tx_type; /* 0 = broadcast, 1= unicast if solicited publish */
944 u8 publish_count; /* number of OTA Publish, 0 means forever until canceled */
945 u16 service_name_len; /* length of service name */
946 u8 service_name[NAN_MAX_SERVICE_NAME_LEN];/* UTF-8 encoded string identifying the service */
948 Field which specifies how the matching indication to host is controlled.
949 0 - Match and Indicate Once
950 1 - Match and Indicate continuous
951 2 - Match and Indicate never. This means don't indicate the match to the host.
954 NanMatchAlg publish_match_indicator;
958 NAN Device that has invoked a Subscribe method corresponding to this Publish method
960 u16 service_specific_info_len;
961 u8 service_specific_info[NAN_MAX_SERVICE_SPECIFIC_INFO_LEN];
964 Ordered sequence of <length, value> pairs which specify further response conditions
965 beyond the service name used to filter subscribe messages to respond to.
966 This is only needed when the PT is set to NAN_SOLICITED or NAN_SOLICITED_UNSOLICITED.
968 u16 rx_match_filter_len;
969 u8 rx_match_filter[NAN_MAX_MATCH_FILTER_LEN];
972 Ordered sequence of <length, value> pairs to be included in the Discovery Frame.
973 If present it is always sent in a Discovery Frame
975 u16 tx_match_filter_len;
976 u8 tx_match_filter[NAN_MAX_MATCH_FILTER_LEN];
979 flag which specifies that the Publish should use the configured RSSI
980 threshold and the received RSSI in order to filter requests
981 0 – ignore the configured RSSI threshold when running a Service
982 Descriptor attribute or Service ID List Attribute through the DE matching logic.
983 1 – use the configured RSSI threshold when running a Service
984 Descriptor attribute or Service ID List Attribute through the DE matching logic.
987 u8 rssi_threshold_flag;
990 8-bit bitmap which allows the Host to associate this publish
991 with a particular Post-NAN Connectivity attribute
992 which has been sent down in a NanConfigureRequest/NanEnableRequest
993 message. If the DE fails to find a configured Post-NAN
994 connectivity attributes referenced by the bitmap,
995 the DE will return an error code to the Host.
996 If the Publish is configured to use a Post-NAN Connectivity
997 attribute and the Host does not refresh the Post-NAN Connectivity
998 attribute the Publish will be canceled and the Host will be sent
999 a PublishTerminatedIndication message.
1003 Set/Enable corresponding bits to disable any indications that follow a publish.
1004 BIT0 - Disable publish termination indication.
1005 BIT1 - Disable match expired indication.
1006 BIT2 - Disable followUp indication received (OTA).
1008 u8 recv_indication_cfg;
1010 Nan accept policy for the specific service(publish)
1012 NanServiceAcceptPolicy service_responder_policy;
1013 /* NAN Cipher Suite Type */
1018 PMK: Info is optional in Discovery phase. PMK info can be passed during
1021 u8 pmk[NAN_PMK_INFO_LEN];
1023 /* Security Context Identifiers length */
1026 Security Context Identifier attribute contains PMKID
1027 shall be included in NDP setup and response messages.
1028 Security Context Identifier, Identifies the Security
1029 Context. For NAN Shared Key Cipher Suite, this field
1030 contains the 16 octet PMKID identifying the PMK used
1031 for setting up the Secure Data Path.
1033 u8 scid[NAN_MAX_SCID_BUF_LEN];
1035 /* NAN configure service discovery extended attributes */
1036 NanSdeaCtrlParams sdea_params;
1038 /* NAN Ranging configuration */
1039 NanRangingCfg ranging_cfg;
1041 /* Enable/disable NAN serivce Ranging auto response mode */
1042 NanRangingAutoResponse ranging_auto_response;
1045 When the ranging_auto_response_cfg is not set, NanRangeRequestInd is
1046 received. Nan Range Response to Peer MAC Addr is notified to indicate
1047 ACCEPT/REJECT/CANCEL to the requestor.
1049 NanRangeResponseCfg range_response_cfg;
1052 Sequence of values indicating the service specific info in SDEA
1054 u16 sdea_service_specific_info_len;
1055 u8 sdea_service_specific_info[NAN_MAX_SDEA_SERVICE_SPECIFIC_INFO_LEN];
1056 } NanPublishRequest;
1059 Publish Cancel Msg Structure
1060 The PublishServiceCancelReq Message is used to request the DE to stop publishing
1061 the Service Name identified by the Publish Id in the message.
1065 } NanPublishCancelRequest;
1068 NAN Subscribe Structure
1069 The SubscribeServiceReq message is sent to the Discovery Engine
1070 whenever the Upper layers would like to listen for a Service Name
1073 u16 subscribe_id; /* id 0 means new subscribe, non zero is existing subscribe */
1074 u16 ttl; /* how many seconds to run for. 0 means forever until canceled */
1076 period: Awake DW Interval for subscribe(service)
1077 Indicates the interval between two Discovery Windows in which
1078 the device supporting the service is awake to transmit or
1079 receive the Service Discovery frames.
1080 Valid values of Awake DW Interval are: 1, 2, 4, 8 and 16, value 0 will
1085 /* Flag which specifies how the Subscribe request shall be processed. */
1086 NanSubscribeType subscribe_type; /* 0 - PASSIVE , 1- ACTIVE */
1088 /* Flag which specifies on Active Subscribes how the Service Response Filter attribute is populated.*/
1089 NanSRFType serviceResponseFilter; /* 0 - Bloom Filter, 1 - MAC Addr */
1091 /* Flag which specifies how the Service Response Filter Include bit is populated.*/
1092 NanSRFIncludeType serviceResponseInclude; /* 0=Do not respond if in the Address Set, 1= Respond */
1094 /* Flag which specifies if the Service Response Filter should be used when creating Subscribes.*/
1095 NanSRFState useServiceResponseFilter; /* 0=Do not send the Service Response Filter,1= send */
1098 Flag which specifies if the Service Specific Info is needed in
1099 the Publish message before creating the MatchIndication
1101 NanSsiInMatchInd ssiRequiredForMatchIndication; /* 0=Not needed, 1= Required */
1104 Field which specifies how the matching indication to host is controlled.
1105 0 - Match and Indicate Once
1106 1 - Match and Indicate continuous
1107 2 - Match and Indicate never. This means don't indicate the match to the host.
1110 NanMatchAlg subscribe_match_indicator;
1113 The number of Subscribe Matches which should occur
1114 before the Subscribe request is automatically terminated.
1116 u8 subscribe_count; /* If this value is 0 this field is not used by the DE.*/
1118 u16 service_name_len;/* length of service name */
1119 u8 service_name[NAN_MAX_SERVICE_NAME_LEN]; /* UTF-8 encoded string identifying the service */
1121 /* Sequence of values which further specify the published service beyond the service name*/
1122 u16 service_specific_info_len;
1123 u8 service_specific_info[NAN_MAX_SERVICE_SPECIFIC_INFO_LEN];
1126 Ordered sequence of <length, value> pairs used to filter out received publish discovery messages.
1127 This can be sent both for a Passive or an Active Subscribe
1129 u16 rx_match_filter_len;
1130 u8 rx_match_filter[NAN_MAX_MATCH_FILTER_LEN];
1133 Ordered sequence of <length, value> pairs included in the
1134 Discovery Frame when an Active Subscribe is used.
1136 u16 tx_match_filter_len;
1137 u8 tx_match_filter[NAN_MAX_MATCH_FILTER_LEN];
1140 Flag which specifies that the Subscribe should use the configured RSSI
1141 threshold and the received RSSI in order to filter requests
1142 0 – ignore the configured RSSI threshold when running a Service
1143 Descriptor attribute or Service ID List Attribute through the DE matching logic.
1144 1 – use the configured RSSI threshold when running a Service
1145 Descriptor attribute or Service ID List Attribute through the DE matching logic.
1148 u8 rssi_threshold_flag;
1151 8-bit bitmap which allows the Host to associate this Active
1152 Subscribe with a particular Post-NAN Connectivity attribute
1153 which has been sent down in a NanConfigureRequest/NanEnableRequest
1154 message. If the DE fails to find a configured Post-NAN
1155 connectivity attributes referenced by the bitmap,
1156 the DE will return an error code to the Host.
1157 If the Subscribe is configured to use a Post-NAN Connectivity
1158 attribute and the Host does not refresh the Post-NAN Connectivity
1159 attribute the Subscribe will be canceled and the Host will be sent
1160 a SubscribeTerminatedIndication message.
1164 NAN Interface Address, conforming to the format as described in
1165 8.2.4.3.2 of IEEE Std. 802.11-2012.
1167 u8 num_intf_addr_present;
1168 u8 intf_addr[NAN_MAX_SUBSCRIBE_MAX_ADDRESS][NAN_MAC_ADDR_LEN];
1170 Set/Enable corresponding bits to disable indications that follow a subscribe.
1171 BIT0 - Disable subscribe termination indication.
1172 BIT1 - Disable match expired indication.
1173 BIT2 - Disable followUp indication received (OTA).
1175 u8 recv_indication_cfg;
1177 /* NAN Cipher Suite Type */
1182 PMK: Info is optional in Discovery phase. PMK info can be passed during
1185 u8 pmk[NAN_PMK_INFO_LEN];
1187 /* Security Context Identifiers length */
1190 Security Context Identifier attribute contains PMKID
1191 shall be included in NDP setup and response messages.
1192 Security Context Identifier, Identifies the Security
1193 Context. For NAN Shared Key Cipher Suite, this field
1194 contains the 16 octet PMKID identifying the PMK used
1195 for setting up the Secure Data Path.
1197 u8 scid[NAN_MAX_SCID_BUF_LEN];
1199 /* NAN configure service discovery extended attributes */
1200 NanSdeaCtrlParams sdea_params;
1202 /* NAN Ranging configuration */
1203 NanRangingCfg ranging_cfg;
1205 /* Enable/disable NAN serivce Ranging auto response mode */
1206 NanRangingAutoResponse ranging_auto_response;
1209 When the ranging_auto_response_cfg is not set, NanRangeRequestInd is
1210 received. Nan Range Response to Peer MAC Addr is notified to indicate
1211 ACCEPT/REJECT/CANCEL to the requestor.
1213 NanRangeResponseCfg range_response_cfg;
1216 Sequence of values indicating the service specific info in SDEA
1218 u16 sdea_service_specific_info_len;
1219 u8 sdea_service_specific_info[NAN_MAX_SDEA_SERVICE_SPECIFIC_INFO_LEN];
1220 } NanSubscribeRequest;
1223 NAN Subscribe Cancel Structure
1224 The SubscribeCancelReq Message is used to request the DE to stop looking for the Service Name.
1228 } NanSubscribeCancelRequest;
1231 Transmit follow up Structure
1232 The TransmitFollowupReq message is sent to the DE to allow the sending of the Service_Specific_Info
1233 to a particular MAC address.
1236 /* Publish or Subscribe Id of an earlier Publish/Subscribe */
1237 u16 publish_subscribe_id;
1240 This Id is the Requestor Instance that is passed as
1241 part of earlier MatchInd/FollowupInd message.
1243 u32 requestor_instance_id;
1244 u8 addr[NAN_MAC_ADDR_LEN]; /* Unicast address */
1245 NanTxPriority priority; /* priority of the request 2=high */
1246 NanTransmitWindowType dw_or_faw; /* 0= send in a DW, 1=send in FAW */
1249 Sequence of values which further specify the published service beyond
1252 u16 service_specific_info_len;
1253 u8 service_specific_info[NAN_MAX_SERVICE_SPECIFIC_INFO_LEN];
1255 Set/Enable corresponding bits to disable responses after followUp.
1256 BIT0 - Disable followUp response from FW.
1258 u8 recv_indication_cfg;
1261 Sequence of values indicating the service specific info in SDEA
1263 u16 sdea_service_specific_info_len;
1264 u8 sdea_service_specific_info[NAN_MAX_SDEA_SERVICE_SPECIFIC_INFO_LEN];
1265 } NanTransmitFollowupRequest;
1268 Stats Request structure
1269 The Discovery Engine can be queried at runtime by the Host processor for statistics
1270 concerning various parts of the Discovery Engine.
1273 NanStatsType stats_type; /* NAN Statistics Request Type */
1274 u8 clear; /* 0= Do not clear the stats and return the current contents , 1= Clear the associated stats */
1279 The NanConfigurationReq message is sent by the Host to the
1280 Discovery Engine in order to configure the Discovery Engine during runtime.
1283 u8 config_sid_beacon;
1285 u8 config_rssi_proximity;
1286 u8 rssi_proximity; // default value -60dBm
1287 u8 config_master_pref;
1288 u8 master_pref; // default value 0x02
1290 1 byte value which defines the RSSI filter threshold.
1291 Any Service Descriptors received above this value
1292 that are configured for RSSI filtering will be dropped.
1293 The rssi values should be specified without sign.
1294 For eg: -70dBm should be specified as 70.
1296 u8 config_5g_rssi_close_proximity;
1297 u8 rssi_close_proximity_5g_val; // default value -60dBm
1299 Optional configuration of Configure request.
1300 Each of the optional parameters have configure flag which
1301 determine whether configuration is to be passed or not.
1304 2 byte quantity which defines the window size over
1305 which the “average RSSI” will be calculated over.
1307 u8 config_rssi_window_size;
1308 u16 rssi_window_size_val; // default value 0x08
1310 If set to 1, the Discovery Engine will enclose the Cluster
1311 Attribute only sent in Beacons in a Vendor Specific Attribute
1312 and transmit in a Service Descriptor Frame.
1314 u8 config_cluster_attribute_val;
1316 The periodicity in seconds between full scan’s to find any new
1317 clusters available in the area. A Full scan should not be done
1318 more than every 10 seconds and should not be done less than every
1321 u8 config_scan_params;
1322 NanSocialChannelScanParams scan_params_val;
1324 1 byte quantity which forces the Random Factor to a particular
1325 value for all transmitted Sync/Discovery beacons
1327 u8 config_random_factor_force;
1328 u8 random_factor_force_val; // default value 0x00
1330 1 byte quantity which forces the HC for all transmitted Sync and
1331 Discovery Beacon NO matter the real HC being received over the
1334 u8 config_hop_count_force;
1335 u8 hop_count_force_val; // default value of 0
1336 /* NAN Post Connectivity Capability */
1337 u8 config_conn_capability;
1338 NanTransmitPostConnectivityCapability conn_capability_val;
1339 /* NAN Post Discover Capability */
1340 u8 num_config_discovery_attr;
1341 NanTransmitPostDiscovery discovery_attr_val[NAN_MAX_POSTDISCOVERY_LEN];
1342 /* NAN Further availability Map */
1344 NanFurtherAvailabilityMap fam_val;
1345 /* Configure 2.4/5GHz DW */
1346 NanConfigDW config_dw;
1348 By default discovery MAC address randomization is enabled
1349 and default interval value is 30 minutes i.e. 1800 seconds.
1350 The value 0 is used to disable MAC addr randomization.
1352 u8 config_disc_mac_addr_randomization;
1353 u32 disc_mac_addr_rand_interval_sec; // default value of 30 minutes
1356 Set/Enable corresponding bits to disable Discovery indications:
1357 BIT0 - Disable Discovery MAC Address Event.
1358 BIT1 - Disable Started Cluster Event.
1359 BIT2 - Disable Joined Cluster Event.
1361 u8 discovery_indication_cfg; // default value of 0
1366 The Discovery Engine can be configured to send up Events whenever a configured
1367 Threshold Crossing Alert (TCA) Type crosses an integral threshold in a particular direction.
1370 NanTcaType tca_type; /* Nan Protocol Threshold Crossing Alert (TCA) Codes */
1372 /* flag which control whether or not an event is generated for the Rising direction */
1373 u8 rising_direction_evt_flag; /* 0 - no event, 1 - event */
1375 /* flag which control whether or not an event is generated for the Falling direction */
1376 u8 falling_direction_evt_flag;/* 0 - no event, 1 - event */
1378 /* flag which requests a previous TCA request to be cleared from the DE */
1379 u8 clear;/*0= Do not clear the TCA, 1=Clear the TCA */
1381 /* 32 bit value which represents the threshold to be used.*/
1386 Beacon Sdf Payload Structure
1387 The Discovery Engine can be configured to publish vendor specific attributes as part of
1388 beacon or service discovery frame transmitted as part of this request..
1392 NanVendorAttribute will have the Vendor Specific Attribute which the
1393 vendor wants to publish as part of Discovery or Sync or Service discovery frame
1395 NanTransmitVendorSpecificAttribute vsa;
1396 } NanBeaconSdfPayloadRequest;
1398 /* Publish statistics. */
1401 u32 validPublishServiceReqMsgs;
1402 u32 validPublishServiceRspMsgs;
1403 u32 validPublishServiceCancelReqMsgs;
1404 u32 validPublishServiceCancelRspMsgs;
1405 u32 validPublishRepliedIndMsgs;
1406 u32 validPublishTerminatedIndMsgs;
1407 u32 validActiveSubscribes;
1410 u32 invalidPublishServiceReqMsgs;
1411 u32 invalidPublishServiceCancelReqMsgs;
1412 u32 invalidActiveSubscribes;
1414 u32 invalidFollowups;
1416 u32 publishNewMatchCount;
1417 u32 pubsubGlobalNewMatchCount;
1420 /* Subscribe statistics. */
1423 u32 validSubscribeServiceReqMsgs;
1424 u32 validSubscribeServiceRspMsgs;
1425 u32 validSubscribeServiceCancelReqMsgs;
1426 u32 validSubscribeServiceCancelRspMsgs;
1427 u32 validSubscribeTerminatedIndMsgs;
1428 u32 validSubscribeMatchIndMsgs;
1429 u32 validSubscribeUnmatchIndMsgs;
1430 u32 validSolicitedPublishes;
1433 u32 invalidSubscribeServiceReqMsgs;
1434 u32 invalidSubscribeServiceCancelReqMsgs;
1435 u32 invalidSubscribeFollowupReqMsgs;
1436 u32 invalidSolicitedPublishes;
1438 u32 invalidFollowups;
1440 u32 bloomFilterIndex;
1441 u32 subscribeNewMatchCount;
1442 u32 pubsubGlobalNewMatchCount;
1443 } NanSubscribeStats;
1445 /* NAN DW Statistics*/
1450 u32 validActionFrames;
1451 u32 validBeaconFrames;
1452 u32 ignoredActionFrames;
1453 u32 ignoredBeaconFrames;
1455 u32 invalidActionFrames;
1456 u32 invalidBeaconFrames;
1457 u32 invalidMacHeaders;
1458 u32 invalidPafHeaders;
1459 u32 nonNanBeaconFrames;
1461 u32 earlyActionFrames;
1462 u32 inDwActionFrames;
1463 u32 lateActionFrames;
1467 u32 totalTRSpUpdates;
1469 u32 completeByTp75DW;
1470 u32 completeByTendDW;
1471 u32 lateActionFramesTx;
1474 /* NAN MAC Statistics. */
1479 u32 validActionFrames;
1480 u32 validBeaconFrames;
1481 u32 ignoredActionFrames;
1482 u32 ignoredBeaconFrames;
1484 u32 invalidActionFrames;
1485 u32 invalidBeaconFrames;
1486 u32 invalidMacHeaders;
1487 u32 invalidPafHeaders;
1488 u32 nonNanBeaconFrames;
1490 u32 earlyActionFrames;
1491 u32 inDwActionFrames;
1492 u32 lateActionFrames;
1496 u32 totalTRSpUpdates;
1498 u32 completeByTp75DW;
1499 u32 completeByTendDW;
1500 u32 lateActionFramesTx;
1506 u32 bloomFilterIndex;
1509 /* NAN Sync Statistics*/
1522 u64 timeSpentInCurrRole;
1523 u64 totalTimeSpentAsMaster;
1524 u64 totalTimeSpentAsNonMasterSync;
1525 u64 totalTimeSpentAsNonMasterNonSync;
1526 u32 transitionsToAnchorMaster;
1527 u32 transitionsToMaster;
1528 u32 transitionsToNonMasterSync;
1529 u32 transitionsToNonMasterNonSync;
1531 u32 amrUpdateRankChangedCount;
1532 u32 amrUpdateBTTChangedCount;
1533 u32 amrUpdateHcChangedCount;
1534 u32 amrUpdateNewDeviceCount;
1537 u32 beaconsAboveHcLimit;
1538 u32 beaconsBelowRssiThresh;
1539 u32 beaconsIgnoredNoSpace;
1540 u32 beaconsForOurCluster;
1541 u32 beaconsForOtherCluster;
1542 u32 beaconCancelRequests;
1543 u32 beaconCancelFailures;
1544 u32 beaconUpdateRequests;
1545 u32 beaconUpdateFailures;
1546 u32 syncBeaconTxAttempts;
1547 u32 syncBeaconTxFailures;
1548 u32 discBeaconTxAttempts;
1549 u32 discBeaconTxFailures;
1550 u32 amHopCountExpireCount;
1554 /* NAN Misc DE Statistics */
1557 u32 validErrorRspMsgs;
1558 u32 validTransmitFollowupReqMsgs;
1559 u32 validTransmitFollowupRspMsgs;
1560 u32 validFollowupIndMsgs;
1561 u32 validConfigurationReqMsgs;
1562 u32 validConfigurationRspMsgs;
1563 u32 validStatsReqMsgs;
1564 u32 validStatsRspMsgs;
1565 u32 validEnableReqMsgs;
1566 u32 validEnableRspMsgs;
1567 u32 validDisableReqMsgs;
1568 u32 validDisableRspMsgs;
1569 u32 validDisableIndMsgs;
1570 u32 validEventIndMsgs;
1571 u32 validTcaReqMsgs;
1572 u32 validTcaRspMsgs;
1573 u32 validTcaIndMsgs;
1574 u32 invalidTransmitFollowupReqMsgs;
1575 u32 invalidConfigurationReqMsgs;
1576 u32 invalidStatsReqMsgs;
1577 u32 invalidEnableReqMsgs;
1578 u32 invalidDisableReqMsgs;
1579 u32 invalidTcaReqMsgs;
1582 /* Publish Response Message structure */
1585 } NanPublishResponse;
1587 /* Subscribe Response Message structure */
1590 } NanSubscribeResponse;
1593 Stats Response Message structure
1594 The Discovery Engine response to a request by the Host for statistics.
1597 NanStatsType stats_type;
1599 NanPublishStats publish_stats;
1600 NanSubscribeStats subscribe_stats;
1601 NanMacStats mac_stats;
1602 NanSyncStats sync_stats;
1603 NanDeStats de_stats;
1604 NanDWStats dw_stats;
1608 /* Response returned for Initiators Data request */
1611 Unique token Id generated on the initiator
1612 side used for a NDP session between two NAN devices
1614 NanDataPathId ndp_instance_id;
1615 } NanDataPathRequestResponse;
1618 NAN Response messages
1621 NanStatusType status; /* contains the result code */
1622 char nan_error[NAN_ERROR_STR_LEN]; /* Describe the NAN error type */
1623 NanResponseType response_type; /* NanResponseType Definitions */
1625 NanPublishResponse publish_response;
1626 NanSubscribeResponse subscribe_response;
1627 NanStatsResponse stats_response;
1628 NanDataPathRequestResponse data_request_response;
1629 NanCapabilities nan_capabilities;
1635 The PublishTerminatedInd message is sent by the DE whenever a Publish
1636 terminates from a user-specified timeout or a unrecoverable error in the DE.
1639 /* Id returned during the initial Publish */
1642 For all user configured termination NAN_STATUS_SUCCESS
1643 and no other reasons expected from firmware.
1645 NanStatusType reason;
1646 char nan_reason[NAN_ERROR_STR_LEN]; /* Describe the NAN reason type */
1647 } NanPublishTerminatedInd;
1651 The MatchInd message is sent once per responding MAC address whenever
1652 the Discovery Engine detects a match for a previous SubscribeServiceReq
1653 or PublishServiceReq.
1656 /* Publish or Subscribe Id of an earlier Publish/Subscribe */
1657 u16 publish_subscribe_id;
1659 A 32 bit Requestor Instance Id which is sent to the Application.
1660 This Id will be sent in any subsequent UnmatchInd/FollowupInd
1663 u32 requestor_instance_id;
1664 u8 addr[NAN_MAC_ADDR_LEN];
1667 Sequence of octets which were received in a Discovery Frame matching the
1670 u16 service_specific_info_len;
1671 u8 service_specific_info[NAN_MAX_SERVICE_SPECIFIC_INFO_LEN];
1674 Ordered sequence of <length, value> pairs received in the Discovery Frame
1675 matching the Subscribe Request.
1677 u16 sdf_match_filter_len;
1678 u8 sdf_match_filter[NAN_MAX_MATCH_FILTER_LEN];
1681 flag to indicate if the Match occurred in a Beacon Frame or in a
1682 Service Discovery Frame.
1683 0 - Match occured in a Service Discovery Frame
1684 1 - Match occured in a Beacon Frame
1686 u8 match_occured_flag;
1689 flag to indicate FW is out of resource and that it can no longer
1690 track this Service Name. The Host still need to send the received
1691 Match_Handle but duplicate MatchInd messages may be received on
1692 this Handle until the resource frees up.
1693 0 - FW is caching this match
1694 1 - FW is unable to cache this match
1696 u8 out_of_resource_flag;
1699 If RSSI filtering was configured in NanSubscribeRequest then this
1700 field will contain the received RSSI value. 0 if not.
1701 All rssi values should be specified without sign.
1702 For eg: -70dBm should be specified as 70.
1707 optional attributes. Each optional attribute is associated with a flag
1708 which specifies whether the attribute is valid or not
1710 /* NAN Post Connectivity Capability received */
1711 u8 is_conn_capability_valid;
1712 NanReceivePostConnectivityCapability conn_capability;
1714 /* NAN Post Discover Capability */
1715 u8 num_rx_discovery_attr;
1716 NanReceivePostDiscovery discovery_attr[NAN_MAX_POSTDISCOVERY_LEN];
1718 /* NAN Further availability Map */
1720 NanFurtherAvailabilityChannel famchan[NAN_MAX_FAM_CHANNELS];
1722 /* NAN Cluster Attribute */
1723 u8 cluster_attribute_len;
1724 u8 cluster_attribute[NAN_MAX_CLUSTER_ATTRIBUTE_LEN];
1726 /* NAN Cipher Suite */
1727 u32 peer_cipher_type;
1729 /* Security Context Identifiers length */
1732 Security Context Identifier attribute contains PMKID
1733 shall be included in NDP setup and response messages.
1734 Security Context Identifier, Identifies the Security
1735 Context. For NAN Shared Key Cipher Suite, this field
1736 contains the 16 octet PMKID identifying the PMK used
1737 for setting up the Secure Data Path.
1739 u8 scid[NAN_MAX_SCID_BUF_LEN];
1741 /* Peer service discovery extended attributes */
1742 NanSdeaCtrlParams peer_sdea_params;
1745 Ranging indication and NanMatchAlg are not tied.
1746 Ex: NanMatchAlg can indicate Match_ONCE, but ranging
1747 indications can be continuous. All ranging indications
1748 depend on SDEA control parameters of ranging required for
1749 continuous, and ingress/egress values in the ranging config.
1750 Ranging indication data is notified if:
1751 1) Ranging required is enabled in SDEA.
1752 range info notified continuous.
1753 2) if range_limit ingress/egress MASKS are enabled
1754 notify once for ingress >= ingress_distance
1755 and egress <= egress_distance, same for ingress_egress_both
1756 3) if the Awake DW intervals are higher than the ranging intervals,
1757 priority is given to the device DW intervalsi.
1760 Range Info includes:
1761 1) distance to the NAN device with the MAC address indicated
1762 with ranged mac address.
1763 2) Ranging event matching the configuration of continuous/ingress/egress.
1765 NanRangeInfo range_info;
1768 Sequence of values indicating the service specific info in SDEA
1770 u16 sdea_service_specific_info_len;
1771 u8 sdea_service_specific_info[NAN_MAX_SDEA_SERVICE_SPECIFIC_INFO_LEN];
1775 MatchExpired Indication
1776 The MatchExpiredInd message is sent whenever the Discovery Engine detects that
1777 a previously Matched Service has been gone for too long. If the previous
1778 MatchInd message for this Publish/Subscribe Id had the out_of_resource_flag
1779 set then this message will not be received
1782 /* Publish or Subscribe Id of an earlier Publish/Subscribe */
1783 u16 publish_subscribe_id;
1785 32 bit value sent by the DE in a previous
1786 MatchInd/FollowupInd to the application.
1788 u32 requestor_instance_id;
1789 } NanMatchExpiredInd;
1792 Subscribe Terminated
1793 The SubscribeTerminatedInd message is sent by the DE whenever a
1794 Subscribe terminates from a user-specified timeout or a unrecoverable error in the DE.
1797 /* Id returned during initial Subscribe */
1800 For all user configured termination NAN_STATUS_SUCCESS
1801 and no other reasons expected from firmware.
1803 NanStatusType reason;
1804 char nan_reason[NAN_ERROR_STR_LEN]; /* Describe the NAN reason type */
1805 } NanSubscribeTerminatedInd;
1808 Followup Indication Message
1809 The FollowupInd message is sent by the DE to the Host whenever it receives a
1810 Followup message from another peer.
1813 /* Publish or Subscribe Id of an earlier Publish/Subscribe */
1814 u16 publish_subscribe_id;
1816 A 32 bit Requestor instance Id which is sent to the Application.
1817 This Id will be used in subsequent UnmatchInd/FollowupInd messages.
1819 u32 requestor_instance_id;
1820 u8 addr[NAN_MAC_ADDR_LEN];
1822 /* Flag which the DE uses to decide if received in a DW or a FAW*/
1823 u8 dw_or_faw; /* 0=Received in a DW, 1 = Received in a FAW*/
1826 Sequence of values which further specify the published service beyond
1829 u16 service_specific_info_len;
1830 u8 service_specific_info[NAN_MAX_SERVICE_SPECIFIC_INFO_LEN];
1833 Sequence of values indicating the service specific info in SDEA
1835 u16 sdea_service_specific_info_len;
1836 u8 sdea_service_specific_info[NAN_MAX_SDEA_SERVICE_SPECIFIC_INFO_LEN];
1840 Event data notifying the Mac address of the Discovery engine.
1841 which is reported as one of the Discovery engine event
1844 u8 addr[NAN_MAC_ADDR_LEN];
1845 } NanMacAddressEvent;
1848 Event data notifying the Cluster address of the cluster
1849 which is reported as one of the Discovery engine event
1852 u8 addr[NAN_MAC_ADDR_LEN];
1856 Discovery Engine Event Indication
1857 The Discovery Engine can inform the Host when significant events occur
1858 The data following the EventId is dependent upon the EventId type.
1859 In other words, each new event defined will carry a different
1860 structure of information back to the host.
1863 NanDiscEngEventType event_type; /* NAN Protocol Event Codes */
1866 MacAddressEvent which will have 6 byte mac address
1867 of the Discovery engine.
1869 NanMacAddressEvent mac_addr;
1871 Cluster Event Data which will be obtained when the
1872 device starts a new cluster or joins a cluster.
1873 The event data will have 6 byte octet string of the
1874 cluster started or joined.
1876 NanClusterEvent cluster;
1878 } NanDiscEngEventInd;
1880 /* Cluster size TCA event*/
1882 /* size of the cluster*/
1884 } NanTcaClusterEvent;
1888 The Discovery Engine can inform the Host when significant events occur.
1889 The data following the TcaId is dependent upon the TcaId type.
1890 In other words, each new event defined will carry a different structure
1891 of information back to the host.
1894 NanTcaType tca_type;
1895 /* flag which defines if the configured Threshold has risen above the threshold */
1896 u8 rising_direction_evt_flag; /* 0 - no event, 1 - event */
1898 /* flag which defines if the configured Threshold has fallen below the threshold */
1899 u8 falling_direction_evt_flag;/* 0 - no event, 1 - event */
1902 This event in obtained when the cluser size threshold
1903 is crossed. Event will have the cluster size
1905 NanTcaClusterEvent cluster;
1910 NAN Disabled Indication
1911 The NanDisableInd message indicates to the upper layers that the Discovery
1912 Engine has flushed all state and has been shutdown. When this message is received
1913 the DE is guaranteed to have left the NAN cluster it was part of and will have terminated
1914 any in progress Publishes or Subscribes.
1918 Following reasons expected:
1920 NAN_STATUS_UNSUPPORTED_CONCURRENCY_NAN_DISABLED
1922 NanStatusType reason;
1923 char nan_reason[NAN_ERROR_STR_LEN]; /* Describe the NAN reason type */
1927 NAN Beacon or SDF Payload Indication
1928 The NanBeaconSdfPayloadInd message indicates to the upper layers that information
1929 elements were received either in a Beacon or SDF which needs to be delivered
1930 outside of a Publish/Subscribe Handle.
1933 /* The MAC address of the peer which sent the attributes.*/
1934 u8 addr[NAN_MAC_ADDR_LEN];
1936 Optional attributes. Each optional attribute is associated with a flag
1937 which specifies whether the attribute is valid or not
1939 /* NAN Receive Vendor Specific Attribute*/
1941 NanReceiveVendorSpecificAttribute vsa;
1943 /* NAN Beacon or SDF Payload Received*/
1944 u8 is_beacon_sdf_payload_received;
1945 NanBeaconSdfPayloadReceive data;
1946 } NanBeaconSdfPayloadInd;
1949 Event Indication notifying the
1950 transmit followup in progress
1955 Following reason codes returned:
1957 NAN_STATUS_NO_OTA_ACK
1958 NAN_STATUS_PROTOCOL_FAILURE
1960 NanStatusType reason;
1961 char nan_reason[NAN_ERROR_STR_LEN]; /* Describe the NAN reason type */
1962 } NanTransmitFollowupInd;
1965 Data request Initiator/Responder
1966 app/service related info
1969 u16 ndp_app_info_len;
1970 u8 ndp_app_info[NAN_DP_MAX_APP_INFO_LEN];
1971 } NanDataPathAppInfo;
1973 /* QoS configuration */
1975 NAN_DP_CONFIG_NO_QOS = 0,
1977 } NanDataPathQosCfg;
1979 /* Configuration params of Data request Initiator/Responder */
1981 /* Status Indicating Security/No Security */
1982 NanDataPathSecurityCfgStatus security_cfg;
1983 NanDataPathQosCfg qos_cfg;
1986 /* Nan Data Path Initiator requesting a data session */
1989 Unique Instance Id identifying the Responder's service.
1990 This is same as publish_id notified on the subscribe side
1991 in a publish/subscribe scenario
1993 u32 requestor_instance_id; /* Value 0 for no publish/subscribe */
1995 /* Config flag for channel request */
1996 NanDataPathChannelCfg channel_request_type;
1997 /* Channel frequency in MHz to start data-path */
1998 wifi_channel channel;
2000 Discovery MAC addr of the publisher/peer
2002 u8 peer_disc_mac_addr[NAN_MAC_ADDR_LEN];
2004 Interface name on which this NDP session is to be started.
2005 This will be the same interface name provided during interface
2008 char ndp_iface[IFNAMSIZ+1];
2009 /* Initiator/Responder Security/QoS configuration */
2010 NanDataPathCfg ndp_cfg;
2011 /* App/Service information of the Initiator */
2012 NanDataPathAppInfo app_info;
2014 /* NAN Cipher Suite Type */
2019 u8 pmk[NAN_PMK_INFO_LEN];
2020 } NanDataPathInitiatorRequest;
2023 Data struct to initiate a data response on the responder side
2024 for an indication received with a data request
2028 Unique token Id generated on the initiator/responder
2029 side used for a NDP session between two NAN devices
2031 NanDataPathId ndp_instance_id;
2033 Interface name on which this NDP session is to be started.
2034 This will be the same interface name provided during interface
2037 char ndp_iface[IFNAMSIZ+1];
2038 /* Initiator/Responder Security/QoS configuration */
2039 NanDataPathCfg ndp_cfg;
2040 /* App/Service information of the responder */
2041 NanDataPathAppInfo app_info;
2042 /* Response Code indicating ACCEPT/REJECT/DEFER */
2043 NanDataPathResponseCode rsp_code;
2045 /* NAN Cipher Suite Type */
2050 u8 pmk[NAN_PMK_INFO_LEN];
2051 } NanDataPathIndicationResponse;
2053 /* NDP termination info */
2055 u8 num_ndp_instances;
2057 Unique token Id generated on the initiator/responder side
2058 used for a NDP session between two NAN devices
2060 NanDataPathId ndp_instance_id[];
2061 } NanDataPathEndRequest;
2064 Event indication received on the
2065 responder side when a Nan Data request or
2066 NDP session is initiated on the Initiator side
2070 Unique Instance Id corresponding to a service/session.
2071 This is similar to the publish_id generated on the
2074 u16 service_instance_id;
2075 /* Discovery MAC addr of the peer/initiator */
2076 u8 peer_disc_mac_addr[NAN_MAC_ADDR_LEN];
2078 Unique token Id generated on the initiator/responder side
2079 used for a NDP session between two NAN devices
2081 NanDataPathId ndp_instance_id;
2082 /* Initiator/Responder Security/QoS configuration */
2083 NanDataPathCfg ndp_cfg;
2084 /* App/Service information of the initiator */
2085 NanDataPathAppInfo app_info;
2086 } NanDataPathRequestInd;
2089 Event indication of data confirm is received on both
2090 initiator and responder side confirming a NDP session
2094 Unique token Id generated on the initiator/responder side
2095 used for a NDP session between two NAN devices
2097 NanDataPathId ndp_instance_id;
2099 NDI mac address of the peer
2100 (required to derive target ipv6 address)
2102 u8 peer_ndi_mac_addr[NAN_MAC_ADDR_LEN];
2103 /* App/Service information of Initiator/Responder */
2104 NanDataPathAppInfo app_info;
2105 /* Response code indicating ACCEPT/REJECT/DEFER */
2106 NanDataPathResponseCode rsp_code;
2108 Reason code indicating the cause for REJECT.
2109 NAN_STATUS_SUCCESS and NAN_STATUS_PROTOCOL_FAILURE are
2110 expected reason codes.
2112 NanStatusType reason_code;
2113 } NanDataPathConfirmInd;
2116 Event indication received on the
2117 initiator/responder side terminating
2121 u8 num_ndp_instances;
2123 Unique token Id generated on the initiator/responder side
2124 used for a NDP session between two NAN devices
2126 NanDataPathId ndp_instance_id[];
2127 } NanDataPathEndInd;
2130 Event indicating Range Request received on the
2134 u16 publish_id;/* id is existing publish */
2135 /* Range Requestor's MAC address */
2136 u8 range_req_intf_addr[NAN_MAC_ADDR_LEN];
2137 } NanRangeRequestInd;
2140 Event indicating Range report on the
2144 u16 publish_id;/* id is existing publish */
2145 /* Range Requestor's MAC address */
2146 u8 range_req_intf_addr[NAN_MAC_ADDR_LEN];
2148 Distance to the NAN device with the MAC address indicated
2149 with ranged mac address.
2151 u32 range_measurement_cm;
2152 } NanRangeReportInd;
2154 /* Response and Event Callbacks */
2156 /* NotifyResponse invoked to notify the status of the Request */
2157 void (*NotifyResponse)(transaction_id id, NanResponseMsg* rsp_data);
2158 /* Callbacks for various Events */
2159 void (*EventPublishTerminated)(NanPublishTerminatedInd* event);
2160 void (*EventMatch) (NanMatchInd* event);
2161 void (*EventMatchExpired) (NanMatchExpiredInd* event);
2162 void (*EventSubscribeTerminated) (NanSubscribeTerminatedInd* event);
2163 void (*EventFollowup) (NanFollowupInd* event);
2164 void (*EventDiscEngEvent) (NanDiscEngEventInd* event);
2165 void (*EventDisabled) (NanDisabledInd* event);
2166 void (*EventTca) (NanTCAInd* event);
2167 void (*EventBeaconSdfPayload) (NanBeaconSdfPayloadInd* event);
2168 void (*EventDataRequest)(NanDataPathRequestInd* event);
2169 void (*EventDataConfirm)(NanDataPathConfirmInd* event);
2170 void (*EventDataEnd)(NanDataPathEndInd* event);
2171 void (*EventTransmitFollowup) (NanTransmitFollowupInd* event);
2172 void (*EventRangeRequest) (NanRangeRequestInd* event);
2173 void (*EventRangeReport) (NanRangeReportInd* event);
2174 } NanCallbackHandler;
2176 /**@brief nan_enable_request
2177 * Enable NAN functionality
2179 * @param transaction_id:
2180 * @param wifi_interface_handle:
2181 * @param NanEnableRequest:
2182 * @return Synchronous wifi_error
2183 * @return Asynchronous NotifyResponse CB return
2184 * NAN_STATUS_SUCCESS
2185 * NAN_STATUS_ALREADY_ENABLED
2186 * NAN_STATUS_INVALID_PARAM
2187 * NAN_STATUS_INTERNAL_FAILURE
2188 * NAN_STATUS_PROTOCOL_FAILURE
2189 * NAN_STATUS_NAN_NOT_ALLOWED
2191 wifi_error nan_enable_request(transaction_id id,
2192 wifi_interface_handle iface,
2193 NanEnableRequest* msg);
2195 /**@brief nan_disbale_request
2196 * Disable NAN functionality.
2198 * @param transaction_id:
2199 * @param wifi_interface_handle:
2200 * @param NanDisableRequest:
2201 * @return Synchronous wifi_error
2202 * @return Asynchronous NotifyResponse CB return
2203 * NAN_STATUS_SUCCESS
2204 * NAN_STATUS_PROTOCOL_FAILURE
2207 wifi_error nan_disable_request(transaction_id id,
2208 wifi_interface_handle iface);
2210 /**@brief nan_publish_request
2211 * Publish request to advertize a service
2213 * @param transaction_id:
2214 * @param wifi_interface_handle:
2215 * @param NanPublishRequest:
2216 * @return Synchronous wifi_error
2217 * @return Asynchronous NotifyResponse CB return
2218 * NAN_STATUS_SUCCESS
2219 * NAN_STATUS_INVALID_PARAM
2220 * NAN_STATUS_PROTOCOL_FAILURE
2221 * NAN_STATUS_NO_RESOURCE_AVAILABLE
2222 * NAN_STATUS_INVALID_PUBLISH_SUBSCRIBE_ID
2224 wifi_error nan_publish_request(transaction_id id,
2225 wifi_interface_handle iface,
2226 NanPublishRequest* msg);
2228 /**@brief nan_publish_cancel_request
2229 * Cancel previous publish request
2231 * @param transaction_id:
2232 * @param wifi_interface_handle:
2233 * @param NanPublishCancelRequest:
2234 * @return Synchronous wifi_error
2235 * @return Asynchronous NotifyResponse CB return
2236 * NAN_STATUS_SUCCESS
2237 * NAN_STATUS_INVALID_PUBLISH_SUBSCRIBE_ID
2238 * NAN_STATUS_INTERNAL_FAILURE
2240 wifi_error nan_publish_cancel_request(transaction_id id,
2241 wifi_interface_handle iface,
2242 NanPublishCancelRequest* msg);
2244 /**@brief nan_subscribe_request
2245 * Subscribe request to search for a service
2247 * @param transaction_id:
2248 * @param wifi_interface_handle:
2249 * @param NanSubscribeRequest:
2250 * @return Synchronous wifi_error
2251 * @return Asynchronous NotifyResponse CB return
2252 * NAN_STATUS_SUCCESS
2253 * NAN_STATUS_INVALID_PARAM
2254 * NAN_STATUS_PROTOCOL_FAILURE
2255 * NAN_STATUS_INTERNAL_FAILURE
2256 * NAN_STATUS_NO_SPACE_AVAILABLE
2257 * NAN_STATUS_INVALID_PUBLISH_SUBSCRIBE_ID
2259 wifi_error nan_subscribe_request(transaction_id id,
2260 wifi_interface_handle iface,
2261 NanSubscribeRequest* msg);
2263 /**@brief nan_subscribe_cancel_request
2264 * Cancel previous subscribe requests.
2266 * @param transaction_id:
2267 * @param wifi_interface_handle:
2268 * @param NanSubscribeRequest:
2269 * @return Synchronous wifi_error
2270 * @return Asynchronous NotifyResponse CB return
2271 * NAN_STATUS_SUCCESS
2272 * NAN_STATUS_INVALID_PUBLISH_SUBSCRIBE_ID
2273 * NAN_STATUS_INTERNAL_FAILURE
2275 wifi_error nan_subscribe_cancel_request(transaction_id id,
2276 wifi_interface_handle iface,
2277 NanSubscribeCancelRequest* msg);
2279 /**@brief nan_transmit_followup_request
2280 * NAN transmit follow up request
2282 * @param transaction_id:
2283 * @param wifi_interface_handle:
2284 * @param NanTransmitFollowupRequest:
2285 * @return Synchronous wifi_error
2286 * @return Asynchronous NotifyResponse CB return
2287 * NAN_STATUS_SUCCESS
2288 * NAN_STATUS_INVALID_PARAM
2289 * NAN_STATUS_INTERNAL_FAILURE
2290 * NAN_STATUS_INVALID_PUBLISH_SUBSCRIBE_ID
2291 * NAN_STATUS_INVALID_REQUESTOR_INSTANCE_ID
2292 * NAN_STATUS_FOLLOWUP_QUEUE_FULL
2293 * @return Asynchronous TransmitFollowupInd CB return
2294 * NAN_STATUS_SUCCESS
2295 * NAN_STATUS_PROTOCOL_FAILURE
2296 * NAN_STATUS_NO_OTA_ACK
2298 wifi_error nan_transmit_followup_request(transaction_id id,
2299 wifi_interface_handle iface,
2300 NanTransmitFollowupRequest* msg);
2302 /**@brief nan_stats_request
2303 * Request NAN statistics from Discovery Engine.
2305 * @param transaction_id:
2306 * @param wifi_interface_handle:
2307 * @param NanStatsRequest:
2308 * @return Synchronous wifi_error
2309 * @return Asynchronous NotifyResponse CB return
2310 * NAN_STATUS_SUCCESS
2311 * NAN_STATUS_INTERNAL_FAILURE
2312 * NAN_STATUS_INVALID_PARAM
2314 wifi_error nan_stats_request(transaction_id id,
2315 wifi_interface_handle iface,
2316 NanStatsRequest* msg);
2318 /**@brief nan_config_request
2319 * NAN configuration request.
2321 * @param transaction_id:
2322 * @param wifi_interface_handle:
2323 * @param NanConfigRequest:
2324 * @return Synchronous wifi_error
2325 * @return Asynchronous NotifyResponse CB return
2326 * NAN_STATUS_SUCCESS
2327 * NAN_STATUS_INVALID_PARAM
2328 * NAN_STATUS_PROTOCOL_FAILURE
2329 * NAN_STATUS_INTERNAL_FAILURE
2331 wifi_error nan_config_request(transaction_id id,
2332 wifi_interface_handle iface,
2333 NanConfigRequest* msg);
2335 /**@brief nan_tca_request
2336 * Configure the various Threshold crossing alerts
2338 * @param transaction_id:
2339 * @param wifi_interface_handle:
2340 * @param NanStatsRequest:
2341 * @return Synchronous wifi_error
2342 * @return Asynchronous NotifyResponse CB return
2343 * NAN_STATUS_SUCCESS
2344 * NAN_STATUS_INVALID_PARAM
2345 * NAN_STATUS_INTERNAL_FAILURE
2347 wifi_error nan_tca_request(transaction_id id,
2348 wifi_interface_handle iface,
2349 NanTCARequest* msg);
2351 /**@brief nan_beacon_sdf_payload_request
2352 * Set NAN Beacon or sdf payload to discovery engine.
2353 * This instructs the Discovery Engine to begin publishing the
2354 * received payload in any Beacon or Service Discovery Frame transmitted
2356 * @param transaction_id:
2357 * @param wifi_interface_handle:
2358 * @param NanStatsRequest:
2359 * @return Synchronous wifi_error
2360 * @return Asynchronous NotifyResponse CB return
2361 * NAN_STATUS_SUCCESS
2362 * NAN_STATUS_INVALID_PARAM
2363 * NAN_STATUS_INTERNAL_FAILURE
2365 wifi_error nan_beacon_sdf_payload_request(transaction_id id,
2366 wifi_interface_handle iface,
2367 NanBeaconSdfPayloadRequest* msg);
2369 /* Register NAN callbacks. */
2370 wifi_error nan_register_handler(wifi_interface_handle iface,
2371 NanCallbackHandler handlers);
2373 /* Get NAN HAL version. */
2374 wifi_error nan_get_version(wifi_handle handle,
2375 NanVersion* version);
2377 /**@brief nan_get_capabilities
2378 * Get NAN Capabilities
2380 * @param transaction_id:
2381 * @param wifi_interface_handle:
2382 * @return Synchronous wifi_error
2383 * @return Asynchronous NotifyResponse CB return
2384 * NAN_STATUS_SUCCESS
2386 /* Get NAN capabilities. */
2387 wifi_error nan_get_capabilities(transaction_id id,
2388 wifi_interface_handle iface);
2390 /* ========== Nan Data Path APIs ================ */
2391 /**@brief nan_data_interface_create
2392 * Create NAN Data Interface.
2394 * @param transaction_id:
2395 * @param wifi_interface_handle:
2396 * @param iface_name:
2397 * @return Synchronous wifi_error
2398 * @return Asynchronous NotifyResponse CB return
2399 * NAN_STATUS_SUCCESS
2400 * NAN_STATUS_INVALID_PARAM
2401 * NAN_STATUS_INTERNAL_FAILURE
2403 wifi_error nan_data_interface_create(transaction_id id,
2404 wifi_interface_handle iface,
2407 /**@brief nan_data_interface_delete
2408 * Delete NAN Data Interface.
2410 * @param transaction_id:
2411 * @param wifi_interface_handle:
2412 * @param iface_name:
2413 * @return Synchronous wifi_error
2414 * @return Asynchronous NotifyResponse CB return
2415 * NAN_STATUS_SUCCESS
2416 * NAN_STATUS_INVALID_PARAM
2417 * NAN_STATUS_INTERNAL_FAILURE
2419 wifi_error nan_data_interface_delete(transaction_id id,
2420 wifi_interface_handle iface,
2423 /**@brief nan_data_request_initiator
2424 * Initiate a NAN Data Path session.
2426 * @param transaction_id:
2427 * @param wifi_interface_handle:
2428 * @param NanDataPathInitiatorRequest:
2429 * @return Synchronous wifi_error
2430 * @return Asynchronous NotifyResponse CB return
2431 * NAN_STATUS_SUCCESS
2432 * NAN_STATUS_INVALID_PARAM
2433 * NAN_STATUS_INTERNAL_FAILURE
2434 * NAN_STATUS_PROTOCOL_FAILURE
2435 * NAN_STATUS_INVALID_REQUESTOR_INSTANCE_ID
2437 wifi_error nan_data_request_initiator(transaction_id id,
2438 wifi_interface_handle iface,
2439 NanDataPathInitiatorRequest* msg);
2441 /**@brief nan_data_indication_response
2442 * Response to a data indication received
2443 * corresponding to a NDP session. An indication
2444 * is received with a data request and the responder
2445 * will send a data response
2447 * @param transaction_id:
2448 * @param wifi_interface_handle:
2449 * @param NanDataPathIndicationResponse:
2450 * @return Synchronous wifi_error
2451 * @return Asynchronous NotifyResponse CB return
2452 * NAN_STATUS_SUCCESS
2453 * NAN_STATUS_INVALID_PARAM
2454 * NAN_STATUS_INTERNAL_FAILURE
2455 * NAN_STATUS_PROTOCOL_FAILURE
2456 * NAN_STATUS_INVALID_NDP_ID
2458 wifi_error nan_data_indication_response(transaction_id id,
2459 wifi_interface_handle iface,
2460 NanDataPathIndicationResponse* msg);
2462 /**@brief nan_data_end
2463 * NDL termination request: from either Initiator/Responder
2465 * @param transaction_id:
2466 * @param wifi_interface_handle:
2467 * @param NanDataPathEndRequest:
2468 * @return Synchronous wifi_error
2469 * @return Asynchronous NotifyResponse CB return
2470 * NAN_STATUS_SUCCESS
2471 * NAN_STATUS_INVALID_PARAM
2472 * NAN_STATUS_INTERNAL_FAILURE
2473 * NAN_STATUS_PROTOCOL_FAILURE
2474 * NAN_STATUS_INVALID_NDP_ID
2476 wifi_error nan_data_end(transaction_id id,
2477 wifi_interface_handle iface,
2478 NanDataPathEndRequest* msg);
2481 #endif /* __cplusplus */
2483 #endif /* __NAN_H__ */