From fcbf923d3ae52c0d5f585dc2bd8e45e4814ce1db Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Thu, 6 Oct 2016 11:08:17 -0700 Subject: [PATCH] wifi(interface): Add RTT Controller object Create a RTT controller object to use for initiating all the RTT related HAL opertations. Since we don't want to fix the iface on which to initiate RTT operations, these methods will be rooted in a new standalone object |RttController|. Framework can decide to intiate an instance of |RttController| on a specified iface or let the implementation pick one. Bug: 31991232 Test: Interface compiles. Change-Id: I65f7a7babd72db26ce6549f572abd9ef73700c82 --- wifi/1.0/Android.bp | 8 ++++++ wifi/1.0/Android.mk | 46 +++++++++++++++++++++++++++++++++ wifi/1.0/IWifiChip.hal | 16 ++++++++++++ wifi/1.0/IWifiRttController.hal | 32 +++++++++++++++++++++++ 4 files changed, 102 insertions(+) create mode 100644 wifi/1.0/IWifiRttController.hal diff --git a/wifi/1.0/Android.bp b/wifi/1.0/Android.bp index e562d8986f..59ad2c59bb 100644 --- a/wifi/1.0/Android.bp +++ b/wifi/1.0/Android.bp @@ -14,6 +14,7 @@ genrule { "IWifiIface.hal", "IWifiNanIface.hal", "IWifiP2pIface.hal", + "IWifiRttController.hal", "IWifiStaIface.hal", ], out: [ @@ -26,6 +27,7 @@ genrule { "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/WifiRttControllerAll.cpp", "android/hardware/wifi/1.0/WifiStaIfaceAll.cpp", ], } @@ -44,6 +46,7 @@ genrule { "IWifiIface.hal", "IWifiNanIface.hal", "IWifiP2pIface.hal", + "IWifiRttController.hal", "IWifiStaIface.hal", ], out: [ @@ -88,6 +91,11 @@ genrule { "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/IWifiRttController.h", + "android/hardware/wifi/1.0/IHwWifiRttController.h", + "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/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 b171a6d4cd..58c487b76c 100644 --- a/wifi/1.0/Android.mk +++ b/wifi/1.0/Android.mk @@ -116,10 +116,14 @@ $(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)/IWifiIface.hal +$(GEN): $(LOCAL_PATH)/IWifiIface.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)/IWifiRttController.hal +$(GEN): $(LOCAL_PATH)/IWifiRttController.hal $(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IWifiStaIface.hal $(GEN): $(LOCAL_PATH)/IWifiStaIface.hal $(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal @@ -229,6 +233,25 @@ $(GEN): $(LOCAL_PATH)/IWifiP2pIface.hal $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) +# +# Build IWifiRttController.hal +# +GEN := $(intermediates)/android/hardware/wifi/1.0/IWifiRttController.java +$(GEN): $(HIDL) +$(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_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::IWifiRttController + +$(GEN): $(LOCAL_PATH)/IWifiRttController.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + # # Build IWifiStaIface.hal # @@ -364,10 +387,14 @@ $(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)/IWifiIface.hal +$(GEN): $(LOCAL_PATH)/IWifiIface.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)/IWifiRttController.hal +$(GEN): $(LOCAL_PATH)/IWifiRttController.hal $(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IWifiStaIface.hal $(GEN): $(LOCAL_PATH)/IWifiStaIface.hal $(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal @@ -477,6 +504,25 @@ $(GEN): $(LOCAL_PATH)/IWifiP2pIface.hal $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) +# +# Build IWifiRttController.hal +# +GEN := $(intermediates)/android/hardware/wifi/1.0/IWifiRttController.java +$(GEN): $(HIDL) +$(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_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava -randroid.hardware:hardware/interfaces \ + android.hardware.wifi@1.0::IWifiRttController + +$(GEN): $(LOCAL_PATH)/IWifiRttController.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + # # Build IWifiStaIface.hal # diff --git a/wifi/1.0/IWifiChip.hal b/wifi/1.0/IWifiChip.hal index 2ee133a87f..cd4b21981a 100644 --- a/wifi/1.0/IWifiChip.hal +++ b/wifi/1.0/IWifiChip.hal @@ -17,10 +17,12 @@ package android.hardware.wifi@1.0; import IWifiChipEventCallback; +import IWifiIface; import IWifiApIface; import IWifiNanIface; import IWifiP2pIface; import IWifiStaIface; +import IWifiRttController; /** * Interface that represents a chip that must be configured as a single unit. @@ -302,4 +304,18 @@ interface IWifiChip { * it exists, null otherwise. */ getStaIface(string ifname) generates (IWifiStaIface iface); + + /** + * Create a RTTController instance. + * + * RTT controller can be either: + * a) Bound to a specific iface by passing in the corresponding |IWifiIface| + * object in |iface| param, OR + * b) Let the implementation decide the iface to use for RTT operations by + * passing null in |iface| param. + * + * @param boundIface HIDL interface object representing the iface if + * the responder must be bound to a specific iface, null otherwise. + */ + createRttController(IWifiIface boundIface) generates (IWifiRttController rtt); }; diff --git a/wifi/1.0/IWifiRttController.hal b/wifi/1.0/IWifiRttController.hal new file mode 100644 index 0000000000..d735da7664 --- /dev/null +++ b/wifi/1.0/IWifiRttController.hal @@ -0,0 +1,32 @@ +/* + * 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 perform RTT operations. + */ +interface IWifiRttController { + /** + * Get the iface on which the RTT operations will be performed. + * + * @return boundIface HIDL interface object representing the iface if bound + * to a specific iface, null otherwise + */ + getBoundIface() generates (IWifiIface boundIface); +};