From adcfba4b09b6d708cafe8d8e0cc35ed8888cde9c Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Wed, 5 Oct 2016 10:19:06 -0700 Subject: [PATCH] wifi(interface): Add Iface objects Create a child object under IWifiChip to represent each interface within the chip. Each iface object has a |type| & |ifname| which should help us uniquely identify them. This should help us expose methods that are applicable only to a specific interface type. While there, Assign a unique id to every chip on the device. Add IWifi.listChipIds() to retrieve the list of chip Id's avaiable on the device. IWifi.getChip() will now use the provided Id to retrieve the corresponding IWifiChip object(because HIDL language doesn't support vec). Bug: 31943042 Bug: 32003988 Test: Interface compiles (not implementation) Change-Id: I723007566ca4220362c02d0f452753fee4e31fce --- wifi/1.0/Android.bp | 40 ++++++ wifi/1.0/Android.mk | 244 +++++++++++++++++++++++++++++++++++++ wifi/1.0/IWifi.hal | 18 ++- wifi/1.0/IWifiApIface.hal | 26 ++++ wifi/1.0/IWifiChip.hal | 144 ++++++++++++++++++++-- wifi/1.0/IWifiIface.hal | 36 ++++++ wifi/1.0/IWifiNanIface.hal | 26 ++++ wifi/1.0/IWifiP2pIface.hal | 26 ++++ wifi/1.0/IWifiStaIface.hal | 26 ++++ wifi/1.0/types.hal | 22 ++++ 10 files changed, 596 insertions(+), 12 deletions(-) create mode 100644 wifi/1.0/IWifiApIface.hal create mode 100644 wifi/1.0/IWifiIface.hal create mode 100644 wifi/1.0/IWifiNanIface.hal create mode 100644 wifi/1.0/IWifiP2pIface.hal create mode 100644 wifi/1.0/IWifiStaIface.hal diff --git a/wifi/1.0/Android.bp b/wifi/1.0/Android.bp index 07e17ef84f..e562d8986f 100644 --- a/wifi/1.0/Android.bp +++ b/wifi/1.0/Android.bp @@ -7,16 +7,26 @@ genrule { srcs: [ "types.hal", "IWifi.hal", + "IWifiApIface.hal", "IWifiChip.hal", "IWifiChipEventCallback.hal", "IWifiEventCallback.hal", + "IWifiIface.hal", + "IWifiNanIface.hal", + "IWifiP2pIface.hal", + "IWifiStaIface.hal", ], out: [ "android/hardware/wifi/1.0/types.cpp", "android/hardware/wifi/1.0/WifiAll.cpp", + "android/hardware/wifi/1.0/WifiApIfaceAll.cpp", "android/hardware/wifi/1.0/WifiChipAll.cpp", "android/hardware/wifi/1.0/WifiChipEventCallbackAll.cpp", "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/WifiP2pIfaceAll.cpp", + "android/hardware/wifi/1.0/WifiStaIfaceAll.cpp", ], } @@ -27,9 +37,14 @@ genrule { srcs: [ "types.hal", "IWifi.hal", + "IWifiApIface.hal", "IWifiChip.hal", "IWifiChipEventCallback.hal", "IWifiEventCallback.hal", + "IWifiIface.hal", + "IWifiNanIface.hal", + "IWifiP2pIface.hal", + "IWifiStaIface.hal", ], out: [ "android/hardware/wifi/1.0/types.h", @@ -38,6 +53,11 @@ genrule { "android/hardware/wifi/1.0/BnWifi.h", "android/hardware/wifi/1.0/BpWifi.h", "android/hardware/wifi/1.0/BsWifi.h", + "android/hardware/wifi/1.0/IWifiApIface.h", + "android/hardware/wifi/1.0/IHwWifiApIface.h", + "android/hardware/wifi/1.0/BnWifiApIface.h", + "android/hardware/wifi/1.0/BpWifiApIface.h", + "android/hardware/wifi/1.0/BsWifiApIface.h", "android/hardware/wifi/1.0/IWifiChip.h", "android/hardware/wifi/1.0/IHwWifiChip.h", "android/hardware/wifi/1.0/BnWifiChip.h", @@ -53,6 +73,26 @@ genrule { "android/hardware/wifi/1.0/BnWifiEventCallback.h", "android/hardware/wifi/1.0/BpWifiEventCallback.h", "android/hardware/wifi/1.0/BsWifiEventCallback.h", + "android/hardware/wifi/1.0/IWifiIface.h", + "android/hardware/wifi/1.0/IHwWifiIface.h", + "android/hardware/wifi/1.0/BnWifiIface.h", + "android/hardware/wifi/1.0/BpWifiIface.h", + "android/hardware/wifi/1.0/BsWifiIface.h", + "android/hardware/wifi/1.0/IWifiNanIface.h", + "android/hardware/wifi/1.0/IHwWifiNanIface.h", + "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/IWifiP2pIface.h", + "android/hardware/wifi/1.0/IHwWifiP2pIface.h", + "android/hardware/wifi/1.0/BnWifiP2pIface.h", + "android/hardware/wifi/1.0/BpWifiP2pIface.h", + "android/hardware/wifi/1.0/BsWifiP2pIface.h", + "android/hardware/wifi/1.0/IWifiStaIface.h", + "android/hardware/wifi/1.0/IHwWifiStaIface.h", + "android/hardware/wifi/1.0/BnWifiStaIface.h", + "android/hardware/wifi/1.0/BpWifiStaIface.h", + "android/hardware/wifi/1.0/BsWifiStaIface.h", ], } diff --git a/wifi/1.0/Android.mk b/wifi/1.0/Android.mk index e211ca83b1..b171a6d4cd 100644 --- a/wifi/1.0/Android.mk +++ b/wifi/1.0/Android.mk @@ -46,6 +46,23 @@ $(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 +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.IfaceType + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + # # Build IWifi.hal # @@ -57,6 +74,8 @@ $(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IWifiChip.hal $(GEN): $(LOCAL_PATH)/IWifiChip.hal $(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IWifiEventCallback.hal $(GEN): $(LOCAL_PATH)/IWifiEventCallback.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) \ @@ -67,6 +86,25 @@ $(GEN): $(LOCAL_PATH)/IWifi.hal $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) +# +# Build IWifiApIface.hal +# +GEN := $(intermediates)/android/hardware/wifi/1.0/IWifiApIface.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IWifiApIface.hal +$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IWifiIface.hal +$(GEN): $(LOCAL_PATH)/IWifiIface.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::IWifiApIface + +$(GEN): $(LOCAL_PATH)/IWifiApIface.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + # # Build IWifiChip.hal # @@ -74,8 +112,16 @@ GEN := $(intermediates)/android/hardware/wifi/1.0/IWifiChip.java $(GEN): $(HIDL) $(GEN): PRIVATE_HIDL := $(HIDL) $(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IWifiChip.hal +$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IWifiApIface.hal +$(GEN): $(LOCAL_PATH)/IWifiApIface.hal $(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IWifiChipEventCallback.hal $(GEN): $(LOCAL_PATH)/IWifiChipEventCallback.hal +$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IWifiNanIface.hal +$(GEN): $(LOCAL_PATH)/IWifiNanIface.hal +$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IWifiP2pIface.hal +$(GEN): $(LOCAL_PATH)/IWifiP2pIface.hal +$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IWifiStaIface.hal +$(GEN): $(LOCAL_PATH)/IWifiStaIface.hal $(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal $(GEN): $(LOCAL_PATH)/types.hal $(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) @@ -125,6 +171,82 @@ $(GEN): PRIVATE_CUSTOM_TOOL = \ $(GEN): $(LOCAL_PATH)/IWifiEventCallback.hal $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build IWifiIface.hal +# +GEN := $(intermediates)/android/hardware/wifi/1.0/IWifiIface.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(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) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::IWifiIface + +$(GEN): $(LOCAL_PATH)/IWifiIface.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build IWifiNanIface.hal +# +GEN := $(intermediates)/android/hardware/wifi/1.0/IWifiNanIface.java +$(GEN): $(HIDL) +$(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_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::IWifiNanIface + +$(GEN): $(LOCAL_PATH)/IWifiNanIface.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build IWifiP2pIface.hal +# +GEN := $(intermediates)/android/hardware/wifi/1.0/IWifiP2pIface.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IWifiP2pIface.hal +$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IWifiIface.hal +$(GEN): $(LOCAL_PATH)/IWifiIface.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::IWifiP2pIface + +$(GEN): $(LOCAL_PATH)/IWifiP2pIface.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build IWifiStaIface.hal +# +GEN := $(intermediates)/android/hardware/wifi/1.0/IWifiStaIface.java +$(GEN): $(HIDL) +$(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_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::IWifiStaIface + +$(GEN): $(LOCAL_PATH)/IWifiStaIface.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) include $(BUILD_JAVA_LIBRARY) @@ -172,6 +294,23 @@ $(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 +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::types.IfaceType + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + # # Build IWifi.hal # @@ -183,6 +322,8 @@ $(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IWifiChip.hal $(GEN): $(LOCAL_PATH)/IWifiChip.hal $(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IWifiEventCallback.hal $(GEN): $(LOCAL_PATH)/IWifiEventCallback.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) \ @@ -193,6 +334,25 @@ $(GEN): $(LOCAL_PATH)/IWifi.hal $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) +# +# Build IWifiApIface.hal +# +GEN := $(intermediates)/android/hardware/wifi/1.0/IWifiApIface.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IWifiApIface.hal +$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IWifiIface.hal +$(GEN): $(LOCAL_PATH)/IWifiIface.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::IWifiApIface + +$(GEN): $(LOCAL_PATH)/IWifiApIface.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + # # Build IWifiChip.hal # @@ -200,8 +360,16 @@ GEN := $(intermediates)/android/hardware/wifi/1.0/IWifiChip.java $(GEN): $(HIDL) $(GEN): PRIVATE_HIDL := $(HIDL) $(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IWifiChip.hal +$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IWifiApIface.hal +$(GEN): $(LOCAL_PATH)/IWifiApIface.hal $(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IWifiChipEventCallback.hal $(GEN): $(LOCAL_PATH)/IWifiChipEventCallback.hal +$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IWifiNanIface.hal +$(GEN): $(LOCAL_PATH)/IWifiNanIface.hal +$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IWifiP2pIface.hal +$(GEN): $(LOCAL_PATH)/IWifiP2pIface.hal +$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IWifiStaIface.hal +$(GEN): $(LOCAL_PATH)/IWifiStaIface.hal $(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal $(GEN): $(LOCAL_PATH)/types.hal $(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) @@ -251,6 +419,82 @@ $(GEN): PRIVATE_CUSTOM_TOOL = \ $(GEN): $(LOCAL_PATH)/IWifiEventCallback.hal $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build IWifiIface.hal +# +GEN := $(intermediates)/android/hardware/wifi/1.0/IWifiIface.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(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) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::IWifiIface + +$(GEN): $(LOCAL_PATH)/IWifiIface.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build IWifiNanIface.hal +# +GEN := $(intermediates)/android/hardware/wifi/1.0/IWifiNanIface.java +$(GEN): $(HIDL) +$(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_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::IWifiNanIface + +$(GEN): $(LOCAL_PATH)/IWifiNanIface.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build IWifiP2pIface.hal +# +GEN := $(intermediates)/android/hardware/wifi/1.0/IWifiP2pIface.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IWifiP2pIface.hal +$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IWifiIface.hal +$(GEN): $(LOCAL_PATH)/IWifiIface.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::IWifiP2pIface + +$(GEN): $(LOCAL_PATH)/IWifiP2pIface.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build IWifiStaIface.hal +# +GEN := $(intermediates)/android/hardware/wifi/1.0/IWifiStaIface.java +$(GEN): $(HIDL) +$(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_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::IWifiStaIface + +$(GEN): $(LOCAL_PATH)/IWifiStaIface.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) include $(BUILD_STATIC_JAVA_LIBRARY) diff --git a/wifi/1.0/IWifi.hal b/wifi/1.0/IWifi.hal index d1311f5462..9e09348087 100644 --- a/wifi/1.0/IWifi.hal +++ b/wifi/1.0/IWifi.hal @@ -70,10 +70,22 @@ interface IWifi { @callflow(next={"registerEventCallback", "start", "stop"}) oneway stop(); - // TODO(b/30570663) return vec instead /** - * Get the configurable chip on the device. + * Retrieve the list of all chip Id's on the device. + * The corresponding |IWifiChip| object for any chip can be + * retrieved using |getChip| method. + * + * @return chipIds List of all chip Id's on the device. */ @callflow(next={"*"}) - getChip() generates (IWifiChip chip); + getChipIds() generates (vec chipIds); + + /** + * Gets a HIDL interface object for the chip corresponding to the + * provided chipId. + * + * @return chip HIDL interface object representing the chip. + */ + @callflow(next={"*"}) + getChip(ChipId chipId) generates (IWifiChip chip); }; diff --git a/wifi/1.0/IWifiApIface.hal b/wifi/1.0/IWifiApIface.hal new file mode 100644 index 0000000000..6bc3580137 --- /dev/null +++ b/wifi/1.0/IWifiApIface.hal @@ -0,0 +1,26 @@ +/* + * 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; + +import IWifiIface; + +/** + * Interface used to represent a single AP iface. + */ +interface IWifiApIface extends IWifiIface { + /** TODO(rpius): Add methods to the interface. */ +}; diff --git a/wifi/1.0/IWifiChip.hal b/wifi/1.0/IWifiChip.hal index 7a41ddf1b7..2ee133a87f 100644 --- a/wifi/1.0/IWifiChip.hal +++ b/wifi/1.0/IWifiChip.hal @@ -17,6 +17,10 @@ package android.hardware.wifi@1.0; import IWifiChipEventCallback; +import IWifiApIface; +import IWifiNanIface; +import IWifiP2pIface; +import IWifiStaIface; /** * Interface that represents a chip that must be configured as a single unit. @@ -24,15 +28,6 @@ import IWifiChipEventCallback; * to perform operations like NAN, RTT, etc. */ interface IWifiChip { - enum IfaceType : uint32_t { - STA, AP, P2P, - /** - * NAN control interface. Datapath support may be queried and created - * through this interface. - */ - NAN, - }; - /** * Set of interface types with the maximum number of interfaces that can have * one of the specified type for a given ChipIfaceCombination. See @@ -121,6 +116,13 @@ interface IWifiChip { vec availableCombinations; }; + /** + * Get the id assigned to this chip. + * + * @return id Assigned chip Id. + */ + getId() generates (ChipId id); + /** * Requests notifications of significant events on this chip. Multiple calls * to this will register multiple callbacks each of which will receive all @@ -176,4 +178,128 @@ interface IWifiChip { * success, or |IWifiChipEventCallback.onFirmwareDebugDumpFailure| on failure. */ oneway requestFirmwareDebugDump(); + + /** + * 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. + * + * @return iface HIDL interface object representing the iface if + * successful, null otherwise. + */ + createApIface() generates (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 ifnames List of all AP iface names on the chip. + */ + getApIfaceNames() generates (vec ifnames); + + /** + * Gets a HIDL interface object for the AP Iface corresponding + * to the provided ifname. + * + * @param ifname Name of the iface. + * @return iface HIDL interface object representing the iface if + * it exists, null otherwise. + */ + getApIface(string ifname) generates (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. + * + * @return iface HIDL interface object representing the iface if + * successful, null otherwise. + */ + createNanIface() generates (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 ifnames List of all NAN iface names on the chip. + */ + getNanIfaceNames() generates (vec ifnames); + + /** + * Gets a HIDL interface object for the NAN Iface corresponding + * to the provided ifname. + * + * @param ifname Name of the iface. + * @return iface HIDL interface object representing the iface if + * it exists, null otherwise. + */ + getNanIface(string ifname) generates (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. + * + * @return iface HIDL interface object representing the iface if + * successful, null otherwise. + */ + createP2pIface() generates (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 ifnames List of all P2P iface names on the chip. + */ + getP2pIfaceNames() generates (vec ifnames); + + /** + * Gets a HIDL interface object for the P2P Iface corresponding + * to the provided ifname. + * + * @param ifname Name of the iface. + * @return iface HIDL interface object representing the iface if + * it exists, null otherwise. + */ + getP2pIface(string ifname) generates (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. + * + * @return iface HIDL interface object representing the iface if + * successful, null otherwise. + */ + createStaIface() generates (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 ifnames List of all STA iface names on the chip. + */ + getStaIfaceNames() generates (vec ifnames); + + /** + * Gets a HIDL interface object for the STA Iface corresponding + * to the provided ifname. + * + * @param ifname Name of the iface. + * @return iface HIDL interface object representing the iface if + * it exists, null otherwise. + */ + getStaIface(string ifname) generates (IWifiStaIface iface); }; diff --git a/wifi/1.0/IWifiIface.hal b/wifi/1.0/IWifiIface.hal new file mode 100644 index 0000000000..f4150e79b4 --- /dev/null +++ b/wifi/1.0/IWifiIface.hal @@ -0,0 +1,36 @@ +/* + * 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 used to represent a single iface. + */ +interface IWifiIface { + /** + * Get the type of this iface. + * + * @return type One of the supported iface types. + */ + getType() generates (IfaceType type); + + /** + * Get the name of this iface. + * + * @return name Name of the iface. + */ + getName() generates (string name); +}; diff --git a/wifi/1.0/IWifiNanIface.hal b/wifi/1.0/IWifiNanIface.hal new file mode 100644 index 0000000000..dade94c885 --- /dev/null +++ b/wifi/1.0/IWifiNanIface.hal @@ -0,0 +1,26 @@ +/* + * 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; + +import IWifiIface; + +/** + * Interface used to represent a single NAN iface. + */ +interface IWifiNanIface extends IWifiIface { + /** TODO(rpius): Add methods to the interface. */ +}; diff --git a/wifi/1.0/IWifiP2pIface.hal b/wifi/1.0/IWifiP2pIface.hal new file mode 100644 index 0000000000..243748ffc0 --- /dev/null +++ b/wifi/1.0/IWifiP2pIface.hal @@ -0,0 +1,26 @@ +/* + * 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; + +import IWifiIface; + +/** + * Interface used to represent a single NAN iface. + */ +interface IWifiP2pIface extends IWifiIface { + /** TODO(rpius): Add methods to the interface. */ +}; diff --git a/wifi/1.0/IWifiStaIface.hal b/wifi/1.0/IWifiStaIface.hal new file mode 100644 index 0000000000..5234c71301 --- /dev/null +++ b/wifi/1.0/IWifiStaIface.hal @@ -0,0 +1,26 @@ +/* + * 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; + +import IWifiIface; + +/** + * Interface used to represent a single STA iface. + */ +interface IWifiStaIface extends IWifiIface { + /** TODO(rpius): Add methods to the interface. */ +}; diff --git a/wifi/1.0/types.hal b/wifi/1.0/types.hal index 49849eaab7..d9abaefe5d 100644 --- a/wifi/1.0/types.hal +++ b/wifi/1.0/types.hal @@ -16,6 +16,9 @@ package android.hardware.wifi@1.0; +/** + * List of failure reasons returned. + */ enum CommandFailureReason : uint32_t { UNKNOWN, DUPLICATE_COMMAND_ID, @@ -40,6 +43,25 @@ struct FailureReason { string description; }; +/** + * List of Iface types supported. + */ +enum IfaceType : uint32_t { + STA, + AP, + P2P, + /** + * NAN control interface. Datapath support may be queried and created + * through this interface. + */ + NAN, +}; + +/** + * An identifier assigned to every chip on the device. + */ +typedef uint32_t ChipId; + /** * An identifier for a mode that the chip can be put in. */