Update the Vendor HAL and compatibility matrix to

implement V2 of the Vendor HAL interface.

Also involves adding a default implementation of the
new method createApOrBridgedApIface().

Bug: 296069900
Test: m
Change-Id: Iea8aa0b66a23125c066d72b710004496d41defcb
This commit is contained in:
Gabriel Biren
2023-11-10 00:43:08 +00:00
parent 61430f49d1
commit aa9bd83dbd
5 changed files with 34 additions and 5 deletions

View File

@@ -648,7 +648,7 @@
</hal>
<hal format="aidl" optional="true" updatable-via-apex="true">
<name>android.hardware.wifi</name>
<version>1</version>
<version>1-2</version>
<interface>
<name>IWifi</name>
<instance>default</instance>

View File

@@ -105,7 +105,7 @@ cc_library_static {
"libwifi-hal",
"libwifi-system-iface",
"libxml2",
"android.hardware.wifi-V1-ndk",
"android.hardware.wifi-V2-ndk",
],
export_include_dirs: ["."],
@@ -132,7 +132,7 @@ cc_binary {
"libwifi-hal",
"libwifi-system-iface",
"libxml2",
"android.hardware.wifi-V1-ndk",
"android.hardware.wifi-V2-ndk",
],
static_libs: ["android.hardware.wifi-service-lib"],
init_rc: ["android.hardware.wifi-service.rc"],
@@ -161,7 +161,7 @@ cc_binary {
"libwifi-hal",
"libwifi-system-iface",
"libxml2",
"android.hardware.wifi-V1-ndk",
"android.hardware.wifi-V2-ndk",
],
static_libs: ["android.hardware.wifi-service-lib"],
init_rc: ["android.hardware.wifi-service-lazy.rc"],
@@ -192,7 +192,8 @@ cc_test {
static_libs: [
"libgmock",
"libgtest",
"android.hardware.wifi-V1-ndk",
"android.hardware.wifi-V2-ndk",
"android.hardware.wifi.common-V1-ndk",
"android.hardware.wifi-service-lib",
],
shared_libs: [

View File

@@ -1,6 +1,7 @@
<manifest version="1.0" type="device">
<hal format="aidl">
<name>android.hardware.wifi</name>
<version>2</version>
<fqname>IWifi/default</fqname>
</hal>
</manifest>

View File

@@ -369,6 +369,14 @@ ndk::ScopedAStatus WifiChip::createBridgedApIface(std::shared_ptr<IWifiApIface>*
&WifiChip::createBridgedApIfaceInternal, _aidl_return);
}
ndk::ScopedAStatus WifiChip::createApOrBridgedApIface(
IfaceConcurrencyType in_ifaceType, const std::vector<common::OuiKeyedData>& in_vendorData,
std::shared_ptr<IWifiApIface>* _aidl_return) {
return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID,
&WifiChip::createApOrBridgedApIfaceInternal, _aidl_return, in_ifaceType,
in_vendorData);
}
ndk::ScopedAStatus WifiChip::getApIfaceNames(std::vector<std::string>* _aidl_return) {
return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID,
&WifiChip::getApIfaceNamesInternal, _aidl_return);
@@ -854,6 +862,18 @@ WifiChip::createBridgedApIfaceInternal() {
return {iface, ndk::ScopedAStatus::ok()};
}
std::pair<std::shared_ptr<IWifiApIface>, ndk::ScopedAStatus>
WifiChip::createApOrBridgedApIfaceInternal(
IfaceConcurrencyType ifaceType, const std::vector<common::OuiKeyedData>& /* vendorData */) {
if (ifaceType == IfaceConcurrencyType::AP) {
return createApIfaceInternal();
} else if (ifaceType == IfaceConcurrencyType::AP_BRIDGED) {
return createBridgedApIfaceInternal();
} else {
return {nullptr, createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS)};
}
}
std::pair<std::vector<std::string>, ndk::ScopedAStatus> WifiChip::getApIfaceNamesInternal() {
if (ap_ifaces_.empty()) {
return {std::vector<std::string>(), ndk::ScopedAStatus::ok()};

View File

@@ -19,6 +19,7 @@
#include <aidl/android/hardware/wifi/BnWifiChip.h>
#include <aidl/android/hardware/wifi/IWifiRttController.h>
#include <aidl/android/hardware/wifi/common/OuiKeyedData.h>
#include <android-base/macros.h>
#include <list>
@@ -96,6 +97,10 @@ class WifiChip : public BnWifiChip {
ndk::ScopedAStatus requestFirmwareDebugDump(std::vector<uint8_t>* _aidl_return) override;
ndk::ScopedAStatus createApIface(std::shared_ptr<IWifiApIface>* _aidl_return) override;
ndk::ScopedAStatus createBridgedApIface(std::shared_ptr<IWifiApIface>* _aidl_return) override;
ndk::ScopedAStatus createApOrBridgedApIface(
IfaceConcurrencyType in_ifaceType,
const std::vector<common::OuiKeyedData>& in_vendorData,
std::shared_ptr<IWifiApIface>* _aidl_return) override;
ndk::ScopedAStatus getApIfaceNames(std::vector<std::string>* _aidl_return) override;
ndk::ScopedAStatus getApIface(const std::string& in_ifname,
std::shared_ptr<IWifiApIface>* _aidl_return) override;
@@ -176,6 +181,8 @@ class WifiChip : public BnWifiChip {
ndk::ScopedAStatus createVirtualApInterface(const std::string& apVirtIf);
std::pair<std::shared_ptr<IWifiApIface>, ndk::ScopedAStatus> createApIfaceInternal();
std::pair<std::shared_ptr<IWifiApIface>, ndk::ScopedAStatus> createBridgedApIfaceInternal();
std::pair<std::shared_ptr<IWifiApIface>, ndk::ScopedAStatus> createApOrBridgedApIfaceInternal(
IfaceConcurrencyType ifaceType, const std::vector<common::OuiKeyedData>& vendorData);
std::pair<std::vector<std::string>, ndk::ScopedAStatus> getApIfaceNamesInternal();
std::pair<std::shared_ptr<IWifiApIface>, ndk::ScopedAStatus> getApIfaceInternal(
const std::string& ifname);