diff options
author | Roshan Pius <rpius@google.com> | 2017-06-20 11:36:29 -0700 |
---|---|---|
committer | Roshan Pius <rpius@google.com> | 2017-07-06 09:19:25 -0700 |
commit | ee3daf9ab68231cc4eb71eba8fec9d2f28c7ecef (patch) | |
tree | 1efdebdcaaa44da900c88f64c09391c02ae23a5a | |
parent | 5e5c1847503de0e55261c03aea0eb7831a58b9a3 (diff) |
wifi(interface): Create 1.1 interface package
Extend the wifi HAL to add a new method in IWifiChip. This new method is
used for setting the TX power limit for meeting SAR requirements.
Bug: 62437848
Test: ./hardware/interfaces/update-makefiles.sh
Test: mmm -j32 hardware/interfaces/wifi/1.1
Change-Id: I8320a64812339f15cd88636505de0dfda18f0ebf
-rw-r--r-- | wifi/1.1/Android.bp | 68 | ||||
-rw-r--r-- | wifi/1.1/Android.mk | 116 | ||||
-rw-r--r-- | wifi/1.1/IWifi.hal | 28 | ||||
-rw-r--r-- | wifi/1.1/IWifiChip.hal | 67 | ||||
-rw-r--r-- | wifi/Android.bp | 1 |
5 files changed, 280 insertions, 0 deletions
diff --git a/wifi/1.1/Android.bp b/wifi/1.1/Android.bp new file mode 100644 index 0000000000..f991fa5465 --- /dev/null +++ b/wifi/1.1/Android.bp @@ -0,0 +1,68 @@ +// This file is autogenerated by hidl-gen. Do not edit manually. + +filegroup { + name: "android.hardware.wifi@1.1_hal", + srcs: [ + "IWifi.hal", + "IWifiChip.hal", + ], +} + +genrule { + name: "android.hardware.wifi@1.1_genc++", + tools: ["hidl-gen"], + cmd: "$(location hidl-gen) -o $(genDir) -Lc++-sources -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.wifi@1.1", + srcs: [ + ":android.hardware.wifi@1.1_hal", + ], + out: [ + "android/hardware/wifi/1.1/WifiAll.cpp", + "android/hardware/wifi/1.1/WifiChipAll.cpp", + ], +} + +genrule { + name: "android.hardware.wifi@1.1_genc++_headers", + tools: ["hidl-gen"], + cmd: "$(location hidl-gen) -o $(genDir) -Lc++-headers -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.wifi@1.1", + srcs: [ + ":android.hardware.wifi@1.1_hal", + ], + out: [ + "android/hardware/wifi/1.1/IWifi.h", + "android/hardware/wifi/1.1/IHwWifi.h", + "android/hardware/wifi/1.1/BnHwWifi.h", + "android/hardware/wifi/1.1/BpHwWifi.h", + "android/hardware/wifi/1.1/BsWifi.h", + "android/hardware/wifi/1.1/IWifiChip.h", + "android/hardware/wifi/1.1/IHwWifiChip.h", + "android/hardware/wifi/1.1/BnHwWifiChip.h", + "android/hardware/wifi/1.1/BpHwWifiChip.h", + "android/hardware/wifi/1.1/BsWifiChip.h", + ], +} + +cc_library_shared { + name: "android.hardware.wifi@1.1", + defaults: ["hidl-module-defaults"], + generated_sources: ["android.hardware.wifi@1.1_genc++"], + generated_headers: ["android.hardware.wifi@1.1_genc++_headers"], + export_generated_headers: ["android.hardware.wifi@1.1_genc++_headers"], + vendor_available: true, + shared_libs: [ + "libhidlbase", + "libhidltransport", + "libhwbinder", + "liblog", + "libutils", + "libcutils", + "android.hardware.wifi@1.0", + ], + export_shared_lib_headers: [ + "libhidlbase", + "libhidltransport", + "libhwbinder", + "libutils", + "android.hardware.wifi@1.0", + ], +} diff --git a/wifi/1.1/Android.mk b/wifi/1.1/Android.mk new file mode 100644 index 0000000000..fbc79ca159 --- /dev/null +++ b/wifi/1.1/Android.mk @@ -0,0 +1,116 @@ +# This file is autogenerated by hidl-gen. Do not edit manually. + +LOCAL_PATH := $(call my-dir) + +################################################################################ + +include $(CLEAR_VARS) +LOCAL_MODULE := android.hardware.wifi-V1.1-java +LOCAL_MODULE_CLASS := JAVA_LIBRARIES + +intermediates := $(call local-generated-sources-dir, COMMON) + +HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX) + +LOCAL_JAVA_LIBRARIES := \ + android.hardware.wifi-V1.0-java \ + android.hidl.base-V1.0-java \ + + +# +# Build IWifi.hal +# +GEN := $(intermediates)/android/hardware/wifi/V1_1/IWifi.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IWifi.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava \ + -randroid.hardware:hardware/interfaces \ + -randroid.hidl:system/libhidl/transport \ + android.hardware.wifi@1.1::IWifi + +$(GEN): $(LOCAL_PATH)/IWifi.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build IWifiChip.hal +# +GEN := $(intermediates)/android/hardware/wifi/V1_1/IWifiChip.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IWifiChip.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava \ + -randroid.hardware:hardware/interfaces \ + -randroid.hidl:system/libhidl/transport \ + android.hardware.wifi@1.1::IWifiChip + +$(GEN): $(LOCAL_PATH)/IWifiChip.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) +include $(BUILD_JAVA_LIBRARY) + + +################################################################################ + +include $(CLEAR_VARS) +LOCAL_MODULE := android.hardware.wifi-V1.1-java-static +LOCAL_MODULE_CLASS := JAVA_LIBRARIES + +intermediates := $(call local-generated-sources-dir, COMMON) + +HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX) + +LOCAL_STATIC_JAVA_LIBRARIES := \ + android.hardware.wifi-V1.0-java-static \ + android.hidl.base-V1.0-java-static \ + + +# +# Build IWifi.hal +# +GEN := $(intermediates)/android/hardware/wifi/V1_1/IWifi.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IWifi.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava \ + -randroid.hardware:hardware/interfaces \ + -randroid.hidl:system/libhidl/transport \ + android.hardware.wifi@1.1::IWifi + +$(GEN): $(LOCAL_PATH)/IWifi.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build IWifiChip.hal +# +GEN := $(intermediates)/android/hardware/wifi/V1_1/IWifiChip.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IWifiChip.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava \ + -randroid.hardware:hardware/interfaces \ + -randroid.hidl:system/libhidl/transport \ + android.hardware.wifi@1.1::IWifiChip + +$(GEN): $(LOCAL_PATH)/IWifiChip.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) +include $(BUILD_STATIC_JAVA_LIBRARY) + + + +include $(call all-makefiles-under,$(LOCAL_PATH)) diff --git a/wifi/1.1/IWifi.hal b/wifi/1.1/IWifi.hal new file mode 100644 index 0000000000..bd48f57931 --- /dev/null +++ b/wifi/1.1/IWifi.hal @@ -0,0 +1,28 @@ +/* + * 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.1; + +import @1.0::IWifi; + +/** + * This is the root of the HAL module and is the interface returned when + * loading an implementation of the Wi-Fi HAL. There must be at most one + * module loaded in the system. + * IWifi.getChip() may return either a @1.0::IWifiChip or @1.1::IWifiChip. + */ +interface IWifi extends @1.0::IWifi { +}; diff --git a/wifi/1.1/IWifiChip.hal b/wifi/1.1/IWifiChip.hal new file mode 100644 index 0000000000..7275412802 --- /dev/null +++ b/wifi/1.1/IWifiChip.hal @@ -0,0 +1,67 @@ +/* + * 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.1; + +import @1.0::IWifiChip; +import @1.0::WifiStatus; + +/** + * Interface that represents a chip that must be configured as a single unit. + * The HAL/driver/firmware will be responsible for determining which phy is used + * to perform operations like NAN, RTT, etc. + */ +interface IWifiChip extends @1.0::IWifiChip { + /** + * Capabilities exposed by this chip. + */ + enum ChipCapabilityMask : @1.0::IWifiChip.ChipCapabilityMask { + /** + * Set/Reset Tx Power limits. + */ + SET_TX_POWER_LIMIT = 1 << 8 + }; + + /** + * API to set TX power limit. + * This is used for meeting SAR requirements while making VOIP calls for + * example. + * + * @param powerInDbm Power level in dBm. + * @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| + */ + setTxPowerLimit(int32_t powerInDbm) generates (WifiStatus status); + + /** + * API to reset TX power limit. + * This is used to set the power back to default values. + * + * @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| + */ + resetTxPowerLimit() generates (WifiStatus status); +}; diff --git a/wifi/Android.bp b/wifi/Android.bp index 523014f2c4..230e720f0c 100644 --- a/wifi/Android.bp +++ b/wifi/Android.bp @@ -2,6 +2,7 @@ subdirs = [ "1.0", "1.0/vts/functional", + "1.1", "offload/1.0", "offload/1.0/vts/functional", "supplicant/1.0", |