2 * Copyright 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.
17 package android.hardware.wifi@1.0;
20 * Enum values indicating the status of operation.
22 enum WifiStatusCode : uint32_t {
25 /** Method invoked on an invalid |IWifiChip| object. */
26 ERROR_WIFI_CHIP_INVALID,
27 /** Method invoked on an invalid |IWifiIface| object. */
28 ERROR_WIFI_IFACE_INVALID,
29 /** Method invoked on an invalid |IWifiRttController| object. */
30 ERROR_WIFI_RTT_CONTROLLER_INVALID,
40 * Generic structure to return the status of an operation.
45 * A vendor specific error message from the vendor to provide more
46 * information beyond the reason code.
52 * List of Iface types supported.
54 enum IfaceType : uint32_t {
59 * NAN control interface. Datapath support must be queried and created
60 * through this interface.
66 * An identifier assigned to every chip on the device.
68 typedef uint32_t ChipId;
71 * An identifier for a mode that the chip can be put in.
73 typedef uint32_t ChipModeId;
76 * A unique handle provided by the client to identify individual invocations of
77 * certain API's like |IWifiStaIface.startBackgroundScan|,
78 * |IWifiStaIface.installApfPacketFilter|, etc.
80 typedef uint32_t CommandId;
83 * Channel frequency in Mhz.
85 typedef uint32_t WifiChannelInMhz;
88 * Channel operating width in Mhz.
90 enum WifiChannelWidthInMhz : uint32_t {
102 * Channel information.
104 struct WifiChannelInfo {
106 * Channel width (20, 40, 80, 80+80, 160).
108 WifiChannelWidthInMhz width;
110 * Primary 20 MHz channel.
112 WifiChannelInMhz centerFreq;
114 * Center frequency (MHz) first segment.
116 WifiChannelInMhz centerFreq0;
118 * Center frequency (MHz) second segment.
120 WifiChannelInMhz centerFreq1;
126 typedef int32_t Rssi;
129 * Mac Address type. 6 octets representing physical address of a device.
131 typedef uint8_t[6] MacAddress;
134 * SSID type. 32 octets representing the network.
136 typedef uint8_t[32] Ssid;
139 * BSSID type. 6 octets representing the physical address of an AP.
141 typedef MacAddress Bssid;
144 * TimeStamp in milliseconds (ms).
146 typedef uint32_t TimeStampInMs;
149 * TimeStamp in microseconds (us).
151 typedef uint64_t TimeStampInUs;
154 * TimeStamp in picoseconds (ps).
156 typedef uint64_t TimeSpanInPs;
159 * Information elements contained within the |ScanResult| structure.
160 * These elements correspond to the IEEE_802.11 standard.
162 struct WifiInformationElement {
167 enum WifiRatePreamble : uint32_t {
176 * Number of spatial streams in VHT/HT.
178 enum WifiRateNss : uint32_t {
188 struct WifiRateInfo {
190 * Preamble used for RTT measurements.
192 WifiRatePreamble preamble;
194 * Number of spatial streams.
198 * Bandwidth of channel.
200 WifiChannelWidthInMhz bw;
202 * OFDM/CCK rate code would be as per ieee std in the units of 0.5mbps.
203 * HT/VHT it would be mcs index.
207 * Bitrate in units of 100 Kbps.
209 uint32_t bitRateInKbps;
213 * Wifi bands defined in 80211 spec.
215 enum WifiBand : uint32_t {
216 BAND_UNSPECIFIED = 0,
232 BAND_5GHZ_WITH_DFS = 6,
234 * 2.4 GHz + 5 GHz; no DFS.
238 * 2.4 GHz + 5 GHz with DFS
240 BAND_24GHZ_5GHZ_WITH_DFS = 7
244 * STA specific types.
245 * TODO(b/32159498): Move to a separate sta_types.hal.
248 * Parameters to specify the APF capabilities of this iface.
250 struct StaApfPacketFilterCapabilities {
252 * Version of the packet filter interpreter supported
256 * Maximum size of the filter bytecodes in byte for an iface.
262 * Parameters to specify the Background Scan capabilities of this iface.
264 struct StaBackgroundScanCapabilities {
266 * Maximum number of byte available for cached scan results
268 uint32_t maxCacheSize;
270 * Maximum number of buckets that can be supplied for a scan
274 * Maximum number of APs that must be stored for each scan.
276 uint32_t maxApCachePerScan;
278 * Max reporting number of scans threshold that can be specified in the scan
281 int32_t maxReportingThreshold;
285 * Mask of event reporting schemes that can be specified in background scan
288 enum StaBackgroundScanBucketEventReportSchemeMask : uint32_t {
290 * Report a scan completion event after scan. If this is not set then scan
291 * completion events must be reported if report_threshold_percent or
292 * report_threshold_num_scans is reached.
296 * Forward scan results (beacons/probe responses + IEs) in real time to HAL,
297 * in addition to completion events.
298 * Note: To keep backward compatibility, fire completion events regardless
299 * of REPORT_EVENTS_EACH_SCAN.
301 FULL_RESULTS = 1 << 1,
303 * Controls if scans for this bucket must be placed in the results buffer.
309 * Max limits for background scan.
311 enum StaScanLimits : uint32_t {
314 MAX_AP_CACHE_PER_SCAN = 32
318 * Background Scan parameters per bucket that can be specified in background
321 struct StaBackgroundScanBucketParameters {
323 * Bands to scan or |BAND_UNSPECIFIED| if frequencies list must be used
328 * Channel frequencies (in Mhz) to scan if |band| is set to
329 * |BAND_UNSPECIFIED|.
330 * Max length: |StaScanLimits.MAX_CHANNELS|.
332 vec<WifiChannelInMhz> frequencies;
334 * Period at which this bucket must be scanned (in milliseconds). Must be an integer
335 * multiple of the |basePeriodInMs| specified in the BackgroundScanParameters.
339 * Bitset of |StaBackgroundScanBucketEventReportSchemeMask| values controlling
340 * when events for this bucket must be reported.
342 bitfield<StaBackgroundScanBucketEventReportSchemeMask> eventReportScheme;
344 * For exponential back off. If |exponentialMaxPeriodInMs| is non zero or
345 * different than period, then this bucket is an exponential backoff bucket
346 * and the scan period must grow exponentially as per formula:
347 * actual_period(N) = period * (base ^ (N/step_count))
348 * to this maximum period (in milliseconds).
350 uint32_t exponentialMaxPeriodInMs;
352 * For exponential back off. multiplier: new_period=old_period * base
354 uint32_t exponentialBase;
356 * For exponential back off. Number of scans to perform for a given
359 uint32_t exponentialStepCount;
363 * Background Scan parameters that can be specified in background scan
366 struct StaBackgroundScanParameters {
368 * GCD of all bucket periods (in milliseconds).
370 uint32_t basePeriodInMs;
372 * Maximum number of APs that must be stored for each scan. If the maximum
373 * is reached the highest RSSI results must be returned.
374 * Max length: |StaScanLimits.MAX_AP_CACHE_PER_SCAN|.
376 uint32_t maxApPerScan;
378 * % cache buffer filled threshold at which the host must be notified of
379 * batched scan results.
381 uint32_t reportThresholdPercent;
383 * Threshold at which the AP must be woken up, in number of scans.
385 uint32_t reportThresholdNumScans;
387 * List of buckets to be scheduled.
388 * Max length: |StaScanLimits.MAX_BUCKETS|.
390 vec<StaBackgroundScanBucketParameters> buckets;
394 * Packet stats for different traffic categories.
396 struct StaLinkLayerIfacePacketStats {
398 * Number of received unicast data packets.
402 * Number of successfully transmitted unicast data pkts (ACK rcvd).
406 * Number of transmitted unicast data pkt losses (no ACK).
410 * Number of transmitted unicast data retry pkts.
416 * Iface statistics for the current connection.
418 struct StaLinkLayerIfaceStats {
420 * Number beacons received from the connected AP.
424 * Access Point Beacon and Management frames RSSI (averaged).
428 * WME Best Effort Access Category packet counters.
430 StaLinkLayerIfacePacketStats wmeBePktStats;
432 * WME Background Access Category packet counters.
434 StaLinkLayerIfacePacketStats wmeBkPktStats;
436 * WME Video Access Category packet counters.
438 StaLinkLayerIfacePacketStats wmeViPktStats;
440 * WME Voice Access Category packet counters.
442 StaLinkLayerIfacePacketStats wmeVoPktStats;
446 * Cumulative radio statistics since collection was enabled.
448 struct StaLinkLayerRadioStats {
450 * Time for which the radio is awake.
454 * Total time for which the radio is in active transmission.
458 * Time for which the radio is in active tranmission per tx level.
460 vec<uint32_t> txTimeInMsPerLevel;
462 * Time for which the radio is in active receive.
466 * Total time for which the radio is awake due to scan.
468 uint32_t onTimeInMsForScan;
472 * Link layer stats retrieved via |getLinkLayerStats|.
474 struct StaLinkLayerStats {
475 StaLinkLayerIfaceStats iface;
476 StaLinkLayerRadioStats radio;
478 * TimeStamp for each stats sample.
479 * This is the absolute milliseconds from boot when these stats were
482 TimeStampInMs timeStampInMs;
486 * Structure describing all the information about a single access point seen
489 struct StaScanResult {
490 TimeStampInUs timeStampInUs;
494 WifiChannelInMhz frequency;
495 uint16_t beaconPeriodInMs;
497 vec<WifiInformationElement> informationElements;
501 * Mask of flags set in the |ScanData| instance.
503 enum StaScanDataFlagMask : int32_t {
505 * Indicates that a scan was interrupted/did not occur so results may be
508 INTERRUPTED = 1 << 0,
512 * Structure describing all the information about all the access points seen during
517 * Bitset containing |ScanDataFlagMask| values.
519 bitfield<StaScanDataFlagMask> flags;
521 * Bitset where each bit indicates if the bucket with that index (starting at
524 uint32_t bucketsScanned;
526 * List of scan results.
528 vec<StaScanResult> results;
532 * Structure describing the roaming control capabilities supported.
534 struct StaRoamingCapabilities {
536 * Maximum number of BSSID's that may be blacklisted.
538 uint32_t maxBlacklistSize;
540 * Maximum number of SSID's that may be whitelisted.
542 uint32_t maxWhitelistSize;
546 * Structure describing the roaming control configuration.
548 struct StaRoamingConfig {
550 * List of BSSID's that are blacklisted for roaming.
552 vec<Bssid> bssidBlacklist;
554 * List of SSID's that are whitelisted for roaming.
556 vec<Ssid> ssidWhitelist;
560 * Enum describing the various states to set the roaming
563 enum StaRoamingState : uint8_t {
565 * Driver/Firmware must not perform any roaming.
569 * Driver/Firmware is allowed to perform roaming respecting
570 * the |StaRoamingConfig| parameters set using |configureRoaming|.
576 * NAN specific types.
577 * TODO(b/32159498): Move to a separate nan_types.hal.
579 * References to "NAN Spec" are to the Wi-Fi Alliance "Wi-Fi Neighbor Awareness
580 * Networking (NAN) Technical Specification".
584 * A unique short handle provided by the client to identify individual invocations of
585 * certain API's like |IWifiNanIface.*|.
587 typedef uint16_t CommandIdShort;
590 * NAN API response codes used in request notifications and events.
592 enum NanStatusType : uint32_t {
594 /* NAN Discovery Engine/Host driver failures */
595 INTERNAL_FAILURE = 1,
596 /* NAN OTA failures */
597 PROTOCOL_FAILURE = 2,
598 /* The publish/subscribe discovery session id is invalid */
599 INVALID_SESSION_ID = 3,
600 /* Out of resources to fufill request */
601 NO_RESOURCES_AVAILABLE = 4,
602 /* Invalid arguments passed */
604 /* Invalid peer id */
606 /* Invalid NAN data-path (ndp) id */
608 /* Attempting to enable NAN when not available, e.g. wifi is disabled */
610 /* Over the air ACK not received */
612 /* Attempting to enable NAN when already enabled */
613 ALREADY_ENABLED = 10,
614 /* Can't queue tx followup message foor transmission */
615 FOLLOWUP_TX_QUEUE_FULL = 11,
616 /* Unsupported concurrency of NAN and another feature - NAN disabled */
617 UNSUPPORTED_CONCURRENCY_NAN_DISABLED = 12
621 * The discovery bands supported by NAN.
623 enum NanBandIndex : uint32_t {
629 * The status information returned in NAN notifications.
631 struct WifiNanStatus {
633 * Status of the command request.
635 NanStatusType status;
637 * Further description of the issue causing a failure.
643 * NAN Match indication type: control how often to trigger |IWifiNanIfaceEventCallback.eventMatch|
644 * for a single discovery session - i.e. continuously discovering the same publisher with no new
647 enum NanMatchAlg : uint32_t {
648 MATCH_ONCE = 0, // Only trigger |IWifiNanIfaceEventCallback.eventMatch| once
649 MATCH_CONTINUOUS, // Trigger |IWifiNanIfaceEventCallback.eventMatch| every time
650 MATCH_NEVER, // Never trigger |IWifiNanIfaceEventCallback.eventMatch|
654 * NAN publish discovery session types.
656 enum NanPublishType : uint32_t {
657 UNSOLICITED = 0, // Publish session broadcasts discovery packets
658 SOLICITED, // Publish session silent, responds to active subscribes queries
659 UNSOLICITED_SOLICITED, // Both
663 * NAN transmit type used in |NanPublishType.SOLICITED| or |NanPublishType.UNSOLICITED_SOLICITED|
664 * publish discovery sessions. Describes the addressing of the packet responding to an ACTIVE
667 enum NanTxType : uint32_t {
668 BROADCAST = 0, // Respond with a broadcast packet
669 UNICAST, // Respond with a unicast packet
673 * NAN subscribe discovery session types.
675 enum NanSubscribeType : uint32_t {
676 PASSIVE = 0, // Subscribe session scans for |NanPublishType.UNSOLICITED| publish sessions.
677 ACTIVE, // Subscribe session probes for |NanPublishType.SOLICITED| publish sessions.
681 * NAN Service Response Filter Attribute Bit.
683 enum NanSrfType : uint32_t {
684 BLOOM_FILTER = 0, // Use a Bloom filter.
685 PARTIAL_MAC_ADDR, // Use a list of MAC addresses.
689 * NAN DP (data-path) channel config options.
691 enum NanDataPathChannelCfg : uint32_t {
692 CHANNEL_NOT_REQUESTED = 0, // No channel request is specified.
693 REQUEST_CHANNEL_SETUP, // Channel request is specified - but may be overridden by firmware.
694 FORCE_CHANNEL_SETUP, // Channel request is specified and must be respected. If the firmware
695 // cannot honor the request then the data-path request is rejected.
699 * NAN band-specific configuration.
701 struct NanBandSpecificConfig {
703 * RSSI values controlling clustering behavior per spec. RSSI values are specified without a sign,
704 * e.g. a value of -65dBm would be specified as 65.
706 uint8_t rssiClose; // NAN Spec: RSSI_close
707 uint8_t rssiMiddle; // NAN Spec: RSSI_middle
709 * RSSI value determining whether discovery is near (used if enabled in discovery by
710 * |NanDiscoveryCommonConfig.useRssiThreshold|).
711 * RSSI values are specified without a sign, e.g. a value of -65dBm would be specified as 65.
712 * NAN Spec: RSSI_close_proximity
714 uint8_t rssiCloseProximity;
716 * Dwell time of each discovery channel in milliseconds. If set to 0 then the firmware determines
717 * the dwell time to use.
721 * Scan period of each discovery channel in seconds. If set to 0 then the firmware determines
722 * the scan period to use.
724 uint16_t scanPeriodSec;
726 * Specifies the discovery window interval for Sync beacons and SDF's.
727 * Valid values of DW Interval are: 1, 2, 3, 4 and 5 corresponding to 1, 2, 4, 8, and 16 DWs.
729 * - reserved in 2.4GHz band
730 * - no wakeup at all in 5GHz band
731 * The publish/subscribe period values don't override this device level configurations if
733 * Configuration is only used only if |validDiscoveryWindowIntervalVal| is set to true.
734 * NAN Spec: Device Capability Attribute / 2.4 GHz DW, Device Capability Attribute / 5 GHz DW
736 bool validDiscoveryWindowIntervalVal;
737 uint8_t discoveryWindowIntervalVal;
741 * Debug configuration parameters. Many of these allow non-standard-compliant operation and are
742 * not intended for normal operational mode.
744 struct NanDebugConfig {
746 * Specification of the lower 2 bytes of the cluster ID. The cluster ID is 50-60-9a-01-00-00 to
747 * 50-60-9a-01-FF-FF. Configuration of the bottom and top values of the range (which defaults to
748 * 0x0000 and 0xFFFF respectively).
749 * Configuration is only used if |validClusterIdVals| is set to true.
751 bool validClusterIdVals;
752 uint16_t clusterIdBottomRangeVal;
753 uint16_t clusterIdTopRangeVal;
755 * NAN management interface address, if specified (|validIntfAddrVal| is true) then overrides any
756 * other configuration (specifically the default randomization configured by
757 * |NanConfigRequest.macAddressRandomizationIntervalSec|).
759 bool validIntfAddrVal;
760 MacAddress intfAddrVal;
762 * Combination of the 24 bit Organizationally Unique ID (OUI) and the 8 bit OUI Type.
763 * Used if |validOuiVal| is set to true.
768 * Force the Random Factor to the specified value for all transmitted Sync/Discovery beacons.
769 * Used if |validRandomFactorForceVal| is set to true.
770 * NAN Spec: Master Indication Attribute / Random Factor
772 bool validRandomFactorForceVal;
773 uint8_t randomFactorForceVal;
775 * Forces the hop-count for all transmitted Sync and Discovery Beacons NO matter the real
776 * hop-count being received over the air. Used if the |validHopCountForceVal}| flag is set to
778 * NAN Spec: Cluster Attribute / Anchor Master Information / Hop Count to Anchor Master
780 bool validHopCountForceVal;
781 uint8_t hopCountForceVal;
783 * Frequency in MHz to of the discovery channel in the specified band. Indexed by |NanBandIndex|.
784 * Used if the |validDiscoveryChannelVal| is set to true.
786 bool validDiscoveryChannelVal;
787 WifiChannelInMhz[2] discoveryChannelMhzVal;
789 * Specifies whether sync/discovery beacons are transmitted in the specified band. Indexed by
790 * |NanBandIndex|. Used if the |validUseBeaconsInBandVal| is set to true.
792 bool validUseBeaconsInBandVal;
793 bool[2] useBeaconsInBandVal;
795 * Specifies whether SDF (service discovery frames) are transmitted in the specified band. Indexed
796 * by |NanBandIndex|. Used if the |validUseSdfInBandVal| is set to true.
798 bool validUseSdfInBandVal;
799 bool[2] useSdfInBandVal;
803 * Configuration parameters of NAN: used when enabling and re-configuring a NAN cluster.
805 struct NanConfigRequest {
807 * Master preference of this device.
808 * NAN Spec: Master Indication Attribute / Master Preference
812 * Controls whether or not the |IWifiNanIfaceEventCallback.eventClusterEvent| will be delivered
813 * for |NanClusterEventType.DISCOVERY_MAC_ADDRESS_CHANGED|.
815 bool disableDiscoveryAddressChangeIndication;
817 * Controls whether or not the |IWifiNanIfaceEventCallback.eventClusterEvent| will be delivered
818 * for |NanClusterEventType.STARTED_CLUSTER|.
820 bool disableStartedClusterIndication;
822 * Controls whether or not the |IWifiNanIfaceEventCallback.eventClusterEvent| will be delivered
823 * for |NanClusterEventType.JOINED_CLUSTER|.
825 bool disableJoinedClusterIndication;
827 * Control whether publish service IDs are included in Sync/Discovery beacons.
828 * NAN Spec: Service ID List Attribute
830 bool includePublishServiceIdsInBeacon;
832 * If |includePublishServiceIdsInBeacon| is true then specifies the number of publish service IDs
833 * to include in the Sync/Discovery beacons:
834 * Value = 0: include as many service IDs as will fit into the maximum allowed beacon frame size.
835 * Value must fit within 7 bits - i.e. <= 127.
837 uint8_t numberOfPublishServiceIdsInBeacon;
839 * Control whether subscribe service IDs are included in Sync/Discovery beacons.
840 * Spec: Subscribe Service ID List Attribute
842 bool includeSubscribeServiceIdsInBeacon;
844 * If |includeSubscribeServiceIdsInBeacon| is true then specifies the number of subscribe service
845 * IDs to include in the Sync/Discovery beacons:
846 * Value = 0: include as many service IDs as will fit into the maximum allowed beacon frame size.
847 * Value must fit within 7 bits - i.e. <= 127.
849 uint8_t numberOfSubscribeServiceIdsInBeacon;
851 * Number of samples used to calculate RSSI.
853 uint16_t rssiWindowSize;
855 * Specifies the interval in seconds that the NAN management interface MAC address is randomized.
856 * A value of 0 is used to disable the MAC address randomization
858 uint32_t macAddressRandomizationIntervalSec;
860 * Additional configuration provided per band: indexed by |NanBandIndex|.
862 NanBandSpecificConfig[2] bandSpecificConfig;
866 * Enable requests for NAN: start-up configuration |IWifiNanIface.enableRequest|.
868 struct NanEnableRequest {
870 * Enable operation in a specific band: indexed by |NanBandIndex|.
872 bool[2] operateInBand;
874 * Specify extent of cluster by specifying the max hop count.
878 * Configurations of NAN cluster operation. Can also be modified at run-time using
879 * |IWifiNanIface.configRequest|.
881 NanConfigRequest configParams;
883 * Non-standard configurations of NAN cluster operation - useful for debugging operations.
885 NanDebugConfig debugConfigs;
889 * Cipher suite flags.
891 enum NanCipherSuiteType : uint32_t {
892 NONE = 0, // No (open) security
893 SHARED_KEY_128_MASK = 1 << 0, // NCS-SK-128
894 SHARED_KEY_256_MASK = 1 << 1 // NCS-SK-256
898 * Ranging in the context of discovery sessions indication controls. Controls the frequency of
899 * ranging-driven |IWifiNanIfaceEventCallback.eventMatch|.
901 enum NanRangingIndication : uint32_t {
902 CONTINUOUS_INDICATION_MASK = 1 << 0, // trigger event on every RTT measurement
903 INGRESS_MET_MASK = 1 << 1, // trigger event only when ingress conditions met
904 EGRESS_MET_MASK = 1 << 2 // trigger event only when egress conditions met
908 * Configurations of NAN discovery sessions: common to publish and subscribe discovery.
910 struct NanDiscoveryCommonConfig {
912 * The ID of the discovery session being configured. A value of 0 specifies a request to create
913 * a new discovery session. The new discovery session ID is returned with
914 * |IWifiNanIfaceEventCallback.notifyStartPublishResponse| or
915 * |IWifiNanIfaceEventCallback.notifyStartSubscribeResponse|.
916 * NAN Spec: Service Descriptor Attribute (SDA) / Instance ID
920 * The lifetime of the discovery session in seconds. A value of 0 means run forever or until
921 * canceled using |IWifiIface.stopPublishRequest| or |IWifiIface.stopSubscribeRequest|.
925 * Indicates the interval between two Discovery Windows in which the device supporting the
926 * service is awake to transmit or receive the Service Discovery frames. Valid values of Awake
927 * DW Interval are: 1, 2, 4, 8 and 16. A value of 0 will default to 1. Does not override
928 * |NanBandSpecificConfig.discoveryWindowIntervalVal| configurations if those are specified.
930 uint16_t discoveryWindowPeriod;
932 * The lifetime of the discovery session in number of transmitted SDF discovery packets. A value
933 * of 0 means forever or until canceled using |IWifiIface.stopPublishRequest| or
934 * |IWifiIface.stopSubscribeRequest|.
936 uint8_t discoveryCount;
938 * UTF-8 encoded string identifying the service.
939 * Max length: |NanCapabilities.maxServiceNameLen|.
940 * NAN Spec: The only acceptable single-byte UTF-8 symbols for a Service Name are alphanumeric
941 * values (A-Z, a-z, 0-9), the hyphen ('-'), and the period ('.'). All valid multi-byte UTF-8
942 * characters are acceptable in a Service Name.
944 vec<uint8_t> serviceName;
946 * Specifies how often to trigger |IWifiNanIfaceEventCallback.eventMatch| when continuously
947 * discovering the same discovery session (with no changes).
949 NanMatchAlg discoveryMatchIndicator;
951 * Arbitrary information communicated in discovery packets - there is no semantic meaning to these
952 * bytes. They are passed-through from publisher to subscriber as-is with no parsing.
953 * Max length: |NanCapabilities.maxServiceSpecificInfoLen|.
954 * NAN Spec: Service Descriptor Attribute (SDA) / Service Info
956 vec<uint8_t> serviceSpecificInfo;
958 * Arbitrary information communicated in discovery packets - there is no semantic meaning to these
959 * bytes. They are passed-through from publisher to subscriber as-is with no parsing.
960 * Max length: |NanCapabilities.maxExtendedServiceSpecificInfoLen|.
961 * Spec: Service Descriptor Extension Attribute (SDEA) / Service Info
963 vec<uint8_t> extendedServiceSpecificInfo;
965 * Ordered sequence of <length, value> pairs (|length| uses 1 byte and contains the number of
966 * bytes in the |value| field) which specify further match criteria (beyond the service name).
967 * The match behavior is specified in details in the NAN spec.
968 * Publisher: used in SOLICITED or SOLICITED_UNSOLICITED sessions.
969 * Subscriber: used in ACTIVE or PASSIVE sessions.
970 * Max length: |NanCapabilities.maxMatchFilterLen|.
971 * NAN Spec: matching_filter_rx
973 vec<uint8_t> rxMatchFilter;
975 * Ordered sequence of <length, value> pairs (|length| uses 1 byte and contains the number of
976 * bytes in the |value| field) which specify further match criteria (beyond the service name).
977 * The match behavior is specified in details in the NAN spec.
978 * Publisher: used if provided.
979 * Subscriber: used (if provided) only in ACTIVE sessions.
980 * Max length: |NanCapabilities.maxMatchFilterLen|.
981 * NAN Spec: matching_filter_tx and Service Descriptor Attribute (SDA) / Matching Filter
983 vec<uint8_t> txMatchFilter;
985 * Specifies whether or not the discovery session uses the
986 * |NanBandSpecificConfig.rssiCloseProximity| value (configured in enable/configure requests) to
987 * filter out matched discovered peers.
988 * NAN Spec: Service Descriptor Attribute / Service Control / Discovery Range Limited.
990 bool useRssiThreshold;
992 * Controls whether or not the |IWifiNanIfaceEventCallback.eventPublishTerminated| (for publish
993 * discovery sessions) or |IWifiNanIfaceEventCallback.eventSubscribeTerminated| (for subscribe
994 * discovery sessions) will be delivered.
996 bool disableDiscoveryTerminationIndication;
998 * Controls whether or not the |IWifiNanIfaceEventCallback.eventMatchExpired| will be delivered.
1000 bool disableMatchExpirationIndication;
1002 * Controls whether or not the |IWifiNanIfaceEventCallback.eventFollowupReceived| will be
1005 bool disableFollowupReceivedIndication;
1007 * Cipher type for data-paths constructed in the context of this discovery session. Must be
1008 * specified as |NanCipherSuiteType.NONE| if no |pmk| is provided.
1010 NanCipherSuiteType cipherType;
1012 * Optional Pairwise Master Key (PMK) for data-paths constructed in the context of this discovery
1013 * session. A PMK can also be provided during the actual construction of the data-path (which
1014 * allows for unique PMKs for each data-path). The |cipherType| must be specified if a PMK is
1021 * Specifies whether or not security is enabled in any data-path (NDP) constructed in the context
1022 * of this discovery session.
1023 * NAN Spec: Service Discovery Extension Attribute (SDEA) / Control / Security Required
1025 bool securityEnabledInNdp;
1027 * Specifies whether or not there is a ranging requirement in this discovery session.
1028 * Ranging is only performed if all other match criteria with the peer are met. Ranging must
1029 * be performed if both peers in the discovery session (publisher and subscriber) set this
1030 * flag to true. Otherwise, if either peer sets this flag to false, ranging must not be performed
1031 * and must not impact discovery decisions.
1032 * Note: specifying that ranging is required also implies that this device must automatically
1033 * accept ranging requests from peers.
1034 * NAN Spec: Service Discovery Extension Attribute (SDEA) / Control / Ranging Require.
1036 bool rangingRequired;
1038 * Interval in msec between two ranging measurements. Only relevant if |rangingRequired| is true.
1039 * If the Awake DW interval specified either in |discoveryWindowPeriod| or in
1040 * |NanBandSpecificConfig.discoveryWindowIntervalVal| is larger than the ranging interval then
1041 * priority is given to Awake DW interval.
1043 uint32_t rangingIntervalMsec;
1045 * The type of ranging feedback to be provided by discovery session matches
1046 * |IWifiNanIfaceEventCallback.eventMatch|. Only relevant if |rangingRequired| is true.
1048 bitfield<NanRangingIndication> configRangingIndications;
1050 * The ingress and egress distance in cm. If ranging is enabled (|rangingEnabled| is true) then
1051 * |configRangingIndications| is used to determine whether ingress and/or egress (or neither)
1052 * are used to determine whether a match has occurred.
1053 * NAN Spec: Service Discovery Extension Attribute (SDEA) / Ingress & Egress Range Limit
1055 uint16_t distanceIngressCm;
1056 uint16_t distanceEgressCm;
1060 * Publish request: specifies a publish discovery operation.
1062 struct NanPublishRequest {
1064 * Common configuration of discovery sessions.
1066 NanDiscoveryCommonConfig baseConfigs;
1068 * The type of the publish discovery session.
1070 NanPublishType publishType;
1072 * For publishType of |NanPublishType.SOLICITED| or |NanPublishType.UNSOLICITED_SOLICITED|
1073 * specifies the type of transmission used for responding to the probing subscribe discovery
1078 * Specifies whether data-path requests |IWifiNanIfaceEventCallback.eventDataPathRequest| (in
1079 * the context of this discovery session) are automatically accepted (if true) - in which case
1080 * the Responder must not call the |IWifiNanIface.respondToDataPathIndicationRequest| method and
1081 * the device must automatically accept the data-path request and complete the negotiation.
1083 bool autoAcceptDataPathRequests;
1087 * Subscribe request: specifies a subscribe discovery operation.
1089 struct NanSubscribeRequest {
1091 * Common configuration of discovery sessions.
1093 NanDiscoveryCommonConfig baseConfigs;
1095 * The type of the subscribe discovery session.
1097 NanSubscribeType subscribeType;
1099 * For |NanSubscribeType.ACTIVE| subscribe discovery sessions specify how the Service Response
1100 * Filter (SRF) attribute is populated. Relevant only if |shouldUseSrf| is set to true.
1101 * NAN Spec: Service Descriptor Attribute (SDA) / Service Response Filter / SRF Control / SRF Type
1105 * Configure whether inclusion of an address in |intfAddr| indicates that those devices should
1106 * respond or the reverse. Relevant only if |shouldUseSrf| is set to true and |srfType| is set to
1107 * |NanSrfType.PARTIAL_MAC_ADDR|.
1108 * NAN Spec: Service Descriptor Attribute (SDA) / Service Response Filter / SRF Control / Include
1110 bool srfRespondIfInAddressSet;
1112 * Control whether the Service Response Filter (SRF) is used.
1113 * NAN Spec: Service Descriptor Attribute (SDA) / Service Control /
1114 * Service Response Filter Present
1118 * Control whether the presence of |NanDiscoveryCommonConfig.serviceSpecificInfo| data is needed
1119 * in the publisher in order to trigger service discovery, i.e. a
1120 * |IWifiNanIfaceEventCallback.eventMatch|. The test is for presence of data - not for the
1121 * specific contents of the data.
1123 bool isSsiRequiredForMatch;
1125 * NAN Interface Addresses constituting the Service Response Filter (SRF).
1126 * Max length (number of addresses): |NanCapabilities.maxSubscribeInterfaceAddresses|.
1127 * NAN Spec: Service Descriptor Attribute (SDA) / Service Response Filter / Address Set
1129 vec<MacAddress> intfAddr;
1133 * Transmit follow up message request.
1135 struct NanTransmitFollowupRequest {
1137 * ID of an active publish or subscribe discovery session. Follow-up message is transmitted in the
1138 * context of the discovery session.
1139 * NAN Spec: Service Descriptor Attribute (SDA) / Instance ID
1141 uint8_t discoverySessionId;
1143 * ID of the peer. Obtained as part of an earlier |IWifiNanIfaceEventCallback.eventMatch| or
1144 * |IWifiNanIfaceEventCallback.eventFollowupReceived|.
1148 * MAC address of the peer. Obtained as part of an earlier |IWifiNanIfaceEventCallback.eventMatch|
1149 * or |IWifiNanIfaceEventCallback.eventFollowupReceived|.
1153 * Should the follow-up message be transmitted with a high priority.
1155 bool isHighPriority;
1157 * Should the follow-up message be transmitted in a discovery window (true) or a further
1158 * availability window (false).
1160 bool shouldUseDiscoveryWindow;
1162 * Arbitrary information communicated to the peer - there is no semantic meaning to these
1163 * bytes. They are passed-through from sender to receiver as-is with no parsing.
1164 * Max length: |NanCapabilities.maxServiceSpecificInfoLen|.
1165 * NAN Spec: Service Descriptor Attribute (SDA) / Service Info
1167 vec<uint8_t> serviceSpecificInfo;
1169 * Arbitrary information communicated in discovery packets - there is no semantic meaning to these
1170 * bytes. They are passed-through from publisher to subscriber as-is with no parsing.
1171 * Max length: |NanCapabilities.maxExtendedServiceSpecificInfoLen|.
1172 * Spec: Service Descriptor Extension Attribute (SDEA) / Service Info
1174 vec<uint8_t> extendedServiceSpecificInfo;
1176 * Disable |IWifiNanIfaceEventCallback.eventTransmitFollowup| - i.e. do not get indication on
1177 * whether the follow-up was transmitted and received successfully.
1179 bool disableFollowupResultIndication;
1183 * Data Path Initiator requesting a data-path.
1185 struct NanInitiateDataPathRequest {
1187 * ID of the peer. Obtained as part of an earlier |IWifiNanIfaceEventCallback.eventMatch| or
1188 * |IWifiNanIfaceEventCallback.eventFollowupReceived|.
1192 * NAN management interface MAC address of the peer. Obtained as part of an earlier
1193 * |IWifiNanIfaceEventCallback.eventMatch| or |IWifiNanIfaceEventCallback.eventFollowupReceived|.
1195 MacAddress peerDiscMacAddr;
1197 * Config flag for channel request.
1199 NanDataPathChannelCfg channelRequestType;
1201 * Channel frequency in MHz to start data-path. Not relevant if |channelRequestType| is
1202 * |NanDataPathChannelCfg.CHANNEL_NOT_REQUESTED|.
1204 WifiChannelInMhz channel;
1206 * NAN data interface name on which this data-path session is to be initiated.
1207 * This must be an interface created using |IWifiNanIface.createDataInterfaceRequest|.
1211 * Specifies whether or not security is required for the data-path being created.
1212 * NAN Spec: Data Path Attributes / NDP Attribute / NDP Control / Security Present
1214 bool securityRequired;
1216 * Arbitrary information communicated to the peer as part of the data-path setup process - there
1217 * is no semantic meaning to these bytes. They are passed-through from sender to receiver as-is
1219 * Max length: |NanCapabilities.maxAppInfoLen|.
1220 * NAN Spec: Data Path Attributes / NDP Attribute / NDP Specific Info
1222 vec<uint8_t> appInfo;
1224 * Cipher type for the data-path being requested. Must be specified as |NanCipherSuiteType.NONE|
1225 * if no |pmk| is provided.
1227 NanCipherSuiteType cipherType;
1229 * Pairwise Master Key (PMK) for the data-path being requested (if |securityRequired| is true).
1230 * The |cipherType| must be specified if a PMK is provided.
1238 * Response to a data-path request from a peer.
1240 struct NanRespondToDataPathIndicationRequest {
1242 * Accept (true) or reject (false) the request.
1243 * NAN Spec: Data Path Attributes / NDP Attribute / Type and Status
1247 * ID of the data-path (NDP) for which we're responding - obtained as part of the request in
1248 * |IWifiNanIfaceEventCallback.eventDataPathRequest|.
1250 uint32_t ndpInstanceId;
1252 * NAN data interface name on which this data-path session is to be started.
1253 * This must be an interface created using |IWifiNanIface.createDataInterfaceRequest|.
1257 * Specifies whether or not security is required for the data-path being created.
1258 * NAN Spec: Data Path Attributes / NDP Attribute / NDP Control / Security Present
1260 bool securityRequired;
1262 * Arbitrary information communicated to the peer as part of the data-path setup process - there
1263 * is no semantic meaning to these bytes. They are passed-through from sender to receiver as-is
1265 * Max length: |NanCapabilities.maxAppInfoLen|.
1266 * NAN Spec: Data Path Attributes / NDP Attribute / NDP Specific Info
1268 vec<uint8_t> appInfo;
1270 * Cipher type for the data-path being negotiated. Must be specified as |NanCipherSuiteType.NONE|
1271 * if no |pmk| is provided.
1273 NanCipherSuiteType cipherType;
1275 * Pairwise Master Key (PMK) for the data-path being negotiated (if |securityRequired| is true).
1276 * The |cipherType| must be specified if a PMK is provided.
1283 * NDP Capabilities response.
1285 struct NanCapabilities {
1287 * Maximum number of clusters which the device can join concurrently.
1289 uint32_t maxConcurrentClusters;
1291 * Maximum number of concurrent publish discovery sessions.
1293 uint32_t maxPublishes;
1295 * Maximum number of concurrent subscribe discovery sessions.
1297 uint32_t maxSubscribes;
1299 * Maximum length (in bytes) of service name.
1301 uint32_t maxServiceNameLen;
1303 * Maximum length (in bytes) of individual match filters.
1305 uint32_t maxMatchFilterLen;
1307 * Maximum length (in bytes) of aggregate match filters across all active sessions.
1309 uint32_t maxTotalMatchFilterLen;
1311 * Maximum length (in bytes) of the service specific info field.
1313 uint32_t maxServiceSpecificInfoLen;
1315 * Maximum length (in bytes) of the extended service specific info field.
1317 uint32_t maxExtendedServiceSpecificInfoLen;
1319 * Maximum number of data interfaces (NDI) which can be created concurrently on the device.
1321 uint32_t maxNdiInterfaces;
1323 * Maximum number of data paths (NDP) which can be created concurrently on each individual
1324 * data interface (NDI).
1326 uint32_t maxNdpSessions;
1328 * Maximum length (in bytes) of application info field (used in data-path negotiations).
1330 uint32_t maxAppInfoLen;
1332 * Maximum number of transmitted followup messages which can be queued by the firmware.
1334 uint32_t maxQueuedTransmitFollowupMsgs;
1336 * Maximum number MAC interface addresses which can be specified to a subscribe discovery session.
1338 uint32_t maxSubscribeInterfaceAddresses;
1340 * The set of supported Cipher suites. The |NanCipherSuiteType| bit fields are used.
1342 bitfield<NanCipherSuiteType> supportedCipherSuites;
1346 * Match indication structure
1348 struct NanMatchInd {
1350 * Publish or subscribe discovery session ID of an existing discovery session.
1351 * NAN Spec: Service Descriptor Attribute (SDA) / Instance ID
1353 uint8_t discoverySessionId;
1355 * A unique ID of the peer. Can be subsequently used in |IWifiNanIface.transmitFollowupRequest| or
1356 * to set up a data-path.
1360 * The NAN Discovery (management) MAC address of the peer.
1364 * The arbitrary information contained in the |NanDiscoveryCommonConfig.serviceSpecificInfo| of
1365 * the peer's discovery session configuration.
1366 * Max length: |NanCapabilities.maxServiceSpecificInfoLen|.
1367 * NAN Spec: Service Descriptor Attribute (SDA) / Service Info
1369 vec<uint8_t> serviceSpecificInfo;
1371 * Arbitrary information communicated in discovery packets - there is no semantic meaning to these
1372 * bytes. They are passed-through from publisher to subscriber as-is with no parsing.
1373 * Max length: |NanCapabilities.maxExtendedServiceSpecificInfoLen|.
1374 * Spec: Service Descriptor Extension Attribute (SDEA) / Service Info
1376 vec<uint8_t> extendedServiceSpecificInfo;
1378 * The match filter from the discovery packet (publish or subscribe) which caused service
1379 * discovery. Matches the peer's |NanDiscoveryCommonConfig.txMatchFilter|.
1380 * Max length: |NanCapabilities.maxMatchFilterLen|.
1381 * NAN Spec: Service Descriptor Attribute (SDA) / Matching Filter
1383 vec<uint8_t> matchFilter;
1385 * Indicates the type of discovery: true if match occurred on a Beacon frame, false if the match
1386 * occurred on a Service Discovery Frames (SDF).
1388 bool matchOccuredInBeaconFlag;
1390 * Flag to indicate firmware is out of resource and that it can no longer track this Service Name.
1391 * Indicates that while |IWifiNanIfaceEventCallback.eventMatch| will be received, the
1392 * |NanDiscoveryCommonConfig.discoveryMatchIndicator| configuration will not be honored.
1394 bool outOfResourceFlag;
1396 * If RSSI filtering was enabled using |NanDiscoveryCommonConfig.useRssiThreshold| in discovery
1397 * session setup then this field contains the received RSSI value. It will contain 0 if RSSI
1398 * filtering was not enabled.
1399 * RSSI values are returned without sign, e.g. -70dBm will be returned as 70.
1403 * Cipher type for data-paths constructed in the context of this discovery session. Valid if
1404 * |peerRequiresSecurityEnabledInNdp| is true.
1406 NanCipherSuiteType peerCipherType;
1408 * Indicates whether or not the peer requires security enabled in any data-path (NDP) constructed
1409 * in the context of this discovery session. The |cipherType| specifies the cipher type for such
1411 * NAN Spec: Service Discovery Extension Attribute (SDEA) / Control / Security Required
1413 bool peerRequiresSecurityEnabledInNdp;
1415 * Indicates whether or not the peer requires (and hence allows) ranging in the context of this
1416 * discovery session.
1417 * Note that ranging is only performed if all other match criteria with the peer are met.
1418 * NAN Spec: Service Discovery Extension Attribute (SDEA) / Control / Ranging Require.
1420 bool peerRequiresRanging;
1422 * Ranging indication supersedes the NanMatchAlg specification.
1423 * Ex: If NanMatchAlg is MATCH_ONCE, but ranging indications is continuous then continuous
1424 * match notifications will be received (with ranging information).
1425 * Ranging indication data is provided if Ranging required is enabled in the discovery
1426 * specification and:
1427 * 1) continuous ranging specified.
1428 * 2) ingress/egress specified and:
1429 * - notify once for ingress >= ingress_distance and egress <= egress_distance,
1430 * - same for ingress_egress_both
1431 * If the Awake DW intervals are larger than the ranging intervals then priority is given to the
1432 * device DW intervals.
1434 * If ranging was required and executed contains the distance to the peer in CM. The
1435 * |rangingIndicationType| field specifies the event which triggered ranging.
1437 uint32_t rangingMeasurementInCm;
1439 * The ranging event(s) which triggered the ranging. E.g. can indicate that continuous ranging was
1440 * requested, or else that an ingress event occurred.
1442 bitfield<NanRangingIndication> rangingIndicationType;
1446 * Followup message received from peer indication structure.
1448 struct NanFollowupReceivedInd {
1450 * Discovery session (publish or subscribe) ID of a previously created discovery session. The
1451 * message is received in the context of this discovery session.
1452 * NAN Spec: Service Descriptor Attribute (SDA) / Instance ID
1454 uint8_t discoverySessionId;
1456 * A unique ID of the peer. Can be subsequently used in |IWifiNanIface.transmitFollowupRequest| or
1457 * to set up a data-path.
1461 * The NAN Discovery (management) MAC address of the peer.
1465 * Indicates whether received in a further availability window (FAW) if true, or in a discovery
1466 * window (DW) if false.
1470 * Received message from the peer - there is no semantic meaning to these bytes. They are
1471 * passed-through from sender to receiver as-is with no parsing.
1472 * Max length: |NanCapabilities.maxServiceSpecificInfoLen|.
1473 * NAN Spec: Service Descriptor Attribute (SDA) / Service Info
1475 vec<uint8_t> serviceSpecificInfo;
1477 * Arbitrary information communicated in discovery packets - there is no semantic meaning to these
1478 * bytes. They are passed-through from publisher to subscriber as-is with no parsing.
1479 * Max length: |NanCapabilities.maxExtendedServiceSpecificInfoLen|.
1480 * Spec: Service Descriptor Extension Attribute (SDEA) / Service Info
1482 vec<uint8_t> extendedServiceSpecificInfo;
1486 * Event types for a cluster event indication.
1488 enum NanClusterEventType : uint32_t {
1490 * Management/discovery interface MAC address has changed (e.g. due to randomization or at
1493 DISCOVERY_MAC_ADDRESS_CHANGED = 0,
1495 * A new cluster has been formed by this device.
1499 * This device has joined an existing cluster.
1505 * Cluster event indication structure: triggered on events impacting how this device is
1506 * visible to peers - cluster forming, joining a new cluster, or changing of the MAC address.
1508 struct NanClusterEventInd {
1510 * Event type causing the cluster event indication to be triggered.
1512 NanClusterEventType eventType;
1514 * MAC Address associated with the corresponding event.
1520 * NAN Data path request Indication Message structure.
1521 * Event indication received by an intended Responder when a Nan Data request initiated by an
1524 struct NanDataPathRequestInd {
1526 * ID of an active publish or subscribe discovery session - the data-path request is in the
1527 * context of this discovery session.
1528 * NAN Spec: Data Path Attributes / NDP Attribute / Publish ID
1530 uint8_t discoverySessionId;
1532 * MAC address of the Initiator peer. This is the MAC address of the peer's management/discovery
1535 MacAddress peerDiscMacAddr;
1537 * ID of the data-path - used to identify the data-path in further negotiation/APIs.
1539 uint32_t ndpInstanceId;
1541 * Specifies whether or not security is required by the peer for the data-path being created.
1542 * NAN Spec: Data Path Attributes / NDP Attribute / NDP Control / Security Present
1544 bool securityRequired;
1546 * Arbitrary information communicated from the peer as part of the data-path setup process - there
1547 * is no semantic meaning to these bytes. They are passed-through from sender to receiver as-is
1549 * Max length: |NanCapabilities.maxAppInfoLen|.
1550 * NAN Spec: Data Path Attributes / NDP Attribute / NDP Specific Info
1552 vec<uint8_t> appInfo;
1556 * NAN Data path confirmation Indication structure.
1557 * Event indication is received on both initiator and responder side when negotiation for a
1558 * data-path finish: on success or failure.
1560 struct NanDataPathConfirmInd {
1562 * ID of the data-path.
1564 uint32_t ndpInstanceId;
1566 * Indicates whether the data-path setup succeeded (true) or failed (false).
1568 bool dataPathSetupSuccess;
1570 * MAC address of the peer's data-interface (not it's management/discovery interface).
1572 MacAddress peerNdiMacAddr;
1574 * Arbitrary information communicated from the peer as part of the data-path setup process - there
1575 * is no semantic meaning to these bytes. They are passed-through from sender to receiver as-is
1577 * Max length: |NanCapabilities.maxAppInfoLen|.
1578 * NAN Spec: Data Path Attributes / NDP Attribute / NDP Specific Info
1580 vec<uint8_t> appInfo;
1582 * Failure reason if |dataPathSetupSuccess| is false.
1584 WifiNanStatus status;
1588 * RTT specific types.
1589 * TODO(b/32159498): Move to a separate rtt_types.hal.
1594 enum RttStatus : uint32_t {
1596 /** General failure status */
1598 /** Target STA does not respond to request */
1600 /** Request rejected. Applies to 2-sided RTT only */
1602 FAIL_NOT_SCHEDULED_YET = 4,
1603 /** Timing measurement times out */
1604 FAIL_TM_TIMEOUT = 5,
1605 /** Target on different channel, cannot range */
1606 FAIL_AP_ON_DIFF_CHANNEL = 6,
1607 /** Ranging not supported */
1608 FAIL_NO_CAPABILITY = 7,
1609 /** Request aborted for unknown reason */
1611 /** Invalid T1-T4 timestamp */
1612 FAIL_INVALID_TS = 9,
1613 /** 11mc protocol failed */
1615 /** Request could not be scheduled */
1617 /** Responder cannot collaborate at time of request */
1618 FAIL_BUSY_TRY_LATER = 12,
1619 /** Bad request args */
1621 /** WiFi not enabled. */
1623 /** Responder overrides param info, cannot range with new params */
1624 FAIL_FTM_PARAM_OVERRIDE = 15,
1630 enum RttPeerType : uint32_t {
1639 * RTT Measurement Bandwidth.
1641 enum RttBw : uint32_t {
1651 * RTT Measurement Preamble.
1653 enum RttPreamble : uint32_t {
1662 enum RttType : uint32_t {
1668 * RTT configuration.
1672 * Peer device mac address.
1676 * 1-sided or 2-sided RTT.
1680 * Optional - peer device hint (STA, P2P, AP).
1684 * Required for STA-AP mode, optional for P2P, NBD etc.
1686 WifiChannelInfo channel;
1688 * Time interval between bursts (units: 100 ms).
1689 * Applies to 1-sided and 2-sided RTT multi-burst requests.
1690 * Range: 0-31, 0: no preference by initiator (2-sided RTT).
1692 uint32_t burstPeriod;
1694 * Total number of RTT bursts to be executed. It will be
1695 * specified in the same way as the parameter "Number of
1696 * Burst Exponent" found in the FTM frame format. It
1697 * applies to both: 1-sided RTT and 2-sided RTT. Valid
1698 * values are 0 to 15 as defined in 802.11mc std.
1699 * 0 means single shot
1700 * The implication of this parameter on the maximum
1701 * number of RTT results is the following:
1702 * for 1-sided RTT: max num of RTT results = (2^num_burst)*(num_frames_per_burst)
1703 * for 2-sided RTT: max num of RTT results = (2^num_burst)*(num_frames_per_burst - 1)
1707 * Num of frames per burst.
1708 * Minimum value = 1, Maximum value = 31
1709 * For 2-sided this equals the number of FTM frames
1710 * to be attempted in a single burst. This also
1711 * equals the number of FTM frames that the
1712 * initiator will request that the responder send
1713 * in a single frame.
1715 uint32_t numFramesPerBurst;
1717 * Number of retries for a failed RTT frame.
1718 * Applies to 1-sided RTT only. Minimum value = 0, Maximum value = 3
1720 uint32_t numRetriesPerRttFrame;
1721 /** Following fields are only valid for 2-side RTT. */
1723 * Maximum number of retries that the initiator can
1724 * retry an FTMR frame.
1725 * Minimum value = 0, Maximum value = 3
1727 uint32_t numRetriesPerFtmr;
1729 * Whether to request location civic info or not.
1731 bool mustRequestLci;
1733 * Whether to request location civic records or not.
1735 bool mustRequestLcr;
1737 * Applies to 1-sided and 2-sided RTT. Valid values will
1738 * be 2-11 and 15 as specified by the 802.11mc std for
1739 * the FTM parameter burst duration. In a multi-burst
1740 * request, if responder overrides with larger value,
1741 * the initiator will return failure. In a single-burst
1742 * request if responder overrides with larger value,
1743 * the initiator will sent TMR_STOP to terminate RTT
1744 * at the end of the burst_duration it requested.
1746 uint32_t burstDuration;
1748 * RTT preamble to be used in the RTT frames.
1750 RttPreamble preamble;
1752 * RTT BW to be used in the RTT frames.
1762 * Peer device mac address.
1766 * Burst number in a multi-burst request.
1770 * Total RTT measurement frames attempted.
1772 uint32_t measurementNumber;
1774 * Total successful RTT measurement frames.
1776 uint32_t successNumber;
1778 * Maximum number of "FTM frames per burst" supported by
1779 * the responder STA. Applies to 2-sided RTT only.
1780 * If reponder overrides with larger value:
1781 * - for single-burst request initiator will truncate the
1782 * larger value and send a TMR_STOP after receiving as
1783 * many frames as originally requested.
1784 * - for multi-burst request, initiator will return
1785 * failure right away.
1787 uint8_t numberPerBurstPeer;
1793 * When status == RTT_STATUS_FAIL_BUSY_TRY_LATER,
1794 * this will be the time provided by the responder as to
1795 * when the request can be tried again. Applies to 2-sided
1796 * RTT only. In sec, 1-31sec.
1798 uint8_t retryAfterDuration;
1804 * Average rssi in 0.5 dB steps e.g. 143 implies -71.5 dB.
1808 * Rssi spread in 0.5 dB steps e.g. 5 implies 2.5 dB spread (optional).
1812 * 1-sided RTT: TX rate of RTT frame.
1813 * 2-sided RTT: TX rate of initiator's Ack in response to FTM frame.
1815 WifiRateInfo txRate;
1817 * 1-sided RTT: TX rate of Ack from other side.
1818 * 2-sided RTT: TX rate of FTM frame coming from responder.
1820 WifiRateInfo rxRate;
1822 * Round trip time in picoseconds
1826 * Rtt standard deviation in picoseconds.
1830 * Difference between max and min rtt times recorded in picoseconds.
1832 TimeSpanInPs rttSpread;
1834 * Distance in mm (optional).
1836 int32_t distanceInMm;
1838 * Standard deviation in mm (optional).
1840 int32_t distanceSdInMm;
1842 * Difference between max and min distance recorded in mm (optional).
1844 int32_t distanceSpreadInMm;
1846 * Time of the measurement (in microseconds since boot).
1848 TimeStampInUs timeStampInUs;
1850 * in ms, actual time taken by the FW to finish one burst
1851 * measurement. Applies to 1-sided and 2-sided RTT.
1853 uint32_t burstDurationInMs;
1855 * Number of bursts allowed by the responder. Applies
1856 * to 2-sided RTT only.
1858 uint32_t negotiatedBurstNum;
1862 WifiInformationElement lci;
1866 WifiInformationElement lcr;
1872 struct RttCapabilities {
1874 * if 1-sided rtt data collection is supported.
1876 bool rttOneSidedSupported;
1878 * if ftm rtt data collection is supported.
1880 bool rttFtmSupported;
1882 * if initiator supports LCI request. Applies to 2-sided RTT.
1886 * if initiator supports LCR request. Applies to 2-sided RTT.
1890 * if 11mc responder mode is supported.
1892 bool responderSupported;
1894 * Bit mask indicates what preamble is supported by initiator.
1895 * Combination of |RttPreamble| values.
1897 bitfield<RttPreamble> preambleSupport;
1899 * Bit mask indicates what BW is supported by initiator.
1900 * Combination of |RttBw| values.
1902 bitfield<RttBw> bwSupport;
1904 * Draft 11mc spec version supported by chip.
1905 * For instance, version 4.0 must be 40 and version 4.3 must be 43 etc.
1911 * Structs for setting LCI/LCR information to be provided to a requestor.
1913 enum RttMotionPattern : uint32_t {
1915 * Not expected to change location.
1919 * Expected to change location.
1923 * Movement pattern unknown.
1929 * Movement pattern unknown.
1931 struct RttLciInformation {
1933 * latitude in degrees * 2^25 , 2's complement.
1937 * longitude in degrees * 2^25 , 2's complement.
1941 * Altitude in units of 1/256 m.
1945 * As defined in Section 2.3.2 of IETF RFC 6225.
1947 uint8_t latitudeUnc;
1949 * As defined in Section 2.3.2 of IETF RFC 6225.
1951 uint8_t longitudeUnc;
1953 * As defined in Section 2.4.5 from IETF RFC 6225.
1955 uint8_t altitudeUnc;
1956 /** Following element for configuring the Z subelement. */
1958 * Motion pattern type.
1960 RttMotionPattern motionPattern;
1962 * Floor in units of 1/16th of floor. 0x80000000 if unknown.
1966 * in units of 1/64 m.
1968 int32_t heightAboveFloor;
1970 * in units of 1/64 m. 0 if unknown
1975 struct RttLcrInformation {
1977 * Country code symbol.
1979 int8_t[2] countryCode;
1981 * Civic info to be copied in FTM frame.
1987 * RTT Responder information
1989 struct RttResponder {
1990 WifiChannelInfo channel;
1991 RttPreamble preamble;
1995 * Debug data specific types.
1996 * TODO(b/32159498): Move to a separate debug_types.hal.
1998 typedef uint32_t WifiRingBufferId;
2001 * Flags describing each debug ring buffer.
2003 enum WifiDebugRingBufferFlags : uint32_t {
2004 HAS_BINARY_ENTRIES = 1 << 0,
2005 HAS_ASCII_ENTRIES = 1 << 1,
2006 HAS_PER_PACKET_ENTRIES = 1 << 2,
2010 * Struct describing each debug ring buffer supported by
2013 struct WifiDebugRingBufferStatus {
2015 * Name of this debug ring buffer.
2019 * Combination of |WifiDebugRingBufferFlags| values.
2023 * Unique integer representing the ring.
2025 WifiRingBufferId ringId;
2027 * Total memory size allocated for the buffer.
2029 uint32_t sizeInBytes;
2031 * Amount of free space in the buffer.
2033 uint32_t freeSizeInBytes;
2035 * Verbose level for ring buffer.
2037 uint32_t verboseLevel;
2041 * Verbose logging level to set for each debug ring buffer supported
2044 enum WifiDebugRingBufferVerboseLevel : uint32_t {
2046 * Level 0 corresponds to no collection, and it makes log handler
2047 * stop by no more events from driver.
2051 * Level 1 correspond to normal log level, with minimal user impact.
2052 * This is the default value.
2056 * Level 2 is enabled when user is lazily trying to reproduce a problem,
2057 * wifi performances and power can be impacted but device should not
2058 * otherwise be significantly impacted.
2062 * Level 3 is used when trying to actively debug a problem.
2063 * This will cause sever performance degradation.
2069 * Enum describing the fate of the TX packets.
2071 enum WifiDebugTxPacketFate : uint32_t {
2073 * Sent over air and ACKed.
2077 * Sent over air but not ACKed. (Normal for broadcast/multicast.)
2081 * Queued within firmware, but not yet sent over air.
2085 * Dropped by firmware as invalid. E.g. bad source address, bad checksum,
2086 * or invalid for current state.
2090 * Dropped by firmware due to lack of buffer space.
2094 * Dropped by firmware for any other reason. Includes frames that were sent
2095 * by driver to firmware, but unaccounted for by firmware.
2099 * Queued within driver, not yet sent to firmware.
2103 * Dropped by driver as invalid. E.g. bad source address, or invalid for
2108 * Dropped by driver due to lack of buffer space.
2112 * Dropped by driver for any other reason.
2118 * Enum describing the fate of the TX packets.
2120 enum WifiDebugRxPacketFate : uint32_t {
2122 * Valid and delivered to network stack (e.g., netif_rx()).
2126 * Queued within firmware, but not yet sent to driver.
2130 * Dropped by firmware due to host-programmable filters.
2134 * Dropped by firmware as invalid. E.g. bad checksum, decrypt failed,
2135 * or invalid for current state.
2139 * Dropped by firmware due to lack of buffer space.
2143 * Dropped by firmware for any other reason.
2147 * Queued within driver, not yet delivered to network stack.
2151 * Dropped by driver due to filter rules.
2155 * Dropped by driver as invalid. E.g. not permitted in current state.
2159 * Dropped by driver due to lack of buffer space.
2163 * Dropped by driver for any other reason.
2169 * Type of frame transmitted/received.
2171 enum WifiDebugPacketFateFrameType : uint32_t {
2178 * Information regarding the frame transmitted/received.
2180 struct WifiDebugPacketFateFrameInfo {
2182 * The type of MAC-layer frame that this frame_info holds.
2183 * - For data frames, use FRAME_TYPE_ETHERNET_II.
2184 * - For management frames, use FRAME_TYPE_80211_MGMT.
2185 * - If the type of the frame is unknown, use FRAME_TYPE_UNKNOWN.
2187 WifiDebugPacketFateFrameType frameType;
2189 * The number of bytes included in |frameContent|.
2190 * If the frame contents are missing (e.g. RX frame dropped in firmware),
2191 * |frameLen| must be set to 0.
2195 * Host clock when this frame was received by the driver (either outbound
2196 * from the host network stack, or inbound from the firmware).
2197 * - The timestamp must be taken from a clock which includes time the host
2198 * spent suspended (e.g. ktime_get_boottime()).
2199 * - If no host timestamp is available (e.g. RX frame was dropped in firmware),
2200 * this field must be set to 0.
2202 TimeStampInUs driverTimestampUsec;
2204 * Firmware clock when this frame was received by the firmware
2205 * (either outbound from the host, or inbound from a remote station).
2206 * - The timestamp must be taken from a clock which includes time firmware
2207 * spent suspended (if applicable).
2208 * - If no firmware timestamp is available (e.g. TX frame was dropped by
2209 * driver), this field must be set to 0.
2210 * - Consumers of |frameInfo| must not assume any synchronization between
2211 * driver and firmware clocks.
2213 TimeStampInUs firmwareTimestampUsec;
2215 * Actual frame content. This is the raw bytes of the corresponding packet.
2216 * - Should be provided for TX frames originated by the host.
2217 * - Should be provided for RX frames received by the driver.
2218 * - Optionally provided for TX frames originated by firmware.
2219 * (At discretion of HAL implementation.)
2220 * - Optionally provided for RX frames dropped in firmware.
2221 * (At discretion of HAL implementation.)
2222 * - If frame content is not provided, |frameLen| must be set to 0.
2224 vec<uint8_t> frameContent;
2228 * Struct describing packet fate report for each Tx frame.
2230 struct WifiDebugTxPacketFateReport {
2231 WifiDebugTxPacketFate fate;
2232 WifiDebugPacketFateFrameInfo frameInfo;
2236 * Struct describing packet fate report for each Rx frame.
2238 struct WifiDebugRxPacketFateReport {
2239 WifiDebugRxPacketFate fate;
2240 WifiDebugPacketFateFrameInfo frameInfo;
2244 * Struct capturing the count of all rx packets that caused
2247 struct WifiDebugHostWakeReasonRxPacketDetails {
2249 * Total rx unicast packet which woke up host.
2251 uint32_t rxUnicastCnt;
2253 * Total rx multicast packet which woke up host.
2255 uint32_t rxMulticastCnt;
2257 * Total rx broadcast packet which woke up host.
2259 uint32_t rxBroadcastCnt;
2263 * Struct capturing the count of all rx multicast packets that caused
2266 struct WifiDebugHostWakeReasonRxMulticastPacketDetails {
2268 * Rx wake packet was ipv4 multicast.
2270 uint32_t ipv4RxMulticastAddrCnt;
2272 * Rx wake packet was ipv6 multicast.
2274 uint32_t ipv6RxMulticastAddrCnt;
2276 * Rx wake packet was non-ipv4 and non-ipv6.
2278 uint32_t otherRxMulticastAddrCnt;
2282 * Struct capturing the count of all rx ICMP packets that caused
2285 struct WifiDebugHostWakeReasonRxIcmpPacketDetails {
2287 * Wake icmp packet count.
2291 * Wake icmp6 packet count.
2295 * Wake icmp6 RA packet count.
2299 * Wake icmp6 NA packet count.
2303 * Wake icmp6 NS packet count.
2309 * Structure capturing the count of all the wireless related host wakeup.
2310 * This is used to capture all the reasons why the host processor
2311 * (WLAN driver) was woken up by the WLAN firmware.
2312 * These stats may be used to debug any power issues caused due to frequent
2313 * wakeup of the host processor by the WLAN firmware.
2315 struct WifiDebugHostWakeReasonStats {
2317 * Total count of cmd/event wakes.
2318 * These must account for all wakeups due to WLAN management
2319 * commands/events received over the air.
2321 uint32_t totalCmdEventWakeCnt;
2323 * Vector of wake counts per cmd/event type.
2324 * The number of command types and their meaning is only understood by the
2327 vec<uint32_t> cmdEventWakeCntPerType;
2329 * Total count of drive/fw wakes.
2330 * These must account for all wakeups due to local driver/firmware
2331 * interactions. These include all vendor implementation specific
2332 * interactions like any heart-beat monitoring, Bus management, etc.
2334 uint32_t totalDriverFwLocalWakeCnt;
2336 * Vector of wake counts per driver/firmware interaction type.
2337 * The number of command types and their meaning is only understood by the
2340 vec<uint32_t> driverFwLocalWakeCntPerType;
2342 * Total data rx packets, that woke up host.
2344 uint32_t totalRxPacketWakeCnt;
2345 WifiDebugHostWakeReasonRxPacketDetails rxPktWakeDetails;
2346 WifiDebugHostWakeReasonRxMulticastPacketDetails rxMulticastPkWakeDetails;
2347 WifiDebugHostWakeReasonRxIcmpPacketDetails rxIcmpPkWakeDetails;