wifi: Add support for removing iface
This is needed to support dynamically switching between ifaces
within the same mode.
While there, correct couple of nits:
1. Pass std::string to the |get*IfaceInternal| methods. This makes the
name comparison easier.
2. Update the docstring of |get*Iface| in IWifiChip.hal to indicate that
we'll return ERROR_INVALID_ARGS if the iface name is wrong.
Bug: 33040049
Test: Compiles
Change-Id: I53584013283a10bf109f1c2ffb6136c44f11ed29
diff --git a/wifi/1.0/IWifiChip.hal b/wifi/1.0/IWifiChip.hal
index 3c085c3..051a088 100644
--- a/wifi/1.0/IWifiChip.hal
+++ b/wifi/1.0/IWifiChip.hal
@@ -323,13 +323,28 @@
* @return status WifiStatus of the operation.
* Possible status codes:
* |WifiStatusCode.SUCCESS|,
- * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|
+ * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
+ * |WifiStatusCode.ERROR_INVALID_ARGS|
* @return iface HIDL interface object representing the iface if
* it exists, null otherwise.
*/
getApIface(string ifname) generates (WifiStatus status, IWifiApIface iface);
/**
+ * Removes the AP Iface with the provided ifname.
+ * Any further calls on the corresponding |IWifiApIface| HIDL interface
+ * object must fail.
+ *
+ * @param ifname Name of the iface.
+ * @return status WifiStatus of the operation.
+ * Possible status codes:
+ * |WifiStatusCode.SUCCESS|,
+ * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
+ * |WifiStatusCode.ERROR_INVALID_ARGS|
+ */
+ removeApIface(string ifname) generates (WifiStatus status);
+
+ /**
* Create a NAN iface on the chip.
*
* Depending on the mode the chip is configured in, the interface creation
@@ -368,13 +383,28 @@
* @return status WifiStatus of the operation.
* Possible status codes:
* |WifiStatusCode.SUCCESS|,
- * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|
+ * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
+ * |WifiStatusCode.ERROR_INVALID_ARGS|
* @return iface HIDL interface object representing the iface if
* it exists, null otherwise.
*/
getNanIface(string ifname) generates (WifiStatus status, IWifiNanIface iface);
/**
+ * Removes the NAN Iface with the provided ifname.
+ * Any further calls on the corresponding |IWifiNanIface| HIDL interface
+ * object must fail.
+ *
+ * @param ifname Name of the iface.
+ * @return status WifiStatus of the operation.
+ * Possible status codes:
+ * |WifiStatusCode.SUCCESS|,
+ * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
+ * |WifiStatusCode.ERROR_INVALID_ARGS|
+ */
+ removeNanIface(string ifname) generates (WifiStatus status);
+
+ /**
* Create a P2P iface on the chip.
*
* Depending on the mode the chip is configured in, the interface creation
@@ -413,13 +443,28 @@
* @return status WifiStatus of the operation.
* Possible status codes:
* |WifiStatusCode.SUCCESS|,
- * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|
+ * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
+ * |WifiStatusCode.ERROR_INVALID_ARGS|
* @return iface HIDL interface object representing the iface if
* it exists, null otherwise.
*/
getP2pIface(string ifname) generates (WifiStatus status, IWifiP2pIface iface);
/**
+ * Removes the P2P Iface with the provided ifname.
+ * Any further calls on the corresponding |IWifiP2pIface| HIDL interface
+ * object must fail.
+ *
+ * @param ifname Name of the iface.
+ * @return status WifiStatus of the operation.
+ * Possible status codes:
+ * |WifiStatusCode.SUCCESS|,
+ * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
+ * |WifiStatusCode.ERROR_INVALID_ARGS|
+ */
+ removeP2pIface(string ifname) generates (WifiStatus status);
+
+ /**
* Create an STA iface on the chip.
*
* Depending on the mode the chip is configured in, the interface creation
@@ -458,13 +503,28 @@
* @return status WifiStatus of the operation.
* Possible status codes:
* |WifiStatusCode.SUCCESS|,
- * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|
+ * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
+ * |WifiStatusCode.ERROR_INVALID_ARGS|
* @return iface HIDL interface object representing the iface if
* it exists, null otherwise.
*/
getStaIface(string ifname) generates (WifiStatus status, IWifiStaIface iface);
/**
+ * Removes the STA Iface with the provided ifname.
+ * Any further calls on the corresponding |IWifiStaIface| HIDL interface
+ * object must fail.
+ *
+ * @param ifname Name of the iface.
+ * @return status WifiStatus of the operation.
+ * Possible status codes:
+ * |WifiStatusCode.SUCCESS|,
+ * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
+ * |WifiStatusCode.ERROR_INVALID_ARGS|
+ */
+ removeStaIface(string ifname) generates (WifiStatus status);
+
+ /**
* Create a RTTController instance.
*
* RTT controller can be either: