mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 11:36:00 +00:00
Merge "wifi: Upgrade hostapd HIDL to 1.3"
This commit is contained in:
@@ -537,7 +537,7 @@
|
||||
</hal>
|
||||
<hal format="hidl" optional="true">
|
||||
<name>android.hardware.wifi.hostapd</name>
|
||||
<version>1.0-2</version>
|
||||
<version>1.0-3</version>
|
||||
<interface>
|
||||
<name>IHostapd</name>
|
||||
<instance>default</instance>
|
||||
|
||||
@@ -25,11 +25,15 @@ cc_test {
|
||||
"VtsHalWifiHostapdV1_0TargetTestUtil",
|
||||
"android.hardware.wifi.hostapd@1.0",
|
||||
"android.hardware.wifi.hostapd@1.1",
|
||||
"android.hardware.wifi.hostapd@1.2",
|
||||
"android.hardware.wifi.hostapd@1.3",
|
||||
"android.hardware.wifi@1.0",
|
||||
"libgmock",
|
||||
"libwifi-system",
|
||||
"libwifi-system-iface",
|
||||
],
|
||||
test_suites: ["general-tests", "vts"],
|
||||
test_suites: [
|
||||
"general-tests",
|
||||
"vts",
|
||||
],
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
|
||||
#include <android/hardware/wifi/1.0/IWifi.h>
|
||||
#include <android/hardware/wifi/hostapd/1.1/IHostapd.h>
|
||||
#include <android/hardware/wifi/hostapd/1.3/IHostapd.h>
|
||||
|
||||
#include "hostapd_hidl_call_util.h"
|
||||
#include "hostapd_hidl_test_utils.h"
|
||||
@@ -43,6 +44,7 @@ constexpr unsigned char kNwSsid[] = {'t', 'e', 's', 't', '1',
|
||||
constexpr char kNwPassphrase[] = "test12345";
|
||||
constexpr int kIfaceChannel = 6;
|
||||
constexpr int kIfaceInvalidChannel = 567;
|
||||
|
||||
} // namespace
|
||||
|
||||
class HostapdHidlTest
|
||||
@@ -170,10 +172,17 @@ class IfaceCallback : public IHostapdCallback {
|
||||
}
|
||||
};
|
||||
|
||||
bool is_1_3(const sp<IHostapd>& hostapd) {
|
||||
sp<::android::hardware::wifi::hostapd::V1_3::IHostapd> hostapd_1_3 =
|
||||
::android::hardware::wifi::hostapd::V1_3::IHostapd::castFrom(hostapd);
|
||||
return hostapd_1_3.get() != nullptr;
|
||||
}
|
||||
|
||||
/*
|
||||
* RegisterCallback
|
||||
*/
|
||||
TEST_P(HostapdHidlTest, registerCallback) {
|
||||
if (is_1_3(hostapd_)) GTEST_SKIP() << "Ignore since current HIDL over 1.3";
|
||||
hostapd_->registerCallback(
|
||||
new IfaceCallback(), [](const HostapdStatus& status) {
|
||||
EXPECT_EQ(HostapdStatusCode::SUCCESS, status.code);
|
||||
|
||||
22
wifi/hostapd/1.3/Android.bp
Normal file
22
wifi/hostapd/1.3/Android.bp
Normal file
@@ -0,0 +1,22 @@
|
||||
// This file is autogenerated by hidl-gen -Landroidbp.
|
||||
|
||||
hidl_interface {
|
||||
name: "android.hardware.wifi.hostapd@1.3",
|
||||
root: "android.hardware",
|
||||
srcs: [
|
||||
"types.hal",
|
||||
"IHostapd.hal",
|
||||
"IHostapdCallback.hal",
|
||||
],
|
||||
interfaces: [
|
||||
"android.hardware.wifi.hostapd@1.0",
|
||||
"android.hardware.wifi.hostapd@1.1",
|
||||
"android.hardware.wifi.hostapd@1.2",
|
||||
"android.hardware.wifi.supplicant@1.0",
|
||||
"android.hidl.base@1.0",
|
||||
],
|
||||
gen_java: true,
|
||||
apex_available: [
|
||||
"com.android.wifi",
|
||||
],
|
||||
}
|
||||
44
wifi/hostapd/1.3/IHostapd.hal
Normal file
44
wifi/hostapd/1.3/IHostapd.hal
Normal file
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* Copyright 2020 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@1.3;
|
||||
|
||||
import @1.2::IHostapd;
|
||||
import @1.2::HostapdStatus;
|
||||
|
||||
import IHostapdCallback;
|
||||
/**
|
||||
* Top-level object for managing SoftAPs.
|
||||
*/
|
||||
interface IHostapd extends @1.2::IHostapd {
|
||||
/**
|
||||
* Register for callbacks from the hostapd service.
|
||||
*
|
||||
* These callbacks are invoked for global events that are not specific
|
||||
* to any interface or network. Registration of multiple callback
|
||||
* objects is supported. These objects must be deleted when the corresponding
|
||||
* client process is dead.
|
||||
*
|
||||
* @param callback An instance of the |IHostapdCallback| HIDL interface
|
||||
* object.
|
||||
* @return status Status of the operation.
|
||||
* Possible status codes:
|
||||
* |HostapdStatusCode.SUCCESS|,
|
||||
* |HostapdStatusCode.FAILURE_UNKNOWN|
|
||||
*/
|
||||
registerCallback_1_3(IHostapdCallback callback)
|
||||
generates (HostapdStatus status);
|
||||
};
|
||||
27
wifi/hostapd/1.3/IHostapdCallback.hal
Normal file
27
wifi/hostapd/1.3/IHostapdCallback.hal
Normal file
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Copyright 2020 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@1.3;
|
||||
|
||||
import @1.1::IHostapdCallback;
|
||||
import Generation;
|
||||
|
||||
/**
|
||||
* Top-level callback object for managing SoftAPs.
|
||||
*/
|
||||
interface IHostapdCallback extends @1.1::IHostapdCallback {
|
||||
oneway onInterfaceInfoChanged(string ifaceName, Generation generation);
|
||||
};
|
||||
37
wifi/hostapd/1.3/types.hal
Normal file
37
wifi/hostapd/1.3/types.hal
Normal file
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* Copyright 2020 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@1.3;
|
||||
|
||||
/**
|
||||
* The wifi generation which AP reside on.
|
||||
* It depends on hw mode and HT/VHT capabilities in hostapd.
|
||||
*
|
||||
* WIFI_STANDARD_LEGACY = (hw_mode is HOSTAPD_MODE_IEEE80211B) or
|
||||
* (hw_mode is HOSTAPD_MODE_IEEE80211G and HT is 0).
|
||||
* WIFI_STANDARD_11N = [hw_mode is HOSTAPD_MODE_IEEE80211G and (HT is 1 or HT40 is 1)] or
|
||||
* [hw_mode is HOSTAPD_MODE_IEEE80211A and VHT is 0].
|
||||
* WIFI_STANDARD_11AC = hw_mode is HOSTAPD_MODE_IEEE80211A and VHT is 1.
|
||||
* WIFI_STANDARD_11AX = hw_mode is HOSTAPD_MODE_IEEE80211AX.
|
||||
*/
|
||||
enum Generation : uint32_t {
|
||||
WIFI_STANDARD_UNKNOWN = -1,
|
||||
WIFI_STANDARD_LEGACY = 0,
|
||||
WIFI_STANDARD_11N = 1,
|
||||
WIFI_STANDARD_11AC = 2,
|
||||
WIFI_STANDARD_11AX = 3,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user