From 7b77747bb565f50ced457ad931e8d0206385d3a1 Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Fri, 7 Oct 2016 13:15:59 -0700 Subject: [PATCH 01/24] wifi(interface): Add gscan/apf related API's Changes in the CL: 1. Add gscan/APF related API's to |IWifiStaIface|. 2. Add a new callback HIDL interface (|IWifiStaIfaceEventCallback) for all callbacks received from |IWifiStaIface|. Bug: 31991459 Test: Compiles Change-Id: Id9f2ded9e20bee393ab53d84efa814d52704cd2c --- wifi/1.0/Android.bp | 8 + wifi/1.0/Android.mk | 46 ++++ wifi/1.0/IWifiChip.hal | 8 +- wifi/1.0/IWifiStaIface.hal | 267 +++++++++++++++++++++++- wifi/1.0/IWifiStaIfaceEventCallback.hal | 126 +++++++++++ wifi/1.0/types.hal | 9 +- 6 files changed, 458 insertions(+), 6 deletions(-) create mode 100644 wifi/1.0/IWifiStaIfaceEventCallback.hal diff --git a/wifi/1.0/Android.bp b/wifi/1.0/Android.bp index b7309310b8..a3daa89ffa 100644 --- a/wifi/1.0/Android.bp +++ b/wifi/1.0/Android.bp @@ -16,6 +16,7 @@ genrule { "IWifiP2pIface.hal", "IWifiRttController.hal", "IWifiStaIface.hal", + "IWifiStaIfaceEventCallback.hal", ], out: [ "android/hardware/wifi/1.0/types.cpp", @@ -29,6 +30,7 @@ genrule { "android/hardware/wifi/1.0/WifiP2pIfaceAll.cpp", "android/hardware/wifi/1.0/WifiRttControllerAll.cpp", "android/hardware/wifi/1.0/WifiStaIfaceAll.cpp", + "android/hardware/wifi/1.0/WifiStaIfaceEventCallbackAll.cpp", ], } @@ -48,6 +50,7 @@ genrule { "IWifiP2pIface.hal", "IWifiRttController.hal", "IWifiStaIface.hal", + "IWifiStaIfaceEventCallback.hal", ], out: [ "android/hardware/wifi/1.0/types.h", @@ -101,6 +104,11 @@ genrule { "android/hardware/wifi/1.0/BnWifiStaIface.h", "android/hardware/wifi/1.0/BpWifiStaIface.h", "android/hardware/wifi/1.0/BsWifiStaIface.h", + "android/hardware/wifi/1.0/IWifiStaIfaceEventCallback.h", + "android/hardware/wifi/1.0/IHwWifiStaIfaceEventCallback.h", + "android/hardware/wifi/1.0/BnWifiStaIfaceEventCallback.h", + "android/hardware/wifi/1.0/BpWifiStaIfaceEventCallback.h", + "android/hardware/wifi/1.0/BsWifiStaIfaceEventCallback.h", ], } diff --git a/wifi/1.0/Android.mk b/wifi/1.0/Android.mk index 58c487b76c..a1a716d23c 100644 --- a/wifi/1.0/Android.mk +++ b/wifi/1.0/Android.mk @@ -261,6 +261,10 @@ $(GEN): PRIVATE_HIDL := $(HIDL) $(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IWifiStaIface.hal $(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IWifiIface.hal $(GEN): $(LOCAL_PATH)/IWifiIface.hal +$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IWifiStaIfaceEventCallback.hal +$(GEN): $(LOCAL_PATH)/IWifiStaIfaceEventCallback.hal +$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal +$(GEN): $(LOCAL_PATH)/types.hal $(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) $(GEN): PRIVATE_CUSTOM_TOOL = \ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ @@ -270,6 +274,25 @@ $(GEN): PRIVATE_CUSTOM_TOOL = \ $(GEN): $(LOCAL_PATH)/IWifiStaIface.hal $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build IWifiStaIfaceEventCallback.hal +# +GEN := $(intermediates)/android/hardware/wifi/1.0/IWifiStaIfaceEventCallback.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IWifiStaIfaceEventCallback.hal +$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal +$(GEN): $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::IWifiStaIfaceEventCallback + +$(GEN): $(LOCAL_PATH)/IWifiStaIfaceEventCallback.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) include $(BUILD_JAVA_LIBRARY) @@ -532,6 +555,10 @@ $(GEN): PRIVATE_HIDL := $(HIDL) $(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IWifiStaIface.hal $(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IWifiIface.hal $(GEN): $(LOCAL_PATH)/IWifiIface.hal +$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IWifiStaIfaceEventCallback.hal +$(GEN): $(LOCAL_PATH)/IWifiStaIfaceEventCallback.hal +$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal +$(GEN): $(LOCAL_PATH)/types.hal $(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) $(GEN): PRIVATE_CUSTOM_TOOL = \ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ @@ -541,6 +568,25 @@ $(GEN): PRIVATE_CUSTOM_TOOL = \ $(GEN): $(LOCAL_PATH)/IWifiStaIface.hal $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build IWifiStaIfaceEventCallback.hal +# +GEN := $(intermediates)/android/hardware/wifi/1.0/IWifiStaIfaceEventCallback.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IWifiStaIfaceEventCallback.hal +$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal +$(GEN): $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::IWifiStaIfaceEventCallback + +$(GEN): $(LOCAL_PATH)/IWifiStaIfaceEventCallback.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) include $(BUILD_STATIC_JAVA_LIBRARY) diff --git a/wifi/1.0/IWifiChip.hal b/wifi/1.0/IWifiChip.hal index cd4b21981a..55f6d61a92 100644 --- a/wifi/1.0/IWifiChip.hal +++ b/wifi/1.0/IWifiChip.hal @@ -36,7 +36,7 @@ interface IWifiChip { * ChipIfaceCombination for examples. */ struct ChipIfaceCombinationLimit { - vec types; // Each IfaceType may occur at most once + vec types; // Each IfaceType must occur at most once. uint32_t maxIfaces; }; @@ -89,7 +89,7 @@ interface IWifiChip { * the target combination is also satisfied. At that point new interfaces * satisfying only the target combination can be added (meaning the initial * combination limits will no longer satisfied). The addition of these new - * interfaces should not impact the existence of interfaces that satisfy both + * interfaces must not impact the existence of interfaces that satisfy both * combinations. * * For example, a chip with available combinations: @@ -98,10 +98,10 @@ interface IWifiChip { * AP interface in place of one of the STAs then first one of the STA * interfaces must be removed and then the AP interface can be created after * the STA had been torn down. During this process the remaining STA and NAN - * interfaces should not be removed/recreated. + * interfaces must not be removed/recreated. * * If a chip does not support this kind of reconfiguration in this mode then - * the combinations should be separated into two separate modes. Before + * the combinations must be separated into two separate modes. Before * switching modes all interfaces will be torn down, the mode switch will be * enacted and when it completes the new interfaces will be brought up. */ diff --git a/wifi/1.0/IWifiStaIface.hal b/wifi/1.0/IWifiStaIface.hal index 5234c71301..a738ebe4da 100644 --- a/wifi/1.0/IWifiStaIface.hal +++ b/wifi/1.0/IWifiStaIface.hal @@ -17,10 +17,275 @@ package android.hardware.wifi@1.0; import IWifiIface; +import IWifiStaIfaceEventCallback; /** * Interface used to represent a single STA iface. */ interface IWifiStaIface extends IWifiIface { - /** TODO(rpius): Add methods to the interface. */ + /** + * Mask of capabilities suported by this Iface. + */ + enum StaIfaceCapabilityMask : uint32_t { + /** + * If set indicates that the APF APIs are supported. + * APF (Android Packet Filter) is a BPF like packet filtering + * bytecode executed by the firmware. + */ + APF = 1 << 0, + /** + * If set indicates that the Background Scan APIs are supported. + * Background scan allow the host to send a number of buckets down to the + * firmware. Each bucket contains a set of channels, a period, and some + * parameters about how and when to report results. + */ + BACKGROUND_SCAN = 1 << 1, + }; + + /** + * Parameters to specify the APF capability of this iface. + */ + struct ApfPacketFilterCapabilities { + /** + * Version of the packet filter interpreter supported + */ + uint32_t version; + /** + * Maximum size of the filter bytecodes in bytes for an iface. + */ + uint32_t maxLength; + }; + + /** + * Parameters to specify the Background Scan capability of this iface. + */ + struct BackgroundScanCapabilities { + /** + * Maximum number of bytes available for cached scan results + */ + uint32_t maxCacheSize; + /** + * Maximum number of buckets that can be supplied for a scan + */ + uint32_t maxBuckets; + /** + * Maximum number of APs that must be stored for each scan. + */ + uint32_t maxApCachePerScan; + /** + * Max reporting number of scans threshold that can be specified in the scan + * parameters. + */ + int32_t maxReportingThreshold; + }; + + /** + * Bands that can be specified in Background scan requests. + */ + enum BackgroundScanBand : uint32_t { + BAND_UNSPECIFIED, + /** + * 2.4 GHz. + */ + BAND_24GHZ = 1, + /** + * 5 GHz without DFS. + */ + BAND_5GHZ = 2, + /** + * 5 GHz DFS only. + */ + BAND_5GHZ_DFS = 4, + /** + * 5 GHz with DFS. + */ + BAND_5GHZ_WITH_DFS = 6, + /** + * 2.4 GHz + 5 GHz; no DFS. + */ + BAND_24GHZ_5GHZ = 3, + /** + * 2.4 GHz + 5 GHz with DFS + */ + BAND_24GHZ_5GHZ_WITH_DFS = 7 + }; + + /** + * Mask of event reporting schemes that can be specified in background scan + * requests. + */ + enum BackgroundScanBucketEventReportSchemeMask : uint32_t { + /** + * Report a scan completion event after scan. If this is not set then scan + * completion events must be reported if report_threshold_percent or + * report_threshold_num_scans is reached. + */ + EACH_SCAN = 1 << 0, + /** + * Forward scan results (beacons/probe responses + IEs) in real time to HAL, + * in addition to completion events. + * Note: To keep backward compatibility, fire completion events regardless + * of REPORT_EVENTS_EACH_SCAN. + */ + FULL_RESULTS = 1 << 1, + /** + * Controls if scans for this bucket must be placed in the results buffer. + */ + NO_BATCH = 1 << 2, + }; + + /** + * Background Scan parameters per bucket that can be specified in background + * scan requests. + */ + struct BackgroundScanBucketParameters { + /** + * Bands to scan or 0 if frequencies list must be used instead. + */ + BackgroundScanBand band; + /** + * Channel frequencies (in Mhz) to scan if |band| is set to + * |UNSPECIFIED|. + */ + vec frequenciesInMhz; + /** + * Period at which this bucket must be scanned (in milliseconds). Must be an integer + * multiple of the |basePeriodInMs| specified in the BackgroundScanParameters. + */ + uint32_t periodInMs; + /** + * Bitset of |BackgroundScanBucketEventReportSchemeMask| values controlling + * when events for this bucket must be reported. + */ + uint32_t eventReportScheme; + /** + * For exponential back off. If |exponentialMaxPeriodInMs| is non zero or + * different than period, then this bucket is an exponential backoff bucket + * and the scan period must grow exponentially as per formula: + * actual_period(N) = period * (base ^ (N/step_count)) + * to this maximum period (in milliseconds). + */ + uint32_t exponentialMaxPeriodInMs; + /** + * For exponential back off. multiplier: new_period=old_period * base + */ + uint32_t exponentialBase; + /** + * For exponential back off. Number of scans to perform for a given + * period. + */ + uint32_t exponentialStepCount; + }; + + /** + * Background Scan parameters that can be specified in background scan + * requests. + */ + struct BackgroundScanParameters { + /** + * GCD of all bucket periods (in milliseconds). + */ + uint32_t basePeriodInMs; + /** + * Maximum number of APs that must be stored for each scan. If the maximum + * is reached the highest RSSI results must be returned. + */ + uint32_t maxApPerScan; + /** + * % cache buffer filled threshold at which the host must be notified of + * batched scan results. + */ + uint32_t reportThresholdPercent; + /** + * Threshold at which the AP must be woken up, in number of scans. + */ + uint32_t reportThresholdNumScans; + /** + * List of buckets to be scheduled. + */ + vec buckets; + }; + + /** + * Requests notifications of significant events on this iface. Multiple calls + * to this must register multiple callbacks each of which must receive all + * events. + * + * @param callback An instance of the |IWifiStaIfaceEventCallback| HIDL interface + * object. + */ + oneway registerEventCallback(IWifiStaIfaceEventCallback callback); + + /** + * Get the capabilities supported by this STA iface. + * + * @return capabilities Bitset of |StaIfaceCapabilityMask| values. + */ + getCapabilities() generates (uint64_t capabilities); + + /** + * Used to query additional information about the chip's APF capabilities. + * Will fail if |StaIfaceCapabilityMask.APF| is not set. + * + * @return capabilities Instance of |ApfPacketFilterCapabilities|. + */ + getApfPacketFilterCapabilities() + generates (ApfPacketFilterCapabilities capabilities); + + /** + * Installs an APF program on this iface, replacing an existing + * program if present. + * Will fail if |StaIfaceCapabilityMask.APF| is not set. + * + * @param cmdId command Id to use for this invocation. + * @param program APF Program to be set. + */ + oneway installApfPacketFilter(CommandId cmdId, vec program); + + /** + * Used to query additional information about the chip's APF capabilities. + * Will fail if |StaIfaceCapabilityMask.BACKGROUND_SCAN| is not set. + * + * @return capabilities Instance of |BackgroundScanCapabilities|. + */ + getBackgroundScanCapabilities() + generates (BackgroundScanCapabilities capabilities); + + /** + * Start a background scan using the given cmdId as an identifier. Only one + * active background scan need be supported. + * + * When this is called all requested buckets must be scanned, starting the + * beginning of the cycle. + * + * For example: + * If there are two buckets specified + * - Bucket 1: period=10s + * - Bucket 2: period=20s + * - Bucket 3: period=30s + * Then the following scans must occur + * - t=0 buckets 1, 2, and 3 are scanned + * - t=10 bucket 1 is scanned + * - t=20 bucket 1 and 2 are scanned + * - t=30 bucket 1 and 3 are scanned + * - t=40 bucket 1 and 2 are scanned + * - t=50 bucket 1 is scanned + * - t=60 buckets 1, 2, and 3 are scanned + * - and the patter repeats + * + * If any scan does not occur or is incomplete (error, interrupted, etc) then + * a cached scan result must still be recorded with the + * WIFI_SCAN_FLAG_INTERRUPTED flag set. + * + * @param cmdId command Id to use for this invocation. + * @param params Background scan parameters. + */ + oneway startBackgroundScan(CommandId cmdId, BackgroundScanParameters params); + + /** + * Stop the background scan started. + * + * @param cmdId command Id corresponding to the request. + */ + oneway stopBackgroundScan(CommandId cmdId); }; diff --git a/wifi/1.0/IWifiStaIfaceEventCallback.hal b/wifi/1.0/IWifiStaIfaceEventCallback.hal new file mode 100644 index 0000000000..1ee2d4e1d2 --- /dev/null +++ b/wifi/1.0/IWifiStaIfaceEventCallback.hal @@ -0,0 +1,126 @@ +/* + * Copyright 2016 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.wifi@1.0; + +interface IWifiStaIfaceEventCallback { + /** + * Callback indicating that the requested packet filter was successfully + * installed. + */ + oneway onInstallPacketFilterSuccess(); + + /** + * Callback indicating that installing a packet filter failed. + */ + oneway onInstallPacketFilterFailure(FailureReason reason); + + /** + * Callback indicating that a requested background scan was started. + */ + oneway onBackgroundScanStarted(); + + /** + * Callback indicating that a requested background scan failed to start. + */ + oneway onBackgroundScanStartFailure(FailureReason reason); + + /** + * Callback indicating that a scan was stopped + */ + oneway onBackgroundScanStopped(); + + /** + * Information elements contained within the |ScanResult| structure. + * These elements correspond to the IEEE_802.11 standard. + */ + struct InformationElement { + uint8_t id; + vec data; + }; + + /** + * BSSID type. 6 octets representing the physical address of an AP. + */ + typedef uint8_t[6] Bssid; + + /** + * Structure describing all the information about a single access point seen + * during the scan. + */ + struct ScanResult { + int64_t timeStampInUs; + vec ssid; + Bssid bssid; + uint32_t frequencyInMhz; + int8_t rssi; + uint16_t beaconPeriodInMs; + uint16_t capability; + vec informationElements; + }; + + /** + * Mask of flags set in the |ScanData| instance. + */ + enum ScanDataFlagMask { + /** + * Indicates that a scan was interrupted/did not occur so results may be + * incomplete. + */ + WIFI_SCAN_FLAG_INTERRUPTED = 1 << 0, + }; + + /** + * Structure describing all the information about all the access points seen during + * the scan. + */ + struct ScanData { + /** + * Bitset containing |ScanDataFlagMask| values. + */ + uint32_t flags; + /** + * Bitset where each bit indicates if the bucket with that index was + * scanned. + */ + uint32_t bucketsScanned; + /** + * List of scan results. + */ + vec results; + }; + + /** + * Called for each received beacon/probe response for a scan with the + * |REPORT_EVENTS_FULL_RESULTS| flag set in + * |BackgroundScanBucketParameters.eventReportScheme|. + * + * @param cmdId command Id corresponding to the request. + * @parm result Full scan result for an AP. + */ + oneway onBackgroundFullScanResult(CommandId cmdId, ScanResult result); + + /** + * Called when the |BackgroundScanBucketParameters.eventReportScheme| flags + * for at least one bucket that was just scanned was + * |REPORT_EVENTS_EACH_SCAN| or one of the configured thresholds was + * breached. + * + * @param cmdId command Id corresponding to the request. + * @parm scanDatas List of scan result for all AP's seen since last callback. + */ + oneway onBackgroundScanResults(CommandId cmdId, vec scanDatas); +}; diff --git a/wifi/1.0/types.hal b/wifi/1.0/types.hal index d9abaefe5d..cabb97dcc3 100644 --- a/wifi/1.0/types.hal +++ b/wifi/1.0/types.hal @@ -51,7 +51,7 @@ enum IfaceType : uint32_t { AP, P2P, /** - * NAN control interface. Datapath support may be queried and created + * NAN control interface. Datapath support must be queried and created * through this interface. */ NAN, @@ -66,3 +66,10 @@ typedef uint32_t ChipId; * An identifier for a mode that the chip can be put in. */ typedef uint32_t ChipModeId; + +/** + * A unique handle provided by the client to identify individual invocations of + * certain API's like |IWifiStaIface.startBackgroundScan|, + * |IWifiStaIface.installApfPacketFilter|, etc. + */ +typedef uint32_t CommandId; From 1f9073cfcb1a9674beb839efa24046851dee0222 Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Mon, 10 Oct 2016 10:32:22 -0700 Subject: [PATCH 02/24] wifi(interface): Add status for every method Add a status parameter for every HIDL interface object method which can possibly become invalid. This should help inform the caller that the object being used is stale/invalid now. While there, Rename |CommandFailureReson| to |FailureReasonCode|. NOTE: |FailureReason| will continue to indicate any errors during the processing of the command via the corresponding |onFailure| callback. Bug: 32056230 Test: Compiles Change-Id: I2ec5af3075221e483579410f344bcedd6bf17a93 --- wifi/1.0/Android.mk | 106 +++++++++++++++++--------- wifi/1.0/IWifiChip.hal | 130 ++++++++++++++++++++++++++------ wifi/1.0/IWifiIface.hal | 12 ++- wifi/1.0/IWifiRttController.hal | 6 +- wifi/1.0/IWifiStaIface.hal | 49 +++++++++--- wifi/1.0/types.hal | 24 +++++- 6 files changed, 256 insertions(+), 71 deletions(-) diff --git a/wifi/1.0/Android.mk b/wifi/1.0/Android.mk index a1a716d23c..e345dd2edc 100644 --- a/wifi/1.0/Android.mk +++ b/wifi/1.0/Android.mk @@ -12,23 +12,6 @@ intermediates := $(local-generated-sources-dir) HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX) -# -# Build types.hal (CommandFailureReason) -# -GEN := $(intermediates)/android/hardware/wifi/1.0/CommandFailureReason.java -$(GEN): $(HIDL) -$(GEN): PRIVATE_HIDL := $(HIDL) -$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal -$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) -$(GEN): PRIVATE_CUSTOM_TOOL = \ - $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ - -Ljava -randroid.hardware:hardware/interfaces \ - android.hardware.wifi@1.0::types.CommandFailureReason - -$(GEN): $(LOCAL_PATH)/types.hal - $(transform-generated-source) -LOCAL_GENERATED_SOURCES += $(GEN) - # # Build types.hal (FailureReason) # @@ -46,6 +29,23 @@ $(GEN): $(LOCAL_PATH)/types.hal $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) +# +# Build types.hal (FailureReasonCode) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/FailureReasonCode.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.FailureReasonCode + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + # # Build types.hal (IfaceType) # @@ -63,6 +63,23 @@ $(GEN): $(LOCAL_PATH)/types.hal $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) +# +# Build types.hal (StatusCode) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/StatusCode.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.StatusCode + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + # # Build IWifi.hal # @@ -242,6 +259,8 @@ $(GEN): PRIVATE_HIDL := $(HIDL) $(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IWifiRttController.hal $(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IWifiIface.hal $(GEN): $(LOCAL_PATH)/IWifiIface.hal +$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal +$(GEN): $(LOCAL_PATH)/types.hal $(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) $(GEN): PRIVATE_CUSTOM_TOOL = \ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ @@ -306,23 +325,6 @@ intermediates := $(local-generated-sources-dir) HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX) -# -# Build types.hal (CommandFailureReason) -# -GEN := $(intermediates)/android/hardware/wifi/1.0/CommandFailureReason.java -$(GEN): $(HIDL) -$(GEN): PRIVATE_HIDL := $(HIDL) -$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal -$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) -$(GEN): PRIVATE_CUSTOM_TOOL = \ - $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ - -Ljava -randroid.hardware:hardware/interfaces \ - android.hardware.wifi@1.0::types.CommandFailureReason - -$(GEN): $(LOCAL_PATH)/types.hal - $(transform-generated-source) -LOCAL_GENERATED_SOURCES += $(GEN) - # # Build types.hal (FailureReason) # @@ -340,6 +342,23 @@ $(GEN): $(LOCAL_PATH)/types.hal $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) +# +# Build types.hal (FailureReasonCode) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/FailureReasonCode.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.FailureReasonCode + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + # # Build types.hal (IfaceType) # @@ -357,6 +376,23 @@ $(GEN): $(LOCAL_PATH)/types.hal $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) +# +# Build types.hal (StatusCode) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/StatusCode.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.StatusCode + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + # # Build IWifi.hal # @@ -536,6 +572,8 @@ $(GEN): PRIVATE_HIDL := $(HIDL) $(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IWifiRttController.hal $(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IWifiIface.hal $(GEN): $(LOCAL_PATH)/IWifiIface.hal +$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal +$(GEN): $(LOCAL_PATH)/types.hal $(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) $(GEN): PRIVATE_CUSTOM_TOOL = \ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ diff --git a/wifi/1.0/IWifiChip.hal b/wifi/1.0/IWifiChip.hal index 55f6d61a92..c9ff038160 100644 --- a/wifi/1.0/IWifiChip.hal +++ b/wifi/1.0/IWifiChip.hal @@ -121,9 +121,13 @@ interface IWifiChip { /** * Get the id assigned to this chip. * + * @return status Status of the operation. + * Possible status codes: + * |StatusCode.SUCCESS|, + * |StatusCode.ERROR_WIFI_CHIP_INVALID| * @return id Assigned chip Id. */ - getId() generates (ChipId id); + getId() generates (StatusCode status, ChipId id); /** * Requests notifications of significant events on this chip. Multiple calls @@ -132,15 +136,23 @@ interface IWifiChip { * * @param callback An instance of the |IWifiChipEventCallback| HIDL interface * object. + * @return status Status of the operation. + * Possible status codes: + * |StatusCode.SUCCESS|, + * |StatusCode.ERROR_WIFI_CHIP_INVALID| */ - oneway registerEventCallback(IWifiChipEventCallback callback); + registerEventCallback(IWifiChipEventCallback callback) generates (StatusCode status); /** * Get the set of operation modes that the chip supports. * + * @return status Status of the operation. + * Possible status codes: + * |StatusCode.SUCCESS|, + * |StatusCode.ERROR_WIFI_CHIP_INVALID| * @return modes List of modes supported by the device. */ - getAvailableModes() generates (vec modes); + getAvailableModes() generates (StatusCode status, vec modes); /** * Reconfigure the Chip. @@ -149,37 +161,60 @@ interface IWifiChip { * * @param modeId The mode that the chip should switch to, corresponding to the * id property of the target ChipMode. + * @return status Status of the operation. + * Possible status codes: + * |StatusCode.SUCCESS|, + * |StatusCode.ERROR_WIFI_CHIP_INVALID| */ - oneway configureChip(ChipModeId modeId); + configureChip(ChipModeId modeId) generates (StatusCode status); /** * Get the current mode that the chip is in. * * @return modeId The mode that the chip is currently configured to, * corresponding to the id property of the target ChipMode. + * @return status Status of the operation. + * Possible status codes: + * |StatusCode.SUCCESS|, + * |StatusCode.ERROR_WIFI_CHIP_INVALID| */ - getMode() generates (ChipModeId modeId); + getMode() generates (StatusCode status, ChipModeId modeId); /** * Request information about the chip. * Must trigger |IWifiChipEventCallback.onChipDebugInfoAvailable| on sucess, * or |IWifiChipEventCallback.onChipDebugInfoFailure| on failure. + * + * @return status Status of the operation. + * Possible status codes: + * |StatusCode.SUCCESS|, + * |StatusCode.ERROR_WIFI_CHIP_INVALID| */ - oneway requestChipDebugInfo(); + requestChipDebugInfo() generates (StatusCode status); /** * Request vendor debug info from the driver. * Must trigger |IWifiChipEventCallback.onDriverDebugDumpAvailable| on success, * or |IWifiChipEventCallback.onDriverDebugDumpFailure| on failure. + * + * @return status Status of the operation. + * Possible status codes: + * |StatusCode.SUCCESS|, + * |StatusCode.ERROR_WIFI_CHIP_INVALID| */ - oneway requestDriverDebugDump(); + requestDriverDebugDump() generates (StatusCode status); /** * Request vendor debug info from the firmware. * Must trigger |IWifiChipEventCallback.onFirmwareDebugDumpAvailable| on * success, or |IWifiChipEventCallback.onFirmwareDebugDumpFailure| on failure. + * + * @return status Status of the operation. + * Possible status codes: + * |StatusCode.SUCCESS|, + * |StatusCode.ERROR_WIFI_CHIP_INVALID| */ - oneway requestFirmwareDebugDump(); + requestFirmwareDebugDump() generates (StatusCode status); /** * Create an AP iface on the chip. @@ -188,29 +223,41 @@ interface IWifiChip { * may fail if we've already reached the maximum allowed * (specified in |ChipIfaceCombination|) number of ifaces of the AP type. * + * @return status Status of the operation. + * Possible status codes: + * |StatusCode.SUCCESS|, + * |StatusCode.ERROR_WIFI_CHIP_INVALID| * @return iface HIDL interface object representing the iface if * successful, null otherwise. */ - createApIface() generates (IWifiApIface iface); + createApIface() generates (StatusCode status, IWifiApIface iface); /** * List all the AP iface names configured on the chip. * The corresponding |IWifiApIface| object for any iface are * retrieved using |getApIface| method. * + * @return status Status of the operation. + * Possible status codes: + * |StatusCode.SUCCESS|, + * |StatusCode.ERROR_WIFI_CHIP_INVALID| * @return ifnames List of all AP iface names on the chip. */ - getApIfaceNames() generates (vec ifnames); + getApIfaceNames() generates (StatusCode status, vec ifnames); /** * Gets a HIDL interface object for the AP Iface corresponding * to the provided ifname. * * @param ifname Name of the iface. + * @return status Status of the operation. + * Possible status codes: + * |StatusCode.SUCCESS|, + * |StatusCode.ERROR_WIFI_CHIP_INVALID| * @return iface HIDL interface object representing the iface if * it exists, null otherwise. */ - getApIface(string ifname) generates (IWifiApIface iface); + getApIface(string ifname) generates (StatusCode status, IWifiApIface iface); /** * Create a NAN iface on the chip. @@ -219,29 +266,41 @@ interface IWifiChip { * may fail if we've already reached the maximum allowed * (specified in |ChipIfaceCombination|) number of ifaces of the NAN type. * + * @return status Status of the operation. + * Possible status codes: + * |StatusCode.SUCCESS|, + * |StatusCode.ERROR_WIFI_CHIP_INVALID| * @return iface HIDL interface object representing the iface if * successful, null otherwise. */ - createNanIface() generates (IWifiNanIface iface); + createNanIface() generates (StatusCode status, IWifiNanIface iface); /** * List all the NAN iface names configured on the chip. * The corresponding |IWifiNanIface| object for any iface are * retrieved using |getNanIface| method. * + * @return status Status of the operation. + * Possible status codes: + * |StatusCode.SUCCESS|, + * |StatusCode.ERROR_WIFI_CHIP_INVALID| * @return ifnames List of all NAN iface names on the chip. */ - getNanIfaceNames() generates (vec ifnames); + getNanIfaceNames() generates (StatusCode status, vec ifnames); /** * Gets a HIDL interface object for the NAN Iface corresponding * to the provided ifname. * * @param ifname Name of the iface. + * @return status Status of the operation. + * Possible status codes: + * |StatusCode.SUCCESS|, + * |StatusCode.ERROR_WIFI_CHIP_INVALID| * @return iface HIDL interface object representing the iface if * it exists, null otherwise. */ - getNanIface(string ifname) generates (IWifiNanIface iface); + getNanIface(string ifname) generates (StatusCode status, IWifiNanIface iface); /** * Create a P2P iface on the chip. @@ -250,29 +309,41 @@ interface IWifiChip { * may fail if we've already reached the maximum allowed * (specified in |ChipIfaceCombination|) number of ifaces of the P2P type. * + * @return status Status of the operation. + * Possible status codes: + * |StatusCode.SUCCESS|, + * |StatusCode.ERROR_WIFI_CHIP_INVALID| * @return iface HIDL interface object representing the iface if * successful, null otherwise. */ - createP2pIface() generates (IWifiP2pIface iface); + createP2pIface() generates (StatusCode status, IWifiP2pIface iface); /** * List all the P2P iface names configured on the chip. * The corresponding |IWifiP2pIface| object for any iface are * retrieved using |getP2pIface| method. * + * @return status Status of the operation. + * Possible status codes: + * |StatusCode.SUCCESS|, + * |StatusCode.ERROR_WIFI_CHIP_INVALID| * @return ifnames List of all P2P iface names on the chip. */ - getP2pIfaceNames() generates (vec ifnames); + getP2pIfaceNames() generates (StatusCode status, vec ifnames); /** * Gets a HIDL interface object for the P2P Iface corresponding * to the provided ifname. * * @param ifname Name of the iface. + * @return status Status of the operation. + * Possible status codes: + * |StatusCode.SUCCESS|, + * |StatusCode.ERROR_WIFI_CHIP_INVALID| * @return iface HIDL interface object representing the iface if * it exists, null otherwise. */ - getP2pIface(string ifname) generates (IWifiP2pIface iface); + getP2pIface(string ifname) generates (StatusCode status, IWifiP2pIface iface); /** * Create an STA iface on the chip. @@ -281,29 +352,41 @@ interface IWifiChip { * may fail if we've already reached the maximum allowed * (specified in |ChipIfaceCombination|) number of ifaces of the STA type. * + * @return status Status of the operation. + * Possible status codes: + * |StatusCode.SUCCESS|, + * |StatusCode.ERROR_WIFI_CHIP_INVALID| * @return iface HIDL interface object representing the iface if * successful, null otherwise. */ - createStaIface() generates (IWifiStaIface iface); + createStaIface() generates (StatusCode status, IWifiStaIface iface); /** * List all the STA iface names configured on the chip. * The corresponding |IWifiStaIface| object for any iface are * retrieved using |getStaIface| method. * + * @return status Status of the operation. + * Possible status codes: + * |StatusCode.SUCCESS|, + * |StatusCode.ERROR_WIFI_CHIP_INVALID| * @return ifnames List of all STA iface names on the chip. */ - getStaIfaceNames() generates (vec ifnames); + getStaIfaceNames() generates (StatusCode status, vec ifnames); /** * Gets a HIDL interface object for the STA Iface corresponding * to the provided ifname. * * @param ifname Name of the iface. + * @return status Status of the operation. + * Possible status codes: + * |StatusCode.SUCCESS|, + * |StatusCode.ERROR_WIFI_CHIP_INVALID| * @return iface HIDL interface object representing the iface if * it exists, null otherwise. */ - getStaIface(string ifname) generates (IWifiStaIface iface); + getStaIface(string ifname) generates (StatusCode status, IWifiStaIface iface); /** * Create a RTTController instance. @@ -316,6 +399,11 @@ interface IWifiChip { * * @param boundIface HIDL interface object representing the iface if * the responder must be bound to a specific iface, null otherwise. + * @return status Status of the operation. + * Possible status codes: + * |StatusCode.SUCCESS|, + * |StatusCode.ERROR_WIFI_CHIP_INVALID| */ - createRttController(IWifiIface boundIface) generates (IWifiRttController rtt); + createRttController(IWifiIface boundIface) + generates (StatusCode status, IWifiRttController rtt); }; diff --git a/wifi/1.0/IWifiIface.hal b/wifi/1.0/IWifiIface.hal index f4150e79b4..726a973f19 100644 --- a/wifi/1.0/IWifiIface.hal +++ b/wifi/1.0/IWifiIface.hal @@ -23,14 +23,22 @@ interface IWifiIface { /** * Get the type of this iface. * + * @return status Status of the operation. + * Possible status codes: + * |StatusCode.SUCCESS|, + * |StatusCode.ERROR_WIFI_IFACE_INVALID| * @return type One of the supported iface types. */ - getType() generates (IfaceType type); + getType() generates (StatusCode status, IfaceType type); /** * Get the name of this iface. * + * @return status Status of the operation. + * Possible status codes: + * |StatusCode.SUCCESS|, + * |StatusCode.ERROR_WIFI_IFACE_INVALID| * @return name Name of the iface. */ - getName() generates (string name); + getName() generates (StatusCode status, string name); }; diff --git a/wifi/1.0/IWifiRttController.hal b/wifi/1.0/IWifiRttController.hal index d735da7664..cc827bbde3 100644 --- a/wifi/1.0/IWifiRttController.hal +++ b/wifi/1.0/IWifiRttController.hal @@ -25,8 +25,12 @@ interface IWifiRttController { /** * Get the iface on which the RTT operations will be performed. * + * @return status Status of the operation. + * Possible status codes: + * |StatusCode.SUCCESS|, + * |StatusCode.ERROR_WIFI_RTT_CONTROLLER_INVALID| * @return boundIface HIDL interface object representing the iface if bound * to a specific iface, null otherwise */ - getBoundIface() generates (IWifiIface boundIface); + getBoundIface() generates (StatusCode status, IWifiIface boundIface); }; diff --git a/wifi/1.0/IWifiStaIface.hal b/wifi/1.0/IWifiStaIface.hal index a738ebe4da..402385bb66 100644 --- a/wifi/1.0/IWifiStaIface.hal +++ b/wifi/1.0/IWifiStaIface.hal @@ -213,24 +213,37 @@ interface IWifiStaIface extends IWifiIface { * * @param callback An instance of the |IWifiStaIfaceEventCallback| HIDL interface * object. + * @return status Status of the operation. + * Possible status codes: + * |StatusCode.SUCCESS|, + * |StatusCode.ERROR_WIFI_IFACE_INVALID| */ - oneway registerEventCallback(IWifiStaIfaceEventCallback callback); + registerEventCallback(IWifiStaIfaceEventCallback callback) + generates (StatusCode status); /** * Get the capabilities supported by this STA iface. * + * @return status Status of the operation. + * Possible status codes: + * |StatusCode.SUCCESS|, + * |StatusCode.ERROR_WIFI_IFACE_INVALID| * @return capabilities Bitset of |StaIfaceCapabilityMask| values. */ - getCapabilities() generates (uint64_t capabilities); + getCapabilities() generates (StatusCode status, uint64_t capabilities); /** * Used to query additional information about the chip's APF capabilities. * Will fail if |StaIfaceCapabilityMask.APF| is not set. * + * @return status Status of the operation. + * Possible status codes: + * |StatusCode.SUCCESS|, + * |StatusCode.ERROR_WIFI_IFACE_INVALID| * @return capabilities Instance of |ApfPacketFilterCapabilities|. */ getApfPacketFilterCapabilities() - generates (ApfPacketFilterCapabilities capabilities); + generates (StatusCode status, ApfPacketFilterCapabilities capabilities); /** * Installs an APF program on this iface, replacing an existing @@ -238,18 +251,27 @@ interface IWifiStaIface extends IWifiIface { * Will fail if |StaIfaceCapabilityMask.APF| is not set. * * @param cmdId command Id to use for this invocation. - * @param program APF Program to be set. + * @param APF Program to be set. + * @return status Status of the operation. + * Possible status codes: + * |StatusCode.SUCCESS|, + * |StatusCode.ERROR_WIFI_IFACE_INVALID| */ - oneway installApfPacketFilter(CommandId cmdId, vec program); + installApfPacketFilter(CommandId cmdId, vec program) + generates (StatusCode status); /** * Used to query additional information about the chip's APF capabilities. * Will fail if |StaIfaceCapabilityMask.BACKGROUND_SCAN| is not set. * + * @return status Status of the operation. + * Possible status codes: + * |StatusCode.SUCCESS|, + * |StatusCode.ERROR_WIFI_IFACE_INVALID| * @return capabilities Instance of |BackgroundScanCapabilities|. */ getBackgroundScanCapabilities() - generates (BackgroundScanCapabilities capabilities); + generates (StatusCode status, BackgroundScanCapabilities capabilities); /** * Start a background scan using the given cmdId as an identifier. Only one @@ -278,14 +300,23 @@ interface IWifiStaIface extends IWifiIface { * WIFI_SCAN_FLAG_INTERRUPTED flag set. * * @param cmdId command Id to use for this invocation. - * @param params Background scan parameters. + * @params Background scan parameters. + * @return status Status of the operation. + * Possible status codes: + * |StatusCode.SUCCESS|, + * |StatusCode.ERROR_WIFI_IFACE_INVALID| */ - oneway startBackgroundScan(CommandId cmdId, BackgroundScanParameters params); + startBackgroundScan(CommandId cmdId, BackgroundScanParameters params) + generates (StatusCode status); /** * Stop the background scan started. * * @param cmdId command Id corresponding to the request. + * @return status Status of the operation. + * Possible status codes: + * |StatusCode.SUCCESS|, + * |StatusCode.ERROR_WIFI_IFACE_INVALID| */ - oneway stopBackgroundScan(CommandId cmdId); + stopBackgroundScan(CommandId cmdId) generates (StatusCode status); }; diff --git a/wifi/1.0/types.hal b/wifi/1.0/types.hal index cabb97dcc3..25d4fa1d25 100644 --- a/wifi/1.0/types.hal +++ b/wifi/1.0/types.hal @@ -17,9 +17,24 @@ package android.hardware.wifi@1.0; /** - * List of failure reasons returned. + * Enum values indicating whether the command processing was successfully + * initiated or not. */ -enum CommandFailureReason : uint32_t { +enum StatusCode : uint32_t { + /** No errors. Command processing successfully initiated. */ + SUCCESS, + /** Method invoked on an invalid |IWifiChip| object. */ + ERROR_WIFI_CHIP_INVALID, + /** Method invoked on an invalid |IWifiIface| object. */ + ERROR_WIFI_IFACE_INVALID, + /** Method invoked on an invalid |IWifiRttController| object. */ + ERROR_WIFI_RTT_CONTROLLER_INVALID +}; + +/** + * List of failure reasons returned in |FailureReason|. + */ +enum FailureReasonCode : uint32_t { UNKNOWN, DUPLICATE_COMMAND_ID, NOT_SUPPORTED, @@ -32,10 +47,11 @@ enum CommandFailureReason : uint32_t { /** * Generic structure to return information about a failure. + * The failure reason will be returned in the corresponding |onFailure| + * callback. */ struct FailureReason { - CommandFailureReason reason; - + FailureReasonCode reason; /** * A vendor specific error message from the vendor to provide more * information beyond the reason code. From a52dc7322d39347c97c6b700bae6c7fa62090cd3 Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Mon, 10 Oct 2016 11:53:07 -0700 Subject: [PATCH 03/24] wifi(interface): Make methods synchronous Having all the HIDL methods asynchronous, makes it hard for the calling code to keep track of the operation status/result. There are some operations which will generate asynchronous results (like bgscan), convert all the other methods to synchronous methods. The |EventCallback| objects will now just broadcast important events (needed for other clients to listen for state changes). This will no longer be used to send responses to every command sent to the HAL. Bug: 32061909 Test: `./hardware/interfaces/update-makefiles.sh` Change-Id: Id2433f4c8e028268dd027cdeb239ba4082b157b5 --- wifi/1.0/Android.mk | 114 +++++------- wifi/1.0/IWifi.hal | 28 ++- wifi/1.0/IWifiChip.hal | 228 +++++++++++++----------- wifi/1.0/IWifiChipEventCallback.hal | 66 ------- wifi/1.0/IWifiEventCallback.hal | 18 +- wifi/1.0/IWifiIface.hal | 16 +- wifi/1.0/IWifiRttController.hal | 8 +- wifi/1.0/IWifiStaIface.hal | 74 +++++--- wifi/1.0/IWifiStaIfaceEventCallback.hal | 32 +--- wifi/1.0/types.hal | 35 ++-- 10 files changed, 267 insertions(+), 352 deletions(-) diff --git a/wifi/1.0/Android.mk b/wifi/1.0/Android.mk index e345dd2edc..c7983ea7f6 100644 --- a/wifi/1.0/Android.mk +++ b/wifi/1.0/Android.mk @@ -12,40 +12,6 @@ intermediates := $(local-generated-sources-dir) HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX) -# -# Build types.hal (FailureReason) -# -GEN := $(intermediates)/android/hardware/wifi/1.0/FailureReason.java -$(GEN): $(HIDL) -$(GEN): PRIVATE_HIDL := $(HIDL) -$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal -$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) -$(GEN): PRIVATE_CUSTOM_TOOL = \ - $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ - -Ljava -randroid.hardware:hardware/interfaces \ - android.hardware.wifi@1.0::types.FailureReason - -$(GEN): $(LOCAL_PATH)/types.hal - $(transform-generated-source) -LOCAL_GENERATED_SOURCES += $(GEN) - -# -# Build types.hal (FailureReasonCode) -# -GEN := $(intermediates)/android/hardware/wifi/1.0/FailureReasonCode.java -$(GEN): $(HIDL) -$(GEN): PRIVATE_HIDL := $(HIDL) -$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal -$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) -$(GEN): PRIVATE_CUSTOM_TOOL = \ - $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ - -Ljava -randroid.hardware:hardware/interfaces \ - android.hardware.wifi@1.0::types.FailureReasonCode - -$(GEN): $(LOCAL_PATH)/types.hal - $(transform-generated-source) -LOCAL_GENERATED_SOURCES += $(GEN) - # # Build types.hal (IfaceType) # @@ -64,9 +30,9 @@ $(GEN): $(LOCAL_PATH)/types.hal LOCAL_GENERATED_SOURCES += $(GEN) # -# Build types.hal (StatusCode) +# Build types.hal (WifiStatus) # -GEN := $(intermediates)/android/hardware/wifi/1.0/StatusCode.java +GEN := $(intermediates)/android/hardware/wifi/1.0/WifiStatus.java $(GEN): $(HIDL) $(GEN): PRIVATE_HIDL := $(HIDL) $(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal @@ -74,7 +40,24 @@ $(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) $(GEN): PRIVATE_CUSTOM_TOOL = \ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ -Ljava -randroid.hardware:hardware/interfaces \ - android.hardware.wifi@1.0::types.StatusCode + android.hardware.wifi@1.0::types.WifiStatus + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (WifiStatusCode) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/WifiStatusCode.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.WifiStatusCode $(GEN): $(LOCAL_PATH)/types.hal $(transform-generated-source) @@ -325,40 +308,6 @@ intermediates := $(local-generated-sources-dir) HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX) -# -# Build types.hal (FailureReason) -# -GEN := $(intermediates)/android/hardware/wifi/1.0/FailureReason.java -$(GEN): $(HIDL) -$(GEN): PRIVATE_HIDL := $(HIDL) -$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal -$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) -$(GEN): PRIVATE_CUSTOM_TOOL = \ - $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ - -Ljava -randroid.hardware:hardware/interfaces \ - android.hardware.wifi@1.0::types.FailureReason - -$(GEN): $(LOCAL_PATH)/types.hal - $(transform-generated-source) -LOCAL_GENERATED_SOURCES += $(GEN) - -# -# Build types.hal (FailureReasonCode) -# -GEN := $(intermediates)/android/hardware/wifi/1.0/FailureReasonCode.java -$(GEN): $(HIDL) -$(GEN): PRIVATE_HIDL := $(HIDL) -$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal -$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) -$(GEN): PRIVATE_CUSTOM_TOOL = \ - $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ - -Ljava -randroid.hardware:hardware/interfaces \ - android.hardware.wifi@1.0::types.FailureReasonCode - -$(GEN): $(LOCAL_PATH)/types.hal - $(transform-generated-source) -LOCAL_GENERATED_SOURCES += $(GEN) - # # Build types.hal (IfaceType) # @@ -377,9 +326,9 @@ $(GEN): $(LOCAL_PATH)/types.hal LOCAL_GENERATED_SOURCES += $(GEN) # -# Build types.hal (StatusCode) +# Build types.hal (WifiStatus) # -GEN := $(intermediates)/android/hardware/wifi/1.0/StatusCode.java +GEN := $(intermediates)/android/hardware/wifi/1.0/WifiStatus.java $(GEN): $(HIDL) $(GEN): PRIVATE_HIDL := $(HIDL) $(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal @@ -387,7 +336,24 @@ $(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) $(GEN): PRIVATE_CUSTOM_TOOL = \ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ -Ljava -randroid.hardware:hardware/interfaces \ - android.hardware.wifi@1.0::types.StatusCode + android.hardware.wifi@1.0::types.WifiStatus + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (WifiStatusCode) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/WifiStatusCode.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.WifiStatusCode $(GEN): $(LOCAL_PATH)/types.hal $(transform-generated-source) diff --git a/wifi/1.0/IWifi.hal b/wifi/1.0/IWifi.hal index 9e09348087..3166691313 100644 --- a/wifi/1.0/IWifi.hal +++ b/wifi/1.0/IWifi.hal @@ -48,27 +48,39 @@ interface IWifi { /** * Perform any setup that is required to make use of the module. If the module - * is already started then this must be a noop. The onStart callback must be - * called when the setup completes or if the HAL is already started. If the - * setup fails then onStartFailure must be called. + * is already started then this must be a noop. + * Must trigger |IWifiEventCallback.onStart| on success. + * + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.NOT_AVAILABLE|, + * |WifiStatusCode.UNKNOWN| */ @entry @callflow(next={"registerEventCallback", "start", "stop", "getChip"}) - oneway start(); + start() generates (WifiStatus status); /** * Tear down any state, ongoing commands, etc. If the module is already * stopped then this must be a noop. If the HAL is already stopped or it - * succeeds then onStop must be called. If the teardown fails onFailure must - * be called. After calling this all IWifiChip objects will be considered - * invalid. + * succeeds then onStop must be called. After calling this all IWifiChip + * objects will be considered invalid. + * Must trigger |IWifiEventCallback.onStop| on success. + * Must trigger |IWifiEventCallback.onFailure| on failure. * * Calling stop then start is a valid way of resetting state in the HAL, * driver, firmware. + * + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.NOT_AVAILABLE|, + * |WifiStatusCode.UNKNOWN| */ @exit @callflow(next={"registerEventCallback", "start", "stop"}) - oneway stop(); + stop() generates (WifiStatus status); /** * Retrieve the list of all chip Id's on the device. diff --git a/wifi/1.0/IWifiChip.hal b/wifi/1.0/IWifiChip.hal index c9ff038160..166cfb409a 100644 --- a/wifi/1.0/IWifiChip.hal +++ b/wifi/1.0/IWifiChip.hal @@ -118,16 +118,28 @@ interface IWifiChip { vec availableCombinations; }; + /** + * Information about the version of the driver and firmware running this chip. + * + * The information in these ASCII strings are vendor specific and does not + * need to follow any particular format. It may be dumped as part of the bug + * report. + */ + struct ChipDebugInfo { + string driverDescription; + string firmwareDescription; + }; + /** * Get the id assigned to this chip. * - * @return status Status of the operation. + * @return status WifiStatus of the operation. * Possible status codes: - * |StatusCode.SUCCESS|, - * |StatusCode.ERROR_WIFI_CHIP_INVALID| + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID| * @return id Assigned chip Id. */ - getId() generates (StatusCode status, ChipId id); + getId() generates (WifiStatus status, ChipId id); /** * Requests notifications of significant events on this chip. Multiple calls @@ -136,257 +148,273 @@ interface IWifiChip { * * @param callback An instance of the |IWifiChipEventCallback| HIDL interface * object. - * @return status Status of the operation. + * @return status WifiStatus of the operation. * Possible status codes: - * |StatusCode.SUCCESS|, - * |StatusCode.ERROR_WIFI_CHIP_INVALID| + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID| */ - registerEventCallback(IWifiChipEventCallback callback) generates (StatusCode status); + registerEventCallback(IWifiChipEventCallback callback) generates (WifiStatus status); /** * Get the set of operation modes that the chip supports. * - * @return status Status of the operation. + * @return status WifiStatus of the operation. * Possible status codes: - * |StatusCode.SUCCESS|, - * |StatusCode.ERROR_WIFI_CHIP_INVALID| + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID| * @return modes List of modes supported by the device. */ - getAvailableModes() generates (StatusCode status, vec modes); + getAvailableModes() generates (WifiStatus status, vec modes); /** * Reconfigure the Chip. - * Must trigger |IWifiChipEventCallback.onChipReconfigured| on sucess, - * or |IWifiChipEventCallback.onChipReconfigureFailure| on failure. + * Any existing |IWifiIface| objects must be marked invalid after this call. + * If this fails then the chips is now in an undefined state and + * configureChip must be called again. + * Must trigger |IWifiChipEventCallback.onChipReconfigured| on success. + * Must trigger |IWifiEventCallback.onFailure| on failure. * * @param modeId The mode that the chip should switch to, corresponding to the * id property of the target ChipMode. - * @return status Status of the operation. + * @return status WifiStatus of the operation. * Possible status codes: - * |StatusCode.SUCCESS|, - * |StatusCode.ERROR_WIFI_CHIP_INVALID| + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|, + * |WifiStatusCode.ERROR_NOT_AVAILABLE|, + * |WifiStatusCode.ERROR_UNKNOWN| */ - configureChip(ChipModeId modeId) generates (StatusCode status); + configureChip(ChipModeId modeId) generates (WifiStatus status); /** * Get the current mode that the chip is in. * * @return modeId The mode that the chip is currently configured to, * corresponding to the id property of the target ChipMode. - * @return status Status of the operation. + * @return status WifiStatus of the operation. * Possible status codes: - * |StatusCode.SUCCESS|, - * |StatusCode.ERROR_WIFI_CHIP_INVALID| + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID| */ - getMode() generates (StatusCode status, ChipModeId modeId); + getMode() generates (WifiStatus status, ChipModeId modeId); /** * Request information about the chip. - * Must trigger |IWifiChipEventCallback.onChipDebugInfoAvailable| on sucess, - * or |IWifiChipEventCallback.onChipDebugInfoFailure| on failure. * - * @return status Status of the operation. + * @return status WifiStatus of the operation. * Possible status codes: - * |StatusCode.SUCCESS|, - * |StatusCode.ERROR_WIFI_CHIP_INVALID| + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|, + * |WifiStatusCode.ERROR_NOT_AVAILABLE|, + * |WifiStatusCode.ERROR_UNKNOWN| + * @return chipDebugInfo Instance of |ChipDebugInfo|. */ - requestChipDebugInfo() generates (StatusCode status); + requestChipDebugInfo() generates (WifiStatus status, ChipDebugInfo chipDebugInfo); /** * Request vendor debug info from the driver. - * Must trigger |IWifiChipEventCallback.onDriverDebugDumpAvailable| on success, - * or |IWifiChipEventCallback.onDriverDebugDumpFailure| on failure. * - * @return status Status of the operation. + * @return status WifiStatus of the operation. * Possible status codes: - * |StatusCode.SUCCESS|, - * |StatusCode.ERROR_WIFI_CHIP_INVALID| + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|, + * |WifiStatusCode.ERROR_NOT_AVAILABLE|, + * |WifiStatusCode.ERROR_UNKNOWN| + * @param blob Vector of bytes retrieved from the driver. */ - requestDriverDebugDump() generates (StatusCode status); + requestDriverDebugDump() generates (WifiStatus status, vec blob); /** * Request vendor debug info from the firmware. - * Must trigger |IWifiChipEventCallback.onFirmwareDebugDumpAvailable| on - * success, or |IWifiChipEventCallback.onFirmwareDebugDumpFailure| on failure. * - * @return status Status of the operation. + * @return status WifiStatus of the operation. * Possible status codes: - * |StatusCode.SUCCESS|, - * |StatusCode.ERROR_WIFI_CHIP_INVALID| + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|, + * |WifiStatusCode.ERROR_NOT_AVAILABLE|, + * |WifiStatusCode.ERROR_UNKNOWN| + * @param blob Vector of bytes retrieved from the driver. */ - requestFirmwareDebugDump() generates (StatusCode status); + requestFirmwareDebugDump() generates (WifiStatus status, vec blob); /** * Create an AP iface on the chip. * * Depending on the mode the chip is configured in, the interface creation - * may fail if we've already reached the maximum allowed - * (specified in |ChipIfaceCombination|) number of ifaces of the AP type. + * may fail (code: |ERROR_NOT_SUPPORTED|) if we've already reached the maximum + * allowed (specified in |ChipIfaceCombination|) number of ifaces of the AP + * type. * - * @return status Status of the operation. + * @return status WifiStatus of the operation. * Possible status codes: - * |StatusCode.SUCCESS|, - * |StatusCode.ERROR_WIFI_CHIP_INVALID| + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|, + * |WifiStatusCode.ERROR_NOT_SUPPORTED| * @return iface HIDL interface object representing the iface if * successful, null otherwise. */ - createApIface() generates (StatusCode status, IWifiApIface iface); + createApIface() generates (WifiStatus status, IWifiApIface iface); /** * List all the AP iface names configured on the chip. * The corresponding |IWifiApIface| object for any iface are * retrieved using |getApIface| method. * - * @return status Status of the operation. + * @return status WifiStatus of the operation. * Possible status codes: - * |StatusCode.SUCCESS|, - * |StatusCode.ERROR_WIFI_CHIP_INVALID| + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID| * @return ifnames List of all AP iface names on the chip. */ - getApIfaceNames() generates (StatusCode status, vec ifnames); + getApIfaceNames() generates (WifiStatus status, vec ifnames); /** * Gets a HIDL interface object for the AP Iface corresponding * to the provided ifname. * * @param ifname Name of the iface. - * @return status Status of the operation. + * @return status WifiStatus of the operation. * Possible status codes: - * |StatusCode.SUCCESS|, - * |StatusCode.ERROR_WIFI_CHIP_INVALID| + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID| * @return iface HIDL interface object representing the iface if * it exists, null otherwise. */ - getApIface(string ifname) generates (StatusCode status, IWifiApIface iface); + getApIface(string ifname) generates (WifiStatus status, IWifiApIface iface); /** * Create a NAN iface on the chip. * * Depending on the mode the chip is configured in, the interface creation - * may fail if we've already reached the maximum allowed - * (specified in |ChipIfaceCombination|) number of ifaces of the NAN type. + * may fail (code: |ERROR_NOT_SUPPORTED|) if we've already reached the maximum + * allowed (specified in |ChipIfaceCombination|) number of ifaces of the NAN + * type. * - * @return status Status of the operation. + * @return status WifiStatus of the operation. * Possible status codes: - * |StatusCode.SUCCESS|, - * |StatusCode.ERROR_WIFI_CHIP_INVALID| + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|, + * |WifiStatusCode.ERROR_NOT_SUPPORTED| * @return iface HIDL interface object representing the iface if * successful, null otherwise. */ - createNanIface() generates (StatusCode status, IWifiNanIface iface); + createNanIface() generates (WifiStatus status, IWifiNanIface iface); /** * List all the NAN iface names configured on the chip. * The corresponding |IWifiNanIface| object for any iface are * retrieved using |getNanIface| method. * - * @return status Status of the operation. + * @return status WifiStatus of the operation. * Possible status codes: - * |StatusCode.SUCCESS|, - * |StatusCode.ERROR_WIFI_CHIP_INVALID| + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID| * @return ifnames List of all NAN iface names on the chip. */ - getNanIfaceNames() generates (StatusCode status, vec ifnames); + getNanIfaceNames() generates (WifiStatus status, vec ifnames); /** * Gets a HIDL interface object for the NAN Iface corresponding * to the provided ifname. * * @param ifname Name of the iface. - * @return status Status of the operation. + * @return status WifiStatus of the operation. * Possible status codes: - * |StatusCode.SUCCESS|, - * |StatusCode.ERROR_WIFI_CHIP_INVALID| + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID| * @return iface HIDL interface object representing the iface if * it exists, null otherwise. */ - getNanIface(string ifname) generates (StatusCode status, IWifiNanIface iface); + getNanIface(string ifname) generates (WifiStatus status, IWifiNanIface iface); /** * Create a P2P iface on the chip. * * Depending on the mode the chip is configured in, the interface creation - * may fail if we've already reached the maximum allowed - * (specified in |ChipIfaceCombination|) number of ifaces of the P2P type. + * may fail (code: |ERROR_NOT_SUPPORTED|) if we've already reached the maximum + * allowed (specified in |ChipIfaceCombination|) number of ifaces of the P2P + * type. * - * @return status Status of the operation. + * @return status WifiStatus of the operation. * Possible status codes: - * |StatusCode.SUCCESS|, - * |StatusCode.ERROR_WIFI_CHIP_INVALID| + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|, + * |WifiStatusCode.ERROR_NOT_SUPPORTED| * @return iface HIDL interface object representing the iface if * successful, null otherwise. */ - createP2pIface() generates (StatusCode status, IWifiP2pIface iface); + createP2pIface() generates (WifiStatus status, IWifiP2pIface iface); /** * List all the P2P iface names configured on the chip. * The corresponding |IWifiP2pIface| object for any iface are * retrieved using |getP2pIface| method. * - * @return status Status of the operation. + * @return status WifiStatus of the operation. * Possible status codes: - * |StatusCode.SUCCESS|, - * |StatusCode.ERROR_WIFI_CHIP_INVALID| + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID| * @return ifnames List of all P2P iface names on the chip. */ - getP2pIfaceNames() generates (StatusCode status, vec ifnames); + getP2pIfaceNames() generates (WifiStatus status, vec ifnames); /** * Gets a HIDL interface object for the P2P Iface corresponding * to the provided ifname. * * @param ifname Name of the iface. - * @return status Status of the operation. + * @return status WifiStatus of the operation. * Possible status codes: - * |StatusCode.SUCCESS|, - * |StatusCode.ERROR_WIFI_CHIP_INVALID| + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID| * @return iface HIDL interface object representing the iface if * it exists, null otherwise. */ - getP2pIface(string ifname) generates (StatusCode status, IWifiP2pIface iface); + getP2pIface(string ifname) generates (WifiStatus status, IWifiP2pIface iface); /** * Create an STA iface on the chip. * * Depending on the mode the chip is configured in, the interface creation - * may fail if we've already reached the maximum allowed - * (specified in |ChipIfaceCombination|) number of ifaces of the STA type. + * may fail (code: |ERROR_NOT_SUPPORTED|) if we've already reached the maximum + * allowed (specified in |ChipIfaceCombination|) number of ifaces of the STA + * type. * - * @return status Status of the operation. + * @return status WifiStatus of the operation. * Possible status codes: - * |StatusCode.SUCCESS|, - * |StatusCode.ERROR_WIFI_CHIP_INVALID| + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|, + * |WifiStatusCode.ERROR_NOT_SUPPORTED| * @return iface HIDL interface object representing the iface if * successful, null otherwise. */ - createStaIface() generates (StatusCode status, IWifiStaIface iface); + createStaIface() generates (WifiStatus status, IWifiStaIface iface); /** * List all the STA iface names configured on the chip. * The corresponding |IWifiStaIface| object for any iface are * retrieved using |getStaIface| method. * - * @return status Status of the operation. + * @return status WifiStatus of the operation. * Possible status codes: - * |StatusCode.SUCCESS|, - * |StatusCode.ERROR_WIFI_CHIP_INVALID| + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID| * @return ifnames List of all STA iface names on the chip. */ - getStaIfaceNames() generates (StatusCode status, vec ifnames); + getStaIfaceNames() generates (WifiStatus status, vec ifnames); /** * Gets a HIDL interface object for the STA Iface corresponding * to the provided ifname. * * @param ifname Name of the iface. - * @return status Status of the operation. + * @return status WifiStatus of the operation. * Possible status codes: - * |StatusCode.SUCCESS|, - * |StatusCode.ERROR_WIFI_CHIP_INVALID| + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID| * @return iface HIDL interface object representing the iface if * it exists, null otherwise. */ - getStaIface(string ifname) generates (StatusCode status, IWifiStaIface iface); + getStaIface(string ifname) generates (WifiStatus status, IWifiStaIface iface); /** * Create a RTTController instance. @@ -399,11 +427,11 @@ interface IWifiChip { * * @param boundIface HIDL interface object representing the iface if * the responder must be bound to a specific iface, null otherwise. - * @return status Status of the operation. + * @return status WifiStatus of the operation. * Possible status codes: - * |StatusCode.SUCCESS|, - * |StatusCode.ERROR_WIFI_CHIP_INVALID| + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID| */ createRttController(IWifiIface boundIface) - generates (StatusCode status, IWifiRttController rtt); + generates (WifiStatus status, IWifiRttController rtt); }; diff --git a/wifi/1.0/IWifiChipEventCallback.hal b/wifi/1.0/IWifiChipEventCallback.hal index 2161c5d4a7..177d42e976 100644 --- a/wifi/1.0/IWifiChipEventCallback.hal +++ b/wifi/1.0/IWifiChipEventCallback.hal @@ -27,70 +27,4 @@ interface IWifiChipEventCallback { * property of the target ChipMode. */ oneway onChipReconfigured(ChipModeId modeId); - - /** - * If this happens then the chips is now in an undefined state and - * configureChip must be called again. Any interface indexes will be - * assumed to be invalid. - * - * @param modeId The mode that the chip failed switched to, corresponding to - * the id property of the target ChipMode. - * @param reason Failure reason code. - */ - oneway onChipReconfigureFailure(ChipModeId modeId, FailureReason reason); - - /** - * Information about the version of the driver and firmware running this chip. - * - * This information is vendor specific and does not need to take any - * particular format. It will be dumped as part of the bug report. - */ - struct ChipDebugInfo { - string driverDescription; - string firmwareDescription; - }; - - /** - * Callback with debug information about this chip - * - * @param info Instance of |ChipDebugInfo|. - */ - oneway onChipDebugInfoAvailable(ChipDebugInfo info); - - /** - * Callback to be invoked on failure to fetch debug info about this chip. - * - * @param reason Failure reason code. - */ - oneway onChipDebugInfoFailure(FailureReason reason); - - /** - * Callback with a vendor specific debug blob from the driver. - * This blob will be dumped as part of the bug report. - * - * @param blob Vector of bytes retrieved from the driver. - */ - oneway onDriverDebugDumpAvailable(vec blob); - - /** - * Callback to be invoked on failure to fetch debug blob from driver. - * - * @param reason Failure reason code. - */ - oneway onDriverDebugDumpFailure(FailureReason reason); - - /** - * Callback with a vendor specific debug blob from the driver. - * This blob will be dumped as part of the bug report. - * - * @param blob Vector of bytes retrieved from the driver. - */ - oneway onFirmwareDebugDumpAvailable(vec blob); - - /** - * Callback to be invoked on failure to fetch debug blob from driver. - * - * @param reason Failure reason code. - */ - oneway onFirmwareDebugDumpFailure(FailureReason reason); }; diff --git a/wifi/1.0/IWifiEventCallback.hal b/wifi/1.0/IWifiEventCallback.hal index 33accff8ea..718f36c20f 100644 --- a/wifi/1.0/IWifiEventCallback.hal +++ b/wifi/1.0/IWifiEventCallback.hal @@ -23,16 +23,6 @@ interface IWifiEventCallback { */ oneway onStart(); - /** - * Called in response to a call to start indicating that the operation - * failed. After this callback the HAL will be considered stopped. Another - * call to start will attempt to reinitialize the HAL; however, there is a - * chance it may fail again. - * - * @param reason Failure reason code. - */ - oneway onStartFailure(FailureReason reason); - /** * Called in response to a call to stop indicating that the operation * completed. When this event is received all IWifiChip objects retrieved @@ -43,10 +33,10 @@ interface IWifiEventCallback { /** * Called when the Wi-Fi system failed in a way that caused it be disabled. * Calling start again must restart Wi-Fi as if stop then start was called - * (full state reset). When this event is received all IWifiChip objects - * retrieved after the last call to start will be considered invalid. + * (full state reset). When this event is received all IWifiChip & IWifiIface + * objects retrieved after the last call to start will be considered invalid. * - * @param reason Failure reason code. + * @param status Failure reason code. */ - oneway onFailure(FailureReason reason); + oneway onFailure(WifiStatus status); }; diff --git a/wifi/1.0/IWifiIface.hal b/wifi/1.0/IWifiIface.hal index 726a973f19..444e095374 100644 --- a/wifi/1.0/IWifiIface.hal +++ b/wifi/1.0/IWifiIface.hal @@ -23,22 +23,22 @@ interface IWifiIface { /** * Get the type of this iface. * - * @return status Status of the operation. + * @return status WifiStatus of the operation. * Possible status codes: - * |StatusCode.SUCCESS|, - * |StatusCode.ERROR_WIFI_IFACE_INVALID| + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID| * @return type One of the supported iface types. */ - getType() generates (StatusCode status, IfaceType type); + getType() generates (WifiStatus status, IfaceType type); /** * Get the name of this iface. * - * @return status Status of the operation. + * @return status WifiStatus of the operation. * Possible status codes: - * |StatusCode.SUCCESS|, - * |StatusCode.ERROR_WIFI_IFACE_INVALID| + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID| * @return name Name of the iface. */ - getName() generates (StatusCode status, string name); + getName() generates (WifiStatus status, string name); }; diff --git a/wifi/1.0/IWifiRttController.hal b/wifi/1.0/IWifiRttController.hal index cc827bbde3..a0e8b12219 100644 --- a/wifi/1.0/IWifiRttController.hal +++ b/wifi/1.0/IWifiRttController.hal @@ -25,12 +25,12 @@ interface IWifiRttController { /** * Get the iface on which the RTT operations will be performed. * - * @return status Status of the operation. + * @return status WifiStatus of the operation. * Possible status codes: - * |StatusCode.SUCCESS|, - * |StatusCode.ERROR_WIFI_RTT_CONTROLLER_INVALID| + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_RTT_CONTROLLER_INVALID| * @return boundIface HIDL interface object representing the iface if bound * to a specific iface, null otherwise */ - getBoundIface() generates (StatusCode status, IWifiIface boundIface); + getBoundIface() generates (WifiStatus status, IWifiIface boundIface); }; diff --git a/wifi/1.0/IWifiStaIface.hal b/wifi/1.0/IWifiStaIface.hal index 402385bb66..ea535f2151 100644 --- a/wifi/1.0/IWifiStaIface.hal +++ b/wifi/1.0/IWifiStaIface.hal @@ -213,37 +213,42 @@ interface IWifiStaIface extends IWifiIface { * * @param callback An instance of the |IWifiStaIfaceEventCallback| HIDL interface * object. - * @return status Status of the operation. + * @return status WifiStatus of the operation. * Possible status codes: - * |StatusCode.SUCCESS|, - * |StatusCode.ERROR_WIFI_IFACE_INVALID| + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID| */ registerEventCallback(IWifiStaIfaceEventCallback callback) - generates (StatusCode status); + generates (WifiStatus status); /** * Get the capabilities supported by this STA iface. * - * @return status Status of the operation. + * @return status WifiStatus of the operation. * Possible status codes: - * |StatusCode.SUCCESS|, - * |StatusCode.ERROR_WIFI_IFACE_INVALID| + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, + * |WifiStatusCode.ERROR_NOT_AVAILABLE|, + * |WifiStatusCode.ERROR_UNKNOWN| * @return capabilities Bitset of |StaIfaceCapabilityMask| values. */ - getCapabilities() generates (StatusCode status, uint64_t capabilities); + getCapabilities() generates (WifiStatus status, uint64_t capabilities); /** * Used to query additional information about the chip's APF capabilities. * Will fail if |StaIfaceCapabilityMask.APF| is not set. * - * @return status Status of the operation. + * @return status WifiStatus of the operation. * Possible status codes: - * |StatusCode.SUCCESS|, - * |StatusCode.ERROR_WIFI_IFACE_INVALID| + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, + * |WifiStatusCode.ERROR_NOT_SUPPORTED|, + * |WifiStatusCode.ERROR_NOT_AVAILABLE|, + * |WifiStatusCode.ERROR_UNKNOWN| * @return capabilities Instance of |ApfPacketFilterCapabilities|. */ getApfPacketFilterCapabilities() - generates (StatusCode status, ApfPacketFilterCapabilities capabilities); + generates (WifiStatus status, ApfPacketFilterCapabilities capabilities); /** * Installs an APF program on this iface, replacing an existing @@ -252,26 +257,33 @@ interface IWifiStaIface extends IWifiIface { * * @param cmdId command Id to use for this invocation. * @param APF Program to be set. - * @return status Status of the operation. + * @return status WifiStatus of the operation. * Possible status codes: - * |StatusCode.SUCCESS|, - * |StatusCode.ERROR_WIFI_IFACE_INVALID| + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, + * |WifiStatusCode.ERROR_INVALID_ARGS|, + * |WifiStatusCode.ERROR_NOT_SUPPORTED|, + * |WifiStatusCode.ERROR_NOT_AVAILABLE|, + * |WifiStatusCode.ERROR_UNKNOWN| */ installApfPacketFilter(CommandId cmdId, vec program) - generates (StatusCode status); + generates (WifiStatus status); /** * Used to query additional information about the chip's APF capabilities. * Will fail if |StaIfaceCapabilityMask.BACKGROUND_SCAN| is not set. * - * @return status Status of the operation. + * @return status WifiStatus of the operation. * Possible status codes: - * |StatusCode.SUCCESS|, - * |StatusCode.ERROR_WIFI_IFACE_INVALID| + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, + * |WifiStatusCode.ERROR_NOT_SUPPORTED|, + * |WifiStatusCode.ERROR_NOT_AVAILABLE|, + * |WifiStatusCode.ERROR_UNKNOWN| * @return capabilities Instance of |BackgroundScanCapabilities|. */ getBackgroundScanCapabilities() - generates (StatusCode status, BackgroundScanCapabilities capabilities); + generates (WifiStatus status, BackgroundScanCapabilities capabilities); /** * Start a background scan using the given cmdId as an identifier. Only one @@ -301,22 +313,28 @@ interface IWifiStaIface extends IWifiIface { * * @param cmdId command Id to use for this invocation. * @params Background scan parameters. - * @return status Status of the operation. + * @return status WifiStatus of the operation. * Possible status codes: - * |StatusCode.SUCCESS|, - * |StatusCode.ERROR_WIFI_IFACE_INVALID| + * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, + * |WifiStatusCode.ERROR_INVALID_ARGS|, + * |WifiStatusCode.ERROR_NOT_SUPPORTED|, + * |WifiStatusCode.ERROR_NOT_AVAILABLE|, + * |WifiStatusCode.ERROR_UNKNOWN| */ startBackgroundScan(CommandId cmdId, BackgroundScanParameters params) - generates (StatusCode status); + generates (WifiStatus status); /** * Stop the background scan started. * * @param cmdId command Id corresponding to the request. - * @return status Status of the operation. + * @return status WifiStatus of the operation. * Possible status codes: - * |StatusCode.SUCCESS|, - * |StatusCode.ERROR_WIFI_IFACE_INVALID| + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, + * |WifiStatusCode.ERROR_NOT_SUPPORTED|, + * |WifiStatusCode.ERROR_NOT_AVAILABLE|, + * |WifiStatusCode.ERROR_UNKNOWN| */ - stopBackgroundScan(CommandId cmdId) generates (StatusCode status); + stopBackgroundScan(CommandId cmdId) generates (WifiStatus status); }; diff --git a/wifi/1.0/IWifiStaIfaceEventCallback.hal b/wifi/1.0/IWifiStaIfaceEventCallback.hal index 1ee2d4e1d2..7466fc33a6 100644 --- a/wifi/1.0/IWifiStaIfaceEventCallback.hal +++ b/wifi/1.0/IWifiStaIfaceEventCallback.hal @@ -17,32 +17,6 @@ package android.hardware.wifi@1.0; interface IWifiStaIfaceEventCallback { - /** - * Callback indicating that the requested packet filter was successfully - * installed. - */ - oneway onInstallPacketFilterSuccess(); - - /** - * Callback indicating that installing a packet filter failed. - */ - oneway onInstallPacketFilterFailure(FailureReason reason); - - /** - * Callback indicating that a requested background scan was started. - */ - oneway onBackgroundScanStarted(); - - /** - * Callback indicating that a requested background scan failed to start. - */ - oneway onBackgroundScanStartFailure(FailureReason reason); - - /** - * Callback indicating that a scan was stopped - */ - oneway onBackgroundScanStopped(); - /** * Information elements contained within the |ScanResult| structure. * These elements correspond to the IEEE_802.11 standard. @@ -103,6 +77,12 @@ interface IWifiStaIfaceEventCallback { vec results; }; + /** + * Callback indicating that an ongoing background scan request has failed. + * The background scan needs to be restarted to continue scanning. + */ + oneway onBackgroundScanFailure(CommandId cmdId); + /** * Called for each received beacon/probe response for a scan with the * |REPORT_EVENTS_FULL_RESULTS| flag set in diff --git a/wifi/1.0/types.hal b/wifi/1.0/types.hal index 25d4fa1d25..f80b9a03ff 100644 --- a/wifi/1.0/types.hal +++ b/wifi/1.0/types.hal @@ -17,41 +17,28 @@ package android.hardware.wifi@1.0; /** - * Enum values indicating whether the command processing was successfully - * initiated or not. + * Enum values indicating the status of operation. */ -enum StatusCode : uint32_t { - /** No errors. Command processing successfully initiated. */ +enum WifiStatusCode : uint32_t { + /** No errors. */ SUCCESS, /** Method invoked on an invalid |IWifiChip| object. */ ERROR_WIFI_CHIP_INVALID, /** Method invoked on an invalid |IWifiIface| object. */ ERROR_WIFI_IFACE_INVALID, /** Method invoked on an invalid |IWifiRttController| object. */ - ERROR_WIFI_RTT_CONTROLLER_INVALID + ERROR_WIFI_RTT_CONTROLLER_INVALID, + ERROR_NOT_SUPPORTED, + ERROR_NOT_AVAILABLE, + ERROR_INVALID_ARGS, + ERROR_UNKNOWN }; /** - * List of failure reasons returned in |FailureReason|. + * Generic structure to return the status of an operation. */ -enum FailureReasonCode : uint32_t { - UNKNOWN, - DUPLICATE_COMMAND_ID, - NOT_SUPPORTED, - NOT_AVAILABLE, - INVALID_ARGS, - DRIVER_ERROR_OTHER, - FIRMWARE_ERROR_OTHER, - SCAN_INVALID_CHANNEL -}; - -/** - * Generic structure to return information about a failure. - * The failure reason will be returned in the corresponding |onFailure| - * callback. - */ -struct FailureReason { - FailureReasonCode reason; +struct WifiStatus { + WifiStatusCode code; /** * A vendor specific error message from the vendor to provide more * information beyond the reason code. From 18680b7affe027388c0d299d9222c37c2833dda2 Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Wed, 12 Oct 2016 08:25:48 -0700 Subject: [PATCH 04/24] wifi(interface): Link layer stats collection Add HIDL methods for STA iface link layer stats. While there, Add the missing gscan API for fetching a list of channels for a given band. Bug:31991459 Test: Compiles Change-Id: I5d448eb823faae4e8f5c25f746cf59e70df454cf --- wifi/1.0/IWifiChip.hal | 2 +- wifi/1.0/IWifiStaIface.hal | 176 ++++++++++++++++++++++++++++++++++++- 2 files changed, 173 insertions(+), 5 deletions(-) diff --git a/wifi/1.0/IWifiChip.hal b/wifi/1.0/IWifiChip.hal index 166cfb409a..2a9ed49bb4 100644 --- a/wifi/1.0/IWifiChip.hal +++ b/wifi/1.0/IWifiChip.hal @@ -174,7 +174,7 @@ interface IWifiChip { * Must trigger |IWifiChipEventCallback.onChipReconfigured| on success. * Must trigger |IWifiEventCallback.onFailure| on failure. * - * @param modeId The mode that the chip should switch to, corresponding to the + * @param modeId The mode that the chip must switch to, corresponding to the * id property of the target ChipMode. * @return status WifiStatus of the operation. * Possible status codes: diff --git a/wifi/1.0/IWifiStaIface.hal b/wifi/1.0/IWifiStaIface.hal index ea535f2151..52f0d4aae9 100644 --- a/wifi/1.0/IWifiStaIface.hal +++ b/wifi/1.0/IWifiStaIface.hal @@ -40,6 +40,10 @@ interface IWifiStaIface extends IWifiIface { * parameters about how and when to report results. */ BACKGROUND_SCAN = 1 << 1, + /** + * If set indicates that the link layer stats APIs are supported. + */ + LINK_LAYER_STATS = 1 << 2 }; /** @@ -206,6 +210,98 @@ interface IWifiStaIface extends IWifiIface { vec buckets; }; + /** + * Packet stats for different traffic categories. + */ + struct LinkLayerIfacePacketStats { + /** + * Number of received unicast data packets. + */ + uint64_t rxMpdu; + /** + * Number of successfully transmitted unicast data pkts (ACK rcvd). + */ + uint64_t txMpdu; + /** + * Number of transmitted unicast data pkt losses (no ACK). + */ + uint64_t lostMpdu; + /** + * Number of transmitted unicast data retry pkts. + */ + uint64_t retries; + }; + + /** + * Iface statistics for the current connection. + */ + struct LinkLayerIfaceStats { + /** + * Number beacons received from the connected AP. + */ + uint32_t beaconRx; + /** + * Access Point Beacon and Management frames RSSI (averaged). + */ + int32_t avgRssiMgmt; + /** + * WME Best Effort Access Category packet counters. + */ + LinkLayerIfacePacketStats wmeBePktStats; + /** + * WME Background Access Category packet counters. + */ + LinkLayerIfacePacketStats wmeBkPktStats; + /** + * WME Video Access Category packet counters. + */ + LinkLayerIfacePacketStats wmeViPktStats; + /** + * WME Voice Access Category packet counters. + */ + LinkLayerIfacePacketStats wmeVoPktStats; + }; + + /** + * Cumulative radio statistics since collection was enabled. + */ + struct LinkLayerRadioStats { + /** + * Time for which the radio is awake. + */ + uint32_t onTimeInMs; + /** + * Total time for which the radio is in active transmission. + */ + uint32_t txTimeInMs; + /** + * Time for which the radio is in active tranmission per tx level. + */ + vec txTimeInMsPerLevel; + /** + * Time for which the radio is in active receive. + */ + uint32_t rxTimeInMs; + /** + * Total time for which the radio is awake due to scan. + */ + uint32_t onTimeInMsForScan; + }; + + /** + * Link layer stats retrieved via |getLinkLayerStats|. + */ + struct LinkLayerStats { + LinkLayerIfaceStats iface; + LinkLayerRadioStats radio; + /** + * Timestamp for each stats sample. + * This is the absolute milliseconds from boot when these stats were + * sampled. + */ + uint32_t timeStampInMs; + }; + /** * Requests notifications of significant events on this iface. Multiple calls * to this must register multiple callbacks each of which must receive all @@ -236,7 +332,7 @@ interface IWifiStaIface extends IWifiIface { /** * Used to query additional information about the chip's APF capabilities. - * Will fail if |StaIfaceCapabilityMask.APF| is not set. + * Must fail if |StaIfaceCapabilityMask.APF| is not set. * * @return status WifiStatus of the operation. * Possible status codes: @@ -253,7 +349,7 @@ interface IWifiStaIface extends IWifiIface { /** * Installs an APF program on this iface, replacing an existing * program if present. - * Will fail if |StaIfaceCapabilityMask.APF| is not set. + * Must fail if |StaIfaceCapabilityMask.APF| is not set. * * @param cmdId command Id to use for this invocation. * @param APF Program to be set. @@ -270,8 +366,8 @@ interface IWifiStaIface extends IWifiIface { generates (WifiStatus status); /** - * Used to query additional information about the chip's APF capabilities. - * Will fail if |StaIfaceCapabilityMask.BACKGROUND_SCAN| is not set. + * Used to query additional information about the chip's Background Scan capabilities. + * Must fail if |StaIfaceCapabilityMask.BACKGROUND_SCAN| is not set. * * @return status WifiStatus of the operation. * Possible status codes: @@ -285,9 +381,29 @@ interface IWifiStaIface extends IWifiIface { getBackgroundScanCapabilities() generates (WifiStatus status, BackgroundScanCapabilities capabilities); + /** + * Used to query the list of valid frequencies (depending on country code set) + * for the provided band. These channels may be specifed in the + * |BackgroundScanBucketParameters.frequenciesInMhz| for a background scan + * request. + * Must fail if |StaIfaceCapabilityMask.BACKGROUND_SCAN| is not set. + * + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, + * |WifiStatusCode.ERROR_NOT_SUPPORTED|, + * |WifiStatusCode.ERROR_NOT_AVAILABLE|, + * |WifiStatusCode.ERROR_UNKNOWN| + * @return frequenciesInMhz vector of valid frequencies for the provided band. + */ + getValidFrequenciesForBackgroundScan(BackgroundScanBand band) + generates (WifiStatus status, vec frequenciesInMhz); + /** * Start a background scan using the given cmdId as an identifier. Only one * active background scan need be supported. + * Must fail if |StaIfaceCapabilityMask.BACKGROUND_SCAN| is not set. * * When this is called all requested buckets must be scanned, starting the * beginning of the cycle. @@ -326,6 +442,7 @@ interface IWifiStaIface extends IWifiIface { /** * Stop the background scan started. + * Must fail if |StaIfaceCapabilityMask.BACKGROUND_SCAN| is not set. * * @param cmdId command Id corresponding to the request. * @return status WifiStatus of the operation. @@ -337,4 +454,55 @@ interface IWifiStaIface extends IWifiIface { * |WifiStatusCode.ERROR_UNKNOWN| */ stopBackgroundScan(CommandId cmdId) generates (WifiStatus status); + + /** + * Enable link layer stats collection. + * Must fail if |StaIfaceCapabilityMask.LINK_LAYER_STATS| is not set. + * + * Radio statistics (once started) must not stop until disabled. + * Iface statistics (once started) reset and start afresh after each + * connection until disabled. + * + * @param debug Set for field debug mode. Driver must collect all + * statistics regardless of performance impact. + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, + * |WifiStatusCode.ERROR_NOT_SUPPORTED|, + * |WifiStatusCode.ERROR_NOT_AVAILABLE|, + * |WifiStatusCode.ERROR_UNKNOWN| + */ + enableLinkLayerStatsCollection(bool debug) + generates (WifiStatus status); + + /** + * Disable link layer stats collection. + * Must fail if |StaIfaceCapabilityMask.LINK_LAYER_STATS| is not set. + * + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, + * |WifiStatusCode.ERROR_NOT_SUPPORTED|, + * |WifiStatusCode.ERROR_NOT_AVAILABLE|, + * |WifiStatusCode.ERROR_UNKNOWN| + */ + disableLinkLayerStatsCollection() generates (WifiStatus status); + + /** + * Retrieve the latest link layer stats. + * Must fail if |StaIfaceCapabilityMask.LINK_LAYER_STATS| is not set or if + * link layer stats collection hasn't been explicitly enabled. + * + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, + * |WifiStatusCode.ERROR_NOT_SUPPORTED|, + * |WifiStatusCode.ERROR_NOT_AVAILABLE|, + * |WifiStatusCode.ERROR_UNKNOWN| + * @return stats Instance of |LinkLayerStats|. + */ + getLinkLayerStats() generates (WifiStatus status, LinkLayerStats stats); }; From 120f94c594cb524d4f84673630d779fc0d6aff16 Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Thu, 13 Oct 2016 11:48:42 -0700 Subject: [PATCH 05/24] wifi(interface): NAN HIDL interface Interface is mostly a replication of the wifi_nan.h HAL header file. 1. All the methods are in |IWifiNanIface|. 2. Moved all the callbacks to |IWifiNanIfaceEventCallback.hal|. 2. Moved all the data types to |types.hal|. 3. Changed all the variable size arrays to vecs. Bug: 31991076 Test: ./hardware/interfaces/update-makefiles.sh Change-Id: I2af0b0003cf30a0f2bfdcb56b69c492cf831745b --- wifi/1.0/Android.bp | 8 + wifi/1.0/Android.mk | 2256 +++++++++++++++++++++++ wifi/1.0/IWifiNanIface.hal | 253 ++- wifi/1.0/IWifiNanIfaceEventCallback.hal | 54 + wifi/1.0/IWifiStaIface.hal | 6 +- wifi/1.0/IWifiStaIfaceEventCallback.hal | 7 +- wifi/1.0/types.hal | 1381 ++++++++++++++ 7 files changed, 3954 insertions(+), 11 deletions(-) create mode 100644 wifi/1.0/IWifiNanIfaceEventCallback.hal diff --git a/wifi/1.0/Android.bp b/wifi/1.0/Android.bp index a3daa89ffa..40521f20c0 100644 --- a/wifi/1.0/Android.bp +++ b/wifi/1.0/Android.bp @@ -13,6 +13,7 @@ genrule { "IWifiEventCallback.hal", "IWifiIface.hal", "IWifiNanIface.hal", + "IWifiNanIfaceEventCallback.hal", "IWifiP2pIface.hal", "IWifiRttController.hal", "IWifiStaIface.hal", @@ -27,6 +28,7 @@ genrule { "android/hardware/wifi/1.0/WifiEventCallbackAll.cpp", "android/hardware/wifi/1.0/WifiIfaceAll.cpp", "android/hardware/wifi/1.0/WifiNanIfaceAll.cpp", + "android/hardware/wifi/1.0/WifiNanIfaceEventCallbackAll.cpp", "android/hardware/wifi/1.0/WifiP2pIfaceAll.cpp", "android/hardware/wifi/1.0/WifiRttControllerAll.cpp", "android/hardware/wifi/1.0/WifiStaIfaceAll.cpp", @@ -47,6 +49,7 @@ genrule { "IWifiEventCallback.hal", "IWifiIface.hal", "IWifiNanIface.hal", + "IWifiNanIfaceEventCallback.hal", "IWifiP2pIface.hal", "IWifiRttController.hal", "IWifiStaIface.hal", @@ -89,6 +92,11 @@ genrule { "android/hardware/wifi/1.0/BnWifiNanIface.h", "android/hardware/wifi/1.0/BpWifiNanIface.h", "android/hardware/wifi/1.0/BsWifiNanIface.h", + "android/hardware/wifi/1.0/IWifiNanIfaceEventCallback.h", + "android/hardware/wifi/1.0/IHwWifiNanIfaceEventCallback.h", + "android/hardware/wifi/1.0/BnWifiNanIfaceEventCallback.h", + "android/hardware/wifi/1.0/BpWifiNanIfaceEventCallback.h", + "android/hardware/wifi/1.0/BsWifiNanIfaceEventCallback.h", "android/hardware/wifi/1.0/IWifiP2pIface.h", "android/hardware/wifi/1.0/IHwWifiP2pIface.h", "android/hardware/wifi/1.0/BnWifiP2pIface.h", diff --git a/wifi/1.0/Android.mk b/wifi/1.0/Android.mk index c7983ea7f6..3ae6affa70 100644 --- a/wifi/1.0/Android.mk +++ b/wifi/1.0/Android.mk @@ -29,6 +29,1111 @@ $(GEN): $(LOCAL_PATH)/types.hal $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) +# +# Build types.hal (NanAvailDuration) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanAvailDuration.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanAvailDuration + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanBeaconSdfPayloadInd) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanBeaconSdfPayloadInd.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanBeaconSdfPayloadInd + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanBeaconSdfPayloadReceive) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanBeaconSdfPayloadReceive.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanBeaconSdfPayloadReceive + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanBeaconSdfPayloadRequest) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanBeaconSdfPayloadRequest.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanBeaconSdfPayloadRequest + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanCapabilities) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanCapabilities.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanCapabilities + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanChannelIndex) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanChannelIndex.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanChannelIndex + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanClusterEvent) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanClusterEvent.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanClusterEvent + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanConfigRequest) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanConfigRequest.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanConfigRequest + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanConnectionType) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanConnectionType.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanConnectionType + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanDataPathAppInfo) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanDataPathAppInfo.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanDataPathAppInfo + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanDataPathCfg) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanDataPathCfg.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanDataPathCfg + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanDataPathChannelCfg) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanDataPathChannelCfg.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanDataPathChannelCfg + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanDataPathConfirmInd) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanDataPathConfirmInd.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanDataPathConfirmInd + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanDataPathEndInd) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanDataPathEndInd.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanDataPathEndInd + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanDataPathEndRequest) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanDataPathEndRequest.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanDataPathEndRequest + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanDataPathIndicationResponse) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanDataPathIndicationResponse.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanDataPathIndicationResponse + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanDataPathInitiatorRequest) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanDataPathInitiatorRequest.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanDataPathInitiatorRequest + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanDataPathQosCfg) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanDataPathQosCfg.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanDataPathQosCfg + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanDataPathRequestInd) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanDataPathRequestInd.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanDataPathRequestInd + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanDataPathRequestResponse) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanDataPathRequestResponse.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanDataPathRequestResponse + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanDataPathResponseCode) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanDataPathResponseCode.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanDataPathResponseCode + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanDataPathSecurityCfgStatus) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanDataPathSecurityCfgStatus.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanDataPathSecurityCfgStatus + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanDeviceRole) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanDeviceRole.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanDeviceRole + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanDisabledInd) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanDisabledInd.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanDisabledInd + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanDiscEngEventInd) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanDiscEngEventInd.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanDiscEngEventInd + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanDiscEngEventType) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanDiscEngEventType.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanDiscEngEventType + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanEnableRequest) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanEnableRequest.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanEnableRequest + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanFollowupInd) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanFollowupInd.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanFollowupInd + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanFurtherAvailabilityChannel) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanFurtherAvailabilityChannel.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanFurtherAvailabilityChannel + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanFurtherAvailabilityMap) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanFurtherAvailabilityMap.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanFurtherAvailabilityMap + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanMacAddressEvent) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanMacAddressEvent.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanMacAddressEvent + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanMatchAlg) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanMatchAlg.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanMatchAlg + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanMatchExpiredInd) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanMatchExpiredInd.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanMatchExpiredInd + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanMatchInd) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanMatchInd.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanMatchInd + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanPublishCancelRequest) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanPublishCancelRequest.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanPublishCancelRequest + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanPublishRequest) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanPublishRequest.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanPublishRequest + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanPublishResponse) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanPublishResponse.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanPublishResponse + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanPublishTerminatedInd) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanPublishTerminatedInd.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanPublishTerminatedInd + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanPublishType) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanPublishType.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanPublishType + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanReceivePostConnectivityCapability) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanReceivePostConnectivityCapability.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanReceivePostConnectivityCapability + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanReceivePostDiscovery) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanReceivePostDiscovery.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanReceivePostDiscovery + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanReceiveVendorSpecificAttribute) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanReceiveVendorSpecificAttribute.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanReceiveVendorSpecificAttribute + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanResponseMsg) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanResponseMsg.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanResponseMsg + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanResponseType) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanResponseType.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanResponseType + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanSizes) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanSizes.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanSizes + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanSocialChannelScanParams) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanSocialChannelScanParams.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanSocialChannelScanParams + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanSrfIncludeType) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanSrfIncludeType.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanSrfIncludeType + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanSrfState) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanSrfState.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanSrfState + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanSrfType) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanSrfType.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanSrfType + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanSsiInMatchInd) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanSsiInMatchInd.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanSsiInMatchInd + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanStatusType) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanStatusType.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanStatusType + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanSubscribeCancelRequest) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanSubscribeCancelRequest.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanSubscribeCancelRequest + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanSubscribeRequest) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanSubscribeRequest.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanSubscribeRequest + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanSubscribeResponse) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanSubscribeResponse.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanSubscribeResponse + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanSubscribeTerminatedInd) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanSubscribeTerminatedInd.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanSubscribeTerminatedInd + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanSubscribeType) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanSubscribeType.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanSubscribeType + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanTransmitFollowupInd) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanTransmitFollowupInd.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanTransmitFollowupInd + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanTransmitFollowupRequest) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanTransmitFollowupRequest.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanTransmitFollowupRequest + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanTransmitPostConnectivityCapability) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanTransmitPostConnectivityCapability.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanTransmitPostConnectivityCapability + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanTransmitPostDiscovery) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanTransmitPostDiscovery.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanTransmitPostDiscovery + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanTransmitVendorSpecificAttribute) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanTransmitVendorSpecificAttribute.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanTransmitVendorSpecificAttribute + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanTransmitWindowType) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanTransmitWindowType.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanTransmitWindowType + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanTxPriority) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanTxPriority.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanTxPriority + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanTxType) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanTxType.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanTxType + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanVsaRxFrameMask) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanVsaRxFrameMask.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanVsaRxFrameMask + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + # # Build types.hal (WifiStatus) # @@ -204,6 +1309,10 @@ $(GEN): PRIVATE_HIDL := $(HIDL) $(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IWifiNanIface.hal $(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IWifiIface.hal $(GEN): $(LOCAL_PATH)/IWifiIface.hal +$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IWifiNanIfaceEventCallback.hal +$(GEN): $(LOCAL_PATH)/IWifiNanIfaceEventCallback.hal +$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal +$(GEN): $(LOCAL_PATH)/types.hal $(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) $(GEN): PRIVATE_CUSTOM_TOOL = \ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ @@ -214,6 +1323,25 @@ $(GEN): $(LOCAL_PATH)/IWifiNanIface.hal $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) +# +# Build IWifiNanIfaceEventCallback.hal +# +GEN := $(intermediates)/android/hardware/wifi/1.0/IWifiNanIfaceEventCallback.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IWifiNanIfaceEventCallback.hal +$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal +$(GEN): $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::IWifiNanIfaceEventCallback + +$(GEN): $(LOCAL_PATH)/IWifiNanIfaceEventCallback.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + # # Build IWifiP2pIface.hal # @@ -325,6 +1453,1111 @@ $(GEN): $(LOCAL_PATH)/types.hal $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) +# +# Build types.hal (NanAvailDuration) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanAvailDuration.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanAvailDuration + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanBeaconSdfPayloadInd) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanBeaconSdfPayloadInd.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanBeaconSdfPayloadInd + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanBeaconSdfPayloadReceive) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanBeaconSdfPayloadReceive.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanBeaconSdfPayloadReceive + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanBeaconSdfPayloadRequest) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanBeaconSdfPayloadRequest.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanBeaconSdfPayloadRequest + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanCapabilities) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanCapabilities.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanCapabilities + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanChannelIndex) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanChannelIndex.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanChannelIndex + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanClusterEvent) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanClusterEvent.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanClusterEvent + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanConfigRequest) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanConfigRequest.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanConfigRequest + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanConnectionType) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanConnectionType.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanConnectionType + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanDataPathAppInfo) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanDataPathAppInfo.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanDataPathAppInfo + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanDataPathCfg) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanDataPathCfg.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanDataPathCfg + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanDataPathChannelCfg) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanDataPathChannelCfg.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanDataPathChannelCfg + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanDataPathConfirmInd) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanDataPathConfirmInd.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanDataPathConfirmInd + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanDataPathEndInd) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanDataPathEndInd.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanDataPathEndInd + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanDataPathEndRequest) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanDataPathEndRequest.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanDataPathEndRequest + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanDataPathIndicationResponse) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanDataPathIndicationResponse.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanDataPathIndicationResponse + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanDataPathInitiatorRequest) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanDataPathInitiatorRequest.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanDataPathInitiatorRequest + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanDataPathQosCfg) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanDataPathQosCfg.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanDataPathQosCfg + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanDataPathRequestInd) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanDataPathRequestInd.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanDataPathRequestInd + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanDataPathRequestResponse) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanDataPathRequestResponse.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanDataPathRequestResponse + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanDataPathResponseCode) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanDataPathResponseCode.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanDataPathResponseCode + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanDataPathSecurityCfgStatus) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanDataPathSecurityCfgStatus.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanDataPathSecurityCfgStatus + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanDeviceRole) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanDeviceRole.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanDeviceRole + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanDisabledInd) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanDisabledInd.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanDisabledInd + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanDiscEngEventInd) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanDiscEngEventInd.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanDiscEngEventInd + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanDiscEngEventType) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanDiscEngEventType.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanDiscEngEventType + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanEnableRequest) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanEnableRequest.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanEnableRequest + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanFollowupInd) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanFollowupInd.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanFollowupInd + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanFurtherAvailabilityChannel) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanFurtherAvailabilityChannel.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanFurtherAvailabilityChannel + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanFurtherAvailabilityMap) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanFurtherAvailabilityMap.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanFurtherAvailabilityMap + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanMacAddressEvent) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanMacAddressEvent.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanMacAddressEvent + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanMatchAlg) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanMatchAlg.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanMatchAlg + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanMatchExpiredInd) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanMatchExpiredInd.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanMatchExpiredInd + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanMatchInd) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanMatchInd.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanMatchInd + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanPublishCancelRequest) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanPublishCancelRequest.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanPublishCancelRequest + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanPublishRequest) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanPublishRequest.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanPublishRequest + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanPublishResponse) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanPublishResponse.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanPublishResponse + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanPublishTerminatedInd) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanPublishTerminatedInd.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanPublishTerminatedInd + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanPublishType) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanPublishType.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanPublishType + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanReceivePostConnectivityCapability) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanReceivePostConnectivityCapability.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanReceivePostConnectivityCapability + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanReceivePostDiscovery) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanReceivePostDiscovery.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanReceivePostDiscovery + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanReceiveVendorSpecificAttribute) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanReceiveVendorSpecificAttribute.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanReceiveVendorSpecificAttribute + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanResponseMsg) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanResponseMsg.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanResponseMsg + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanResponseType) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanResponseType.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanResponseType + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanSizes) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanSizes.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanSizes + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanSocialChannelScanParams) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanSocialChannelScanParams.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanSocialChannelScanParams + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanSrfIncludeType) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanSrfIncludeType.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanSrfIncludeType + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanSrfState) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanSrfState.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanSrfState + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanSrfType) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanSrfType.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanSrfType + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanSsiInMatchInd) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanSsiInMatchInd.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanSsiInMatchInd + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanStatusType) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanStatusType.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanStatusType + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanSubscribeCancelRequest) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanSubscribeCancelRequest.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanSubscribeCancelRequest + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanSubscribeRequest) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanSubscribeRequest.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanSubscribeRequest + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanSubscribeResponse) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanSubscribeResponse.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanSubscribeResponse + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanSubscribeTerminatedInd) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanSubscribeTerminatedInd.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanSubscribeTerminatedInd + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanSubscribeType) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanSubscribeType.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanSubscribeType + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanTransmitFollowupInd) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanTransmitFollowupInd.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanTransmitFollowupInd + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanTransmitFollowupRequest) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanTransmitFollowupRequest.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanTransmitFollowupRequest + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanTransmitPostConnectivityCapability) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanTransmitPostConnectivityCapability.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanTransmitPostConnectivityCapability + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanTransmitPostDiscovery) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanTransmitPostDiscovery.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanTransmitPostDiscovery + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanTransmitVendorSpecificAttribute) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanTransmitVendorSpecificAttribute.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanTransmitVendorSpecificAttribute + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanTransmitWindowType) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanTransmitWindowType.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanTransmitWindowType + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanTxPriority) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanTxPriority.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanTxPriority + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanTxType) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanTxType.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanTxType + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanVsaRxFrameMask) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanVsaRxFrameMask.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanVsaRxFrameMask + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + # # Build types.hal (WifiStatus) # @@ -500,6 +2733,10 @@ $(GEN): PRIVATE_HIDL := $(HIDL) $(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IWifiNanIface.hal $(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IWifiIface.hal $(GEN): $(LOCAL_PATH)/IWifiIface.hal +$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IWifiNanIfaceEventCallback.hal +$(GEN): $(LOCAL_PATH)/IWifiNanIfaceEventCallback.hal +$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal +$(GEN): $(LOCAL_PATH)/types.hal $(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) $(GEN): PRIVATE_CUSTOM_TOOL = \ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ @@ -510,6 +2747,25 @@ $(GEN): $(LOCAL_PATH)/IWifiNanIface.hal $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) +# +# Build IWifiNanIfaceEventCallback.hal +# +GEN := $(intermediates)/android/hardware/wifi/1.0/IWifiNanIfaceEventCallback.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IWifiNanIfaceEventCallback.hal +$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal +$(GEN): $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::IWifiNanIfaceEventCallback + +$(GEN): $(LOCAL_PATH)/IWifiNanIfaceEventCallback.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + # # Build IWifiP2pIface.hal # diff --git a/wifi/1.0/IWifiNanIface.hal b/wifi/1.0/IWifiNanIface.hal index dade94c885..2926c4f2d2 100644 --- a/wifi/1.0/IWifiNanIface.hal +++ b/wifi/1.0/IWifiNanIface.hal @@ -17,10 +17,259 @@ package android.hardware.wifi@1.0; import IWifiIface; +import IWifiNanIfaceEventCallback; /** - * Interface used to represent a single NAN iface. + * Interface used to represent a single NAN(Neighbour Aware Network) iface. */ interface IWifiNanIface extends IWifiIface { - /** TODO(rpius): Add methods to the interface. */ + /** + * Requests notifications of significant events on this iface. Multiple calls + * to this must register multiple callbacks each of which must receive all + * events. + * + * @param callback An instance of the |IWifiNanIfaceEventCallback| HIDL interface + * object. + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID| + */ + registerEventCallback(IWifiNanIfaceEventCallback callback) + generates (WifiStatus status); + + /** + * Enable NAN functionality. + * + * @param cmdId command Id to use for this invocation. + * @param msg Instance of |NanEnableRequest|. + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, + * |WifiStatusCode.ERROR_INVALID_ARGS|, + * |WifiStatusCode.ERROR_UNKNOWN| + */ + enableRequest(CommandId cmdId, NanEnableRequest msg) + generates (WifiStatus status); + + /** + * Disable NAN functionality. + * + * @param cmdId command Id to use for this invocation. + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, + * |WifiStatusCode.ERROR_UNKNOWN| + */ + disableRequest(CommandId cmdId) generates (WifiStatus status); + + /** + * Publish request to advertize a service. + * + * @param cmdId command Id to use for this invocation. + * @param msg Instance of |NanPublishRequest|. + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, + * |WifiStatusCode.ERROR_INVALID_ARGS|, + * |WifiStatusCode.ERROR_UNKNOWN| + */ + publishRequest(CommandId cmdId, NanPublishRequest msg) + generates (WifiStatus status); + + /** + * Cancel previous publish requests. + * + * @param cmdId command Id to use for this invocation. + * @param msg Instance of |NanPublishCancelRequest|. + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, + * |WifiStatusCode.ERROR_INVALID_ARGS|, + * |WifiStatusCode.ERROR_UNKNOWN| + */ + publishCancelRequest(CommandId cmdId, NanPublishCancelRequest msg) + generates (WifiStatus status); + + /** + * Subscribe request to search for a service. + * + * @param cmdId command Id to use for this invocation. + * @param msg Instance of |NanSubscribeRequest|. + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, + * |WifiStatusCode.ERROR_INVALID_ARGS|, + * |WifiStatusCode.ERROR_UNKNOWN| + */ + subscribeRequest(CommandId cmdId, NanSubscribeRequest msg) + generates (WifiStatus status); + + /** + * Cancel previous subscribe requests. + * + * @param cmdId command Id to use for this invocation. + * @param msg Instance of |NanSubscribeCancelRequest|. + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, + * |WifiStatusCode.ERROR_INVALID_ARGS|, + * |WifiStatusCode.ERROR_UNKNOWN| + */ + subscribeCancelRequest(CommandId cmdId, NanSubscribeCancelRequest msg) + generates (WifiStatus status); + + /** + * NAN transmit follow up request. + * + * @param cmdId command Id to use for this invocation. + * @param msg Instance of |NanTransmitFollowupRequest|. + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, + * |WifiStatusCode.ERROR_INVALID_ARGS|, + * |WifiStatusCode.ERROR_UNKNOWN| + */ + transmitFollowupRequest(CommandId cmdId, NanTransmitFollowupRequest msg) + generates (WifiStatus status); + + /** + * NAN configuration request. + * + * @param cmdId command Id to use for this invocation. + * @param msg Instance of |NanConfigRequest|. + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, + * |WifiStatusCode.ERROR_INVALID_ARGS|, + * |WifiStatusCode.ERROR_UNKNOWN| + */ + configRequest(CommandId cmdId, NanConfigRequest msg) + generates (WifiStatus status); + + /** + * Set NAN Beacon or sdf payload to discovery engine. + * This instructs the Discovery Engine to begin publishing the + * received payload in any Beacon or Service Discovery Frame transmitted + * + * @param cmdId command Id to use for this invocation. + * @param msg Instance of |NanBeaconSdfPayloadRequest|. + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, + * |WifiStatusCode.ERROR_INVALID_ARGS|, + * |WifiStatusCode.ERROR_UNKNOWN| + */ + beaconSdfPayloadRequest(CommandId cmdId, NanBeaconSdfPayloadRequest msg) + generates (WifiStatus status); + + /** + * Get NAN HAL version. + * + * @param cmdId command Id to use for this invocation. + * @return version Instance of |NanVersion|. + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, + * |WifiStatusCode.ERROR_INVALID_ARGS|, + * |WifiStatusCode.ERROR_UNKNOWN| + */ + getVersion() generates (WifiStatus status, NanVersion version); + + /** + * Get NAN capabilities. + * + * @param cmdId command Id to use for this invocation. + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, + * |WifiStatusCode.ERROR_INVALID_ARGS|, + * |WifiStatusCode.ERROR_UNKNOWN| + */ + getCapabilities(CommandId cmdId) generates (WifiStatus status); + + /** + * Create NAN Data Interface + * + * @param cmdId command Id to use for this invocation. + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, + * |WifiStatusCode.ERROR_INVALID_ARGS|, + * |WifiStatusCode.ERROR_UNKNOWN| + */ + dataInterfaceCreate(CommandId cmdId, string ifaceName) + generates (WifiStatus status); + + /** + * Delete NAN Data Interface. + * + * @param cmdId command Id to use for this invocation. + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, + * |WifiStatusCode.ERROR_INVALID_ARGS|, + * |WifiStatusCode.ERROR_UNKNOWN| + */ + dataInterfaceDelete(CommandId cmdId, string ifaceName) + generates (WifiStatus status); + + /** + * Initiate a NDP session: Initiator + * + * @param cmdId command Id to use for this invocation. + * @param msg Instance of |NanDataPathInitiatorRequest|. + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, + * |WifiStatusCode.ERROR_INVALID_ARGS|, + * |WifiStatusCode.ERROR_UNKNOWN| + */ + dataRequestInitiator(CommandId cmdId, NanDataPathInitiatorRequest msg) + generates (WifiStatus status); + + /** + * Response to a data indication received corresponding to a NDP session. An indication + * is received with a data request and the responder will send a data response. + * + * @param cmdId command Id to use for this invocation. + * @param msg Instance of |NanDataPathIndicationResponse|. + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, + * |WifiStatusCode.ERROR_INVALID_ARGS|, + * |WifiStatusCode.ERROR_UNKNOWN| + */ + dataIndicationResponse(CommandId cmdId, NanDataPathIndicationResponse msg) + generates (WifiStatus status); + + /** + * NDL termination request: from either Initiator/Responder. + * + * @param cmdId command Id to use for this invocation. + * @param msg Instance of |NanDataPathEndRequest|. + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, + * |WifiStatusCode.ERROR_INVALID_ARGS|, + * |WifiStatusCode.ERROR_UNKNOWN| + */ + dataEnd(CommandId cmdId, NanDataPathEndRequest msg) + generates (WifiStatus status); }; diff --git a/wifi/1.0/IWifiNanIfaceEventCallback.hal b/wifi/1.0/IWifiNanIfaceEventCallback.hal new file mode 100644 index 0000000000..27b437446a --- /dev/null +++ b/wifi/1.0/IWifiNanIfaceEventCallback.hal @@ -0,0 +1,54 @@ +/* + * Copyright 2016 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.wifi@1.0; + +/** + * NAN Response and Event Callbacks. + */ +interface IWifiNanIfaceEventCallback { + /** + * NotifyResponse invoked to notify the status of the Request. + */ + oneway notifyResponse(CommandId id, NanResponseMsg rspData); + + /** + * Callbacks for the various asynchornous NAN Events. + */ + oneway eventPublishTerminated(NanPublishTerminatedInd event); + + oneway eventMatch(NanMatchInd event); + + oneway eventMatchExpired(NanMatchExpiredInd event); + + oneway eventSubscribeTerminated(NanSubscribeTerminatedInd event); + + oneway eventFollowup(NanFollowupInd event); + + oneway eventDiscEngEvent(NanDiscEngEventInd event); + + oneway eventDisabled(NanDisabledInd event); + + oneway eventBeaconSdfPayload(NanBeaconSdfPayloadInd event); + + oneway eventDataRequest(NanDataPathRequestInd event); + + oneway eventDataConfirm(NanDataPathConfirmInd event); + + oneway eventDataEnd(NanDataPathEndInd event); + + oneway eventTransmitFollowup(NanTransmitFollowupInd event); +}; diff --git a/wifi/1.0/IWifiStaIface.hal b/wifi/1.0/IWifiStaIface.hal index 52f0d4aae9..8f45777fd1 100644 --- a/wifi/1.0/IWifiStaIface.hal +++ b/wifi/1.0/IWifiStaIface.hal @@ -151,7 +151,7 @@ interface IWifiStaIface extends IWifiIface { * Channel frequencies (in Mhz) to scan if |band| is set to * |UNSPECIFIED|. */ - vec frequenciesInMhz; + vec frequencies; /** * Period at which this bucket must be scanned (in milliseconds). Must be an integer * multiple of the |basePeriodInMs| specified in the BackgroundScanParameters. @@ -395,10 +395,10 @@ interface IWifiStaIface extends IWifiIface { * |WifiStatusCode.ERROR_NOT_SUPPORTED|, * |WifiStatusCode.ERROR_NOT_AVAILABLE|, * |WifiStatusCode.ERROR_UNKNOWN| - * @return frequenciesInMhz vector of valid frequencies for the provided band. + * @return frequencies vector of valid frequencies for the provided band. */ getValidFrequenciesForBackgroundScan(BackgroundScanBand band) - generates (WifiStatus status, vec frequenciesInMhz); + generates (WifiStatus status, vec frequencies); /** * Start a background scan using the given cmdId as an identifier. Only one diff --git a/wifi/1.0/IWifiStaIfaceEventCallback.hal b/wifi/1.0/IWifiStaIfaceEventCallback.hal index 7466fc33a6..129c258104 100644 --- a/wifi/1.0/IWifiStaIfaceEventCallback.hal +++ b/wifi/1.0/IWifiStaIfaceEventCallback.hal @@ -26,11 +26,6 @@ interface IWifiStaIfaceEventCallback { vec data; }; - /** - * BSSID type. 6 octets representing the physical address of an AP. - */ - typedef uint8_t[6] Bssid; - /** * Structure describing all the information about a single access point seen * during the scan. @@ -39,8 +34,8 @@ interface IWifiStaIfaceEventCallback { int64_t timeStampInUs; vec ssid; Bssid bssid; - uint32_t frequencyInMhz; int8_t rssi; + WifiChannelInMhz frequency; uint16_t beaconPeriodInMs; uint16_t capability; vec informationElements; diff --git a/wifi/1.0/types.hal b/wifi/1.0/types.hal index f80b9a03ff..a7ecf7eea3 100644 --- a/wifi/1.0/types.hal +++ b/wifi/1.0/types.hal @@ -76,3 +76,1384 @@ typedef uint32_t ChipModeId; * |IWifiStaIface.installApfPacketFilter|, etc. */ typedef uint32_t CommandId; + +/** + * Channel frequency in Mhz. + */ +typedef uint32_t WifiChannelInMhz; + +/** + * Mac Address type. 6 octets representing physical address of a device. + */ +typedef uint8_t[6] MacAddress; + +/** + * BSSID type. 6 octets representing the physical address of an AP. + */ +typedef MacAddress Bssid; + +/** + * NAN specific types. + * TODO(b/32159498): Move to a separate nan_types.hal. + */ +/** + * Various max sizes used in the NAN interface. + */ +enum NanMaxSize : uint32_t { + SOCIAL_CHANNELS = 3, + SERVICE_NAME_LEN = 255, + MATCH_FILTER_LEN = 255, + SERVICE_SPECIFIC_INFO_LEN = 1024, + VSA_DATA_LEN = 1024, + MESH_DATA_LEN = 32, + INFRA_DATA_LEN = 32, + CLUSTER_ATTRIBUTE_LEN = 255, + SUBSCRIBE_MAX_ADDRESS = 42, + FAM_CHANNELS = 32, + POSTDISCOVERY_LEN = 5, + FRAME_DATA_LEN = 504, + DP_APP_INFO_LEN = 512, +}; + +/** + * NAN protocol Version info. + */ +typedef int32_t NanVersion; + +/** NAN Iface specific types */ +/** + * NAN data path identifiers. + */ +typedef uint32_t NanDataPathId; + +/** + * Data request Initiator/Responder app/service related info. + */ +struct NanDataPathAppInfo { + /** + * Max length: |MAX_DP_APP_INFO_LEN|. + */ + vec ndpAppInfo; +}; + +/** + * Configuration params of Data request Initiator/Responder. + */ +struct NanDataPathCfg { + /** + * Indicates whether to use Security/No Security. + */ + bool useSecurity; + /** + * Indicating whether to use QOS/No QOS. + */ + bool useQos; +}; + +/** + * Indicates the availability interval duration associated with the + * Availability Intervals Bitmap field + */ +enum NanAvailDuration : uint32_t { + DURATION_16MS = 0, + DURATION_32MS = 1, + DURATION_64MS = 2, +}; + +/** + * Possible connection types in Post NAN Discovery attributes. + */ +enum NanConnectionType : uint32_t { + WLAN_INFRA = 0, + P2P_OPER = 1, + WLAN_IBSS = 2, + WLAN_MESH = 3, + FURTHER_SERVICE_AVAILABILITY = 4, + WLAN_RANGING = 5, +}; + +/** + * Possible device roles in Post NAN Discovery attributes. + */ +enum NanDeviceRole : uint32_t { + WLAN_INFRA_AP = 0, + WLAN_INFRA_STA = 1, + P2P_OPER_GO = 2, + P2P_OPER_DEV = 3, + P2P_OPER_CLI = 4, +}; + +/** + * Data request Responder's response. + */ +enum NanDataPathResponseCode : uint32_t { + ACCEPT = 0, + REJECT, +}; + +/** + * Further availability per channel information. + */ +struct NanFurtherAvailabilityChannel { + /** + * Defined above. + */ + NanAvailDuration entryControl; + /** + * 1 byte field indicating the frequency band the NAN Device + * must be available as defined in IEEE Std. 802.11-2012 + * Annex E Table E-4 Global Operating Classes + */ + uint8_t classVal; + /** + * 1 byte field indicating the channel the NAN Device + * must be available. + */ + uint8_t channel; + /** + * Map Id - 4 bit field which identifies the Further + * availability map attribute. + */ + uint8_t mapid; + /** + * Divides the time between the beginnings of consecutive "Discovery + * Windows" of a given NAN cluster into consecutive time intervals + * of equal durations. The time interval duration is specified by + * the |entryControl| field. + * A device that sets the i-th bit of the Availability + * Intervals Bitmap to 1 shall be present during the corresponding + * i-th time interval in the operation channel indicated by the + * Operating Class and Channel Number fields in the same Availability Entry. + * A device that sets the i-th bit of the Availability Intervals Bitmap to + * 0 may be present during the corresponding i-th time interval in the operation + * channel indicated by the Operating Class and Channel Number fields in the same + * Availability Entry. + * The size of the Bitmap is dependent upon the Availability Interval Duration + * Chosen in the Entry Control Field. The size can be either 1, 2 or 4 bytes long + * - Duration field is equal to 0, only AIB[0] is valid + * - Duration field is equal to 1, only AIB [0] and AIB [1] is valid + * - Duration field is equal to 2, AIB [0], AIB [1], AIB [2] and AIB [3] are valid + */ + uint32_t availIntervalBitmap; +}; + +/** + * NAN Publish Types. + */ +enum NanPublishType : uint32_t { + UNSOLICITED = 0, + SOLICITED, + UNSOLICITED_SOLICITED, +}; + +/** + * NAN Transmit Priorities. + */ +enum NanTxPriority : uint32_t { + NORMAL = 0, + HIGH, +}; + +/** + * NAN Transmit Types. + */ +enum NanTxType : uint32_t { + BROADCAST = 0, + UNICAST, +}; + +/** + * NAN Subscribe Type. + */ +enum NanSubscribeType : uint32_t { + PASSIVE = 0, + ACTIVE, +}; + +/** + * NAN Service Response Filter Attribute Bit. + */ +enum NanSrfType : uint32_t { + BLOOM_FILTER = 0, + PARTIAL_MAC_ADDR, +}; + +/** + * NAN Service Response Filter Include Bit. + */ +enum NanSrfIncludeType : uint32_t { + DO_NOT_RESPOND = 0, + RESPOND, +}; + +/** + * NAN Match indication type. + */ +enum NanMatchAlg : uint32_t { + MATCH_ONCE = 0, + MATCH_CONTINUOUS, + MATCH_NEVER, +}; + +/** + * NAN Transmit Window Type. + */ +enum NanTransmitWindowType : uint32_t { + DW = 0, + FAW, +}; + +/** + * NAN DP channel config options. + */ +enum NanDataPathChannelCfg : uint32_t { + CHANNEL_NOT_REQUESTED = 0, + REQUEST_CHANNEL_SETUP, + FORCE_CHANNEL_SETUP, +}; + +/** + * Host can send Vendor specific attributes which the Discovery Engine can + * enclose in Beacons and/or Service Discovery frames transmitted. + * Below structure is used to populate that. + * TODO(b/32207606): This can be moved to vendor extension to the HIDL. + */ +struct NanTransmitVendorSpecificAttribute { + /** + * 0 = transmit only in the next discovery window + * 1 = transmit in next 16 discovery window + */ + uint8_t payloadTransmitFlag; + /** + * Below flags must determine in which all frames + * the vendor specific attributes must be included + */ + uint8_t txInDiscoveryBeacon; + uint8_t txInSyncBeacon; + uint8_t txInServiceDiscovery; + /** + * Organizationally Unique Identifier. + */ + uint32_t vendorOui; + /** + * Vendor specific attribute to be transmitted. + * Max length: |MAX_VSA_DATA_LEN|. + */ + vec vsa; +}; + +/** + * Host can set the Periodic scan parameters for each of the + * 3(6, 44, 149) Social channels. Only these channels are allowed + * any other channels are rejected + */ + enum NanChannelIndex : uint32_t { + CHANNEL_24G_BAND = 0, + CHANNEL_5G_BAND_LOW, + CHANNEL_5G_BAND_HIGH, +}; + +/** + * Structure to set the Social Channel Scan parameters + * passed as part of EnableRequest/ConfigRequest. + */ +struct NanSocialChannelScanParams { + /** + * Dwell time of each social channel in milliseconds + * ChannelIndex corresponds to the respective channel + * If time set to 0 then the FW default time must be used. + * Max length: |MAX_SOCIAL_CHANNELS|. + * dwellTime[i] refers to the dwell time of the i'th social channel. + */ + vec dwellTime; + /** + * Scan period of each social channel in seconds + * ChannelIndex corresponds to the respective channel + * If time set to 0 then the FW default time must be used. + * Max length: |MAX_SOCIAL_CHANNELS|. + * scanPeriod[i] refers to the scan period of the i'th social channel. + */ + vec scanPeriod; +}; + +/** + * Enable Request Message Structure + * The EnableReq message in structs the Discovery Engine to enter an operational state + */ +struct NanEnableRequest { + /** + * Mandatory parameters below. + */ + uint8_t masterPref; + /** + * A cluster_low value matching cluster_high indicates a request to join + * a cluster with that value. If the requested cluster is not found the + * device must start its own cluster. + */ + uint16_t clusterLow; + uint16_t clusterHigh; + /** + * Optional configuration of Enable request. + * Each of the optional parameters have configure flag which + * determine whether configuration is to be passed or not. + * TODO(b/32207606): Check if these config variables needed or not. + */ + bool validSupport5gVal; + uint8_t support5gVal; + /** + * BIT 0 is used to specify to include Service IDs in Sync/Discovery beacons + * 0 - Do not include SIDs in any beacons + * 1 - Include SIDs in all beacons. + * Rest 7 bits are count field which allows control over the number of SIDs + * included in the Beacon. 0 means to include as many SIDs that fit into + * the maximum allow Beacon frame size + */ + bool validSidBeaconVal; + uint8_t sidBeaconVal; + /** + * The rssi values below must be specified without sign. + * For eg: -70dBm must be specified as 70. + */ + bool valid2dot4gRssiCloseVal; + uint8_t rssiClose2dot4gVal; + bool valid2dot4gRssiMiddleVal; + uint8_t rssiMiddle2dot4gVal; + bool valid2dot4gRssiProximityVal; + uint8_t rssiProximity2dot4gVal; + bool validHopCountLimitVal; + uint8_t hopCountLimitVal; + /** + * Defines 2.4G channel access support + */ + bool valid2dot4gSupportVal; + bool support2dot4gVal; + /** + * Defines 2.4G channels must be used for sync/discovery beacons + */ + bool valid2dot4gBeaconsVal; + bool beacon2dot4gVal; + /** + * Defines 2.4G channels must be used for Service Discovery frames + */ + bool valid2dot4gSdfVal; + bool sdf2dot4gVal; + /** + * Defines 5G channels must be used for sync/discovery beacons + */ + bool valid5gBeaconsVal; + bool beacon5gVal; + /** + * Defines 5G channels must be used for Service Discovery frames + */ + bool valid5gSdfVal; + bool sdf5gVal; + /** + * 1 byte value which defines the RSSI in + * dBm for a close by Peer in 5 Ghz channels. + * The rssi values must be specified without sign. + * For eg: -70dBm must be specified as 70. + */ + bool valid5gRssiCloseVal; + uint8_t rssiClose5gVal; + /** + * 1 byte value which defines the RSSI value in + * dBm for a close by Peer in 5 Ghz channels. + * The rssi values must be specified without sign. + * For eg: -70dBm must be specified as 70. + */ + bool valid5gRssiMiddleVal; + uint8_t rssiMiddle5gVal; + /** + * 1 byte value which defines the RSSI filter + * threshold. Any Service Descriptors received above this + * value that are configured for RSSI filtering must be dropped. + * The rssi values must be specified without sign. + * For eg: -70dBm must be specified as 70. + */ + bool valid5gRssiCloseProximityVal; + uint8_t rssiCloseProximity5gVal; + /** + * 1 byte quantity which defines the window size over + * which the “average RSSI” must be calculated over. + */ + bool validRssiWindowSizeVal; + uint8_t rssiWindowSizeVal; + /** + * The 24 bit Organizationally Unique ID + the 8 bit Network Id. + */ + uint8_t validOuiVal; + uint32_t ouiVal; + /** + * NAN Interface Address, If not configured the Discovery Engine + * must generate a 6 byte Random MAC. + */ + bool validIntfAddrVal; + MacAddress intfAddrVal; + /** + * If set to true, the Discovery Engine must enclose the Cluster + * Attribute only sent in Beacons in a Vendor Specific Attribute + * and transmit in a Service Descriptor Frame. + */ + bool configClusterAttributeVal; + /** + * The periodicity in seconds between full scan’s to find any new + * clusters available in the area. A Full scan must not be done + * more than every 10 seconds and must not be done less than every + * 30 seconds. + */ + bool validScanParamsVal; + NanSocialChannelScanParams scanParamsVal; + /** + * 1 byte quantity which forces the Random Factor to a particular + * value for all transmitted Sync/Discovery beacons + */ + bool validRandomFactorForceVal; + uint8_t randomFactorForceVal; + /** + * 1 byte quantity which forces the HC for all transmitted Sync and + * Discovery Beacon NO matter the real HC being received over the + * air. + */ + bool validHopCountForceVal; + uint8_t hopCountForceVal; + /** + * Channel frequency in MHz to enable on. + */ + bool valid24gChannelVal; + WifiChannelInMhz channel24gVal; + bool valid5gChannelVal; + WifiChannelInMhz channel5gVal; +}; + + +/** + * Publish Msg Structure + * Message is used to request the DE to publish the Service Name + * using the parameters passed into the "Discovery Window". + */ +struct NanPublishRequest { + /** + * Id 0 means new publish, any other id is existing publish. + */ + uint16_t publishId; + /** + * How many seconds to run for. 0 means forever until canceled. + */ + uint16_t ttl; + /** + * Periodicity of OTA unsolicited publish. Specified in increments of 500 ms. + */ + uint16_t period; + /** + * 0= unsolicited, solicited = 1, 2= both. + */ + NanPublishType publishType; + /** + * 0 = broadcast, 1= unicast if solicited publish. + */ + NanTxType txType; + /** + * Number of OTA Publish, 0 means forever until canceled. + */ + uint8_t publishCount; + /** + * UTF-8 encoded string identifying the service. + * Max length: |MAX_SERVICE_NAME_LEN|. + */ + string serviceName; + /** + * Field which specifies how the matching indication to host is controlled. + * 0 - Match and Indicate Once + * 1 - Match and Indicate continuous + * 2 - Match and Indicate never. This means don't indicate the match to + * the host. + * 3 - Reserved + */ + NanMatchAlg publishMatchIndicator; + /** + * Sequence of values NAN Device that has invoked a Subscribe method + * corresponding to this Publish method. + * Max length: |MAX_SERVICE_SPECIFIC_INFO_LEN|. + */ + vec serviceSpecificInfo; + /** + * Ordered sequence of pairs which specify further response conditions + * beyond the service name used to filter subscribe messages to respond to. + * This is only needed when the PT is set to SOLICITED or SOLICITED_UNSOLICITED. + * Max length: |MAX_MATCH_FILTER_LEN|. + */ + vec rxMatchFilter; + /** + * Ordered sequence of pairs to be included in the Discovery Frame. + * If present it is always sent in a Discovery Frame + * Max length: |MAX_MATCH_FILTER_LEN|. + */ + vec txMatchFilter; + /** + * Flag which specifies that the Publish must use the configured RSSI + * threshold and the received RSSI in order to filter requests + * false – ignore the configured RSSI threshold when running a Service + * Descriptor attribute or Service ID List Attribute through the DE matching logic. + * true – use the configured RSSI threshold when running a Service + * Descriptor attribute or Service ID List Attribute through the DE matching logic. + */ + bool useRssiThreshold; + /** + * 8-bit bitmap which allows the Host to associate this publish + * with a particular Post-NAN Connectivity attribute + * which has been sent down in a ConfigureRequest/EnableRequest + * message. If the DE fails to find a configured Post-NAN + * connectivity attributes referenced by the bitmap, + * the DE must return an error code to the Host. + * If the Publish is configured to use a Post-NAN Connectivity + * attribute and the Host does not refresh the Post-NAN Connectivity + * attribute the Publish must be canceled and the Host must be sent + * a PublishTerminatedIndication message. + */ + uint8_t connmap; + /** + * Set/Enable corresponding bits to disable any indications that follow a publish. + * BIT0 - Disable publish termination indication. + * BIT1 - Disable match expired indication. + * BIT2 - Disable followUp indication received (OTA). + */ + uint8_t recvIndicationCfg; +}; + +/** + * Publish Cancel Msg Structure. + * The PublishServiceCancelReq Message is used to request the DE to stop publishing + * the Service Name identified by the Publish Id in the message. + */ +struct NanPublishCancelRequest { + uint16_t publishId; +}; + +/** + * NAN Subscribe Structure. + * The SubscribeServiceReq message is sent to the Discovery Engine + * whenever the Upper layers would like to listen for a Service Name + */ +struct NanSubscribeRequest { + /** + * Id 0 means new subscribe, non zero is existing subscribe. + */ + uint16_t subscribeId; + /** + * How many seconds to run for. 0 means forever until canceled. + */ + uint16_t ttl; + /** + * Periodicity of OTA Active Subscribe. Units in increments of 500 ms, + * 0 = attempt every DW. + */ + uint16_t period; + /** + * Flag which specifies how the Subscribe request shall be processed. + * 0 - PASSIVE , 1- ACTIVE. + */ + NanSubscribeType subscribeType; + /** + * Flag which specifies on Active Subscribes how the Service Response Filter + * attribute is populated. + * 0 - Bloom Filter, 1 - MAC Addr. + */ + NanSrfType serviceResponseFilter; + /** + * Flag which specifies how the Service Response Filter Include bit is + * populated. + * 0=Do not respond if in the Address Set, 1= Respond. + */ + NanSrfIncludeType serviceResponseInclude; + /** + * Flag which specifies if the Service Response Filter must be used when + * creating Subscribes. + * 0=Do not send the Service Response Filter,1= send. + */ + bool shouldUseServiceResponseFilter; + /** + * Flag which specifies if the Service Specific Info is needed in + * the Publish message before creating the MatchIndication. + * 0=Not needed, 1= Required. + */ + bool isSsiRequiredForMatchIndication; + /** + * Field which specifies how the matching indication to host is controlled. + * 0 - Match and Indicate Once + * 1 - Match and Indicate continuous + * 2 - Match and Indicate never. This means don't indicate the match to the + * host. + * 3 - Reserved + */ + NanMatchAlg subscribeMatchIndicator; + /** + * The number of Subscribe Matches which must occur + * before the Subscribe request is automatically terminated. + * If this value is 0 this field is not used by the DE. + */ + uint8_t subscribeCount; + /** + * UTF-8 encoded string identifying the service. + * Max length: |MAX_SERVICE_NAME_LEN|. + */ + string serviceName; + /** + * Sequence of values which further specify the published service beyond the + * service name. + * Max length: |MAX_SERVICE_SPECIFIC_INFO_LEN|. + */ + vec serviceSpecificInfo; + /** + * Ordered sequence of pairs used to filter out received + * publish discovery messages. + * This can be sent both for a Passive or an Active Subscribe + * Max length: |MAX_MATCH_FILTER_LEN|. + */ + vec rxMatchFilter; + /** + * Ordered sequence of pairs included in the + * Discovery Frame when an Active Subscribe is used. + * Max length: |MAX_MATCH_FILTER_LEN|. + */ + vec txMatchFilter; + /** + * Flag which specifies that the Publish must use the configured RSSI + * threshold and the received RSSI in order to filter requests + * false – ignore the configured RSSI threshold when running a Service + * Descriptor attribute or Service ID List Attribute through the DE matching logic. + * true – use the configured RSSI threshold when running a Service + * Descriptor attribute or Service ID List Attribute through the DE matching logic. + */ + bool useRssiThreshold; + /** + * 8-bit bitmap which allows the Host to associate this Active + * Subscribe with a particular Post-NAN Connectivity attribute + * which has been sent down in a ConfigureRequest/EnableRequest + * message. If the DE fails to find a configured Post-NAN + * connectivity attributes referenced by the bitmap, + * the DE must return an error code to the Host. + * If the Subscribe is configured to use a Post-NAN Connectivity + * attribute and the Host does not refresh the Post-NAN Connectivity + * attribute the Subscribe must be canceled and the Host must be sent + * a SubscribeTerminatedIndication message. + */ + uint8_t connmap; + /** + * NAN Interface Address, conforming to the format as described in + * 8.2.4.3.2 of IEEE Std. 802.11-2012. + * Max length: |MAX_SUBSCRIBE_MAX_ADDRESS|. + */ + vec intfAddr; + /** + * Set/Enable corresponding bits to disable indications that follow a + * subscribe. + * BIT0 - Disable subscribe termination indication. + * BIT1 - Disable match expired indication. + * BIT2 - Disable followUp indication received (OTA). + */ + uint8_t recvIndicationCfg; +}; + +/** + * NAN Subscribe Cancel Structure + * The SubscribeCancelReq Message is used to request the DE to stop looking + * for the Service Name. + */ +struct NanSubscribeCancelRequest { + uint16_t subscribeId; +}; + +/** + * Transmit follow up Structure. + * The TransmitFollowupReq message is sent to the DE to allow the sending of + * the Service_Specific_Info to a particular MAC address. + */ +struct NanTransmitFollowupRequest { + /** + * Publish or Subscribe Id of an earlier Publish/Subscribe. + */ + uint16_t publishSubscribeId; + /** + * This Id is the Requestor Instance that is passed as + * part of earlier MatchInd/FollowupInd message. + */ + uint32_t requestorInstanceId; + /** + * Unicast address. + */ + MacAddress addr; + /** + * Priority of the request 2=high. + */ + NanTxPriority priority; + /** + * Flag which the DE uses to decide if received in a DW or a FAW + * 0= send in a DW, 1=send in FAW. + */ + NanTransmitWindowType dwOrFaw; + /** + * Sequence of values which further specify the published service beyond + * the service name. + * Max length: |MAX_SERVICE_SPECIFIC_INFO_LEN|. + */ + vec serviceSpecificInfo; + /** + * Set/Enable corresponding bits to disable responses after followUp. + * BIT0 - Disable followUp response from FW. + */ + uint8_t recvIndicationCfg; +}; + +/** + * Config Structure. + * The ConfigurationReq message is sent by the Host to the + * Discovery Engine in order to configure the Discovery Engine during runtime. + */ +struct NanConfigRequest { + bool validSidBeaconVal; + uint8_t sidBeacon; + bool validRssiProximityVal; + uint8_t rssiProximity; + bool validMasterPrefVal; + uint8_t masterPref; + /** + * 1 byte value which defines the RSSI filter threshold. + * Any Service Descriptors received above this value + * that are configured for RSSI filtering must be dropped. + * The rssi values must be specified without sign. + * For eg: -70dBm must be specified as 70. + */ + bool valid5gRssiCloseProximityVal; + uint8_t rssiCloseProximity5gVal; + /** + * 2 byte quantity which defines the window size over + * which the “average RSSI” must be calculated over. + */ + bool validRssiWindowSizeVal; + uint16_t rssiWindowSizeVal; + /** + * If set to 1, the Discovery Engine must enclose the Cluster + * Attribute only sent in Beacons in a Vendor Specific Attribute + * and transmit in a Service Descriptor Frame. + */ + bool configClusterAttributeVal; + /** + * The periodicity in seconds between full scan’s to find any new + * clusters available in the area. A Full scan must not be done + * more than every 10 seconds and must not be done less than every + * 30 seconds. + */ + bool validScanParamsVal; + NanSocialChannelScanParams scanParamsVal; + /** + * 1 byte quantity which forces the Random Factor to a particular + * value for all transmitted Sync/Discovery beacons + */ + bool validRandomFactorForceVal; + uint8_t randomFactorForceVal; + /** + * 1 byte quantity which forces the HC for all transmitted Sync and + * Discovery Beacon NO matter the real HC being received over the + * air. + */ + bool validHopCountForceVal; + uint8_t hopCountForceVal; +}; + +/** + * Beacon Sdf Payload Structure + * The Discovery Engine can be configured to publish vendor specific attributes as part of + * beacon or service discovery frame transmitted as part of this request.. + */ +struct NanBeaconSdfPayloadRequest { + /** + * VendorAttribute must have the Vendor Specific Attribute which the + * vendor wants to publish as part of Discovery or Sync or Service discovery frame + */ + NanTransmitVendorSpecificAttribute vsa; +}; + +/** + * Data Path Initiator requesting a data session. + */ +struct NanDataPathInitiatorRequest { + /** + * Unique Instance Id identifying the Responder's service. + * This is same as publish_id notified on the subscribe side + * in a publish/subscribe scenario + */ + uint32_t serviceInstanceId; + /** + * Config flag for channel request. + */ + NanDataPathChannelCfg channelRequestType; + /** + * Channel frequency in MHz to start data-path. + */ + WifiChannelInMhz channel; + /** + * Discovery MAC addr of the publisher/peer. + */ + MacAddress peerDiscMacAddr; + /** + * Interface name on which this NDP session is to be started. + * This must be the same interface name provided during interface + * create. + */ + string ndpIface; + /** + * Initiator/Responder Security/QoS configuration. + */ + NanDataPathCfg ndpCfg; + /** + * App/Service information of the Initiator. + */ + NanDataPathAppInfo appInfo; +}; + +/** + * Data struct Nanto initiate a data response on the responder side + * for an indication received with a data request. + */ +struct NanDataPathIndicationResponse { + /** + * Unique token Id generated on the initiator/responder + * side used for a NDP session between two NAN devices. + */ + NanDataPathId ndpInstanceId; + /** + * Interface name on which this NDP session is to be started. + * This must be the same interface name provided during interface + * create. + */ + string ndpIface; + /** + * Initiator/Responder Security/QoS configuration. + */ + NanDataPathCfg ndpCfg; + /** + * App/Service information of the responder. + */ + NanDataPathAppInfo appInfo; + /** + * Response Code indicating ACCEPT/REJECT/DEFER + */ + NanDataPathResponseCode rspCode; +}; + +/** + * NDP termination info. + */ +struct NanDataPathEndRequest { + uint8_t numNdpInstances; + /** + * Unique token Id generated on the initiator/responder side + * used for a NDP session between two NAN devices + */ + vec ndpInstanceIds; +}; + +/** + * Definition of various ResponseType + */ +enum NanResponseType : uint32_t { + ENABLED = 0, + DISABLED = 1, + PUBLISH = 2, + PUBLISH_CANCEL = 3, + TRANSMIT_FOLLOWUP = 4, + SUBSCRIBE = 5, + SUBSCRIBE_CANCEL = 6, + CONFIG = 8, + ERROR = 10, + BEACON_SDF_PAYLOAD = 11, + GET_CAPABILITIES = 12, + DP_INTERFACE_CREATE = 13, + DP_INTERFACE_DELETE = 14, + DP_INITIATOR_RESPONSE = 15, + DP_RESPONDER_RESPONSE = 16, + DP_END = 17, +}; + +/** + * Various NAN Protocol Response code + */ +enum NanStatusType : uint32_t { + /* NAN Protocol Response Codes */ + SUCCESS = 0, + TIMEOUT = 1, + DE_FAILURE = 2, + INVALID_MSG_VERSION = 3, + INVALID_MSG_LEN = 4, + INVALID_MSG_ID = 5, + INVALID_HANDLE = 6, + NO_SPACE_AVAILABLE = 7, + INVALID_PUBLISH_TYPE = 8, + INVALID_TX_TYPE = 9, + INVALID_MATCH_ALGORITHM = 10, + DISABLE_IN_PROGRESS = 11, + INVALID_TLV_LEN = 12, + INVALID_TLV_TYPE = 13, + MISSING_TLV_TYPE = 14, + INVALID_TOTAL_TLVS_LEN = 15, + INVALID_MATCH_HANDLE = 16, + INVALID_TLV_VALUE = 17, + INVALID_TX_PRIORITY = 18, + INVALID_CONNECTION_MAP = 19, + NOT_ALLOWED = 22, + NO_OTA_ACK = 23, + TX_FAIL = 24, + ALREADY_ENABLED = 25, + FOLLOWUP_QUEUE_FULL = 26, + + /* NAN Configuration Response codes */ + INVALID_RSSI_CLOSE_VALUE = 4096, + INVALID_RSSI_MIDDLE_VALUE = 4097, + INVALID_HOP_COUNT_LIMIT = 4098, + INVALID_MASTER_PREFERENCE_VALUE = 4099, + INVALID_LOW_CLUSTER_ID_VALUE = 4100, + INVALID_HIGH_CLUSTER_ID_VALUE = 4101, + INVALID_BACKGROUND_SCAN_PERIOD = 4102, + INVALID_RSSI_PROXIMITY_VALUE = 4103, + INVALID_SCAN_CHANNEL = 4104, + INVALID_POST_CONNECTIVITY_CAPABILITIES_BITMAP = 4105, + INVALID_FURTHER_AVAILABILITY_MAP_NUMCHAN_VALUE = 4106, + INVALID_FURTHER_AVAILABILITY_MAP_DURATION_VALUE = 4107, + INVALID_FURTHER_AVAILABILITY_MAP_CLASS_VALUE = 4108, + INVALID_FURTHER_AVAILABILITY_MAP_CHANNEL_VALUE = 4109, + INVALID_FURTHER_AVAILABILITY_MAP_AVAILABILITY_INTERVAL_BITMAP_VALUE = 4110, + INVALID_FURTHER_AVAILABILITY_MAP_MAP_ID = 4111, + INVALID_POST_DISCOVERY_CONN_TYPE_VALUE = 4112, + INVALID_POST_DISCOVERY_DEVICE_ROLE_VALUE = 4113, + INVALID_POST_DISCOVERY_DURATION_VALUE = 4114, + INVALID_POST_DISCOVERY_BITMAP_VALUE = 4115, + MISSING_FUTHER_AVAILABILITY_MAP = 4116, + INVALID_BAND_CONFIG_FLAGS = 4117, + INVALID_RANDOM_FACTOR_UPDATE_TIME_VALUE = 4118, + INVALID_ONGOING_SCAN_PERIOD = 4119, + INVALID_DW_INTERVAL_VALUE = 4120, + INVALID_DB_INTERVAL_VALUE = 4121, + + /* 4122-8191 RESERVED */ + TERMINATED_REASON_INVALID = 8192, + TERMINATED_REASON_TIMEOUT = 8193, + TERMINATED_REASON_USER_REQUEST = 8194, + TERMINATED_REASON_FAILURE = 8195, + TERMINATED_REASON_COUNT_REACHED = 8196, + TERMINATED_REASON_DE_SHUTDOWN = 8197, + TERMINATED_REASON_DISABLE_IN_PROGRESS = 8198, + TERMINATED_REASON_POST_DISC_ATTR_EXPIRED = 8199, + TERMINATED_REASON_POST_DISC_LEN_EXCEEDED = 8200, + TERMINATED_REASON_FURTHER_AVAIL_MAP_EMPTY = 8201, + + /* 9000-9500 NDP Status type */ + NDP_UNSUPPORTED_CONCURRENCY = 9000, + NDP_DATA_IFACE_CREATE_FAILED = 9001, + NDP_DATA_IFACE_DELETE_FAILED = 9002, + NDP_DATA_INITIATOR_REQUEST_FAILED = 9003, + NDP_DATA_RESPONDER_REQUEST_FAILED = 9004, + NDP_INVALID_SERVICE_INSTANCE_ID = 9005, + NDP_INVALID_NDP_INSTANCE_ID = 9006, + NDP_INVALID_RESPONSE_CODE = 9007, + NDP_INVALID_APP_INFO_LEN = 9008, + + /* OTA failures and timeouts during negotiation */ + NDP_MGMT_FRAME_REQUEST_FAILED = 9009, + NDP_MGMT_FRAME_RESPONSE_FAILED = 9010, + NDP_MGMT_FRAME_CONFIRM_FAILED = 9011, + NDP_END_FAILED = 9012, + NDP_MGMT_FRAME_END_REQUEST_FAILED = 9013, + + /* 9500 onwards vendor specific error codes */ + NDP_VENDOR_SPECIFIC_ERROR = 9500, +}; + +/** + * Publish Response Message structure. + */ +struct NanPublishResponse { + uint16_t publishId; +}; + +/** + * Subscribe Response Message structure. + */ +struct NanSubscribeResponse { + uint16_t subscribeId; +}; + +/** + * Response returned for Initiators Data request. + */ +struct NanDataPathRequestResponse { + /** + * Unique token Id generated on the initiator + * side used for a NDP session between two NAN devices + */ + NanDataPathId ndpInstanceId; +}; + +/** + * NDP Capabilites info. + */ +struct NanCapabilities { + uint32_t maxConcurrentClusters; + uint32_t maxPublishes; + uint32_t maxSubscribes; + uint32_t maxServiceNameLen; + uint32_t maxMatchFilterLen; + uint32_t maxTotalMatchFilterLen; + uint32_t maxServiceSpecificInfoLen; + uint32_t maxVsaDataLen; + uint32_t maxMeshDataLen; + uint32_t maxNdiInterfaces; + uint32_t maxNdpSessions; + uint32_t maxAppInfoLen; + uint32_t maxQueuedTransmitFollowupMsgs; +}; + +/** + * NAN Response Message body. + */ +union NanResponseMsgBody { + NanPublishResponse publishResponse; + NanSubscribeResponse subscribeResponse; + NanDataPathRequestResponse dataRequestResponse; + NanCapabilities nanCapabilities; +}; + +/** + * NAN Response Messages. + */ +struct NanResponseMsg { + /** + * Contains the result code. + */ + NanStatusType status; + /** + * For error returns the value is returned which was in error. + */ + uint32_t value; + /** + * ResponseType Definitions. + */ + NanResponseType responseType; + NanResponseMsgBody body; +}; + +/** + * Publish Terminated Message structure. + * The PublishTerminatedInd message is sent by the DE whenever a Publish + * terminates from a user-specified timeout or a unrecoverable error in the DE. + */ +struct NanPublishTerminatedInd { + /** + * Id returned during the initial Publish. + */ + uint16_t publishId; + NanStatusType reason; +}; + +/** + * Match Indication Message structure. + * The MatchInd message is sent once per responding MAC address whenever + * the Discovery Engine detects a match for a previous SubscribeServiceReq + * or PublishServiceReq. + */ +struct NanMatchInd { + /** + * Publish or Subscribe Id of an earlier Publish/Subscribe. + */ + uint16_t publishSubscribeId; + /** + * A 32 bit Requestor Instance Id which is sent to the Application. + * This Id must be sent in any subsequent UnmatchInd/FollowupInd + * messages. + */ + uint32_t requestorInstanceId; + MacAddress addr; + /** + * Sequence of octets which were received in a Discovery Frame matching the + * Subscribe Request. + * Max length: |MAX_SERVICE_SPECIFIC_INFO_LEN|. + */ + vec serviceSpecificInfo; + /** + * Ordered sequence of pairs received in the Discovery Frame + * matching the Subscribe Request. + * Max length: |MAX_MATCH_FILTER_LEN|. + */ + vec sdfMatchFilter; + /** + * Flag to indicate if the Match occurred in a Beacon Frame or in a + * Service Discovery Frame. + */ + bool matchOccuredFlag; + /** + * Flag to indicate FW is out of resource and that it can no longer + * track this Service Name. The Host still need to send the received + * Match_Handle but duplicate MatchInd messages may be received on + * this Handle until the resource frees up. + */ + bool outOfResourceFlag; + /** + * If RSSI filtering was configured in SubscribeRequest then this + * field must contain the received RSSI value. 0 if not. + * All rssi values must be specified without sign. + * For eg: -70dBm must be specified as 70. + */ + uint8_t rssiValue; +}; + +/** + * MatchExpired Indication Message structure. + * The MatchExpiredInd message is sent whenever the Discovery Engine detects that + * a previously Matched Service has been gone for too long. If the previous + * MatchInd message for this Publish/Subscribe Id had the out_of_resource_flag + * set then this message must not be received + */ +struct NanMatchExpiredInd { + /** + * Publish or Subscribe Id of an earlier Publish/Subscribe. + */ + uint16_t publishSubscribeId; + /** + * 32 bit value sent by the DE in a previous + * MatchInd/FollowupInd to the application. + */ + uint32_t requestorInstanceId; +}; + +/** + * Subscribe Terminated Message structure. + * The SubscribeTerminatedInd message is sent by the DE whenever a + * Subscribe terminates from a user-specified timeout or a unrecoverable error in the DE. + */ +struct NanSubscribeTerminatedInd { + /** + * Id returned during initial Subscribe. + */ + uint16_t subscribeId; + NanStatusType reason; +}; + +/** + * Followup Indication Message structure. + * The FollowupInd message is sent by the DE to the Host whenever it receives a + * Followup message from another peer. + */ +struct NanFollowupInd { + /** + * Publish or Subscribe Id of an earlier Publish/Subscribe. + */ + uint16_t publishSubscribeId; + /** + * A 32 bit Requestor instance Id which is sent to the Application. + * This Id must be used in subsequent UnmatchInd/FollowupInd messages. + */ + uint32_t requestorInstanceId; + MacAddress addr; + /** + * Flag which the DE uses to decide if received in a DW or a FAW + * 0= send in a DW, 1=send in FAW. + */ + NanTransmitWindowType dwOrFaw; + /** + * Sequence of values which further specify the published service beyond + * the service name + * Max length: |MAX_SERVICE_SPECIFIC_INFO_LEN|. + */ + vec serviceSpecificInfo; +}; + +/** + * NAN Protocol Event ID Codes. + */ +enum NanDiscEngEventType : uint32_t { + /** + * Event data notifying the Mac address of the Discovery engine. + * which is reported as one of the Discovery engine event + */ + DISC_MAC_ADDR = 0, + /** + * Event data notifying the Cluster address of the cluster + * which is reported as one of the Discovery engine events. + */ + STARTED_CLUSTER, + JOINED_CLUSTER, +}; + +/** + * Discovery Engine Event Indication Message structure. + * The Discovery Engine can inform the Host when significant events occur + * The data following the EventId is dependent upon the EventId type. + * In other words, each new event defined must carry a different + * structure of information back to the host. + */ +struct NanDiscEngEventInd { + /** + * NAN Protocol Event Codes. + */ + NanDiscEngEventType eventType; + /** + * Mac Address associated with the corresponding event. + */ + MacAddress addr; +}; + +/** + * NAN Disabled Indication Message structure. + * The DisableInd message indicates to the upper layers that the Discovery + * Engine has flushed all state and has been shutdown. When this message is + * received the DE is guaranteed to have left the NAN cluster it was part of + * and must have terminated any in progress Publishes or Subscribes. + */ +struct NanDisabledInd { + NanStatusType reason; +}; + +/** + * Mask to determine on which frames attribute was received. + */ +enum NanVsaRxFrameMask: uint32_t { + DISCOVERY_BEACON_MASK = 1 << 0, + SYNC_BEACON_MASK = 1 << 1, + SERVICE_DISCOVERY_MASK = 1 << 2 +}; + +struct NanReceiveVendorSpecificAttribute { + /** + * Frames on which this vendor specific attribute + * was received. Mask |NanVsaRxFrameMask| defined above. + */ + uint8_t vsaReceivedOn; + /** + * Organizationally Unique Identifier. + */ + uint32_t vendorOui; + /** + * Vendor specific attribute. + * Max length: |MAX_VSA_DATA_LEN|. + */ + vec vsa; +}; + +/** + * NAN Beacon SDF Payload Received Message structure. + * Discovery engine sends the details of received Beacon or + * Service Discovery Frames as part of this structure. + */ +struct NanBeaconSdfPayloadReceive { + /** + * Frame data. + * Max length: |MAX_FRAME_DATA_LEN|. + */ + vec frameData; +}; + +/** + * NAN Beacon or SDF Payload Indication Message structure. + * The BeaconSdfPayloadInd message indicates to the upper layers that information + * elements were received either in a Beacon or SDF which needs to be delivered + * outside of a Publish/Subscribe Handle. + */ +struct NanBeaconSdfPayloadInd { + /** + * The MAC address of the peer which sent the attributes. + */ + MacAddress addr; + /** + * NAN Receive Vendor Specific Attribute. + */ + bool isVsaReceived; + NanReceiveVendorSpecificAttribute vsa; + /** + * NAN Beacon or SDF Payload Received. + */ + bool isBeaconSdfPayloadReceived; + NanBeaconSdfPayloadReceive data; +}; + +/** + * NAN Data path request Indication Message structure. + * Event indication received on the responder side when a Nan Data request or + * NDP session is initiated on the Initiator side. + */ +struct NanDataPathRequestInd { + /** + * Unique Instance Id corresponding to a service/session. + * This is similar to the publish_id generated on the + * publisher side. + */ + uint16_t serviceInstanceId; + /** + * Discovery MAC addr of the peer/initiator. + */ + MacAddress peerDiscMacAddr; + /** + * Unique token Id generated on the initiator/responder side + * used for a NDP session between two NAN devices. + */ + NanDataPathId ndpInstanceId; + /** + * Initiator/Responder Security/QoS configuration. + */ + NanDataPathCfg ndpCfg; + /** + * App/Service information of the initiator. + */ + NanDataPathAppInfo appInfo; +}; + +/** + * NAN Data path confirmation Indication Message structure. + * Event indication of data confirm is received on both + * initiator and responder side confirming a NDP session. + */ +struct NanDataPathConfirmInd { + /** + * Unique token Id generated on the initiator/responder side + * used for a NDP session between two NAN devices + */ + NanDataPathId ndpInstanceId; + /** + * NDI mac address of the peer. + * (required to derive target ipv6 address) + */ + MacAddress peerNdiMacAddr; + /** + * App/Service information of Initiator/Responder. + */ + NanDataPathAppInfo appInfo; + /** + * Response code indicating ACCEPT/REJECT/DEFER. + */ + NanDataPathResponseCode rspCode; + /** + * Reason code indicating the cause for REJECT. + */ + NanStatusType reasonCode; +}; + +/** + * NAN Data path end Indication Message structure. + * Event indication received on the initiator/responder side terminating + * a NDP session + */ +struct NanDataPathEndInd { + /** + * Unique token Id generated on the initiator/responder side + * used for a NDP session between two NAN devices + */ + vec ndpInstanceIds; +}; + +/** + * NAN Transmit followup Indication Message structure. + * Event Indication notifying the transmit followup in progress. + */ +struct NanTransmitFollowupInd { + CommandId cmdId; + NanStatusType reason; +}; + From 18eec81adc49e363a97e6cd9b95c004d7b62ec6d Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Fri, 14 Oct 2016 11:29:30 -0700 Subject: [PATCH 06/24] wifi(interface): Rtt controller HIDL interface Bug: 31991232 Test: ./hardware/interfaces/update-makefiles.sh Change-Id: I53b95e85ee8a71bcb0494420913c9511f87908c0 --- wifi/1.0/Android.bp | 8 + wifi/1.0/Android.mk | 756 +++++++++++++++++++ wifi/1.0/IWifiRttController.hal | 209 ++++- wifi/1.0/IWifiRttControllerEventCallback.hal | 30 + wifi/1.0/IWifiStaIface.hal | 4 +- wifi/1.0/IWifiStaIfaceEventCallback.hal | 15 +- wifi/1.0/types.hal | 575 ++++++++++++++ 7 files changed, 1581 insertions(+), 16 deletions(-) create mode 100644 wifi/1.0/IWifiRttControllerEventCallback.hal diff --git a/wifi/1.0/Android.bp b/wifi/1.0/Android.bp index 40521f20c0..da9210c380 100644 --- a/wifi/1.0/Android.bp +++ b/wifi/1.0/Android.bp @@ -16,6 +16,7 @@ genrule { "IWifiNanIfaceEventCallback.hal", "IWifiP2pIface.hal", "IWifiRttController.hal", + "IWifiRttControllerEventCallback.hal", "IWifiStaIface.hal", "IWifiStaIfaceEventCallback.hal", ], @@ -31,6 +32,7 @@ genrule { "android/hardware/wifi/1.0/WifiNanIfaceEventCallbackAll.cpp", "android/hardware/wifi/1.0/WifiP2pIfaceAll.cpp", "android/hardware/wifi/1.0/WifiRttControllerAll.cpp", + "android/hardware/wifi/1.0/WifiRttControllerEventCallbackAll.cpp", "android/hardware/wifi/1.0/WifiStaIfaceAll.cpp", "android/hardware/wifi/1.0/WifiStaIfaceEventCallbackAll.cpp", ], @@ -52,6 +54,7 @@ genrule { "IWifiNanIfaceEventCallback.hal", "IWifiP2pIface.hal", "IWifiRttController.hal", + "IWifiRttControllerEventCallback.hal", "IWifiStaIface.hal", "IWifiStaIfaceEventCallback.hal", ], @@ -107,6 +110,11 @@ genrule { "android/hardware/wifi/1.0/BnWifiRttController.h", "android/hardware/wifi/1.0/BpWifiRttController.h", "android/hardware/wifi/1.0/BsWifiRttController.h", + "android/hardware/wifi/1.0/IWifiRttControllerEventCallback.h", + "android/hardware/wifi/1.0/IHwWifiRttControllerEventCallback.h", + "android/hardware/wifi/1.0/BnWifiRttControllerEventCallback.h", + "android/hardware/wifi/1.0/BpWifiRttControllerEventCallback.h", + "android/hardware/wifi/1.0/BsWifiRttControllerEventCallback.h", "android/hardware/wifi/1.0/IWifiStaIface.h", "android/hardware/wifi/1.0/IHwWifiStaIface.h", "android/hardware/wifi/1.0/BnWifiStaIface.h", diff --git a/wifi/1.0/Android.mk b/wifi/1.0/Android.mk index 3ae6affa70..9c731546ac 100644 --- a/wifi/1.0/Android.mk +++ b/wifi/1.0/Android.mk @@ -12,6 +12,40 @@ intermediates := $(local-generated-sources-dir) HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX) +# +# Build types.hal (ChannelInfo) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/ChannelInfo.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.ChannelInfo + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (ChannelWidth) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/ChannelWidth.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.ChannelWidth + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + # # Build types.hal (IfaceType) # @@ -29,6 +63,23 @@ $(GEN): $(LOCAL_PATH)/types.hal $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) +# +# Build types.hal (InformationElement) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/InformationElement.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.InformationElement + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + # # Build types.hal (NanAvailDuration) # @@ -1134,6 +1185,312 @@ $(GEN): $(LOCAL_PATH)/types.hal $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) +# +# Build types.hal (RateInfo) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/RateInfo.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.RateInfo + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (RttBw) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/RttBw.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.RttBw + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (RttCapabilities) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/RttCapabilities.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.RttCapabilities + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (RttChannelMap) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/RttChannelMap.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.RttChannelMap + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (RttConfig) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/RttConfig.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.RttConfig + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (RttConstants) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/RttConstants.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.RttConstants + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (RttDebugFormat) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/RttDebugFormat.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.RttDebugFormat + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (RttDebugInfo) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/RttDebugInfo.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.RttDebugInfo + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (RttDebugType) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/RttDebugType.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.RttDebugType + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (RttLciInformation) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/RttLciInformation.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.RttLciInformation + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (RttLcrInformation) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/RttLcrInformation.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.RttLcrInformation + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (RttMotionPattern) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/RttMotionPattern.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.RttMotionPattern + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (RttPeerType) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/RttPeerType.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.RttPeerType + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (RttPreamble) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/RttPreamble.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.RttPreamble + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (RttResponder) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/RttResponder.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.RttResponder + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (RttResult) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/RttResult.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.RttResult + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (RttStatus) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/RttStatus.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.RttStatus + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (RttType) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/RttType.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.RttType + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + # # Build types.hal (WifiStatus) # @@ -1370,6 +1727,8 @@ $(GEN): PRIVATE_HIDL := $(HIDL) $(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IWifiRttController.hal $(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IWifiIface.hal $(GEN): $(LOCAL_PATH)/IWifiIface.hal +$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IWifiRttControllerEventCallback.hal +$(GEN): $(LOCAL_PATH)/IWifiRttControllerEventCallback.hal $(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal $(GEN): $(LOCAL_PATH)/types.hal $(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) @@ -1382,6 +1741,25 @@ $(GEN): $(LOCAL_PATH)/IWifiRttController.hal $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) +# +# Build IWifiRttControllerEventCallback.hal +# +GEN := $(intermediates)/android/hardware/wifi/1.0/IWifiRttControllerEventCallback.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IWifiRttControllerEventCallback.hal +$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal +$(GEN): $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::IWifiRttControllerEventCallback + +$(GEN): $(LOCAL_PATH)/IWifiRttControllerEventCallback.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + # # Build IWifiStaIface.hal # @@ -1436,6 +1814,40 @@ intermediates := $(local-generated-sources-dir) HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX) +# +# Build types.hal (ChannelInfo) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/ChannelInfo.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.ChannelInfo + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (ChannelWidth) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/ChannelWidth.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.ChannelWidth + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + # # Build types.hal (IfaceType) # @@ -1453,6 +1865,23 @@ $(GEN): $(LOCAL_PATH)/types.hal $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) +# +# Build types.hal (InformationElement) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/InformationElement.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.InformationElement + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + # # Build types.hal (NanAvailDuration) # @@ -2558,6 +2987,312 @@ $(GEN): $(LOCAL_PATH)/types.hal $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) +# +# Build types.hal (RateInfo) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/RateInfo.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.RateInfo + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (RttBw) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/RttBw.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.RttBw + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (RttCapabilities) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/RttCapabilities.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.RttCapabilities + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (RttChannelMap) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/RttChannelMap.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.RttChannelMap + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (RttConfig) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/RttConfig.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.RttConfig + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (RttConstants) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/RttConstants.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.RttConstants + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (RttDebugFormat) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/RttDebugFormat.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.RttDebugFormat + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (RttDebugInfo) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/RttDebugInfo.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.RttDebugInfo + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (RttDebugType) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/RttDebugType.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.RttDebugType + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (RttLciInformation) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/RttLciInformation.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.RttLciInformation + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (RttLcrInformation) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/RttLcrInformation.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.RttLcrInformation + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (RttMotionPattern) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/RttMotionPattern.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.RttMotionPattern + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (RttPeerType) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/RttPeerType.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.RttPeerType + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (RttPreamble) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/RttPreamble.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.RttPreamble + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (RttResponder) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/RttResponder.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.RttResponder + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (RttResult) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/RttResult.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.RttResult + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (RttStatus) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/RttStatus.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.RttStatus + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (RttType) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/RttType.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.RttType + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + # # Build types.hal (WifiStatus) # @@ -2794,6 +3529,8 @@ $(GEN): PRIVATE_HIDL := $(HIDL) $(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IWifiRttController.hal $(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IWifiIface.hal $(GEN): $(LOCAL_PATH)/IWifiIface.hal +$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IWifiRttControllerEventCallback.hal +$(GEN): $(LOCAL_PATH)/IWifiRttControllerEventCallback.hal $(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal $(GEN): $(LOCAL_PATH)/types.hal $(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) @@ -2806,6 +3543,25 @@ $(GEN): $(LOCAL_PATH)/IWifiRttController.hal $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) +# +# Build IWifiRttControllerEventCallback.hal +# +GEN := $(intermediates)/android/hardware/wifi/1.0/IWifiRttControllerEventCallback.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IWifiRttControllerEventCallback.hal +$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal +$(GEN): $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::IWifiRttControllerEventCallback + +$(GEN): $(LOCAL_PATH)/IWifiRttControllerEventCallback.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + # # Build IWifiStaIface.hal # diff --git a/wifi/1.0/IWifiRttController.hal b/wifi/1.0/IWifiRttController.hal index a0e8b12219..93b3d92561 100644 --- a/wifi/1.0/IWifiRttController.hal +++ b/wifi/1.0/IWifiRttController.hal @@ -17,13 +17,14 @@ package android.hardware.wifi@1.0; import IWifiIface; +import IWifiRttControllerEventCallback; /** - * Interface used to perform RTT operations. + * Interface used to perform RTT(Round trip time) operations. */ interface IWifiRttController { /** - * Get the iface on which the RTT operations will be performed. + * Get the iface on which the RTT operations must be performed. * * @return status WifiStatus of the operation. * Possible status codes: @@ -33,4 +34,208 @@ interface IWifiRttController { * to a specific iface, null otherwise */ getBoundIface() generates (WifiStatus status, IWifiIface boundIface); + + /** + * Requests notifications of significant events on this rtt controller. + * Multiple calls to this must register multiple callbacks each of which must + * receive all events. + * + * @param callback An instance of the |IWifiRttControllerEventCallback| HIDL + * interface object. + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID| + */ + registerEventCallback(IWifiRttControllerEventCallback callback) + generates (WifiStatus status); + + /** + * API to request RTT measurement. + * + * @param cmdId command Id to use for this invocation. + * @param rttConfigs Vector of |RttConfig| parameters. + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_RTT_CONTROLLER_INVALID|, + * |WifiStatusCode.ERROR_INVALID_ARGS|, + * |WifiStatusCode.ERROR_NOT_AVAILABLE|, + * |WifiStatusCode.ERROR_UNKNOWN| + */ + rangeRequest(CommandId cmdId, vec rttConfigs) + generates (WifiStatus status); + + /** + * API to cancel RTT measurements. + * + * @param cmdId command Id corresponding to the original request. + * @param addrs Vector of addresses for which to cancel. + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_RTT_CONTROLLER_INVALID|, + * |WifiStatusCode.ERROR_INVALID_ARGS|, + * |WifiStatusCode.ERROR_NOT_AVAILABLE|, + * |WifiStatusCode.ERROR_UNKNOWN| + */ + rangeCancel(CommandId cmdId, vec addrs) + generates (WifiStatus status); + + /** + * API to start publishing the channel map on responder device in an NBD + * cluster. + * Responder device must take this request and schedule broadcasting the + * channel map in a NBD ranging attribute in a Service Discovery Frame. + * DE must automatically remove the ranging attribute from the OTA queue + * after number of Discovery Window specified by numDw where each + * Discovery Window is 512 TUs apart. + * + * @param cmdId command Id to use for this invocation. + * @param params Instance of |RttChannelMap|. + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_RTT_CONTROLLER_INVALID|, + * |WifiStatusCode.ERROR_INVALID_ARGS|, + * |WifiStatusCode.ERROR_NOT_AVAILABLE|, + * |WifiStatusCode.ERROR_UNKNOWN| + */ + setChannelMap(CommandId cmdId, RttChannelMap params, uint32_t numDw) + generates (WifiStatus status); + + /** + * API to clear the channel map on the responder device in an NBD cluster. + * Responder device must cancel future ranging channel request, starting from + * next Discovery Window interval and must also stop broadcasting NBD + * ranging attribute in Service Discovery Frame. + * + * @param cmdId command Id corresponding to the original request. + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_RTT_CONTROLLER_INVALID|, + * |WifiStatusCode.ERROR_INVALID_ARGS|, + * |WifiStatusCode.ERROR_NOT_AVAILABLE|, + * |WifiStatusCode.ERROR_UNKNOWN| + */ + clearChannelMap(CommandId cmdId) generates (WifiStatus status); + + /** + * RTT capabilities of the device. + * + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_RTT_CONTROLLER_INVALID|, + * |WifiStatusCode.ERROR_UNKNOWN| + * @return capabilities Instance of |RttCapabilities|. + */ + getCapabilities() generates (WifiStatus status, RttCapabilities capabilities); + + /** + * Set configuration for debug. + * + * @param type debug level to be set. + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_RTT_CONTROLLER_INVALID|, + * |WifiStatusCode.ERROR_INVALID_ARGS|, + * |WifiStatusCode.ERROR_NOT_AVAILABLE|, + * |WifiStatusCode.ERROR_UNKNOWN| + */ + setDebugCfg(RttDebugType Type) generates (WifiStatus status); + + /** + * Get the debug information. + * + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.ERROR_WIFI_RTT_CONTROLLER_INVALID|, + * |WifiStatusCode.ERROR_NOT_AVAILABLE|, + * |WifiStatusCode.ERROR_UNKNOWN| + * @return info Instance of |RttDebugInfo|. + */ + getDebugInfo() generates (WifiStatus status, RttDebugInfo info); + + /** + * API to configure the LCI(Location civic information). + * Used in RTT Responder mode only. + * + * @param cmdId command Id to use for this invocation. + * @param lci Instance of |RttLciInformation|. + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_RTT_CONTROLLER_INVALID|, + * |WifiStatusCode.ERROR_INVALID_ARGS|, + * |WifiStatusCode.ERROR_NOT_AVAILABLE|, + * |WifiStatusCode.ERROR_UNKNOWN| + */ + setLci(CommandId cmdId, RttLciInformation lci) generates (WifiStatus status); + + /** + * API to configure the LCR(Location civic records). + * Used in RTT Responder mode only. + * + * @param cmdId command Id to use for this invocation. + * @param lcr Instance of |RttLcrInformation|. + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_RTT_CONTROLLER_INVALID|, + * |WifiStatusCode.ERROR_INVALID_ARGS|, + * |WifiStatusCode.ERROR_NOT_AVAILABLE|, + * |WifiStatusCode.ERROR_UNKNOWN| + */ + setLcr(CommandId cmdId, RttLcrInformation lcr) generates (WifiStatus status); + + /** + * Get RTT responder information e.g. WiFi channel to enable responder on. + * + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_RTT_CONTROLLER_INVALID|, + * |WifiStatusCode.ERROR_NOT_AVAILABLE|, + * |WifiStatusCode.ERROR_UNKNOWN| + * @return info Instance of |RttResponderInfo|. + */ + getResponderInfo() generates (WifiStatus status, RttResponder info); + + /** + * Enable RTT responder mode. + * + * @param cmdId command Id to use for this invocation. + * @parm channelHint Hint of the channel information where RTT responder must + * be enabled on. + * @param maxDurationInSeconds Timeout of responder mode. + * @param info Instance of |RttResponderInfo|. + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_RTT_CONTROLLER_INVALID|, + * |WifiStatusCode.ERROR_INVALID_ARGS|, + * |WifiStatusCode.ERROR_NOT_AVAILABLE|, + * |WifiStatusCode.ERROR_UNKNOWN| + */ + enableResponder(CommandId cmdId, + WifiChannelInfo channelHint, + uint32_t maxDurationSeconds, + RttResponder info) + generates (WifiStatus status); + + /** + * Disable RTT responder mode. + * + * @param cmdId command Id corresponding to the original request. + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_RTT_CONTROLLER_INVALID|, + * |WifiStatusCode.ERROR_NOT_AVAILABLE|, + * |WifiStatusCode.ERROR_UNKNOWN| + */ + disableResponder(CommandId cmdId) generates (WifiStatus status); }; diff --git a/wifi/1.0/IWifiRttControllerEventCallback.hal b/wifi/1.0/IWifiRttControllerEventCallback.hal new file mode 100644 index 0000000000..e23e395f30 --- /dev/null +++ b/wifi/1.0/IWifiRttControllerEventCallback.hal @@ -0,0 +1,30 @@ +/* + * Copyright 2016 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.wifi@1.0; + +/** + * RTT Response and Event Callbacks. + */ +interface IWifiRttControllerEventCallback { + /** + * Invoked when an RTT result is available. + * + * @param cmdId command Id corresponding to the original request. + * @param results Vector of |RttResult| instances. + */ + oneway onResults(CommandId cmdId, vec results); +}; diff --git a/wifi/1.0/IWifiStaIface.hal b/wifi/1.0/IWifiStaIface.hal index 8f45777fd1..5cf1413f94 100644 --- a/wifi/1.0/IWifiStaIface.hal +++ b/wifi/1.0/IWifiStaIface.hal @@ -295,11 +295,11 @@ interface IWifiStaIface extends IWifiIface { LinkLayerIfaceStats iface; LinkLayerRadioStats radio; /** - * Timestamp for each stats sample. + * TimeStamp for each stats sample. * This is the absolute milliseconds from boot when these stats were * sampled. */ - uint32_t timeStampInMs; + TimeStampInMs timeStampInMs; }; /** diff --git a/wifi/1.0/IWifiStaIfaceEventCallback.hal b/wifi/1.0/IWifiStaIfaceEventCallback.hal index 129c258104..6bffc7d7d5 100644 --- a/wifi/1.0/IWifiStaIfaceEventCallback.hal +++ b/wifi/1.0/IWifiStaIfaceEventCallback.hal @@ -17,28 +17,19 @@ package android.hardware.wifi@1.0; interface IWifiStaIfaceEventCallback { - /** - * Information elements contained within the |ScanResult| structure. - * These elements correspond to the IEEE_802.11 standard. - */ - struct InformationElement { - uint8_t id; - vec data; - }; - /** * Structure describing all the information about a single access point seen * during the scan. */ struct ScanResult { - int64_t timeStampInUs; + TimeStampInUs timeStampInUs; vec ssid; Bssid bssid; - int8_t rssi; + Rssi rssi; WifiChannelInMhz frequency; uint16_t beaconPeriodInMs; uint16_t capability; - vec informationElements; + vec informationElements; }; /** diff --git a/wifi/1.0/types.hal b/wifi/1.0/types.hal index a7ecf7eea3..65c39f734e 100644 --- a/wifi/1.0/types.hal +++ b/wifi/1.0/types.hal @@ -82,6 +82,47 @@ typedef uint32_t CommandId; */ typedef uint32_t WifiChannelInMhz; +/** + * Channel operating width in Mhz. + */ +enum WifiChannelWidthInMhz : uint32_t { + WIDTH_20 = 0, + WIDTH_40 = 1, + WIDTH_80 = 2, + WIDTH_160 = 3, + WIDTH_80P80 = 4, + WIDTH_5 = 5, + WIDTH_10 = 6, + WIDTH_INVALID = -1 +}; + +/** + * Channel information. + */ +struct WifiChannelInfo { + /** + * Channel width (20, 40, 80, 80+80, 160). + */ + WifiChannelWidthInMhz width; + /** + * Primary 20 MHz channel. + */ + WifiChannelInMhz centerFreq; + /** + * Center frequency (MHz) first segment. + */ + WifiChannelInMhz centerFreq0; + /** + * Center frequency (MHz) second segment. + */ + WifiChannelInMhz centerFreq1; +}; + +/** + * RSSI information. + */ +typedef int32_t Rssi; + /** * Mac Address type. 6 octets representing physical address of a device. */ @@ -92,6 +133,75 @@ typedef uint8_t[6] MacAddress; */ typedef MacAddress Bssid; +/** + * TimeStamp in milliseconds (ms). + */ +typedef uint32_t TimeStampInMs; + +/** + * TimeStamp in microseconds (us). + */ +typedef uint64_t TimeStampInUs; + +/** + * TimeStamp in picoseconds (ps). + */ +typedef uint64_t TimeSpanInPs; + +/** + * Information elements contained within the |ScanResult| structure. + * These elements correspond to the IEEE_802.11 standard. + */ +struct WifiInformationElement { + uint8_t id; + vec data; +}; + +enum WifiRatePreamble : uint32_t { + OFDM = 0, + CCK = 1, + HT = 2, + VHT = 3, + RESERVED = 4 +}; + +/** + * Number of spatial streams in VHT/HT. + */ +enum WifiRateNss : uint32_t { + NSS_1x1 = 0, + NSS_2x2 = 1, + NSS_3x3 = 2, + NSS_4x4 = 3 +}; + +/** + * Wifi rate info. + */ +struct WifiRateInfo { + /** + * Preamble used for RTT measurements. + */ + WifiRatePreamble preamble; + /** + * Number of spatial streams. + */ + WifiRateNss nss; + /** + * Bandwidth of channel. + */ + WifiChannelWidthInMhz bw; + /** + * OFDM/CCK rate code would be as per ieee std in the units of 0.5mbps. + * HT/VHT it would be mcs index. + */ + uint8_t rateMcsIdx; + /** + * Bitrate in units of 100 Kbps. + */ + uint32_t bitRateInKbps; +}; + /** * NAN specific types. * TODO(b/32159498): Move to a separate nan_types.hal. @@ -1457,3 +1567,468 @@ struct NanTransmitFollowupInd { NanStatusType reason; }; +/** + * RTT specific types. + * TODO(b/32159498): Move to a separate rtt_types.hal. + */ +/** + * Constants used in the RTT interface. + */ +enum RttConstants : uint32_t { + PREAMBLE_LEGACY = 0x1, + PREAMBLE_HT = 0x2, + PREAMBLE_VHT = 0x4, + BW_5_SUPPORT = 0x1, + BW_10_SUPPORT = 0x2, + BW_20_SUPPORT = 0x4, + BW_40_SUPPORT = 0x8, + BW_80_SUPPORT = 0x10, + BW_160_SUPPORT = 0x20, +}; + +/** + * Ranging status. + */ +enum RttStatus : uint32_t { + SUCCESS = 0, + /** General failure status */ + FAILURE = 1, + /** Target STA does not respond to request */ + FAIL_NO_RSP = 2, + /** Request rejected. Applies to 2-sided RTT only */ + FAIL_REJECTED = 3, + FAIL_NOT_SCHEDULED_YET = 4, + /** Timing measurement times out */ + FAIL_TM_TIMEOUT = 5, + /** Target on different channel, cannot range */ + FAIL_AP_ON_DIFF_CHANNEL = 6, + /** Ranging not supported */ + FAIL_NO_CAPABILITY = 7, + /** Request aborted for unknown reason */ + ABORTED = 8, + /** Invalid T1-T4 timestamp */ + FAIL_INVALID_TS = 9, + /** 11mc protocol failed */ + FAIL_PROTOCOL = 10, + /** Request could not be scheduled */ + FAIL_SCHEDULE = 11, + /** Responder cannot collaborate at time of request */ + FAIL_BUSY_TRY_LATER = 12, + /** Bad request args */ + INVALID_REQ = 13, + /** WiFi not enabled. */ + NO_WIFI = 14, + /** Responder overrides param info, cannot range with new params */ + FAIL_FTM_PARAM_OVERRIDE = 15, +}; + +/** + * RTT peer types. + */ +enum RttPeerType : uint32_t { + AP = 0x1, + STA = 0x2, + P2P_GO = 0x3, + P2P_CLIENT = 0x4, + NAN = 0x5, +}; + +/** + * RTT Measurement Bandwidth. + */ +enum RttBw : uint32_t { + BW_5MHZ = 0x01, + BW_10MHZ = 0x02, + BW_20MHZ = 0x04, + BW_40MHZ = 0x08, + BW_80MHZ = 0x10, + BW_160MHZ = 0x20, +}; + +/** + * RTT Measurement Preamble. + */ +enum RttPreamble : uint32_t { + LEGACY = 0x1, + HT = 0x2, + VHT = 0x4, +}; + +/** + * RTT Types. + */ +enum RttType : uint32_t { + ONE_SIDED = 0x1, + TWO_SIDED = 0x2, +}; + +/** + * RTT configuration. + */ +struct RttConfig { + /** + * Peer device mac address. + */ + MacAddress addr; + /** + * 1-sided or 2-sided RTT. + */ + RttType type; + /** + * Optional - peer device hint (STA, P2P, AP). + */ + RttPeerType peer; + /** + * Required for STA-AP mode, optional for P2P, NBD etc. + */ + WifiChannelInfo channel; + /** + * Time interval between bursts (units: 100 ms). + * Applies to 1-sided and 2-sided RTT multi-burst requests. + * Range: 0-31, 0: no preference by initiator (2-sided RTT). + */ + uint32_t burstPeriod; + /** + * Total number of RTT bursts to be executed. It will be + * specified in the same way as the parameter "Number of + * Burst Exponent" found in the FTM frame format. It + * applies to both: 1-sided RTT and 2-sided RTT. Valid + * values are 0 to 15 as defined in 802.11mc std. + * 0 means single shot + * The implication of this parameter on the maximum + * number of RTT results is the following: + * for 1-sided RTT: max num of RTT results = (2^num_burst)*(num_frames_per_burst) + * for 2-sided RTT: max num of RTT results = (2^num_burst)*(num_frames_per_burst - 1) + */ + uint32_t numBurst; + /** + * Num of frames per burst. + * Minimum value = 1, Maximum value = 31 + * For 2-sided this equals the number of FTM frames + * to be attempted in a single burst. This also + * equals the number of FTM frames that the + * initiator will request that the responder send + * in a single frame. + */ + uint32_t numFramesPerBurst; + /** + * Number of retries for a failed RTT frame. + * Applies to 1-sided RTT only. Minimum value = 0, Maximum value = 3 + */ + uint32_t numRetriesPerRttFrame; + /** Following fields are only valid for 2-side RTT. */ + /** + * Maximum number of retries that the initiator can + * retry an FTMR frame. + * Minimum value = 0, Maximum value = 3 + */ + uint32_t numRetriesPerFtmr; + /** + * Whether to request location civic info or not. + */ + bool mustRequestLci; + /** + * Whether to request location civic records or not. + */ + bool mustRequestLcr; + /** + * Applies to 1-sided and 2-sided RTT. Valid values will + * be 2-11 and 15 as specified by the 802.11mc std for + * the FTM parameter burst duration. In a multi-burst + * request, if responder overrides with larger value, + * the initiator will return failure. In a single-burst + * request if responder overrides with larger value, + * the initiator will sent TMR_STOP to terminate RTT + * at the end of the burst_duration it requested. + */ + uint32_t burstDuration; + /** + * RTT preamble to be used in the RTT frames. + */ + RttPreamble preamble; + /** + * RTT BW to be used in the RTT frames. + */ + RttBw bw; +}; + +/** + * RTT results. + */ +struct RttResult { + /** + * Peer device mac address. + */ + MacAddress addr; + /** + * Burst number in a multi-burst request. + */ + uint32_t burstNum; + /** + * Total RTT measurement frames attempted. + */ + uint32_t measurementNumber; + /** + * Total successful RTT measurement frames. + */ + uint32_t successNumber; + /** + * Maximum number of "FTM frames per burst" supported by + * the responder STA. Applies to 2-sided RTT only. + * If reponder overrides with larger value: + * - for single-burst request initiator will truncate the + * larger value and send a TMR_STOP after receiving as + * many frames as originally requested. + * - for multi-burst request, initiator will return + * failure right away. + */ + uint8_t numberPerBurstPeer; + /** + * Ranging status. + */ + RttStatus status; + /** + * When status == RTT_STATUS_FAIL_BUSY_TRY_LATER, + * this will be the time provided by the responder as to + * when the request can be tried again. Applies to 2-sided + * RTT only. In sec, 1-31sec. + */ + uint8_t retryAfterDuration; + /** + * RTT type. + */ + RttType type; + /** + * Average rssi in 0.5 dB steps e.g. 143 implies -71.5 dB. + */ + Rssi rssi; + /** + * Rssi spread in 0.5 dB steps e.g. 5 implies 2.5 dB spread (optional). + */ + Rssi rssiSpread; + /** + * 1-sided RTT: TX rate of RTT frame. + * 2-sided RTT: TX rate of initiator's Ack in response to FTM frame. + */ + WifiRateInfo txRate; + /** + * 1-sided RTT: TX rate of Ack from other side. + * 2-sided RTT: TX rate of FTM frame coming from responder. + */ + WifiRateInfo rxRate; + /** + * Round trip time in picoseconds + */ + TimeSpanInPs rtt; + /** + * Rtt standard deviation in picoseconds. + */ + TimeSpanInPs rttSd; + /** + * Difference between max and min rtt times recorded in picoseconds. + */ + TimeSpanInPs rttSpread; + /** + * Distance in mm (optional). + */ + int32_t distanceInMm; + /** + * Standard deviation in mm (optional). + */ + int32_t distanceSdInMm; + /** + * Difference between max and min distance recorded in mm (optional). + */ + int32_t distanceSpreadInMm; + /** + * Time of the measurement (in microseconds since boot). + */ + TimeStampInUs timeStampInUs; + /** + * in ms, actual time taken by the FW to finish one burst + * measurement. Applies to 1-sided and 2-sided RTT. + */ + uint32_t burstDurationInMs; + /** + * Number of bursts allowed by the responder. Applies + * to 2-sided RTT only. + */ + uint32_t negotiatedBurstNum; + /** + * for 11mc only. + */ + WifiInformationElement lci; + /** + * for 11mc only. + */ + WifiInformationElement lcr; +}; + +/** + * NBD ranging channel map. + */ +struct RttChannelMap { + WifiChannelInMhz[32] availablity; +}; + +/** + * RTT Capabilities. + */ +struct RttCapabilities { + /** + * if 1-sided rtt data collection is supported. + */ + bool rttOneSidedSupported; + /** + * if ftm rtt data collection is supported. + */ + bool rttFtmSupported; + /** + * if initiator supports LCI request. Applies to 2-sided RTT. + */ + bool lciSupported; + /** + * if initiator supports LCR request. Applies to 2-sided RTT. + */ + bool lcrSupported; + /** + * if 11mc responder mode is supported. + */ + bool responderSupported; + /** + * bit mask indicates what preamble is supported by initiator. + */ + uint8_t preambleSupport; + /** + * bit mask indicates what BW is supported by initiator. + */ + uint8_t bwSupport; + /** + * Draft 11mc spec version supported by chip. + * For instance, version 4.0 must be 40 and version 4.3 must be 43 etc. + */ + uint8_t mcVersion; +}; + +/** + * Debugging definitions. + */ +enum RttDebugType : uint32_t { + DISABLE, + LOG, + PROTO, + BURST, + ACCURACY, + LOGDETAIL, +}; + +enum RttDebugFormat : uint32_t { + TXT, + BINARY, +}; + +/** + * Debug info. + */ +struct RttDebugInfo { + /** + * Version info. + */ + uint32_t version; + /** + * Debug data type. + */ + RttDebugType type; + /** + * Debug data format. + */ + RttDebugFormat format; + /** + * Debug data content. + */ + vec data; +}; + +/** + * Structs for setting LCI/LCR information to be provided to a requestor. + */ +enum RttMotionPattern : uint32_t { + /** + * Not expected to change location. + */ + NOT_EXPECTED = 0, + /** + * Expected to change location. + */ + EXPECTED = 1, + /** + * Movement pattern unknown. + */ + UNKNOWN = 2, +}; + +/** + * Movement pattern unknown. + */ +struct RttLciInformation { + /** + * latitude in degrees * 2^25 , 2's complement. + */ + int64_t latitude; + /** + * longitude in degrees * 2^25 , 2's complement. + */ + int64_t longitude; + /** + * Altitude in units of 1/256 m. + */ + int32_t altitude; + /** + * As defined in Section 2.3.2 of IETF RFC 6225. + */ + uint8_t latitudeUnc; + /** + * As defined in Section 2.3.2 of IETF RFC 6225. + */ + uint8_t longitudeUnc; + /** + * As defined in Section 2.4.5 from IETF RFC 6225. + */ + uint8_t altitudeUnc; + /** Following element for configuring the Z subelement. */ + /** + * Motion pattern type. + */ + RttMotionPattern motionPattern; + /** + * Floor in units of 1/16th of floor. 0x80000000 if unknown. + */ + int32_t floor; + /** + * in units of 1/64 m. + */ + int32_t heightAboveFloor; + /** + * in units of 1/64 m. 0 if unknown + */ + int32_t heightUnc; +}; + +struct RttLcrInformation { + /** + * Country code symbol. + */ + int8_t[2] countryCode; + /** + * Civic info to be copied in FTM frame. + */ + string civicInfo; +}; + +/*** + * RTT Responder information + */ +struct RttResponder { + WifiChannelInfo channel; + RttPreamble preamble; +}; From e03f736ca003a0d2679ce15c1d0602ad67e43e93 Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Fri, 14 Oct 2016 14:53:43 -0700 Subject: [PATCH 07/24] wifi(interface): Fix compilation failure Changes in the CL: a) Unions are not allowed in the HIDL generated code that is going to be used in java. b) Few RTT constants were defined twice in the legacy rtt.h. One set as enums, the other set as #define's. Remove the duplicated values in the HIDL interface. Bug: 31991076 Bug: 31991232 Test: mmm -j32 hardware/interfaces/wifi/1.0/ Change-Id: I03db70c7b89c0be53a7754ab8b34a19ad2c6e536 --- wifi/1.0/Android.mk | 932 +++++++++--------------- wifi/1.0/IWifiNanIfaceEventCallback.hal | 31 +- wifi/1.0/types.hal | 100 +-- 3 files changed, 448 insertions(+), 615 deletions(-) diff --git a/wifi/1.0/Android.mk b/wifi/1.0/Android.mk index 9c731546ac..291212dbb6 100644 --- a/wifi/1.0/Android.mk +++ b/wifi/1.0/Android.mk @@ -12,40 +12,6 @@ intermediates := $(local-generated-sources-dir) HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX) -# -# Build types.hal (ChannelInfo) -# -GEN := $(intermediates)/android/hardware/wifi/1.0/ChannelInfo.java -$(GEN): $(HIDL) -$(GEN): PRIVATE_HIDL := $(HIDL) -$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal -$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) -$(GEN): PRIVATE_CUSTOM_TOOL = \ - $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ - -Ljava -randroid.hardware:hardware/interfaces \ - android.hardware.wifi@1.0::types.ChannelInfo - -$(GEN): $(LOCAL_PATH)/types.hal - $(transform-generated-source) -LOCAL_GENERATED_SOURCES += $(GEN) - -# -# Build types.hal (ChannelWidth) -# -GEN := $(intermediates)/android/hardware/wifi/1.0/ChannelWidth.java -$(GEN): $(HIDL) -$(GEN): PRIVATE_HIDL := $(HIDL) -$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal -$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) -$(GEN): PRIVATE_CUSTOM_TOOL = \ - $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ - -Ljava -randroid.hardware:hardware/interfaces \ - android.hardware.wifi@1.0::types.ChannelWidth - -$(GEN): $(LOCAL_PATH)/types.hal - $(transform-generated-source) -LOCAL_GENERATED_SOURCES += $(GEN) - # # Build types.hal (IfaceType) # @@ -63,23 +29,6 @@ $(GEN): $(LOCAL_PATH)/types.hal $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) -# -# Build types.hal (InformationElement) -# -GEN := $(intermediates)/android/hardware/wifi/1.0/InformationElement.java -$(GEN): $(HIDL) -$(GEN): PRIVATE_HIDL := $(HIDL) -$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal -$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) -$(GEN): PRIVATE_CUSTOM_TOOL = \ - $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ - -Ljava -randroid.hardware:hardware/interfaces \ - android.hardware.wifi@1.0::types.InformationElement - -$(GEN): $(LOCAL_PATH)/types.hal - $(transform-generated-source) -LOCAL_GENERATED_SOURCES += $(GEN) - # # Build types.hal (NanAvailDuration) # @@ -149,9 +98,9 @@ $(GEN): $(LOCAL_PATH)/types.hal LOCAL_GENERATED_SOURCES += $(GEN) # -# Build types.hal (NanCapabilities) +# Build types.hal (NanCapabilitiesResponse) # -GEN := $(intermediates)/android/hardware/wifi/1.0/NanCapabilities.java +GEN := $(intermediates)/android/hardware/wifi/1.0/NanCapabilitiesResponse.java $(GEN): $(HIDL) $(GEN): PRIVATE_HIDL := $(HIDL) $(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal @@ -159,7 +108,24 @@ $(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) $(GEN): PRIVATE_CUSTOM_TOOL = \ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ -Ljava -randroid.hardware:hardware/interfaces \ - android.hardware.wifi@1.0::types.NanCapabilities + android.hardware.wifi@1.0::types.NanCapabilitiesResponse + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanCapabilitiesResponseMsg) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanCapabilitiesResponseMsg.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanCapabilitiesResponseMsg $(GEN): $(LOCAL_PATH)/types.hal $(transform-generated-source) @@ -182,23 +148,6 @@ $(GEN): $(LOCAL_PATH)/types.hal $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) -# -# Build types.hal (NanClusterEvent) -# -GEN := $(intermediates)/android/hardware/wifi/1.0/NanClusterEvent.java -$(GEN): $(HIDL) -$(GEN): PRIVATE_HIDL := $(HIDL) -$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal -$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) -$(GEN): PRIVATE_CUSTOM_TOOL = \ - $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ - -Ljava -randroid.hardware:hardware/interfaces \ - android.hardware.wifi@1.0::types.NanClusterEvent - -$(GEN): $(LOCAL_PATH)/types.hal - $(transform-generated-source) -LOCAL_GENERATED_SOURCES += $(GEN) - # # Build types.hal (NanConfigRequest) # @@ -369,23 +318,6 @@ $(GEN): $(LOCAL_PATH)/types.hal $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) -# -# Build types.hal (NanDataPathQosCfg) -# -GEN := $(intermediates)/android/hardware/wifi/1.0/NanDataPathQosCfg.java -$(GEN): $(HIDL) -$(GEN): PRIVATE_HIDL := $(HIDL) -$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal -$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) -$(GEN): PRIVATE_CUSTOM_TOOL = \ - $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ - -Ljava -randroid.hardware:hardware/interfaces \ - android.hardware.wifi@1.0::types.NanDataPathQosCfg - -$(GEN): $(LOCAL_PATH)/types.hal - $(transform-generated-source) -LOCAL_GENERATED_SOURCES += $(GEN) - # # Build types.hal (NanDataPathRequestInd) # @@ -404,9 +336,9 @@ $(GEN): $(LOCAL_PATH)/types.hal LOCAL_GENERATED_SOURCES += $(GEN) # -# Build types.hal (NanDataPathRequestResponse) +# Build types.hal (NanDataPathResponse) # -GEN := $(intermediates)/android/hardware/wifi/1.0/NanDataPathRequestResponse.java +GEN := $(intermediates)/android/hardware/wifi/1.0/NanDataPathResponse.java $(GEN): $(HIDL) $(GEN): PRIVATE_HIDL := $(HIDL) $(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal @@ -414,7 +346,7 @@ $(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) $(GEN): PRIVATE_CUSTOM_TOOL = \ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ -Ljava -randroid.hardware:hardware/interfaces \ - android.hardware.wifi@1.0::types.NanDataPathRequestResponse + android.hardware.wifi@1.0::types.NanDataPathResponse $(GEN): $(LOCAL_PATH)/types.hal $(transform-generated-source) @@ -438,9 +370,9 @@ $(GEN): $(LOCAL_PATH)/types.hal LOCAL_GENERATED_SOURCES += $(GEN) # -# Build types.hal (NanDataPathSecurityCfgStatus) +# Build types.hal (NanDataPathResponseMsg) # -GEN := $(intermediates)/android/hardware/wifi/1.0/NanDataPathSecurityCfgStatus.java +GEN := $(intermediates)/android/hardware/wifi/1.0/NanDataPathResponseMsg.java $(GEN): $(HIDL) $(GEN): PRIVATE_HIDL := $(HIDL) $(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal @@ -448,7 +380,7 @@ $(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) $(GEN): PRIVATE_CUSTOM_TOOL = \ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ -Ljava -randroid.hardware:hardware/interfaces \ - android.hardware.wifi@1.0::types.NanDataPathSecurityCfgStatus + android.hardware.wifi@1.0::types.NanDataPathResponseMsg $(GEN): $(LOCAL_PATH)/types.hal $(transform-generated-source) @@ -573,40 +505,6 @@ $(GEN): $(LOCAL_PATH)/types.hal $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) -# -# Build types.hal (NanFurtherAvailabilityMap) -# -GEN := $(intermediates)/android/hardware/wifi/1.0/NanFurtherAvailabilityMap.java -$(GEN): $(HIDL) -$(GEN): PRIVATE_HIDL := $(HIDL) -$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal -$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) -$(GEN): PRIVATE_CUSTOM_TOOL = \ - $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ - -Ljava -randroid.hardware:hardware/interfaces \ - android.hardware.wifi@1.0::types.NanFurtherAvailabilityMap - -$(GEN): $(LOCAL_PATH)/types.hal - $(transform-generated-source) -LOCAL_GENERATED_SOURCES += $(GEN) - -# -# Build types.hal (NanMacAddressEvent) -# -GEN := $(intermediates)/android/hardware/wifi/1.0/NanMacAddressEvent.java -$(GEN): $(HIDL) -$(GEN): PRIVATE_HIDL := $(HIDL) -$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal -$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) -$(GEN): PRIVATE_CUSTOM_TOOL = \ - $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ - -Ljava -randroid.hardware:hardware/interfaces \ - android.hardware.wifi@1.0::types.NanMacAddressEvent - -$(GEN): $(LOCAL_PATH)/types.hal - $(transform-generated-source) -LOCAL_GENERATED_SOURCES += $(GEN) - # # Build types.hal (NanMatchAlg) # @@ -658,6 +556,23 @@ $(GEN): $(LOCAL_PATH)/types.hal $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) +# +# Build types.hal (NanMaxSize) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanMaxSize.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanMaxSize + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + # # Build types.hal (NanPublishCancelRequest) # @@ -709,6 +624,23 @@ $(GEN): $(LOCAL_PATH)/types.hal $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) +# +# Build types.hal (NanPublishResponseMsg) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanPublishResponseMsg.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanPublishResponseMsg + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + # # Build types.hal (NanPublishTerminatedInd) # @@ -743,40 +675,6 @@ $(GEN): $(LOCAL_PATH)/types.hal $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) -# -# Build types.hal (NanReceivePostConnectivityCapability) -# -GEN := $(intermediates)/android/hardware/wifi/1.0/NanReceivePostConnectivityCapability.java -$(GEN): $(HIDL) -$(GEN): PRIVATE_HIDL := $(HIDL) -$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal -$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) -$(GEN): PRIVATE_CUSTOM_TOOL = \ - $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ - -Ljava -randroid.hardware:hardware/interfaces \ - android.hardware.wifi@1.0::types.NanReceivePostConnectivityCapability - -$(GEN): $(LOCAL_PATH)/types.hal - $(transform-generated-source) -LOCAL_GENERATED_SOURCES += $(GEN) - -# -# Build types.hal (NanReceivePostDiscovery) -# -GEN := $(intermediates)/android/hardware/wifi/1.0/NanReceivePostDiscovery.java -$(GEN): $(HIDL) -$(GEN): PRIVATE_HIDL := $(HIDL) -$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal -$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) -$(GEN): PRIVATE_CUSTOM_TOOL = \ - $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ - -Ljava -randroid.hardware:hardware/interfaces \ - android.hardware.wifi@1.0::types.NanReceivePostDiscovery - -$(GEN): $(LOCAL_PATH)/types.hal - $(transform-generated-source) -LOCAL_GENERATED_SOURCES += $(GEN) - # # Build types.hal (NanReceiveVendorSpecificAttribute) # @@ -795,9 +693,9 @@ $(GEN): $(LOCAL_PATH)/types.hal LOCAL_GENERATED_SOURCES += $(GEN) # -# Build types.hal (NanResponseMsg) +# Build types.hal (NanResponseMsgHeader) # -GEN := $(intermediates)/android/hardware/wifi/1.0/NanResponseMsg.java +GEN := $(intermediates)/android/hardware/wifi/1.0/NanResponseMsgHeader.java $(GEN): $(HIDL) $(GEN): PRIVATE_HIDL := $(HIDL) $(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal @@ -805,7 +703,7 @@ $(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) $(GEN): PRIVATE_CUSTOM_TOOL = \ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ -Ljava -randroid.hardware:hardware/interfaces \ - android.hardware.wifi@1.0::types.NanResponseMsg + android.hardware.wifi@1.0::types.NanResponseMsgHeader $(GEN): $(LOCAL_PATH)/types.hal $(transform-generated-source) @@ -828,23 +726,6 @@ $(GEN): $(LOCAL_PATH)/types.hal $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) -# -# Build types.hal (NanSizes) -# -GEN := $(intermediates)/android/hardware/wifi/1.0/NanSizes.java -$(GEN): $(HIDL) -$(GEN): PRIVATE_HIDL := $(HIDL) -$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal -$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) -$(GEN): PRIVATE_CUSTOM_TOOL = \ - $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ - -Ljava -randroid.hardware:hardware/interfaces \ - android.hardware.wifi@1.0::types.NanSizes - -$(GEN): $(LOCAL_PATH)/types.hal - $(transform-generated-source) -LOCAL_GENERATED_SOURCES += $(GEN) - # # Build types.hal (NanSocialChannelScanParams) # @@ -879,23 +760,6 @@ $(GEN): $(LOCAL_PATH)/types.hal $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) -# -# Build types.hal (NanSrfState) -# -GEN := $(intermediates)/android/hardware/wifi/1.0/NanSrfState.java -$(GEN): $(HIDL) -$(GEN): PRIVATE_HIDL := $(HIDL) -$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal -$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) -$(GEN): PRIVATE_CUSTOM_TOOL = \ - $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ - -Ljava -randroid.hardware:hardware/interfaces \ - android.hardware.wifi@1.0::types.NanSrfState - -$(GEN): $(LOCAL_PATH)/types.hal - $(transform-generated-source) -LOCAL_GENERATED_SOURCES += $(GEN) - # # Build types.hal (NanSrfType) # @@ -913,23 +777,6 @@ $(GEN): $(LOCAL_PATH)/types.hal $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) -# -# Build types.hal (NanSsiInMatchInd) -# -GEN := $(intermediates)/android/hardware/wifi/1.0/NanSsiInMatchInd.java -$(GEN): $(HIDL) -$(GEN): PRIVATE_HIDL := $(HIDL) -$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal -$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) -$(GEN): PRIVATE_CUSTOM_TOOL = \ - $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ - -Ljava -randroid.hardware:hardware/interfaces \ - android.hardware.wifi@1.0::types.NanSsiInMatchInd - -$(GEN): $(LOCAL_PATH)/types.hal - $(transform-generated-source) -LOCAL_GENERATED_SOURCES += $(GEN) - # # Build types.hal (NanStatusType) # @@ -998,6 +845,23 @@ $(GEN): $(LOCAL_PATH)/types.hal $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) +# +# Build types.hal (NanSubscribeResponseMsg) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanSubscribeResponseMsg.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanSubscribeResponseMsg + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + # # Build types.hal (NanSubscribeTerminatedInd) # @@ -1066,40 +930,6 @@ $(GEN): $(LOCAL_PATH)/types.hal $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) -# -# Build types.hal (NanTransmitPostConnectivityCapability) -# -GEN := $(intermediates)/android/hardware/wifi/1.0/NanTransmitPostConnectivityCapability.java -$(GEN): $(HIDL) -$(GEN): PRIVATE_HIDL := $(HIDL) -$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal -$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) -$(GEN): PRIVATE_CUSTOM_TOOL = \ - $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ - -Ljava -randroid.hardware:hardware/interfaces \ - android.hardware.wifi@1.0::types.NanTransmitPostConnectivityCapability - -$(GEN): $(LOCAL_PATH)/types.hal - $(transform-generated-source) -LOCAL_GENERATED_SOURCES += $(GEN) - -# -# Build types.hal (NanTransmitPostDiscovery) -# -GEN := $(intermediates)/android/hardware/wifi/1.0/NanTransmitPostDiscovery.java -$(GEN): $(HIDL) -$(GEN): PRIVATE_HIDL := $(HIDL) -$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal -$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) -$(GEN): PRIVATE_CUSTOM_TOOL = \ - $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ - -Ljava -randroid.hardware:hardware/interfaces \ - android.hardware.wifi@1.0::types.NanTransmitPostDiscovery - -$(GEN): $(LOCAL_PATH)/types.hal - $(transform-generated-source) -LOCAL_GENERATED_SOURCES += $(GEN) - # # Build types.hal (NanTransmitVendorSpecificAttribute) # @@ -1185,23 +1015,6 @@ $(GEN): $(LOCAL_PATH)/types.hal $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) -# -# Build types.hal (RateInfo) -# -GEN := $(intermediates)/android/hardware/wifi/1.0/RateInfo.java -$(GEN): $(HIDL) -$(GEN): PRIVATE_HIDL := $(HIDL) -$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal -$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) -$(GEN): PRIVATE_CUSTOM_TOOL = \ - $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ - -Ljava -randroid.hardware:hardware/interfaces \ - android.hardware.wifi@1.0::types.RateInfo - -$(GEN): $(LOCAL_PATH)/types.hal - $(transform-generated-source) -LOCAL_GENERATED_SOURCES += $(GEN) - # # Build types.hal (RttBw) # @@ -1270,23 +1083,6 @@ $(GEN): $(LOCAL_PATH)/types.hal $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) -# -# Build types.hal (RttConstants) -# -GEN := $(intermediates)/android/hardware/wifi/1.0/RttConstants.java -$(GEN): $(HIDL) -$(GEN): PRIVATE_HIDL := $(HIDL) -$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal -$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) -$(GEN): PRIVATE_CUSTOM_TOOL = \ - $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ - -Ljava -randroid.hardware:hardware/interfaces \ - android.hardware.wifi@1.0::types.RttConstants - -$(GEN): $(LOCAL_PATH)/types.hal - $(transform-generated-source) -LOCAL_GENERATED_SOURCES += $(GEN) - # # Build types.hal (RttDebugFormat) # @@ -1491,6 +1287,108 @@ $(GEN): $(LOCAL_PATH)/types.hal $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) +# +# Build types.hal (WifiChannelInfo) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/WifiChannelInfo.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.WifiChannelInfo + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (WifiChannelWidthInMhz) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/WifiChannelWidthInMhz.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.WifiChannelWidthInMhz + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (WifiInformationElement) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/WifiInformationElement.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.WifiInformationElement + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (WifiRateInfo) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/WifiRateInfo.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.WifiRateInfo + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (WifiRateNss) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/WifiRateNss.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.WifiRateNss + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (WifiRatePreamble) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/WifiRatePreamble.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.WifiRatePreamble + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + # # Build types.hal (WifiStatus) # @@ -1814,40 +1712,6 @@ intermediates := $(local-generated-sources-dir) HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX) -# -# Build types.hal (ChannelInfo) -# -GEN := $(intermediates)/android/hardware/wifi/1.0/ChannelInfo.java -$(GEN): $(HIDL) -$(GEN): PRIVATE_HIDL := $(HIDL) -$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal -$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) -$(GEN): PRIVATE_CUSTOM_TOOL = \ - $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ - -Ljava -randroid.hardware:hardware/interfaces \ - android.hardware.wifi@1.0::types.ChannelInfo - -$(GEN): $(LOCAL_PATH)/types.hal - $(transform-generated-source) -LOCAL_GENERATED_SOURCES += $(GEN) - -# -# Build types.hal (ChannelWidth) -# -GEN := $(intermediates)/android/hardware/wifi/1.0/ChannelWidth.java -$(GEN): $(HIDL) -$(GEN): PRIVATE_HIDL := $(HIDL) -$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal -$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) -$(GEN): PRIVATE_CUSTOM_TOOL = \ - $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ - -Ljava -randroid.hardware:hardware/interfaces \ - android.hardware.wifi@1.0::types.ChannelWidth - -$(GEN): $(LOCAL_PATH)/types.hal - $(transform-generated-source) -LOCAL_GENERATED_SOURCES += $(GEN) - # # Build types.hal (IfaceType) # @@ -1865,23 +1729,6 @@ $(GEN): $(LOCAL_PATH)/types.hal $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) -# -# Build types.hal (InformationElement) -# -GEN := $(intermediates)/android/hardware/wifi/1.0/InformationElement.java -$(GEN): $(HIDL) -$(GEN): PRIVATE_HIDL := $(HIDL) -$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal -$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) -$(GEN): PRIVATE_CUSTOM_TOOL = \ - $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ - -Ljava -randroid.hardware:hardware/interfaces \ - android.hardware.wifi@1.0::types.InformationElement - -$(GEN): $(LOCAL_PATH)/types.hal - $(transform-generated-source) -LOCAL_GENERATED_SOURCES += $(GEN) - # # Build types.hal (NanAvailDuration) # @@ -1951,9 +1798,9 @@ $(GEN): $(LOCAL_PATH)/types.hal LOCAL_GENERATED_SOURCES += $(GEN) # -# Build types.hal (NanCapabilities) +# Build types.hal (NanCapabilitiesResponse) # -GEN := $(intermediates)/android/hardware/wifi/1.0/NanCapabilities.java +GEN := $(intermediates)/android/hardware/wifi/1.0/NanCapabilitiesResponse.java $(GEN): $(HIDL) $(GEN): PRIVATE_HIDL := $(HIDL) $(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal @@ -1961,7 +1808,24 @@ $(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) $(GEN): PRIVATE_CUSTOM_TOOL = \ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ -Ljava -randroid.hardware:hardware/interfaces \ - android.hardware.wifi@1.0::types.NanCapabilities + android.hardware.wifi@1.0::types.NanCapabilitiesResponse + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (NanCapabilitiesResponseMsg) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanCapabilitiesResponseMsg.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanCapabilitiesResponseMsg $(GEN): $(LOCAL_PATH)/types.hal $(transform-generated-source) @@ -1984,23 +1848,6 @@ $(GEN): $(LOCAL_PATH)/types.hal $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) -# -# Build types.hal (NanClusterEvent) -# -GEN := $(intermediates)/android/hardware/wifi/1.0/NanClusterEvent.java -$(GEN): $(HIDL) -$(GEN): PRIVATE_HIDL := $(HIDL) -$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal -$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) -$(GEN): PRIVATE_CUSTOM_TOOL = \ - $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ - -Ljava -randroid.hardware:hardware/interfaces \ - android.hardware.wifi@1.0::types.NanClusterEvent - -$(GEN): $(LOCAL_PATH)/types.hal - $(transform-generated-source) -LOCAL_GENERATED_SOURCES += $(GEN) - # # Build types.hal (NanConfigRequest) # @@ -2171,23 +2018,6 @@ $(GEN): $(LOCAL_PATH)/types.hal $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) -# -# Build types.hal (NanDataPathQosCfg) -# -GEN := $(intermediates)/android/hardware/wifi/1.0/NanDataPathQosCfg.java -$(GEN): $(HIDL) -$(GEN): PRIVATE_HIDL := $(HIDL) -$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal -$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) -$(GEN): PRIVATE_CUSTOM_TOOL = \ - $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ - -Ljava -randroid.hardware:hardware/interfaces \ - android.hardware.wifi@1.0::types.NanDataPathQosCfg - -$(GEN): $(LOCAL_PATH)/types.hal - $(transform-generated-source) -LOCAL_GENERATED_SOURCES += $(GEN) - # # Build types.hal (NanDataPathRequestInd) # @@ -2206,9 +2036,9 @@ $(GEN): $(LOCAL_PATH)/types.hal LOCAL_GENERATED_SOURCES += $(GEN) # -# Build types.hal (NanDataPathRequestResponse) +# Build types.hal (NanDataPathResponse) # -GEN := $(intermediates)/android/hardware/wifi/1.0/NanDataPathRequestResponse.java +GEN := $(intermediates)/android/hardware/wifi/1.0/NanDataPathResponse.java $(GEN): $(HIDL) $(GEN): PRIVATE_HIDL := $(HIDL) $(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal @@ -2216,7 +2046,7 @@ $(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) $(GEN): PRIVATE_CUSTOM_TOOL = \ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ -Ljava -randroid.hardware:hardware/interfaces \ - android.hardware.wifi@1.0::types.NanDataPathRequestResponse + android.hardware.wifi@1.0::types.NanDataPathResponse $(GEN): $(LOCAL_PATH)/types.hal $(transform-generated-source) @@ -2240,9 +2070,9 @@ $(GEN): $(LOCAL_PATH)/types.hal LOCAL_GENERATED_SOURCES += $(GEN) # -# Build types.hal (NanDataPathSecurityCfgStatus) +# Build types.hal (NanDataPathResponseMsg) # -GEN := $(intermediates)/android/hardware/wifi/1.0/NanDataPathSecurityCfgStatus.java +GEN := $(intermediates)/android/hardware/wifi/1.0/NanDataPathResponseMsg.java $(GEN): $(HIDL) $(GEN): PRIVATE_HIDL := $(HIDL) $(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal @@ -2250,7 +2080,7 @@ $(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) $(GEN): PRIVATE_CUSTOM_TOOL = \ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ -Ljava -randroid.hardware:hardware/interfaces \ - android.hardware.wifi@1.0::types.NanDataPathSecurityCfgStatus + android.hardware.wifi@1.0::types.NanDataPathResponseMsg $(GEN): $(LOCAL_PATH)/types.hal $(transform-generated-source) @@ -2375,40 +2205,6 @@ $(GEN): $(LOCAL_PATH)/types.hal $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) -# -# Build types.hal (NanFurtherAvailabilityMap) -# -GEN := $(intermediates)/android/hardware/wifi/1.0/NanFurtherAvailabilityMap.java -$(GEN): $(HIDL) -$(GEN): PRIVATE_HIDL := $(HIDL) -$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal -$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) -$(GEN): PRIVATE_CUSTOM_TOOL = \ - $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ - -Ljava -randroid.hardware:hardware/interfaces \ - android.hardware.wifi@1.0::types.NanFurtherAvailabilityMap - -$(GEN): $(LOCAL_PATH)/types.hal - $(transform-generated-source) -LOCAL_GENERATED_SOURCES += $(GEN) - -# -# Build types.hal (NanMacAddressEvent) -# -GEN := $(intermediates)/android/hardware/wifi/1.0/NanMacAddressEvent.java -$(GEN): $(HIDL) -$(GEN): PRIVATE_HIDL := $(HIDL) -$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal -$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) -$(GEN): PRIVATE_CUSTOM_TOOL = \ - $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ - -Ljava -randroid.hardware:hardware/interfaces \ - android.hardware.wifi@1.0::types.NanMacAddressEvent - -$(GEN): $(LOCAL_PATH)/types.hal - $(transform-generated-source) -LOCAL_GENERATED_SOURCES += $(GEN) - # # Build types.hal (NanMatchAlg) # @@ -2460,6 +2256,23 @@ $(GEN): $(LOCAL_PATH)/types.hal $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) +# +# Build types.hal (NanMaxSize) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanMaxSize.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanMaxSize + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + # # Build types.hal (NanPublishCancelRequest) # @@ -2511,6 +2324,23 @@ $(GEN): $(LOCAL_PATH)/types.hal $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) +# +# Build types.hal (NanPublishResponseMsg) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanPublishResponseMsg.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanPublishResponseMsg + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + # # Build types.hal (NanPublishTerminatedInd) # @@ -2545,40 +2375,6 @@ $(GEN): $(LOCAL_PATH)/types.hal $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) -# -# Build types.hal (NanReceivePostConnectivityCapability) -# -GEN := $(intermediates)/android/hardware/wifi/1.0/NanReceivePostConnectivityCapability.java -$(GEN): $(HIDL) -$(GEN): PRIVATE_HIDL := $(HIDL) -$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal -$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) -$(GEN): PRIVATE_CUSTOM_TOOL = \ - $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ - -Ljava -randroid.hardware:hardware/interfaces \ - android.hardware.wifi@1.0::types.NanReceivePostConnectivityCapability - -$(GEN): $(LOCAL_PATH)/types.hal - $(transform-generated-source) -LOCAL_GENERATED_SOURCES += $(GEN) - -# -# Build types.hal (NanReceivePostDiscovery) -# -GEN := $(intermediates)/android/hardware/wifi/1.0/NanReceivePostDiscovery.java -$(GEN): $(HIDL) -$(GEN): PRIVATE_HIDL := $(HIDL) -$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal -$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) -$(GEN): PRIVATE_CUSTOM_TOOL = \ - $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ - -Ljava -randroid.hardware:hardware/interfaces \ - android.hardware.wifi@1.0::types.NanReceivePostDiscovery - -$(GEN): $(LOCAL_PATH)/types.hal - $(transform-generated-source) -LOCAL_GENERATED_SOURCES += $(GEN) - # # Build types.hal (NanReceiveVendorSpecificAttribute) # @@ -2597,9 +2393,9 @@ $(GEN): $(LOCAL_PATH)/types.hal LOCAL_GENERATED_SOURCES += $(GEN) # -# Build types.hal (NanResponseMsg) +# Build types.hal (NanResponseMsgHeader) # -GEN := $(intermediates)/android/hardware/wifi/1.0/NanResponseMsg.java +GEN := $(intermediates)/android/hardware/wifi/1.0/NanResponseMsgHeader.java $(GEN): $(HIDL) $(GEN): PRIVATE_HIDL := $(HIDL) $(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal @@ -2607,7 +2403,7 @@ $(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) $(GEN): PRIVATE_CUSTOM_TOOL = \ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ -Ljava -randroid.hardware:hardware/interfaces \ - android.hardware.wifi@1.0::types.NanResponseMsg + android.hardware.wifi@1.0::types.NanResponseMsgHeader $(GEN): $(LOCAL_PATH)/types.hal $(transform-generated-source) @@ -2630,23 +2426,6 @@ $(GEN): $(LOCAL_PATH)/types.hal $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) -# -# Build types.hal (NanSizes) -# -GEN := $(intermediates)/android/hardware/wifi/1.0/NanSizes.java -$(GEN): $(HIDL) -$(GEN): PRIVATE_HIDL := $(HIDL) -$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal -$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) -$(GEN): PRIVATE_CUSTOM_TOOL = \ - $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ - -Ljava -randroid.hardware:hardware/interfaces \ - android.hardware.wifi@1.0::types.NanSizes - -$(GEN): $(LOCAL_PATH)/types.hal - $(transform-generated-source) -LOCAL_GENERATED_SOURCES += $(GEN) - # # Build types.hal (NanSocialChannelScanParams) # @@ -2681,23 +2460,6 @@ $(GEN): $(LOCAL_PATH)/types.hal $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) -# -# Build types.hal (NanSrfState) -# -GEN := $(intermediates)/android/hardware/wifi/1.0/NanSrfState.java -$(GEN): $(HIDL) -$(GEN): PRIVATE_HIDL := $(HIDL) -$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal -$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) -$(GEN): PRIVATE_CUSTOM_TOOL = \ - $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ - -Ljava -randroid.hardware:hardware/interfaces \ - android.hardware.wifi@1.0::types.NanSrfState - -$(GEN): $(LOCAL_PATH)/types.hal - $(transform-generated-source) -LOCAL_GENERATED_SOURCES += $(GEN) - # # Build types.hal (NanSrfType) # @@ -2715,23 +2477,6 @@ $(GEN): $(LOCAL_PATH)/types.hal $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) -# -# Build types.hal (NanSsiInMatchInd) -# -GEN := $(intermediates)/android/hardware/wifi/1.0/NanSsiInMatchInd.java -$(GEN): $(HIDL) -$(GEN): PRIVATE_HIDL := $(HIDL) -$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal -$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) -$(GEN): PRIVATE_CUSTOM_TOOL = \ - $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ - -Ljava -randroid.hardware:hardware/interfaces \ - android.hardware.wifi@1.0::types.NanSsiInMatchInd - -$(GEN): $(LOCAL_PATH)/types.hal - $(transform-generated-source) -LOCAL_GENERATED_SOURCES += $(GEN) - # # Build types.hal (NanStatusType) # @@ -2800,6 +2545,23 @@ $(GEN): $(LOCAL_PATH)/types.hal $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) +# +# Build types.hal (NanSubscribeResponseMsg) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/NanSubscribeResponseMsg.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.NanSubscribeResponseMsg + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + # # Build types.hal (NanSubscribeTerminatedInd) # @@ -2868,40 +2630,6 @@ $(GEN): $(LOCAL_PATH)/types.hal $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) -# -# Build types.hal (NanTransmitPostConnectivityCapability) -# -GEN := $(intermediates)/android/hardware/wifi/1.0/NanTransmitPostConnectivityCapability.java -$(GEN): $(HIDL) -$(GEN): PRIVATE_HIDL := $(HIDL) -$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal -$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) -$(GEN): PRIVATE_CUSTOM_TOOL = \ - $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ - -Ljava -randroid.hardware:hardware/interfaces \ - android.hardware.wifi@1.0::types.NanTransmitPostConnectivityCapability - -$(GEN): $(LOCAL_PATH)/types.hal - $(transform-generated-source) -LOCAL_GENERATED_SOURCES += $(GEN) - -# -# Build types.hal (NanTransmitPostDiscovery) -# -GEN := $(intermediates)/android/hardware/wifi/1.0/NanTransmitPostDiscovery.java -$(GEN): $(HIDL) -$(GEN): PRIVATE_HIDL := $(HIDL) -$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal -$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) -$(GEN): PRIVATE_CUSTOM_TOOL = \ - $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ - -Ljava -randroid.hardware:hardware/interfaces \ - android.hardware.wifi@1.0::types.NanTransmitPostDiscovery - -$(GEN): $(LOCAL_PATH)/types.hal - $(transform-generated-source) -LOCAL_GENERATED_SOURCES += $(GEN) - # # Build types.hal (NanTransmitVendorSpecificAttribute) # @@ -2987,23 +2715,6 @@ $(GEN): $(LOCAL_PATH)/types.hal $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) -# -# Build types.hal (RateInfo) -# -GEN := $(intermediates)/android/hardware/wifi/1.0/RateInfo.java -$(GEN): $(HIDL) -$(GEN): PRIVATE_HIDL := $(HIDL) -$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal -$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) -$(GEN): PRIVATE_CUSTOM_TOOL = \ - $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ - -Ljava -randroid.hardware:hardware/interfaces \ - android.hardware.wifi@1.0::types.RateInfo - -$(GEN): $(LOCAL_PATH)/types.hal - $(transform-generated-source) -LOCAL_GENERATED_SOURCES += $(GEN) - # # Build types.hal (RttBw) # @@ -3072,23 +2783,6 @@ $(GEN): $(LOCAL_PATH)/types.hal $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) -# -# Build types.hal (RttConstants) -# -GEN := $(intermediates)/android/hardware/wifi/1.0/RttConstants.java -$(GEN): $(HIDL) -$(GEN): PRIVATE_HIDL := $(HIDL) -$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal -$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) -$(GEN): PRIVATE_CUSTOM_TOOL = \ - $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ - -Ljava -randroid.hardware:hardware/interfaces \ - android.hardware.wifi@1.0::types.RttConstants - -$(GEN): $(LOCAL_PATH)/types.hal - $(transform-generated-source) -LOCAL_GENERATED_SOURCES += $(GEN) - # # Build types.hal (RttDebugFormat) # @@ -3293,6 +2987,108 @@ $(GEN): $(LOCAL_PATH)/types.hal $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) +# +# Build types.hal (WifiChannelInfo) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/WifiChannelInfo.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.WifiChannelInfo + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (WifiChannelWidthInMhz) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/WifiChannelWidthInMhz.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.WifiChannelWidthInMhz + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (WifiInformationElement) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/WifiInformationElement.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.WifiInformationElement + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (WifiRateInfo) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/WifiRateInfo.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.WifiRateInfo + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (WifiRateNss) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/WifiRateNss.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.WifiRateNss + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (WifiRatePreamble) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/WifiRatePreamble.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.WifiRatePreamble + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + # # Build types.hal (WifiStatus) # diff --git a/wifi/1.0/IWifiNanIfaceEventCallback.hal b/wifi/1.0/IWifiNanIfaceEventCallback.hal index 27b437446a..2b90cbaef6 100644 --- a/wifi/1.0/IWifiNanIfaceEventCallback.hal +++ b/wifi/1.0/IWifiNanIfaceEventCallback.hal @@ -21,9 +21,36 @@ package android.hardware.wifi@1.0; */ interface IWifiNanIfaceEventCallback { /** - * NotifyResponse invoked to notify the status of the Request. + * Callback invoked to notify the status of the Publish Request. + * + * @param cmdId command Id corresponding to the original request. + * @param rspData Message Data. */ - oneway notifyResponse(CommandId id, NanResponseMsg rspData); + oneway notifyPublishResponse(CommandId id, NanPublishResponseMsg rspData); + + /** + * Callback invoked to notify the status of the Subscribe Request. + * + * @param cmdId command Id corresponding to the original request. + * @param rspData Message Data. + */ + oneway notifySubscribeResponse(CommandId id, NanSubscribeResponseMsg rspData); + + /** + * Callback invoked to notify the status of the Data Path Request. + * + * @param cmdId command Id corresponding to the original request. + * @param rspData Message Data. + */ + oneway notifyDataPathResponse(CommandId id, NanDataPathResponseMsg rspData); + + /** + * Callback invoked to notify the status of the Capability Request. + * + * @param cmdId command Id corresponding to the original request. + * @param rspData Message Data. + */ + oneway notifyCapabilitiesResponse(CommandId id, NanCapabilitiesResponseMsg rspData); /** * Callbacks for the various asynchornous NAN Events. diff --git a/wifi/1.0/types.hal b/wifi/1.0/types.hal index 65c39f734e..02d235337b 100644 --- a/wifi/1.0/types.hal +++ b/wifi/1.0/types.hal @@ -1178,6 +1178,25 @@ enum NanStatusType : uint32_t { NDP_VENDOR_SPECIFIC_ERROR = 9500, }; +/** + * NAN Response message header + */ +struct NanResponseMsgHeader { + /** + * Contains the result code. + */ + NanStatusType status; + /** + * For error returns the value is returned which was in error. + * TODO(b/32207606): Find all the error values. + */ + uint32_t value; + /** + * ResponseType Definitions. + */ + NanResponseType responseType; +}; + /** * Publish Response Message structure. */ @@ -1185,6 +1204,15 @@ struct NanPublishResponse { uint16_t publishId; }; +/** + * NAN Publish Response Messages. + */ +struct NanPublishResponseMsg { + NanResponseMsgHeader header; + NanPublishResponse body; +}; + + /** * Subscribe Response Message structure. */ @@ -1192,10 +1220,18 @@ struct NanSubscribeResponse { uint16_t subscribeId; }; +/** + * NAN Subscribe Response Messages. + */ +struct NanSubscribeResponseMsg { + NanResponseMsgHeader header; + NanSubscribeResponse body; +}; + /** * Response returned for Initiators Data request. */ -struct NanDataPathRequestResponse { +struct NanDataPathResponse { /** * Unique token Id generated on the initiator * side used for a NDP session between two NAN devices @@ -1204,9 +1240,17 @@ struct NanDataPathRequestResponse { }; /** - * NDP Capabilites info. + * NAN Data Path Response Messages. */ -struct NanCapabilities { +struct NanDataPathResponseMsg { + NanResponseMsgHeader header; + NanDataPathResponse body; +}; + +/** + * NDP Capabilites response. + */ +struct NanCapabilitiesResponse { uint32_t maxConcurrentClusters; uint32_t maxPublishes; uint32_t maxSubscribes; @@ -1223,32 +1267,11 @@ struct NanCapabilities { }; /** - * NAN Response Message body. + * NAN Capabilities Response Messages. */ -union NanResponseMsgBody { - NanPublishResponse publishResponse; - NanSubscribeResponse subscribeResponse; - NanDataPathRequestResponse dataRequestResponse; - NanCapabilities nanCapabilities; -}; - -/** - * NAN Response Messages. - */ -struct NanResponseMsg { - /** - * Contains the result code. - */ - NanStatusType status; - /** - * For error returns the value is returned which was in error. - */ - uint32_t value; - /** - * ResponseType Definitions. - */ - NanResponseType responseType; - NanResponseMsgBody body; +struct NanCapabilitiesResponseMsg { + NanResponseMsgHeader header; + NanCapabilitiesResponse body; }; /** @@ -1571,21 +1594,6 @@ struct NanTransmitFollowupInd { * RTT specific types. * TODO(b/32159498): Move to a separate rtt_types.hal. */ -/** - * Constants used in the RTT interface. - */ -enum RttConstants : uint32_t { - PREAMBLE_LEGACY = 0x1, - PREAMBLE_HT = 0x2, - PREAMBLE_VHT = 0x4, - BW_5_SUPPORT = 0x1, - BW_10_SUPPORT = 0x2, - BW_20_SUPPORT = 0x4, - BW_40_SUPPORT = 0x8, - BW_80_SUPPORT = 0x10, - BW_160_SUPPORT = 0x20, -}; - /** * Ranging status. */ @@ -1896,11 +1904,13 @@ struct RttCapabilities { */ bool responderSupported; /** - * bit mask indicates what preamble is supported by initiator. + * Bit mask indicates what preamble is supported by initiator. + * Combination of |RttPreamble| values. */ uint8_t preambleSupport; /** - * bit mask indicates what BW is supported by initiator. + * Bit mask indicates what BW is supported by initiator. + * Combination of |RttBw| values. */ uint8_t bwSupport; /** From 5e25466ebf7282bfbbe58e5f1f741c9a05993602 Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Wed, 26 Oct 2016 10:10:48 -0700 Subject: [PATCH 08/24] wifi(interface): Move all StaIface types to types.hal Some of these structs are used in the debug framework and hence needs to live in types.hal. Add a |Sta| prefix to differentiate them from other types similar to what is done for Nan and Rtt types. Bug: 31991459 Test: ./hardware/interfaces/update-makefiles.sh Change-Id: Idc49b28447609c4334b0a086481c404c06a63fea --- wifi/1.0/Android.mk | 442 ++++++++++++++++++++++++ wifi/1.0/IWifiStaIface.hal | 275 +-------------- wifi/1.0/IWifiStaIfaceEventCallback.hal | 54 +-- wifi/1.0/types.hal | 306 ++++++++++++++++ 4 files changed, 762 insertions(+), 315 deletions(-) diff --git a/wifi/1.0/Android.mk b/wifi/1.0/Android.mk index 291212dbb6..bfd32d5e91 100644 --- a/wifi/1.0/Android.mk +++ b/wifi/1.0/Android.mk @@ -1287,6 +1287,227 @@ $(GEN): $(LOCAL_PATH)/types.hal $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) +# +# Build types.hal (StaApfPacketFilterCapabilities) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/StaApfPacketFilterCapabilities.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.StaApfPacketFilterCapabilities + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (StaBackgroundScanBand) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/StaBackgroundScanBand.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.StaBackgroundScanBand + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (StaBackgroundScanBucketEventReportSchemeMask) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/StaBackgroundScanBucketEventReportSchemeMask.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.StaBackgroundScanBucketEventReportSchemeMask + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (StaBackgroundScanBucketParameters) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/StaBackgroundScanBucketParameters.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.StaBackgroundScanBucketParameters + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (StaBackgroundScanCapabilities) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/StaBackgroundScanCapabilities.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.StaBackgroundScanCapabilities + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (StaBackgroundScanParameters) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/StaBackgroundScanParameters.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.StaBackgroundScanParameters + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (StaLinkLayerIfacePacketStats) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/StaLinkLayerIfacePacketStats.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.StaLinkLayerIfacePacketStats + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (StaLinkLayerIfaceStats) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/StaLinkLayerIfaceStats.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.StaLinkLayerIfaceStats + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (StaLinkLayerRadioStats) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/StaLinkLayerRadioStats.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.StaLinkLayerRadioStats + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (StaLinkLayerStats) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/StaLinkLayerStats.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.StaLinkLayerStats + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (StaScanData) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/StaScanData.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.StaScanData + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (StaScanDataFlagMask) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/StaScanDataFlagMask.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.StaScanDataFlagMask + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (StaScanResult) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/StaScanResult.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.StaScanResult + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + # # Build types.hal (WifiChannelInfo) # @@ -2987,6 +3208,227 @@ $(GEN): $(LOCAL_PATH)/types.hal $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) +# +# Build types.hal (StaApfPacketFilterCapabilities) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/StaApfPacketFilterCapabilities.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.StaApfPacketFilterCapabilities + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (StaBackgroundScanBand) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/StaBackgroundScanBand.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.StaBackgroundScanBand + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (StaBackgroundScanBucketEventReportSchemeMask) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/StaBackgroundScanBucketEventReportSchemeMask.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.StaBackgroundScanBucketEventReportSchemeMask + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (StaBackgroundScanBucketParameters) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/StaBackgroundScanBucketParameters.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.StaBackgroundScanBucketParameters + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (StaBackgroundScanCapabilities) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/StaBackgroundScanCapabilities.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.StaBackgroundScanCapabilities + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (StaBackgroundScanParameters) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/StaBackgroundScanParameters.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.StaBackgroundScanParameters + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (StaLinkLayerIfacePacketStats) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/StaLinkLayerIfacePacketStats.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.StaLinkLayerIfacePacketStats + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (StaLinkLayerIfaceStats) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/StaLinkLayerIfaceStats.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.StaLinkLayerIfaceStats + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (StaLinkLayerRadioStats) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/StaLinkLayerRadioStats.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.StaLinkLayerRadioStats + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (StaLinkLayerStats) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/StaLinkLayerStats.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.StaLinkLayerStats + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (StaScanData) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/StaScanData.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.StaScanData + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (StaScanDataFlagMask) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/StaScanDataFlagMask.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.StaScanDataFlagMask + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (StaScanResult) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/StaScanResult.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.StaScanResult + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + # # Build types.hal (WifiChannelInfo) # diff --git a/wifi/1.0/IWifiStaIface.hal b/wifi/1.0/IWifiStaIface.hal index 5cf1413f94..3ca9b7d084 100644 --- a/wifi/1.0/IWifiStaIface.hal +++ b/wifi/1.0/IWifiStaIface.hal @@ -43,263 +43,7 @@ interface IWifiStaIface extends IWifiIface { /** * If set indicates that the link layer stats APIs are supported. */ - LINK_LAYER_STATS = 1 << 2 - }; - - /** - * Parameters to specify the APF capability of this iface. - */ - struct ApfPacketFilterCapabilities { - /** - * Version of the packet filter interpreter supported - */ - uint32_t version; - /** - * Maximum size of the filter bytecodes in bytes for an iface. - */ - uint32_t maxLength; - }; - - /** - * Parameters to specify the Background Scan capability of this iface. - */ - struct BackgroundScanCapabilities { - /** - * Maximum number of bytes available for cached scan results - */ - uint32_t maxCacheSize; - /** - * Maximum number of buckets that can be supplied for a scan - */ - uint32_t maxBuckets; - /** - * Maximum number of APs that must be stored for each scan. - */ - uint32_t maxApCachePerScan; - /** - * Max reporting number of scans threshold that can be specified in the scan - * parameters. - */ - int32_t maxReportingThreshold; - }; - - /** - * Bands that can be specified in Background scan requests. - */ - enum BackgroundScanBand : uint32_t { - BAND_UNSPECIFIED, - /** - * 2.4 GHz. - */ - BAND_24GHZ = 1, - /** - * 5 GHz without DFS. - */ - BAND_5GHZ = 2, - /** - * 5 GHz DFS only. - */ - BAND_5GHZ_DFS = 4, - /** - * 5 GHz with DFS. - */ - BAND_5GHZ_WITH_DFS = 6, - /** - * 2.4 GHz + 5 GHz; no DFS. - */ - BAND_24GHZ_5GHZ = 3, - /** - * 2.4 GHz + 5 GHz with DFS - */ - BAND_24GHZ_5GHZ_WITH_DFS = 7 - }; - - /** - * Mask of event reporting schemes that can be specified in background scan - * requests. - */ - enum BackgroundScanBucketEventReportSchemeMask : uint32_t { - /** - * Report a scan completion event after scan. If this is not set then scan - * completion events must be reported if report_threshold_percent or - * report_threshold_num_scans is reached. - */ - EACH_SCAN = 1 << 0, - /** - * Forward scan results (beacons/probe responses + IEs) in real time to HAL, - * in addition to completion events. - * Note: To keep backward compatibility, fire completion events regardless - * of REPORT_EVENTS_EACH_SCAN. - */ - FULL_RESULTS = 1 << 1, - /** - * Controls if scans for this bucket must be placed in the results buffer. - */ - NO_BATCH = 1 << 2, - }; - - /** - * Background Scan parameters per bucket that can be specified in background - * scan requests. - */ - struct BackgroundScanBucketParameters { - /** - * Bands to scan or 0 if frequencies list must be used instead. - */ - BackgroundScanBand band; - /** - * Channel frequencies (in Mhz) to scan if |band| is set to - * |UNSPECIFIED|. - */ - vec frequencies; - /** - * Period at which this bucket must be scanned (in milliseconds). Must be an integer - * multiple of the |basePeriodInMs| specified in the BackgroundScanParameters. - */ - uint32_t periodInMs; - /** - * Bitset of |BackgroundScanBucketEventReportSchemeMask| values controlling - * when events for this bucket must be reported. - */ - uint32_t eventReportScheme; - /** - * For exponential back off. If |exponentialMaxPeriodInMs| is non zero or - * different than period, then this bucket is an exponential backoff bucket - * and the scan period must grow exponentially as per formula: - * actual_period(N) = period * (base ^ (N/step_count)) - * to this maximum period (in milliseconds). - */ - uint32_t exponentialMaxPeriodInMs; - /** - * For exponential back off. multiplier: new_period=old_period * base - */ - uint32_t exponentialBase; - /** - * For exponential back off. Number of scans to perform for a given - * period. - */ - uint32_t exponentialStepCount; - }; - - /** - * Background Scan parameters that can be specified in background scan - * requests. - */ - struct BackgroundScanParameters { - /** - * GCD of all bucket periods (in milliseconds). - */ - uint32_t basePeriodInMs; - /** - * Maximum number of APs that must be stored for each scan. If the maximum - * is reached the highest RSSI results must be returned. - */ - uint32_t maxApPerScan; - /** - * % cache buffer filled threshold at which the host must be notified of - * batched scan results. - */ - uint32_t reportThresholdPercent; - /** - * Threshold at which the AP must be woken up, in number of scans. - */ - uint32_t reportThresholdNumScans; - /** - * List of buckets to be scheduled. - */ - vec buckets; - }; - - /** - * Packet stats for different traffic categories. - */ - struct LinkLayerIfacePacketStats { - /** - * Number of received unicast data packets. - */ - uint64_t rxMpdu; - /** - * Number of successfully transmitted unicast data pkts (ACK rcvd). - */ - uint64_t txMpdu; - /** - * Number of transmitted unicast data pkt losses (no ACK). - */ - uint64_t lostMpdu; - /** - * Number of transmitted unicast data retry pkts. - */ - uint64_t retries; - }; - - /** - * Iface statistics for the current connection. - */ - struct LinkLayerIfaceStats { - /** - * Number beacons received from the connected AP. - */ - uint32_t beaconRx; - /** - * Access Point Beacon and Management frames RSSI (averaged). - */ - int32_t avgRssiMgmt; - /** - * WME Best Effort Access Category packet counters. - */ - LinkLayerIfacePacketStats wmeBePktStats; - /** - * WME Background Access Category packet counters. - */ - LinkLayerIfacePacketStats wmeBkPktStats; - /** - * WME Video Access Category packet counters. - */ - LinkLayerIfacePacketStats wmeViPktStats; - /** - * WME Voice Access Category packet counters. - */ - LinkLayerIfacePacketStats wmeVoPktStats; - }; - - /** - * Cumulative radio statistics since collection was enabled. - */ - struct LinkLayerRadioStats { - /** - * Time for which the radio is awake. - */ - uint32_t onTimeInMs; - /** - * Total time for which the radio is in active transmission. - */ - uint32_t txTimeInMs; - /** - * Time for which the radio is in active tranmission per tx level. - */ - vec txTimeInMsPerLevel; - /** - * Time for which the radio is in active receive. - */ - uint32_t rxTimeInMs; - /** - * Total time for which the radio is awake due to scan. - */ - uint32_t onTimeInMsForScan; - }; - - /** - * Link layer stats retrieved via |getLinkLayerStats|. - */ - struct LinkLayerStats { - LinkLayerIfaceStats iface; - LinkLayerRadioStats radio; - /** - * TimeStamp for each stats sample. - * This is the absolute milliseconds from boot when these stats were - * sampled. - */ - TimeStampInMs timeStampInMs; + LINK_LAYER_STATS = 1 << 2, }; /** @@ -328,7 +72,7 @@ interface IWifiStaIface extends IWifiIface { * |WifiStatusCode.ERROR_UNKNOWN| * @return capabilities Bitset of |StaIfaceCapabilityMask| values. */ - getCapabilities() generates (WifiStatus status, uint64_t capabilities); + getCapabilities() generates (WifiStatus status, uint32_t capabilities); /** * Used to query additional information about the chip's APF capabilities. @@ -341,10 +85,10 @@ interface IWifiStaIface extends IWifiIface { * |WifiStatusCode.ERROR_NOT_SUPPORTED|, * |WifiStatusCode.ERROR_NOT_AVAILABLE|, * |WifiStatusCode.ERROR_UNKNOWN| - * @return capabilities Instance of |ApfPacketFilterCapabilities|. + * @return capabilities Instance of |StaApfPacketFilterCapabilities|. */ getApfPacketFilterCapabilities() - generates (WifiStatus status, ApfPacketFilterCapabilities capabilities); + generates (WifiStatus status, StaApfPacketFilterCapabilities capabilities); /** * Installs an APF program on this iface, replacing an existing @@ -376,10 +120,10 @@ interface IWifiStaIface extends IWifiIface { * |WifiStatusCode.ERROR_NOT_SUPPORTED|, * |WifiStatusCode.ERROR_NOT_AVAILABLE|, * |WifiStatusCode.ERROR_UNKNOWN| - * @return capabilities Instance of |BackgroundScanCapabilities|. + * @return capabilities Instance of |StaBackgroundScanCapabilities|. */ getBackgroundScanCapabilities() - generates (WifiStatus status, BackgroundScanCapabilities capabilities); + generates (WifiStatus status, StaBackgroundScanCapabilities capabilities); /** * Used to query the list of valid frequencies (depending on country code set) @@ -388,6 +132,7 @@ interface IWifiStaIface extends IWifiIface { * request. * Must fail if |StaIfaceCapabilityMask.BACKGROUND_SCAN| is not set. * + * @param band Band for which the frequency list is being generated. * @return status WifiStatus of the operation. * Possible status codes: * |WifiStatusCode.SUCCESS|, @@ -397,7 +142,7 @@ interface IWifiStaIface extends IWifiIface { * |WifiStatusCode.ERROR_UNKNOWN| * @return frequencies vector of valid frequencies for the provided band. */ - getValidFrequenciesForBackgroundScan(BackgroundScanBand band) + getValidFrequenciesForBackgroundScan(StaBackgroundScanBand band) generates (WifiStatus status, vec frequencies); /** @@ -437,7 +182,7 @@ interface IWifiStaIface extends IWifiIface { * |WifiStatusCode.ERROR_NOT_AVAILABLE|, * |WifiStatusCode.ERROR_UNKNOWN| */ - startBackgroundScan(CommandId cmdId, BackgroundScanParameters params) + startBackgroundScan(CommandId cmdId, StaBackgroundScanParameters params) generates (WifiStatus status); /** @@ -504,5 +249,5 @@ interface IWifiStaIface extends IWifiIface { * |WifiStatusCode.ERROR_UNKNOWN| * @return stats Instance of |LinkLayerStats|. */ - getLinkLayerStats() generates (WifiStatus status, LinkLayerStats stats); + getLinkLayerStats() generates (WifiStatus status, StaLinkLayerStats stats); }; diff --git a/wifi/1.0/IWifiStaIfaceEventCallback.hal b/wifi/1.0/IWifiStaIfaceEventCallback.hal index 6bffc7d7d5..d47d40cfd6 100644 --- a/wifi/1.0/IWifiStaIfaceEventCallback.hal +++ b/wifi/1.0/IWifiStaIfaceEventCallback.hal @@ -17,52 +17,6 @@ package android.hardware.wifi@1.0; interface IWifiStaIfaceEventCallback { - /** - * Structure describing all the information about a single access point seen - * during the scan. - */ - struct ScanResult { - TimeStampInUs timeStampInUs; - vec ssid; - Bssid bssid; - Rssi rssi; - WifiChannelInMhz frequency; - uint16_t beaconPeriodInMs; - uint16_t capability; - vec informationElements; - }; - - /** - * Mask of flags set in the |ScanData| instance. - */ - enum ScanDataFlagMask { - /** - * Indicates that a scan was interrupted/did not occur so results may be - * incomplete. - */ - WIFI_SCAN_FLAG_INTERRUPTED = 1 << 0, - }; - - /** - * Structure describing all the information about all the access points seen during - * the scan. - */ - struct ScanData { - /** - * Bitset containing |ScanDataFlagMask| values. - */ - uint32_t flags; - /** - * Bitset where each bit indicates if the bucket with that index was - * scanned. - */ - uint32_t bucketsScanned; - /** - * List of scan results. - */ - vec results; - }; - /** * Callback indicating that an ongoing background scan request has failed. * The background scan needs to be restarted to continue scanning. @@ -72,15 +26,15 @@ interface IWifiStaIfaceEventCallback { /** * Called for each received beacon/probe response for a scan with the * |REPORT_EVENTS_FULL_RESULTS| flag set in - * |BackgroundScanBucketParameters.eventReportScheme|. + * |StaBackgroundScanBucketParameters.eventReportScheme|. * * @param cmdId command Id corresponding to the request. * @parm result Full scan result for an AP. */ - oneway onBackgroundFullScanResult(CommandId cmdId, ScanResult result); + oneway onBackgroundFullScanResult(CommandId cmdId, StaScanResult result); /** - * Called when the |BackgroundScanBucketParameters.eventReportScheme| flags + * Called when the |StaBackgroundScanBucketParameters.eventReportScheme| flags * for at least one bucket that was just scanned was * |REPORT_EVENTS_EACH_SCAN| or one of the configured thresholds was * breached. @@ -88,5 +42,5 @@ interface IWifiStaIfaceEventCallback { * @param cmdId command Id corresponding to the request. * @parm scanDatas List of scan result for all AP's seen since last callback. */ - oneway onBackgroundScanResults(CommandId cmdId, vec scanDatas); + oneway onBackgroundScanResults(CommandId cmdId, vec scanDatas); }; diff --git a/wifi/1.0/types.hal b/wifi/1.0/types.hal index 02d235337b..e7af6ee711 100644 --- a/wifi/1.0/types.hal +++ b/wifi/1.0/types.hal @@ -202,6 +202,312 @@ struct WifiRateInfo { uint32_t bitRateInKbps; }; +/** + * STA specific types. + * TODO(b/32159498): Move to a separate nan_types.hal. + */ +/** + * Parameters to specify the APF capability of this iface. + */ +struct StaApfPacketFilterCapabilities { + /** + * Version of the packet filter interpreter supported + */ + uint32_t version; + /** + * Maximum size of the filter bytecodes in byte for an iface. + */ + uint32_t maxLength; +}; + +/** + * Parameters to specify the Background Scan capability of this iface. + */ +struct StaBackgroundScanCapabilities { + /** + * Maximum number of byte available for cached scan results + */ + uint32_t maxCacheSize; + /** + * Maximum number of buckets that can be supplied for a scan + */ + uint32_t maxBuckets; + /** + * Maximum number of APs that must be stored for each scan. + */ + uint32_t maxApCachePerScan; + /** + * Max reporting number of scans threshold that can be specified in the scan + * parameters. + */ + int32_t maxReportingThreshold; +}; + +/** + * Bands that can be specified in Background scan requests. + */ +enum StaBackgroundScanBand : uint32_t { + BAND_UNSPECIFIED, + /** + * 2.4 GHz. + */ + BAND_24GHZ = 1, + /** + * 5 GHz without DFS. + */ + BAND_5GHZ = 2, + /** + * 5 GHz DFS only. + */ + BAND_5GHZ_DFS = 4, + /** + * 5 GHz with DFS. + */ + BAND_5GHZ_WITH_DFS = 6, + /** + * 2.4 GHz + 5 GHz; no DFS. + */ + BAND_24GHZ_5GHZ = 3, + /** + * 2.4 GHz + 5 GHz with DFS + */ + BAND_24GHZ_5GHZ_WITH_DFS = 7 +}; + +/** + * Mask of event reporting schemes that can be specified in background scan + * requests. + */ +enum StaBackgroundScanBucketEventReportSchemeMask : uint32_t { + /** + * Report a scan completion event after scan. If this is not set then scan + * completion events must be reported if report_threshold_percent or + * report_threshold_num_scans is reached. + */ + EACH_SCAN = 1 << 0, + /** + * Forward scan results (beacons/probe responses + IEs) in real time to HAL, + * in addition to completion events. + * Note: To keep backward compatibility, fire completion events regardless + * of REPORT_EVENTS_EACH_SCAN. + */ + FULL_RESULTS = 1 << 1, + /** + * Controls if scans for this bucket must be placed in the results buffer. + */ + NO_BATCH = 1 << 2, +}; + +/** + * Background Scan parameters per bucket that can be specified in background + * scan requests. + */ +struct StaBackgroundScanBucketParameters { + /** + * Bands to scan or 0 if frequencies list must be used instead. + */ + StaBackgroundScanBand band; + /** + * Channel frequencies (in Mhz) to scan if |band| is set to + * |UNSPECIFIED|. + */ + vec frequencies; + /** + * Period at which this bucket must be scanned (in milliseconds). Must be an integer + * multiple of the |basePeriodInMs| specified in the BackgroundScanParameters. + */ + uint32_t periodInMs; + /** + * Bitset of |BackgroundScanBucketEventReportSchemeMask| values controlling + * when events for this bucket must be reported. + */ + uint32_t eventReportScheme; + /** + * For exponential back off. If |exponentialMaxPeriodInMs| is non zero or + * different than period, then this bucket is an exponential backoff bucket + * and the scan period must grow exponentially as per formula: + * actual_period(N) = period * (base ^ (N/step_count)) + * to this maximum period (in milliseconds). + */ + uint32_t exponentialMaxPeriodInMs; + /** + * For exponential back off. multiplier: new_period=old_period * base + */ + uint32_t exponentialBase; + /** + * For exponential back off. Number of scans to perform for a given + * period. + */ + uint32_t exponentialStepCount; +}; + +/** + * Background Scan parameters that can be specified in background scan + * requests. + */ +struct StaBackgroundScanParameters { + /** + * GCD of all bucket periods (in milliseconds). + */ + uint32_t basePeriodInMs; + /** + * Maximum number of APs that must be stored for each scan. If the maximum + * is reached the highest RSSI results must be returned. + */ + uint32_t maxApPerScan; + /** + * % cache buffer filled threshold at which the host must be notified of + * batched scan results. + */ + uint32_t reportThresholdPercent; + /** + * Threshold at which the AP must be woken up, in number of scans. + */ + uint32_t reportThresholdNumScans; + /** + * List of buckets to be scheduled. + */ + vec buckets; +}; + +/** + * Packet stats for different traffic categories. + */ +struct StaLinkLayerIfacePacketStats { + /** + * Number of received unicast data packets. + */ + uint64_t rxMpdu; + /** + * Number of successfully transmitted unicast data pkts (ACK rcvd). + */ + uint64_t txMpdu; + /** + * Number of transmitted unicast data pkt losses (no ACK). + */ + uint64_t lostMpdu; + /** + * Number of transmitted unicast data retry pkts. + */ + uint64_t retries; +}; + +/** + * Iface statistics for the current connection. + */ +struct StaLinkLayerIfaceStats { + /** + * Number beacons received from the connected AP. + */ + uint32_t beaconRx; + /** + * Access Point Beacon and Management frames RSSI (averaged). + */ + int32_t avgRssiMgmt; + /** + * WME Best Effort Access Category packet counters. + */ + StaLinkLayerIfacePacketStats wmeBePktStats; + /** + * WME Background Access Category packet counters. + */ + StaLinkLayerIfacePacketStats wmeBkPktStats; + /** + * WME Video Access Category packet counters. + */ + StaLinkLayerIfacePacketStats wmeViPktStats; + /** + * WME Voice Access Category packet counters. + */ + StaLinkLayerIfacePacketStats wmeVoPktStats; +}; + +/** + * Cumulative radio statistics since collection was enabled. + */ +struct StaLinkLayerRadioStats { + /** + * Time for which the radio is awake. + */ + uint32_t onTimeInMs; + /** + * Total time for which the radio is in active transmission. + */ + uint32_t txTimeInMs; + /** + * Time for which the radio is in active tranmission per tx level. + */ + vec txTimeInMsPerLevel; + /** + * Time for which the radio is in active receive. + */ + uint32_t rxTimeInMs; + /** + * Total time for which the radio is awake due to scan. + */ + uint32_t onTimeInMsForScan; +}; + +/** + * Link layer stats retrieved via |getLinkLayerStats|. + */ +struct StaLinkLayerStats { + StaLinkLayerIfaceStats iface; + StaLinkLayerRadioStats radio; + /** + * TimeStamp for each stats sample. + * This is the absolute milliseconds from boot when these stats were + * sampled. + */ + TimeStampInMs timeStampInMs; +}; + +/** + * Structure describing all the information about a single access point seen + * during the scan. + */ +struct StaScanResult { + TimeStampInUs timeStampInUs; + vec ssid; + Bssid bssid; + Rssi rssi; + WifiChannelInMhz frequency; + uint16_t beaconPeriodInMs; + uint16_t capability; + vec informationElements; +}; + +/** + * Mask of flags set in the |ScanData| instance. + */ +enum StaScanDataFlagMask { + /** + * Indicates that a scan was interrupted/did not occur so results may be + * incomplete. + */ + WIFI_SCAN_FLAG_INTERRUPTED = 1 << 0, +}; + +/** + * Structure describing all the information about all the access points seen during + * the scan. + */ +struct StaScanData { + /** + * Bitset containing |ScanDataFlagMask| values. + */ + uint32_t flags; + /** + * Bitset where each bit indicates if the bucket with that index was + * scanned. + */ + uint32_t bucketsScanned; + /** + * List of scan results. + */ + vec results; +}; + /** * NAN specific types. * TODO(b/32159498): Move to a separate nan_types.hal. From e3a02b07b62fa70d37849c5b45957f5b5e697215 Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Wed, 19 Oct 2016 12:31:01 -0700 Subject: [PATCH 09/24] wifi(interface): Add wifi debug ring buffer related interface The debug ring buffers is a purely debug mechanism to let the driver report debug info like connection events, power events, etc to the framework. The framework used to previously dump out the raw byte stream in the bugreport and the vendors had some tools to parse out the data. This is now being changed to provide the framework with the internal ring buffer structs to ease parsing this data in framework itself. This will eventually be used in the new wifilogd daemon. Bug: 32221997 Test: ./hardware/interfaces/update-makefiles.sh Change-Id: I2c90662cfa9d07ae6fc72198a286338dbaacbfc2 --- wifi/1.0/Android.mk | 408 +++++++++++++++++++++ wifi/1.0/IWifiChip.hal | 84 ++++- wifi/1.0/IWifiChipEventCallback.hal | 43 +++ wifi/1.0/types.hal | 545 +++++++++++++++++++++++++++- 4 files changed, 1073 insertions(+), 7 deletions(-) diff --git a/wifi/1.0/Android.mk b/wifi/1.0/Android.mk index bfd32d5e91..e8122724c0 100644 --- a/wifi/1.0/Android.mk +++ b/wifi/1.0/Android.mk @@ -1542,6 +1542,210 @@ $(GEN): $(LOCAL_PATH)/types.hal $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) +# +# Build types.hal (WifiDebugRingBufferFlags) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/WifiDebugRingBufferFlags.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.WifiDebugRingBufferFlags + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (WifiDebugRingBufferStatus) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/WifiDebugRingBufferStatus.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.WifiDebugRingBufferStatus + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (WifiDebugRingBufferVerboseLevel) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/WifiDebugRingBufferVerboseLevel.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.WifiDebugRingBufferVerboseLevel + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (WifiDebugRingEntryConnectivityEvent) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/WifiDebugRingEntryConnectivityEvent.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.WifiDebugRingEntryConnectivityEvent + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (WifiDebugRingEntryEventTlv) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/WifiDebugRingEntryEventTlv.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.WifiDebugRingEntryEventTlv + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (WifiDebugRingEntryEventTlvType) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/WifiDebugRingEntryEventTlvType.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.WifiDebugRingEntryEventTlvType + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (WifiDebugRingEntryEventType) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/WifiDebugRingEntryEventType.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.WifiDebugRingEntryEventType + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (WifiDebugRingEntryFlags) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/WifiDebugRingEntryFlags.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.WifiDebugRingEntryFlags + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (WifiDebugRingEntryHeader) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/WifiDebugRingEntryHeader.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.WifiDebugRingEntryHeader + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (WifiDebugRingEntryPowerEvent) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/WifiDebugRingEntryPowerEvent.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.WifiDebugRingEntryPowerEvent + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (WifiDebugRingEntryVendorData) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/WifiDebugRingEntryVendorData.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.WifiDebugRingEntryVendorData + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (WifiDebugRingEntryWakelockEvent) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/WifiDebugRingEntryWakelockEvent.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.WifiDebugRingEntryWakelockEvent + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + # # Build types.hal (WifiInformationElement) # @@ -3463,6 +3667,210 @@ $(GEN): $(LOCAL_PATH)/types.hal $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) +# +# Build types.hal (WifiDebugRingBufferFlags) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/WifiDebugRingBufferFlags.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.WifiDebugRingBufferFlags + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (WifiDebugRingBufferStatus) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/WifiDebugRingBufferStatus.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.WifiDebugRingBufferStatus + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (WifiDebugRingBufferVerboseLevel) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/WifiDebugRingBufferVerboseLevel.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.WifiDebugRingBufferVerboseLevel + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (WifiDebugRingEntryConnectivityEvent) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/WifiDebugRingEntryConnectivityEvent.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.WifiDebugRingEntryConnectivityEvent + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (WifiDebugRingEntryEventTlv) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/WifiDebugRingEntryEventTlv.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.WifiDebugRingEntryEventTlv + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (WifiDebugRingEntryEventTlvType) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/WifiDebugRingEntryEventTlvType.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.WifiDebugRingEntryEventTlvType + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (WifiDebugRingEntryEventType) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/WifiDebugRingEntryEventType.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.WifiDebugRingEntryEventType + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (WifiDebugRingEntryFlags) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/WifiDebugRingEntryFlags.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.WifiDebugRingEntryFlags + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (WifiDebugRingEntryHeader) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/WifiDebugRingEntryHeader.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.WifiDebugRingEntryHeader + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (WifiDebugRingEntryPowerEvent) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/WifiDebugRingEntryPowerEvent.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.WifiDebugRingEntryPowerEvent + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (WifiDebugRingEntryVendorData) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/WifiDebugRingEntryVendorData.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.WifiDebugRingEntryVendorData + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (WifiDebugRingEntryWakelockEvent) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/WifiDebugRingEntryWakelockEvent.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.WifiDebugRingEntryWakelockEvent + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + # # Build types.hal (WifiInformationElement) # diff --git a/wifi/1.0/IWifiChip.hal b/wifi/1.0/IWifiChip.hal index 2a9ed49bb4..29425b1f5e 100644 --- a/wifi/1.0/IWifiChip.hal +++ b/wifi/1.0/IWifiChip.hal @@ -85,7 +85,7 @@ interface IWifiChip { * [{STA} <=1, {AP} <= 1]. * * When switching between two available combinations it is expected that - * interfaces only supported by the initial combination will be removed until + * interfaces only supported by the initial combination must be removed until * the target combination is also satisfied. At that point new interfaces * satisfying only the target combination can be added (meaning the initial * combination limits will no longer satisfied). The addition of these new @@ -102,8 +102,8 @@ interface IWifiChip { * * If a chip does not support this kind of reconfiguration in this mode then * the combinations must be separated into two separate modes. Before - * switching modes all interfaces will be torn down, the mode switch will be - * enacted and when it completes the new interfaces will be brought up. + * switching modes all interfaces must be torn down, the mode switch must be + * enacted and when it completes the new interfaces must be brought up. */ struct ChipMode { /** @@ -143,7 +143,7 @@ interface IWifiChip { /** * Requests notifications of significant events on this chip. Multiple calls - * to this will register multiple callbacks each of which will receive all + * to this must register multiple callbacks each of which must receive all * events. * * @param callback An instance of the |IWifiChipEventCallback| HIDL interface @@ -434,4 +434,80 @@ interface IWifiChip { */ createRttController(IWifiIface boundIface) generates (WifiStatus status, IWifiRttController rtt); + + /** + * WiFi debug ring buffer life cycle is as follow: + * - At initialization time, framework must call |getDebugRingBuffersStatus|. + * to obtain the names and list of supported ring buffers. + * The driver may expose several different rings each holding a different + * type of data (connection events, power events, etc). + * - When WiFi operations start framework must call + * |startLoggingToDebugRingBuffer| to trigger log collection for a specific + * ring. The vebose level for each ring buffer can be specified in this API. + * - During wifi operations, driver must periodically report per ring data to + * framework by invoking the + * |IWifiChipEventCallback.onDebugRingBufferEntriesAvailable| callback. + * - When capturing a bug report, framework must indicate to driver that all + * the data has to be uploaded urgently by calling + * |forceDumpToDebugRingBuffer|. + * + * The data uploaded by driver must be stored by framework in separate files, + * with one stream of file per ring. Framework must store the files in pcapng + * format, allowing for easy merging and parsing with network analyzer tools. + * TODO: Since we're not longer dumping out the raw data, storing in separate + * pcapng files for parsing later must not work anymore. + */ + /** + * API to get the status of all ring buffers supported by driver. + * + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|, + * |WifiStatusCode.NOT_AVAILABLE|, + * |WifiStatusCode.UNKNOWN| + * @return ringBuffers Vector of |WifiDebugRingBufferStatus| corresponding to the + * status of each ring bufffer on the device. + */ + getDebugRingBuffersStatus() generates (WifiStatus status, + vec ringBuffers); + + /** + * API to trigger the debug data collection. + * + * @param ringName represent the name of the ring for which data collection + * shall start. This can be retrieved via the corresponding + * |WifiDebugRingBufferStatus|. + * @parm maxIntervalInSec Maximum interval in seconds for driver to invoke + * |onDebugRingBufferData|, ignore if zero. + * @parm minDataSizeInBytes: Minimum data size in buffer for driver to invoke + * |onDebugRingBufferData|, ignore if zero. + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|, + * |WifiStatusCode.NOT_AVAILABLE|, + * |WifiStatusCode.UNKNOWN| + */ + startLoggingToDebugRingBuffer(string ringName, + WifiDebugRingBufferVerboseLevel verboseLevel, + uint32_t maxIntervalInSec, + uint32_t minDataSizeInBytes) + generates (WifiStatus status); + + /** + * API to force dump data into the corresponding ring buffer. + * This is to be invoked during bugreport collection. + * + * @param ringName represent the name of the ring for which data collection + * shall be forced. This can be retrieved via the corresponding + * |WifiDebugRingBufferStatus|. + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|, + * |WifiStatusCode.NOT_AVAILABLE|, + * |WifiStatusCode.UNKNOWN| + */ + forceDumpToDebugRingBuffer(string ringName) generates (WifiStatus status); }; diff --git a/wifi/1.0/IWifiChipEventCallback.hal b/wifi/1.0/IWifiChipEventCallback.hal index 177d42e976..292b10f657 100644 --- a/wifi/1.0/IWifiChipEventCallback.hal +++ b/wifi/1.0/IWifiChipEventCallback.hal @@ -27,4 +27,47 @@ interface IWifiChipEventCallback { * property of the target ChipMode. */ oneway onChipReconfigured(ChipModeId modeId); + + /** + * Callbacks for reporting debug ring buffer data. + * + * The ring buffer data collection is event based: + * - Driver calls this callback when new records are available, the + * |WifiDebugRingBufferStatus| passed up to framework in the callback + * indicates to framework if more data is available in the ring buffer. + * It is not expected that driver will necessarily always empty the ring + * immediately as data is available, instead driver will report data + * every X seconds or if N bytes are available based on the parameters + * set via |startLoggingToDebugRingBuffer|. + * - In the case where a bug report has to be captured, framework will + * require driver to upload all data immediately. This is indicated to + * driver when framework calls |forceDumpToDebugRingBuffer|. The driver + * will start sending all available data in the indicated ring by repeatedly + * invoking this callback. + * + * @return status Status of the corresponding ring buffer. This should + * contain the name of the ring buffer on which the data is + * available. + * @return entries Vector of debug ring buffer data entries. These + * should be parsed based on the type of entry. + */ + /** Connectivity event data callback */ + oneway onDebugRingBufferConnectivityEventEntriesAvailable( + WifiDebugRingBufferStatus status, + vec entries); + + /** Power event data callback */ + oneway onDebugRingBufferPowerEventEntriesAvailable( + WifiDebugRingBufferStatus status, + vec entries); + + /** Wakelock event data callback */ + oneway onDebugRingBufferWakelockEventEntriesAvailable( + WifiDebugRingBufferStatus status, + vec entries); + + /** Vendor data event data callback */ + oneway onDebugRingBufferVendorDataEntriesAvailable( + WifiDebugRingBufferStatus status, + vec entries); }; diff --git a/wifi/1.0/types.hal b/wifi/1.0/types.hal index e7af6ee711..a66e6fdd3a 100644 --- a/wifi/1.0/types.hal +++ b/wifi/1.0/types.hal @@ -128,6 +128,11 @@ typedef int32_t Rssi; */ typedef uint8_t[6] MacAddress; +/** + * SSID type. 32 octets representing the network. + */ +typedef uint8_t[32] Ssid; + /** * BSSID type. 6 octets representing the physical address of an AP. */ @@ -536,7 +541,6 @@ enum NanMaxSize : uint32_t { */ typedef int32_t NanVersion; -/** NAN Iface specific types */ /** * NAN data path identifiers. */ @@ -732,7 +736,7 @@ enum NanDataPathChannelCfg : uint32_t { * Host can send Vendor specific attributes which the Discovery Engine can * enclose in Beacons and/or Service Discovery frames transmitted. * Below structure is used to populate that. - * TODO(b/32207606): This can be moved to vendor extension to the HIDL. + * TODO(b/32207606): This can be moved to vendor extension. */ struct NanTransmitVendorSpecificAttribute { /** @@ -812,7 +816,6 @@ struct NanEnableRequest { * Optional configuration of Enable request. * Each of the optional parameters have configure flag which * determine whether configuration is to be passed or not. - * TODO(b/32207606): Check if these config variables needed or not. */ bool validSupport5gVal; uint8_t support5gVal; @@ -2348,3 +2351,539 @@ struct RttResponder { WifiChannelInfo channel; RttPreamble preamble; }; + +/** + * Debug data specific types. + * TODO(b/32159498): Move to a separate debug_types.hal. + */ +typedef uint32_t WifiRingBufferId; + +/** + * Mask of flags present in |WifiDebugRingEntryHeader.flags| field. + */ +enum WifiDebugRingEntryFlags : uint8_t { + /** + * Set for binary entries + */ + HAS_BINARY = 1 << 0, + /** + * Set if 64 bits timestamp is present + */ + HAS_TIMESTAMP = 1 << 1, +}; + +/** + * This structure represent an entry within a debug ring buffer. + * Wifi driver are responsible to manage the debug ring buffer and write the + * debug information into those buffer. + * + * In general, the debug entries can be used to store meaningful 802.11 + * information (SME, MLME, connection and packet statistics) as well as vendor + * proprietary data that is specific to a specific driver or chipset. + * Binary entries can be used so as to store packet data or vendor specific + * information and will be treated as blobs of data by android framework. + * + * A user land process will be started by framework so as to periodically + * retrieve the data logged by drivers into their debug ring buffer, store the + * data into log files and include the logs into android bugreports. + */ +struct WifiDebugRingEntryHeader { + /** + * The size of |payload| excluding the header. + */ + uint16_t sizeInBytes; + /** + * Combination of |WifiDebugRingEntryFlags| values. + */ + uint8_t flags; + /** + * Present if |HAS_TIMESTAMP| bit is set. + */ + TimeStampInUs timestamp; +}; + +/** + * Below event types are used for both the connect and power event + * ring entries. + */ +enum WifiDebugRingEntryEventType : uint16_t { + /** + * Driver receives association command from kernel. + */ + ASSOCIATION_REQUESTED = 0, + AUTH_COMPLETE = 1, + ASSOC_COMPLETE = 2, + /** + * Firmware event indicating auth frames are sent. + */ + FW_AUTH_STARTED = 3, + /** + * Firmware event indicating assoc frames are sent. + */ + FW_ASSOC_STARTED = 4, + /** + * Firmware event indicating reassoc frames are sent. + */ + FW_RE_ASSOC_STARTED = 5, + DRIVER_SCAN_REQUESTED = 6, + DRIVER_SCAN_RESULT_FOUND = 7, + DRIVER_SCAN_COMPLETE = 8, + BACKGROUND_SCAN_STARTED = 9, + BACKGROUND_SCAN_COMPLETE = 10, + DISASSOCIATION_REQUESTED = 11, + RE_ASSOCIATION_REQUESTED = 12, + ROAM_REQUESTED = 13, + /** + * Received beacon from AP (event enabled only in verbose mode). + */ + BEACON_RECEIVED = 14, + /** + * Firmware has triggered a roam scan (not g-scan). + */ + ROAM_SCAN_STARTED = 15, + /** + * Firmware has completed a roam scan (not g-scan). + */ + ROAM_SCAN_COMPLETE = 16, + /** + * Firmware has started searching for roam candidates (with reason =xx). + */ + ROAM_SEARCH_STARTED = 17, + /** + * Firmware has stopped searching for roam candidates (with reason =xx). + */ + ROAM_SEARCH_STOPPED = 18, + /** + * Received channel switch anouncement from AP. + */ + CHANNEL_SWITCH_ANOUNCEMENT = 20, + /** + * Firmware start transmit eapol frame, with EAPOL index 1-4. + */ + FW_EAPOL_FRAME_TRANSMIT_START = 21, + /** + * Firmware gives up eapol frame, with rate, success/failure and number + * retries. + */ + FW_EAPOL_FRAME_TRANSMIT_STOP = 22, + /** + * Kernel queue EAPOL for transmission in driver with EAPOL index 1-4. + */ + DRIVER_EAPOL_FRAME_TRANSMIT_REQUESTED = 23, + /** + * With rate, regardless of the fact that EAPOL frame is accepted or + * rejected by firmware. + */ + FW_EAPOL_FRAME_RECEIVED = 24, + /** + * With rate, and eapol index, driver has received EAPOL frame and will + * queue it up to wpa_supplicant. + */ + DRIVER_EAPOL_FRAME_RECEIVED = 26, + /** + * With success/failure, parameters + */ + BLOCK_ACK_NEGOTIATION_COMPLETE = 27, + BT_COEX_BT_SCO_START = 28, + BT_COEX_BT_SCO_STOP = 29, + /** + * For paging/scan etc., when BT starts transmiting twice per BT slot. + */ + BT_COEX_BT_SCAN_START = 30, + BT_COEX_BT_SCAN_STOP = 31, + BT_COEX_BT_HID_START = 32, + BT_COEX_BT_HID_STOP = 33, + /** + * Firmware sends auth frame in roaming to next candidate. + */ + ROAM_AUTH_STARTED = 34, + /** + * Firmware receive auth confirm from ap + */ + ROAM_AUTH_COMPLETE = 35, + /** + * Firmware sends assoc/reassoc frame in roaming to next candidate. + */ + ROAM_ASSOC_STARTED = 36, + /** + * Firmware receive assoc/reassoc confirm from ap. + */ + ROAM_ASSOC_COMPLETE = 37, + /** + * Firmware sends stop BACKGROUND_SCAN + */ + BACKGROUND_SCAN_STOP = 38, + /** + * Firmware indicates BACKGROUND_SCAN scan cycle started. + */ + BACKGROUND_SCAN_CYCLE_STARTED = 39, + /** + * Firmware indicates BACKGROUND_SCAN scan cycle completed. + */ + BACKGROUND_SCAN_CYCLE_COMPLETED = 40, + /** + * Firmware indicates BACKGROUND_SCAN scan start for a particular bucket. + */ + BACKGROUND_SCAN_BUCKET_STARTED = 41, + /** + * Firmware indicates BACKGROUND_SCAN scan completed for for a particular bucket. + */ + BACKGROUND_SCAN_BUCKET_COMPLETED = 42, + /** + * Event received from firmware about BACKGROUND_SCAN scan results being available. + */ + BACKGROUND_SCAN_RESULTS_AVAILABLE = 43, + /** + * Event received from firmware with BACKGROUND_SCAN capabilities. + */ + BACKGROUND_SCAN_CAPABILITIES = 44, + /** + * Event received from firmware when eligible candidate is found. + */ + ROAM_CANDIDATE_FOUND = 45, + /** + * Event received from firmware when roam scan configuration gets + * enabled or disabled. + */ + ROAM_SCAN_CONFIG = 46, + /** + * Firmware/driver timed out authentication. + */ + AUTH_TIMEOUT = 47, + /** + * Firmware/driver timed out association. + */ + ASSOC_TIMEOUT = 48, + /** + * Firmware/driver encountered allocation failure. + */ + MEM_ALLOC_FAILURE = 49, + /** + * Driver added a PNO network in firmware. + */ + DRIVER_PNO_ADD = 50, + /** + * Driver removed a PNO network in firmware. + */ + DRIVER_PNO_REMOVE = 51, + /** + * Driver received PNO networks found indication from firmware. + */ + DRIVER_PNO_NETWORK_FOUND = 52, + /** + * Driver triggered a scan for PNO networks. + */ + DRIVER_PNO_SCAN_REQUESTED = 53, + /** + * Driver received scan results of PNO networks. + */ + DRIVER_PNO_SCAN_RESULT_FOUND = 54, + /** + * Driver updated scan results from PNO networks to cfg80211. + */ + DRIVER_PNO_SCAN_COMPLETE = 55, +}; + +/** + * Parameters of the various events are a sequence of TLVs + * (type, length, value). The types for different TLV's are defined below. + */ +enum WifiDebugRingEntryEventTlvType : uint16_t { + /** + * Take a byte stream as parameter. + */ + VENDOR_SPECIFIC = 0, + /** + * Takes a MAC address as parameter. + */ + BSSID = 1, + /** + * Takes a MAC address as parameter. + */ + ADDR = 2, + /** + * Takes an SSID as parameter. + */ + SSID = 3, + /** + * Takes an integer as parameter. + */ + STATUS = 4, + /** + * Takes a |WifiChannelInfo| struct as parameter. + */ + CHANNEL_SPEC = 5, + /** + * Takes a MAC address as parameter. + */ + ADDR_1 = 6, + /** + * Takes a MAC address as parameter. + */ + ADDR_2 = 7, + /** + * Takes a MAC address as parameter. + */ + ADDR_3 = 8, + /** + * Takes a MAC address as parameter. + */ + ADDR_4 = 9, + /** + * Takes a TSF value as parameter. + */ + TSF = 10, + /** + * Takes one or more specific 802.11 IEs parameter IEs are in turn + * indicated in TLV format as per 802.11, spec. + */ + IE = 11, + /** + * Takes a string interface name as parameter. + */ + IFACE_NAME = 12, + /** + * Takes a integer reason code as per 802.11 as parameter. + */ + REASON_CODE = 13, + /** + * Takes an integer representing wifi rate in 1 mbps as parameter. + */ + RATE_MBPS = 14, + /** + * Takes an integer as parameter. + */ + REQUEST_ID = 15, + /** + * Takes an integer as parameter. + */ + BUCKET_ID = 16, + /** + * Takes a |BackgroundScanParameters| struct as parameter. + */ + BACKGROUND_SCAN_PARAMS = 17, + /** + * Takes a |BackgroundScanCapabilities| struct as parameter. + */ + BACKGROUND_SCAN_CAPABILITIES = 18, + /** + * Takes an integer as parameter. + */ + SCAN_ID = 19, + /** + * Takes an integer as parameter. + */ + RSSI = 20, + /** + * Takes a |WifiChannelInMhz| as parameter. + */ + CHANNEL = 21, + /** + * Takes an integer as parameter. + */ + LINK_ID = 22, + /** + * Takes an integer as parameter. + */ + LINK_ROLE = 23, + /** + * Takes an integer as parameter. + */ + LINK_STATE = 24, + /** + * Takes an integer as parameter. + */ + LINK_TYPE = 25, + /** + * Takes an integer as parameter. + */ + TSCO = 26, + /** + * Takes an integer as parameter. + */ + RSCO = 27, + /** + * Takes an integer as parameter. + * M1=1, M2=2, M3=3, M=4, + */ + EAPOL_MESSAGE_TYPE = 28, +}; + +/** + * Used to describe a specific TLV in an event entry. + */ +struct WifiDebugRingEntryEventTlv { + WifiDebugRingEntryEventTlvType type; + /** + * All possible types of values that can be held in the TLV. + * Note: This should ideally be a union. But, since this HIDL package + * is going to be used by a java client, we cannot have unions in this + * package. + */ + /* TODO(b/32207606): This can be moved to vendor extension. */ + vec vendorSpecific; + Bssid bssid; + MacAddress addr; + Ssid ssid; + WifiChannelInfo channelSpec; + uint64_t tsf; + vec ie; + string ifaceName; + StaBackgroundScanParameters bgScanParams; + StaBackgroundScanCapabilities bgScanCapabilities; + Rssi rssi; + WifiChannelInMhz channel; + uint32_t integerVal; +}; + +/** + * Used to describe a connect event ring entry. + */ +struct WifiDebugRingEntryConnectivityEvent { + /** + * Ring entry header. + */ + WifiDebugRingEntryHeader header; + /** + * Type of connection event. + */ + WifiDebugRingEntryEventType event; + /** + * Separate parameter structure per event to be provided and optional data. + * The event data is expected to include an official android part, with some + * parameter as transmit rate, num retries, num scan result found, etc. + * event data can include a vendor proprietary part which is understood by + * the vendor only. + */ + vec tlvs; +}; + +/** + * Used to describe a power event ring entry. + */ +struct WifiDebugRingEntryPowerEvent { + /** + * Ring entry header. + */ + WifiDebugRingEntryHeader header; + /** + * Type of power event. + */ + WifiDebugRingEntryEventType event; + /** + * Separate parameter structure per event to be provided and optional data. + * The event data is expected to include an official android part, with some + * parameter as transmit rate, num retries, num scan result found, etc. + * event data can include a vendor proprietary part which is understood by + * the vendor only. + */ + vec tlvs; +}; + +/** + * Used to describe a wakelock event ring entry. + */ +struct WifiDebugRingEntryWakelockEvent { + /** + * Ring entry header. + */ + WifiDebugRingEntryHeader header; + /** + * true = wake lock acquired. + * false = wake lock released. + */ + bool wasAcquired; + /** + * Reason why this wake lock is taken. + * This is a vendor defined reason and can only be understood by the + * vendor. + */ + uint32_t vendorSpecificReason; + /** + * Wake lock name. + */ + string wakelockName; +}; + +/** + * Used to describe a vendor specific data ring entry. + */ +struct WifiDebugRingEntryVendorData { + /** + * Ring entry header. + */ + WifiDebugRingEntryHeader header; + /** + * This is a blob that will only be understood by the + * vendor. + */ + vec vendorData; +}; + +/** + * Flags describing each debug ring buffer. + */ +enum WifiDebugRingBufferFlags : uint32_t { + HAS_BINARY_ENTRIES = 1 << 0, + HAS_ASCII_ENTRIES = 1 << 1, + HAS_PER_PACKET_ENTRIES = 1 << 2, +}; + +/** + * Struct describing each debug ring buffer supported by + * the device. + */ +struct WifiDebugRingBufferStatus { + /** + * Name of this debug ring buffer. + */ + string ringName; + /** + * Combination of |WifiDebugRingBufferFlags| values. + */ + uint32_t flags; + /** + * Unique integer representing the ring. + */ + WifiRingBufferId ringId; + /** + * Total memory size allocated for the buffer. + */ + uint32_t sizeInBytes; + /** + * Amount of free space in the buffer. + */ + uint32_t freeSizeInBytes; + /** + * Verbose level for ring buffer. + */ + uint32_t verboseLevel; +}; + +/** + * Verbose logging level to set for each debug ring buffer supported + * by the device. + */ +enum WifiDebugRingBufferVerboseLevel : uint32_t { + /** + * Level 0 corresponds to no collection, and it makes log handler + * stop by no more events from driver. + */ + NONE = 0, + /** + * Level 1 correspond to normal log level, with minimal user impact. + * This is the default value. + */ + DEFAULT = 1, + /** + * Level 2 is enabled when user is lazily trying to reproduce a problem, + * wifi performances and power can be impacted but device should not + * otherwise be significantly impacted. + */ + VERBOSE = 2, + /** + * Level 3 is used when trying to actively debug a problem. + * This will cause sever performance degradation. + */ + EXCESSIVE = 3 +}; From fe9ad36cb272d346b42e54d51ff8aa089554f9e7 Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Wed, 19 Oct 2016 16:45:12 -0700 Subject: [PATCH 10/24] wifi(interface): Add wifi debug packet fate related interface The packet fate debug mechanism is used to track the state of all the packets transmitted/received during the association process. Also, Add the various debug capabilities in the respective interfaces. All ring buffer, driver/firmware dump, etc related capabilities are in IWifiChip object. The packet fate capability is exposed in IWifiStaIface object. Bug: 32221997 Test: ./hardware/interfaces/update-makefiles.sh Change-Id: Ic6bf49d682b70a1cdcd18c69fc25a544921bd548 --- wifi/1.0/Android.mk | 204 +++++++++++++++++++++++++++++++++++++ wifi/1.0/IWifiChip.hal | 48 +++++++++ wifi/1.0/IWifiStaIface.hal | 94 +++++++++++++++++ wifi/1.0/types.hal | 176 ++++++++++++++++++++++++++++++++ 4 files changed, 522 insertions(+) diff --git a/wifi/1.0/Android.mk b/wifi/1.0/Android.mk index e8122724c0..a3901f4647 100644 --- a/wifi/1.0/Android.mk +++ b/wifi/1.0/Android.mk @@ -1542,6 +1542,40 @@ $(GEN): $(LOCAL_PATH)/types.hal $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) +# +# Build types.hal (WifiDebugPacketFateFrameInfo) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/WifiDebugPacketFateFrameInfo.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.WifiDebugPacketFateFrameInfo + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (WifiDebugPacketFateFrameType) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/WifiDebugPacketFateFrameType.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.WifiDebugPacketFateFrameType + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + # # Build types.hal (WifiDebugRingBufferFlags) # @@ -1746,6 +1780,74 @@ $(GEN): $(LOCAL_PATH)/types.hal $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) +# +# Build types.hal (WifiDebugRxPacketFate) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/WifiDebugRxPacketFate.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.WifiDebugRxPacketFate + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (WifiDebugRxPacketFateReport) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/WifiDebugRxPacketFateReport.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.WifiDebugRxPacketFateReport + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (WifiDebugTxPacketFate) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/WifiDebugTxPacketFate.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.WifiDebugTxPacketFate + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (WifiDebugTxPacketFateReport) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/WifiDebugTxPacketFateReport.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.WifiDebugTxPacketFateReport + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + # # Build types.hal (WifiInformationElement) # @@ -3667,6 +3769,40 @@ $(GEN): $(LOCAL_PATH)/types.hal $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) +# +# Build types.hal (WifiDebugPacketFateFrameInfo) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/WifiDebugPacketFateFrameInfo.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.WifiDebugPacketFateFrameInfo + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (WifiDebugPacketFateFrameType) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/WifiDebugPacketFateFrameType.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.WifiDebugPacketFateFrameType + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + # # Build types.hal (WifiDebugRingBufferFlags) # @@ -3871,6 +4007,74 @@ $(GEN): $(LOCAL_PATH)/types.hal $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) +# +# Build types.hal (WifiDebugRxPacketFate) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/WifiDebugRxPacketFate.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.WifiDebugRxPacketFate + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (WifiDebugRxPacketFateReport) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/WifiDebugRxPacketFateReport.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.WifiDebugRxPacketFateReport + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (WifiDebugTxPacketFate) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/WifiDebugTxPacketFate.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.WifiDebugTxPacketFate + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (WifiDebugTxPacketFateReport) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/WifiDebugTxPacketFateReport.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.WifiDebugTxPacketFateReport + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + # # Build types.hal (WifiInformationElement) # diff --git a/wifi/1.0/IWifiChip.hal b/wifi/1.0/IWifiChip.hal index 29425b1f5e..487a5aefc1 100644 --- a/wifi/1.0/IWifiChip.hal +++ b/wifi/1.0/IWifiChip.hal @@ -130,6 +130,37 @@ interface IWifiChip { string firmwareDescription; }; + /** + * Capabilities exposed by this chip. + */ + enum ChipCapabilityMask : uint32_t { + /** + * Memory dump of Firmware. + */ + DEBUG_MEMORY_FIRMWARE_DUMP_SUPPORTED = 1 << 0, + /** + * Memory dump of Driver. + */ + DEBUG_MEMORY_DRIVER_DUMP_SUPPORTED = 1 << 1, + /** + * Connectivity events reported via debug ring buffer. + */ + DEBUG_RING_BUFFER_CONNECT_EVENT_SUPPORTED = 1 << 2, + /** + * Power events reported via debug ring buffer. + */ + DEBUG_RING_BUFFER_POWER_EVENT_SUPPORTED = 1 << 3, + /** + * Wakelock events reported via debug ring buffer. + */ + DEBUG_RING_BUFFER_WAKELOCK_EVENT_SUPPORTED = 1 << 4, + /** + * Vendor data reported via debug ring buffer. + * This mostly contains firmware event logs. + */ + DEBUG_RING_BUFFER_VENDOR_DATA_SUPPORTED = 1 << 5, + }; + /** * Get the id assigned to this chip. * @@ -155,6 +186,19 @@ interface IWifiChip { */ registerEventCallback(IWifiChipEventCallback callback) generates (WifiStatus status); + /** + * Get the capabilities supported by this chip. + * + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|, + * |WifiStatusCode.ERROR_NOT_AVAILABLE|, + * |WifiStatusCode.ERROR_UNKNOWN| + * @return capabilities Bitset of |ChipCapabilityMask| values. + */ + getCapabilities() generates (WifiStatus status, uint32_t capabilities); + /** * Get the set of operation modes that the chip supports. * @@ -464,6 +508,7 @@ interface IWifiChip { * Possible status codes: * |WifiStatusCode.SUCCESS|, * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|, + * |WifiStatusCode.ERROR_NOT_SUPPORTED|, * |WifiStatusCode.NOT_AVAILABLE|, * |WifiStatusCode.UNKNOWN| * @return ringBuffers Vector of |WifiDebugRingBufferStatus| corresponding to the @@ -486,6 +531,7 @@ interface IWifiChip { * Possible status codes: * |WifiStatusCode.SUCCESS|, * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|, + * |WifiStatusCode.ERROR_NOT_SUPPORTED|, * |WifiStatusCode.NOT_AVAILABLE|, * |WifiStatusCode.UNKNOWN| */ @@ -506,6 +552,8 @@ interface IWifiChip { * Possible status codes: * |WifiStatusCode.SUCCESS|, * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|, + * |WifiStatusCode.ERROR_NOT_SUPPORTED|, + * |WifiStatusCode.ERROR_NOT_STARTED|, * |WifiStatusCode.NOT_AVAILABLE|, * |WifiStatusCode.UNKNOWN| */ diff --git a/wifi/1.0/IWifiStaIface.hal b/wifi/1.0/IWifiStaIface.hal index 3ca9b7d084..41b2bad7f6 100644 --- a/wifi/1.0/IWifiStaIface.hal +++ b/wifi/1.0/IWifiStaIface.hal @@ -44,6 +44,10 @@ interface IWifiStaIface extends IWifiIface { * If set indicates that the link layer stats APIs are supported. */ LINK_LAYER_STATS = 1 << 2, + /** + * Tracks connection packets' fate. + */ + DEBUG_PACKET_FATE_SUPPORTED = 1 << 3 }; /** @@ -195,6 +199,7 @@ interface IWifiStaIface extends IWifiIface { * |WifiStatusCode.SUCCESS|, * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, * |WifiStatusCode.ERROR_NOT_SUPPORTED|, + * |WifiStatusCode.ERROR_NOT_STARTED|, * |WifiStatusCode.ERROR_NOT_AVAILABLE|, * |WifiStatusCode.ERROR_UNKNOWN| */ @@ -230,6 +235,7 @@ interface IWifiStaIface extends IWifiIface { * |WifiStatusCode.SUCCESS|, * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, * |WifiStatusCode.ERROR_NOT_SUPPORTED|, + * |WifiStatusCode.ERROR_NOT_STARTED|, * |WifiStatusCode.ERROR_NOT_AVAILABLE|, * |WifiStatusCode.ERROR_UNKNOWN| */ @@ -245,9 +251,97 @@ interface IWifiStaIface extends IWifiIface { * |WifiStatusCode.SUCCESS|, * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, * |WifiStatusCode.ERROR_NOT_SUPPORTED|, + * |WifiStatusCode.ERROR_NOT_STARTED|, * |WifiStatusCode.ERROR_NOT_AVAILABLE|, * |WifiStatusCode.ERROR_UNKNOWN| * @return stats Instance of |LinkLayerStats|. */ getLinkLayerStats() generates (WifiStatus status, StaLinkLayerStats stats); + + /** + * API to start packet fate monitoring. + * - Once stared, monitoring must remain active until HAL is unloaded. + * - When HAL is unloaded, all packet fate buffers must be cleared. + * - The packet fates are used to monitor the state of packets transmitted/ + * received during association. + * + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, + * |WifiStatusCode.ERROR_NOT_SUPPORTED|, + * |WifiStatusCode.ERROR_NOT_AVAILABLE|, + * |WifiStatusCode.ERROR_UNKNOWN| + */ + startDebugPacketFateMonitoring() generates (WifiStatus status); + + /** + * API to stop packet fate monitoring. + * + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, + * |WifiStatusCode.ERROR_NOT_SUPPORTED|, + * |WifiStatusCode.ERROR_NOT_STARTED|, + * |WifiStatusCode.ERROR_NOT_AVAILABLE|, + * |WifiStatusCode.ERROR_UNKNOWN| + */ + stopDebugPacketFateMonitoring() generates (WifiStatus status); + + /** + * API to retrieve fates of outbound packets. + * - HAL implementation must return the fates of + * all the frames transmitted for the most recent association. + * The fate reports must follow the same order as their respective + * packets. + * - HAL implementation may choose (but is not required) to include + * reports for management frames. + * - Packets reported by firmware, but not recognized by driver, + * must be included. However, the ordering of the corresponding + * reports is at the discretion of HAL implementation. + * - Framework must be able to call this API multiple times for the same + * association. + * + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, + * |WifiStatusCode.ERROR_NOT_SUPPORTED|, + * |WifiStatusCode.ERROR_NOT_STARTED|, + * |WifiStatusCode.ERROR_NOT_AVAILABLE|, + * |WifiStatusCode.ERROR_UNKNOWN| + * @return fates Vector of |WifiDebugTxPacketFateReport| instances corresponding + * to the packet fates. + */ + getDebugTxPacketFates() + generates (WifiStatus status, vec fates); + + /** + * API to retrieve fates of inbound packets. + * - HAL implementation must return the fates of + * all the frames received for the most recent association. + * The fate reports must follow the same order as their respective + * packets. + * - HAL implementation may choose (but is not required) to include + * reports for management frames. + * - Packets reported by firmware, but not recognized by driver, + * must be included. However, the ordering of the corresponding + * reports is at the discretion of HAL implementation. + * - Framework must be able to call this API multiple times for the same + * association. + * + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, + * |WifiStatusCode.ERROR_NOT_SUPPORTED|, + * |WifiStatusCode.ERROR_NOT_STARTED|, + * |WifiStatusCode.ERROR_NOT_AVAILABLE|, + * |WifiStatusCode.ERROR_UNKNOWN| + * @return fates Vector of |WifiDebugRxPacketFateReport| instances corresponding + * to the packet fates. + */ + getDebugRxPacketFates() + generates (WifiStatus status, vec fates); }; diff --git a/wifi/1.0/types.hal b/wifi/1.0/types.hal index a66e6fdd3a..0c3a2119ef 100644 --- a/wifi/1.0/types.hal +++ b/wifi/1.0/types.hal @@ -30,6 +30,7 @@ enum WifiStatusCode : uint32_t { ERROR_WIFI_RTT_CONTROLLER_INVALID, ERROR_NOT_SUPPORTED, ERROR_NOT_AVAILABLE, + ERROR_NOT_STARTED, ERROR_INVALID_ARGS, ERROR_UNKNOWN }; @@ -2887,3 +2888,178 @@ enum WifiDebugRingBufferVerboseLevel : uint32_t { */ EXCESSIVE = 3 }; + +/** + * Enum describing the fate of the TX packets. + */ +enum WifiDebugTxPacketFate : uint32_t { + /** + * Sent over air and ACKed. + */ + ACKED, + /** + * Sent over air but not ACKed. (Normal for broadcast/multicast.) + */ + SENT, + /** + * Queued within firmware, but not yet sent over air. + */ + FW_QUEUED, + /** + * Dropped by firmware as invalid. E.g. bad source address, bad checksum, + * or invalid for current state. + */ + FW_DROP_INVALID, + /** + * Dropped by firmware due to lack of buffer space. + */ + FW_DROP_NOBUFS, + /** + * Dropped by firmware for any other reason. Includes frames that were sent + * by driver to firmware, but unaccounted for by firmware. + */ + FW_DROP_OTHER, + /** + * Queued within driver, not yet sent to firmware. + */ + DRV_QUEUED, + /** + * Dropped by driver as invalid. E.g. bad source address, or invalid for + * current state. + */ + DRV_DROP_INVALID, + /** + * Dropped by driver due to lack of buffer space. + */ + DRV_DROP_NOBUFS, + /** + * Dropped by driver for any other reason. + */ + DRV_DROP_OTHER, +}; + +/** + * Enum describing the fate of the TX packets. + */ +enum WifiDebugRxPacketFate : uint32_t { + /** + * Valid and delivered to network stack (e.g., netif_rx()). + */ + SUCCESS, + /** + * Queued within firmware, but not yet sent to driver. + */ + FW_QUEUED, + /** + * Dropped by firmware due to host-programmable filters. + */ + FW_DROP_FILTER, + /** + * Dropped by firmware as invalid. E.g. bad checksum, decrypt failed, + * or invalid for current state. + */ + FW_DROP_INVALID, + /** + * Dropped by firmware due to lack of buffer space. + */ + FW_DROP_NOBUFS, + /** + * Dropped by firmware for any other reason. + */ + FW_DROP_OTHER, + /** + * Queued within driver, not yet delivered to network stack. + */ + DRV_QUEUED, + /** + * Dropped by driver due to filter rules. + */ + DRV_DROP_FILTER, + /** + * Dropped by driver as invalid. E.g. not permitted in current state. + */ + DRV_DROP_INVALID, + /** + * Dropped by driver due to lack of buffer space. + */ + DRV_DROP_NOBUFS, + /** + * Dropped by driver for any other reason. + */ + DRV_DROP_OTHER, +}; + +/** + * Type of frame transmitted/received. + */ +enum WifiDebugPacketFateFrameType : uint32_t { + UNKNOWN, + ETHERNET_II, + MGMT_80211, +}; + +/** + * Information regarding the frame transmitted/received. + */ +struct WifiDebugPacketFateFrameInfo { + /** + * The type of MAC-layer frame that this frame_info holds. + * - For data frames, use FRAME_TYPE_ETHERNET_II. + * - For management frames, use FRAME_TYPE_80211_MGMT. + * - If the type of the frame is unknown, use FRAME_TYPE_UNKNOWN. + */ + WifiDebugPacketFateFrameType frameType; + /** + * The number of bytes included in |frameContent|. + * If the frame contents are missing (e.g. RX frame dropped in firmware), + * |frameLen| must be set to 0. + */ + uint64_t frameLen; + /** + * Host clock when this frame was received by the driver (either outbound + * from the host network stack, or inbound from the firmware). + * - The timestamp must be taken from a clock which includes time the host + * spent suspended (e.g. ktime_get_boottime()). + * - If no host timestamp is available (e.g. RX frame was dropped in firmware), + * this field must be set to 0. + */ + TimeStampInUs driverTimestampUsec; + /** + * Firmware clock when this frame was received by the firmware + * (either outbound from the host, or inbound from a remote station). + * - The timestamp must be taken from a clock which includes time firmware + * spent suspended (if applicable). + * - If no firmware timestamp is available (e.g. TX frame was dropped by + * driver), this field must be set to 0. + * - Consumers of |frameInfo| must not assume any synchronization between + * driver and firmware clocks. + */ + TimeStampInUs firmwareTimestampUsec; + /** + * Actual frame content. This is the raw bytes of the corresponding packet. + * - Should be provided for TX frames originated by the host. + * - Should be provided for RX frames received by the driver. + * - Optionally provided for TX frames originated by firmware. + * (At discretion of HAL implementation.) + * - Optionally provided for RX frames dropped in firmware. + * (At discretion of HAL implementation.) + * - If frame content is not provided, |frameLen| must be set to 0. + */ + vec frameContent; +}; + +/** + * Struct describing packet fate report for each Rx frame. + */ +struct WifiDebugTxPacketFateReport { + WifiDebugTxPacketFate fate; + WifiDebugPacketFateFrameInfo frameInf; +}; + +/** + * Struct describing packet fate report for each Rx frame. + */ +struct WifiDebugRxPacketFateReport { + WifiDebugRxPacketFate fate; + WifiDebugPacketFateFrameInfo frameInfo; +}; From e0724f98b0fe7f9bf2257d3a1351839f0b19224b Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Thu, 20 Oct 2016 09:33:26 -0700 Subject: [PATCH 11/24] wifi(interface): Add wifi host debug wake up reason stats These stats are used to determine if the device is being woken up frequently by the wlan chipset. The stats structure describe all the various resons for which the host was woken up by the wlan chipset (firmware). Bug: 32221997 Test: ./hardware/interfaces/update-makefiles.sh Change-Id: Id52915348fef0283affcd834c6f1db5055e54ace --- wifi/1.0/Android.mk | 136 +++++++++++++++++++++++++++++++++++++++++ wifi/1.0/IWifiChip.hal | 22 +++++++ wifi/1.0/types.hal | 107 ++++++++++++++++++++++++++++++++ 3 files changed, 265 insertions(+) diff --git a/wifi/1.0/Android.mk b/wifi/1.0/Android.mk index a3901f4647..3a27ed8001 100644 --- a/wifi/1.0/Android.mk +++ b/wifi/1.0/Android.mk @@ -1542,6 +1542,74 @@ $(GEN): $(LOCAL_PATH)/types.hal $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) +# +# Build types.hal (WifiDebugHostWakeReasonRxIcmpPacketDetails) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/WifiDebugHostWakeReasonRxIcmpPacketDetails.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.WifiDebugHostWakeReasonRxIcmpPacketDetails + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (WifiDebugHostWakeReasonRxMulticastPacketDetails) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/WifiDebugHostWakeReasonRxMulticastPacketDetails.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.WifiDebugHostWakeReasonRxMulticastPacketDetails + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (WifiDebugHostWakeReasonRxPacketDetails) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/WifiDebugHostWakeReasonRxPacketDetails.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.WifiDebugHostWakeReasonRxPacketDetails + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (WifiDebugHostWakeReasonStats) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/WifiDebugHostWakeReasonStats.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.WifiDebugHostWakeReasonStats + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + # # Build types.hal (WifiDebugPacketFateFrameInfo) # @@ -3769,6 +3837,74 @@ $(GEN): $(LOCAL_PATH)/types.hal $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) +# +# Build types.hal (WifiDebugHostWakeReasonRxIcmpPacketDetails) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/WifiDebugHostWakeReasonRxIcmpPacketDetails.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.WifiDebugHostWakeReasonRxIcmpPacketDetails + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (WifiDebugHostWakeReasonRxMulticastPacketDetails) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/WifiDebugHostWakeReasonRxMulticastPacketDetails.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.WifiDebugHostWakeReasonRxMulticastPacketDetails + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (WifiDebugHostWakeReasonRxPacketDetails) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/WifiDebugHostWakeReasonRxPacketDetails.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.WifiDebugHostWakeReasonRxPacketDetails + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (WifiDebugHostWakeReasonStats) +# +GEN := $(intermediates)/android/hardware/wifi/1.0/WifiDebugHostWakeReasonStats.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.WifiDebugHostWakeReasonStats + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + # # Build types.hal (WifiDebugPacketFateFrameInfo) # diff --git a/wifi/1.0/IWifiChip.hal b/wifi/1.0/IWifiChip.hal index 487a5aefc1..3c085c345c 100644 --- a/wifi/1.0/IWifiChip.hal +++ b/wifi/1.0/IWifiChip.hal @@ -159,6 +159,10 @@ interface IWifiChip { * This mostly contains firmware event logs. */ DEBUG_RING_BUFFER_VENDOR_DATA_SUPPORTED = 1 << 5, + /** + * Host wake reasons stats collection. + */ + DEBUG_HOST_WAKE_REASON_STATS = 1 << 6, }; /** @@ -558,4 +562,22 @@ interface IWifiChip { * |WifiStatusCode.UNKNOWN| */ forceDumpToDebugRingBuffer(string ringName) generates (WifiStatus status); + + /** + * API to retrieve the wifi wake up reason stats for debugging. + * The driver is expected to start maintaining these stats once the chip + * is configured using |configureChip|. These stats must be reset whenever + * the chip is reconfigured or the HAL is stopped. + * + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|, + * |WifiStatusCode.ERROR_NOT_SUPPORTED|, + * |WifiStatusCode.NOT_AVAILABLE|, + * |WifiStatusCode.UNKNOWN| + * @return stats Instance of |WifiDebugHostWakeReasonStats|. + */ + getDebugHostWakeReasonStats() + generates (WifiStatus status, WifiDebugHostWakeReasonStats stats); }; diff --git a/wifi/1.0/types.hal b/wifi/1.0/types.hal index 0c3a2119ef..066662c1f9 100644 --- a/wifi/1.0/types.hal +++ b/wifi/1.0/types.hal @@ -3063,3 +3063,110 @@ struct WifiDebugRxPacketFateReport { WifiDebugRxPacketFate fate; WifiDebugPacketFateFrameInfo frameInfo; }; + +/** + * Struct capturing the count of all rx packets that caused + * host wakeup. + */ +struct WifiDebugHostWakeReasonRxPacketDetails { + /** + * Total rx unicast packet which woke up host. + */ + uint32_t rxUnicastCnt; + /** + * Total rx multicast packet which woke up host. + */ + uint32_t rxMulticastCnt; + /** + * Total rx broadcast packet which woke up host. + */ + uint32_t rxBroadcastCnt; +}; + +/** + * Struct capturing the count of all rx multicast packets that caused + * host wakeup. + */ +struct WifiDebugHostWakeReasonRxMulticastPacketDetails { + /** + * Rx wake packet was ipv4 multicast. + */ + uint32_t ipv4RxMulticastAddrCnt; + /** + * Rx wake packet was ipv6 multicast. + */ + uint32_t ipv6RxMulticastAddrCnt; + /** + * Rx wake packet was non-ipv4 and non-ipv6. + */ + uint32_t otherRxMulticastAddrCnt; +}; + +/** + * Struct capturing the count of all rx ICMP packets that caused + * host wakeup. + */ +struct WifiDebugHostWakeReasonRxIcmpPacketDetails { + /** + * Wake icmp packet count. + */ + uint32_t icmpPkt; + /** + * Wake icmp6 packet count. + */ + uint32_t icmp6Pkt; + /** + * Wake icmp6 RA packet count. + */ + uint32_t icmp6Ra; + /** + * Wake icmp6 NA packet count. + */ + uint32_t icmp6Na; + /** + * Wake icmp6 NS packet count. + */ + uint32_t icmp6Ns; +}; + +/** + * Structure capturing the count of all the wireless related host wakeup. + * This is used to capture all the reasons why the host processor + * (WLAN driver) was woken up by the WLAN firmware. + * These stats may be used to debug any power issues caused due to frequent + * wakeup of the host processor by the WLAN firmware. + */ +struct WifiDebugHostWakeReasonStats { + /** + * Total count of cmd/event wakes. + * These must account for all wakeups due to WLAN management + * commands/events received over the air. + */ + uint32_t totalCmdEventWakeCnt; + /** + * Vector of wake counts per cmd/event type. + * The number of command types and their meaning is only understood by the + * vendor. + */ + vec cmdEventWakeCntPerType; + /** + * Total count of drive/fw wakes. + * These must account for all wakeups due to local driver/firmware + * interactions. These include all vendor implementation specific + * interactions like any heart-beat monitoring, Bus management, etc. + */ + uint32_t totalDriverFwLocalWakeCnt; + /** + * Vector of wake counts per driver/firmware interaction type. + * The number of command types and their meaning is only understood by the + * vendor. + */ + vec driverFwLocalWakeCntPerType; + /** + * Total data rx packets, that woke up host. + */ + uint32_t totalRxPacketWakeCnt; + WifiDebugHostWakeReasonRxPacketDetails rxPktWakeDetails; + WifiDebugHostWakeReasonRxMulticastPacketDetails rxMulticastPkWakeDetails; + WifiDebugHostWakeReasonRxIcmpPacketDetails rxIcmpPkWakeDetails; +}; From 02caa1b821e101bf74b528e5fd64d794633a3e6c Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Wed, 26 Oct 2016 15:56:17 -0700 Subject: [PATCH 12/24] wifi(interface): Add status for all methods Add missing status returns for a few HIDL methods. This is to keep the interface consistent. Bug: 32146455 Test: update_makefile.sh Change-Id: Ia66fe4d00e884e5ce1e1906db77bb5ffdaebffdd --- wifi/1.0/IWifi.hal | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/wifi/1.0/IWifi.hal b/wifi/1.0/IWifi.hal index 3166691313..a6329206ec 100644 --- a/wifi/1.0/IWifi.hal +++ b/wifi/1.0/IWifi.hal @@ -34,10 +34,15 @@ interface IWifi { * * @param callback An instance of the |IWifiEventCallback| HIDL interface * object. + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.UNKNOWN| */ @entry @callflow(next={"*"}) - oneway registerEventCallback(IWifiEventCallback callback); + registerEventCallback(IWifiEventCallback callback) + generates (WifiStatus status); /** * Get the current state of the HAL. @@ -75,7 +80,7 @@ interface IWifi { * @return status WifiStatus of the operation. * Possible status codes: * |WifiStatusCode.SUCCESS|, - * |WifiStatusCode.NOT_AVAILABLE|, + * |WifiStatusCode.NOT_STARTED|, * |WifiStatusCode.UNKNOWN| */ @exit @@ -87,17 +92,27 @@ interface IWifi { * The corresponding |IWifiChip| object for any chip can be * retrieved using |getChip| method. * + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.NOT_STARTED|, + * |WifiStatusCode.UNKNOWN| * @return chipIds List of all chip Id's on the device. */ @callflow(next={"*"}) - getChipIds() generates (vec chipIds); + getChipIds() generates (WifiStatus status, vec chipIds); /** * Gets a HIDL interface object for the chip corresponding to the * provided chipId. * + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.NOT_STARTED|, + * |WifiStatusCode.UNKNOWN| * @return chip HIDL interface object representing the chip. */ @callflow(next={"*"}) - getChip(ChipId chipId) generates (IWifiChip chip); + getChip(ChipId chipId) generates (WifiStatus status, IWifiChip chip); }; From 1922482a5cdf64805dab06966f9d413a7d30d893 Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Tue, 11 Oct 2016 08:21:46 -0700 Subject: [PATCH 13/24] wifi: Rename failure_reason_util to wifi_status_util The HIDL interface now returns a |WifiStatus| instance to indicate the status of any operation. This is replacing the existing asynchronous delivery of success or failure (using |FailureReason| instance). Rename the existing util class to |wifi_status_util| and add a couple of methods to create a |WifiStatus| instance with empty description. Bug: 32056230 Test: Compiles Change-Id: I8488f7cd7d6ad6bd7a0c3c82a7ef83299d877d45 --- wifi/1.0/default/Android.mk | 4 +- ...e_reason_util.cpp => wifi_status_util.cpp} | 46 +++++++++++-------- ...ilure_reason_util.h => wifi_status_util.h} | 18 ++++---- 3 files changed, 40 insertions(+), 28 deletions(-) rename wifi/1.0/default/{failure_reason_util.cpp => wifi_status_util.cpp} (60%) rename wifi/1.0/default/{failure_reason_util.h => wifi_status_util.h} (65%) diff --git a/wifi/1.0/default/Android.mk b/wifi/1.0/default/Android.mk index 3fd5fbae4c..3d8c68962b 100644 --- a/wifi/1.0/default/Android.mk +++ b/wifi/1.0/default/Android.mk @@ -18,7 +18,6 @@ LOCAL_MODULE := android.hardware.wifi@1.0-impl LOCAL_MODULE_RELATIVE_PATH := hw LOCAL_CPPFLAGS := -std=c++11 -Wall -Wno-unused-parameter -Werror -Wextra LOCAL_SRC_FILES := \ - failure_reason_util.cpp \ wifi.cpp \ wifi_ap_iface.cpp \ wifi_chip.cpp \ @@ -26,7 +25,8 @@ LOCAL_SRC_FILES := \ wifi_nan_iface.cpp \ wifi_p2p_iface.cpp \ wifi_rtt_controller.cpp \ - wifi_sta_iface.cpp + wifi_sta_iface.cpp \ + wifi_status_util.cpp LOCAL_SHARED_LIBRARIES := \ android.hardware.wifi@1.0 \ libbase \ diff --git a/wifi/1.0/default/failure_reason_util.cpp b/wifi/1.0/default/wifi_status_util.cpp similarity index 60% rename from wifi/1.0/default/failure_reason_util.cpp rename to wifi/1.0/default/wifi_status_util.cpp index f703ebe2c2..21b4eebe7b 100644 --- a/wifi/1.0/default/failure_reason_util.cpp +++ b/wifi/1.0/default/wifi_status_util.cpp @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "failure_reason_util.h" +#include "wifi_status_util.h" namespace android { namespace hardware { @@ -22,7 +22,7 @@ namespace wifi { namespace V1_0 { namespace implementation { -std::string LegacyErrorToString(wifi_error error) { +std::string legacyErrorToString(wifi_error error) { switch (error) { case WIFI_SUCCESS: return "SUCCESS"; @@ -48,47 +48,57 @@ std::string LegacyErrorToString(wifi_error error) { } } -FailureReason CreateFailureReason(CommandFailureReason reason, - const std::string& description) { - FailureReason result; - result.reason = reason; +WifiStatus createWifiStatus(WifiStatusCode code, + const std::string& description) { + WifiStatus result; + result.code = code; result.description = description.data(); return result; } -FailureReason CreateFailureReasonLegacyError(wifi_error error, - const std::string& desc) { +WifiStatus createWifiStatus(WifiStatusCode code) { + return createWifiStatus(code, ""); +} + +WifiStatus createWifiStatusFromLegacyError(wifi_error error, + const std::string& desc) { switch (error) { case WIFI_ERROR_UNINITIALIZED: case WIFI_ERROR_NOT_AVAILABLE: - return CreateFailureReason(CommandFailureReason::NOT_AVAILABLE, desc); + return createWifiStatus(WifiStatusCode::ERROR_NOT_AVAILABLE, desc); case WIFI_ERROR_NOT_SUPPORTED: - return CreateFailureReason(CommandFailureReason::NOT_SUPPORTED, desc); + return createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED, desc); case WIFI_ERROR_INVALID_ARGS: case WIFI_ERROR_INVALID_REQUEST_ID: - return CreateFailureReason(CommandFailureReason::INVALID_ARGS, desc); + return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS, desc); case WIFI_ERROR_TIMED_OUT: - return CreateFailureReason(CommandFailureReason::UNKNOWN, - desc + ", timed out"); + return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN, + desc + ", timed out"); case WIFI_ERROR_TOO_MANY_REQUESTS: - return CreateFailureReason(CommandFailureReason::UNKNOWN, - desc + ", too many requests"); + return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN, + desc + ", too many requests"); case WIFI_ERROR_OUT_OF_MEMORY: - return CreateFailureReason(CommandFailureReason::UNKNOWN, - desc + ", out of memory"); + return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN, + desc + ", out of memory"); case WIFI_ERROR_NONE: + return createWifiStatus(WifiStatusCode::SUCCESS, desc); + case WIFI_ERROR_UNKNOWN: default: - return CreateFailureReason(CommandFailureReason::UNKNOWN, "unknown"); + return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN, "unknown"); } } +WifiStatus createWifiStatusFromLegacyError(wifi_error error) { + return createWifiStatusFromLegacyError(error, ""); +} + } // namespace implementation } // namespace V1_0 } // namespace wifi diff --git a/wifi/1.0/default/failure_reason_util.h b/wifi/1.0/default/wifi_status_util.h similarity index 65% rename from wifi/1.0/default/failure_reason_util.h rename to wifi/1.0/default/wifi_status_util.h index 7d51bbf2fe..ec4b3f0e36 100644 --- a/wifi/1.0/default/failure_reason_util.h +++ b/wifi/1.0/default/wifi_status_util.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef FAILURE_REASON_UTIL_H_ -#define FAILURE_REASON_UTIL_H_ +#ifndef WIFI_STATUS_UTIL_H_ +#define WIFI_STATUS_UTIL_H_ #include #include @@ -26,12 +26,14 @@ namespace wifi { namespace V1_0 { namespace implementation { -std::string LegacyErrorToString(wifi_error error); +std::string legacyErrorToString(wifi_error error); -FailureReason CreateFailureReason(CommandFailureReason reason, - const std::string& description); -FailureReason CreateFailureReasonLegacyError(wifi_error error, - const std::string& description); +WifiStatus createWifiStatus(WifiStatusCode code, + const std::string& description); +WifiStatus createWifiStatus(WifiStatusCode code); +WifiStatus createWifiStatusFromLegacyError(wifi_error error, + const std::string& description); +WifiStatus createWifiStatusFromLegacyError(wifi_error error); } // namespace implementation } // namespace V1_0 @@ -39,4 +41,4 @@ FailureReason CreateFailureReasonLegacyError(wifi_error error, } // namespace hardware } // namespace android -#endif // FAILURE_REASON_UTIL_H_ +#endif // WIFI_STATUS_UTIL_H_ From 503582ed945f9d4da8696709566fb556df088099 Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Tue, 11 Oct 2016 08:25:30 -0700 Subject: [PATCH 14/24] wifi: Make methods deliver status synchronously (1/3) Make the following |IWifi| HIDL interface methods return a synchronous status code: a) start() b) stop() The other methods in this interface do not have a failure case and hence not returning a status code. This changes the nature of event callbacks registered for each interface. Previously, every operation's status was sent to all the registered event callbacks. Now, only the caller is notified of the operation's status via the passed synchronous callbacks. The event callbacks are now used to broadcast only important state changes/events. Bug: 32056230 Bug: 32061909 Test: Compiles Change-Id: I95dc3fa139ac3ac7500d81e9e0dbc4f4de04e127 --- wifi/1.0/default/wifi.cpp | 73 ++++++++++++++++++++------------------- wifi/1.0/default/wifi.h | 12 +++---- 2 files changed, 44 insertions(+), 41 deletions(-) diff --git a/wifi/1.0/default/wifi.cpp b/wifi/1.0/default/wifi.cpp index ff2eb4cb2e..e10826bfbb 100644 --- a/wifi/1.0/default/wifi.cpp +++ b/wifi/1.0/default/wifi.cpp @@ -18,8 +18,8 @@ #include -#include "failure_reason_util.h" #include "wifi_chip.h" +#include "wifi_status_util.h" namespace { // Chip ID to use for the only supported chip. @@ -36,9 +36,9 @@ Wifi::Wifi() : legacy_hal_(new WifiLegacyHal()), run_state_(RunState::STOPPED) {} Return Wifi::registerEventCallback( - const sp& callback) { + const sp& event_callback) { // TODO(b/31632518): remove the callback when the client is destroyed - callbacks_.emplace_back(callback); + event_callbacks_.emplace_back(event_callback); return Void(); } @@ -46,47 +46,44 @@ Return Wifi::isStarted() { return run_state_ != RunState::STOPPED; } -Return Wifi::start() { +Return Wifi::start(start_cb hidl_status_cb) { if (run_state_ == RunState::STARTED) { - for (const auto& callback : callbacks_) { - callback->onStart(); - } + hidl_status_cb(createWifiStatus(WifiStatusCode::SUCCESS)); return Void(); } else if (run_state_ == RunState::STOPPING) { - for (const auto& callback : callbacks_) { - callback->onStartFailure(CreateFailureReason( - CommandFailureReason::NOT_AVAILABLE, "HAL is stopping")); - } + hidl_status_cb(createWifiStatus(WifiStatusCode::ERROR_NOT_AVAILABLE, + "HAL is stopping")); return Void(); } LOG(INFO) << "Starting HAL"; - wifi_error status = legacy_hal_->start(); - if (status != WIFI_SUCCESS) { + wifi_error legacy_status = legacy_hal_->start(); + if (legacy_status != WIFI_SUCCESS) { LOG(ERROR) << "Failed to start Wifi HAL"; - for (auto& callback : callbacks_) { - callback->onStartFailure( - CreateFailureReasonLegacyError(status, "Failed to start HAL")); - } + hidl_status_cb( + createWifiStatusFromLegacyError(legacy_status, "Failed to start HAL")); return Void(); } // Create the chip instance once the HAL is started. chip_ = new WifiChip(kChipId, legacy_hal_); run_state_ = RunState::STARTED; - for (const auto& callback : callbacks_) { - callback->onStart(); + for (const auto& callback : event_callbacks_) { + if (!callback->onStart().getStatus().isOk()) { + LOG(ERROR) << "Failed to invoke onStart callback"; + }; } + hidl_status_cb(createWifiStatus(WifiStatusCode::SUCCESS)); return Void(); } -Return Wifi::stop() { +Return Wifi::stop(stop_cb hidl_status_cb) { if (run_state_ == RunState::STOPPED) { - for (const auto& callback : callbacks_) { - callback->onStop(); - } + hidl_status_cb(createWifiStatus(WifiStatusCode::SUCCESS)); return Void(); } else if (run_state_ == RunState::STOPPING) { + hidl_status_cb(createWifiStatus(WifiStatusCode::ERROR_NOT_AVAILABLE, + "HAL is stopping")); return Void(); } @@ -98,37 +95,43 @@ Return Wifi::stop() { } chip_.clear(); run_state_ = RunState::STOPPED; - for (const auto& callback : callbacks_) { - callback->onStop(); + for (const auto& callback : event_callbacks_) { + if (!callback->onStop().getStatus().isOk()) { + LOG(ERROR) << "Failed to invoke onStop callback"; + }; } }; - wifi_error status = legacy_hal_->stop(on_complete_callback_); - if (status != WIFI_SUCCESS) { + wifi_error legacy_status = legacy_hal_->stop(on_complete_callback_); + if (legacy_status != WIFI_SUCCESS) { LOG(ERROR) << "Failed to stop Wifi HAL"; - for (const auto& callback : callbacks_) { - callback->onFailure( - CreateFailureReasonLegacyError(status, "Failed to stop HAL")); + WifiStatus wifi_status = + createWifiStatusFromLegacyError(legacy_status, "Failed to stop HAL"); + for (const auto& callback : event_callbacks_) { + callback->onFailure(wifi_status); } + hidl_status_cb(wifi_status); + return Void(); } + hidl_status_cb(createWifiStatus(WifiStatusCode::SUCCESS)); return Void(); } -Return Wifi::getChipIds(getChipIds_cb cb) { +Return Wifi::getChipIds(getChipIds_cb hidl_status_cb) { std::vector chip_ids; if (chip_.get()) { chip_ids.emplace_back(kChipId); } hidl_vec hidl_data; hidl_data.setToExternal(chip_ids.data(), chip_ids.size()); - cb(hidl_data); + hidl_status_cb(hidl_data); return Void(); } -Return Wifi::getChip(ChipId chip_id, getChip_cb cb) { +Return Wifi::getChip(ChipId chip_id, getChip_cb hidl_status_cb) { if (chip_.get() && chip_id == kChipId) { - cb(chip_); + hidl_status_cb(chip_); } else { - cb(nullptr); + hidl_status_cb(nullptr); } return Void(); } diff --git a/wifi/1.0/default/wifi.h b/wifi/1.0/default/wifi.h index 55ba12b36b..989b63019b 100644 --- a/wifi/1.0/default/wifi.h +++ b/wifi/1.0/default/wifi.h @@ -41,12 +41,12 @@ class Wifi : public IWifi { // HIDL methods exposed. Return registerEventCallback( - const sp& callback) override; + const sp& event_callback) override; Return isStarted() override; - Return start() override; - Return stop() override; - Return getChipIds(getChipIds_cb cb) override; - Return getChip(ChipId chip_id, getChip_cb cb) override; + Return start(start_cb hidl_status_cb) override; + Return stop(stop_cb hidl_status_cb) override; + Return getChipIds(getChipIds_cb hidl_status_cb) override; + Return getChip(ChipId chip_id, getChip_cb hidl_status_cb) override; private: enum class RunState { STOPPED, STARTED, STOPPING }; @@ -55,7 +55,7 @@ class Wifi : public IWifi { // and shared with all the child HIDL interface objects. std::shared_ptr legacy_hal_; RunState run_state_; - std::vector> callbacks_; + std::vector> event_callbacks_; sp chip_; DISALLOW_COPY_AND_ASSIGN(Wifi); From 5c05546fc9fdcb1dfa92b2c80474f88bba5a77a4 Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Tue, 11 Oct 2016 08:27:27 -0700 Subject: [PATCH 15/24] wifi: Make methods deliver status synchronously (2/3) Make all the |IWifiChip| HIDL interface methods return a synchronous status code. Change from using the event callbacks to the synchronous callbacks for delivering status. While there, 1. Use std::tie to retrive values out of the legacy HAL functions returning a pair. 2. Use the std::vector to hidl_vec constructor for returning vector of ifnames. Bug: 32056230 Bug: 32061909 Test: Compiles Change-Id: Iac27521be17cd9852df04ad7d412e09160a08d33 --- wifi/1.0/default/wifi_chip.cpp | 323 +++++++++++++++++++-------------- wifi/1.0/default/wifi_chip.h | 53 +++--- 2 files changed, 212 insertions(+), 164 deletions(-) diff --git a/wifi/1.0/default/wifi_chip.cpp b/wifi/1.0/default/wifi_chip.cpp index 4dd020b592..4f8545ff48 100644 --- a/wifi/1.0/default/wifi_chip.cpp +++ b/wifi/1.0/default/wifi_chip.cpp @@ -18,23 +18,19 @@ #include -#include "failure_reason_util.h" +#include "wifi_status_util.h" namespace { using android::sp; using android::hardware::hidl_vec; using android::hardware::hidl_string; -hidl_vec createHidlVecOfIfaceNames(const std::string& ifname) { +std::vector createHidlVecOfIfaceNames(const std::string& ifname) { std::vector ifnames; if (!ifname.empty()) { - hidl_string hidl_ifname; - hidl_ifname = ifname.c_str(); - ifnames.emplace_back(hidl_ifname); + ifnames.emplace_back(ifname); } - hidl_vec hidl_ifnames; - hidl_ifnames.setToExternal(ifnames.data(), ifnames.size()); - return hidl_ifnames; + return ifnames; } template @@ -59,156 +55,181 @@ WifiChip::WifiChip(ChipId chip_id, void WifiChip::invalidate() { invalidateAndRemoveAllIfaces(); legacy_hal_.reset(); - callbacks_.clear(); + event_callbacks_.clear(); is_valid_ = false; } -Return WifiChip::getId() { - return chip_id_; +Return WifiChip::getId(getId_cb hidl_status_cb) { + if (!is_valid_) { + hidl_status_cb(createWifiStatus(WifiStatusCode::ERROR_WIFI_CHIP_INVALID), + UINT32_MAX); + return Void(); + } + hidl_status_cb(createWifiStatus(WifiStatusCode::SUCCESS), chip_id_); + return Void(); } Return WifiChip::registerEventCallback( - const sp& callback) { - if (!is_valid_) + const sp& event_callback, + registerEventCallback_cb hidl_status_cb) { + if (!is_valid_) { + hidl_status_cb(createWifiStatus(WifiStatusCode::ERROR_WIFI_CHIP_INVALID)); return Void(); + } // TODO(b/31632518): remove the callback when the client is destroyed - callbacks_.emplace_back(callback); + event_callbacks_.emplace_back(event_callback); + hidl_status_cb(createWifiStatus(WifiStatusCode::SUCCESS)); return Void(); } -Return WifiChip::getAvailableModes(getAvailableModes_cb cb) { +Return WifiChip::getAvailableModes(getAvailableModes_cb hidl_status_cb) { if (!is_valid_) { - cb(hidl_vec()); - return Void(); - } else { - // TODO add implementation + hidl_status_cb(createWifiStatus(WifiStatusCode::ERROR_WIFI_CHIP_INVALID), + hidl_vec()); return Void(); } + // TODO add implementation + hidl_status_cb(createWifiStatus(WifiStatusCode::SUCCESS), + hidl_vec()); + return Void(); } -Return WifiChip::configureChip(uint32_t /*mode_id*/) { - if (!is_valid_) +Return WifiChip::configureChip(uint32_t /*mode_id*/, + configureChip_cb hidl_status_cb) { + if (!is_valid_) { + hidl_status_cb(createWifiStatus(WifiStatusCode::ERROR_WIFI_CHIP_INVALID)); return Void(); + } invalidateAndRemoveAllIfaces(); // TODO add implementation + hidl_status_cb(createWifiStatus(WifiStatusCode::SUCCESS)); return Void(); } -Return WifiChip::getMode() { - if (!is_valid_) - return 0; +Return WifiChip::getMode(getMode_cb hidl_status_cb) { + if (!is_valid_) { + hidl_status_cb(createWifiStatus(WifiStatusCode::ERROR_WIFI_CHIP_INVALID), + UINT32_MAX); + return Void(); + } // TODO add implementation - return 0; -} - -Return WifiChip::requestChipDebugInfo() { - if (!is_valid_) - return Void(); - - IWifiChipEventCallback::ChipDebugInfo result; - - std::pair ret = - legacy_hal_.lock()->getDriverVersion(); - if (ret.first != WIFI_SUCCESS) { - LOG(ERROR) << "Failed to get driver version: " - << LegacyErrorToString(ret.first); - FailureReason reason = CreateFailureReasonLegacyError( - ret.first, " failed to get driver version"); - for (const auto& callback : callbacks_) { - callback->onChipDebugInfoFailure(reason); - } - return Void(); - } - result.driverDescription = ret.second.c_str(); - - ret = legacy_hal_.lock()->getFirmwareVersion(); - if (ret.first != WIFI_SUCCESS) { - LOG(ERROR) << "Failed to get firmware version: " - << LegacyErrorToString(ret.first); - FailureReason reason = CreateFailureReasonLegacyError( - ret.first, " failed to get firmware version"); - for (const auto& callback : callbacks_) { - callback->onChipDebugInfoFailure(reason); - } - return Void(); - } - result.firmwareDescription = ret.second.c_str(); - - for (const auto& callback : callbacks_) { - callback->onChipDebugInfoAvailable(result); - } + hidl_status_cb(createWifiStatus(WifiStatusCode::SUCCESS), 0); return Void(); } -Return WifiChip::requestDriverDebugDump() { - if (!is_valid_) - return Void(); - - std::pair> ret = - legacy_hal_.lock()->requestDriverMemoryDump(); - if (ret.first != WIFI_SUCCESS) { - LOG(ERROR) << "Failed to get driver debug dump: " - << LegacyErrorToString(ret.first); - FailureReason reason = CreateFailureReasonLegacyError(ret.first, ""); - for (const auto& callback : callbacks_) { - callback->onDriverDebugDumpFailure(reason); - } +Return WifiChip::requestChipDebugInfo( + requestChipDebugInfo_cb hidl_status_cb) { + if (!is_valid_) { + hidl_status_cb(createWifiStatus(WifiStatusCode::ERROR_WIFI_CHIP_INVALID), + IWifiChip::ChipDebugInfo()); + return Void(); + } + + IWifiChip::ChipDebugInfo result; + + wifi_error legacy_status; + std::string driver_desc; + std::tie(legacy_status, driver_desc) = legacy_hal_.lock()->getDriverVersion(); + if (legacy_status != WIFI_SUCCESS) { + LOG(ERROR) << "Failed to get driver version: " + << legacyErrorToString(legacy_status); + WifiStatus status = createWifiStatusFromLegacyError( + legacy_status, "failed to get driver version"); + hidl_status_cb(status, result); + return Void(); + } + result.driverDescription = driver_desc.c_str(); + + std::string firmware_desc; + std::tie(legacy_status, firmware_desc) = + legacy_hal_.lock()->getFirmwareVersion(); + if (legacy_status != WIFI_SUCCESS) { + LOG(ERROR) << "Failed to get firmware version: " + << legacyErrorToString(legacy_status); + WifiStatus status = createWifiStatusFromLegacyError( + legacy_status, "failed to get firmware version"); + hidl_status_cb(status, result); + return Void(); + } + result.firmwareDescription = firmware_desc.c_str(); + + hidl_status_cb(createWifiStatus(WifiStatusCode::SUCCESS), result); + return Void(); +} + +Return WifiChip::requestDriverDebugDump( + requestDriverDebugDump_cb hidl_status_cb) { + if (!is_valid_) { + hidl_status_cb(createWifiStatus(WifiStatusCode::ERROR_WIFI_CHIP_INVALID), + hidl_vec()); + return Void(); + } + + wifi_error legacy_status; + std::vector driver_dump; + std::tie(legacy_status, driver_dump) = + legacy_hal_.lock()->requestDriverMemoryDump(); + if (legacy_status != WIFI_SUCCESS) { + LOG(ERROR) << "Failed to get driver debug dump: " + << legacyErrorToString(legacy_status); + hidl_status_cb(createWifiStatusFromLegacyError(legacy_status), + hidl_vec()); return Void(); } - auto& driver_dump = ret.second; hidl_vec hidl_data; hidl_data.setToExternal(reinterpret_cast(driver_dump.data()), driver_dump.size()); - for (const auto& callback : callbacks_) { - callback->onDriverDebugDumpAvailable(hidl_data); - } + hidl_status_cb(createWifiStatus(WifiStatusCode::SUCCESS), hidl_data); return Void(); } -Return WifiChip::requestFirmwareDebugDump() { - if (!is_valid_) - return Void(); - - std::pair> ret = - legacy_hal_.lock()->requestFirmwareMemoryDump(); - if (ret.first != WIFI_SUCCESS) { - LOG(ERROR) << "Failed to get firmware debug dump: " - << LegacyErrorToString(ret.first); - FailureReason reason = CreateFailureReasonLegacyError(ret.first, ""); - for (const auto& callback : callbacks_) { - callback->onFirmwareDebugDumpFailure(reason); - } +Return WifiChip::requestFirmwareDebugDump( + requestFirmwareDebugDump_cb hidl_status_cb) { + if (!is_valid_) { + hidl_status_cb(createWifiStatus(WifiStatusCode::ERROR_WIFI_CHIP_INVALID), + hidl_vec()); + return Void(); + } + + wifi_error legacy_status; + std::vector firmware_dump; + std::tie(legacy_status, firmware_dump) = + legacy_hal_.lock()->requestFirmwareMemoryDump(); + if (legacy_status != WIFI_SUCCESS) { + LOG(ERROR) << "Failed to get firmware debug dump: " + << legacyErrorToString(legacy_status); + hidl_status_cb(createWifiStatusFromLegacyError(legacy_status), + hidl_vec()); return Void(); } - auto& firmware_dump = ret.second; hidl_vec hidl_data; hidl_data.setToExternal(reinterpret_cast(firmware_dump.data()), firmware_dump.size()); - for (const auto& callback : callbacks_) { - callback->onFirmwareDebugDumpAvailable(hidl_data); - } + hidl_status_cb(createWifiStatus(WifiStatusCode::SUCCESS), hidl_data); return Void(); } -Return WifiChip::createApIface(createApIface_cb cb) { +Return WifiChip::createApIface(createApIface_cb hidl_status_cb) { if (!is_valid_) { - cb(nullptr); + hidl_status_cb(createWifiStatus(WifiStatusCode::ERROR_WIFI_CHIP_INVALID), + nullptr); return Void(); } // TODO(b/31997422): Disallow this based on the chip combination. std::string ifname = legacy_hal_.lock()->getApIfaceName(); ap_iface_ = new WifiApIface(ifname, legacy_hal_); - cb(ap_iface_); + hidl_status_cb(createWifiStatus(WifiStatusCode::SUCCESS), ap_iface_); return Void(); } -Return WifiChip::getApIfaceNames(getApIfaceNames_cb cb) { +Return WifiChip::getApIfaceNames(getApIfaceNames_cb hidl_status_cb) { if (!is_valid_) { - cb(hidl_vec()); + hidl_status_cb(createWifiStatus(WifiStatusCode::ERROR_WIFI_CHIP_INVALID), + hidl_vec()); return Void(); } @@ -216,41 +237,47 @@ Return WifiChip::getApIfaceNames(getApIfaceNames_cb cb) { if (ap_iface_.get()) { ifname = legacy_hal_.lock()->getApIfaceName().c_str(); } - cb(createHidlVecOfIfaceNames(ifname)); + hidl_status_cb(createWifiStatus(WifiStatusCode::SUCCESS), + createHidlVecOfIfaceNames(ifname)); return Void(); } -Return WifiChip::getApIface(const hidl_string& ifname, getApIface_cb cb) { +Return WifiChip::getApIface(const hidl_string& ifname, + getApIface_cb hidl_status_cb) { if (!is_valid_) { - cb(nullptr); + hidl_status_cb(createWifiStatus(WifiStatusCode::ERROR_WIFI_CHIP_INVALID), + nullptr); return Void(); } if (ap_iface_.get() && (ifname.c_str() == legacy_hal_.lock()->getApIfaceName())) { - cb(ap_iface_); + hidl_status_cb(createWifiStatus(WifiStatusCode::SUCCESS), ap_iface_); } else { - cb(nullptr); + hidl_status_cb(createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS), + nullptr); } return Void(); } -Return WifiChip::createNanIface(createNanIface_cb cb) { +Return WifiChip::createNanIface(createNanIface_cb hidl_status_cb) { if (!is_valid_) { - cb(nullptr); + hidl_status_cb(createWifiStatus(WifiStatusCode::ERROR_WIFI_CHIP_INVALID), + nullptr); return Void(); } // TODO(b/31997422): Disallow this based on the chip combination. std::string ifname = legacy_hal_.lock()->getNanIfaceName(); nan_iface_ = new WifiNanIface(ifname, legacy_hal_); - cb(nan_iface_); + hidl_status_cb(createWifiStatus(WifiStatusCode::SUCCESS), nan_iface_); return Void(); } -Return WifiChip::getNanIfaceNames(getNanIfaceNames_cb cb) { +Return WifiChip::getNanIfaceNames(getNanIfaceNames_cb hidl_status_cb) { if (!is_valid_) { - cb(hidl_vec()); + hidl_status_cb(createWifiStatus(WifiStatusCode::ERROR_WIFI_CHIP_INVALID), + hidl_vec()); return Void(); } @@ -258,42 +285,47 @@ Return WifiChip::getNanIfaceNames(getNanIfaceNames_cb cb) { if (nan_iface_.get()) { ifname = legacy_hal_.lock()->getNanIfaceName().c_str(); } - cb(createHidlVecOfIfaceNames(ifname)); + hidl_status_cb(createWifiStatus(WifiStatusCode::SUCCESS), + createHidlVecOfIfaceNames(ifname)); return Void(); } Return WifiChip::getNanIface(const hidl_string& ifname, - getNanIface_cb cb) { + getNanIface_cb hidl_status_cb) { if (!is_valid_) { - cb(nullptr); + hidl_status_cb(createWifiStatus(WifiStatusCode::ERROR_WIFI_CHIP_INVALID), + nullptr); return Void(); } if (nan_iface_.get() && (ifname.c_str() == legacy_hal_.lock()->getNanIfaceName())) { - cb(nan_iface_); + hidl_status_cb(createWifiStatus(WifiStatusCode::SUCCESS), nan_iface_); } else { - cb(nullptr); + hidl_status_cb(createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS), + nullptr); } return Void(); } -Return WifiChip::createP2pIface(createP2pIface_cb cb) { +Return WifiChip::createP2pIface(createP2pIface_cb hidl_status_cb) { if (!is_valid_) { - cb(nullptr); + hidl_status_cb(createWifiStatus(WifiStatusCode::ERROR_WIFI_CHIP_INVALID), + nullptr); return Void(); } // TODO(b/31997422): Disallow this based on the chip combination. std::string ifname = legacy_hal_.lock()->getP2pIfaceName(); p2p_iface_ = new WifiP2pIface(ifname, legacy_hal_); - cb(p2p_iface_); + hidl_status_cb(createWifiStatus(WifiStatusCode::SUCCESS), p2p_iface_); return Void(); } -Return WifiChip::getP2pIfaceNames(getP2pIfaceNames_cb cb) { +Return WifiChip::getP2pIfaceNames(getP2pIfaceNames_cb hidl_status_cb) { if (!is_valid_) { - cb(hidl_vec()); + hidl_status_cb(createWifiStatus(WifiStatusCode::ERROR_WIFI_CHIP_INVALID), + hidl_vec()); return Void(); } @@ -301,42 +333,47 @@ Return WifiChip::getP2pIfaceNames(getP2pIfaceNames_cb cb) { if (p2p_iface_.get()) { ifname = legacy_hal_.lock()->getP2pIfaceName().c_str(); } - cb(createHidlVecOfIfaceNames(ifname)); + hidl_status_cb(createWifiStatus(WifiStatusCode::SUCCESS), + createHidlVecOfIfaceNames(ifname)); return Void(); } Return WifiChip::getP2pIface(const hidl_string& ifname, - getP2pIface_cb cb) { + getP2pIface_cb hidl_status_cb) { if (!is_valid_) { - cb(nullptr); + hidl_status_cb(createWifiStatus(WifiStatusCode::ERROR_WIFI_CHIP_INVALID), + nullptr); return Void(); } if (p2p_iface_.get() && (ifname.c_str() == legacy_hal_.lock()->getP2pIfaceName())) { - cb(p2p_iface_); + hidl_status_cb(createWifiStatus(WifiStatusCode::SUCCESS), p2p_iface_); } else { - cb(nullptr); + hidl_status_cb(createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS), + nullptr); } return Void(); } -Return WifiChip::createStaIface(createStaIface_cb cb) { +Return WifiChip::createStaIface(createStaIface_cb hidl_status_cb) { if (!is_valid_) { - cb(nullptr); + hidl_status_cb(createWifiStatus(WifiStatusCode::ERROR_WIFI_CHIP_INVALID), + nullptr); return Void(); } // TODO(b/31997422): Disallow this based on the chip combination. std::string ifname = legacy_hal_.lock()->getStaIfaceName(); sta_iface_ = new WifiStaIface(ifname, legacy_hal_); - cb(sta_iface_); + hidl_status_cb(createWifiStatus(WifiStatusCode::SUCCESS), sta_iface_); return Void(); } -Return WifiChip::getStaIfaceNames(getStaIfaceNames_cb cb) { +Return WifiChip::getStaIfaceNames(getStaIfaceNames_cb hidl_status_cb) { if (!is_valid_) { - cb(hidl_vec()); + hidl_status_cb(createWifiStatus(WifiStatusCode::ERROR_WIFI_CHIP_INVALID), + hidl_vec()); return Void(); } @@ -344,36 +381,40 @@ Return WifiChip::getStaIfaceNames(getStaIfaceNames_cb cb) { if (sta_iface_.get()) { ifname = legacy_hal_.lock()->getStaIfaceName().c_str(); } - cb(createHidlVecOfIfaceNames(ifname)); + hidl_status_cb(createWifiStatus(WifiStatusCode::SUCCESS), + createHidlVecOfIfaceNames(ifname)); return Void(); } Return WifiChip::getStaIface(const hidl_string& ifname, - getStaIface_cb cb) { + getStaIface_cb hidl_status_cb) { if (!is_valid_) { - cb(nullptr); + hidl_status_cb(createWifiStatus(WifiStatusCode::ERROR_WIFI_CHIP_INVALID), + nullptr); return Void(); } if (sta_iface_.get() && (ifname.c_str() == legacy_hal_.lock()->getStaIfaceName())) { - cb(sta_iface_); + hidl_status_cb(createWifiStatus(WifiStatusCode::SUCCESS), sta_iface_); } else { - cb(nullptr); + hidl_status_cb(createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS), + nullptr); } return Void(); } -Return WifiChip::createRttController(const sp& bound_iface, - createRttController_cb cb) { +Return WifiChip::createRttController( + const sp& bound_iface, createRttController_cb hidl_status_cb) { if (!is_valid_) { - cb(nullptr); + hidl_status_cb(createWifiStatus(WifiStatusCode::ERROR_WIFI_CHIP_INVALID), + nullptr); return Void(); } sp rtt = new WifiRttController(bound_iface, legacy_hal_); rtt_controllers_.emplace_back(rtt); - cb(rtt); + hidl_status_cb(createWifiStatus(WifiStatusCode::SUCCESS), rtt); return Void(); } diff --git a/wifi/1.0/default/wifi_chip.h b/wifi/1.0/default/wifi_chip.h index 94ffa63ec2..dd9117e63e 100644 --- a/wifi/1.0/default/wifi_chip.h +++ b/wifi/1.0/default/wifi_chip.h @@ -59,39 +59,46 @@ class WifiChip : public IWifiChip { void invalidate(); // HIDL methods exposed. - Return getId() override; + Return getId(getId_cb hidl_status_cb) override; Return registerEventCallback( - const sp& callback) override; - Return getAvailableModes(getAvailableModes_cb cb) override; - Return configureChip(uint32_t mode_id) override; - Return getMode() override; - Return requestChipDebugInfo() override; - Return requestDriverDebugDump() override; - Return requestFirmwareDebugDump() override; - Return createApIface(createApIface_cb cb) override; - Return getApIfaceNames(getApIfaceNames_cb cb) override; - Return getApIface(const hidl_string& ifname, getApIface_cb cb) override; - Return createNanIface(createNanIface_cb cb) override; - Return getNanIfaceNames(getNanIfaceNames_cb cb) override; + const sp& event_callback, + registerEventCallback_cb hidl_status_cb) override; + Return getAvailableModes(getAvailableModes_cb hidl_status_cb) override; + Return configureChip(uint32_t mode_id, + configureChip_cb hidl_status_cb) override; + Return getMode(getMode_cb hidl_status_cb) override; + Return requestChipDebugInfo( + requestChipDebugInfo_cb hidl_status_cb) override; + Return requestDriverDebugDump( + requestDriverDebugDump_cb hidl_status_cb) override; + Return requestFirmwareDebugDump( + requestFirmwareDebugDump_cb hidl_status_cb) override; + Return createApIface(createApIface_cb hidl_status_cb) override; + Return getApIfaceNames(getApIfaceNames_cb hidl_status_cb) override; + Return getApIface(const hidl_string& ifname, + getApIface_cb hidl_status_cb) override; + Return createNanIface(createNanIface_cb hidl_status_cb) override; + Return getNanIfaceNames(getNanIfaceNames_cb hidl_status_cb) override; Return getNanIface(const hidl_string& ifname, - getNanIface_cb cb) override; - Return createP2pIface(createP2pIface_cb cb) override; - Return getP2pIfaceNames(getP2pIfaceNames_cb cb) override; + getNanIface_cb hidl_status_cb) override; + Return createP2pIface(createP2pIface_cb hidl_status_cb) override; + Return getP2pIfaceNames(getP2pIfaceNames_cb hidl_status_cb) override; Return getP2pIface(const hidl_string& ifname, - getP2pIface_cb cb) override; - Return createStaIface(createStaIface_cb cb) override; - Return getStaIfaceNames(getStaIfaceNames_cb cb) override; + getP2pIface_cb hidl_status_cb) override; + Return createStaIface(createStaIface_cb hidl_status_cb) override; + Return getStaIfaceNames(getStaIfaceNames_cb hidl_status_cb) override; Return getStaIface(const hidl_string& ifname, - getStaIface_cb cb) override; - Return createRttController(const sp& bound_iface, - createRttController_cb cb) override; + getStaIface_cb hidl_status_cb) override; + Return createRttController( + const sp& bound_iface, + createRttController_cb hidl_status_cb) override; private: void invalidateAndRemoveAllIfaces(); ChipId chip_id_; std::weak_ptr legacy_hal_; - std::vector> callbacks_; + std::vector> event_callbacks_; sp ap_iface_; sp nan_iface_; sp p2p_iface_; From 734fea0d98213d2f721f8f8988114d0cf397d436 Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Tue, 11 Oct 2016 08:30:28 -0700 Subject: [PATCH 16/24] wifi: Make methods deliver status synchronously (3/3) Make all the |IWifiIface|/|IWifiRttController| HIDL interface methods return a synchronous status code. Change from using the event callbacks to the synchronous callbacks for delivering status. While there, Use the default std::string to hidl_string constructor in status callbacks. Bug: 32056230 Bug: 32061909 Test: Compiles Change-Id: Ifa06a11afb085bfd6684f7b997fb730d192018ea --- wifi/1.0/default/wifi_ap_iface.cpp | 23 ++++++++++++++++------- wifi/1.0/default/wifi_ap_iface.h | 4 ++-- wifi/1.0/default/wifi_legacy_hal.cpp | 6 +++--- wifi/1.0/default/wifi_legacy_hal.h | 1 + wifi/1.0/default/wifi_nan_iface.cpp | 23 ++++++++++++++++------- wifi/1.0/default/wifi_nan_iface.h | 4 ++-- wifi/1.0/default/wifi_p2p_iface.cpp | 23 ++++++++++++++++------- wifi/1.0/default/wifi_p2p_iface.h | 4 ++-- wifi/1.0/default/wifi_rtt_controller.cpp | 12 +++++++++--- wifi/1.0/default/wifi_rtt_controller.h | 2 +- wifi/1.0/default/wifi_sta_iface.cpp | 23 ++++++++++++++++------- wifi/1.0/default/wifi_sta_iface.h | 4 ++-- wifi/1.0/default/wifi_status_util.h | 1 - 13 files changed, 86 insertions(+), 44 deletions(-) diff --git a/wifi/1.0/default/wifi_ap_iface.cpp b/wifi/1.0/default/wifi_ap_iface.cpp index aded04d194..1b59b18ae3 100644 --- a/wifi/1.0/default/wifi_ap_iface.cpp +++ b/wifi/1.0/default/wifi_ap_iface.cpp @@ -18,7 +18,7 @@ #include -#include "failure_reason_util.h" +#include "wifi_status_util.h" namespace android { namespace hardware { @@ -35,15 +35,24 @@ void WifiApIface::invalidate() { is_valid_ = false; } -Return WifiApIface::getName(getName_cb cb) { - hidl_string hidl_ifname; - hidl_ifname.setToExternal(ifname_.c_str(), ifname_.size()); - cb(hidl_ifname); +Return WifiApIface::getName(getName_cb hidl_status_cb) { + if (!is_valid_) { + hidl_status_cb(createWifiStatus(WifiStatusCode::ERROR_WIFI_IFACE_INVALID), + hidl_string()); + return Void(); + } + hidl_status_cb(createWifiStatus(WifiStatusCode::SUCCESS), ifname_); return Void(); } -Return WifiApIface::getType() { - return IfaceType::AP; +Return WifiApIface::getType(getType_cb hidl_status_cb) { + if (!is_valid_) { + hidl_status_cb(createWifiStatus(WifiStatusCode::ERROR_WIFI_IFACE_INVALID), + IfaceType::AP); + return Void(); + } + hidl_status_cb(createWifiStatus(WifiStatusCode::SUCCESS), IfaceType::AP); + return Void(); } } // namespace implementation diff --git a/wifi/1.0/default/wifi_ap_iface.h b/wifi/1.0/default/wifi_ap_iface.h index b95a3d8ed6..1382112892 100644 --- a/wifi/1.0/default/wifi_ap_iface.h +++ b/wifi/1.0/default/wifi_ap_iface.h @@ -39,8 +39,8 @@ class WifiApIface : public IWifiApIface { void invalidate(); // HIDL methods exposed. - Return getName(getName_cb cb) override; - Return getType() override; + Return getName(getName_cb hidl_status_cb) override; + Return getType(getType_cb hidl_status_cb) override; private: std::string ifname_; diff --git a/wifi/1.0/default/wifi_legacy_hal.cpp b/wifi/1.0/default/wifi_legacy_hal.cpp index 553a058135..65c078287a 100644 --- a/wifi/1.0/default/wifi_legacy_hal.cpp +++ b/wifi/1.0/default/wifi_legacy_hal.cpp @@ -16,8 +16,8 @@ #include -#include "failure_reason_util.h" #include "wifi_legacy_hal.h" +#include "wifi_status_util.h" #include #include @@ -188,7 +188,7 @@ wifi_error WifiLegacyHal::retrieveWlanInterfaceHandle() { global_handle_, &num_iface_handles, &iface_handles); if (status != WIFI_SUCCESS) { LOG(ERROR) << "Failed to enumerate interface handles: " - << LegacyErrorToString(status); + << legacyErrorToString(status); return status; } for (int i = 0; i < num_iface_handles; ++i) { @@ -198,7 +198,7 @@ wifi_error WifiLegacyHal::retrieveWlanInterfaceHandle() { iface_handles[i], current_ifname.data(), current_ifname.size()); if (status != WIFI_SUCCESS) { LOG(WARNING) << "Failed to get interface handle name: " - << LegacyErrorToString(status); + << legacyErrorToString(status); continue; } if (ifname_to_find == current_ifname.data()) { diff --git a/wifi/1.0/default/wifi_legacy_hal.h b/wifi/1.0/default/wifi_legacy_hal.h index 3585975b10..367ff15d24 100644 --- a/wifi/1.0/default/wifi_legacy_hal.h +++ b/wifi/1.0/default/wifi_legacy_hal.h @@ -19,6 +19,7 @@ #include #include +#include #include diff --git a/wifi/1.0/default/wifi_nan_iface.cpp b/wifi/1.0/default/wifi_nan_iface.cpp index 3c7ae4b8cf..da15cf6f5a 100644 --- a/wifi/1.0/default/wifi_nan_iface.cpp +++ b/wifi/1.0/default/wifi_nan_iface.cpp @@ -18,7 +18,7 @@ #include -#include "failure_reason_util.h" +#include "wifi_status_util.h" namespace android { namespace hardware { @@ -35,15 +35,24 @@ void WifiNanIface::invalidate() { is_valid_ = false; } -Return WifiNanIface::getName(getName_cb cb) { - hidl_string hidl_ifname; - hidl_ifname.setToExternal(ifname_.c_str(), ifname_.size()); - cb(hidl_ifname); +Return WifiNanIface::getName(getName_cb hidl_status_cb) { + if (!is_valid_) { + hidl_status_cb(createWifiStatus(WifiStatusCode::ERROR_WIFI_IFACE_INVALID), + hidl_string()); + return Void(); + } + hidl_status_cb(createWifiStatus(WifiStatusCode::SUCCESS), ifname_); return Void(); } -Return WifiNanIface::getType() { - return IfaceType::NAN; +Return WifiNanIface::getType(getType_cb hidl_status_cb) { + if (!is_valid_) { + hidl_status_cb(createWifiStatus(WifiStatusCode::ERROR_WIFI_IFACE_INVALID), + IfaceType::NAN); + return Void(); + } + hidl_status_cb(createWifiStatus(WifiStatusCode::SUCCESS), IfaceType::NAN); + return Void(); } } // namespace implementation diff --git a/wifi/1.0/default/wifi_nan_iface.h b/wifi/1.0/default/wifi_nan_iface.h index 93e2e7795f..a97c38a1c4 100644 --- a/wifi/1.0/default/wifi_nan_iface.h +++ b/wifi/1.0/default/wifi_nan_iface.h @@ -39,8 +39,8 @@ class WifiNanIface : public IWifiNanIface { void invalidate(); // HIDL methods exposed. - Return getName(getName_cb cb) override; - Return getType() override; + Return getName(getName_cb hidl_status_cb) override; + Return getType(getType_cb hidl_status_cb) override; private: std::string ifname_; diff --git a/wifi/1.0/default/wifi_p2p_iface.cpp b/wifi/1.0/default/wifi_p2p_iface.cpp index 349a158fb5..9ffb48c8b0 100644 --- a/wifi/1.0/default/wifi_p2p_iface.cpp +++ b/wifi/1.0/default/wifi_p2p_iface.cpp @@ -18,7 +18,7 @@ #include -#include "failure_reason_util.h" +#include "wifi_status_util.h" namespace android { namespace hardware { @@ -35,15 +35,24 @@ void WifiP2pIface::invalidate() { is_valid_ = false; } -Return WifiP2pIface::getName(getName_cb cb) { - hidl_string hidl_ifname; - hidl_ifname.setToExternal(ifname_.c_str(), ifname_.size()); - cb(hidl_ifname); +Return WifiP2pIface::getName(getName_cb hidl_status_cb) { + if (!is_valid_) { + hidl_status_cb(createWifiStatus(WifiStatusCode::ERROR_WIFI_IFACE_INVALID), + hidl_string()); + return Void(); + } + hidl_status_cb(createWifiStatus(WifiStatusCode::SUCCESS), ifname_); return Void(); } -Return WifiP2pIface::getType() { - return IfaceType::P2P; +Return WifiP2pIface::getType(getType_cb hidl_status_cb) { + if (!is_valid_) { + hidl_status_cb(createWifiStatus(WifiStatusCode::ERROR_WIFI_IFACE_INVALID), + IfaceType::P2P); + return Void(); + } + hidl_status_cb(createWifiStatus(WifiStatusCode::SUCCESS), IfaceType::P2P); + return Void(); } } // namespace implementation diff --git a/wifi/1.0/default/wifi_p2p_iface.h b/wifi/1.0/default/wifi_p2p_iface.h index d70415df66..ba02212302 100644 --- a/wifi/1.0/default/wifi_p2p_iface.h +++ b/wifi/1.0/default/wifi_p2p_iface.h @@ -39,8 +39,8 @@ class WifiP2pIface : public IWifiP2pIface { void invalidate(); // HIDL methods exposed. - Return getName(getName_cb cb) override; - Return getType() override; + Return getName(getName_cb hidl_status_cb) override; + Return getType(getType_cb hidl_status_cb) override; private: std::string ifname_; diff --git a/wifi/1.0/default/wifi_rtt_controller.cpp b/wifi/1.0/default/wifi_rtt_controller.cpp index e2df1a85f7..c0d0a0054d 100644 --- a/wifi/1.0/default/wifi_rtt_controller.cpp +++ b/wifi/1.0/default/wifi_rtt_controller.cpp @@ -18,7 +18,7 @@ #include -#include "failure_reason_util.h" +#include "wifi_status_util.h" namespace android { namespace hardware { @@ -36,8 +36,14 @@ void WifiRttController::invalidate() { is_valid_ = false; } -Return WifiRttController::getBoundIface(getBoundIface_cb cb) { - cb(bound_iface_); +Return WifiRttController::getBoundIface(getBoundIface_cb hidl_status_cb) { + if (!is_valid_) { + hidl_status_cb( + createWifiStatus(WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID), + nullptr); + return Void(); + } + hidl_status_cb(createWifiStatus(WifiStatusCode::SUCCESS), bound_iface_); return Void(); } diff --git a/wifi/1.0/default/wifi_rtt_controller.h b/wifi/1.0/default/wifi_rtt_controller.h index 8d78b93e2f..51b15573dc 100644 --- a/wifi/1.0/default/wifi_rtt_controller.h +++ b/wifi/1.0/default/wifi_rtt_controller.h @@ -40,7 +40,7 @@ class WifiRttController : public IWifiRttController { void invalidate(); // HIDL methods exposed. - Return getBoundIface(getBoundIface_cb cb) override; + Return getBoundIface(getBoundIface_cb hidl_status_cb) override; private: sp bound_iface_; diff --git a/wifi/1.0/default/wifi_sta_iface.cpp b/wifi/1.0/default/wifi_sta_iface.cpp index 225cec424e..e3ae1118a3 100644 --- a/wifi/1.0/default/wifi_sta_iface.cpp +++ b/wifi/1.0/default/wifi_sta_iface.cpp @@ -18,7 +18,7 @@ #include -#include "failure_reason_util.h" +#include "wifi_status_util.h" namespace android { namespace hardware { @@ -35,15 +35,24 @@ void WifiStaIface::invalidate() { is_valid_ = false; } -Return WifiStaIface::getName(getName_cb cb) { - hidl_string hidl_ifname; - hidl_ifname.setToExternal(ifname_.c_str(), ifname_.size()); - cb(hidl_ifname); +Return WifiStaIface::getName(getName_cb hidl_status_cb) { + if (!is_valid_) { + hidl_status_cb(createWifiStatus(WifiStatusCode::ERROR_WIFI_IFACE_INVALID), + hidl_string()); + return Void(); + } + hidl_status_cb(createWifiStatus(WifiStatusCode::SUCCESS), ifname_); return Void(); } -Return WifiStaIface::getType() { - return IfaceType::STA; +Return WifiStaIface::getType(getType_cb hidl_status_cb) { + if (!is_valid_) { + hidl_status_cb(createWifiStatus(WifiStatusCode::ERROR_WIFI_IFACE_INVALID), + IfaceType::STA); + return Void(); + } + hidl_status_cb(createWifiStatus(WifiStatusCode::SUCCESS), IfaceType::STA); + return Void(); } } // namespace implementation diff --git a/wifi/1.0/default/wifi_sta_iface.h b/wifi/1.0/default/wifi_sta_iface.h index fc5efec90c..29c5f06b71 100644 --- a/wifi/1.0/default/wifi_sta_iface.h +++ b/wifi/1.0/default/wifi_sta_iface.h @@ -39,8 +39,8 @@ class WifiStaIface : public IWifiStaIface { void invalidate(); // HIDL methods exposed. - Return getName(getName_cb cb) override; - Return getType() override; + Return getName(getName_cb hidl_status_cb) override; + Return getType(getType_cb hidl_status_cb) override; private: std::string ifname_; diff --git a/wifi/1.0/default/wifi_status_util.h b/wifi/1.0/default/wifi_status_util.h index ec4b3f0e36..c988b059d0 100644 --- a/wifi/1.0/default/wifi_status_util.h +++ b/wifi/1.0/default/wifi_status_util.h @@ -27,7 +27,6 @@ namespace V1_0 { namespace implementation { std::string legacyErrorToString(wifi_error error); - WifiStatus createWifiStatus(WifiStatusCode code, const std::string& description); WifiStatus createWifiStatus(WifiStatusCode code); From 5647665827980a6dd2189214e02009f4c8f78dfc Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Wed, 26 Oct 2016 14:43:05 -0700 Subject: [PATCH 17/24] wifi: Helper functions for invoking hidl cont callbacks The helper functions are used to invoke an internal method which implements the functionality and then invoke the HIDL callback with the return values. HIDL's auto-generated code uses on-stack callbacks to return non-primitive/multiple values from HIDL methods. This is unwieldy and the implementation of the method's functionality gets mixed up with the semantics of handling these callbacks. This tries to hide the semantics of HIDL auto-generated code from the functionality. Converted all IWifi methods to use these new helper functions. Bug: 32337072 Test: Compiles Change-Id: I57cbafcc2ecb52ec5055f4bd80bc064bd438b850 --- wifi/1.0/default/hidl_return_util.h | 109 ++++++++++++++++++++++++++ wifi/1.0/default/wifi.cpp | 109 +++++++++++++++++--------- wifi/1.0/default/wifi.h | 13 ++- wifi/1.0/default/wifi_status_util.cpp | 5 +- 4 files changed, 192 insertions(+), 44 deletions(-) create mode 100644 wifi/1.0/default/hidl_return_util.h diff --git a/wifi/1.0/default/hidl_return_util.h b/wifi/1.0/default/hidl_return_util.h new file mode 100644 index 0000000000..2986165507 --- /dev/null +++ b/wifi/1.0/default/hidl_return_util.h @@ -0,0 +1,109 @@ +/* + * Copyright (C) 2016 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef HIDL_RETURN_UTIL_H_ +#define HIDL_RETURN_UTIL_H_ + +#include "wifi_status_util.h" + +namespace android { +namespace hardware { +namespace wifi { +namespace V1_0 { +namespace implementation { +namespace hidl_return_util { + +/** + * These utility functions are used to invoke a method on the provided + * HIDL interface object. + * These functions checks if the provided HIDL interface object is valid. + * a) if valid, Invokes the corresponding internal implementation function of + * the HIDL method. It then invokes the HIDL continuation callback with + * the status and any returned values. + * b) if invalid, invokes the HIDL continuation callback with the + * provided error status and default values. + */ +// Use for HIDL methods which return only an instance of WifiStatus. +template +Return validateAndCall( + ObjT* obj, + WifiStatusCode status_code_if_invalid, + WorkFuncT&& work, + const std::function& hidl_cb, + Args&&... args) { + if (obj->isValid()) { + hidl_cb((obj->*work)(std::forward(args)...)); + } else { + hidl_cb(createWifiStatus(status_code_if_invalid)); + } + return Void(); +} + +// Use for HIDL methods which return instance of WifiStatus and a single return +// value. +template +Return validateAndCall( + ObjT* obj, + WifiStatusCode status_code_if_invalid, + WorkFuncT&& work, + const std::function& hidl_cb, + Args&&... args) { + if (obj->isValid()) { + const auto& ret_pair = (obj->*work)(std::forward(args)...); + const WifiStatus& status = std::get<0>(ret_pair); + const auto& ret_value = std::get<1>(ret_pair); + hidl_cb(status, ret_value); + } else { + hidl_cb(createWifiStatus(status_code_if_invalid), + typename std::remove_reference::type()); + } + return Void(); +} + +// Use for HIDL methods which return instance of WifiStatus and 2 return +// values. +template +Return validateAndCall( + ObjT* obj, + WifiStatusCode status_code_if_invalid, + WorkFuncT&& work, + const std::function& hidl_cb, + Args&&... args) { + if (obj->isValid()) { + const auto& ret_tuple = (obj->*work)(std::forward(args)...); + const WifiStatus& status = std::get<0>(ret_tuple); + const auto& ret_value1 = std::get<1>(ret_tuple); + const auto& ret_value2 = std::get<2>(ret_tuple); + hidl_cb(status, ret_value1, ret_value2); + } else { + hidl_cb(createWifiStatus(status_code_if_invalid), + typename std::remove_reference::type(), + typename std::remove_reference::type()); + } + return Void(); +} + +} // namespace hidl_util +} // namespace implementation +} // namespace V1_0 +} // namespace wifi +} // namespace hardware +} // namespace android +#endif // HIDL_RETURN_UTIL_H_ diff --git a/wifi/1.0/default/wifi.cpp b/wifi/1.0/default/wifi.cpp index e10826bfbb..73b921ada7 100644 --- a/wifi/1.0/default/wifi.cpp +++ b/wifi/1.0/default/wifi.cpp @@ -14,11 +14,10 @@ * limitations under the License. */ -#include "wifi.h" - #include -#include "wifi_chip.h" +#include "hidl_return_util.h" +#include "wifi.h" #include "wifi_status_util.h" namespace { @@ -31,15 +30,24 @@ namespace hardware { namespace wifi { namespace V1_0 { namespace implementation { +using hidl_return_util::validateAndCall; Wifi::Wifi() : legacy_hal_(new WifiLegacyHal()), run_state_(RunState::STOPPED) {} +bool Wifi::isValid() { + // This object is always valid. + return true; +} + Return Wifi::registerEventCallback( - const sp& event_callback) { - // TODO(b/31632518): remove the callback when the client is destroyed - event_callbacks_.emplace_back(event_callback); - return Void(); + const sp& event_callback, + registerEventCallback_cb hidl_status_cb) { + return validateAndCall(this, + WifiStatusCode::ERROR_UNKNOWN, + &Wifi::registerEventCallbackInternal, + hidl_status_cb, + event_callback); } Return Wifi::isStarted() { @@ -47,22 +55,53 @@ Return Wifi::isStarted() { } Return Wifi::start(start_cb hidl_status_cb) { + return validateAndCall(this, + WifiStatusCode::ERROR_UNKNOWN, + &Wifi::startInternal, + hidl_status_cb); +} + +Return Wifi::stop(stop_cb hidl_status_cb) { + return validateAndCall( + this, WifiStatusCode::ERROR_UNKNOWN, &Wifi::stopInternal, hidl_status_cb); +} + +Return Wifi::getChipIds(getChipIds_cb hidl_status_cb) { + return validateAndCall(this, + WifiStatusCode::ERROR_UNKNOWN, + &Wifi::getChipIdsInternal, + hidl_status_cb); +} + +Return Wifi::getChip(ChipId chip_id, getChip_cb hidl_status_cb) { + return validateAndCall(this, + WifiStatusCode::ERROR_UNKNOWN, + &Wifi::getChipInternal, + hidl_status_cb, + chip_id); +} + +WifiStatus Wifi::registerEventCallbackInternal( + const sp& event_callback) { + // TODO(b/31632518): remove the callback when the client is destroyed + event_callbacks_.emplace_back(event_callback); + return createWifiStatus(WifiStatusCode::SUCCESS); +} + +WifiStatus Wifi::startInternal() { if (run_state_ == RunState::STARTED) { - hidl_status_cb(createWifiStatus(WifiStatusCode::SUCCESS)); - return Void(); + return createWifiStatus(WifiStatusCode::SUCCESS); } else if (run_state_ == RunState::STOPPING) { - hidl_status_cb(createWifiStatus(WifiStatusCode::ERROR_NOT_AVAILABLE, - "HAL is stopping")); - return Void(); + return createWifiStatus(WifiStatusCode::ERROR_NOT_AVAILABLE, + "HAL is stopping"); } LOG(INFO) << "Starting HAL"; wifi_error legacy_status = legacy_hal_->start(); if (legacy_status != WIFI_SUCCESS) { LOG(ERROR) << "Failed to start Wifi HAL"; - hidl_status_cb( - createWifiStatusFromLegacyError(legacy_status, "Failed to start HAL")); - return Void(); + return createWifiStatusFromLegacyError(legacy_status, + "Failed to start HAL"); } // Create the chip instance once the HAL is started. @@ -73,18 +112,15 @@ Return Wifi::start(start_cb hidl_status_cb) { LOG(ERROR) << "Failed to invoke onStart callback"; }; } - hidl_status_cb(createWifiStatus(WifiStatusCode::SUCCESS)); - return Void(); + return createWifiStatus(WifiStatusCode::SUCCESS); } -Return Wifi::stop(stop_cb hidl_status_cb) { +WifiStatus Wifi::stopInternal() { if (run_state_ == RunState::STOPPED) { - hidl_status_cb(createWifiStatus(WifiStatusCode::SUCCESS)); - return Void(); + return createWifiStatus(WifiStatusCode::SUCCESS); } else if (run_state_ == RunState::STOPPING) { - hidl_status_cb(createWifiStatus(WifiStatusCode::ERROR_NOT_AVAILABLE, - "HAL is stopping")); - return Void(); + return createWifiStatus(WifiStatusCode::ERROR_NOT_AVAILABLE, + "HAL is stopping"); } LOG(INFO) << "Stopping HAL"; @@ -109,33 +145,28 @@ Return Wifi::stop(stop_cb hidl_status_cb) { for (const auto& callback : event_callbacks_) { callback->onFailure(wifi_status); } - hidl_status_cb(wifi_status); - return Void(); + return wifi_status; } - hidl_status_cb(createWifiStatus(WifiStatusCode::SUCCESS)); - return Void(); + return createWifiStatus(WifiStatusCode::SUCCESS); } -Return Wifi::getChipIds(getChipIds_cb hidl_status_cb) { +std::pair> Wifi::getChipIdsInternal() { std::vector chip_ids; if (chip_.get()) { chip_ids.emplace_back(kChipId); } - hidl_vec hidl_data; - hidl_data.setToExternal(chip_ids.data(), chip_ids.size()); - hidl_status_cb(hidl_data); - return Void(); + return {createWifiStatus(WifiStatusCode::SUCCESS), std::move(chip_ids)}; } -Return Wifi::getChip(ChipId chip_id, getChip_cb hidl_status_cb) { - if (chip_.get() && chip_id == kChipId) { - hidl_status_cb(chip_); - } else { - hidl_status_cb(nullptr); +std::pair> Wifi::getChipInternal(ChipId chip_id) { + if (!chip_.get()) { + return {createWifiStatus(WifiStatusCode::ERROR_NOT_STARTED), nullptr}; } - return Void(); + if (chip_id != kChipId) { + return {createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS), nullptr}; + } + return {createWifiStatus(WifiStatusCode::SUCCESS), chip_}; } - } // namespace implementation } // namespace V1_0 } // namespace wifi diff --git a/wifi/1.0/default/wifi.h b/wifi/1.0/default/wifi.h index 989b63019b..c6821164fd 100644 --- a/wifi/1.0/default/wifi.h +++ b/wifi/1.0/default/wifi.h @@ -39,9 +39,12 @@ class Wifi : public IWifi { public: Wifi(); + bool isValid(); + // HIDL methods exposed. Return registerEventCallback( - const sp& event_callback) override; + const sp& event_callback, + registerEventCallback_cb hidl_status_cb) override; Return isStarted() override; Return start(start_cb hidl_status_cb) override; Return stop(stop_cb hidl_status_cb) override; @@ -51,6 +54,14 @@ class Wifi : public IWifi { private: enum class RunState { STOPPED, STARTED, STOPPING }; + // Corresponding worker functions for the HIDL methods. + WifiStatus registerEventCallbackInternal( + const sp& event_callback); + WifiStatus startInternal(); + WifiStatus stopInternal(); + std::pair> getChipIdsInternal(); + std::pair> getChipInternal(ChipId chip_id); + // Instance is created in this root level |IWifi| HIDL interface object // and shared with all the child HIDL interface objects. std::shared_ptr legacy_hal_; diff --git a/wifi/1.0/default/wifi_status_util.cpp b/wifi/1.0/default/wifi_status_util.cpp index 21b4eebe7b..34a1c1d23e 100644 --- a/wifi/1.0/default/wifi_status_util.cpp +++ b/wifi/1.0/default/wifi_status_util.cpp @@ -50,10 +50,7 @@ std::string legacyErrorToString(wifi_error error) { WifiStatus createWifiStatus(WifiStatusCode code, const std::string& description) { - WifiStatus result; - result.code = code; - result.description = description.data(); - return result; + return {code, description}; } WifiStatus createWifiStatus(WifiStatusCode code) { From 3c86852a2e0d9ef8696cf87f2bd0f067862f4e80 Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Thu, 27 Oct 2016 12:43:49 -0700 Subject: [PATCH 18/24] wifi: Use hidl_return_util functions in WifiChip Modify the WifiChip methods to the use the new helper functions. Also, 1. Modify the WifiLegacyHal.requestDriverMemoryDump & WifiLegacyHal.requestDriverMemoryDump to return a vector of |uint8_t| instead of |char| to avoid unnecessary typecasting in the HIDL methods. 2. Remove |createHidlVecOfIfaceNames| helper function as most of the necessary conversion should be handled by hidl_vec/hidl_string constructors. Bug: 32337072 Test: Compiles Change-Id: Ic0b7aa2a5a078e53d5bc5bef18995a3cc0f548a1 --- wifi/1.0/default/wifi_chip.cpp | 590 +++++++++++++-------------- wifi/1.0/default/wifi_chip.h | 32 ++ wifi/1.0/default/wifi_legacy_hal.cpp | 16 +- wifi/1.0/default/wifi_legacy_hal.h | 4 +- 4 files changed, 338 insertions(+), 304 deletions(-) diff --git a/wifi/1.0/default/wifi_chip.cpp b/wifi/1.0/default/wifi_chip.cpp index 4f8545ff48..bc46eec333 100644 --- a/wifi/1.0/default/wifi_chip.cpp +++ b/wifi/1.0/default/wifi_chip.cpp @@ -14,10 +14,10 @@ * limitations under the License. */ -#include "wifi_chip.h" - #include +#include "hidl_return_util.h" +#include "wifi_chip.h" #include "wifi_status_util.h" namespace { @@ -25,14 +25,6 @@ using android::sp; using android::hardware::hidl_vec; using android::hardware::hidl_string; -std::vector createHidlVecOfIfaceNames(const std::string& ifname) { - std::vector ifnames; - if (!ifname.empty()) { - ifnames.emplace_back(ifname); - } - return ifnames; -} - template void invalidateAndClear(sp& iface) { if (iface.get()) { @@ -47,6 +39,7 @@ namespace hardware { namespace wifi { namespace V1_0 { namespace implementation { +using hidl_return_util::validateAndCall; WifiChip::WifiChip(ChipId chip_id, const std::weak_ptr legacy_hal) @@ -59,363 +52,173 @@ void WifiChip::invalidate() { is_valid_ = false; } +bool WifiChip::isValid() { + return is_valid_; +} + Return WifiChip::getId(getId_cb hidl_status_cb) { - if (!is_valid_) { - hidl_status_cb(createWifiStatus(WifiStatusCode::ERROR_WIFI_CHIP_INVALID), - UINT32_MAX); - return Void(); - } - hidl_status_cb(createWifiStatus(WifiStatusCode::SUCCESS), chip_id_); - return Void(); + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_CHIP_INVALID, + &WifiChip::getIdInternal, + hidl_status_cb); } Return WifiChip::registerEventCallback( const sp& event_callback, registerEventCallback_cb hidl_status_cb) { - if (!is_valid_) { - hidl_status_cb(createWifiStatus(WifiStatusCode::ERROR_WIFI_CHIP_INVALID)); - return Void(); - } - // TODO(b/31632518): remove the callback when the client is destroyed - event_callbacks_.emplace_back(event_callback); - hidl_status_cb(createWifiStatus(WifiStatusCode::SUCCESS)); - return Void(); + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_CHIP_INVALID, + &WifiChip::registerEventCallbackInternal, + hidl_status_cb, + event_callback); } Return WifiChip::getAvailableModes(getAvailableModes_cb hidl_status_cb) { - if (!is_valid_) { - hidl_status_cb(createWifiStatus(WifiStatusCode::ERROR_WIFI_CHIP_INVALID), - hidl_vec()); - return Void(); - } - // TODO add implementation - hidl_status_cb(createWifiStatus(WifiStatusCode::SUCCESS), - hidl_vec()); - return Void(); + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_CHIP_INVALID, + &WifiChip::getAvailableModesInternal, + hidl_status_cb); } -Return WifiChip::configureChip(uint32_t /*mode_id*/, +Return WifiChip::configureChip(uint32_t mode_id, configureChip_cb hidl_status_cb) { - if (!is_valid_) { - hidl_status_cb(createWifiStatus(WifiStatusCode::ERROR_WIFI_CHIP_INVALID)); - return Void(); - } - - invalidateAndRemoveAllIfaces(); - // TODO add implementation - hidl_status_cb(createWifiStatus(WifiStatusCode::SUCCESS)); - return Void(); + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_CHIP_INVALID, + &WifiChip::configureChipInternal, + hidl_status_cb, + mode_id); } Return WifiChip::getMode(getMode_cb hidl_status_cb) { - if (!is_valid_) { - hidl_status_cb(createWifiStatus(WifiStatusCode::ERROR_WIFI_CHIP_INVALID), - UINT32_MAX); - return Void(); - } - // TODO add implementation - hidl_status_cb(createWifiStatus(WifiStatusCode::SUCCESS), 0); - return Void(); + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_CHIP_INVALID, + &WifiChip::getModeInternal, + hidl_status_cb); } Return WifiChip::requestChipDebugInfo( requestChipDebugInfo_cb hidl_status_cb) { - if (!is_valid_) { - hidl_status_cb(createWifiStatus(WifiStatusCode::ERROR_WIFI_CHIP_INVALID), - IWifiChip::ChipDebugInfo()); - return Void(); - } - - IWifiChip::ChipDebugInfo result; - - wifi_error legacy_status; - std::string driver_desc; - std::tie(legacy_status, driver_desc) = legacy_hal_.lock()->getDriverVersion(); - if (legacy_status != WIFI_SUCCESS) { - LOG(ERROR) << "Failed to get driver version: " - << legacyErrorToString(legacy_status); - WifiStatus status = createWifiStatusFromLegacyError( - legacy_status, "failed to get driver version"); - hidl_status_cb(status, result); - return Void(); - } - result.driverDescription = driver_desc.c_str(); - - std::string firmware_desc; - std::tie(legacy_status, firmware_desc) = - legacy_hal_.lock()->getFirmwareVersion(); - if (legacy_status != WIFI_SUCCESS) { - LOG(ERROR) << "Failed to get firmware version: " - << legacyErrorToString(legacy_status); - WifiStatus status = createWifiStatusFromLegacyError( - legacy_status, "failed to get firmware version"); - hidl_status_cb(status, result); - return Void(); - } - result.firmwareDescription = firmware_desc.c_str(); - - hidl_status_cb(createWifiStatus(WifiStatusCode::SUCCESS), result); - return Void(); + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_CHIP_INVALID, + &WifiChip::requestChipDebugInfoInternal, + hidl_status_cb); } Return WifiChip::requestDriverDebugDump( requestDriverDebugDump_cb hidl_status_cb) { - if (!is_valid_) { - hidl_status_cb(createWifiStatus(WifiStatusCode::ERROR_WIFI_CHIP_INVALID), - hidl_vec()); - return Void(); - } - - wifi_error legacy_status; - std::vector driver_dump; - std::tie(legacy_status, driver_dump) = - legacy_hal_.lock()->requestDriverMemoryDump(); - if (legacy_status != WIFI_SUCCESS) { - LOG(ERROR) << "Failed to get driver debug dump: " - << legacyErrorToString(legacy_status); - hidl_status_cb(createWifiStatusFromLegacyError(legacy_status), - hidl_vec()); - return Void(); - } - - hidl_vec hidl_data; - hidl_data.setToExternal(reinterpret_cast(driver_dump.data()), - driver_dump.size()); - hidl_status_cb(createWifiStatus(WifiStatusCode::SUCCESS), hidl_data); - return Void(); + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_CHIP_INVALID, + &WifiChip::requestDriverDebugDumpInternal, + hidl_status_cb); } Return WifiChip::requestFirmwareDebugDump( requestFirmwareDebugDump_cb hidl_status_cb) { - if (!is_valid_) { - hidl_status_cb(createWifiStatus(WifiStatusCode::ERROR_WIFI_CHIP_INVALID), - hidl_vec()); - return Void(); - } - - wifi_error legacy_status; - std::vector firmware_dump; - std::tie(legacy_status, firmware_dump) = - legacy_hal_.lock()->requestFirmwareMemoryDump(); - if (legacy_status != WIFI_SUCCESS) { - LOG(ERROR) << "Failed to get firmware debug dump: " - << legacyErrorToString(legacy_status); - hidl_status_cb(createWifiStatusFromLegacyError(legacy_status), - hidl_vec()); - return Void(); - } - - hidl_vec hidl_data; - hidl_data.setToExternal(reinterpret_cast(firmware_dump.data()), - firmware_dump.size()); - hidl_status_cb(createWifiStatus(WifiStatusCode::SUCCESS), hidl_data); - return Void(); + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_CHIP_INVALID, + &WifiChip::requestFirmwareDebugDumpInternal, + hidl_status_cb); } Return WifiChip::createApIface(createApIface_cb hidl_status_cb) { - if (!is_valid_) { - hidl_status_cb(createWifiStatus(WifiStatusCode::ERROR_WIFI_CHIP_INVALID), - nullptr); - return Void(); - } - - // TODO(b/31997422): Disallow this based on the chip combination. - std::string ifname = legacy_hal_.lock()->getApIfaceName(); - ap_iface_ = new WifiApIface(ifname, legacy_hal_); - hidl_status_cb(createWifiStatus(WifiStatusCode::SUCCESS), ap_iface_); - return Void(); + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_CHIP_INVALID, + &WifiChip::createApIfaceInternal, + hidl_status_cb); } Return WifiChip::getApIfaceNames(getApIfaceNames_cb hidl_status_cb) { - if (!is_valid_) { - hidl_status_cb(createWifiStatus(WifiStatusCode::ERROR_WIFI_CHIP_INVALID), - hidl_vec()); - return Void(); - } - - std::string ifname; - if (ap_iface_.get()) { - ifname = legacy_hal_.lock()->getApIfaceName().c_str(); - } - hidl_status_cb(createWifiStatus(WifiStatusCode::SUCCESS), - createHidlVecOfIfaceNames(ifname)); - return Void(); + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_CHIP_INVALID, + &WifiChip::getApIfaceNamesInternal, + hidl_status_cb); } Return WifiChip::getApIface(const hidl_string& ifname, getApIface_cb hidl_status_cb) { - if (!is_valid_) { - hidl_status_cb(createWifiStatus(WifiStatusCode::ERROR_WIFI_CHIP_INVALID), - nullptr); - return Void(); - } - - if (ap_iface_.get() && - (ifname.c_str() == legacy_hal_.lock()->getApIfaceName())) { - hidl_status_cb(createWifiStatus(WifiStatusCode::SUCCESS), ap_iface_); - } else { - hidl_status_cb(createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS), - nullptr); - } - return Void(); + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_CHIP_INVALID, + &WifiChip::getApIfaceInternal, + hidl_status_cb, + ifname); } Return WifiChip::createNanIface(createNanIface_cb hidl_status_cb) { - if (!is_valid_) { - hidl_status_cb(createWifiStatus(WifiStatusCode::ERROR_WIFI_CHIP_INVALID), - nullptr); - return Void(); - } - - // TODO(b/31997422): Disallow this based on the chip combination. - std::string ifname = legacy_hal_.lock()->getNanIfaceName(); - nan_iface_ = new WifiNanIface(ifname, legacy_hal_); - hidl_status_cb(createWifiStatus(WifiStatusCode::SUCCESS), nan_iface_); - return Void(); + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_CHIP_INVALID, + &WifiChip::createNanIfaceInternal, + hidl_status_cb); } Return WifiChip::getNanIfaceNames(getNanIfaceNames_cb hidl_status_cb) { - if (!is_valid_) { - hidl_status_cb(createWifiStatus(WifiStatusCode::ERROR_WIFI_CHIP_INVALID), - hidl_vec()); - return Void(); - } - - std::string ifname; - if (nan_iface_.get()) { - ifname = legacy_hal_.lock()->getNanIfaceName().c_str(); - } - hidl_status_cb(createWifiStatus(WifiStatusCode::SUCCESS), - createHidlVecOfIfaceNames(ifname)); - return Void(); + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_CHIP_INVALID, + &WifiChip::getNanIfaceNamesInternal, + hidl_status_cb); } Return WifiChip::getNanIface(const hidl_string& ifname, getNanIface_cb hidl_status_cb) { - if (!is_valid_) { - hidl_status_cb(createWifiStatus(WifiStatusCode::ERROR_WIFI_CHIP_INVALID), - nullptr); - return Void(); - } - - if (nan_iface_.get() && - (ifname.c_str() == legacy_hal_.lock()->getNanIfaceName())) { - hidl_status_cb(createWifiStatus(WifiStatusCode::SUCCESS), nan_iface_); - } else { - hidl_status_cb(createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS), - nullptr); - } - return Void(); + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_CHIP_INVALID, + &WifiChip::getNanIfaceInternal, + hidl_status_cb, + ifname); } Return WifiChip::createP2pIface(createP2pIface_cb hidl_status_cb) { - if (!is_valid_) { - hidl_status_cb(createWifiStatus(WifiStatusCode::ERROR_WIFI_CHIP_INVALID), - nullptr); - return Void(); - } - - // TODO(b/31997422): Disallow this based on the chip combination. - std::string ifname = legacy_hal_.lock()->getP2pIfaceName(); - p2p_iface_ = new WifiP2pIface(ifname, legacy_hal_); - hidl_status_cb(createWifiStatus(WifiStatusCode::SUCCESS), p2p_iface_); - return Void(); + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_CHIP_INVALID, + &WifiChip::createP2pIfaceInternal, + hidl_status_cb); } Return WifiChip::getP2pIfaceNames(getP2pIfaceNames_cb hidl_status_cb) { - if (!is_valid_) { - hidl_status_cb(createWifiStatus(WifiStatusCode::ERROR_WIFI_CHIP_INVALID), - hidl_vec()); - return Void(); - } - - std::string ifname; - if (p2p_iface_.get()) { - ifname = legacy_hal_.lock()->getP2pIfaceName().c_str(); - } - hidl_status_cb(createWifiStatus(WifiStatusCode::SUCCESS), - createHidlVecOfIfaceNames(ifname)); - return Void(); + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_CHIP_INVALID, + &WifiChip::getP2pIfaceNamesInternal, + hidl_status_cb); } Return WifiChip::getP2pIface(const hidl_string& ifname, getP2pIface_cb hidl_status_cb) { - if (!is_valid_) { - hidl_status_cb(createWifiStatus(WifiStatusCode::ERROR_WIFI_CHIP_INVALID), - nullptr); - return Void(); - } - - if (p2p_iface_.get() && - (ifname.c_str() == legacy_hal_.lock()->getP2pIfaceName())) { - hidl_status_cb(createWifiStatus(WifiStatusCode::SUCCESS), p2p_iface_); - } else { - hidl_status_cb(createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS), - nullptr); - } - return Void(); + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_CHIP_INVALID, + &WifiChip::getP2pIfaceInternal, + hidl_status_cb, + ifname); } Return WifiChip::createStaIface(createStaIface_cb hidl_status_cb) { - if (!is_valid_) { - hidl_status_cb(createWifiStatus(WifiStatusCode::ERROR_WIFI_CHIP_INVALID), - nullptr); - return Void(); - } - - // TODO(b/31997422): Disallow this based on the chip combination. - std::string ifname = legacy_hal_.lock()->getStaIfaceName(); - sta_iface_ = new WifiStaIface(ifname, legacy_hal_); - hidl_status_cb(createWifiStatus(WifiStatusCode::SUCCESS), sta_iface_); - return Void(); + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_CHIP_INVALID, + &WifiChip::createStaIfaceInternal, + hidl_status_cb); } Return WifiChip::getStaIfaceNames(getStaIfaceNames_cb hidl_status_cb) { - if (!is_valid_) { - hidl_status_cb(createWifiStatus(WifiStatusCode::ERROR_WIFI_CHIP_INVALID), - hidl_vec()); - return Void(); - } - - std::string ifname; - if (sta_iface_.get()) { - ifname = legacy_hal_.lock()->getStaIfaceName().c_str(); - } - hidl_status_cb(createWifiStatus(WifiStatusCode::SUCCESS), - createHidlVecOfIfaceNames(ifname)); - return Void(); + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_CHIP_INVALID, + &WifiChip::getStaIfaceNamesInternal, + hidl_status_cb); } Return WifiChip::getStaIface(const hidl_string& ifname, getStaIface_cb hidl_status_cb) { - if (!is_valid_) { - hidl_status_cb(createWifiStatus(WifiStatusCode::ERROR_WIFI_CHIP_INVALID), - nullptr); - return Void(); - } - - if (sta_iface_.get() && - (ifname.c_str() == legacy_hal_.lock()->getStaIfaceName())) { - hidl_status_cb(createWifiStatus(WifiStatusCode::SUCCESS), sta_iface_); - } else { - hidl_status_cb(createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS), - nullptr); - } - return Void(); + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_CHIP_INVALID, + &WifiChip::getStaIfaceInternal, + hidl_status_cb, + ifname); } Return WifiChip::createRttController( const sp& bound_iface, createRttController_cb hidl_status_cb) { - if (!is_valid_) { - hidl_status_cb(createWifiStatus(WifiStatusCode::ERROR_WIFI_CHIP_INVALID), - nullptr); - return Void(); - } - - sp rtt = new WifiRttController(bound_iface, legacy_hal_); - rtt_controllers_.emplace_back(rtt); - hidl_status_cb(createWifiStatus(WifiStatusCode::SUCCESS), rtt); - return Void(); + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_CHIP_INVALID, + &WifiChip::createRttControllerInternal, + hidl_status_cb, + bound_iface); } void WifiChip::invalidateAndRemoveAllIfaces() { @@ -431,6 +234,201 @@ void WifiChip::invalidateAndRemoveAllIfaces() { rtt_controllers_.clear(); } +std::pair WifiChip::getIdInternal() { + return {createWifiStatus(WifiStatusCode::SUCCESS), chip_id_}; +} + +WifiStatus WifiChip::registerEventCallbackInternal( + const sp& event_callback) { + // TODO(b/31632518): remove the callback when the client is destroyed + event_callbacks_.emplace_back(event_callback); + return createWifiStatus(WifiStatusCode::SUCCESS); +} + +std::pair> +WifiChip::getAvailableModesInternal() { + // TODO add implementation + return {createWifiStatus(WifiStatusCode::SUCCESS), + std::vector()}; +} + +WifiStatus WifiChip::configureChipInternal(uint32_t /* mode_id */) { + invalidateAndRemoveAllIfaces(); + // TODO add implementation + return createWifiStatus(WifiStatusCode::SUCCESS); +} + +std::pair WifiChip::getModeInternal() { + // TODO add implementation + return {createWifiStatus(WifiStatusCode::SUCCESS), 0}; +} + +std::pair +WifiChip::requestChipDebugInfoInternal() { + IWifiChip::ChipDebugInfo result; + wifi_error legacy_status; + std::string driver_desc; + std::tie(legacy_status, driver_desc) = legacy_hal_.lock()->getDriverVersion(); + if (legacy_status != WIFI_SUCCESS) { + LOG(ERROR) << "Failed to get driver version: " + << legacyErrorToString(legacy_status); + WifiStatus status = createWifiStatusFromLegacyError( + legacy_status, "failed to get driver version"); + return {status, result}; + } + result.driverDescription = driver_desc.c_str(); + + std::string firmware_desc; + std::tie(legacy_status, firmware_desc) = + legacy_hal_.lock()->getFirmwareVersion(); + if (legacy_status != WIFI_SUCCESS) { + LOG(ERROR) << "Failed to get firmware version: " + << legacyErrorToString(legacy_status); + WifiStatus status = createWifiStatusFromLegacyError( + legacy_status, "failed to get firmware version"); + return {status, result}; + } + result.firmwareDescription = firmware_desc.c_str(); + + return {createWifiStatus(WifiStatusCode::SUCCESS), result}; +} + +std::pair> +WifiChip::requestDriverDebugDumpInternal() { + wifi_error legacy_status; + std::vector driver_dump; + std::tie(legacy_status, driver_dump) = + legacy_hal_.lock()->requestDriverMemoryDump(); + if (legacy_status != WIFI_SUCCESS) { + LOG(ERROR) << "Failed to get driver debug dump: " + << legacyErrorToString(legacy_status); + return {createWifiStatusFromLegacyError(legacy_status), + std::vector()}; + } + return {createWifiStatus(WifiStatusCode::SUCCESS), driver_dump}; +} + +std::pair> +WifiChip::requestFirmwareDebugDumpInternal() { + wifi_error legacy_status; + std::vector firmware_dump; + std::tie(legacy_status, firmware_dump) = + legacy_hal_.lock()->requestFirmwareMemoryDump(); + if (legacy_status != WIFI_SUCCESS) { + LOG(ERROR) << "Failed to get firmware debug dump: " + << legacyErrorToString(legacy_status); + return {createWifiStatusFromLegacyError(legacy_status), + std::vector()}; + } + return {createWifiStatus(WifiStatusCode::SUCCESS), firmware_dump}; +} + +std::pair> WifiChip::createApIfaceInternal() { + // TODO(b/31997422): Disallow this based on the chip combination. + std::string ifname = legacy_hal_.lock()->getApIfaceName(); + ap_iface_ = new WifiApIface(ifname, legacy_hal_); + return {createWifiStatus(WifiStatusCode::SUCCESS), ap_iface_}; +} + +std::pair> +WifiChip::getApIfaceNamesInternal() { + if (!ap_iface_.get()) { + return {createWifiStatus(WifiStatusCode::SUCCESS), {}}; + } + return {createWifiStatus(WifiStatusCode::SUCCESS), + {legacy_hal_.lock()->getApIfaceName()}}; +} + +std::pair> WifiChip::getApIfaceInternal( + const hidl_string& ifname) { + if (!ap_iface_.get() || + (ifname.c_str() != legacy_hal_.lock()->getApIfaceName())) { + return {createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS), nullptr}; + } + return {createWifiStatus(WifiStatusCode::SUCCESS), ap_iface_}; +} + +std::pair> WifiChip::createNanIfaceInternal() { + // TODO(b/31997422): Disallow this based on the chip combination. + std::string ifname = legacy_hal_.lock()->getNanIfaceName(); + nan_iface_ = new WifiNanIface(ifname, legacy_hal_); + return {createWifiStatus(WifiStatusCode::SUCCESS), nan_iface_}; +} + +std::pair> +WifiChip::getNanIfaceNamesInternal() { + if (!nan_iface_.get()) { + return {createWifiStatus(WifiStatusCode::SUCCESS), {}}; + } + return {createWifiStatus(WifiStatusCode::SUCCESS), + {legacy_hal_.lock()->getNanIfaceName()}}; +} + +std::pair> WifiChip::getNanIfaceInternal( + const hidl_string& ifname) { + if (!nan_iface_.get() || + (ifname.c_str() != legacy_hal_.lock()->getNanIfaceName())) { + return {createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS), nullptr}; + } + return {createWifiStatus(WifiStatusCode::SUCCESS), nan_iface_}; +} + +std::pair> WifiChip::createP2pIfaceInternal() { + // TODO(b/31997422): Disallow this based on the chip combination. + std::string ifname = legacy_hal_.lock()->getP2pIfaceName(); + p2p_iface_ = new WifiP2pIface(ifname, legacy_hal_); + return {createWifiStatus(WifiStatusCode::SUCCESS), p2p_iface_}; +} + +std::pair> +WifiChip::getP2pIfaceNamesInternal() { + if (!p2p_iface_.get()) { + return {createWifiStatus(WifiStatusCode::SUCCESS), {}}; + } + return {createWifiStatus(WifiStatusCode::SUCCESS), + {legacy_hal_.lock()->getP2pIfaceName()}}; +} + +std::pair> WifiChip::getP2pIfaceInternal( + const hidl_string& ifname) { + if (!p2p_iface_.get() || + (ifname.c_str() != legacy_hal_.lock()->getP2pIfaceName())) { + return {createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS), nullptr}; + } + return {createWifiStatus(WifiStatusCode::SUCCESS), p2p_iface_}; +} + +std::pair> WifiChip::createStaIfaceInternal() { + // TODO(b/31997422): Disallow this based on the chip combination. + std::string ifname = legacy_hal_.lock()->getStaIfaceName(); + sta_iface_ = new WifiStaIface(ifname, legacy_hal_); + return {createWifiStatus(WifiStatusCode::SUCCESS), sta_iface_}; +} + +std::pair> +WifiChip::getStaIfaceNamesInternal() { + if (!sta_iface_.get()) { + return {createWifiStatus(WifiStatusCode::SUCCESS), {}}; + } + return {createWifiStatus(WifiStatusCode::SUCCESS), + {legacy_hal_.lock()->getStaIfaceName()}}; +} + +std::pair> WifiChip::getStaIfaceInternal( + const hidl_string& ifname) { + if (!sta_iface_.get() || + (ifname.c_str() != legacy_hal_.lock()->getStaIfaceName())) { + return {createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS), nullptr}; + } + return {createWifiStatus(WifiStatusCode::SUCCESS), sta_iface_}; +} + +std::pair> +WifiChip::createRttControllerInternal(const sp& bound_iface) { + sp rtt = new WifiRttController(bound_iface, legacy_hal_); + rtt_controllers_.emplace_back(rtt); + return {createWifiStatus(WifiStatusCode::SUCCESS), rtt}; +} } // namespace implementation } // namespace V1_0 } // namespace wifi diff --git a/wifi/1.0/default/wifi_chip.h b/wifi/1.0/default/wifi_chip.h index dd9117e63e..47b4d7a2ee 100644 --- a/wifi/1.0/default/wifi_chip.h +++ b/wifi/1.0/default/wifi_chip.h @@ -57,6 +57,7 @@ class WifiChip : public IWifiChip { // All HIDL method implementations should check if the object is still marked // valid before processing them. void invalidate(); + bool isValid(); // HIDL methods exposed. Return getId(getId_cb hidl_status_cb) override; @@ -96,6 +97,37 @@ class WifiChip : public IWifiChip { private: void invalidateAndRemoveAllIfaces(); + // Corresponding worker functions for the HIDL methods. + std::pair getIdInternal(); + WifiStatus registerEventCallbackInternal( + const sp& event_callback); + std::pair> getAvailableModesInternal(); + WifiStatus configureChipInternal(uint32_t mode_id); + std::pair getModeInternal(); + std::pair + requestChipDebugInfoInternal(); + std::pair> requestDriverDebugDumpInternal(); + std::pair> + requestFirmwareDebugDumpInternal(); + std::pair> createApIfaceInternal(); + std::pair> getApIfaceNamesInternal(); + std::pair> getApIfaceInternal( + const hidl_string& ifname); + std::pair> createNanIfaceInternal(); + std::pair> getNanIfaceNamesInternal(); + std::pair> getNanIfaceInternal( + const hidl_string& ifname); + std::pair> createP2pIfaceInternal(); + std::pair> getP2pIfaceNamesInternal(); + std::pair> getP2pIfaceInternal( + const hidl_string& ifname); + std::pair> createStaIfaceInternal(); + std::pair> getStaIfaceNamesInternal(); + std::pair> getStaIfaceInternal( + const hidl_string& ifname); + std::pair> createRttControllerInternal( + const sp& bound_iface); + ChipId chip_id_; std::weak_ptr legacy_hal_; std::vector> event_callbacks_; diff --git a/wifi/1.0/default/wifi_legacy_hal.cpp b/wifi/1.0/default/wifi_legacy_hal.cpp index 65c078287a..5bd2454a99 100644 --- a/wifi/1.0/default/wifi_legacy_hal.cpp +++ b/wifi/1.0/default/wifi_legacy_hal.cpp @@ -154,12 +154,14 @@ std::pair WifiLegacyHal::getFirmwareVersion() { return std::make_pair(status, buffer.data()); } -std::pair> +std::pair> WifiLegacyHal::requestDriverMemoryDump() { - std::vector driver_dump; + std::vector driver_dump; on_driver_memory_dump_internal_callback = [&driver_dump](char* buffer, int buffer_size) { - driver_dump.insert(driver_dump.end(), buffer, buffer + buffer_size); + driver_dump.insert(driver_dump.end(), + reinterpret_cast(buffer), + reinterpret_cast(buffer) + buffer_size); }; wifi_error status = global_func_table_.wifi_get_driver_memory_dump( wlan_interface_handle_, {onDriverMemoryDump}); @@ -167,12 +169,14 @@ WifiLegacyHal::requestDriverMemoryDump() { return std::make_pair(status, std::move(driver_dump)); } -std::pair> +std::pair> WifiLegacyHal::requestFirmwareMemoryDump() { - std::vector firmware_dump; + std::vector firmware_dump; on_firmware_memory_dump_internal_callback = [&firmware_dump]( char* buffer, int buffer_size) { - firmware_dump.insert(firmware_dump.end(), buffer, buffer + buffer_size); + firmware_dump.insert(firmware_dump.end(), + reinterpret_cast(buffer), + reinterpret_cast(buffer) + buffer_size); }; wifi_error status = global_func_table_.wifi_get_firmware_memory_dump( wlan_interface_handle_, {onFirmwareMemoryDump}); diff --git a/wifi/1.0/default/wifi_legacy_hal.h b/wifi/1.0/default/wifi_legacy_hal.h index 367ff15d24..21acb92621 100644 --- a/wifi/1.0/default/wifi_legacy_hal.h +++ b/wifi/1.0/default/wifi_legacy_hal.h @@ -49,8 +49,8 @@ class WifiLegacyHal { // Wrappers for all the functions in the legacy HAL function table. std::pair getDriverVersion(); std::pair getFirmwareVersion(); - std::pair> requestDriverMemoryDump(); - std::pair> requestFirmwareMemoryDump(); + std::pair> requestDriverMemoryDump(); + std::pair> requestFirmwareMemoryDump(); private: static const uint32_t kMaxVersionStringLength; From 907d4a234da9806cde5169c17236a0501805b70a Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Thu, 27 Oct 2016 12:48:12 -0700 Subject: [PATCH 19/24] wifi: Use hidl_return_util functions in Iface/Rtt Modify the WifiIface & WifiRttController methods to the use the new helper functions. Bug: 32337072 Test: Compiles Change-Id: I8ce5450f3012ea3ad699db3c780c0bf985492aad --- wifi/1.0/default/wifi_ap_iface.cpp | 39 ++++++++++++++---------- wifi/1.0/default/wifi_ap_iface.h | 5 +++ wifi/1.0/default/wifi_nan_iface.cpp | 39 ++++++++++++++---------- wifi/1.0/default/wifi_nan_iface.h | 5 +++ wifi/1.0/default/wifi_p2p_iface.cpp | 39 ++++++++++++++---------- wifi/1.0/default/wifi_p2p_iface.h | 5 +++ wifi/1.0/default/wifi_rtt_controller.cpp | 26 ++++++++++------ wifi/1.0/default/wifi_rtt_controller.h | 4 +++ wifi/1.0/default/wifi_sta_iface.cpp | 39 ++++++++++++++---------- wifi/1.0/default/wifi_sta_iface.h | 5 +++ 10 files changed, 132 insertions(+), 74 deletions(-) diff --git a/wifi/1.0/default/wifi_ap_iface.cpp b/wifi/1.0/default/wifi_ap_iface.cpp index 1b59b18ae3..8c389467dd 100644 --- a/wifi/1.0/default/wifi_ap_iface.cpp +++ b/wifi/1.0/default/wifi_ap_iface.cpp @@ -14,10 +14,10 @@ * limitations under the License. */ -#include "wifi_ap_iface.h" - #include +#include "hidl_return_util.h" +#include "wifi_ap_iface.h" #include "wifi_status_util.h" namespace android { @@ -25,6 +25,7 @@ namespace hardware { namespace wifi { namespace V1_0 { namespace implementation { +using hidl_return_util::validateAndCall; WifiApIface::WifiApIface(const std::string& ifname, const std::weak_ptr legacy_hal) @@ -35,24 +36,30 @@ void WifiApIface::invalidate() { is_valid_ = false; } +bool WifiApIface::isValid() { + return is_valid_; +} + Return WifiApIface::getName(getName_cb hidl_status_cb) { - if (!is_valid_) { - hidl_status_cb(createWifiStatus(WifiStatusCode::ERROR_WIFI_IFACE_INVALID), - hidl_string()); - return Void(); - } - hidl_status_cb(createWifiStatus(WifiStatusCode::SUCCESS), ifname_); - return Void(); + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiApIface::getNameInternal, + hidl_status_cb); } Return WifiApIface::getType(getType_cb hidl_status_cb) { - if (!is_valid_) { - hidl_status_cb(createWifiStatus(WifiStatusCode::ERROR_WIFI_IFACE_INVALID), - IfaceType::AP); - return Void(); - } - hidl_status_cb(createWifiStatus(WifiStatusCode::SUCCESS), IfaceType::AP); - return Void(); + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiApIface::getTypeInternal, + hidl_status_cb); +} + +std::pair WifiApIface::getNameInternal() { + return {createWifiStatus(WifiStatusCode::SUCCESS), ifname_}; +} + +std::pair WifiApIface::getTypeInternal() { + return {createWifiStatus(WifiStatusCode::SUCCESS), IfaceType::AP}; } } // namespace implementation diff --git a/wifi/1.0/default/wifi_ap_iface.h b/wifi/1.0/default/wifi_ap_iface.h index 1382112892..458bddad04 100644 --- a/wifi/1.0/default/wifi_ap_iface.h +++ b/wifi/1.0/default/wifi_ap_iface.h @@ -37,12 +37,17 @@ class WifiApIface : public IWifiApIface { const std::weak_ptr legacy_hal); // Refer to |WifiChip::invalidate()|. void invalidate(); + bool isValid(); // HIDL methods exposed. Return getName(getName_cb hidl_status_cb) override; Return getType(getType_cb hidl_status_cb) override; private: + // Corresponding worker functions for the HIDL methods. + std::pair getNameInternal(); + std::pair getTypeInternal(); + std::string ifname_; std::weak_ptr legacy_hal_; bool is_valid_; diff --git a/wifi/1.0/default/wifi_nan_iface.cpp b/wifi/1.0/default/wifi_nan_iface.cpp index da15cf6f5a..c018e67090 100644 --- a/wifi/1.0/default/wifi_nan_iface.cpp +++ b/wifi/1.0/default/wifi_nan_iface.cpp @@ -14,10 +14,10 @@ * limitations under the License. */ -#include "wifi_nan_iface.h" - #include +#include "hidl_return_util.h" +#include "wifi_nan_iface.h" #include "wifi_status_util.h" namespace android { @@ -25,6 +25,7 @@ namespace hardware { namespace wifi { namespace V1_0 { namespace implementation { +using hidl_return_util::validateAndCall; WifiNanIface::WifiNanIface(const std::string& ifname, const std::weak_ptr legacy_hal) @@ -35,24 +36,30 @@ void WifiNanIface::invalidate() { is_valid_ = false; } +bool WifiNanIface::isValid() { + return is_valid_; +} + Return WifiNanIface::getName(getName_cb hidl_status_cb) { - if (!is_valid_) { - hidl_status_cb(createWifiStatus(WifiStatusCode::ERROR_WIFI_IFACE_INVALID), - hidl_string()); - return Void(); - } - hidl_status_cb(createWifiStatus(WifiStatusCode::SUCCESS), ifname_); - return Void(); + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::getNameInternal, + hidl_status_cb); } Return WifiNanIface::getType(getType_cb hidl_status_cb) { - if (!is_valid_) { - hidl_status_cb(createWifiStatus(WifiStatusCode::ERROR_WIFI_IFACE_INVALID), - IfaceType::NAN); - return Void(); - } - hidl_status_cb(createWifiStatus(WifiStatusCode::SUCCESS), IfaceType::NAN); - return Void(); + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::getTypeInternal, + hidl_status_cb); +} + +std::pair WifiNanIface::getNameInternal() { + return {createWifiStatus(WifiStatusCode::SUCCESS), ifname_}; +} + +std::pair WifiNanIface::getTypeInternal() { + return {createWifiStatus(WifiStatusCode::SUCCESS), IfaceType::NAN}; } } // namespace implementation diff --git a/wifi/1.0/default/wifi_nan_iface.h b/wifi/1.0/default/wifi_nan_iface.h index a97c38a1c4..31e0c7ffe4 100644 --- a/wifi/1.0/default/wifi_nan_iface.h +++ b/wifi/1.0/default/wifi_nan_iface.h @@ -37,12 +37,17 @@ class WifiNanIface : public IWifiNanIface { const std::weak_ptr legacy_hal); // Refer to |WifiChip::invalidate()|. void invalidate(); + bool isValid(); // HIDL methods exposed. Return getName(getName_cb hidl_status_cb) override; Return getType(getType_cb hidl_status_cb) override; private: + // Corresponding worker functions for the HIDL methods. + std::pair getNameInternal(); + std::pair getTypeInternal(); + std::string ifname_; std::weak_ptr legacy_hal_; bool is_valid_; diff --git a/wifi/1.0/default/wifi_p2p_iface.cpp b/wifi/1.0/default/wifi_p2p_iface.cpp index 9ffb48c8b0..65258ba0eb 100644 --- a/wifi/1.0/default/wifi_p2p_iface.cpp +++ b/wifi/1.0/default/wifi_p2p_iface.cpp @@ -14,10 +14,10 @@ * limitations under the License. */ -#include "wifi_p2p_iface.h" - #include +#include "hidl_return_util.h" +#include "wifi_p2p_iface.h" #include "wifi_status_util.h" namespace android { @@ -25,6 +25,7 @@ namespace hardware { namespace wifi { namespace V1_0 { namespace implementation { +using hidl_return_util::validateAndCall; WifiP2pIface::WifiP2pIface(const std::string& ifname, const std::weak_ptr legacy_hal) @@ -35,24 +36,30 @@ void WifiP2pIface::invalidate() { is_valid_ = false; } +bool WifiP2pIface::isValid() { + return is_valid_; +} + Return WifiP2pIface::getName(getName_cb hidl_status_cb) { - if (!is_valid_) { - hidl_status_cb(createWifiStatus(WifiStatusCode::ERROR_WIFI_IFACE_INVALID), - hidl_string()); - return Void(); - } - hidl_status_cb(createWifiStatus(WifiStatusCode::SUCCESS), ifname_); - return Void(); + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiP2pIface::getNameInternal, + hidl_status_cb); } Return WifiP2pIface::getType(getType_cb hidl_status_cb) { - if (!is_valid_) { - hidl_status_cb(createWifiStatus(WifiStatusCode::ERROR_WIFI_IFACE_INVALID), - IfaceType::P2P); - return Void(); - } - hidl_status_cb(createWifiStatus(WifiStatusCode::SUCCESS), IfaceType::P2P); - return Void(); + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiP2pIface::getTypeInternal, + hidl_status_cb); +} + +std::pair WifiP2pIface::getNameInternal() { + return {createWifiStatus(WifiStatusCode::SUCCESS), ifname_}; +} + +std::pair WifiP2pIface::getTypeInternal() { + return {createWifiStatus(WifiStatusCode::SUCCESS), IfaceType::P2P}; } } // namespace implementation diff --git a/wifi/1.0/default/wifi_p2p_iface.h b/wifi/1.0/default/wifi_p2p_iface.h index ba02212302..d4656e1224 100644 --- a/wifi/1.0/default/wifi_p2p_iface.h +++ b/wifi/1.0/default/wifi_p2p_iface.h @@ -37,12 +37,17 @@ class WifiP2pIface : public IWifiP2pIface { const std::weak_ptr legacy_hal); // Refer to |WifiChip::invalidate()|. void invalidate(); + bool isValid(); // HIDL methods exposed. Return getName(getName_cb hidl_status_cb) override; Return getType(getType_cb hidl_status_cb) override; private: + // Corresponding worker functions for the HIDL methods. + std::pair getNameInternal(); + std::pair getTypeInternal(); + std::string ifname_; std::weak_ptr legacy_hal_; bool is_valid_; diff --git a/wifi/1.0/default/wifi_rtt_controller.cpp b/wifi/1.0/default/wifi_rtt_controller.cpp index c0d0a0054d..b7eab89d9f 100644 --- a/wifi/1.0/default/wifi_rtt_controller.cpp +++ b/wifi/1.0/default/wifi_rtt_controller.cpp @@ -14,10 +14,10 @@ * limitations under the License. */ -#include "wifi_rtt_controller.h" - #include +#include "hidl_return_util.h" +#include "wifi_rtt_controller.h" #include "wifi_status_util.h" namespace android { @@ -25,6 +25,7 @@ namespace hardware { namespace wifi { namespace V1_0 { namespace implementation { +using hidl_return_util::validateAndCall; WifiRttController::WifiRttController( const sp& bound_iface, @@ -36,15 +37,20 @@ void WifiRttController::invalidate() { is_valid_ = false; } +bool WifiRttController::isValid() { + return is_valid_; +} + Return WifiRttController::getBoundIface(getBoundIface_cb hidl_status_cb) { - if (!is_valid_) { - hidl_status_cb( - createWifiStatus(WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID), - nullptr); - return Void(); - } - hidl_status_cb(createWifiStatus(WifiStatusCode::SUCCESS), bound_iface_); - return Void(); + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, + &WifiRttController::getBoundIfaceInternal, + hidl_status_cb); +} + +std::pair> +WifiRttController::getBoundIfaceInternal() { + return {createWifiStatus(WifiStatusCode::SUCCESS), bound_iface_}; } } // namespace implementation diff --git a/wifi/1.0/default/wifi_rtt_controller.h b/wifi/1.0/default/wifi_rtt_controller.h index 51b15573dc..afb6a0009c 100644 --- a/wifi/1.0/default/wifi_rtt_controller.h +++ b/wifi/1.0/default/wifi_rtt_controller.h @@ -38,11 +38,15 @@ class WifiRttController : public IWifiRttController { const std::weak_ptr legacy_hal); // Refer to |WifiChip::invalidate()|. void invalidate(); + bool isValid(); // HIDL methods exposed. Return getBoundIface(getBoundIface_cb hidl_status_cb) override; private: + // Corresponding worker functions for the HIDL methods. + std::pair> getBoundIfaceInternal(); + sp bound_iface_; std::weak_ptr legacy_hal_; bool is_valid_; diff --git a/wifi/1.0/default/wifi_sta_iface.cpp b/wifi/1.0/default/wifi_sta_iface.cpp index e3ae1118a3..83bd28db84 100644 --- a/wifi/1.0/default/wifi_sta_iface.cpp +++ b/wifi/1.0/default/wifi_sta_iface.cpp @@ -14,10 +14,10 @@ * limitations under the License. */ -#include "wifi_sta_iface.h" - #include +#include "hidl_return_util.h" +#include "wifi_sta_iface.h" #include "wifi_status_util.h" namespace android { @@ -25,6 +25,7 @@ namespace hardware { namespace wifi { namespace V1_0 { namespace implementation { +using hidl_return_util::validateAndCall; WifiStaIface::WifiStaIface(const std::string& ifname, const std::weak_ptr legacy_hal) @@ -35,24 +36,30 @@ void WifiStaIface::invalidate() { is_valid_ = false; } +bool WifiStaIface::isValid() { + return is_valid_; +} + Return WifiStaIface::getName(getName_cb hidl_status_cb) { - if (!is_valid_) { - hidl_status_cb(createWifiStatus(WifiStatusCode::ERROR_WIFI_IFACE_INVALID), - hidl_string()); - return Void(); - } - hidl_status_cb(createWifiStatus(WifiStatusCode::SUCCESS), ifname_); - return Void(); + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiStaIface::getNameInternal, + hidl_status_cb); } Return WifiStaIface::getType(getType_cb hidl_status_cb) { - if (!is_valid_) { - hidl_status_cb(createWifiStatus(WifiStatusCode::ERROR_WIFI_IFACE_INVALID), - IfaceType::STA); - return Void(); - } - hidl_status_cb(createWifiStatus(WifiStatusCode::SUCCESS), IfaceType::STA); - return Void(); + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiStaIface::getTypeInternal, + hidl_status_cb); +} + +std::pair WifiStaIface::getNameInternal() { + return {createWifiStatus(WifiStatusCode::SUCCESS), ifname_}; +} + +std::pair WifiStaIface::getTypeInternal() { + return {createWifiStatus(WifiStatusCode::SUCCESS), IfaceType::STA}; } } // namespace implementation diff --git a/wifi/1.0/default/wifi_sta_iface.h b/wifi/1.0/default/wifi_sta_iface.h index 29c5f06b71..6303305e63 100644 --- a/wifi/1.0/default/wifi_sta_iface.h +++ b/wifi/1.0/default/wifi_sta_iface.h @@ -37,12 +37,17 @@ class WifiStaIface : public IWifiStaIface { const std::weak_ptr legacy_hal); // Refer to |WifiChip::invalidate()|. void invalidate(); + bool isValid(); // HIDL methods exposed. Return getName(getName_cb hidl_status_cb) override; Return getType(getType_cb hidl_status_cb) override; private: + // Corresponding worker functions for the HIDL methods. + std::pair getNameInternal(); + std::pair getTypeInternal(); + std::string ifname_; std::weak_ptr legacy_hal_; bool is_valid_; From 7d08d7a16db03d14a5e14bda3c19b32256d3ef64 Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Thu, 27 Oct 2016 14:35:05 -0700 Subject: [PATCH 20/24] wifi: Stub implementation of WifiChip methods Bug: 32221997 Test: Compiles Change-Id: I627a05ce17d8b0e87101f395c3b3d6c10d3c440c --- wifi/1.0/default/wifi_chip.cpp | 88 ++++++++++++++++++++++++++++++++-- wifi/1.0/default/wifi_chip.h | 25 ++++++++++ 2 files changed, 109 insertions(+), 4 deletions(-) diff --git a/wifi/1.0/default/wifi_chip.cpp b/wifi/1.0/default/wifi_chip.cpp index bc46eec333..2245288bd1 100644 --- a/wifi/1.0/default/wifi_chip.cpp +++ b/wifi/1.0/default/wifi_chip.cpp @@ -73,6 +73,13 @@ Return WifiChip::registerEventCallback( event_callback); } +Return WifiChip::getCapabilities(getCapabilities_cb hidl_status_cb) { + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_CHIP_INVALID, + &WifiChip::getCapabilitiesInternal, + hidl_status_cb); +} + Return WifiChip::getAvailableModes(getAvailableModes_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, @@ -221,6 +228,48 @@ Return WifiChip::createRttController( bound_iface); } +Return WifiChip::getDebugRingBuffersStatus( + getDebugRingBuffersStatus_cb hidl_status_cb) { + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_CHIP_INVALID, + &WifiChip::getDebugRingBuffersStatusInternal, + hidl_status_cb); +} + +Return WifiChip::startLoggingToDebugRingBuffer( + const hidl_string& ring_name, + WifiDebugRingBufferVerboseLevel verbose_level, + uint32_t max_interval_in_sec, + uint32_t min_data_size_in_bytes, + startLoggingToDebugRingBuffer_cb hidl_status_cb) { + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_CHIP_INVALID, + &WifiChip::startLoggingToDebugRingBufferInternal, + hidl_status_cb, + ring_name, + verbose_level, + max_interval_in_sec, + min_data_size_in_bytes); +} + +Return WifiChip::forceDumpToDebugRingBuffer( + const hidl_string& ring_name, + forceDumpToDebugRingBuffer_cb hidl_status_cb) { + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_CHIP_INVALID, + &WifiChip::forceDumpToDebugRingBufferInternal, + hidl_status_cb, + ring_name); +} + +Return WifiChip::getDebugHostWakeReasonStats( + getDebugHostWakeReasonStats_cb hidl_status_cb) { + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_CHIP_INVALID, + &WifiChip::getDebugHostWakeReasonStatsInternal, + hidl_status_cb); +} + void WifiChip::invalidateAndRemoveAllIfaces() { invalidateAndClear(ap_iface_); invalidateAndClear(nan_iface_); @@ -245,11 +294,15 @@ WifiStatus WifiChip::registerEventCallbackInternal( return createWifiStatus(WifiStatusCode::SUCCESS); } +std::pair WifiChip::getCapabilitiesInternal() { + // TODO add implementation + return {createWifiStatus(WifiStatusCode::SUCCESS), 0}; +} + std::pair> WifiChip::getAvailableModesInternal() { // TODO add implementation - return {createWifiStatus(WifiStatusCode::SUCCESS), - std::vector()}; + return {createWifiStatus(WifiStatusCode::SUCCESS), {}}; } WifiStatus WifiChip::configureChipInternal(uint32_t /* mode_id */) { @@ -317,8 +370,7 @@ WifiChip::requestFirmwareDebugDumpInternal() { if (legacy_status != WIFI_SUCCESS) { LOG(ERROR) << "Failed to get firmware debug dump: " << legacyErrorToString(legacy_status); - return {createWifiStatusFromLegacyError(legacy_status), - std::vector()}; + return {createWifiStatusFromLegacyError(legacy_status), {}}; } return {createWifiStatus(WifiStatusCode::SUCCESS), firmware_dump}; } @@ -429,6 +481,34 @@ WifiChip::createRttControllerInternal(const sp& bound_iface) { rtt_controllers_.emplace_back(rtt); return {createWifiStatus(WifiStatusCode::SUCCESS), rtt}; } + +std::pair> +WifiChip::getDebugRingBuffersStatusInternal() { + // TODO implement + return {createWifiStatus(WifiStatusCode::SUCCESS), {}}; +} + +WifiStatus WifiChip::startLoggingToDebugRingBufferInternal( + const hidl_string& /* ring_name */, + WifiDebugRingBufferVerboseLevel /* verbose_level */, + uint32_t /* max_interval_in_sec */, + uint32_t /* min_data_size_in_bytes */) { + // TODO implement + return createWifiStatus(WifiStatusCode::SUCCESS); +} + +WifiStatus WifiChip::forceDumpToDebugRingBufferInternal( + const hidl_string& /* ring_name */) { + // TODO implement + return createWifiStatus(WifiStatusCode::SUCCESS); +} + +std::pair +WifiChip::getDebugHostWakeReasonStatsInternal() { + // TODO implement + return {createWifiStatus(WifiStatusCode::SUCCESS), {}}; +} + } // namespace implementation } // namespace V1_0 } // namespace wifi diff --git a/wifi/1.0/default/wifi_chip.h b/wifi/1.0/default/wifi_chip.h index 47b4d7a2ee..0c8adacd97 100644 --- a/wifi/1.0/default/wifi_chip.h +++ b/wifi/1.0/default/wifi_chip.h @@ -64,6 +64,7 @@ class WifiChip : public IWifiChip { Return registerEventCallback( const sp& event_callback, registerEventCallback_cb hidl_status_cb) override; + Return getCapabilities(getCapabilities_cb hidl_status_cb) override; Return getAvailableModes(getAvailableModes_cb hidl_status_cb) override; Return configureChip(uint32_t mode_id, configureChip_cb hidl_status_cb) override; @@ -93,6 +94,19 @@ class WifiChip : public IWifiChip { Return createRttController( const sp& bound_iface, createRttController_cb hidl_status_cb) override; + Return getDebugRingBuffersStatus( + getDebugRingBuffersStatus_cb hidl_status_cb) override; + Return startLoggingToDebugRingBuffer( + const hidl_string& ring_name, + WifiDebugRingBufferVerboseLevel verbose_level, + uint32_t max_interval_in_sec, + uint32_t min_data_size_in_bytes, + startLoggingToDebugRingBuffer_cb hidl_status_cb) override; + Return forceDumpToDebugRingBuffer( + const hidl_string& ring_name, + forceDumpToDebugRingBuffer_cb hidl_status_cb) override; + Return getDebugHostWakeReasonStats( + getDebugHostWakeReasonStats_cb hidl_status_cb) override; private: void invalidateAndRemoveAllIfaces(); @@ -101,6 +115,7 @@ class WifiChip : public IWifiChip { std::pair getIdInternal(); WifiStatus registerEventCallbackInternal( const sp& event_callback); + std::pair getCapabilitiesInternal(); std::pair> getAvailableModesInternal(); WifiStatus configureChipInternal(uint32_t mode_id); std::pair getModeInternal(); @@ -127,6 +142,16 @@ class WifiChip : public IWifiChip { const hidl_string& ifname); std::pair> createRttControllerInternal( const sp& bound_iface); + std::pair> + getDebugRingBuffersStatusInternal(); + WifiStatus startLoggingToDebugRingBufferInternal( + const hidl_string& ring_name, + WifiDebugRingBufferVerboseLevel verbose_level, + uint32_t max_interval_in_sec, + uint32_t min_data_size_in_bytes); + WifiStatus forceDumpToDebugRingBufferInternal(const hidl_string& ring_name); + std::pair + getDebugHostWakeReasonStatsInternal(); ChipId chip_id_; std::weak_ptr legacy_hal_; From a04ba3fcb85758329c046d543745fbe8159d79a3 Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Thu, 27 Oct 2016 14:36:26 -0700 Subject: [PATCH 21/24] wifi: Stub implementation of WifiStaIface methods Bug: 32221997 Bug: 31991459 Test: Compiles Change-Id: Iefc68958befc549fd9100b29f84cb6e6d73efe95 --- wifi/1.0/default/wifi_sta_iface.cpp | 222 ++++++++++++++++++++++++++++ wifi/1.0/default/wifi_sta_iface.h | 59 ++++++++ 2 files changed, 281 insertions(+) diff --git a/wifi/1.0/default/wifi_sta_iface.cpp b/wifi/1.0/default/wifi_sta_iface.cpp index 83bd28db84..1f220f3a29 100644 --- a/wifi/1.0/default/wifi_sta_iface.cpp +++ b/wifi/1.0/default/wifi_sta_iface.cpp @@ -33,6 +33,7 @@ WifiStaIface::WifiStaIface(const std::string& ifname, void WifiStaIface::invalidate() { legacy_hal_.reset(); + event_callbacks_.clear(); is_valid_ = false; } @@ -54,6 +55,140 @@ Return WifiStaIface::getType(getType_cb hidl_status_cb) { hidl_status_cb); } +Return WifiStaIface::registerEventCallback( + const sp& callback, + registerEventCallback_cb hidl_status_cb) { + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiStaIface::registerEventCallbackInternal, + hidl_status_cb, + callback); +} + +Return WifiStaIface::getCapabilities(getCapabilities_cb hidl_status_cb) { + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiStaIface::getCapabilitiesInternal, + hidl_status_cb); +} + +Return WifiStaIface::getApfPacketFilterCapabilities( + getApfPacketFilterCapabilities_cb hidl_status_cb) { + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiStaIface::getApfPacketFilterCapabilitiesInternal, + hidl_status_cb); +} + +Return WifiStaIface::installApfPacketFilter( + uint32_t cmd_id, + const hidl_vec& program, + installApfPacketFilter_cb hidl_status_cb) { + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiStaIface::installApfPacketFilterInternal, + hidl_status_cb, + cmd_id, + program); +} + +Return WifiStaIface::getBackgroundScanCapabilities( + getBackgroundScanCapabilities_cb hidl_status_cb) { + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiStaIface::getBackgroundScanCapabilitiesInternal, + hidl_status_cb); +} + +Return WifiStaIface::getValidFrequenciesForBackgroundScan( + StaBackgroundScanBand band, + getValidFrequenciesForBackgroundScan_cb hidl_status_cb) { + return validateAndCall( + this, + WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiStaIface::getValidFrequenciesForBackgroundScanInternal, + hidl_status_cb, + band); +} + +Return WifiStaIface::startBackgroundScan( + uint32_t cmd_id, + const StaBackgroundScanParameters& params, + startBackgroundScan_cb hidl_status_cb) { + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiStaIface::startBackgroundScanInternal, + hidl_status_cb, + cmd_id, + params); +} + +Return WifiStaIface::stopBackgroundScan( + uint32_t cmd_id, stopBackgroundScan_cb hidl_status_cb) { + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiStaIface::stopBackgroundScanInternal, + hidl_status_cb, + cmd_id); +} + +Return WifiStaIface::enableLinkLayerStatsCollection( + bool debug, enableLinkLayerStatsCollection_cb hidl_status_cb) { + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiStaIface::enableLinkLayerStatsCollectionInternal, + hidl_status_cb, + debug); +} + +Return WifiStaIface::disableLinkLayerStatsCollection( + disableLinkLayerStatsCollection_cb hidl_status_cb) { + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiStaIface::disableLinkLayerStatsCollectionInternal, + hidl_status_cb); +} + +Return WifiStaIface::getLinkLayerStats( + getLinkLayerStats_cb hidl_status_cb) { + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiStaIface::getLinkLayerStatsInternal, + hidl_status_cb); +} + +Return WifiStaIface::startDebugPacketFateMonitoring( + startDebugPacketFateMonitoring_cb hidl_status_cb) { + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiStaIface::startDebugPacketFateMonitoringInternal, + hidl_status_cb); +} + +Return WifiStaIface::stopDebugPacketFateMonitoring( + stopDebugPacketFateMonitoring_cb hidl_status_cb) { + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiStaIface::stopDebugPacketFateMonitoringInternal, + hidl_status_cb); +} + +Return WifiStaIface::getDebugTxPacketFates( + getDebugTxPacketFates_cb hidl_status_cb) { + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiStaIface::getDebugTxPacketFatesInternal, + hidl_status_cb); +} + +Return WifiStaIface::getDebugRxPacketFates( + getDebugRxPacketFates_cb hidl_status_cb) { + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiStaIface::getDebugRxPacketFatesInternal, + hidl_status_cb); +} + std::pair WifiStaIface::getNameInternal() { return {createWifiStatus(WifiStatusCode::SUCCESS), ifname_}; } @@ -62,6 +197,93 @@ std::pair WifiStaIface::getTypeInternal() { return {createWifiStatus(WifiStatusCode::SUCCESS), IfaceType::STA}; } +WifiStatus WifiStaIface::registerEventCallbackInternal( + const sp& callback) { + // TODO(b/31632518): remove the callback when the client is destroyed + event_callbacks_.emplace_back(callback); + return createWifiStatus(WifiStatusCode::SUCCESS); +} + +std::pair WifiStaIface::getCapabilitiesInternal() { + // TODO implement + return {createWifiStatus(WifiStatusCode::SUCCESS), 0}; +} + +std::pair +WifiStaIface::getApfPacketFilterCapabilitiesInternal() { + // TODO implement + return {createWifiStatus(WifiStatusCode::SUCCESS), {}}; +} + +WifiStatus WifiStaIface::installApfPacketFilterInternal( + uint32_t /* cmd_id */, const std::vector& /* program */) { + // TODO implement + return createWifiStatus(WifiStatusCode::SUCCESS); +} + +std::pair +WifiStaIface::getBackgroundScanCapabilitiesInternal() { + // TODO implement + return {createWifiStatus(WifiStatusCode::SUCCESS), {}}; +} + +std::pair> +WifiStaIface::getValidFrequenciesForBackgroundScanInternal( + StaBackgroundScanBand /* band */) { + // TODO implement + return {createWifiStatus(WifiStatusCode::SUCCESS), {}}; +} + +WifiStatus WifiStaIface::startBackgroundScanInternal( + uint32_t /* cmd_id */, const StaBackgroundScanParameters& /* params */) { + // TODO implement + return createWifiStatus(WifiStatusCode::SUCCESS); +} + +WifiStatus WifiStaIface::stopBackgroundScanInternal(uint32_t /* cmd_id */) { + // TODO implement + return createWifiStatus(WifiStatusCode::SUCCESS); +} + +WifiStatus WifiStaIface::enableLinkLayerStatsCollectionInternal( + bool /* debug */) { + // TODO implement + return createWifiStatus(WifiStatusCode::SUCCESS); +} + +WifiStatus WifiStaIface::disableLinkLayerStatsCollectionInternal() { + // TODO implement + return createWifiStatus(WifiStatusCode::SUCCESS); +} + +std::pair +WifiStaIface::getLinkLayerStatsInternal() { + // TODO implement + return {createWifiStatus(WifiStatusCode::SUCCESS), {}}; +} + +WifiStatus WifiStaIface::startDebugPacketFateMonitoringInternal() { + // TODO implement + return createWifiStatus(WifiStatusCode::SUCCESS); +} + +WifiStatus WifiStaIface::stopDebugPacketFateMonitoringInternal() { + // TODO implement + return createWifiStatus(WifiStatusCode::SUCCESS); +} + +std::pair> +WifiStaIface::getDebugTxPacketFatesInternal() { + // TODO implement + return {createWifiStatus(WifiStatusCode::SUCCESS), {}}; +} + +std::pair> +WifiStaIface::getDebugRxPacketFatesInternal() { + // TODO implement + return {createWifiStatus(WifiStatusCode::SUCCESS), {}}; +} + } // namespace implementation } // namespace V1_0 } // namespace wifi diff --git a/wifi/1.0/default/wifi_sta_iface.h b/wifi/1.0/default/wifi_sta_iface.h index 6303305e63..a13feeb9a9 100644 --- a/wifi/1.0/default/wifi_sta_iface.h +++ b/wifi/1.0/default/wifi_sta_iface.h @@ -19,6 +19,7 @@ #include #include +#include #include "wifi_legacy_hal.h" @@ -42,14 +43,72 @@ class WifiStaIface : public IWifiStaIface { // HIDL methods exposed. Return getName(getName_cb hidl_status_cb) override; Return getType(getType_cb hidl_status_cb) override; + Return registerEventCallback( + const sp& callback, + registerEventCallback_cb hidl_status_cb) override; + Return getCapabilities(getCapabilities_cb hidl_status_cb) override; + Return getApfPacketFilterCapabilities( + getApfPacketFilterCapabilities_cb hidl_status_cb) override; + Return installApfPacketFilter( + uint32_t cmd_id, + const hidl_vec& program, + installApfPacketFilter_cb hidl_status_cb) override; + Return getBackgroundScanCapabilities( + getBackgroundScanCapabilities_cb hidl_status_cb) override; + Return getValidFrequenciesForBackgroundScan( + StaBackgroundScanBand band, + getValidFrequenciesForBackgroundScan_cb hidl_status_cb) override; + Return startBackgroundScan( + uint32_t cmd_id, + const StaBackgroundScanParameters& params, + startBackgroundScan_cb hidl_status_cb) override; + Return stopBackgroundScan( + uint32_t cmd_id, stopBackgroundScan_cb hidl_status_cb) override; + Return enableLinkLayerStatsCollection( + bool debug, enableLinkLayerStatsCollection_cb hidl_status_cb) override; + Return disableLinkLayerStatsCollection( + disableLinkLayerStatsCollection_cb hidl_status_cb) override; + Return getLinkLayerStats(getLinkLayerStats_cb hidl_status_cb) override; + Return startDebugPacketFateMonitoring( + startDebugPacketFateMonitoring_cb hidl_status_cb) override; + Return stopDebugPacketFateMonitoring( + stopDebugPacketFateMonitoring_cb hidl_status_cb) override; + Return getDebugTxPacketFates( + getDebugTxPacketFates_cb hidl_status_cb) override; + Return getDebugRxPacketFates( + getDebugRxPacketFates_cb hidl_status_cb) override; private: // Corresponding worker functions for the HIDL methods. std::pair getNameInternal(); std::pair getTypeInternal(); + WifiStatus registerEventCallbackInternal( + const sp& callback); + std::pair getCapabilitiesInternal(); + std::pair + getApfPacketFilterCapabilitiesInternal(); + WifiStatus installApfPacketFilterInternal( + uint32_t cmd_id, const std::vector& program); + std::pair + getBackgroundScanCapabilitiesInternal(); + std::pair> + getValidFrequenciesForBackgroundScanInternal(StaBackgroundScanBand band); + WifiStatus startBackgroundScanInternal( + uint32_t cmd_id, const StaBackgroundScanParameters& params); + WifiStatus stopBackgroundScanInternal(uint32_t cmd_id); + WifiStatus enableLinkLayerStatsCollectionInternal(bool debug); + WifiStatus disableLinkLayerStatsCollectionInternal(); + std::pair getLinkLayerStatsInternal(); + WifiStatus startDebugPacketFateMonitoringInternal(); + WifiStatus stopDebugPacketFateMonitoringInternal(); + std::pair> + getDebugTxPacketFatesInternal(); + std::pair> + getDebugRxPacketFatesInternal(); std::string ifname_; std::weak_ptr legacy_hal_; + std::vector> event_callbacks_; bool is_valid_; DISALLOW_COPY_AND_ASSIGN(WifiStaIface); From 7913f5e49d263ac846241ab9ffa22421668cdbe8 Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Thu, 27 Oct 2016 17:09:30 -0700 Subject: [PATCH 22/24] wifi: Stub implementation of WifiRttController methods Bug: 31991232 Test: Compiles Change-Id: I90f803ae19746ef844280cd8df96987e350f8a3f --- wifi/1.0/default/wifi_rtt_controller.cpp | 216 +++++++++++++++++++++++ wifi/1.0/default/wifi_rtt_controller.h | 56 ++++++ 2 files changed, 272 insertions(+) diff --git a/wifi/1.0/default/wifi_rtt_controller.cpp b/wifi/1.0/default/wifi_rtt_controller.cpp index b7eab89d9f..dbe836b22f 100644 --- a/wifi/1.0/default/wifi_rtt_controller.cpp +++ b/wifi/1.0/default/wifi_rtt_controller.cpp @@ -34,6 +34,7 @@ WifiRttController::WifiRttController( void WifiRttController::invalidate() { legacy_hal_.reset(); + event_callbacks_.clear(); is_valid_ = false; } @@ -48,11 +49,226 @@ Return WifiRttController::getBoundIface(getBoundIface_cb hidl_status_cb) { hidl_status_cb); } +Return WifiRttController::registerEventCallback( + const sp& callback, + registerEventCallback_cb hidl_status_cb) { + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, + &WifiRttController::registerEventCallbackInternal, + hidl_status_cb, + callback); +} + +Return WifiRttController::rangeRequest( + uint32_t cmd_id, + const hidl_vec& rtt_configs, + rangeRequest_cb hidl_status_cb) { + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, + &WifiRttController::rangeRequestInternal, + hidl_status_cb, + cmd_id, + rtt_configs); +} + +Return WifiRttController::rangeCancel( + uint32_t cmd_id, + const hidl_vec>& addrs, + rangeCancel_cb hidl_status_cb) { + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, + &WifiRttController::rangeCancelInternal, + hidl_status_cb, + cmd_id, + addrs); +} + +Return WifiRttController::setChannelMap(uint32_t cmd_id, + const RttChannelMap& params, + uint32_t num_dw, + setChannelMap_cb hidl_status_cb) { + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, + &WifiRttController::setChannelMapInternal, + hidl_status_cb, + cmd_id, + params, + num_dw); +} + +Return WifiRttController::clearChannelMap( + uint32_t cmd_id, clearChannelMap_cb hidl_status_cb) { + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, + &WifiRttController::clearChannelMapInternal, + hidl_status_cb, + cmd_id); +} + +Return WifiRttController::getCapabilities( + getCapabilities_cb hidl_status_cb) { + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, + &WifiRttController::getCapabilitiesInternal, + hidl_status_cb); +} + +Return WifiRttController::setDebugCfg(RttDebugType type, + setDebugCfg_cb hidl_status_cb) { + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, + &WifiRttController::setDebugCfgInternal, + hidl_status_cb, + type); +} + +Return WifiRttController::getDebugInfo(getDebugInfo_cb hidl_status_cb) { + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, + &WifiRttController::getDebugInfoInternal, + hidl_status_cb); +} + +Return WifiRttController::setLci(uint32_t cmd_id, + const RttLciInformation& lci, + setLci_cb hidl_status_cb) { + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, + &WifiRttController::setLciInternal, + hidl_status_cb, + cmd_id, + lci); +} + +Return WifiRttController::setLcr(uint32_t cmd_id, + const RttLcrInformation& lcr, + setLcr_cb hidl_status_cb) { + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, + &WifiRttController::setLcrInternal, + hidl_status_cb, + cmd_id, + lcr); +} + +Return WifiRttController::getResponderInfo( + getResponderInfo_cb hidl_status_cb) { + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, + &WifiRttController::getResponderInfoInternal, + hidl_status_cb); +} + +Return WifiRttController::enableResponder( + uint32_t cmd_id, + const WifiChannelInfo& channel_hint, + uint32_t maxDurationSeconds, + const RttResponder& info, + enableResponder_cb hidl_status_cb) { + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, + &WifiRttController::enableResponderInternal, + hidl_status_cb, + cmd_id, + channel_hint, + maxDurationSeconds, + info); +} + +Return WifiRttController::disableResponder( + uint32_t cmd_id, disableResponder_cb hidl_status_cb) { + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID, + &WifiRttController::disableResponderInternal, + hidl_status_cb, + cmd_id); +} + std::pair> WifiRttController::getBoundIfaceInternal() { return {createWifiStatus(WifiStatusCode::SUCCESS), bound_iface_}; } +WifiStatus WifiRttController::registerEventCallbackInternal( + const sp& callback) { + // TODO(b/31632518): remove the callback when the client is destroyed + event_callbacks_.emplace_back(callback); + return createWifiStatus(WifiStatusCode::SUCCESS); +} + +WifiStatus WifiRttController::rangeRequestInternal( + uint32_t /* cmd_id */, const std::vector& /* rtt_configs */) { + // TODO implement + return createWifiStatus(WifiStatusCode::SUCCESS); +} + +WifiStatus WifiRttController::rangeCancelInternal( + uint32_t /* cmd_id */, + const std::vector>& /* addrs */) { + // TODO implement + return createWifiStatus(WifiStatusCode::SUCCESS); +} + +WifiStatus WifiRttController::setChannelMapInternal( + uint32_t /* cmd_id */, + const RttChannelMap& /* params */, + uint32_t /* num_dw */) { + // TODO implement + return createWifiStatus(WifiStatusCode::SUCCESS); +} + +WifiStatus WifiRttController::clearChannelMapInternal(uint32_t /* cmd_id */) { + // TODO implement + return createWifiStatus(WifiStatusCode::SUCCESS); +} + +std::pair +WifiRttController::getCapabilitiesInternal() { + // TODO implement + return {createWifiStatus(WifiStatusCode::SUCCESS), {}}; +} + +WifiStatus WifiRttController::setDebugCfgInternal(RttDebugType /* type */) { + // TODO implement + return createWifiStatus(WifiStatusCode::SUCCESS); +} + +std::pair WifiRttController::getDebugInfoInternal() { + // TODO implement + return {createWifiStatus(WifiStatusCode::SUCCESS), {}}; +} + +WifiStatus WifiRttController::setLciInternal( + uint32_t /* cmd_id */, const RttLciInformation& /* lci */) { + // TODO implement + return createWifiStatus(WifiStatusCode::SUCCESS); +} + +WifiStatus WifiRttController::setLcrInternal( + uint32_t /* cmd_id */, const RttLcrInformation& /* lcr */) { + // TODO implement + return createWifiStatus(WifiStatusCode::SUCCESS); +} + +std::pair +WifiRttController::getResponderInfoInternal() { + // TODO implement + return {createWifiStatus(WifiStatusCode::SUCCESS), {}}; +} + +WifiStatus WifiRttController::enableResponderInternal( + uint32_t /* cmd_id */, + const WifiChannelInfo& /* channel_hint */, + uint32_t /* maxDurationSeconds */, + const RttResponder& /* info */) { + // TODO implement + return createWifiStatus(WifiStatusCode::SUCCESS); +} + +WifiStatus WifiRttController::disableResponderInternal(uint32_t /* cmd_id */) { + // TODO implement + return createWifiStatus(WifiStatusCode::SUCCESS); +} } // namespace implementation } // namespace V1_0 } // namespace wifi diff --git a/wifi/1.0/default/wifi_rtt_controller.h b/wifi/1.0/default/wifi_rtt_controller.h index afb6a0009c..5ebd4bcf8e 100644 --- a/wifi/1.0/default/wifi_rtt_controller.h +++ b/wifi/1.0/default/wifi_rtt_controller.h @@ -20,6 +20,7 @@ #include #include #include +#include #include "wifi_legacy_hal.h" @@ -42,13 +43,68 @@ class WifiRttController : public IWifiRttController { // HIDL methods exposed. Return getBoundIface(getBoundIface_cb hidl_status_cb) override; + Return registerEventCallback( + const sp& callback, + registerEventCallback_cb hidl_status_cb) override; + Return rangeRequest(uint32_t cmd_id, + const hidl_vec& rtt_configs, + rangeRequest_cb hidl_status_cb) override; + Return rangeCancel(uint32_t cmd_id, + const hidl_vec>& addrs, + rangeCancel_cb hidl_status_cb) override; + Return setChannelMap(uint32_t cmd_id, + const RttChannelMap& params, + uint32_t num_dw, + setChannelMap_cb hidl_status_cb) override; + Return clearChannelMap(uint32_t cmd_id, + clearChannelMap_cb hidl_status_cb) override; + Return getCapabilities(getCapabilities_cb hidl_status_cb) override; + Return setDebugCfg(RttDebugType type, + setDebugCfg_cb hidl_status_cb) override; + Return getDebugInfo(getDebugInfo_cb hidl_status_cb) override; + Return setLci(uint32_t cmd_id, + const RttLciInformation& lci, + setLci_cb hidl_status_cb) override; + Return setLcr(uint32_t cmd_id, + const RttLcrInformation& lcr, + setLcr_cb hidl_status_cb) override; + Return getResponderInfo(getResponderInfo_cb hidl_status_cb) override; + Return enableResponder(uint32_t cmd_id, + const WifiChannelInfo& channel_hint, + uint32_t maxDurationSeconds, + const RttResponder& info, + enableResponder_cb hidl_status_cb) override; + Return disableResponder(uint32_t cmd_id, + disableResponder_cb hidl_status_cb) override; private: // Corresponding worker functions for the HIDL methods. std::pair> getBoundIfaceInternal(); + WifiStatus registerEventCallbackInternal( + const sp& callback); + WifiStatus rangeRequestInternal(uint32_t cmd_id, + const std::vector& rtt_configs); + WifiStatus rangeCancelInternal( + uint32_t cmd_id, const std::vector>& addrs); + WifiStatus setChannelMapInternal(uint32_t cmd_id, + const RttChannelMap& params, + uint32_t num_dw); + WifiStatus clearChannelMapInternal(uint32_t cmd_id); + std::pair getCapabilitiesInternal(); + WifiStatus setDebugCfgInternal(RttDebugType type); + std::pair getDebugInfoInternal(); + WifiStatus setLciInternal(uint32_t cmd_id, const RttLciInformation& lci); + WifiStatus setLcrInternal(uint32_t cmd_id, const RttLcrInformation& lcr); + std::pair getResponderInfoInternal(); + WifiStatus enableResponderInternal(uint32_t cmd_id, + const WifiChannelInfo& channel_hint, + uint32_t maxDurationSeconds, + const RttResponder& info); + WifiStatus disableResponderInternal(uint32_t cmd_id); sp bound_iface_; std::weak_ptr legacy_hal_; + std::vector> event_callbacks_; bool is_valid_; DISALLOW_COPY_AND_ASSIGN(WifiRttController); From 0c92d446a26d3aeff57b3e62d6454addb9ac76fe Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Thu, 27 Oct 2016 17:38:53 -0700 Subject: [PATCH 23/24] wifi: Stub implementation of WifiNanIface methods Bug: 31991076 Test: Compiles Change-Id: Ia3723a14af20176c08e6e466e8b55bb32c8f9d41 --- wifi/1.0/default/wifi_nan_iface.cpp | 275 ++++++++++++++++++++++++++++ wifi/1.0/default/wifi_nan_iface.h | 87 +++++++++ 2 files changed, 362 insertions(+) diff --git a/wifi/1.0/default/wifi_nan_iface.cpp b/wifi/1.0/default/wifi_nan_iface.cpp index c018e67090..a2190a815d 100644 --- a/wifi/1.0/default/wifi_nan_iface.cpp +++ b/wifi/1.0/default/wifi_nan_iface.cpp @@ -33,6 +33,7 @@ WifiNanIface::WifiNanIface(const std::string& ifname, void WifiNanIface::invalidate() { legacy_hal_.reset(); + event_callbacks_.clear(); is_valid_ = false; } @@ -47,6 +48,193 @@ Return WifiNanIface::getName(getName_cb hidl_status_cb) { hidl_status_cb); } +Return WifiNanIface::registerEventCallback( + const sp& callback, + registerEventCallback_cb hidl_status_cb) { + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::registerEventCallbackInternal, + hidl_status_cb, + callback); +} + +Return WifiNanIface::enableRequest(uint32_t cmd_id, + const NanEnableRequest& msg, + enableRequest_cb hidl_status_cb) { + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::enableRequestInternal, + hidl_status_cb, + cmd_id, + msg); +} + +Return WifiNanIface::disableRequest(uint32_t cmd_id, + disableRequest_cb hidl_status_cb) { + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::disableRequestInternal, + hidl_status_cb, + cmd_id); +} + +Return WifiNanIface::publishRequest(uint32_t cmd_id, + const NanPublishRequest& msg, + publishRequest_cb hidl_status_cb) { + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::publishRequestInternal, + hidl_status_cb, + cmd_id, + msg); +} + +Return WifiNanIface::publishCancelRequest( + uint32_t cmd_id, + const NanPublishCancelRequest& msg, + publishCancelRequest_cb hidl_status_cb) { + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::publishCancelRequestInternal, + hidl_status_cb, + cmd_id, + msg); +} + +Return WifiNanIface::subscribeRequest( + uint32_t cmd_id, + const NanSubscribeRequest& msg, + subscribeRequest_cb hidl_status_cb) { + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::subscribeRequestInternal, + hidl_status_cb, + cmd_id, + msg); +} + +Return WifiNanIface::subscribeCancelRequest( + uint32_t cmd_id, + const NanSubscribeCancelRequest& msg, + subscribeCancelRequest_cb hidl_status_cb) { + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::subscribeCancelRequestInternal, + hidl_status_cb, + cmd_id, + msg); +} + +Return WifiNanIface::transmitFollowupRequest( + uint32_t cmd_id, + const NanTransmitFollowupRequest& msg, + transmitFollowupRequest_cb hidl_status_cb) { + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::transmitFollowupRequestInternal, + hidl_status_cb, + cmd_id, + msg); +} + +Return WifiNanIface::configRequest(uint32_t cmd_id, + const NanConfigRequest& msg, + configRequest_cb hidl_status_cb) { + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::configRequestInternal, + hidl_status_cb, + cmd_id, + msg); +} + +Return WifiNanIface::beaconSdfPayloadRequest( + uint32_t cmd_id, + const NanBeaconSdfPayloadRequest& msg, + beaconSdfPayloadRequest_cb hidl_status_cb) { + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::beaconSdfPayloadRequestInternal, + hidl_status_cb, + cmd_id, + msg); +} + +Return WifiNanIface::getVersion(getVersion_cb hidl_status_cb) { + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::getVersionInternal, + hidl_status_cb); +} + +Return WifiNanIface::getCapabilities(uint32_t cmd_id, + getCapabilities_cb hidl_status_cb) { + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::getCapabilitiesInternal, + hidl_status_cb, + cmd_id); +} + +Return WifiNanIface::dataInterfaceCreate( + uint32_t cmd_id, + const hidl_string& iface_name, + dataInterfaceCreate_cb hidl_status_cb) { + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::dataInterfaceCreateInternal, + hidl_status_cb, + cmd_id, + iface_name); +} + +Return WifiNanIface::dataInterfaceDelete( + uint32_t cmd_id, + const hidl_string& iface_name, + dataInterfaceDelete_cb hidl_status_cb) { + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::dataInterfaceDeleteInternal, + hidl_status_cb, + cmd_id, + iface_name); +} + +Return WifiNanIface::dataRequestInitiator( + uint32_t cmd_id, + const NanDataPathInitiatorRequest& msg, + dataRequestInitiator_cb hidl_status_cb) { + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::dataRequestInitiatorInternal, + hidl_status_cb, + cmd_id, + msg); +} + +Return WifiNanIface::dataIndicationResponse( + uint32_t cmd_id, + const NanDataPathIndicationResponse& msg, + dataIndicationResponse_cb hidl_status_cb) { + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::dataIndicationResponseInternal, + hidl_status_cb, + cmd_id, + msg); +} + +Return WifiNanIface::dataEnd(uint32_t cmd_id, + const NanDataPathEndRequest& msg, + dataEnd_cb hidl_status_cb) { + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiNanIface::dataEndInternal, + hidl_status_cb, + cmd_id, + msg); +} + Return WifiNanIface::getType(getType_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, @@ -62,6 +250,93 @@ std::pair WifiNanIface::getTypeInternal() { return {createWifiStatus(WifiStatusCode::SUCCESS), IfaceType::NAN}; } +WifiStatus WifiNanIface::registerEventCallbackInternal( + const sp& callback) { + // TODO(b/31632518): remove the callback when the client is destroyed + event_callbacks_.emplace_back(callback); + return createWifiStatus(WifiStatusCode::SUCCESS); +} + +WifiStatus WifiNanIface::enableRequestInternal( + uint32_t /* cmd_id */, const NanEnableRequest& /* msg */) { + // TODO implement + return createWifiStatus(WifiStatusCode::SUCCESS); +} + +WifiStatus WifiNanIface::disableRequestInternal(uint32_t /* cmd_id */) { + // TODO implement + return createWifiStatus(WifiStatusCode::SUCCESS); +} + +WifiStatus WifiNanIface::publishRequestInternal( + uint32_t /* cmd_id */, const NanPublishRequest& /* msg */) { + // TODO implement + return createWifiStatus(WifiStatusCode::SUCCESS); +} + +WifiStatus WifiNanIface::publishCancelRequestInternal( + uint32_t /* cmd_id */, const NanPublishCancelRequest& /* msg */) { + // TODO implement + return createWifiStatus(WifiStatusCode::SUCCESS); +} +WifiStatus WifiNanIface::subscribeRequestInternal( + uint32_t /* cmd_id */, const NanSubscribeRequest& /* msg */) { + // TODO implement + return createWifiStatus(WifiStatusCode::SUCCESS); +} +WifiStatus WifiNanIface::subscribeCancelRequestInternal( + uint32_t /* cmd_id */, const NanSubscribeCancelRequest& /* msg */) { + // TODO implement + return createWifiStatus(WifiStatusCode::SUCCESS); +} +WifiStatus WifiNanIface::transmitFollowupRequestInternal( + uint32_t /* cmd_id */, const NanTransmitFollowupRequest& /* msg */) { + // TODO implement + return createWifiStatus(WifiStatusCode::SUCCESS); +} +WifiStatus WifiNanIface::configRequestInternal( + uint32_t /* cmd_id */, const NanConfigRequest& /* msg */) { + // TODO implement + return createWifiStatus(WifiStatusCode::SUCCESS); +} +WifiStatus WifiNanIface::beaconSdfPayloadRequestInternal( + uint32_t /* cmd_id */, const NanBeaconSdfPayloadRequest& /* msg */) { + // TODO implement + return createWifiStatus(WifiStatusCode::SUCCESS); +} +std::pair WifiNanIface::getVersionInternal() { + // TODO implement + return {createWifiStatus(WifiStatusCode::SUCCESS), 0}; +} +WifiStatus WifiNanIface::getCapabilitiesInternal(uint32_t /* cmd_id */) { + // TODO implement + return createWifiStatus(WifiStatusCode::SUCCESS); +} +WifiStatus WifiNanIface::dataInterfaceCreateInternal( + uint32_t /* cmd_id */, const std::string& /* iface_name */) { + // TODO implement + return createWifiStatus(WifiStatusCode::SUCCESS); +} +WifiStatus WifiNanIface::dataInterfaceDeleteInternal( + uint32_t /* cmd_id */, const std::string& /* iface_name */) { + // TODO implement + return createWifiStatus(WifiStatusCode::SUCCESS); +} +WifiStatus WifiNanIface::dataRequestInitiatorInternal( + uint32_t /* cmd_id */, const NanDataPathInitiatorRequest& /* msg */) { + // TODO implement + return createWifiStatus(WifiStatusCode::SUCCESS); +} +WifiStatus WifiNanIface::dataIndicationResponseInternal( + uint32_t /* cmd_id */, const NanDataPathIndicationResponse& /* msg */) { + // TODO implement + return createWifiStatus(WifiStatusCode::SUCCESS); +} +WifiStatus WifiNanIface::dataEndInternal( + uint32_t /* cmd_id */, const NanDataPathEndRequest& /* msg */) { + // TODO implement + return createWifiStatus(WifiStatusCode::SUCCESS); +} } // namespace implementation } // namespace V1_0 } // namespace wifi diff --git a/wifi/1.0/default/wifi_nan_iface.h b/wifi/1.0/default/wifi_nan_iface.h index 31e0c7ffe4..f3c06406ed 100644 --- a/wifi/1.0/default/wifi_nan_iface.h +++ b/wifi/1.0/default/wifi_nan_iface.h @@ -19,6 +19,7 @@ #include #include +#include #include "wifi_legacy_hal.h" @@ -42,14 +43,100 @@ class WifiNanIface : public IWifiNanIface { // HIDL methods exposed. Return getName(getName_cb hidl_status_cb) override; Return getType(getType_cb hidl_status_cb) override; + Return registerEventCallback( + const sp& callback, + registerEventCallback_cb hidl_status_cb) override; + Return enableRequest(uint32_t cmd_id, + const NanEnableRequest& msg, + enableRequest_cb hidl_status_cb) override; + Return disableRequest(uint32_t cmd_id, + disableRequest_cb hidl_status_cb) override; + Return publishRequest(uint32_t cmd_id, + const NanPublishRequest& msg, + publishRequest_cb hidl_status_cb) override; + Return publishCancelRequest( + uint32_t cmd_id, + const NanPublishCancelRequest& msg, + publishCancelRequest_cb hidl_status_cb) override; + Return subscribeRequest(uint32_t cmd_id, + const NanSubscribeRequest& msg, + subscribeRequest_cb hidl_status_cb) override; + Return subscribeCancelRequest( + uint32_t cmd_id, + const NanSubscribeCancelRequest& msg, + subscribeCancelRequest_cb hidl_status_cb) override; + Return transmitFollowupRequest( + uint32_t cmd_id, + const NanTransmitFollowupRequest& msg, + transmitFollowupRequest_cb hidl_status_cb) override; + Return configRequest(uint32_t cmd_id, + const NanConfigRequest& msg, + configRequest_cb hidl_status_cb) override; + Return beaconSdfPayloadRequest( + uint32_t cmd_id, + const NanBeaconSdfPayloadRequest& msg, + beaconSdfPayloadRequest_cb hidl_status_cb) override; + Return getVersion(getVersion_cb hidl_status_cb) override; + Return getCapabilities(uint32_t cmd_id, + getCapabilities_cb hidl_status_cb) override; + Return dataInterfaceCreate( + uint32_t cmd_id, + const hidl_string& iface_name, + dataInterfaceCreate_cb hidl_status_cb) override; + Return dataInterfaceDelete( + uint32_t cmd_id, + const hidl_string& iface_name, + dataInterfaceDelete_cb hidl_status_cb) override; + Return dataRequestInitiator( + uint32_t cmd_id, + const NanDataPathInitiatorRequest& msg, + dataRequestInitiator_cb hidl_status_cb) override; + Return dataIndicationResponse( + uint32_t cmd_id, + const NanDataPathIndicationResponse& msg, + dataIndicationResponse_cb hidl_status_cb) override; + Return dataEnd(uint32_t cmd_id, + const NanDataPathEndRequest& msg, + dataEnd_cb hidl_status_cb) override; private: // Corresponding worker functions for the HIDL methods. std::pair getNameInternal(); std::pair getTypeInternal(); + WifiStatus registerEventCallbackInternal( + const sp& callback); + WifiStatus enableRequestInternal(uint32_t cmd_id, + const NanEnableRequest& msg); + WifiStatus disableRequestInternal(uint32_t cmd_id); + WifiStatus publishRequestInternal(uint32_t cmd_id, + const NanPublishRequest& msg); + WifiStatus publishCancelRequestInternal(uint32_t cmd_id, + const NanPublishCancelRequest& msg); + WifiStatus subscribeRequestInternal(uint32_t cmd_id, + const NanSubscribeRequest& msg); + WifiStatus subscribeCancelRequestInternal( + uint32_t cmd_id, const NanSubscribeCancelRequest& msg); + WifiStatus transmitFollowupRequestInternal( + uint32_t cmd_id, const NanTransmitFollowupRequest& msg); + WifiStatus configRequestInternal(uint32_t cmd_id, + const NanConfigRequest& msg); + WifiStatus beaconSdfPayloadRequestInternal( + uint32_t cmd_id, const NanBeaconSdfPayloadRequest& msg); + std::pair getVersionInternal(); + WifiStatus getCapabilitiesInternal(uint32_t cmd_id); + WifiStatus dataInterfaceCreateInternal(uint32_t cmd_id, + const std::string& iface_name); + WifiStatus dataInterfaceDeleteInternal(uint32_t cmd_id, + const std::string& iface_name); + WifiStatus dataRequestInitiatorInternal( + uint32_t cmd_id, const NanDataPathInitiatorRequest& msg); + WifiStatus dataIndicationResponseInternal( + uint32_t cmd_id, const NanDataPathIndicationResponse& msg); + WifiStatus dataEndInternal(uint32_t cmd_id, const NanDataPathEndRequest& msg); std::string ifname_; std::weak_ptr legacy_hal_; + std::vector> event_callbacks_; bool is_valid_; DISALLOW_COPY_AND_ASSIGN(WifiNanIface); From 23f9f3034440d26b04cf7e38ab10637fc4a0097a Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Mon, 24 Oct 2016 13:33:51 -0700 Subject: [PATCH 24/24] wifi: Remove passthrough mode Wifi HAL is not going to support HIDL passthrough mode. So, remove the target definition. Bug: 32376894 Test: Compiles Change-Id: I43740541f576746826d75c6ac48a11bb2a619227 --- wifi/1.0/default/Android.mk | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/wifi/1.0/default/Android.mk b/wifi/1.0/default/Android.mk index 3d8c68962b..e84124eb6b 100644 --- a/wifi/1.0/default/Android.mk +++ b/wifi/1.0/default/Android.mk @@ -14,10 +14,11 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) -LOCAL_MODULE := android.hardware.wifi@1.0-impl +LOCAL_MODULE := android.hardware.wifi@1.0-service LOCAL_MODULE_RELATIVE_PATH := hw LOCAL_CPPFLAGS := -std=c++11 -Wall -Wno-unused-parameter -Werror -Wextra LOCAL_SRC_FILES := \ + service.cpp \ wifi.cpp \ wifi_ap_iface.cpp \ wifi_chip.cpp \ @@ -38,25 +39,5 @@ LOCAL_SHARED_LIBRARIES := \ libutils \ libwifi-system LOCAL_WHOLE_STATIC_LIBRARIES := $(LIB_WIFI_HAL) -include $(BUILD_SHARED_LIBRARY) - -include $(CLEAR_VARS) -LOCAL_MODULE := android.hardware.wifi@1.0-service -LOCAL_MODULE_RELATIVE_PATH := hw -LOCAL_CPPFLAGS := -std=c++11 -Wall -Wno-unused-parameter -Werror -Wextra -LOCAL_SRC_FILES := \ - service.cpp -LOCAL_SHARED_LIBRARIES := \ - android.hardware.wifi@1.0 \ - android.hardware.wifi@1.0-impl \ - libbase \ - libcutils \ - libhidl \ - libhwbinder \ - liblog \ - libnl \ - libutils \ - libwifi-system -LOCAL_WHOLE_STATIC_LIBRARIES := $(LIB_WIFI_HAL) LOCAL_INIT_RC := android.hardware.wifi@1.0-service.rc include $(BUILD_EXECUTABLE)