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
diff --git a/wifi/1.0/Android.mk b/wifi/1.0/Android.mk
index e345dd2..c7983ea 100644
--- a/wifi/1.0/Android.mk
+++ b/wifi/1.0/Android.mk
@@ -13,40 +13,6 @@
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)
#
GEN := $(intermediates)/android/hardware/wifi/1.0/IfaceType.java
@@ -64,9 +30,9 @@
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_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)
@@ -326,40 +309,6 @@
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)
#
GEN := $(intermediates)/android/hardware/wifi/1.0/IfaceType.java
@@ -377,9 +326,9 @@
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_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 9e09348..3166691 100644
--- a/wifi/1.0/IWifi.hal
+++ b/wifi/1.0/IWifi.hal
@@ -48,27 +48,39 @@
/**
* 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 c9ff038..166cfb4 100644
--- a/wifi/1.0/IWifiChip.hal
+++ b/wifi/1.0/IWifiChip.hal
@@ -119,15 +119,27 @@
};
/**
+ * 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 @@
*
* @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<ChipMode> modes);
+ getAvailableModes() generates (WifiStatus status, vec<ChipMode> 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<uint8_t> 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<uint8_t> 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<string> ifnames);
+ getApIfaceNames() generates (WifiStatus status, vec<string> 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<string> ifnames);
+ getNanIfaceNames() generates (WifiStatus status, vec<string> 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<string> ifnames);
+ getP2pIfaceNames() generates (WifiStatus status, vec<string> 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<string> ifnames);
+ getStaIfaceNames() generates (WifiStatus status, vec<string> 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 @@
*
* @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 2161c5d..177d42e 100644
--- a/wifi/1.0/IWifiChipEventCallback.hal
+++ b/wifi/1.0/IWifiChipEventCallback.hal
@@ -27,70 +27,4 @@
* 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<uint8_t> 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<uint8_t> 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 33accff..718f36c 100644
--- a/wifi/1.0/IWifiEventCallback.hal
+++ b/wifi/1.0/IWifiEventCallback.hal
@@ -24,16 +24,6 @@
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
* after the last call to start will be considered invalid.
@@ -43,10 +33,10 @@
/**
* 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 726a973..444e095 100644
--- a/wifi/1.0/IWifiIface.hal
+++ b/wifi/1.0/IWifiIface.hal
@@ -23,22 +23,22 @@
/**
* 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 cc827bb..a0e8b12 100644
--- a/wifi/1.0/IWifiRttController.hal
+++ b/wifi/1.0/IWifiRttController.hal
@@ -25,12 +25,12 @@
/**
* 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 402385b..ea535f2 100644
--- a/wifi/1.0/IWifiStaIface.hal
+++ b/wifi/1.0/IWifiStaIface.hal
@@ -213,37 +213,42 @@
*
* @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 @@
*
* @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<uint8_t> 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 @@
*
* @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 1ee2d4e..7466fc3 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.
@@ -104,6 +78,12 @@
};
/**
+ * 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
* |BackgroundScanBucketParameters.eventReportScheme|.
diff --git a/wifi/1.0/types.hal b/wifi/1.0/types.hal
index 25d4fa1..f80b9a0 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.