From 08df76ec0de84d9ea1339e7165c1a12b1dc152e5 Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Mon, 17 Jul 2017 13:10:01 -0700 Subject: [PATCH] wifi: Add the missing RTT capabilities These feature flags are defined in the legacy HAL, but were not exposed in the HIDL interface. Updated the hash in current.txt using 'hidl-gen -L hash -r android.hardware.wifi@1.1:hardware/interfaces -r android.hardware:hardware/interfaces -r android.hidl:system/libhidl/transport android.hardware.wifi@1.1::IWifiChip' Bug: 63545934 Test: Manual testing Change-Id: Ia196e0fc1c5e305210ec95eb8a54b1a1204ebf20 --- current.txt | 2 +- wifi/1.1/IWifiChip.hal | 10 +++++++++- wifi/1.1/default/hidl_struct_util.cpp | 8 +++++++- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/current.txt b/current.txt index d93352a608..edfcf91267 100644 --- a/current.txt +++ b/current.txt @@ -219,4 +219,4 @@ bb7c96762d0aa3ddb874c8815bacdd3cbc8fb87ea2f82b928bc29e24a3593055 android.hardwar c3354ab0d381a236c12dc486ad4b6bec28c979d26748b4661f12ede36f392808 android.hardware.wifi.offload@1.0::IOffloadCallback b18caefefcc765092412285d776234fcf213b73bdf07ae1b67a5f71b2d2464e3 android.hardware.wifi.offload@1.0::types c26473e2e4a00af43e28a0ddf9002e5062a7d0940429e5efb6e5513a8abcb75c android.hardware.wifi@1.1::IWifi -48adfb7259e3816a82a4c394ffaf56fb14628a542295b7a51f1311392d3f8769 android.hardware.wifi@1.1::IWifiChip +bfcf4856c7b6c66ebc56785ed3e5d181b7be859c2add672497a843b024518737 android.hardware.wifi@1.1::IWifiChip diff --git a/wifi/1.1/IWifiChip.hal b/wifi/1.1/IWifiChip.hal index 7275412802..50cd02ddeb 100644 --- a/wifi/1.1/IWifiChip.hal +++ b/wifi/1.1/IWifiChip.hal @@ -32,7 +32,15 @@ interface IWifiChip extends @1.0::IWifiChip { /** * Set/Reset Tx Power limits. */ - SET_TX_POWER_LIMIT = 1 << 8 + SET_TX_POWER_LIMIT = 1 << 8, + /** + * Device to Device RTT. + */ + D2D_RTT = 1 << 9, + /** + * Device to AP RTT. + */ + D2AP_RTT = 1 << 10 }; /** diff --git a/wifi/1.1/default/hidl_struct_util.cpp b/wifi/1.1/default/hidl_struct_util.cpp index a413cbb39b..6b93b9ef15 100644 --- a/wifi/1.1/default/hidl_struct_util.cpp +++ b/wifi/1.1/default/hidl_struct_util.cpp @@ -75,6 +75,10 @@ V1_1::IWifiChip::ChipCapabilityMask convertLegacyFeatureToHidlChipCapability( switch (feature) { case WIFI_FEATURE_SET_TX_POWER_LIMIT: return HidlChipCaps::SET_TX_POWER_LIMIT; + case WIFI_FEATURE_D2D_RTT: + return HidlChipCaps::D2D_RTT; + case WIFI_FEATURE_D2AP_RTT: + return HidlChipCaps::D2AP_RTT; }; CHECK(false) << "Unknown legacy feature: " << feature; return {}; @@ -133,7 +137,9 @@ bool convertLegacyFeaturesToHidlChipCapabilities( *hidl_caps |= convertLegacyLoggerFeatureToHidlChipCapability(feature); } } - for (const auto feature : {WIFI_FEATURE_SET_TX_POWER_LIMIT}) { + for (const auto feature : {WIFI_FEATURE_SET_TX_POWER_LIMIT, + WIFI_FEATURE_D2D_RTT, + WIFI_FEATURE_D2AP_RTT}) { if (feature & legacy_feature_set) { *hidl_caps |= convertLegacyFeatureToHidlChipCapability(feature); }