diff options
-rw-r--r-- | wifi/1.0/vts/functional/Android.bp | 4 | ||||
-rw-r--r-- | wifi/1.1/default/Android.mk (renamed from wifi/1.0/default/Android.mk) | 1 | ||||
-rw-r--r-- | wifi/1.1/default/THREADING.README (renamed from wifi/1.0/default/THREADING.README) | 0 | ||||
-rw-r--r-- | wifi/1.1/default/android.hardware.wifi@1.0-service.rc (renamed from wifi/1.0/default/android.hardware.wifi@1.0-service.rc) | 0 | ||||
-rw-r--r-- | wifi/1.1/default/hidl_callback_util.h (renamed from wifi/1.0/default/hidl_callback_util.h) | 4 | ||||
-rw-r--r-- | wifi/1.1/default/hidl_return_util.h (renamed from wifi/1.0/default/hidl_return_util.h) | 5 | ||||
-rw-r--r-- | wifi/1.1/default/hidl_struct_util.cpp (renamed from wifi/1.0/default/hidl_struct_util.cpp) | 4 | ||||
-rw-r--r-- | wifi/1.1/default/hidl_struct_util.h (renamed from wifi/1.0/default/hidl_struct_util.h) | 5 | ||||
-rw-r--r-- | wifi/1.1/default/hidl_sync_util.cpp (renamed from wifi/1.0/default/hidl_sync_util.cpp) | 4 | ||||
-rw-r--r-- | wifi/1.1/default/hidl_sync_util.h (renamed from wifi/1.0/default/hidl_sync_util.h) | 4 | ||||
-rw-r--r-- | wifi/1.1/default/service.cpp (renamed from wifi/1.0/default/service.cpp) | 4 | ||||
-rw-r--r-- | wifi/1.1/default/wifi.cpp (renamed from wifi/1.0/default/wifi.cpp) | 4 | ||||
-rw-r--r-- | wifi/1.1/default/wifi.h (renamed from wifi/1.0/default/wifi.h) | 9 | ||||
-rw-r--r-- | wifi/1.1/default/wifi_ap_iface.cpp (renamed from wifi/1.0/default/wifi_ap_iface.cpp) | 4 | ||||
-rw-r--r-- | wifi/1.1/default/wifi_ap_iface.h (renamed from wifi/1.0/default/wifi_ap_iface.h) | 7 | ||||
-rw-r--r-- | wifi/1.1/default/wifi_chip.cpp (renamed from wifi/1.0/default/wifi_chip.cpp) | 33 | ||||
-rw-r--r-- | wifi/1.1/default/wifi_chip.h (renamed from wifi/1.0/default/wifi_chip.h) | 14 | ||||
-rw-r--r-- | wifi/1.1/default/wifi_feature_flags.h (renamed from wifi/1.0/default/wifi_feature_flags.h) | 4 | ||||
-rw-r--r-- | wifi/1.1/default/wifi_legacy_hal.cpp (renamed from wifi/1.0/default/wifi_legacy_hal.cpp) | 4 | ||||
-rw-r--r-- | wifi/1.1/default/wifi_legacy_hal.h (renamed from wifi/1.0/default/wifi_legacy_hal.h) | 4 | ||||
-rw-r--r-- | wifi/1.1/default/wifi_legacy_hal_stubs.cpp (renamed from wifi/1.0/default/wifi_legacy_hal_stubs.cpp) | 4 | ||||
-rw-r--r-- | wifi/1.1/default/wifi_legacy_hal_stubs.h (renamed from wifi/1.0/default/wifi_legacy_hal_stubs.h) | 4 | ||||
-rw-r--r-- | wifi/1.1/default/wifi_mode_controller.cpp (renamed from wifi/1.0/default/wifi_mode_controller.cpp) | 4 | ||||
-rw-r--r-- | wifi/1.1/default/wifi_mode_controller.h (renamed from wifi/1.0/default/wifi_mode_controller.h) | 6 | ||||
-rw-r--r-- | wifi/1.1/default/wifi_nan_iface.cpp (renamed from wifi/1.0/default/wifi_nan_iface.cpp) | 4 | ||||
-rw-r--r-- | wifi/1.1/default/wifi_nan_iface.h (renamed from wifi/1.0/default/wifi_nan_iface.h) | 7 | ||||
-rw-r--r-- | wifi/1.1/default/wifi_p2p_iface.cpp (renamed from wifi/1.0/default/wifi_p2p_iface.cpp) | 4 | ||||
-rw-r--r-- | wifi/1.1/default/wifi_p2p_iface.h (renamed from wifi/1.0/default/wifi_p2p_iface.h) | 7 | ||||
-rw-r--r-- | wifi/1.1/default/wifi_rtt_controller.cpp (renamed from wifi/1.0/default/wifi_rtt_controller.cpp) | 4 | ||||
-rw-r--r-- | wifi/1.1/default/wifi_rtt_controller.h (renamed from wifi/1.0/default/wifi_rtt_controller.h) | 6 | ||||
-rw-r--r-- | wifi/1.1/default/wifi_sta_iface.cpp (renamed from wifi/1.0/default/wifi_sta_iface.cpp) | 4 | ||||
-rw-r--r-- | wifi/1.1/default/wifi_sta_iface.h (renamed from wifi/1.0/default/wifi_sta_iface.h) | 7 | ||||
-rw-r--r-- | wifi/1.1/default/wifi_status_util.cpp (renamed from wifi/1.0/default/wifi_status_util.cpp) | 4 | ||||
-rw-r--r-- | wifi/1.1/default/wifi_status_util.h (renamed from wifi/1.0/default/wifi_status_util.h) | 5 | ||||
-rw-r--r-- | wifi/1.1/vts/functional/Android.bp | 39 | ||||
-rw-r--r-- | wifi/1.1/vts/functional/VtsHalWifiV1_1TargetTest.cpp | 29 | ||||
-rw-r--r-- | wifi/1.1/vts/functional/wifi_chip_hidl_test.cpp | 94 | ||||
-rw-r--r-- | wifi/Android.bp | 1 |
38 files changed, 281 insertions, 70 deletions
diff --git a/wifi/1.0/vts/functional/Android.bp b/wifi/1.0/vts/functional/Android.bp index b454a06d8..2d6679f77 100644 --- a/wifi/1.0/vts/functional/Android.bp +++ b/wifi/1.0/vts/functional/Android.bp @@ -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", diff --git a/wifi/1.0/default/Android.mk b/wifi/1.1/default/Android.mk index fe33e0867..575842230 100644 --- a/wifi/1.0/default/Android.mk +++ b/wifi/1.1/default/Android.mk @@ -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 \ diff --git a/wifi/1.0/default/THREADING.README b/wifi/1.1/default/THREADING.README index 8366ca020..8366ca020 100644 --- a/wifi/1.0/default/THREADING.README +++ b/wifi/1.1/default/THREADING.README diff --git a/wifi/1.0/default/android.hardware.wifi@1.0-service.rc b/wifi/1.1/default/android.hardware.wifi@1.0-service.rc index 696b1f933..696b1f933 100644 --- a/wifi/1.0/default/android.hardware.wifi@1.0-service.rc +++ b/wifi/1.1/default/android.hardware.wifi@1.0-service.rc diff --git a/wifi/1.0/default/hidl_callback_util.h b/wifi/1.1/default/hidl_callback_util.h index b7100c8ac..fb1362225 100644 --- a/wifi/1.0/default/hidl_callback_util.h +++ b/wifi/1.1/default/hidl_callback_util.h @@ -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 diff --git a/wifi/1.0/default/hidl_return_util.h b/wifi/1.1/default/hidl_return_util.h index 3f6364be3..2f95c23d7 100644 --- a/wifi/1.0/default/hidl_return_util.h +++ b/wifi/1.1/default/hidl_return_util.h @@ -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 diff --git a/wifi/1.0/default/hidl_struct_util.cpp b/wifi/1.1/default/hidl_struct_util.cpp index fa0279bea..e40a7d8fd 100644 --- a/wifi/1.0/default/hidl_struct_util.cpp +++ b/wifi/1.1/default/hidl_struct_util.cpp @@ -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 diff --git a/wifi/1.0/default/hidl_struct_util.h b/wifi/1.1/default/hidl_struct_util.h index c04d92fbd..a04f6363d 100644 --- a/wifi/1.0/default/hidl_struct_util.h +++ b/wifi/1.1/default/hidl_struct_util.h @@ -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 diff --git a/wifi/1.0/default/hidl_sync_util.cpp b/wifi/1.1/default/hidl_sync_util.cpp index 7d47f2f7b..ba18e344a 100644 --- a/wifi/1.0/default/hidl_sync_util.cpp +++ b/wifi/1.1/default/hidl_sync_util.cpp @@ -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 diff --git a/wifi/1.0/default/hidl_sync_util.h b/wifi/1.1/default/hidl_sync_util.h index 6631e55bc..0e882df50 100644 --- a/wifi/1.0/default/hidl_sync_util.h +++ b/wifi/1.1/default/hidl_sync_util.h @@ -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 diff --git a/wifi/1.0/default/service.cpp b/wifi/1.1/default/service.cpp index 059304e33..b3fcd50e5 100644 --- a/wifi/1.0/default/service.cpp +++ b/wifi/1.1/default/service.cpp @@ -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"; diff --git a/wifi/1.0/default/wifi.cpp b/wifi/1.1/default/wifi.cpp index b48844ef2..4ed1f555e 100644 --- a/wifi/1.0/default/wifi.cpp +++ b/wifi/1.1/default/wifi.cpp @@ -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 diff --git a/wifi/1.0/default/wifi.h b/wifi/1.1/default/wifi.h index c6fa84cb3..1ade2d8b9 100644 --- a/wifi/1.0/default/wifi.h +++ b/wifi/1.1/default/wifi.h @@ -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 diff --git a/wifi/1.0/default/wifi_ap_iface.cpp b/wifi/1.1/default/wifi_ap_iface.cpp index e2beec2c6..150a6cc06 100644 --- a/wifi/1.0/default/wifi_ap_iface.cpp +++ b/wifi/1.1/default/wifi_ap_iface.cpp @@ -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 diff --git a/wifi/1.0/default/wifi_ap_iface.h b/wifi/1.1/default/wifi_ap_iface.h index efc168a08..608fe6b5a 100644 --- a/wifi/1.0/default/wifi_ap_iface.h +++ b/wifi/1.1/default/wifi_ap_iface.h @@ -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 diff --git a/wifi/1.0/default/wifi_chip.cpp b/wifi/1.1/default/wifi_chip.cpp index 770c83f18..87985c067 100644 --- a/wifi/1.0/default/wifi_chip.cpp +++ b/wifi/1.1/default/wifi_chip.cpp @@ -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 diff --git a/wifi/1.0/default/wifi_chip.h b/wifi/1.1/default/wifi_chip.h index 406938c36..b7dde5013 100644 --- a/wifi/1.0/default/wifi_chip.h +++ b/wifi/1.1/default/wifi_chip.h @@ -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 diff --git a/wifi/1.0/default/wifi_feature_flags.h b/wifi/1.1/default/wifi_feature_flags.h index 3502fbdeb..5939ffbef 100644 --- a/wifi/1.0/default/wifi_feature_flags.h +++ b/wifi/1.1/default/wifi_feature_flags.h @@ -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 diff --git a/wifi/1.0/default/wifi_legacy_hal.cpp b/wifi/1.1/default/wifi_legacy_hal.cpp index 3f2610456..c1e1cd3a4 100644 --- a/wifi/1.0/default/wifi_legacy_hal.cpp +++ b/wifi/1.1/default/wifi_legacy_hal.cpp @@ -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 diff --git a/wifi/1.0/default/wifi_legacy_hal.h b/wifi/1.1/default/wifi_legacy_hal.h index 962d15314..fef7999c0 100644 --- a/wifi/1.0/default/wifi_legacy_hal.h +++ b/wifi/1.1/default/wifi_legacy_hal.h @@ -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 diff --git a/wifi/1.0/default/wifi_legacy_hal_stubs.cpp b/wifi/1.1/default/wifi_legacy_hal_stubs.cpp index 2973430db..a5a5d4859 100644 --- a/wifi/1.0/default/wifi_legacy_hal_stubs.cpp +++ b/wifi/1.1/default/wifi_legacy_hal_stubs.cpp @@ -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 diff --git a/wifi/1.0/default/wifi_legacy_hal_stubs.h b/wifi/1.1/default/wifi_legacy_hal_stubs.h index 1cb5f9d52..bfc4c9b86 100644 --- a/wifi/1.0/default/wifi_legacy_hal_stubs.h +++ b/wifi/1.1/default/wifi_legacy_hal_stubs.h @@ -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 diff --git a/wifi/1.0/default/wifi_mode_controller.cpp b/wifi/1.1/default/wifi_mode_controller.cpp index 7e82d4caf..b8a44c253 100644 --- a/wifi/1.0/default/wifi_mode_controller.cpp +++ b/wifi/1.1/default/wifi_mode_controller.cpp @@ -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 diff --git a/wifi/1.0/default/wifi_mode_controller.h b/wifi/1.1/default/wifi_mode_controller.h index a4147a905..69845095b 100644 --- a/wifi/1.0/default/wifi_mode_controller.h +++ b/wifi/1.1/default/wifi_mode_controller.h @@ -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 diff --git a/wifi/1.0/default/wifi_nan_iface.cpp b/wifi/1.1/default/wifi_nan_iface.cpp index ee324ced1..a111d0610 100644 --- a/wifi/1.0/default/wifi_nan_iface.cpp +++ b/wifi/1.1/default/wifi_nan_iface.cpp @@ -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 diff --git a/wifi/1.0/default/wifi_nan_iface.h b/wifi/1.1/default/wifi_nan_iface.h index e1edd2924..260d8ab4e 100644 --- a/wifi/1.0/default/wifi_nan_iface.h +++ b/wifi/1.1/default/wifi_nan_iface.h @@ -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 diff --git a/wifi/1.0/default/wifi_p2p_iface.cpp b/wifi/1.1/default/wifi_p2p_iface.cpp index 0d055f131..78e08db97 100644 --- a/wifi/1.0/default/wifi_p2p_iface.cpp +++ b/wifi/1.1/default/wifi_p2p_iface.cpp @@ -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 diff --git a/wifi/1.0/default/wifi_p2p_iface.h b/wifi/1.1/default/wifi_p2p_iface.h index d2982db8c..f563a3d31 100644 --- a/wifi/1.0/default/wifi_p2p_iface.h +++ b/wifi/1.1/default/wifi_p2p_iface.h @@ -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 diff --git a/wifi/1.0/default/wifi_rtt_controller.cpp b/wifi/1.1/default/wifi_rtt_controller.cpp index f18feaea3..9ef702da1 100644 --- a/wifi/1.0/default/wifi_rtt_controller.cpp +++ b/wifi/1.1/default/wifi_rtt_controller.cpp @@ -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 diff --git a/wifi/1.0/default/wifi_rtt_controller.h b/wifi/1.1/default/wifi_rtt_controller.h index 7c0abcaf8..543788574 100644 --- a/wifi/1.0/default/wifi_rtt_controller.h +++ b/wifi/1.1/default/wifi_rtt_controller.h @@ -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 diff --git a/wifi/1.0/default/wifi_sta_iface.cpp b/wifi/1.1/default/wifi_sta_iface.cpp index 3c5204808..28f3f02a2 100644 --- a/wifi/1.0/default/wifi_sta_iface.cpp +++ b/wifi/1.1/default/wifi_sta_iface.cpp @@ -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 diff --git a/wifi/1.0/default/wifi_sta_iface.h b/wifi/1.1/default/wifi_sta_iface.h index 08faa2f1b..587a5de7b 100644 --- a/wifi/1.0/default/wifi_sta_iface.h +++ b/wifi/1.1/default/wifi_sta_iface.h @@ -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 diff --git a/wifi/1.0/default/wifi_status_util.cpp b/wifi/1.1/default/wifi_status_util.cpp index c2d0758cb..3a85e0998 100644 --- a/wifi/1.0/default/wifi_status_util.cpp +++ b/wifi/1.1/default/wifi_status_util.cpp @@ -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 diff --git a/wifi/1.0/default/wifi_status_util.h b/wifi/1.1/default/wifi_status_util.h index 7f557e012..cc93d66ca 100644 --- a/wifi/1.0/default/wifi_status_util.h +++ b/wifi/1.1/default/wifi_status_util.h @@ -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 diff --git a/wifi/1.1/vts/functional/Android.bp b/wifi/1.1/vts/functional/Android.bp new file mode 100644 index 000000000..6b0baf785 --- /dev/null +++ b/wifi/1.1/vts/functional/Android.bp @@ -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", + ], +} diff --git a/wifi/1.1/vts/functional/VtsHalWifiV1_1TargetTest.cpp b/wifi/1.1/vts/functional/VtsHalWifiV1_1TargetTest.cpp new file mode 100644 index 000000000..160fcd234 --- /dev/null +++ b/wifi/1.1/vts/functional/VtsHalWifiV1_1TargetTest.cpp @@ -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; +} diff --git a/wifi/1.1/vts/functional/wifi_chip_hidl_test.cpp b/wifi/1.1/vts/functional/wifi_chip_hidl_test.cpp new file mode 100644 index 000000000..839b6c434 --- /dev/null +++ b/wifi/1.1/vts/functional/wifi_chip_hidl_test.cpp @@ -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); + } +} diff --git a/wifi/Android.bp b/wifi/Android.bp index 230e720f0..b4ab98ffe 100644 --- a/wifi/Android.bp +++ b/wifi/Android.bp @@ -3,6 +3,7 @@ subdirs = [ "1.0", "1.0/vts/functional", "1.1", + "1.1/vts/functional", "offload/1.0", "offload/1.0/vts/functional", "supplicant/1.0", |