Merge "Revert "composer: adds BufferAhead for the LayerCommand.aidl""
diff --git a/audio/common/all-versions/default/Android.bp b/audio/common/all-versions/default/Android.bp
index 8f55744..a25565d 100644
--- a/audio/common/all-versions/default/Android.bp
+++ b/audio/common/all-versions/default/Android.bp
@@ -157,6 +157,28 @@
],
}
+cc_library {
+ name: "android.hardware.audio.common@7.1-util",
+ defaults: ["android.hardware.audio.common-util_default"],
+ srcs: [
+ "7.0/HidlUtils.cpp",
+ "HidlUtilsCommon.cpp",
+ "UuidUtils.cpp",
+ ],
+ shared_libs: [
+ "android.hardware.audio.common@7.0",
+ "android.hardware.audio.common@7.1-enums",
+ "libbase",
+ ],
+ cflags: [
+ "-DMAJOR_VERSION=7",
+ "-DMINOR_VERSION=1",
+ "-DCOMMON_TYPES_MINOR_VERSION=0",
+ "-DCORE_TYPES_MINOR_VERSION=0",
+ "-include common/all-versions/VersionMacro.h",
+ ],
+}
+
// Note: this isn't a VTS test, but rather a unit test
// to verify correctness of conversion utilities.
cc_test {
@@ -214,3 +236,35 @@
test_suites: ["device-tests"],
}
+
+cc_test {
+ name: "android.hardware.audio.common@7.1-util_tests",
+ defaults: ["android.hardware.audio.common-util_default"],
+
+ srcs: ["tests/hidlutils_tests.cpp"],
+
+ // Use static linking to allow running in presubmit on
+ // targets that don't have HAL V7.1.
+ static_libs: [
+ "android.hardware.audio.common@7.1-enums",
+ "android.hardware.audio.common@7.1-util",
+ "android.hardware.audio.common@7.0",
+ ],
+
+ shared_libs: [
+ "libbase",
+ "libxml2",
+ ],
+
+ cflags: [
+ "-Werror",
+ "-Wall",
+ "-DMAJOR_VERSION=7",
+ "-DMINOR_VERSION=1",
+ "-DCOMMON_TYPES_MINOR_VERSION=0",
+ "-DCORE_TYPES_MINOR_VERSION=0",
+ "-include common/all-versions/VersionMacro.h",
+ ],
+
+ test_suites: ["device-tests"],
+}
diff --git a/audio/common/all-versions/default/HidlUtilsCommon.cpp b/audio/common/all-versions/default/HidlUtilsCommon.cpp
index d2da193..bc3d870 100644
--- a/audio/common/all-versions/default/HidlUtilsCommon.cpp
+++ b/audio/common/all-versions/default/HidlUtilsCommon.cpp
@@ -20,7 +20,7 @@
namespace hardware {
namespace audio {
namespace common {
-namespace CPP_VERSION {
+namespace COMMON_TYPES_CPP_VERSION {
namespace implementation {
status_t HidlUtils::audioPortConfigsFromHal(unsigned int numHalConfigs,
@@ -51,7 +51,7 @@
}
} // namespace implementation
-} // namespace CPP_VERSION
+} // namespace COMMON_TYPES_CPP_VERSION
} // namespace common
} // namespace audio
} // namespace hardware
diff --git a/audio/common/all-versions/default/TEST_MAPPING b/audio/common/all-versions/default/TEST_MAPPING
index c965113..780beea 100644
--- a/audio/common/all-versions/default/TEST_MAPPING
+++ b/audio/common/all-versions/default/TEST_MAPPING
@@ -5,6 +5,9 @@
},
{
"name": "android.hardware.audio.common@7.0-util_tests"
+ },
+ {
+ "name": "android.hardware.audio.common@7.1-util_tests"
}
]
}
diff --git a/audio/common/all-versions/default/tests/hidlutils_tests.cpp b/audio/common/all-versions/default/tests/hidlutils_tests.cpp
index 2749cce..ec16b02 100644
--- a/audio/common/all-versions/default/tests/hidlutils_tests.cpp
+++ b/audio/common/all-versions/default/tests/hidlutils_tests.cpp
@@ -23,7 +23,7 @@
#include <log/log.h>
#include <HidlUtils.h>
-#include <android_audio_policy_configuration_V7_0-enums.h>
+#include PATH(APM_XSD_ENUMS_H_FILENAME)
#include <system/audio.h>
#include <xsdc/XsdcSupport.h>
@@ -32,7 +32,7 @@
using namespace ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION;
using ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION::implementation::HidlUtils;
namespace xsd {
-using namespace ::android::audio::policy::configuration::V7_0;
+using namespace ::android::audio::policy::configuration::CPP_VERSION;
}
static constexpr audio_channel_mask_t kInvalidHalChannelMask = AUDIO_CHANNEL_INVALID;
diff --git a/audio/core/all-versions/default/Android.bp b/audio/core/all-versions/default/Android.bp
index df688fd..3536561 100644
--- a/audio/core/all-versions/default/Android.bp
+++ b/audio/core/all-versions/default/Android.bp
@@ -168,10 +168,10 @@
shared_libs: [
"android.hardware.audio@7.0",
"android.hardware.audio@7.1",
- "android.hardware.audio@7.0-util",
+ "android.hardware.audio@7.1-util",
"android.hardware.audio.common@7.0",
"android.hardware.audio.common@7.1-enums",
- "android.hardware.audio.common@7.0-util",
+ "android.hardware.audio.common@7.1-util",
"libbase",
],
cflags: [
diff --git a/audio/core/all-versions/default/TEST_MAPPING b/audio/core/all-versions/default/TEST_MAPPING
index 1e29440..07e98f3 100644
--- a/audio/core/all-versions/default/TEST_MAPPING
+++ b/audio/core/all-versions/default/TEST_MAPPING
@@ -4,6 +4,9 @@
"name": "android.hardware.audio@7.0-util_tests"
},
{
+ "name": "android.hardware.audio@7.1-util_tests"
+ },
+ {
"name": "HalAudioV6_0GeneratorTest"
},
{
diff --git a/audio/core/all-versions/default/util/Android.bp b/audio/core/all-versions/default/util/Android.bp
index 7caf18d..b96f2d2 100644
--- a/audio/core/all-versions/default/util/Android.bp
+++ b/audio/core/all-versions/default/util/Android.bp
@@ -112,6 +112,25 @@
],
}
+cc_library {
+ name: "android.hardware.audio@7.1-util",
+ defaults: ["android.hardware.audio-util_default"],
+ shared_libs: [
+ "android.hardware.audio.common@7.0",
+ "android.hardware.audio.common@7.1-enums",
+ "android.hardware.audio.common@7.1-util",
+ "android.hardware.audio@7.1",
+ "libbase",
+ ],
+ cflags: [
+ "-DMAJOR_VERSION=7",
+ "-DMINOR_VERSION=1",
+ "-DCOMMON_TYPES_MINOR_VERSION=0",
+ "-DCORE_TYPES_MINOR_VERSION=0",
+ "-include common/all-versions/VersionMacro.h",
+ ],
+}
+
// Note: this isn't a VTS test, but rather a unit test
// to verify correctness of conversion utilities.
cc_test {
@@ -145,3 +164,37 @@
test_suites: ["device-tests"],
}
+
+cc_test {
+ name: "android.hardware.audio@7.1-util_tests",
+ defaults: ["android.hardware.audio-util_default"],
+
+ srcs: ["tests/coreutils_tests.cpp"],
+
+ // Use static linking to allow running in presubmit on
+ // targets that don't have HAL V7.1.
+ static_libs: [
+ "android.hardware.audio.common@7.0",
+ "android.hardware.audio.common@7.1-enums",
+ "android.hardware.audio.common@7.1-util",
+ "android.hardware.audio@7.1",
+ "android.hardware.audio@7.1-util",
+ ],
+
+ shared_libs: [
+ "libbase",
+ "libxml2",
+ ],
+
+ cflags: [
+ "-Werror",
+ "-Wall",
+ "-DMAJOR_VERSION=7",
+ "-DMINOR_VERSION=1",
+ "-DCOMMON_TYPES_MINOR_VERSION=0",
+ "-DCORE_TYPES_MINOR_VERSION=0",
+ "-include common/all-versions/VersionMacro.h",
+ ],
+
+ test_suites: ["device-tests"],
+}
diff --git a/audio/core/all-versions/default/util/tests/coreutils_tests.cpp b/audio/core/all-versions/default/util/tests/coreutils_tests.cpp
index 3976b08..0e15960 100644
--- a/audio/core/all-versions/default/util/tests/coreutils_tests.cpp
+++ b/audio/core/all-versions/default/util/tests/coreutils_tests.cpp
@@ -22,18 +22,18 @@
#define LOG_TAG "CoreUtils_Test"
#include <log/log.h>
-#include <android_audio_policy_configuration_V7_0-enums.h>
+#include PATH(APM_XSD_ENUMS_H_FILENAME)
#include <system/audio.h>
#include <util/CoreUtils.h>
#include <xsdc/XsdcSupport.h>
using namespace android;
using namespace ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION;
-using namespace ::android::hardware::audio::CPP_VERSION;
+using namespace ::android::hardware::audio::CORE_TYPES_CPP_VERSION;
using ::android::hardware::hidl_vec;
-using ::android::hardware::audio::CPP_VERSION::implementation::CoreUtils;
+using ::android::hardware::audio::CORE_TYPES_CPP_VERSION::implementation::CoreUtils;
namespace xsd {
-using namespace ::android::audio::policy::configuration::V7_0;
+using namespace ::android::audio::policy::configuration::CPP_VERSION;
}
static constexpr audio_channel_mask_t kInvalidHalChannelMask = AUDIO_CHANNEL_INVALID;
diff --git a/audio/core/all-versions/vts/functional/7.1/AudioPrimaryHidlHalTest.cpp b/audio/core/all-versions/vts/functional/7.1/AudioPrimaryHidlHalTest.cpp
index 6b9b32d..09b25d9 100644
--- a/audio/core/all-versions/vts/functional/7.1/AudioPrimaryHidlHalTest.cpp
+++ b/audio/core/all-versions/vts/functional/7.1/AudioPrimaryHidlHalTest.cpp
@@ -47,6 +47,7 @@
// initial state. To workaround this, destroy the HAL at the end of this test.
ASSERT_TRUE(resetDevice());
}
+
class LatencyModeOutputStreamTest : public OutputStreamTest {
protected:
void SetUp() override {
@@ -95,3 +96,8 @@
EXPECT_OK(stream->setLatencyModeCallback(new MockOutLatencyModeCallback));
EXPECT_OK(stream->setLatencyModeCallback(nullptr));
}
+
+INSTANTIATE_TEST_CASE_P(LatencyModeOutputStream, LatencyModeOutputStreamTest,
+ ::testing::ValuesIn(getOutputDeviceSingleConfigParameters()),
+ &DeviceConfigParameterToString);
+GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(LatencyModeOutputStreamTest);
diff --git a/audio/core/all-versions/vts/functional/Android.bp b/audio/core/all-versions/vts/functional/Android.bp
index 61ab1bb..87063a7 100644
--- a/audio/core/all-versions/vts/functional/Android.bp
+++ b/audio/core/all-versions/vts/functional/Android.bp
@@ -200,7 +200,7 @@
"android.hardware.audio.common@7.0",
"android.hardware.audio.common@7.0-enums",
"android.hardware.audio.common@7.1-enums",
- "android.hardware.audio.common@7.0-util",
+ "android.hardware.audio.common@7.1-util",
],
cflags: [
"-DMAJOR_VERSION=7",
diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/IBluetoothAudioProvider.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/IBluetoothAudioProvider.aidl
index 0dcba2e..6e0bd98 100644
--- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/IBluetoothAudioProvider.aidl
+++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/IBluetoothAudioProvider.aidl
@@ -39,4 +39,5 @@
void streamStarted(in android.hardware.bluetooth.audio.BluetoothAudioStatus status);
void streamSuspended(in android.hardware.bluetooth.audio.BluetoothAudioStatus status);
void updateAudioConfiguration(in android.hardware.bluetooth.audio.AudioConfiguration audioConfig);
+ void setLowLatencyModeAllowed(in boolean allowed);
}
diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/IBluetoothAudioProvider.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/IBluetoothAudioProvider.aidl
index 6f88f30..ca6f691 100644
--- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/IBluetoothAudioProvider.aidl
+++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/IBluetoothAudioProvider.aidl
@@ -82,4 +82,12 @@
* encoding.
*/
void updateAudioConfiguration(in AudioConfiguration audioConfig);
+
+ /**
+ * Called when the supported latency mode is updated.
+ *
+ * @param allowed If the peripheral devices can't keep up with low latency
+ * mode, the API will be called with supported is false.
+ */
+ void setLowLatencyModeAllowed(in boolean allowed);
}
diff --git a/bluetooth/audio/aidl/default/BluetoothAudioProvider.cpp b/bluetooth/audio/aidl/default/BluetoothAudioProvider.cpp
index c2ffa2e..54e82d1 100644
--- a/bluetooth/audio/aidl/default/BluetoothAudioProvider.cpp
+++ b/bluetooth/audio/aidl/default/BluetoothAudioProvider.cpp
@@ -121,6 +121,19 @@
return ndk::ScopedAStatus::ok();
}
+ndk::ScopedAStatus BluetoothAudioProvider::setLowLatencyModeAllowed(
+ bool allowed) {
+ LOG(INFO) << __func__ << " - SessionType=" << toString(session_type_);
+
+ if (stack_iface_ == nullptr) {
+ LOG(INFO) << __func__ << " - SessionType=" << toString(session_type_)
+ << " has NO session";
+ return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
+ }
+ LOG(INFO) << __func__ << " - allowed " << allowed;
+ return ndk::ScopedAStatus::ok();
+}
+
void BluetoothAudioProvider::binderDiedCallbackAidl(void* ptr) {
LOG(ERROR) << __func__ << " - BluetoothAudio Service died";
auto provider = static_cast<BluetoothAudioProvider*>(ptr);
diff --git a/bluetooth/audio/aidl/default/BluetoothAudioProvider.h b/bluetooth/audio/aidl/default/BluetoothAudioProvider.h
index f7acbdf..393aaba 100644
--- a/bluetooth/audio/aidl/default/BluetoothAudioProvider.h
+++ b/bluetooth/audio/aidl/default/BluetoothAudioProvider.h
@@ -46,6 +46,7 @@
ndk::ScopedAStatus streamSuspended(BluetoothAudioStatus status);
ndk::ScopedAStatus updateAudioConfiguration(
const AudioConfiguration& audio_config);
+ ndk::ScopedAStatus setLowLatencyModeAllowed(bool allowed);
virtual bool isValid(const SessionType& sessionType) = 0;
diff --git a/bluetooth/audio/utils/session/BluetoothAudioSupportedCodecsDB_2_2.cpp b/bluetooth/audio/utils/session/BluetoothAudioSupportedCodecsDB_2_2.cpp
index 4c99b0f..decff70 100644
--- a/bluetooth/audio/utils/session/BluetoothAudioSupportedCodecsDB_2_2.cpp
+++ b/bluetooth/audio/utils/session/BluetoothAudioSupportedCodecsDB_2_2.cpp
@@ -77,9 +77,13 @@
// Stores the supported setting of audio location, connected device, and the
// channel count for each device
std::vector<std::tuple<AudioLocation, uint8_t, uint8_t>>
- supportedDeviceSetting = {std::make_tuple(stereoAudio, 2, 1),
- std::make_tuple(monoAudio, 1, 2),
- std::make_tuple(monoAudio, 1, 1)};
+ supportedDeviceSetting = {
+ // Stereo, two connected device, one for L one for R
+ std::make_tuple(stereoAudio, 2, 1),
+ // Stereo, one connected device for both L and R
+ std::make_tuple(stereoAudio, 1, 2),
+ // Mono
+ std::make_tuple(monoAudio, 1, 1)};
bool IsOffloadLeAudioConfigurationValid(
const ::android::hardware::bluetooth::audio::V2_1::SessionType&
diff --git a/gnss/aidl/default/Gnss.cpp b/gnss/aidl/default/Gnss.cpp
index af1dd5c..a861957 100644
--- a/gnss/aidl/default/Gnss.cpp
+++ b/gnss/aidl/default/Gnss.cpp
@@ -58,7 +58,8 @@
int capabilities = (int)(IGnssCallback::CAPABILITY_SATELLITE_BLOCKLIST |
IGnssCallback::CAPABILITY_SATELLITE_PVT |
- IGnssCallback::CAPABILITY_CORRELATION_VECTOR);
+ IGnssCallback::CAPABILITY_CORRELATION_VECTOR |
+ IGnssCallback::CAPABILITY_ANTENNA_INFO);
auto status = sGnssCallback->gnssSetCapabilitiesCb(capabilities);
if (!status.isOk()) {
diff --git a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/PrepareModelConfig.aidl b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/PrepareModelConfig.aidl
index 85c924f..1f44ba7 100644
--- a/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/PrepareModelConfig.aidl
+++ b/neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/PrepareModelConfig.aidl
@@ -39,7 +39,8 @@
long deadlineNs;
ParcelFileDescriptor[] modelCache;
ParcelFileDescriptor[] dataCache;
- byte[] cacheToken;
+ byte[32] cacheToken;
android.hardware.neuralnetworks.TokenValuePair[] compilationHints;
android.hardware.neuralnetworks.ExtensionNameAndPrefix[] extensionNameToPrefix;
+ const int BYTE_SIZE_OF_CACHE_TOKEN = 32;
}
diff --git a/neuralnetworks/aidl/android/hardware/neuralnetworks/IDevice.aidl b/neuralnetworks/aidl/android/hardware/neuralnetworks/IDevice.aidl
index 821b9fe..7808fc2 100644
--- a/neuralnetworks/aidl/android/hardware/neuralnetworks/IDevice.aidl
+++ b/neuralnetworks/aidl/android/hardware/neuralnetworks/IDevice.aidl
@@ -39,7 +39,7 @@
/**
* The byte size of the cache token.
*/
- const int BYTE_SIZE_OF_CACHE_TOKEN = 32;
+ const int BYTE_SIZE_OF_CACHE_TOKEN = PrepareModelConfig.BYTE_SIZE_OF_CACHE_TOKEN;
/**
* The maximum number of files for each type of cache in compilation caching.
*/
diff --git a/neuralnetworks/aidl/android/hardware/neuralnetworks/IPreparedModel.aidl b/neuralnetworks/aidl/android/hardware/neuralnetworks/IPreparedModel.aidl
index 949804e..f752750 100644
--- a/neuralnetworks/aidl/android/hardware/neuralnetworks/IPreparedModel.aidl
+++ b/neuralnetworks/aidl/android/hardware/neuralnetworks/IPreparedModel.aidl
@@ -204,6 +204,12 @@
* appropriate ErrorStatus value. If the inputs to the function are valid and there is no error,
* createReusableExecution must construct a reusable execution.
*
+ * This method will be called when a client requests a reusable execution with consistent
+ * request and execution config. For single-time execution,
+ * {@link IPreparedModel::executeSynchronouslyWithConfig} or
+ * {@link IPreparedModel::executeFencedWithConfig} is preferred, because the overhead of
+ * setting up a reusable execution can be avoided.
+ *
* @param request The input and output information on which the prepared model is to be
* executed.
* @param config Specifies the execution configuration parameters.
@@ -223,6 +229,10 @@
* ExecutionConfig} instead of a list of configuration parameters, and ExecutionConfig contains
* more configuration parameters than are passed to executeSynchronously.
*
+ * This method is preferred when a client requests a single-time synchronous execution.
+ * For reusable execution with consistent request and execution config,
+ * {@link IPreparedModel::createReusableExecution} must be called.
+ *
* @param request The input and output information on which the prepared model is to be
* executed.
* @param config Specifies the execution configuration parameters.
@@ -246,6 +256,10 @@
* ExecutionConfig} instead of a list of configuration parameters, and ExecutionConfig contains
* more configuration parameters than are passed to executeFenced.
*
+ * This method is preferred when a client requests a single-time fenced execution.
+ * For reusable execution with consistent request and execution config,
+ * {@link IPreparedModel::createReusableExecution} must be called.
+ *
* @param request The input and output information on which the prepared model is to be
* executed. The outputs in the request must have fully specified dimensions.
* @param waitFor A vector of sync fence file descriptors. Execution must not start until all
diff --git a/neuralnetworks/aidl/android/hardware/neuralnetworks/PrepareModelConfig.aidl b/neuralnetworks/aidl/android/hardware/neuralnetworks/PrepareModelConfig.aidl
index 96df968..55bd291 100644
--- a/neuralnetworks/aidl/android/hardware/neuralnetworks/PrepareModelConfig.aidl
+++ b/neuralnetworks/aidl/android/hardware/neuralnetworks/PrepareModelConfig.aidl
@@ -28,6 +28,11 @@
@VintfStability
parcelable PrepareModelConfig {
/**
+ * The byte size of the cache token.
+ */
+ const int BYTE_SIZE_OF_CACHE_TOKEN = 32;
+
+ /**
* Indicates the intended execution behavior of a prepared model.
*/
ExecutionPreference preference;
@@ -66,7 +71,7 @@
*/
ParcelFileDescriptor[] dataCache;
/**
- * A caching token of length IDevice::BYTE_SIZE_OF_CACHE_TOKEN identifying
+ * A caching token of length BYTE_SIZE_OF_CACHE_TOKEN identifying
* the prepared model. The same token will be provided when
* retrieving the prepared model from the cache files with
* IDevice::prepareModelFromCache. Tokens should be chosen to have a low
@@ -77,7 +82,7 @@
* indicating that caching information is not provided, this
* token must be ignored.
*/
- byte[] cacheToken;
+ byte[BYTE_SIZE_OF_CACHE_TOKEN] cacheToken;
/**
* A vector of token / value pairs represent vendor specific
* compilation hints or metadata. The provided TokenValuePairs must not
diff --git a/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Conversions.h b/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Conversions.h
index af58715..71a28ef 100644
--- a/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Conversions.h
+++ b/neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Conversions.h
@@ -27,6 +27,7 @@
#include <aidl/android/hardware/neuralnetworks/Extension.h>
#include <aidl/android/hardware/neuralnetworks/ExtensionNameAndPrefix.h>
#include <aidl/android/hardware/neuralnetworks/ExtensionOperandTypeInformation.h>
+#include <aidl/android/hardware/neuralnetworks/IDevice.h>
#include <aidl/android/hardware/neuralnetworks/Memory.h>
#include <aidl/android/hardware/neuralnetworks/Model.h>
#include <aidl/android/hardware/neuralnetworks/Operand.h>
@@ -219,6 +220,7 @@
#endif // NN_AIDL_V4_OR_ABOVE
nn::GeneralResult<std::vector<int32_t>> toSigned(const std::vector<uint32_t>& vec);
+std::vector<uint8_t> toVec(const std::array<uint8_t, IDevice::BYTE_SIZE_OF_CACHE_TOKEN>& token);
} // namespace aidl::android::hardware::neuralnetworks::utils
diff --git a/neuralnetworks/aidl/utils/src/Conversions.cpp b/neuralnetworks/aidl/utils/src/Conversions.cpp
index 9b897c4..83fda10 100644
--- a/neuralnetworks/aidl/utils/src/Conversions.cpp
+++ b/neuralnetworks/aidl/utils/src/Conversions.cpp
@@ -614,7 +614,7 @@
using Ts::operator()...;
};
template <class... Ts>
-overloaded(Ts...)->overloaded<Ts...>;
+overloaded(Ts...) -> overloaded<Ts...>;
#ifdef __ANDROID__
nn::GeneralResult<common::NativeHandle> aidlHandleFromNativeHandle(
@@ -1190,4 +1190,8 @@
return std::vector<int32_t>(vec.begin(), vec.end());
}
+std::vector<uint8_t> toVec(const std::array<uint8_t, IDevice::BYTE_SIZE_OF_CACHE_TOKEN>& token) {
+ return std::vector<uint8_t>(token.begin(), token.end());
+}
+
} // namespace aidl::android::hardware::neuralnetworks::utils
diff --git a/neuralnetworks/aidl/utils/src/Device.cpp b/neuralnetworks/aidl/utils/src/Device.cpp
index f3f4fdb..b64a40d 100644
--- a/neuralnetworks/aidl/utils/src/Device.cpp
+++ b/neuralnetworks/aidl/utils/src/Device.cpp
@@ -229,7 +229,6 @@
const auto aidlDeadline = NN_TRY(convert(deadline));
auto aidlModelCache = NN_TRY(convert(modelCache));
auto aidlDataCache = NN_TRY(convert(dataCache));
- const auto aidlToken = NN_TRY(convert(token));
const auto cb = ndk::SharedRefBase::make<PreparedModelCallback>(kFeatureLevel);
const auto scoped = kDeathHandler.protectCallback(cb.get());
@@ -240,12 +239,13 @@
const auto ret = kDevice->prepareModelWithConfig(
aidlModel,
{aidlPreference, aidlPriority, aidlDeadline, std::move(aidlModelCache),
- std::move(aidlDataCache), aidlToken, std::move(aidlHints),
+ std::move(aidlDataCache), token, std::move(aidlHints),
std::move(aidlExtensionPrefix)},
cb);
HANDLE_ASTATUS(ret) << "prepareModel failed";
return cb->get();
}
+ const auto aidlToken = NN_TRY(convert(token));
const auto ret = kDevice->prepareModel(aidlModel, aidlPreference, aidlPriority, aidlDeadline,
aidlModelCache, aidlDataCache, aidlToken, cb);
HANDLE_ASTATUS(ret) << "prepareModel failed";
diff --git a/neuralnetworks/aidl/utils/src/InvalidDevice.cpp b/neuralnetworks/aidl/utils/src/InvalidDevice.cpp
index 33270ff..44f8ea9 100644
--- a/neuralnetworks/aidl/utils/src/InvalidDevice.cpp
+++ b/neuralnetworks/aidl/utils/src/InvalidDevice.cpp
@@ -189,7 +189,8 @@
}
}
return prepareModel(model, config.preference, config.priority, config.deadlineNs,
- config.modelCache, config.dataCache, config.cacheToken, callback);
+ config.modelCache, config.dataCache, utils::toVec(config.cacheToken),
+ callback);
}
ndk::ScopedAStatus InvalidDevice::prepareModelFromCache(
diff --git a/neuralnetworks/aidl/vts/functional/Utils.h b/neuralnetworks/aidl/vts/functional/Utils.h
index 4e0a4aa..ccb0778 100644
--- a/neuralnetworks/aidl/vts/functional/Utils.h
+++ b/neuralnetworks/aidl/vts/functional/Utils.h
@@ -21,6 +21,7 @@
#include <gtest/gtest.h>
#include <algorithm>
+#include <array>
#include <iosfwd>
#include <string>
#include <utility>
@@ -47,6 +48,7 @@
inline constexpr int64_t kOmittedTimeoutDuration = -1;
inline constexpr int64_t kNoDuration = -1;
inline const std::vector<uint8_t> kEmptyCacheToken(IDevice::BYTE_SIZE_OF_CACHE_TOKEN);
+inline const std::array<uint8_t, IDevice::BYTE_SIZE_OF_CACHE_TOKEN> kEmptyCacheTokenArray{};
// Returns the amount of space needed to store a value of the specified type.
//
diff --git a/neuralnetworks/aidl/vts/functional/ValidateModel.cpp b/neuralnetworks/aidl/vts/functional/ValidateModel.cpp
index 931ba25..060434e 100644
--- a/neuralnetworks/aidl/vts/functional/ValidateModel.cpp
+++ b/neuralnetworks/aidl/vts/functional/ValidateModel.cpp
@@ -85,7 +85,7 @@
std::shared_ptr<PreparedModelCallback> preparedModelCallback =
ndk::SharedRefBase::make<PreparedModelCallback>();
const auto prepareLaunchStatus = device->prepareModelWithConfig(
- model, {preference, priority, kNoDeadline, {}, {}, kEmptyCacheToken, {}, {}},
+ model, {preference, priority, kNoDeadline, {}, {}, kEmptyCacheTokenArray, {}, {}},
preparedModelCallback);
ASSERT_FALSE(prepareLaunchStatus.isOk());
ASSERT_EQ(prepareLaunchStatus.getExceptionCode(), EX_SERVICE_SPECIFIC);
diff --git a/neuralnetworks/aidl/vts/functional/VtsHalNeuralnetworks.cpp b/neuralnetworks/aidl/vts/functional/VtsHalNeuralnetworks.cpp
index 51b4805..bf87f15 100644
--- a/neuralnetworks/aidl/vts/functional/VtsHalNeuralnetworks.cpp
+++ b/neuralnetworks/aidl/vts/functional/VtsHalNeuralnetworks.cpp
@@ -72,7 +72,7 @@
kNoDeadline,
{},
{},
- kEmptyCacheToken,
+ kEmptyCacheTokenArray,
{},
{}},
preparedModelCallback);
diff --git a/neuralnetworks/utils/adapter/aidl/src/Device.cpp b/neuralnetworks/utils/adapter/aidl/src/Device.cpp
index 84aaddb..1b90a1a 100644
--- a/neuralnetworks/utils/adapter/aidl/src/Device.cpp
+++ b/neuralnetworks/utils/adapter/aidl/src/Device.cpp
@@ -312,8 +312,8 @@
const std::shared_ptr<IPreparedModelCallback>& callback) {
const auto result = adapter::prepareModel(
kDevice, kExecutor, model, config.preference, config.priority, config.deadlineNs,
- config.modelCache, config.dataCache, config.cacheToken, config.compilationHints,
- config.extensionNameToPrefix, callback);
+ config.modelCache, config.dataCache, utils::toVec(config.cacheToken),
+ config.compilationHints, config.extensionNameToPrefix, callback);
if (!result.has_value()) {
const auto& [message, code] = result.error();
const auto aidlCode = utils::convert(code).value_or(ErrorStatus::GENERAL_FAILURE);
diff --git a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl
index fec044e..cbe2068 100644
--- a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl
+++ b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl
@@ -35,14 +35,13 @@
@Backing(type="int") @VintfStability
enum UwbVendorCapabilityTlvTypes {
SUPPORTED_POWER_STATS_QUERY = 192,
- CCC_SUPPORTED_VERSIONS = 160,
- CCC_SUPPORTED_UWB_CONFIGS = 161,
- CCC_SUPPORTED_PULSE_SHAPE_COMBOS = 162,
- CCC_SUPPORTED_RAN_MULTIPLIER = 163,
- CCC_SUPPORTED_CHAPS_PER_SLOT = 164,
- CCC_SUPPORTED_SYNC_CODES = 165,
- CCC_SUPPORTED_CHANNELS = 166,
- CCC_SUPPORTED_HOPPING_SEQUENCES = 167,
- CCC_SUPPORTED_HOPPING_CONFIG_MODES = 168,
+ CCC_SUPPORTED_CHAPS_PER_SLOT = 160,
+ CCC_SUPPORTED_SYNC_CODES = 161,
+ CCC_SUPPORTED_HOPPING_CONFIG_MODES_AND_SEQUENCES = 162,
+ CCC_SUPPORTED_CHANNELS = 163,
+ CCC_SUPPORTED_VERSIONS = 164,
+ CCC_SUPPORTED_UWB_CONFIGS = 165,
+ CCC_SUPPORTED_PULSE_SHAPE_COMBOS = 166,
+ CCC_SUPPORTED_RAN_MULTIPLIER = 167,
SUPPORTED_AOA_RESULT_REQ_ANTENNA_INTERLEAVING = 227,
}
diff --git a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvValues.aidl b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvValues.aidl
index ee47a13..0e33f70 100644
--- a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvValues.aidl
+++ b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvValues.aidl
@@ -36,19 +36,21 @@
enum UwbVendorCapabilityTlvValues {
UWB_CONFIG_0 = 0,
UWB_CONFIG_1 = 1,
- PULSE_SHAPE_SYMMETRICAL_ROOT_RAISED_COSINE = 1,
- PULSE_SHAPE_PRECURSOR_FREE = 2,
- PULSE_SHAPE_PRECURSOR_FREE_SPECIAL = 3,
- CHAPS_PER_SLOT_3 = 3,
- CHAPS_PER_SLOT_4 = 4,
- CHAPS_PER_SLOT_6 = 6,
+ PULSE_SHAPE_SYMMETRICAL_ROOT_RAISED_COSINE = 0,
+ PULSE_SHAPE_PRECURSOR_FREE = 1,
+ PULSE_SHAPE_PRECURSOR_FREE_SPECIAL = 2,
+ CHAPS_PER_SLOT_3 = 1,
+ CHAPS_PER_SLOT_4 = 2,
+ CHAPS_PER_SLOT_6 = 4,
CHAPS_PER_SLOT_8 = 8,
- CHAPS_PER_SLOT_9 = 9,
- CHAPS_PER_SLOT_12 = 12,
- CHAPS_PER_SLOT_24 = 24,
- HOPPING_SEQUENCE_DEFAULT = 0,
- HOPPING_SEQUENCE_AES = 1,
- HOPPING_CONFIG_MODE_NONE = 0,
- HOPPING_CONFIG_MODE_CONTINUOUS = 1,
- HOPPING_CONFIG_MODE_ADAPTIVE = 2,
+ CHAPS_PER_SLOT_9 = 16,
+ CHAPS_PER_SLOT_12 = 32,
+ CHAPS_PER_SLOT_24 = 64,
+ HOPPING_SEQUENCE_DEFAULT = 16,
+ HOPPING_SEQUENCE_AES = 8,
+ HOPPING_CONFIG_MODE_NONE = 128,
+ HOPPING_CONFIG_MODE_CONTINUOUS = 64,
+ HOPPING_CONFIG_MODE_ADAPTIVE = 32,
+ CCC_CHANNEL_5 = 1,
+ CCC_CHANNEL_9 = 2,
}
diff --git a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl
index 4591dda..97f8010 100644
--- a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl
+++ b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl
@@ -46,17 +46,85 @@
********************************************/
/**
+ * 1 byte bitmask with a list of supported chaps per slot
+ * Bitmap of supported values of Slot durations as a multiple of TChap,
+ * NChap_per_Slot as defined in CCC Specification.
+ * Each “1” in this bit map corresponds to a specific
+ * value of NChap_per_Slot where:
+ * 0x01 = “3”,
+ * 0x02 = “4”,
+ * 0x04= “6”,
+ * 0x08 =“8”,
+ * 0x10 =“9”,
+ * 0x20 = “12”,
+ * 0x40 = “24”,
+ * 0x80 is reserved.
+ */
+ CCC_SUPPORTED_CHAPS_PER_SLOT = 0xA0,
+
+ /**
+ * 4 byte bitmask with a list of supported sync codes
+ * Bitmap of SYNC code indices that can be used.
+ * The position of each “1” in this bit pattern
+ * corresponds to the index of a SYNC code that
+ * can be used, where:
+ * 0x00000001 = “1”,
+ * 0x00000002 = “2”,
+ * 0x00000004 = “3”,
+ * 0x00000008 = “4”,
+ * ….
+ * 0x40000000 = “31”,
+ * 0x80000000 = “32”
+ * Refer to IEEE 802.15.4-2015 and CCC
+ * Specification for SYNC code index definition
+ */
+ CCC_SUPPORTED_SYNC_CODES = 0xA1,
+
+ /**
+ * 1 byte bitmask with a list of supported hopping config modes and sequences.
+ * [b7 b6 b5] : bitmask of hopping modes the
+ * device offers to use in the ranging session
+ * 100 - No Hopping
+ * 010 - Continuous Hopping
+ * 001 - Adaptive Hopping
+ * [b4 b3 b2 b1 b0] : bit mask of hopping
+ * sequences the device offers to use in the
+ * ranging session
+ * b4=1 is always set because of the default
+ * hopping sequence. Support for it is mandatory.
+ * b3=1 is set when the optional AES based
+ * hopping sequence is supported.
+ */
+ CCC_SUPPORTED_HOPPING_CONFIG_MODES_AND_SEQUENCES = 0xA2,
+
+ /**
+ * 1 byte bitmask with list of supported channels
+ * Bitmap of supported UWB channels. Each “1” in
+ * this bit map corresponds to a specific value of
+ * UWB channel where:
+ * 0x01 = "Channel 5"
+ * 0x02 = "Channel 9"
+ */
+ CCC_SUPPORTED_CHANNELS = 0xA3,
+
+ /**
* 2 byte tuple {major_version (1 byte), minor_version (1 byte)} array with list of supported
* CCC versions
*/
- CCC_SUPPORTED_VERSIONS = 0xA0,
+ CCC_SUPPORTED_VERSIONS = 0xA4,
+
/**
* byte array with a list of supported UWB configs
- * Values:
- * UWB_CONFIG_0 = 0
- * UWB_CONFIG_1 = 1
+ *
+ * UWB configurations are define in chapter
+ * "21.4 UWB Frame Elements" of the CCC
+ * specification. Configuration 0x0000 is
+ * mandatory for device and vehicle, configuration
+ * 0x0001 is mandatory for the device, optional for
+ * the vehicle.
*/
- CCC_SUPPORTED_UWB_CONFIGS = 0xA1,
+ CCC_SUPPORTED_UWB_CONFIGS = 0xA5,
+
/**
* 1 byte tuple {initiator_tx (4 bits), responder_tx (4 bits)} array with list of supported
* pulse shape combos
@@ -66,43 +134,10 @@
* PULSE_SHAPE_PRECURSOR_FREE_SPECIAL = 3
*/
/** */
- CCC_SUPPORTED_PULSE_SHAPE_COMBOS = 0xA2,
+ CCC_SUPPORTED_PULSE_SHAPE_COMBOS = 0xA6,
+
/** Int value for indicating supported ran multiplier */
- CCC_SUPPORTED_RAN_MULTIPLIER = 0xA3,
- /**
- * byte array with a list of supported chaps per slot
- * Values:
- * CHAPS_PER_SLOT_3 = 3
- * CHAPS_PER_SLOT_4 = 4
- * CHAPS_PER_SLOT_6 = 6
- * CHAPS_PER_SLOT_8 = 8
- * CHAPS_PER_SLOT_9 = 9
- * CHAPS_PER_SLOT_12 = 12
- * CHAPS_PER_SLOT_24 = 24
- */
- CCC_SUPPORTED_CHAPS_PER_SLOT = 0xA4,
- /**
- * byte array with a list of supported sync codes
- * Values: 1 - 32
- */
- CCC_SUPPORTED_SYNC_CODES = 0xA5,
- /** byte array with list of supported channels */
- CCC_SUPPORTED_CHANNELS = 0xA6,
- /**
- * byte array with a list of supported hopping sequences
- * Values:
- HOPPING_SEQUENCE_DEFAULT = 0
- HOPPING_SEQUENCE_AES = 1
- */
- CCC_SUPPORTED_HOPPING_SEQUENCES = 0xA7,
- /**
- * byte array with a list of supported hopping config modes
- * Values:
- * HOPPING_CONFIG_MODE_NONE = 0
- * HOPPING_CONFIG_MODE_CONTINUOUS = 1
- * HOPPING_CONFIG_MODE_ADAPTIVE = 2
- */
- CCC_SUPPORTED_HOPPING_CONFIG_MODES = 0xA8,
+ CCC_SUPPORTED_RAN_MULTIPLIER = 0xA7,
/*********************************************
* FIRA specific
diff --git a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvValues.aidl b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvValues.aidl
index 380089f..7c86b79 100644
--- a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvValues.aidl
+++ b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvValues.aidl
@@ -30,22 +30,25 @@
UWB_CONFIG_0 = 0,
UWB_CONFIG_1 = 1,
- PULSE_SHAPE_SYMMETRICAL_ROOT_RAISED_COSINE = 1,
- PULSE_SHAPE_PRECURSOR_FREE = 2,
- PULSE_SHAPE_PRECURSOR_FREE_SPECIAL = 3,
+ PULSE_SHAPE_SYMMETRICAL_ROOT_RAISED_COSINE = 0,
+ PULSE_SHAPE_PRECURSOR_FREE = 1,
+ PULSE_SHAPE_PRECURSOR_FREE_SPECIAL = 2,
- CHAPS_PER_SLOT_3 = 3,
- CHAPS_PER_SLOT_4 = 4,
- CHAPS_PER_SLOT_6 = 6,
- CHAPS_PER_SLOT_8 = 8,
- CHAPS_PER_SLOT_9 = 9,
- CHAPS_PER_SLOT_12 = 12,
- CHAPS_PER_SLOT_24 = 24,
+ CHAPS_PER_SLOT_3 = 1,
+ CHAPS_PER_SLOT_4 = 1 << 1,
+ CHAPS_PER_SLOT_6 = 1 << 2,
+ CHAPS_PER_SLOT_8 = 1 << 3,
+ CHAPS_PER_SLOT_9 = 1 << 4,
+ CHAPS_PER_SLOT_12 = 1 << 5,
+ CHAPS_PER_SLOT_24 = 1 << 6,
- HOPPING_SEQUENCE_DEFAULT = 0,
- HOPPING_SEQUENCE_AES = 1,
+ HOPPING_SEQUENCE_DEFAULT = 1 << 4,
+ HOPPING_SEQUENCE_AES = 1 << 3,
- HOPPING_CONFIG_MODE_NONE = 0,
- HOPPING_CONFIG_MODE_CONTINUOUS = 1,
- HOPPING_CONFIG_MODE_ADAPTIVE = 2,
+ HOPPING_CONFIG_MODE_NONE = 1 << 7,
+ HOPPING_CONFIG_MODE_CONTINUOUS = 1 << 6,
+ HOPPING_CONFIG_MODE_ADAPTIVE = 1 << 5,
+
+ CCC_CHANNEL_5 = 1,
+ CCC_CHANNEL_9 = 1 << 1,
}
diff --git a/wifi/1.6/IWifiChip.hal b/wifi/1.6/IWifiChip.hal
index 555ec91..726839d 100644
--- a/wifi/1.6/IWifiChip.hal
+++ b/wifi/1.6/IWifiChip.hal
@@ -16,6 +16,7 @@
package android.hardware.wifi@1.6;
+import @1.0::ChipModeId;
import @1.0::IWifiIface;
import @1.0::WifiStatus;
import @1.5::WifiBand;
@@ -101,6 +102,107 @@
generates (WifiStatus status, vec<WifiUsableChannel> channels);
/**
+ * Set of interface concurrency types with the maximum number of interfaces that can have
+ * one of the specified concurrency types for a given ChipConcurrencyCombination. See
+ * ChipConcurrencyCombination for examples.
+ */
+ struct ChipConcurrencyCombinationLimit {
+ // Each IfaceConcurrencyType must occur at most once.
+ vec<IfaceConcurrencyType> types;
+ uint32_t maxIfaces;
+ };
+
+ /**
+ * Set of interfaces that can operate concurrently when in a given mode. See
+ * ChipMode below.
+ *
+ * For example:
+ * [{STA} <= 2]
+ * At most two STA interfaces are supported
+ * [], [STA], [STA+STA]
+ *
+ * [{STA} <= 1, {NAN} <= 1, {AP_BRIDGED} <= 1]
+ * Any combination of STA, NAN, AP_BRIDGED
+ * [], [STA], [NAN], [AP_BRIDGED], [STA+NAN], [STA+AP_BRIDGED], [NAN+AP_BRIDGED],
+ * [STA+NAN+AP_BRIDGED]
+ *
+ * [{STA} <= 1, {NAN,P2P} <= 1]
+ * Optionally a STA and either NAN or P2P
+ * [], [STA], [STA+NAN], [STA+P2P], [NAN], [P2P]
+ * Not included [NAN+P2P], [STA+NAN+P2P]
+ *
+ * [{STA} <= 1, {STA,NAN} <= 1]
+ * Optionally a STA and either a second STA or a NAN
+ * [], [STA], [STA+NAN], [STA+STA], [NAN]
+ * Not included [STA+STA+NAN]
+ */
+ struct ChipConcurrencyCombination {
+ vec<ChipConcurrencyCombinationLimit> limits;
+ };
+
+ /**
+ * A mode that the chip can be put in. A mode defines a set of constraints on
+ * the interfaces that can exist while in that mode. Modes define a unit of
+ * configuration where all interfaces must be torn down to switch to a
+ * different mode. Some HALs may only have a single mode, but an example where
+ * multiple modes would be required is if a chip has different firmwares with
+ * different capabilities.
+ *
+ * When in a mode, it must be possible to perform any combination of creating
+ * and removing interfaces as long as at least one of the
+ * ChipConcurrencyCombinations is satisfied. This means that if a chip has two
+ * available combinations, [{STA} <= 1] and [{AP_BRIDGED} <= 1] then it is expected
+ * that exactly one STA type or one AP_BRIDGED type can be created, but it
+ * is not expected that both a STA and AP_BRIDGED type could be created. If it
+ * was then there would be a single available combination
+ * [{STA} <=1, {AP_BRIDGED} <= 1].
+ *
+ * When switching between two available combinations it is expected that
+ * interfaces only supported by the initial combination must be removed until
+ * the target combination is also satisfied. At that point new interfaces
+ * satisfying only the target combination can be added (meaning the initial
+ * combination limits will no longer satisfied). The addition of these new
+ * interfaces must not impact the existence of interfaces that satisfy both
+ * combinations.
+ *
+ * For example, a chip with available combinations:
+ * [{STA} <= 2, {NAN} <=1] and [{STA} <=1, {NAN} <= 1, {AP_BRIDGED} <= 1}]
+ * If the chip currently has 3 interfaces STA, STA and NAN and wants to add an
+ * AP_BRIDGED interface in place of one of the STAs then first one of the STA
+ * interfaces must be removed and then the AP interface can be created after
+ * the STA had been torn down. During this process the remaining STA and NAN
+ * interfaces must not be removed/recreated.
+ *
+ * If a chip does not support this kind of reconfiguration in this mode then
+ * the combinations must be separated into two separate modes. Before
+ * switching modes all interfaces must be torn down, the mode switch must be
+ * enacted and when it completes the new interfaces must be brought up.
+ */
+ struct ChipMode {
+ /**
+ * Id that can be used to put the chip in this mode.
+ */
+ ChipModeId id;
+
+ /**
+ * A list of the possible interface concurrency type combinations that the chip can have
+ * while in this mode.
+ */
+ vec<ChipConcurrencyCombination> availableCombinations;
+ };
+
+ /**
+ * Get the set of operation modes that the chip supports.
+ *
+ * @return status WifiStatus of the operation.
+ * Possible status codes:
+ * |WifiStatusCode.SUCCESS|,
+ * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|
+ * @return modes List of modes supported by the device.
+ */
+ getAvailableModes_1_6() generates (WifiStatus status, vec<ChipMode> modes);
+
+ /**
* Retrieve the list of all the possible radio combinations supported by this
* chip.
*
diff --git a/wifi/1.6/default/tests/mock_wifi_feature_flags.h b/wifi/1.6/default/tests/mock_wifi_feature_flags.h
index fa3600a..fbe1f7a 100644
--- a/wifi/1.6/default/tests/mock_wifi_feature_flags.h
+++ b/wifi/1.6/default/tests/mock_wifi_feature_flags.h
@@ -33,7 +33,7 @@
public:
MockWifiFeatureFlags();
- MOCK_METHOD1(getChipModes, std::vector<V1_0::IWifiChip::ChipMode>(bool is_primary));
+ MOCK_METHOD1(getChipModes, std::vector<V1_6::IWifiChip::ChipMode>(bool is_primary));
MOCK_METHOD0(isApMacRandomizationDisabled, bool());
};
diff --git a/wifi/1.6/default/tests/wifi_chip_unit_tests.cpp b/wifi/1.6/default/tests/wifi_chip_unit_tests.cpp
index 542b180..48c0065 100644
--- a/wifi/1.6/default/tests/wifi_chip_unit_tests.cpp
+++ b/wifi/1.6/default/tests/wifi_chip_unit_tests.cpp
@@ -48,13 +48,13 @@
protected:
void setupV1IfaceCombination() {
// clang-format off
- const hidl_vec<V1_0::IWifiChip::ChipIfaceCombination> combinationsSta = {
- {{{{IfaceType::STA}, 1}, {{IfaceType::P2P}, 1}}}
+ const hidl_vec<IWifiChip::ChipConcurrencyCombination> combinationsSta = {
+ {{{{IfaceConcurrencyType::STA}, 1}, {{IfaceConcurrencyType::P2P}, 1}}}
};
- const hidl_vec<V1_0::IWifiChip::ChipIfaceCombination> combinationsAp = {
- {{{{IfaceType::AP}, 1}}}
+ const hidl_vec<IWifiChip::ChipConcurrencyCombination> combinationsAp = {
+ {{{{IfaceConcurrencyType::AP}, 1}}}
};
- const std::vector<V1_0::IWifiChip::ChipMode> modes = {
+ const std::vector<V1_6::IWifiChip::ChipMode> modes = {
{feature_flags::chip_mode_ids::kV1Sta, combinationsSta},
{feature_flags::chip_mode_ids::kV1Ap, combinationsAp}
};
@@ -64,13 +64,14 @@
void setupV1_AwareIfaceCombination() {
// clang-format off
- const hidl_vec<V1_0::IWifiChip::ChipIfaceCombination> combinationsSta = {
- {{{{IfaceType::STA}, 1}, {{IfaceType::P2P, IfaceType::NAN}, 1}}}
+ const hidl_vec<IWifiChip::ChipConcurrencyCombination> combinationsSta = {
+ {{{{IfaceConcurrencyType::STA}, 1},
+ {{IfaceConcurrencyType::P2P, IfaceConcurrencyType::NAN}, 1}}}
};
- const hidl_vec<V1_0::IWifiChip::ChipIfaceCombination> combinationsAp = {
- {{{{IfaceType::AP}, 1}}}
+ const hidl_vec<IWifiChip::ChipConcurrencyCombination> combinationsAp = {
+ {{{{IfaceConcurrencyType::AP}, 1}}}
};
- const std::vector<V1_0::IWifiChip::ChipMode> modes = {
+ const std::vector<V1_6::IWifiChip::ChipMode> modes = {
{feature_flags::chip_mode_ids::kV1Sta, combinationsSta},
{feature_flags::chip_mode_ids::kV1Ap, combinationsAp}
};
@@ -80,10 +81,11 @@
void setupV1_AwareDisabledApIfaceCombination() {
// clang-format off
- const hidl_vec<V1_0::IWifiChip::ChipIfaceCombination> combinationsSta = {
- {{{{IfaceType::STA}, 1}, {{IfaceType::P2P, IfaceType::NAN}, 1}}}
+ const hidl_vec<IWifiChip::ChipConcurrencyCombination> combinationsSta = {
+ {{{{IfaceConcurrencyType::STA}, 1},
+ {{IfaceConcurrencyType::P2P, IfaceConcurrencyType::NAN}, 1}}}
};
- const std::vector<V1_0::IWifiChip::ChipMode> modes = {
+ const std::vector<V1_6::IWifiChip::ChipMode> modes = {
{feature_flags::chip_mode_ids::kV1Sta, combinationsSta}
};
// clang-format on
@@ -92,11 +94,12 @@
void setupV2_AwareIfaceCombination() {
// clang-format off
- const hidl_vec<V1_0::IWifiChip::ChipIfaceCombination> combinations = {
- {{{{IfaceType::STA}, 1}, {{IfaceType::AP}, 1}}},
- {{{{IfaceType::STA}, 1}, {{IfaceType::P2P, IfaceType::NAN}, 1}}}
+ const hidl_vec<IWifiChip::ChipConcurrencyCombination> combinations = {
+ {{{{IfaceConcurrencyType::STA}, 1}, {{IfaceConcurrencyType::AP}, 1}}},
+ {{{{IfaceConcurrencyType::STA}, 1},
+ {{IfaceConcurrencyType::P2P, IfaceConcurrencyType::NAN}, 1}}}
};
- const std::vector<V1_0::IWifiChip::ChipMode> modes = {
+ const std::vector<V1_6::IWifiChip::ChipMode> modes = {
{feature_flags::chip_mode_ids::kV3, combinations}
};
// clang-format on
@@ -105,10 +108,11 @@
void setupV2_AwareDisabledApIfaceCombination() {
// clang-format off
- const hidl_vec<V1_0::IWifiChip::ChipIfaceCombination> combinations = {
- {{{{IfaceType::STA}, 1}, {{IfaceType::P2P, IfaceType::NAN}, 1}}}
+ const hidl_vec<IWifiChip::ChipConcurrencyCombination> combinations = {
+ {{{{IfaceConcurrencyType::STA}, 1},
+ {{IfaceConcurrencyType::P2P, IfaceConcurrencyType::NAN}, 1}}}
};
- const std::vector<V1_0::IWifiChip::ChipMode> modes = {
+ const std::vector<V1_6::IWifiChip::ChipMode> modes = {
{feature_flags::chip_mode_ids::kV3, combinations}
};
// clang-format on
@@ -117,10 +121,10 @@
void setup_MultiIfaceCombination() {
// clang-format off
- const hidl_vec<V1_0::IWifiChip::ChipIfaceCombination> combinations = {
- {{{{IfaceType::STA}, 3}, {{IfaceType::AP}, 1}}}
+ const hidl_vec<IWifiChip::ChipConcurrencyCombination> combinations = {
+ {{{{IfaceConcurrencyType::STA}, 3}, {{IfaceConcurrencyType::AP}, 1}}}
};
- const std::vector<V1_0::IWifiChip::ChipMode> modes = {
+ const std::vector<V1_6::IWifiChip::ChipMode> modes = {
{feature_flags::chip_mode_ids::kV3, combinations}
};
// clang-format on
@@ -128,19 +132,20 @@
}
void assertNumberOfModes(uint32_t num_modes) {
- chip_->getAvailableModes([num_modes](const WifiStatus& status,
- const std::vector<WifiChip::ChipMode>& modes) {
+ chip_->getAvailableModes_1_6([num_modes](const WifiStatus& status,
+ const std::vector<WifiChip::ChipMode>& modes) {
ASSERT_EQ(WifiStatusCode::SUCCESS, status.code);
// V2_Aware has 1 mode of operation.
ASSERT_EQ(num_modes, modes.size());
});
}
- void findModeAndConfigureForIfaceType(const IfaceType& type) {
+ void findModeAndConfigureForIfaceType(const IfaceConcurrencyType& type) {
// This should be aligned with kInvalidModeId in wifi_chip.cpp.
ChipModeId mode_id = UINT32_MAX;
- chip_->getAvailableModes([&mode_id, &type](const WifiStatus& status,
- const std::vector<WifiChip::ChipMode>& modes) {
+ chip_->getAvailableModes_1_6([&mode_id, &type](
+ const WifiStatus& status,
+ const std::vector<WifiChip::ChipMode>& modes) {
ASSERT_EQ(WifiStatusCode::SUCCESS, status.code);
for (const auto& mode : modes) {
for (const auto& combination : mode.availableCombinations) {
@@ -298,48 +303,48 @@
};
TEST_F(WifiChipV1IfaceCombinationTest, StaMode_CreateSta_ShouldSucceed) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_EQ(createIface(IfaceType::STA), "wlan0");
}
TEST_F(WifiChipV1IfaceCombinationTest, StaMode_CreateP2p_ShouldSucceed) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_FALSE(createIface(IfaceType::P2P).empty());
}
TEST_F(WifiChipV1IfaceCombinationTest, StaMode_CreateNan_ShouldFail) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_TRUE(createIface(IfaceType::NAN).empty());
}
TEST_F(WifiChipV1IfaceCombinationTest, StaMode_CreateAp_ShouldFail) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_TRUE(createIface(IfaceType::AP).empty());
}
TEST_F(WifiChipV1IfaceCombinationTest, StaMode_CreateStaP2p_ShouldSucceed) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_FALSE(createIface(IfaceType::STA).empty());
ASSERT_FALSE(createIface(IfaceType::P2P).empty());
}
TEST_F(WifiChipV1IfaceCombinationTest, ApMode_CreateAp_ShouldSucceed) {
- findModeAndConfigureForIfaceType(IfaceType::AP);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::AP);
ASSERT_EQ(createIface(IfaceType::AP), "wlan0");
}
TEST_F(WifiChipV1IfaceCombinationTest, ApMode_CreateSta_ShouldFail) {
- findModeAndConfigureForIfaceType(IfaceType::AP);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::AP);
ASSERT_TRUE(createIface(IfaceType::STA).empty());
}
TEST_F(WifiChipV1IfaceCombinationTest, ApMode_CreateP2p_ShouldFail) {
- findModeAndConfigureForIfaceType(IfaceType::AP);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::AP);
ASSERT_TRUE(createIface(IfaceType::STA).empty());
}
TEST_F(WifiChipV1IfaceCombinationTest, ApMode_CreateNan_ShouldFail) {
- findModeAndConfigureForIfaceType(IfaceType::AP);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::AP);
ASSERT_TRUE(createIface(IfaceType::NAN).empty());
}
@@ -357,46 +362,46 @@
};
TEST_F(WifiChipV1_AwareIfaceCombinationTest, StaMode_CreateSta_ShouldSucceed) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_EQ(createIface(IfaceType::STA), "wlan0");
}
TEST_F(WifiChipV1_AwareIfaceCombinationTest, StaMode_CreateP2p_ShouldSucceed) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_FALSE(createIface(IfaceType::P2P).empty());
}
TEST_F(WifiChipV1_AwareIfaceCombinationTest, StaMode_CreateNan_ShouldSucceed) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_FALSE(createIface(IfaceType::NAN).empty());
}
TEST_F(WifiChipV1_AwareIfaceCombinationTest, StaMode_CreateAp_ShouldFail) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_TRUE(createIface(IfaceType::AP).empty());
}
TEST_F(WifiChipV1_AwareIfaceCombinationTest, StaMode_CreateStaP2p_ShouldSucceed) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_FALSE(createIface(IfaceType::STA).empty());
ASSERT_FALSE(createIface(IfaceType::P2P).empty());
}
TEST_F(WifiChipV1_AwareIfaceCombinationTest, StaMode_CreateStaNan_ShouldSucceed) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_FALSE(createIface(IfaceType::STA).empty());
ASSERT_FALSE(createIface(IfaceType::NAN).empty());
}
TEST_F(WifiChipV1_AwareIfaceCombinationTest, StaMode_CreateStaP2PNan_ShouldFail) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_FALSE(createIface(IfaceType::STA).empty());
ASSERT_FALSE(createIface(IfaceType::P2P).empty());
ASSERT_TRUE(createIface(IfaceType::NAN).empty());
}
TEST_F(WifiChipV1_AwareIfaceCombinationTest, StaMode_CreateStaNan_AfterP2pRemove_ShouldSucceed) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_FALSE(createIface(IfaceType::STA).empty());
const auto p2p_iface_name = createIface(IfaceType::P2P);
ASSERT_FALSE(p2p_iface_name.empty());
@@ -408,7 +413,7 @@
}
TEST_F(WifiChipV1_AwareIfaceCombinationTest, StaMode_CreateStaP2p_AfterNanRemove_ShouldSucceed) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_FALSE(createIface(IfaceType::STA).empty());
const auto nan_iface_name = createIface(IfaceType::NAN);
ASSERT_FALSE(nan_iface_name.empty());
@@ -420,50 +425,50 @@
}
TEST_F(WifiChipV1_AwareIfaceCombinationTest, ApMode_CreateAp_ShouldSucceed) {
- findModeAndConfigureForIfaceType(IfaceType::AP);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::AP);
ASSERT_EQ(createIface(IfaceType::AP), "wlan0");
}
TEST_F(WifiChipV1_AwareIfaceCombinationTest, ApMode_CreateSta_ShouldFail) {
- findModeAndConfigureForIfaceType(IfaceType::AP);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::AP);
ASSERT_TRUE(createIface(IfaceType::STA).empty());
}
TEST_F(WifiChipV1_AwareIfaceCombinationTest, ApMode_CreateP2p_ShouldFail) {
- findModeAndConfigureForIfaceType(IfaceType::AP);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::AP);
ASSERT_TRUE(createIface(IfaceType::STA).empty());
}
TEST_F(WifiChipV1_AwareIfaceCombinationTest, ApMode_CreateNan_ShouldFail) {
- findModeAndConfigureForIfaceType(IfaceType::AP);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::AP);
ASSERT_TRUE(createIface(IfaceType::NAN).empty());
}
TEST_F(WifiChipV1_AwareIfaceCombinationTest, RttControllerFlowStaModeNoSta) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_TRUE(createRttController());
}
TEST_F(WifiChipV1_AwareIfaceCombinationTest, RttControllerFlowStaModeWithSta) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_FALSE(createIface(IfaceType::STA).empty());
ASSERT_TRUE(createRttController());
}
TEST_F(WifiChipV1_AwareIfaceCombinationTest, RttControllerFlowApToSta) {
- findModeAndConfigureForIfaceType(IfaceType::AP);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::AP);
const auto ap_iface_name = createIface(IfaceType::AP);
ASSERT_FALSE(ap_iface_name.empty());
ASSERT_FALSE(createRttController());
removeIface(IfaceType::AP, ap_iface_name);
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_TRUE(createRttController());
}
TEST_F(WifiChipV1_AwareIfaceCombinationTest, SelectTxScenarioWithOnlySta) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_EQ(createIface(IfaceType::STA), "wlan0");
EXPECT_CALL(*legacy_hal_, selectTxPowerScenario("wlan0", testing::_))
.WillOnce(testing::Return(legacy_hal::WIFI_SUCCESS));
@@ -473,7 +478,7 @@
}
TEST_F(WifiChipV1_AwareIfaceCombinationTest, SelectTxScenarioWithOnlyAp) {
- findModeAndConfigureForIfaceType(IfaceType::AP);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::AP);
ASSERT_EQ(createIface(IfaceType::AP), "wlan0");
EXPECT_CALL(*legacy_hal_, selectTxPowerScenario("wlan0", testing::_))
.WillOnce(testing::Return(legacy_hal::WIFI_SUCCESS));
@@ -496,45 +501,45 @@
};
TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateSta_ShouldSucceed) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_EQ(createIface(IfaceType::STA), "wlan0");
}
TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateP2p_ShouldSucceed) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_FALSE(createIface(IfaceType::P2P).empty());
}
TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateNan_ShouldSucceed) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_FALSE(createIface(IfaceType::NAN).empty());
}
TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateAp_ShouldSucceed) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_EQ(createIface(IfaceType::AP), "wlan1");
}
TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateStaSta_ShouldFail) {
- findModeAndConfigureForIfaceType(IfaceType::AP);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::AP);
ASSERT_EQ(createIface(IfaceType::STA), "wlan0");
ASSERT_TRUE(createIface(IfaceType::STA).empty());
}
TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateStaAp_ShouldSucceed) {
- findModeAndConfigureForIfaceType(IfaceType::AP);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::AP);
ASSERT_EQ(createIface(IfaceType::STA), "wlan0");
ASSERT_EQ(createIface(IfaceType::AP), "wlan1");
}
TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateApSta_ShouldSucceed) {
- findModeAndConfigureForIfaceType(IfaceType::AP);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::AP);
ASSERT_EQ(createIface(IfaceType::AP), "wlan1");
ASSERT_EQ(createIface(IfaceType::STA), "wlan0");
}
TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateSta_AfterStaApRemove_ShouldSucceed) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
const auto sta_iface_name = createIface(IfaceType::STA);
ASSERT_FALSE(sta_iface_name.empty());
const auto ap_iface_name = createIface(IfaceType::AP);
@@ -549,26 +554,26 @@
}
TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateStaP2p_ShouldSucceed) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_FALSE(createIface(IfaceType::STA).empty());
ASSERT_FALSE(createIface(IfaceType::P2P).empty());
}
TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateStaNan_ShouldSucceed) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_FALSE(createIface(IfaceType::STA).empty());
ASSERT_FALSE(createIface(IfaceType::NAN).empty());
}
TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateStaP2PNan_ShouldFail) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_FALSE(createIface(IfaceType::STA).empty());
ASSERT_FALSE(createIface(IfaceType::P2P).empty());
ASSERT_TRUE(createIface(IfaceType::NAN).empty());
}
TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateStaNan_AfterP2pRemove_ShouldSucceed) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_FALSE(createIface(IfaceType::STA).empty());
const auto p2p_iface_name = createIface(IfaceType::P2P);
ASSERT_FALSE(p2p_iface_name.empty());
@@ -580,7 +585,7 @@
}
TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateStaP2p_AfterNanRemove_ShouldSucceed) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_FALSE(createIface(IfaceType::STA).empty());
const auto nan_iface_name = createIface(IfaceType::NAN);
ASSERT_FALSE(nan_iface_name.empty());
@@ -592,19 +597,19 @@
}
TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateApNan_ShouldFail) {
- findModeAndConfigureForIfaceType(IfaceType::AP);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::AP);
ASSERT_FALSE(createIface(IfaceType::AP).empty());
ASSERT_TRUE(createIface(IfaceType::NAN).empty());
}
TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateApP2p_ShouldFail) {
- findModeAndConfigureForIfaceType(IfaceType::AP);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::AP);
ASSERT_FALSE(createIface(IfaceType::AP).empty());
ASSERT_TRUE(createIface(IfaceType::P2P).empty());
}
TEST_F(WifiChipV2_AwareIfaceCombinationTest, StaMode_CreateStaNan_AfterP2pRemove_ShouldSucceed) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_FALSE(createIface(IfaceType::STA).empty());
const auto p2p_iface_name = createIface(IfaceType::P2P);
ASSERT_FALSE(p2p_iface_name.empty());
@@ -616,7 +621,7 @@
}
TEST_F(WifiChipV2_AwareIfaceCombinationTest, StaMode_CreateStaP2p_AfterNanRemove_ShouldSucceed) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_FALSE(createIface(IfaceType::STA).empty());
const auto nan_iface_name = createIface(IfaceType::NAN);
ASSERT_FALSE(nan_iface_name.empty());
@@ -628,7 +633,7 @@
}
TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateStaAp_EnsureDifferentIfaceNames) {
- findModeAndConfigureForIfaceType(IfaceType::AP);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::AP);
const auto sta_iface_name = createIface(IfaceType::STA);
const auto ap_iface_name = createIface(IfaceType::AP);
ASSERT_FALSE(sta_iface_name.empty());
@@ -637,25 +642,25 @@
}
TEST_F(WifiChipV2_AwareIfaceCombinationTest, RttControllerFlowStaModeNoSta) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_TRUE(createRttController());
}
TEST_F(WifiChipV2_AwareIfaceCombinationTest, RttControllerFlowStaModeWithSta) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_FALSE(createIface(IfaceType::STA).empty());
ASSERT_TRUE(createRttController());
}
TEST_F(WifiChipV2_AwareIfaceCombinationTest, RttControllerFlow) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_FALSE(createIface(IfaceType::STA).empty());
ASSERT_FALSE(createIface(IfaceType::AP).empty());
ASSERT_TRUE(createRttController());
}
TEST_F(WifiChipV2_AwareIfaceCombinationTest, SelectTxScenarioWithOnlySta) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_EQ(createIface(IfaceType::STA), "wlan0");
EXPECT_CALL(*legacy_hal_, selectTxPowerScenario("wlan0", testing::_))
.WillOnce(testing::Return(legacy_hal::WIFI_SUCCESS));
@@ -665,7 +670,7 @@
}
TEST_F(WifiChipV2_AwareIfaceCombinationTest, SelectTxScenarioWithOnlyAp) {
- findModeAndConfigureForIfaceType(IfaceType::AP);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::AP);
ASSERT_EQ(createIface(IfaceType::AP), "wlan1");
EXPECT_CALL(*legacy_hal_, selectTxPowerScenario("wlan1", testing::_))
.WillOnce(testing::Return(legacy_hal::WIFI_SUCCESS));
@@ -675,7 +680,7 @@
}
TEST_F(WifiChipV2_AwareIfaceCombinationTest, InvalidateAndRemoveNanOnStaRemove) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_EQ(createIface(IfaceType::STA), "wlan0");
// Create NAN iface
@@ -711,7 +716,7 @@
}
TEST_F(WifiChipV2_AwareIfaceCombinationTest, InvalidateAndRemoveRttControllerOnStaRemove) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_EQ(createIface(IfaceType::STA), "wlan0");
// Create RTT controller
@@ -735,7 +740,7 @@
TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateNanWithSharedNanIface) {
property_set("wifi.aware.interface", nullptr);
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_EQ(createIface(IfaceType::STA), "wlan0");
ASSERT_EQ(createIface(IfaceType::NAN), "wlan0");
removeIface(IfaceType::NAN, "wlan0");
@@ -744,7 +749,7 @@
TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateNanWithDedicatedNanIface) {
property_set("wifi.aware.interface", "aware0");
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_EQ(createIface(IfaceType::STA), "wlan0");
EXPECT_CALL(*iface_util_, ifNameToIndex("aware0")).WillOnce(testing::Return(4));
EXPECT_CALL(*iface_util_, setUpState("aware0", true)).WillOnce(testing::Return(true));
@@ -764,7 +769,7 @@
};
TEST_F(WifiChipV1_AwareDisabledApIfaceCombinationTest, StaMode_CreateSta_ShouldSucceed) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_FALSE(createIface(IfaceType::STA).empty());
ASSERT_TRUE(createIface(IfaceType::AP).empty());
}
@@ -779,7 +784,7 @@
};
TEST_F(WifiChipV2_AwareDisabledApIfaceCombinationTest, CreateSta_ShouldSucceed) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_FALSE(createIface(IfaceType::STA).empty());
ASSERT_TRUE(createIface(IfaceType::AP).empty());
}
@@ -794,7 +799,7 @@
};
TEST_F(WifiChip_MultiIfaceTest, Create3Sta) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_FALSE(createIface(IfaceType::STA).empty());
ASSERT_FALSE(createIface(IfaceType::STA).empty());
ASSERT_FALSE(createIface(IfaceType::STA).empty());
@@ -807,7 +812,7 @@
property_set("wifi.interface.2", "");
property_set("wifi.interface", "");
property_set("wifi.concurrent.interface", "");
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_EQ(createIface(IfaceType::STA), "wlan0");
ASSERT_EQ(createIface(IfaceType::STA), "wlan1");
ASSERT_EQ(createIface(IfaceType::STA), "wlan2");
@@ -819,7 +824,7 @@
property_set("wifi.interface.2", "test2");
property_set("wifi.interface", "bad0");
property_set("wifi.concurrent.interface", "bad1");
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_EQ(createIface(IfaceType::STA), "bad0");
ASSERT_EQ(createIface(IfaceType::STA), "bad1");
ASSERT_EQ(createIface(IfaceType::STA), "test2");
@@ -831,14 +836,14 @@
property_set("wifi.interface.2", "");
property_set("wifi.interface", "testA0");
property_set("wifi.concurrent.interface", "testA1");
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
ASSERT_EQ(createIface(IfaceType::STA), "testA0");
ASSERT_EQ(createIface(IfaceType::STA), "testA1");
ASSERT_EQ(createIface(IfaceType::STA), "wlan2");
}
TEST_F(WifiChip_MultiIfaceTest, CreateApStartsWithIdx1) {
- findModeAndConfigureForIfaceType(IfaceType::STA);
+ findModeAndConfigureForIfaceType(IfaceConcurrencyType::STA);
// First AP will be slotted to wlan1.
ASSERT_EQ(createIface(IfaceType::AP), "wlan1");
// First STA will be slotted to wlan0.
diff --git a/wifi/1.6/default/wifi_chip.cpp b/wifi/1.6/default/wifi_chip.cpp
index 4fff770..0e2accf 100644
--- a/wifi/1.6/default/wifi_chip.cpp
+++ b/wifi/1.6/default/wifi_chip.cpp
@@ -728,6 +728,11 @@
&WifiChip::getSupportedRadioCombinationsMatrixInternal, hidl_status_cb);
}
+Return<void> WifiChip::getAvailableModes_1_6(getAvailableModes_1_6_cb hidl_status_cb) {
+ return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID,
+ &WifiChip::getAvailableModesInternal_1_6, hidl_status_cb);
+}
+
void WifiChip::invalidateAndRemoveAllIfaces() {
invalidateAndClearBridgedApAll();
invalidateAndClearAll(ap_ifaces_);
@@ -784,9 +789,10 @@
return {createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED), 0};
}
-std::pair<WifiStatus, std::vector<V1_4::IWifiChip::ChipMode>>
+std::pair<WifiStatus, std::vector<V1_0::IWifiChip::ChipMode>>
WifiChip::getAvailableModesInternal() {
- return {createWifiStatus(WifiStatusCode::SUCCESS), modes_};
+ // Deprecated support -- use getAvailableModes_1_6.
+ return {createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED), {}};
}
WifiStatus WifiChip::configureChipInternal(
@@ -910,7 +916,7 @@
}
std::pair<WifiStatus, sp<V1_5::IWifiApIface>> WifiChip::createApIfaceInternal() {
- if (!canCurrentModeSupportIfaceOfTypeWithCurrentIfaces(IfaceType::AP)) {
+ if (!canCurrentModeSupportConcurrencyTypeWithCurrentTypes(IfaceConcurrencyType::AP)) {
return {createWifiStatus(WifiStatusCode::ERROR_NOT_AVAILABLE), {}};
}
std::string ifname = allocateApIfaceName();
@@ -923,7 +929,7 @@
}
std::pair<WifiStatus, sp<V1_5::IWifiApIface>> WifiChip::createBridgedApIfaceInternal() {
- if (!canCurrentModeSupportIfaceOfTypeWithCurrentIfaces(IfaceType::AP)) {
+ if (!canCurrentModeSupportConcurrencyTypeWithCurrentTypes(IfaceConcurrencyType::AP_BRIDGED)) {
return {createWifiStatus(WifiStatusCode::ERROR_NOT_AVAILABLE), {}};
}
std::vector<std::string> ap_instances = allocateBridgedApInstanceNames();
@@ -1040,7 +1046,7 @@
}
std::pair<WifiStatus, sp<V1_4::IWifiNanIface>> WifiChip::createNanIfaceInternal() {
- if (!canCurrentModeSupportIfaceOfTypeWithCurrentIfaces(IfaceType::NAN)) {
+ if (!canCurrentModeSupportConcurrencyTypeWithCurrentTypes(IfaceConcurrencyType::NAN)) {
return {createWifiStatus(WifiStatusCode::ERROR_NOT_AVAILABLE), {}};
}
bool is_dedicated_iface = true;
@@ -1092,7 +1098,7 @@
}
std::pair<WifiStatus, sp<IWifiP2pIface>> WifiChip::createP2pIfaceInternal() {
- if (!canCurrentModeSupportIfaceOfTypeWithCurrentIfaces(IfaceType::P2P)) {
+ if (!canCurrentModeSupportConcurrencyTypeWithCurrentTypes(IfaceConcurrencyType::P2P)) {
return {createWifiStatus(WifiStatusCode::ERROR_NOT_AVAILABLE), {}};
}
std::string ifname = getPredefinedP2pIfaceName();
@@ -1136,7 +1142,7 @@
}
std::pair<WifiStatus, sp<V1_6::IWifiStaIface>> WifiChip::createStaIfaceInternal() {
- if (!canCurrentModeSupportIfaceOfTypeWithCurrentIfaces(IfaceType::STA)) {
+ if (!canCurrentModeSupportConcurrencyTypeWithCurrentTypes(IfaceConcurrencyType::STA)) {
return {createWifiStatus(WifiStatusCode::ERROR_NOT_AVAILABLE), {}};
}
std::string ifname = allocateStaIfaceName();
@@ -1436,7 +1442,8 @@
std::pair<WifiStatus, sp<V1_6::IWifiRttController>> WifiChip::createRttControllerInternal_1_6(
const sp<IWifiIface>& bound_iface) {
- if (sta_ifaces_.size() == 0 && !canCurrentModeSupportIfaceOfType(IfaceType::STA)) {
+ if (sta_ifaces_.size() == 0 &&
+ !canCurrentModeSupportConcurrencyTypeWithCurrentTypes(IfaceConcurrencyType::STA)) {
LOG(ERROR) << "createRttControllerInternal_1_6: Chip cannot support STAs "
"(and RTT by extension)";
return {createWifiStatus(WifiStatusCode::ERROR_NOT_AVAILABLE), {}};
@@ -1489,6 +1496,11 @@
return {createWifiStatus(WifiStatusCode::SUCCESS), hidl_matrix};
}
+std::pair<WifiStatus, std::vector<V1_6::IWifiChip::ChipMode>>
+WifiChip::getAvailableModesInternal_1_6() {
+ return {createWifiStatus(WifiStatusCode::SUCCESS), modes_};
+}
+
WifiStatus WifiChip::handleChipConfiguration(
/* NONNULL */ std::unique_lock<std::recursive_mutex>* lock, ChipModeId mode_id) {
// If the chip is already configured in a different mode, stop
@@ -1606,7 +1618,8 @@
return createWifiStatusFromLegacyError(legacy_status);
}
-std::vector<V1_4::IWifiChip::ChipIfaceCombination> WifiChip::getCurrentModeIfaceCombinations() {
+std::vector<V1_6::IWifiChip::ChipConcurrencyCombination>
+WifiChip::getCurrentModeConcurrencyCombinations() {
if (!isValidModeId(current_mode_id_)) {
LOG(ERROR) << "Chip not configured in a mode yet";
return {};
@@ -1616,27 +1629,39 @@
return mode.availableCombinations;
}
}
- CHECK(0) << "Expected to find iface combinations for current mode!";
+ CHECK(0) << "Expected to find concurrency combinations for current mode!";
return {};
}
-// Returns a map indexed by IfaceType with the number of ifaces currently
-// created of the corresponding type.
-std::map<IfaceType, size_t> WifiChip::getCurrentIfaceCombination() {
- std::map<IfaceType, size_t> iface_counts;
- iface_counts[IfaceType::AP] = ap_ifaces_.size();
- iface_counts[IfaceType::NAN] = nan_ifaces_.size();
- iface_counts[IfaceType::P2P] = p2p_ifaces_.size();
- iface_counts[IfaceType::STA] = sta_ifaces_.size();
+// Returns a map indexed by IfaceConcurrencyType with the number of ifaces currently
+// created of the corresponding concurrency type.
+std::map<IfaceConcurrencyType, size_t> WifiChip::getCurrentConcurrencyCombination() {
+ std::map<IfaceConcurrencyType, size_t> iface_counts;
+ uint32_t num_ap = 0;
+ uint32_t num_ap_bridged = 0;
+ for (const auto& ap_iface : ap_ifaces_) {
+ std::string ap_iface_name = ap_iface->getName();
+ if (br_ifaces_ap_instances_.count(ap_iface_name) > 0 &&
+ br_ifaces_ap_instances_[ap_iface_name].size() > 1) {
+ num_ap_bridged++;
+ } else {
+ num_ap++;
+ }
+ }
+ iface_counts[IfaceConcurrencyType::AP] = num_ap;
+ iface_counts[IfaceConcurrencyType::AP_BRIDGED] = num_ap_bridged;
+ iface_counts[IfaceConcurrencyType::NAN] = nan_ifaces_.size();
+ iface_counts[IfaceConcurrencyType::P2P] = p2p_ifaces_.size();
+ iface_counts[IfaceConcurrencyType::STA] = sta_ifaces_.size();
return iface_counts;
}
-// This expands the provided iface combinations to a more parseable
+// This expands the provided concurrency combinations to a more parseable
// form. Returns a vector of available combinations possible with the number
-// of ifaces of each type in the combination.
-// This method is a port of HalDeviceManager.expandIfaceCombos() from framework.
-std::vector<std::map<IfaceType, size_t>> WifiChip::expandIfaceCombinations(
- const V1_4::IWifiChip::ChipIfaceCombination& combination) {
+// of each concurrency type in the combination.
+// This method is a port of HalDeviceManager.expandConcurrencyCombos() from framework.
+std::vector<std::map<IfaceConcurrencyType, size_t>> WifiChip::expandConcurrencyCombinations(
+ const V1_6::IWifiChip::ChipConcurrencyCombination& combination) {
uint32_t num_expanded_combos = 1;
for (const auto& limit : combination.limits) {
for (uint32_t i = 0; i < limit.maxIfaces; i++) {
@@ -1644,12 +1669,14 @@
}
}
- // Allocate the vector of expanded combos and reset all iface counts to 0
+ // Allocate the vector of expanded combos and reset all concurrency type counts to 0
// in each combo.
- std::vector<std::map<IfaceType, size_t>> expanded_combos;
+ std::vector<std::map<IfaceConcurrencyType, size_t>> expanded_combos;
expanded_combos.resize(num_expanded_combos);
for (auto& expanded_combo : expanded_combos) {
- for (const auto type : {IfaceType::AP, IfaceType::NAN, IfaceType::P2P, IfaceType::STA}) {
+ for (const auto type :
+ {IfaceConcurrencyType::AP, IfaceConcurrencyType::AP_BRIDGED, IfaceConcurrencyType::NAN,
+ IfaceConcurrencyType::P2P, IfaceConcurrencyType::STA}) {
expanded_combo[type] = 0;
}
}
@@ -1666,12 +1693,15 @@
return expanded_combos;
}
-bool WifiChip::canExpandedIfaceComboSupportIfaceOfTypeWithCurrentIfaces(
- const std::map<IfaceType, size_t>& expanded_combo, IfaceType requested_type) {
- const auto current_combo = getCurrentIfaceCombination();
+bool WifiChip::canExpandedConcurrencyComboSupportConcurrencyTypeWithCurrentTypes(
+ const std::map<IfaceConcurrencyType, size_t>& expanded_combo,
+ IfaceConcurrencyType requested_type) {
+ const auto current_combo = getCurrentConcurrencyCombination();
// Check if we have space for 1 more iface of |type| in this combo
- for (const auto type : {IfaceType::AP, IfaceType::NAN, IfaceType::P2P, IfaceType::STA}) {
+ for (const auto type :
+ {IfaceConcurrencyType::AP, IfaceConcurrencyType::AP_BRIDGED, IfaceConcurrencyType::NAN,
+ IfaceConcurrencyType::P2P, IfaceConcurrencyType::STA}) {
size_t num_ifaces_needed = current_combo.at(type);
if (type == requested_type) {
num_ifaces_needed++;
@@ -1685,21 +1715,22 @@
}
// This method does the following:
-// a) Enumerate all possible iface combos by expanding the current
-// ChipIfaceCombination.
-// b) Check if the requested iface type can be added to the current mode
-// with the iface combination that is already active.
-bool WifiChip::canCurrentModeSupportIfaceOfTypeWithCurrentIfaces(IfaceType requested_type) {
+// a) Enumerate all possible concurrency combos by expanding the current
+// ChipConcurrencyCombination.
+// b) Check if the requested concurrency type can be added to the current mode
+// with the concurrency combination that is already active.
+bool WifiChip::canCurrentModeSupportConcurrencyTypeWithCurrentTypes(
+ IfaceConcurrencyType requested_type) {
if (!isValidModeId(current_mode_id_)) {
LOG(ERROR) << "Chip not configured in a mode yet";
return false;
}
- const auto combinations = getCurrentModeIfaceCombinations();
+ const auto combinations = getCurrentModeConcurrencyCombinations();
for (const auto& combination : combinations) {
- const auto expanded_combos = expandIfaceCombinations(combination);
+ const auto expanded_combos = expandConcurrencyCombinations(combination);
for (const auto& expanded_combo : expanded_combos) {
- if (canExpandedIfaceComboSupportIfaceOfTypeWithCurrentIfaces(expanded_combo,
- requested_type)) {
+ if (canExpandedConcurrencyComboSupportConcurrencyTypeWithCurrentTypes(expanded_combo,
+ requested_type)) {
return true;
}
}
@@ -1707,15 +1738,17 @@
return false;
}
-// Note: This does not consider ifaces already active. It only checks if the
-// provided expanded iface combination can support the requested combo.
-bool WifiChip::canExpandedIfaceComboSupportIfaceCombo(
- const std::map<IfaceType, size_t>& expanded_combo,
- const std::map<IfaceType, size_t>& req_combo) {
- // Check if we have space for 1 more iface of |type| in this combo
- for (const auto type : {IfaceType::AP, IfaceType::NAN, IfaceType::P2P, IfaceType::STA}) {
+// Note: This does not consider concurrency types already active. It only checks if the
+// provided expanded concurrency combination can support the requested combo.
+bool WifiChip::canExpandedConcurrencyComboSupportConcurrencyCombo(
+ const std::map<IfaceConcurrencyType, size_t>& expanded_combo,
+ const std::map<IfaceConcurrencyType, size_t>& req_combo) {
+ // Check if we have space for 1 more |type| in this combo
+ for (const auto type :
+ {IfaceConcurrencyType::AP, IfaceConcurrencyType::AP_BRIDGED, IfaceConcurrencyType::NAN,
+ IfaceConcurrencyType::P2P, IfaceConcurrencyType::STA}) {
if (req_combo.count(type) == 0) {
- // Iface of "type" not in the req_combo.
+ // Concurrency type not in the req_combo.
continue;
}
size_t num_ifaces_needed = req_combo.at(type);
@@ -1727,21 +1760,22 @@
return true;
}
// This method does the following:
-// a) Enumerate all possible iface combos by expanding the current
-// ChipIfaceCombination.
-// b) Check if the requested iface combo can be added to the current mode.
-// Note: This does not consider ifaces already active. It only checks if the
+// a) Enumerate all possible concurrency combos by expanding the current
+// ChipConcurrencyCombination.
+// b) Check if the requested concurrency combo can be added to the current mode.
+// Note: This does not consider concurrency types already active. It only checks if the
// current mode can support the requested combo.
-bool WifiChip::canCurrentModeSupportIfaceCombo(const std::map<IfaceType, size_t>& req_combo) {
+bool WifiChip::canCurrentModeSupportConcurrencyCombo(
+ const std::map<IfaceConcurrencyType, size_t>& req_combo) {
if (!isValidModeId(current_mode_id_)) {
LOG(ERROR) << "Chip not configured in a mode yet";
return false;
}
- const auto combinations = getCurrentModeIfaceCombinations();
+ const auto combinations = getCurrentModeConcurrencyCombinations();
for (const auto& combination : combinations) {
- const auto expanded_combos = expandIfaceCombinations(combination);
+ const auto expanded_combos = expandConcurrencyCombinations(combination);
for (const auto& expanded_combo : expanded_combos) {
- if (canExpandedIfaceComboSupportIfaceCombo(expanded_combo, req_combo)) {
+ if (canExpandedConcurrencyComboSupportConcurrencyCombo(expanded_combo, req_combo)) {
return true;
}
}
@@ -1750,14 +1784,14 @@
}
// This method does the following:
-// a) Enumerate all possible iface combos by expanding the current
-// ChipIfaceCombination.
-// b) Check if the requested iface type can be added to the current mode.
-bool WifiChip::canCurrentModeSupportIfaceOfType(IfaceType requested_type) {
- // Check if we can support at least 1 iface of type.
- std::map<IfaceType, size_t> req_iface_combo;
+// a) Enumerate all possible concurrency combos by expanding the current
+// ChipConcurrencyCombination.
+// b) Check if the requested concurrency type can be added to the current mode.
+bool WifiChip::canCurrentModeSupportConcurrencyType(IfaceConcurrencyType requested_type) {
+ // Check if we can support at least 1 of the requested concurrency type.
+ std::map<IfaceConcurrencyType, size_t> req_iface_combo;
req_iface_combo[requested_type] = 1;
- return canCurrentModeSupportIfaceCombo(req_iface_combo);
+ return canCurrentModeSupportConcurrencyCombo(req_iface_combo);
}
bool WifiChip::isValidModeId(ChipModeId mode_id) {
@@ -1771,17 +1805,17 @@
bool WifiChip::isStaApConcurrencyAllowedInCurrentMode() {
// Check if we can support at least 1 STA & 1 AP concurrently.
- std::map<IfaceType, size_t> req_iface_combo;
- req_iface_combo[IfaceType::AP] = 1;
- req_iface_combo[IfaceType::STA] = 1;
- return canCurrentModeSupportIfaceCombo(req_iface_combo);
+ std::map<IfaceConcurrencyType, size_t> req_iface_combo;
+ req_iface_combo[IfaceConcurrencyType::STA] = 1;
+ req_iface_combo[IfaceConcurrencyType::AP] = 1;
+ return canCurrentModeSupportConcurrencyCombo(req_iface_combo);
}
bool WifiChip::isDualStaConcurrencyAllowedInCurrentMode() {
// Check if we can support at least 2 STA concurrently.
- std::map<IfaceType, size_t> req_iface_combo;
- req_iface_combo[IfaceType::STA] = 2;
- return canCurrentModeSupportIfaceCombo(req_iface_combo);
+ std::map<IfaceConcurrencyType, size_t> req_iface_combo;
+ req_iface_combo[IfaceConcurrencyType::STA] = 2;
+ return canCurrentModeSupportConcurrencyCombo(req_iface_combo);
}
std::string WifiChip::getFirstActiveWlanIfaceName() {
diff --git a/wifi/1.6/default/wifi_chip.h b/wifi/1.6/default/wifi_chip.h
index 13d62fb..f952a68 100644
--- a/wifi/1.6/default/wifi_chip.h
+++ b/wifi/1.6/default/wifi_chip.h
@@ -17,6 +17,11 @@
#ifndef WIFI_CHIP_H_
#define WIFI_CHIP_H_
+// HACK: NAN is a macro defined in math.h, which can be included in various
+// headers. This wifi HAL uses an enum called NAN, which does not compile when
+// the macro is defined. Undefine NAN to work around it.
+#undef NAN
+
#include <list>
#include <map>
#include <mutex>
@@ -162,6 +167,7 @@
getUsableChannels_1_6_cb _hidl_cb) override;
Return<void> getSupportedRadioCombinationsMatrix(
getSupportedRadioCombinationsMatrix_cb hidl_status_cb) override;
+ Return<void> getAvailableModes_1_6(getAvailableModes_1_6_cb hidl_status_cb) override;
private:
void invalidateAndRemoveAllIfaces();
@@ -175,7 +181,7 @@
WifiStatus registerEventCallbackInternal(
const sp<V1_0::IWifiChipEventCallback>& event_callback);
std::pair<WifiStatus, uint32_t> getCapabilitiesInternal();
- std::pair<WifiStatus, std::vector<ChipMode>> getAvailableModesInternal();
+ std::pair<WifiStatus, std::vector<V1_0::IWifiChip::ChipMode>> getAvailableModesInternal();
WifiStatus configureChipInternal(std::unique_lock<std::recursive_mutex>* lock,
ChipModeId mode_id);
std::pair<WifiStatus, uint32_t> getModeInternal();
@@ -239,17 +245,21 @@
ChipModeId mode_id);
WifiStatus registerDebugRingBufferCallback();
WifiStatus registerRadioModeChangeCallback();
- std::vector<V1_4::IWifiChip::ChipIfaceCombination> getCurrentModeIfaceCombinations();
- std::map<IfaceType, size_t> getCurrentIfaceCombination();
- std::vector<std::map<IfaceType, size_t>> expandIfaceCombinations(
- const V1_4::IWifiChip::ChipIfaceCombination& combination);
- bool canExpandedIfaceComboSupportIfaceOfTypeWithCurrentIfaces(
- const std::map<IfaceType, size_t>& expanded_combo, IfaceType requested_type);
- bool canCurrentModeSupportIfaceOfTypeWithCurrentIfaces(IfaceType requested_type);
- bool canExpandedIfaceComboSupportIfaceCombo(const std::map<IfaceType, size_t>& expanded_combo,
- const std::map<IfaceType, size_t>& req_combo);
- bool canCurrentModeSupportIfaceCombo(const std::map<IfaceType, size_t>& req_combo);
- bool canCurrentModeSupportIfaceOfType(IfaceType requested_type);
+ std::vector<V1_6::IWifiChip::ChipConcurrencyCombination>
+ getCurrentModeConcurrencyCombinations();
+ std::map<IfaceConcurrencyType, size_t> getCurrentConcurrencyCombination();
+ std::vector<std::map<IfaceConcurrencyType, size_t>> expandConcurrencyCombinations(
+ const V1_6::IWifiChip::ChipConcurrencyCombination& combination);
+ bool canExpandedConcurrencyComboSupportConcurrencyTypeWithCurrentTypes(
+ const std::map<IfaceConcurrencyType, size_t>& expanded_combo,
+ IfaceConcurrencyType requested_type);
+ bool canCurrentModeSupportConcurrencyTypeWithCurrentTypes(IfaceConcurrencyType requested_type);
+ bool canExpandedConcurrencyComboSupportConcurrencyCombo(
+ const std::map<IfaceConcurrencyType, size_t>& expanded_combo,
+ const std::map<IfaceConcurrencyType, size_t>& req_combo);
+ bool canCurrentModeSupportConcurrencyCombo(
+ const std::map<IfaceConcurrencyType, size_t>& req_combo);
+ bool canCurrentModeSupportConcurrencyType(IfaceConcurrencyType requested_type);
bool isValidModeId(ChipModeId mode_id);
bool isStaApConcurrencyAllowedInCurrentMode();
bool isDualStaConcurrencyAllowedInCurrentMode();
@@ -270,6 +280,7 @@
std::pair<WifiStatus, std::vector<V1_6::WifiUsableChannel>> getUsableChannelsInternal_1_6(
WifiBand band, uint32_t ifaceModeMask, uint32_t filterMask);
std::pair<WifiStatus, WifiRadioCombinationMatrix> getSupportedRadioCombinationsMatrixInternal();
+ std::pair<WifiStatus, std::vector<V1_6::IWifiChip::ChipMode>> getAvailableModesInternal_1_6();
ChipId chip_id_;
std::weak_ptr<legacy_hal::WifiLegacyHal> legacy_hal_;
@@ -285,7 +296,7 @@
// Members pertaining to chip configuration.
uint32_t current_mode_id_;
std::mutex lock_t;
- std::vector<V1_4::IWifiChip::ChipMode> modes_;
+ std::vector<V1_6::IWifiChip::ChipMode> modes_;
// The legacy ring buffer callback API has only a global callback
// registration mechanism. Use this to check if we have already
// registered a callback.
diff --git a/wifi/1.6/default/wifi_feature_flags.cpp b/wifi/1.6/default/wifi_feature_flags.cpp
index 71319e1..e80a3cd 100644
--- a/wifi/1.6/default/wifi_feature_flags.cpp
+++ b/wifi/1.6/default/wifi_feature_flags.cpp
@@ -29,8 +29,8 @@
namespace feature_flags {
using V1_0::ChipModeId;
-using V1_0::IfaceType;
using V1_0::IWifiChip;
+using V1_6::IfaceConcurrencyType;
/* The chip may either have a single mode supporting any number of combinations,
* or a fixed dual-mode (so it involves firmware loading to switch between
@@ -42,9 +42,9 @@
* WIFI_HAL_INTERFACE_COMBINATIONS := {{{STA, AP}, 1}, {{P2P, NAN}, 1}},
* WIFI_HAL_INTERFACE_COMBINATIONS += {{{STA}, 1}, {{AP}, 2}}
* What means:
- * Interface combination 1: 1 STA or AP and 1 P2P or NAN concurrent iface
+ * Interface concurrency combination 1: 1 STA or AP and 1 P2P or NAN concurrent iface
* operations.
- * Interface combination 2: 1 STA and 2 AP concurrent iface operations.
+ * Interface concurrency combination 2: 1 STA and 2 AP concurrent iface operations.
*
* For backward compatibility, the following makefile flags can be used to
* generate combinations list:
@@ -53,20 +53,20 @@
* - WIFI_HIDL_FEATURE_AWARE
* However, they are ignored if WIFI_HAL_INTERFACE_COMBINATIONS was provided.
* With WIFI_HIDL_FEATURE_DUAL_INTERFACE flag set, there is a single mode with
- * two interface combinations:
- * Interface Combination 1: Will support 1 STA and 1 P2P or NAN (optional)
+ * two concurrency combinations:
+ * Interface Concurrency Combination 1: Will support 1 STA and 1 P2P or NAN (optional)
* concurrent iface operations.
- * Interface Combination 2: Will support 1 STA and 1 AP concurrent
+ * Interface Concurrency Combination 2: Will support 1 STA and 1 AP concurrent
* iface operations.
*
* The only dual-mode configuration supported is for alternating STA and AP
* mode, that may involve firmware reloading. In such case, there are 2 separate
- * modes of operation with 1 interface combination each:
+ * modes of operation with 1 concurrency combination each:
* Mode 1 (STA mode): Will support 1 STA and 1 P2P or NAN (optional)
* concurrent iface operations.
* Mode 2 (AP mode): Will support 1 AP iface operation.
*
- * If Aware is enabled, the iface combination will be modified to support either
+ * If Aware is enabled, the concurrency combination will be modified to support either
* P2P or NAN in place of just P2P.
*/
// clang-format off
@@ -117,79 +117,87 @@
* The main point here is to simplify the syntax required by
* WIFI_HAL_INTERFACE_COMBINATIONS.
*/
-struct ChipIfaceCombination : public hidl_vec<IWifiChip::ChipIfaceCombinationLimit> {
- ChipIfaceCombination(const std::initializer_list<IWifiChip::ChipIfaceCombinationLimit> list)
+struct ChipConcurrencyCombination
+ : public hidl_vec<V1_6::IWifiChip::ChipConcurrencyCombinationLimit> {
+ ChipConcurrencyCombination(
+ const std::initializer_list<V1_6::IWifiChip::ChipConcurrencyCombinationLimit> list)
: hidl_vec(list) {}
- operator IWifiChip::ChipIfaceCombination() const { return {*this}; }
+ operator V1_6::IWifiChip::ChipConcurrencyCombination() const { return {*this}; }
- static hidl_vec<IWifiChip::ChipIfaceCombination> make_vec(
- const std::initializer_list<ChipIfaceCombination> list) {
- return hidl_vec<IWifiChip::ChipIfaceCombination>( //
+ static hidl_vec<V1_6::IWifiChip::ChipConcurrencyCombination> make_vec(
+ const std::initializer_list<ChipConcurrencyCombination> list) {
+ return hidl_vec<V1_6::IWifiChip::ChipConcurrencyCombination>( //
std::begin(list), std::end(list));
}
};
-#define STA IfaceType::STA
-#define AP IfaceType::AP
-#define P2P IfaceType::P2P
-#define NAN IfaceType::NAN
-static const std::vector<IWifiChip::ChipMode> kChipModesPrimary{
- {kMainModeId, ChipIfaceCombination::make_vec({WIFI_HAL_INTERFACE_COMBINATIONS})},
+#define STA IfaceConcurrencyType::STA
+#define AP IfaceConcurrencyType::AP
+#define AP_BRIDGED IfaceConcurrencyType::AP_BRIDGED
+#define P2P IfaceConcurrencyType::P2P
+#define NAN IfaceConcurrencyType::NAN
+static const std::vector<V1_6::IWifiChip::ChipMode> kChipModesPrimary{
+ {kMainModeId, ChipConcurrencyCombination::make_vec({WIFI_HAL_INTERFACE_COMBINATIONS})},
#ifdef WIFI_HAL_INTERFACE_COMBINATIONS_AP
{chip_mode_ids::kV1Ap,
- ChipIfaceCombination::make_vec({WIFI_HAL_INTERFACE_COMBINATIONS_AP})},
+ ChipConcurrencyCombination::make_vec({WIFI_HAL_INTERFACE_COMBINATIONS_AP})},
#endif
};
-static const std::vector<IWifiChip::ChipMode> kChipModesSecondary{
+static const std::vector<V1_6::IWifiChip::ChipMode> kChipModesSecondary{
#ifdef WIFI_HAL_INTERFACE_COMBINATIONS_SECONDARY_CHIP
{chip_mode_ids::kV3,
- ChipIfaceCombination::make_vec({WIFI_HAL_INTERFACE_COMBINATIONS_SECONDARY_CHIP})},
+ ChipConcurrencyCombination::make_vec({WIFI_HAL_INTERFACE_COMBINATIONS_SECONDARY_CHIP})},
#endif
};
constexpr char kDebugPresetInterfaceCombinationIdxProperty[] =
"persist.vendor.debug.wifi.hal.preset_interface_combination_idx";
-// List of pre-defined interface combinations that can be enabled at runtime via
+// List of pre-defined concurrency combinations that can be enabled at runtime via
// setting the property: "kDebugPresetInterfaceCombinationIdxProperty" to the
// corresponding index value.
-static const std::vector<std::pair<std::string, std::vector<IWifiChip::ChipMode>>> kDebugChipModes{
- // Legacy combination - No STA/AP concurrencies.
- // 0 - (1 AP) or (1 STA + 1 of (P2P or NAN))
- {"No STA/AP Concurrency",
- {{kMainModeId,
- ChipIfaceCombination::make_vec({{{{AP}, 1}}, {{{STA}, 1}, {{P2P, NAN}, 1}}})}}},
+static const std::vector<std::pair<std::string, std::vector<V1_6::IWifiChip::ChipMode>>>
+ kDebugChipModes{// Legacy combination - No STA/AP concurrencies.
+ // 0 - (1 AP) or (1 STA + 1 of (P2P or NAN))
+ {"No STA/AP Concurrency",
+ {{kMainModeId, ChipConcurrencyCombination::make_vec(
+ {{{{AP}, 1}}, {{{STA}, 1}, {{P2P, NAN}, 1}}})}}},
- // STA + AP concurrency
- // 1 - (1 STA + 1 AP) or (1 STA + 1 of (P2P or NAN))
- {"STA + AP Concurrency",
- {{kMainModeId, ChipIfaceCombination::make_vec(
- {{{{STA}, 1}, {{AP}, 1}}, {{{STA}, 1}, {{P2P, NAN}, 1}}})}}},
+ // STA + AP concurrency
+ // 1 - (1 STA + 1 AP) or (1 STA + 1 of (P2P or NAN))
+ {"STA + AP Concurrency",
+ {{kMainModeId,
+ ChipConcurrencyCombination::make_vec(
+ {{{{STA}, 1}, {{AP}, 1}}, {{{STA}, 1}, {{P2P, NAN}, 1}}})}}},
- // STA + STA concurrency
- // 2 - (1 STA + 1 AP) or (2 STA + 1 of (P2P or NAN))
- {"Dual STA Concurrency",
- {{kMainModeId, ChipIfaceCombination::make_vec(
- {{{{STA}, 1}, {{AP}, 1}}, {{{STA}, 2}, {{P2P, NAN}, 1}}})}}},
+ // STA + STA concurrency
+ // 2 - (1 STA + 1 AP) or (2 STA + 1 of (P2P or NAN))
+ {"Dual STA Concurrency",
+ {{kMainModeId,
+ ChipConcurrencyCombination::make_vec(
+ {{{{STA}, 1}, {{AP}, 1}}, {{{STA}, 2}, {{P2P, NAN}, 1}}})}}},
- // AP + AP + STA concurrency
- // 3 - (1 STA + 2 AP) or (1 STA + 1 of (P2P or NAN))
- {"Dual AP Concurrency",
- {{kMainModeId, ChipIfaceCombination::make_vec(
- {{{{STA}, 1}, {{AP}, 2}}, {{{STA}, 1}, {{P2P, NAN}, 1}}})}}},
+ // AP + AP + STA concurrency
+ // 3 - (1 STA + 2 AP) or (1 STA + 1 of (P2P or NAN))
+ {"Dual AP Concurrency",
+ {{kMainModeId,
+ ChipConcurrencyCombination::make_vec(
+ {{{{STA}, 1}, {{AP}, 2}}, {{{STA}, 1}, {{P2P, NAN}, 1}}})}}},
- // STA + STA concurrency and AP + AP + STA concurrency
- // 4 - (1 STA + 2 AP) or (2 STA + 1 of (P2P or NAN))
- {"Dual STA & Dual AP Concurrency",
- {{kMainModeId, ChipIfaceCombination::make_vec(
- {{{{STA}, 1}, {{AP}, 2}}, {{{STA}, 2}, {{P2P, NAN}, 1}}})}}},
+ // STA + STA concurrency and AP + AP + STA concurrency
+ // 4 - (1 STA + 2 AP) or (2 STA + 1 of (P2P or NAN))
+ {"Dual STA & Dual AP Concurrency",
+ {{kMainModeId,
+ ChipConcurrencyCombination::make_vec(
+ {{{{STA}, 1}, {{AP}, 2}}, {{{STA}, 2}, {{P2P, NAN}, 1}}})}}},
- // STA + STA concurrency
- // 5 - (1 STA + 1 AP (bridged or single) | P2P | NAN), or (2 STA))
- {"Dual STA or STA plus single other interface",
- {{kMainModeId,
- ChipIfaceCombination::make_vec({{{{STA}, 1}, {{P2P, NAN, AP}, 1}}, {{{STA}, 2}}})}}}};
+ // STA + STA concurrency
+ // 5 - (1 STA + 1 AP (bridged or single) | P2P | NAN), or (2 STA))
+ {"Dual STA or STA plus single other interface",
+ {{kMainModeId, ChipConcurrencyCombination::make_vec(
+ {{{{STA}, 1}, {{P2P, NAN, AP, AP_BRIDGED}, 1}},
+ {{{STA}, 2}}})}}}};
#undef STA
#undef AP
@@ -206,13 +214,13 @@
WifiFeatureFlags::WifiFeatureFlags() {}
-std::vector<IWifiChip::ChipMode> WifiFeatureFlags::getChipModesForPrimary() {
+std::vector<V1_6::IWifiChip::ChipMode> WifiFeatureFlags::getChipModesForPrimary() {
std::array<char, PROPERTY_VALUE_MAX> buffer;
auto res = property_get(kDebugPresetInterfaceCombinationIdxProperty, buffer.data(), nullptr);
- // Debug propety not set, use the device preset interface combination.
+ // Debug property not set, use the device preset concurrency combination.
if (res <= 0) return kChipModesPrimary;
- // Debug propety set, use one of the debug preset interface combination.
+ // Debug property set, use one of the debug preset concurrency combination.
unsigned long idx = std::stoul(buffer.data());
if (idx >= kDebugChipModes.size()) {
LOG(ERROR) << "Invalid index set in property: "
@@ -220,14 +228,14 @@
return kChipModesPrimary;
}
std::string name;
- std::vector<IWifiChip::ChipMode> chip_modes;
+ std::vector<V1_6::IWifiChip::ChipMode> chip_modes;
std::tie(name, chip_modes) = kDebugChipModes[idx];
LOG(INFO) << "Using debug chip mode: <" << name
<< "> set via property: " << kDebugPresetInterfaceCombinationIdxProperty;
return chip_modes;
}
-std::vector<IWifiChip::ChipMode> WifiFeatureFlags::getChipModes(bool is_primary) {
+std::vector<V1_6::IWifiChip::ChipMode> WifiFeatureFlags::getChipModes(bool is_primary) {
return (is_primary) ? getChipModesForPrimary() : kChipModesSecondary;
}
diff --git a/wifi/1.6/default/wifi_feature_flags.h b/wifi/1.6/default/wifi_feature_flags.h
index d5844d9..1635341 100644
--- a/wifi/1.6/default/wifi_feature_flags.h
+++ b/wifi/1.6/default/wifi_feature_flags.h
@@ -17,7 +17,7 @@
#ifndef WIFI_FEATURE_FLAGS_H_
#define WIFI_FEATURE_FLAGS_H_
-#include <android/hardware/wifi/1.2/IWifiChip.h>
+#include <android/hardware/wifi/1.6/IWifiChip.h>
namespace android {
namespace hardware {
@@ -42,10 +42,10 @@
WifiFeatureFlags();
virtual ~WifiFeatureFlags() = default;
- virtual std::vector<V1_0::IWifiChip::ChipMode> getChipModes(bool is_primary);
+ virtual std::vector<V1_6::IWifiChip::ChipMode> getChipModes(bool is_primary);
private:
- std::vector<V1_0::IWifiChip::ChipMode> getChipModesForPrimary();
+ std::vector<V1_6::IWifiChip::ChipMode> getChipModesForPrimary();
};
} // namespace feature_flags
diff --git a/wifi/1.6/types.hal b/wifi/1.6/types.hal
index 80fdbd1..aed37fa 100644
--- a/wifi/1.6/types.hal
+++ b/wifi/1.6/types.hal
@@ -1312,3 +1312,29 @@
*/
vec<WifiRadioCombination> radioCombinations;
};
+
+/**
+ * List of interface concurrency types, used in reporting device concurrency capabilities.
+ */
+enum IfaceConcurrencyType : uint32_t {
+ /**
+ * Concurrency type for station mode.
+ */
+ STA,
+ /**
+ * Concurrency type of single-port AP mode.
+ */
+ AP,
+ /**
+ * Concurrency type of two-port bridged AP mode.
+ */
+ AP_BRIDGED,
+ /**
+ * Concurrency type of peer-to-peer mode.
+ */
+ P2P,
+ /**
+ * Concurrency type of neighborhood area network mode.
+ */
+ NAN,
+};
diff --git a/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/ApInfo.aidl b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/ApInfo.aidl
index bdbaadd..ca20f37 100644
--- a/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/ApInfo.aidl
+++ b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/ApInfo.aidl
@@ -37,7 +37,7 @@
String ifaceName;
String apIfaceInstance;
int freqMhz;
- android.hardware.wifi.hostapd.Bandwidth bandwidth;
+ android.hardware.wifi.hostapd.ChannelBandwidth channelBandwidth;
android.hardware.wifi.hostapd.Generation generation;
byte[] apIfaceInstanceMacAddress;
}
diff --git a/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/Bandwidth.aidl b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/ChannelBandwidth.aidl
similarity index 86%
rename from wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/Bandwidth.aidl
rename to wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/ChannelBandwidth.aidl
index 4d78640..6c1fd22 100644
--- a/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/Bandwidth.aidl
+++ b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/ChannelBandwidth.aidl
@@ -33,17 +33,18 @@
package android.hardware.wifi.hostapd;
@Backing(type="int") @VintfStability
-enum Bandwidth {
+enum ChannelBandwidth {
BANDWIDTH_INVALID = 0,
- BANDWIDTH_20_NOHT = 1,
- BANDWIDTH_20 = 2,
- BANDWIDTH_40 = 3,
- BANDWIDTH_80 = 4,
- BANDWIDTH_80P80 = 5,
- BANDWIDTH_160 = 6,
- BANDWIDTH_320 = 7,
- BANDWIDTH_2160 = 8,
- BANDWIDTH_4320 = 9,
- BANDWIDTH_6480 = 10,
- BANDWIDTH_8640 = 11,
+ BANDWIDTH_AUTO = 1,
+ BANDWIDTH_20_NOHT = 2,
+ BANDWIDTH_20 = 3,
+ BANDWIDTH_40 = 4,
+ BANDWIDTH_80 = 5,
+ BANDWIDTH_80P80 = 6,
+ BANDWIDTH_160 = 7,
+ BANDWIDTH_320 = 8,
+ BANDWIDTH_2160 = 9,
+ BANDWIDTH_4320 = 10,
+ BANDWIDTH_6480 = 11,
+ BANDWIDTH_8640 = 12,
}
diff --git a/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/HwModeParams.aidl b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/HwModeParams.aidl
index 8d8d7bb..d732bcb 100644
--- a/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/HwModeParams.aidl
+++ b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/HwModeParams.aidl
@@ -44,4 +44,5 @@
boolean enableHeTargetWakeTime;
boolean enableEdmg;
boolean enable80211BE;
+ android.hardware.wifi.hostapd.ChannelBandwidth maximumChannelBandwidth;
}
diff --git a/wifi/hostapd/aidl/android/hardware/wifi/hostapd/ApInfo.aidl b/wifi/hostapd/aidl/android/hardware/wifi/hostapd/ApInfo.aidl
index bf506b2..a6fe63b 100644
--- a/wifi/hostapd/aidl/android/hardware/wifi/hostapd/ApInfo.aidl
+++ b/wifi/hostapd/aidl/android/hardware/wifi/hostapd/ApInfo.aidl
@@ -16,7 +16,7 @@
package android.hardware.wifi.hostapd;
-import android.hardware.wifi.hostapd.Bandwidth;
+import android.hardware.wifi.hostapd.ChannelBandwidth;
import android.hardware.wifi.hostapd.Generation;
/**
@@ -44,9 +44,9 @@
int freqMhz;
/**
- * The operational bandwidth of the AP.
+ * The operational channel bandwidth of the AP.
*/
- Bandwidth bandwidth;
+ ChannelBandwidth channelBandwidth;
/**
* The operational mode of the AP (e.g. 11ac, 11ax).
diff --git a/wifi/hostapd/aidl/android/hardware/wifi/hostapd/Bandwidth.aidl b/wifi/hostapd/aidl/android/hardware/wifi/hostapd/Bandwidth.aidl
deleted file mode 100644
index e605153..0000000
--- a/wifi/hostapd/aidl/android/hardware/wifi/hostapd/Bandwidth.aidl
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2021 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.hostapd;
-
-/**
- * The channel bandwidth of the AP.
- */
-@VintfStability
-@Backing(type="int")
-enum Bandwidth {
- BANDWIDTH_INVALID = 0,
- BANDWIDTH_20_NOHT = 1,
- BANDWIDTH_20 = 2,
- BANDWIDTH_40 = 3,
- BANDWIDTH_80 = 4,
- BANDWIDTH_80P80 = 5,
- BANDWIDTH_160 = 6,
- BANDWIDTH_320 = 7,
- BANDWIDTH_2160 = 8,
- BANDWIDTH_4320 = 9,
- BANDWIDTH_6480 = 10,
- BANDWIDTH_8640 = 11,
-}
diff --git a/wifi/hostapd/aidl/android/hardware/wifi/hostapd/ChannelBandwidth.aidl b/wifi/hostapd/aidl/android/hardware/wifi/hostapd/ChannelBandwidth.aidl
new file mode 100644
index 0000000..8ea3952
--- /dev/null
+++ b/wifi/hostapd/aidl/android/hardware/wifi/hostapd/ChannelBandwidth.aidl
@@ -0,0 +1,77 @@
+/*
+ * Copyright (C) 2021 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.hostapd;
+
+/**
+ * The channel bandwidth of the AP.
+ */
+@VintfStability
+@Backing(type="int")
+enum ChannelBandwidth {
+ /**
+ * Invalid bandwidth value for AP
+ */
+ BANDWIDTH_INVALID = 0,
+ /**
+ * Channel bandwidth is auto-selected by the chip
+ */
+ BANDWIDTH_AUTO = 1,
+ /**
+ * AP channel bandwidth is 20 MHz but not HT
+ */
+ BANDWIDTH_20_NOHT = 2,
+ /**
+ * AP channel bandwidth is 20 MHz
+ */
+ BANDWIDTH_20 = 3,
+ /**
+ * AP channel bandwidth is 40 MHz
+ */
+ BANDWIDTH_40 = 4,
+ /**
+ * AP channel bandwidth is 80 MHz
+ */
+ BANDWIDTH_80 = 5,
+ /**
+ * AP channel bandwidth is 80+80 MHz
+ */
+ BANDWIDTH_80P80 = 6,
+ /**
+ * AP channel bandwidth is 160 MHz
+ */
+ BANDWIDTH_160 = 7,
+ /**
+ * AP channel bandwidth is 320 MHz
+ */
+ BANDWIDTH_320 = 8,
+ /**
+ * AP channel bandwidth is 2160 MHz
+ */
+ BANDWIDTH_2160 = 9,
+ /**
+ * AP channel bandwidth is 4320 MHz
+ */
+ BANDWIDTH_4320 = 10,
+ /**
+ * AP channel bandwidth is 6480 MHz
+ */
+ BANDWIDTH_6480 = 11,
+ /**
+ * AP channel bandwidth is 8640 MHz
+ */
+ BANDWIDTH_8640 = 12,
+}
diff --git a/wifi/hostapd/aidl/android/hardware/wifi/hostapd/HwModeParams.aidl b/wifi/hostapd/aidl/android/hardware/wifi/hostapd/HwModeParams.aidl
index e66a24a..320db9c 100644
--- a/wifi/hostapd/aidl/android/hardware/wifi/hostapd/HwModeParams.aidl
+++ b/wifi/hostapd/aidl/android/hardware/wifi/hostapd/HwModeParams.aidl
@@ -16,6 +16,8 @@
package android.hardware.wifi.hostapd;
+import android.hardware.wifi.hostapd.ChannelBandwidth;
+
/**
* Parameters to control the HW mode for the interface.
*/
@@ -74,4 +76,9 @@
* used with Extreme High Throughput.
*/
boolean enable80211BE;
+ /**
+ * Limit on maximum channel bandwidth for the softAp.
+ * For automatic selection with no limit use BANDWIDTH_AUTO
+ */
+ ChannelBandwidth maximumChannelBandwidth;
}