Merge changes from topic 'wifi_1_1' into oc-dr1-dev

am: 291721771f

Change-Id: I8253fd29b38e8689d1593c2f707d4c9c0ec4cec9
This commit is contained in:
Roshan Pius
2017-07-06 21:52:44 +00:00
committed by android-build-merger
42 changed files with 561 additions and 70 deletions

View File

@@ -17,10 +17,12 @@
cc_library_static {
name: "VtsHalWifiV1_0TargetTestUtil",
srcs: [
"wifi_hidl_call_util_selftest.cpp",
"wifi_hidl_test.cpp",
"wifi_hidl_test_utils.cpp"],
export_include_dirs: [
"."
],
shared_libs: [
"libbase",
"liblog",

68
wifi/1.1/Android.bp Normal file
View File

@@ -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",
],
}

116
wifi/1.1/Android.mk Normal file
View File

@@ -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))

28
wifi/1.1/IWifi.hal Normal file
View File

@@ -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 {
};

67
wifi/1.1/IWifiChip.hal Normal file
View File

@@ -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);
};

View File

@@ -38,6 +38,7 @@ LOCAL_SRC_FILES := \
wifi_status_util.cpp
LOCAL_SHARED_LIBRARIES := \
android.hardware.wifi@1.0 \
android.hardware.wifi@1.1 \
libbase \
libcutils \
libhidlbase \

View File

@@ -51,7 +51,7 @@ class HidlDeathHandler : public android::hardware::hidl_death_recipient {
namespace android {
namespace hardware {
namespace wifi {
namespace V1_0 {
namespace V1_1 {
namespace implementation {
namespace hidl_callback_util {
template <typename CallbackType>
@@ -114,7 +114,7 @@ class HidlCallbackHandler {
} // namespace hidl_callback_util
} // namespace implementation
} // namespace V1_0
} // namespace V1_1
} // namespace wifi
} // namespace hardware
} // namespace android

View File

@@ -23,9 +23,10 @@
namespace android {
namespace hardware {
namespace wifi {
namespace V1_0 {
namespace V1_1 {
namespace implementation {
namespace hidl_return_util {
using namespace android::hardware::wifi::V1_0;
/**
* These utility functions are used to invoke a method on the provided
@@ -106,7 +107,7 @@ Return<void> validateAndCall(
} // namespace hidl_util
} // namespace implementation
} // namespace V1_0
} // namespace V1_1
} // namespace wifi
} // namespace hardware
} // namespace android

View File

@@ -22,7 +22,7 @@
namespace android {
namespace hardware {
namespace wifi {
namespace V1_0 {
namespace V1_1 {
namespace implementation {
namespace hidl_struct_util {
@@ -2177,7 +2177,7 @@ bool convertLegacyVectorOfRttResultToHidl(
}
} // namespace hidl_struct_util
} // namespace implementation
} // namespace V1_0
} // namespace V1_1
} // namespace wifi
} // namespace hardware
} // namespace android

View File

@@ -32,9 +32,10 @@
namespace android {
namespace hardware {
namespace wifi {
namespace V1_0 {
namespace V1_1 {
namespace implementation {
namespace hidl_struct_util {
using namespace android::hardware::wifi::V1_0;
// Chip conversion methods.
bool convertLegacyFeaturesToHidlChipCapabilities(
@@ -161,7 +162,7 @@ bool convertLegacyVectorOfRttResultToHidl(
std::vector<RttResult>* hidl_results);
} // namespace hidl_struct_util
} // namespace implementation
} // namespace V1_0
} // namespace V1_1
} // namespace wifi
} // namespace hardware
} // namespace android

View File

@@ -23,7 +23,7 @@ std::recursive_mutex g_mutex;
namespace android {
namespace hardware {
namespace wifi {
namespace V1_0 {
namespace V1_1 {
namespace implementation {
namespace hidl_sync_util {
@@ -33,7 +33,7 @@ std::unique_lock<std::recursive_mutex> acquireGlobalLock() {
} // namespace hidl_sync_util
} // namespace implementation
} // namespace V1_0
} // namespace V1_1
} // namespace wifi
} // namespace hardware
} // namespace android

View File

@@ -24,13 +24,13 @@
namespace android {
namespace hardware {
namespace wifi {
namespace V1_0 {
namespace V1_1 {
namespace implementation {
namespace hidl_sync_util {
std::unique_lock<std::recursive_mutex> acquireGlobalLock();
} // namespace hidl_sync_util
} // namespace implementation
} // namespace V1_0
} // namespace V1_1
} // namespace wifi
} // namespace hardware
} // namespace android

View File

@@ -32,8 +32,8 @@ int main(int /*argc*/, char** argv) {
configureRpcThreadpool(1, true /* callerWillJoin */);
// Setup hwbinder service
android::sp<android::hardware::wifi::V1_0::IWifi> service =
new android::hardware::wifi::V1_0::implementation::Wifi();
android::sp<android::hardware::wifi::V1_1::IWifi> service =
new android::hardware::wifi::V1_1::implementation::Wifi();
CHECK_EQ(service->registerAsService(), android::NO_ERROR)
<< "Failed to register wifi HAL";

View File

@@ -28,7 +28,7 @@ static constexpr android::hardware::wifi::V1_0::ChipId kChipId = 0;
namespace android {
namespace hardware {
namespace wifi {
namespace V1_0 {
namespace V1_1 {
namespace implementation {
using hidl_return_util::validateAndCall;
@@ -195,7 +195,7 @@ WifiStatus Wifi::stopLegacyHalAndDeinitializeModeController() {
return createWifiStatus(WifiStatusCode::SUCCESS);
}
} // namespace implementation
} // namespace V1_0
} // namespace V1_1
} // namespace wifi
} // namespace hardware
} // namespace android

View File

@@ -20,7 +20,7 @@
#include <functional>
#include <android-base/macros.h>
#include <android/hardware/wifi/1.0/IWifi.h>
#include <android/hardware/wifi/1.1/IWifi.h>
#include <utils/Looper.h>
#include "hidl_callback_util.h"
@@ -31,13 +31,14 @@
namespace android {
namespace hardware {
namespace wifi {
namespace V1_0 {
namespace V1_1 {
namespace implementation {
using namespace android::hardware::wifi::V1_0;
/**
* Root HIDL interface object used to control the Wifi HAL.
*/
class Wifi : public IWifi {
class Wifi : public V1_1::IWifi {
public:
Wifi();
@@ -79,7 +80,7 @@ class Wifi : public IWifi {
};
} // namespace implementation
} // namespace V1_0
} // namespace V1_1
} // namespace wifi
} // namespace hardware
} // namespace android

View File

@@ -24,7 +24,7 @@
namespace android {
namespace hardware {
namespace wifi {
namespace V1_0 {
namespace V1_1 {
namespace implementation {
using hidl_return_util::validateAndCall;
@@ -100,7 +100,7 @@ WifiApIface::getValidFrequenciesForBandInternal(WifiBand band) {
return {createWifiStatusFromLegacyError(legacy_status), valid_frequencies};
}
} // namespace implementation
} // namespace V1_0
} // namespace V1_1
} // namespace wifi
} // namespace hardware
} // namespace android

View File

@@ -25,13 +25,14 @@
namespace android {
namespace hardware {
namespace wifi {
namespace V1_0 {
namespace V1_1 {
namespace implementation {
using namespace android::hardware::wifi::V1_0;
/**
* HIDL interface object used to control a AP Iface instance.
*/
class WifiApIface : public IWifiApIface {
class WifiApIface : public V1_0::IWifiApIface {
public:
WifiApIface(const std::string& ifname,
const std::weak_ptr<legacy_hal::WifiLegacyHal> legacy_hal);
@@ -63,7 +64,7 @@ class WifiApIface : public IWifiApIface {
};
} // namespace implementation
} // namespace V1_0
} // namespace V1_1
} // namespace wifi
} // namespace hardware
} // namespace android

View File

@@ -46,7 +46,7 @@ void invalidateAndClear(sp<Iface>& iface) {
namespace android {
namespace hardware {
namespace wifi {
namespace V1_0 {
namespace V1_1 {
namespace implementation {
using hidl_return_util::validateAndCall;
@@ -343,6 +343,23 @@ Return<void> WifiChip::enableDebugErrorAlerts(
enable);
}
Return<void> WifiChip::setTxPowerLimit(
int32_t powerInDbm, setTxPowerLimit_cb hidl_status_cb) {
return validateAndCall(this,
WifiStatusCode::ERROR_WIFI_CHIP_INVALID,
&WifiChip::setTxPowerLimitInternal,
hidl_status_cb,
powerInDbm);
}
Return<void> WifiChip::resetTxPowerLimit(
resetTxPowerLimit_cb hidl_status_cb) {
return validateAndCall(this,
WifiStatusCode::ERROR_WIFI_CHIP_INVALID,
&WifiChip::resetTxPowerLimitInternal,
hidl_status_cb);
}
void WifiChip::invalidateAndRemoveAllIfaces() {
invalidateAndClear(ap_iface_);
invalidateAndClear(nan_iface_);
@@ -801,6 +818,18 @@ WifiStatus WifiChip::enableDebugErrorAlertsInternal(bool enable) {
return createWifiStatusFromLegacyError(legacy_status);
}
WifiStatus WifiChip::setTxPowerLimitInternal(int32_t /* powerInDbm */) {
// TODO(b/62437848): Implement this method once we are ready with the
// header changes in legacy HAL.
return createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED);
}
WifiStatus WifiChip::resetTxPowerLimitInternal() {
// TODO(b/62437848): Implement this method once we are ready with the
// header changes in legacy HAL.
return createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED);
}
WifiStatus WifiChip::handleChipConfiguration(ChipModeId mode_id) {
// If the chip is already configured in a different mode, stop
// the legacy HAL and then start it after firmware mode change.
@@ -869,7 +898,7 @@ WifiStatus WifiChip::registerDebugRingBufferCallback() {
}
} // namespace implementation
} // namespace V1_0
} // namespace V1_1
} // namespace wifi
} // namespace hardware
} // namespace android

View File

@@ -20,7 +20,7 @@
#include <map>
#include <android-base/macros.h>
#include <android/hardware/wifi/1.0/IWifiChip.h>
#include <android/hardware/wifi/1.1/IWifiChip.h>
#include "hidl_callback_util.h"
#include "wifi_ap_iface.h"
@@ -34,15 +34,16 @@
namespace android {
namespace hardware {
namespace wifi {
namespace V1_0 {
namespace V1_1 {
namespace implementation {
using namespace android::hardware::wifi::V1_0;
/**
* HIDL interface object used to control a Wifi HAL chip instance.
* Since there is only a single chip instance used today, there is no
* identifying handle information stored here.
*/
class WifiChip : public IWifiChip {
class WifiChip : public V1_1::IWifiChip {
public:
WifiChip(
ChipId chip_id,
@@ -125,6 +126,9 @@ class WifiChip : public IWifiChip {
getDebugHostWakeReasonStats_cb hidl_status_cb) override;
Return<void> enableDebugErrorAlerts(
bool enable, enableDebugErrorAlerts_cb hidl_status_cb) override;
Return<void> setTxPowerLimit(
int32_t powerInDbm, setTxPowerLimit_cb hidl_status_cb) override;
Return<void> resetTxPowerLimit(resetTxPowerLimit_cb hidl_status_cb) override;
private:
void invalidateAndRemoveAllIfaces();
@@ -176,6 +180,8 @@ class WifiChip : public IWifiChip {
std::pair<WifiStatus, WifiDebugHostWakeReasonStats>
getDebugHostWakeReasonStatsInternal();
WifiStatus enableDebugErrorAlertsInternal(bool enable);
WifiStatus setTxPowerLimitInternal(int32_t powerInDbm);
WifiStatus resetTxPowerLimitInternal();
WifiStatus handleChipConfiguration(ChipModeId mode_id);
WifiStatus registerDebugRingBufferCallback();
@@ -201,7 +207,7 @@ class WifiChip : public IWifiChip {
};
} // namespace implementation
} // namespace V1_0
} // namespace V1_1
} // namespace wifi
} // namespace hardware
} // namespace android

View File

@@ -20,7 +20,7 @@
namespace android {
namespace hardware {
namespace wifi {
namespace V1_0 {
namespace V1_1 {
namespace implementation {
class WifiFeatureFlags {
@@ -33,7 +33,7 @@ class WifiFeatureFlags {
};
} // namespace implementation
} // namespace V1_0
} // namespace V1_1
} // namespace wifi
} // namespace hardware
} // namespace android

View File

@@ -47,7 +47,7 @@ std::vector<char> makeCharVec(const std::string& str) {
namespace android {
namespace hardware {
namespace wifi {
namespace V1_0 {
namespace V1_1 {
namespace implementation {
namespace legacy_hal {
// Legacy HAL functions accept "C" style function pointers, so use global
@@ -1316,7 +1316,7 @@ void WifiLegacyHal::invalidate() {
} // namespace legacy_hal
} // namespace implementation
} // namespace V1_0
} // namespace V1_1
} // namespace wifi
} // namespace hardware
} // namespace android

View File

@@ -26,7 +26,7 @@
namespace android {
namespace hardware {
namespace wifi {
namespace V1_0 {
namespace V1_1 {
namespace implementation {
// This is in a separate namespace to prevent typename conflicts between
// the legacy HAL types and the HIDL interface types.
@@ -298,7 +298,7 @@ class WifiLegacyHal {
} // namespace legacy_hal
} // namespace implementation
} // namespace V1_0
} // namespace V1_1
} // namespace wifi
} // namespace hardware
} // namespace android

View File

@@ -20,7 +20,7 @@
namespace android {
namespace hardware {
namespace wifi {
namespace V1_0 {
namespace V1_1 {
namespace implementation {
namespace legacy_hal {
template <typename>
@@ -136,7 +136,7 @@ bool initHalFuncTableWithStubs(wifi_hal_fn* hal_fn) {
}
} // namespace legacy_hal
} // namespace implementation
} // namespace V1_0
} // namespace V1_1
} // namespace wifi
} // namespace hardware
} // namespace android

View File

@@ -20,7 +20,7 @@
namespace android {
namespace hardware {
namespace wifi {
namespace V1_0 {
namespace V1_1 {
namespace implementation {
namespace legacy_hal {
#include <hardware_legacy/wifi_hal.h>
@@ -28,7 +28,7 @@ namespace legacy_hal {
bool initHalFuncTableWithStubs(wifi_hal_fn* hal_fn);
} // namespace legacy_hal
} // namespace implementation
} // namespace V1_0
} // namespace V1_1
} // namespace wifi
} // namespace hardware
} // namespace android

View File

@@ -48,7 +48,7 @@ int convertIfaceTypeToFirmwareMode(IfaceType type) {
namespace android {
namespace hardware {
namespace wifi {
namespace V1_0 {
namespace V1_1 {
namespace implementation {
namespace mode_controller {
@@ -80,7 +80,7 @@ bool WifiModeController::deinitialize() {
}
} // namespace mode_controller
} // namespace implementation
} // namespace V1_0
} // namespace V1_1
} // namespace wifi
} // namespace hardware
} // namespace android

View File

@@ -24,9 +24,11 @@
namespace android {
namespace hardware {
namespace wifi {
namespace V1_0 {
namespace V1_1 {
namespace implementation {
namespace mode_controller {
using namespace android::hardware::wifi::V1_0;
/**
* Class that encapsulates all firmware mode configuration.
* This class will perform the necessary firmware reloads to put the chip in the
@@ -51,7 +53,7 @@ class WifiModeController {
} // namespace mode_controller
} // namespace implementation
} // namespace V1_0
} // namespace V1_1
} // namespace wifi
} // namespace hardware
} // namespace android

View File

@@ -24,7 +24,7 @@
namespace android {
namespace hardware {
namespace wifi {
namespace V1_0 {
namespace V1_1 {
namespace implementation {
using hidl_return_util::validateAndCall;
@@ -763,7 +763,7 @@ WifiStatus WifiNanIface::terminateDataPathRequestInternal(
}
} // namespace implementation
} // namespace V1_0
} // namespace V1_1
} // namespace wifi
} // namespace hardware
} // namespace android

View File

@@ -27,13 +27,14 @@
namespace android {
namespace hardware {
namespace wifi {
namespace V1_0 {
namespace V1_1 {
namespace implementation {
using namespace android::hardware::wifi::V1_0;
/**
* HIDL interface object used to control a NAN Iface instance.
*/
class WifiNanIface : public IWifiNanIface {
class WifiNanIface : public V1_0::IWifiNanIface {
public:
WifiNanIface(const std::string& ifname,
const std::weak_ptr<legacy_hal::WifiLegacyHal> legacy_hal);
@@ -132,7 +133,7 @@ class WifiNanIface : public IWifiNanIface {
};
} // namespace implementation
} // namespace V1_0
} // namespace V1_1
} // namespace wifi
} // namespace hardware
} // namespace android

View File

@@ -23,7 +23,7 @@
namespace android {
namespace hardware {
namespace wifi {
namespace V1_0 {
namespace V1_1 {
namespace implementation {
using hidl_return_util::validateAndCall;
@@ -64,7 +64,7 @@ std::pair<WifiStatus, IfaceType> WifiP2pIface::getTypeInternal() {
}
} // namespace implementation
} // namespace V1_0
} // namespace V1_1
} // namespace wifi
} // namespace hardware
} // namespace android

View File

@@ -25,13 +25,14 @@
namespace android {
namespace hardware {
namespace wifi {
namespace V1_0 {
namespace V1_1 {
namespace implementation {
using namespace android::hardware::wifi::V1_0;
/**
* HIDL interface object used to control a P2P Iface instance.
*/
class WifiP2pIface : public IWifiP2pIface {
class WifiP2pIface : public V1_0::IWifiP2pIface {
public:
WifiP2pIface(const std::string& ifname,
const std::weak_ptr<legacy_hal::WifiLegacyHal> legacy_hal);
@@ -56,7 +57,7 @@ class WifiP2pIface : public IWifiP2pIface {
};
} // namespace implementation
} // namespace V1_0
} // namespace V1_1
} // namespace wifi
} // namespace hardware
} // namespace android

View File

@@ -24,7 +24,7 @@
namespace android {
namespace hardware {
namespace wifi {
namespace V1_0 {
namespace V1_1 {
namespace implementation {
using hidl_return_util::validateAndCall;
@@ -291,7 +291,7 @@ WifiStatus WifiRttController::disableResponderInternal(uint32_t cmd_id) {
return createWifiStatusFromLegacyError(legacy_status);
}
} // namespace implementation
} // namespace V1_0
} // namespace V1_1
} // namespace wifi
} // namespace hardware
} // namespace android

View File

@@ -27,13 +27,13 @@
namespace android {
namespace hardware {
namespace wifi {
namespace V1_0 {
namespace V1_1 {
namespace implementation {
/**
* HIDL interface object used to control all RTT operations.
*/
class WifiRttController : public IWifiRttController {
class WifiRttController : public V1_0::IWifiRttController {
public:
WifiRttController(const sp<IWifiIface>& bound_iface,
const std::weak_ptr<legacy_hal::WifiLegacyHal> legacy_hal);
@@ -97,7 +97,7 @@ class WifiRttController : public IWifiRttController {
};
} // namespace implementation
} // namespace V1_0
} // namespace V1_1
} // namespace wifi
} // namespace hardware
} // namespace android

View File

@@ -24,7 +24,7 @@
namespace android {
namespace hardware {
namespace wifi {
namespace V1_0 {
namespace V1_1 {
namespace implementation {
using hidl_return_util::validateAndCall;
@@ -623,7 +623,7 @@ WifiStaIface::getDebugRxPacketFatesInternal() {
}
} // namespace implementation
} // namespace V1_0
} // namespace V1_1
} // namespace wifi
} // namespace hardware
} // namespace android

View File

@@ -27,13 +27,14 @@
namespace android {
namespace hardware {
namespace wifi {
namespace V1_0 {
namespace V1_1 {
namespace implementation {
using namespace android::hardware::wifi::V1_0;
/**
* HIDL interface object used to control a STA Iface instance.
*/
class WifiStaIface : public IWifiStaIface {
class WifiStaIface : public V1_0::IWifiStaIface {
public:
WifiStaIface(const std::string& ifname,
const std::weak_ptr<legacy_hal::WifiLegacyHal> legacy_hal);
@@ -159,7 +160,7 @@ class WifiStaIface : public IWifiStaIface {
};
} // namespace implementation
} // namespace V1_0
} // namespace V1_1
} // namespace wifi
} // namespace hardware
} // namespace android

View File

@@ -19,7 +19,7 @@
namespace android {
namespace hardware {
namespace wifi {
namespace V1_0 {
namespace V1_1 {
namespace implementation {
std::string legacyErrorToString(legacy_hal::wifi_error error) {
@@ -100,7 +100,7 @@ WifiStatus createWifiStatusFromLegacyError(legacy_hal::wifi_error error) {
}
} // namespace implementation
} // namespace V1_0
} // namespace V1_1
} // namespace wifi
} // namespace hardware
} // namespace android

View File

@@ -24,8 +24,9 @@
namespace android {
namespace hardware {
namespace wifi {
namespace V1_0 {
namespace V1_1 {
namespace implementation {
using namespace android::hardware::wifi::V1_0;
std::string legacyErrorToString(legacy_hal::wifi_error error);
WifiStatus createWifiStatus(WifiStatusCode code,
@@ -36,7 +37,7 @@ WifiStatus createWifiStatusFromLegacyError(legacy_hal::wifi_error error,
WifiStatus createWifiStatusFromLegacyError(legacy_hal::wifi_error error);
} // namespace implementation
} // namespace V1_0
} // namespace V1_1
} // namespace wifi
} // namespace hardware
} // namespace android

View File

@@ -0,0 +1,39 @@
//
// Copyright (C) 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.
//
cc_test {
name: "VtsHalWifiV1_1TargetTest",
defaults: ["hidl_defaults"],
srcs: [
"VtsHalWifiV1_1TargetTest.cpp",
"wifi_chip_hidl_test.cpp"],
shared_libs: [
"libbase",
"liblog",
"libcutils",
"libhidlbase",
"libhidltransport",
"libnativehelper",
"libutils",
"android.hardware.wifi@1.0",
"android.hardware.wifi@1.1",
],
static_libs: ["VtsHalWifiV1_0TargetTestUtil", "VtsHalHidlTargetTestBase"],
cflags: [
"-O0",
"-g",
],
}

View File

@@ -0,0 +1,29 @@
/*
* Copyright (C) 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.
*/
#include <android-base/logging.h>
#include <VtsHalHidlTargetTestBase.h>
#include "wifi_hidl_test_utils.h"
int main(int argc, char** argv) {
::testing::AddGlobalTestEnvironment(new WifiHidlEnvironment);
::testing::InitGoogleTest(&argc, argv);
int status = RUN_ALL_TESTS();
LOG(INFO) << "Test result = " << status;
return status;
}

View File

@@ -0,0 +1,94 @@
/*
* Copyright (C) 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.
*/
#include <android-base/logging.h>
#include <android/hardware/wifi/1.1/IWifi.h>
#include <android/hardware/wifi/1.1/IWifiChip.h>
#include <VtsHalHidlTargetTestBase.h>
#include "wifi_hidl_call_util.h"
#include "wifi_hidl_test_utils.h"
using ::android::sp;
using ::android::hardware::hidl_string;
using ::android::hardware::hidl_vec;
using ::android::hardware::wifi::V1_0::IfaceType;
using ::android::hardware::wifi::V1_0::ChipId;
using ::android::hardware::wifi::V1_0::ChipModeId;
using ::android::hardware::wifi::V1_0::WifiStatus;
using ::android::hardware::wifi::V1_0::WifiStatusCode;
using ::android::hardware::wifi::V1_1::IWifi;
using ::android::hardware::wifi::V1_1::IWifiChip;
using ::android::hardware::wifi::V1_0::IWifiStaIface;
namespace {
constexpr int32_t kFakePowerInDbm = -56;
}; //namespace
/**
* Fixture to use for all Wifi chip HIDL interface tests.
*/
class WifiChipHidlTest : public ::testing::VtsHalHidlTargetTestBase {
public:
virtual void SetUp() override {
wifi_chip_ = IWifiChip::castFrom(getWifiChip());
ASSERT_NE(nullptr, wifi_chip_.get());
}
virtual void TearDown() override { stopWifi(); }
protected:
uint32_t configureChipForStaIfaceAndGetCapabilities() {
ChipModeId mode_id;
EXPECT_TRUE(configureChipToSupportIfaceType(
wifi_chip_, IfaceType::STA, &mode_id));
const auto& status_and_caps = HIDL_INVOKE(wifi_chip_, getCapabilities);
EXPECT_EQ(WifiStatusCode::SUCCESS, status_and_caps.first.code);
return status_and_caps.second;
}
sp<IWifiChip> wifi_chip_;
};
/*
* SetTxPowerLimit
*/
TEST_F(WifiChipHidlTest, SetTxPowerLimit) {
uint32_t caps = configureChipForStaIfaceAndGetCapabilities();
const auto& status =
HIDL_INVOKE(wifi_chip_, setTxPowerLimit, kFakePowerInDbm);
if (caps & IWifiChip::ChipCapabilityMask::SET_TX_POWER_LIMIT) {
EXPECT_EQ(WifiStatusCode::SUCCESS, status.code);
} else {
EXPECT_EQ(WifiStatusCode::ERROR_NOT_SUPPORTED, status.code);
}
}
/*
* SetTxPowerLimit
*/
TEST_F(WifiChipHidlTest, ResetTxPowerLimit) {
uint32_t caps = configureChipForStaIfaceAndGetCapabilities();
const auto& status =
HIDL_INVOKE(wifi_chip_, resetTxPowerLimit);
if (caps & IWifiChip::ChipCapabilityMask::SET_TX_POWER_LIMIT) {
EXPECT_EQ(WifiStatusCode::SUCCESS, status.code);
} else {
EXPECT_EQ(WifiStatusCode::ERROR_NOT_SUPPORTED, status.code);
}
}

View File

@@ -2,6 +2,8 @@
subdirs = [
"1.0",
"1.0/vts/functional",
"1.1",
"1.1/vts/functional",
"offload/1.0",
"offload/1.0/vts/functional",
"supplicant/1.0",