Wifi: Add implementation for vendor HAL for 11be support
This commit adds the implementation for the HAL API changes
to enable 11be support.
Bug: 198746544
Test: Build Succeeds
Test: VTS test
Change-Id: I2d1f296856698951c2c0111200e7c7bf661da132
diff --git a/wifi/1.6/default/hidl_struct_util.cpp b/wifi/1.6/default/hidl_struct_util.cpp
index 3489c9e..2a6b131 100644
--- a/wifi/1.6/default/hidl_struct_util.cpp
+++ b/wifi/1.6/default/hidl_struct_util.cpp
@@ -438,7 +438,7 @@
bool convertLegacyWifiUsableChannelToHidl(
const legacy_hal::wifi_usable_channel& legacy_usable_channel,
- V1_5::WifiUsableChannel* hidl_usable_channel) {
+ V1_6::WifiUsableChannel* hidl_usable_channel) {
if (!hidl_usable_channel) {
return false;
}
@@ -454,13 +454,13 @@
bool convertLegacyWifiUsableChannelsToHidl(
const std::vector<legacy_hal::wifi_usable_channel>& legacy_usable_channels,
- std::vector<V1_5::WifiUsableChannel>* hidl_usable_channels) {
+ std::vector<V1_6::WifiUsableChannel>* hidl_usable_channels) {
if (!hidl_usable_channels) {
return false;
}
*hidl_usable_channels = {};
for (const auto& legacy_usable_channel : legacy_usable_channels) {
- V1_5::WifiUsableChannel hidl_usable_channel;
+ V1_6::WifiUsableChannel hidl_usable_channel;
if (!convertLegacyWifiUsableChannelToHidl(legacy_usable_channel, &hidl_usable_channel)) {
return false;
}
@@ -894,28 +894,28 @@
bool convertLegacyLinkLayerRadioStatsToHidl(
const legacy_hal::LinkLayerRadioStats& legacy_radio_stat,
- V1_5::StaLinkLayerRadioStats* hidl_radio_stat) {
+ V1_6::StaLinkLayerRadioStats* hidl_radio_stat) {
if (!hidl_radio_stat) {
return false;
}
*hidl_radio_stat = {};
hidl_radio_stat->radioId = legacy_radio_stat.stats.radio;
- hidl_radio_stat->V1_3.V1_0.onTimeInMs = legacy_radio_stat.stats.on_time;
- hidl_radio_stat->V1_3.V1_0.txTimeInMs = legacy_radio_stat.stats.tx_time;
- hidl_radio_stat->V1_3.V1_0.rxTimeInMs = legacy_radio_stat.stats.rx_time;
- hidl_radio_stat->V1_3.V1_0.onTimeInMsForScan = legacy_radio_stat.stats.on_time_scan;
- hidl_radio_stat->V1_3.V1_0.txTimeInMsPerLevel = legacy_radio_stat.tx_time_per_levels;
- hidl_radio_stat->V1_3.onTimeInMsForNanScan = legacy_radio_stat.stats.on_time_nbd;
- hidl_radio_stat->V1_3.onTimeInMsForBgScan = legacy_radio_stat.stats.on_time_gscan;
- hidl_radio_stat->V1_3.onTimeInMsForRoamScan = legacy_radio_stat.stats.on_time_roam_scan;
- hidl_radio_stat->V1_3.onTimeInMsForPnoScan = legacy_radio_stat.stats.on_time_pno_scan;
- hidl_radio_stat->V1_3.onTimeInMsForHs20Scan = legacy_radio_stat.stats.on_time_hs20;
+ hidl_radio_stat->V1_0.onTimeInMs = legacy_radio_stat.stats.on_time;
+ hidl_radio_stat->V1_0.txTimeInMs = legacy_radio_stat.stats.tx_time;
+ hidl_radio_stat->V1_0.rxTimeInMs = legacy_radio_stat.stats.rx_time;
+ hidl_radio_stat->V1_0.onTimeInMsForScan = legacy_radio_stat.stats.on_time_scan;
+ hidl_radio_stat->V1_0.txTimeInMsPerLevel = legacy_radio_stat.tx_time_per_levels;
+ hidl_radio_stat->onTimeInMsForNanScan = legacy_radio_stat.stats.on_time_nbd;
+ hidl_radio_stat->onTimeInMsForBgScan = legacy_radio_stat.stats.on_time_gscan;
+ hidl_radio_stat->onTimeInMsForRoamScan = legacy_radio_stat.stats.on_time_roam_scan;
+ hidl_radio_stat->onTimeInMsForPnoScan = legacy_radio_stat.stats.on_time_pno_scan;
+ hidl_radio_stat->onTimeInMsForHs20Scan = legacy_radio_stat.stats.on_time_hs20;
- std::vector<V1_3::WifiChannelStats> hidl_channel_stats;
+ std::vector<V1_6::WifiChannelStats> hidl_channel_stats;
for (const auto& channel_stat : legacy_radio_stat.channel_stats) {
- V1_3::WifiChannelStats hidl_channel_stat;
+ V1_6::WifiChannelStats hidl_channel_stat;
hidl_channel_stat.onTimeInMs = channel_stat.on_time;
hidl_channel_stat.ccaBusyTimeInMs = channel_stat.cca_busy_time;
/*
@@ -929,13 +929,13 @@
hidl_channel_stats.push_back(hidl_channel_stat);
}
- hidl_radio_stat->V1_3.channelStats = hidl_channel_stats;
+ hidl_radio_stat->channelStats = hidl_channel_stats;
return true;
}
bool convertLegacyLinkLayerStatsToHidl(const legacy_hal::LinkLayerStats& legacy_stats,
- V1_5::StaLinkLayerStats* hidl_stats) {
+ V1_6::StaLinkLayerStats* hidl_stats) {
if (!hidl_stats) {
return false;
}
@@ -1010,9 +1010,9 @@
hidl_stats->iface.timeSliceDutyCycleInPercent =
legacy_stats.iface.info.time_slicing_duty_cycle_percent;
// peer info legacy_stats conversion.
- std::vector<V1_5::StaPeerInfo> hidl_peers_info_stats;
+ std::vector<V1_6::StaPeerInfo> hidl_peers_info_stats;
for (const auto& legacy_peer_info_stats : legacy_stats.peers) {
- V1_5::StaPeerInfo hidl_peer_info_stats;
+ V1_6::StaPeerInfo hidl_peer_info_stats;
if (!convertLegacyPeerInfoStatsToHidl(legacy_peer_info_stats, &hidl_peer_info_stats)) {
return false;
}
@@ -1020,9 +1020,9 @@
}
hidl_stats->iface.peers = hidl_peers_info_stats;
// radio legacy_stats conversion.
- std::vector<V1_5::StaLinkLayerRadioStats> hidl_radios_stats;
+ std::vector<V1_6::StaLinkLayerRadioStats> hidl_radios_stats;
for (const auto& legacy_radio_stats : legacy_stats.radios) {
- V1_5::StaLinkLayerRadioStats hidl_radio_stats;
+ V1_6::StaLinkLayerRadioStats hidl_radio_stats;
if (!convertLegacyLinkLayerRadioStatsToHidl(legacy_radio_stats, &hidl_radio_stats)) {
return false;
}
@@ -1036,7 +1036,7 @@
}
bool convertLegacyPeerInfoStatsToHidl(const legacy_hal::WifiPeerInfo& legacy_peer_info_stats,
- V1_5::StaPeerInfo* hidl_peer_info_stats) {
+ V1_6::StaPeerInfo* hidl_peer_info_stats) {
if (!hidl_peer_info_stats) {
return false;
}
@@ -1044,9 +1044,9 @@
hidl_peer_info_stats->staCount = legacy_peer_info_stats.peer_info.bssload.sta_count;
hidl_peer_info_stats->chanUtil = legacy_peer_info_stats.peer_info.bssload.chan_util;
- std::vector<V1_5::StaRateStat> hidlRateStats;
+ std::vector<V1_6::StaRateStat> hidlRateStats;
for (const auto& legacy_rate_stats : legacy_peer_info_stats.rate_stats) {
- V1_5::StaRateStat rateStat;
+ V1_6::StaRateStat rateStat;
if (!convertLegacyWifiRateInfoToHidl(legacy_rate_stats.rate, &rateStat.rateInfo)) {
return false;
}
@@ -2134,7 +2134,7 @@
}
bool convertLegacyNdpChannelInfoToHidl(const legacy_hal::NanChannelInfo& legacy_struct,
- V1_2::NanDataPathChannelInfo* hidl_struct) {
+ V1_6::NanDataPathChannelInfo* hidl_struct) {
if (!hidl_struct) {
LOG(ERROR) << "convertLegacyNdpChannelInfoToHidl: hidl_struct is null";
return false;
@@ -2150,7 +2150,7 @@
}
bool convertLegacyNanDataPathConfirmIndToHidl(const legacy_hal::NanDataPathConfirmInd& legacy_ind,
- V1_2::NanDataPathConfirmInd* hidl_ind) {
+ V1_6::NanDataPathConfirmInd* hidl_ind) {
if (!hidl_ind) {
LOG(ERROR) << "convertLegacyNanDataPathConfirmIndToHidl: hidl_ind is null";
return false;
@@ -2166,9 +2166,9 @@
hidl_ind->V1_0.status.status = convertLegacyNanStatusTypeToHidl(legacy_ind.reason_code);
hidl_ind->V1_0.status.description = ""; // TODO: b/34059183
- std::vector<V1_2::NanDataPathChannelInfo> channelInfo;
+ std::vector<V1_6::NanDataPathChannelInfo> channelInfo;
for (unsigned int i = 0; i < legacy_ind.num_channels; ++i) {
- V1_2::NanDataPathChannelInfo hidl_struct;
+ V1_6::NanDataPathChannelInfo hidl_struct;
if (!convertLegacyNdpChannelInfoToHidl(legacy_ind.channel_info[i], &hidl_struct)) {
return false;
}
@@ -2181,7 +2181,7 @@
bool convertLegacyNanDataPathScheduleUpdateIndToHidl(
const legacy_hal::NanDataPathScheduleUpdateInd& legacy_ind,
- V1_2::NanDataPathScheduleUpdateInd* hidl_ind) {
+ V1_6::NanDataPathScheduleUpdateInd* hidl_ind) {
if (!hidl_ind) {
LOG(ERROR) << "convertLegacyNanDataPathScheduleUpdateIndToHidl: "
"hidl_ind is null";
@@ -2190,9 +2190,9 @@
*hidl_ind = {};
hidl_ind->peerDiscoveryAddress = hidl_array<uint8_t, 6>(legacy_ind.peer_mac_addr);
- std::vector<V1_2::NanDataPathChannelInfo> channelInfo;
+ std::vector<V1_6::NanDataPathChannelInfo> channelInfo;
for (unsigned int i = 0; i < legacy_ind.num_channels; ++i) {
- V1_2::NanDataPathChannelInfo hidl_struct;
+ V1_6::NanDataPathChannelInfo hidl_struct;
if (!convertLegacyNdpChannelInfoToHidl(legacy_ind.channel_info[i], &hidl_struct)) {
return false;
}
@@ -2260,13 +2260,16 @@
return legacy_hal::WIFI_CHAN_WIDTH_5;
case WifiChannelWidthInMhz::WIDTH_10:
return legacy_hal::WIFI_CHAN_WIDTH_10;
+ case V1_6::WifiChannelWidthInMhz::WIDTH_320:
+ return legacy_hal::WIFI_CHAN_WIDTH_320;
case WifiChannelWidthInMhz::WIDTH_INVALID:
return legacy_hal::WIFI_CHAN_WIDTH_INVALID;
};
CHECK(false);
}
-WifiChannelWidthInMhz convertLegacyWifiChannelWidthToHidl(legacy_hal::wifi_channel_width type) {
+V1_6::WifiChannelWidthInMhz convertLegacyWifiChannelWidthToHidl(
+ legacy_hal::wifi_channel_width type) {
switch (type) {
case legacy_hal::WIFI_CHAN_WIDTH_20:
return WifiChannelWidthInMhz::WIDTH_20;
@@ -2282,35 +2285,41 @@
return WifiChannelWidthInMhz::WIDTH_5;
case legacy_hal::WIFI_CHAN_WIDTH_10:
return WifiChannelWidthInMhz::WIDTH_10;
+ case legacy_hal::WIFI_CHAN_WIDTH_320:
+ return V1_6::WifiChannelWidthInMhz::WIDTH_320;
default:
return WifiChannelWidthInMhz::WIDTH_INVALID;
};
}
-legacy_hal::wifi_rtt_preamble convertHidlRttPreambleToLegacy(V1_4::RttPreamble type) {
+legacy_hal::wifi_rtt_preamble convertHidlRttPreambleToLegacy(V1_6::RttPreamble type) {
switch (type) {
- case V1_4::RttPreamble::LEGACY:
+ case V1_6::RttPreamble::LEGACY:
return legacy_hal::WIFI_RTT_PREAMBLE_LEGACY;
- case V1_4::RttPreamble::HT:
+ case V1_6::RttPreamble::HT:
return legacy_hal::WIFI_RTT_PREAMBLE_HT;
- case V1_4::RttPreamble::VHT:
+ case V1_6::RttPreamble::VHT:
return legacy_hal::WIFI_RTT_PREAMBLE_VHT;
- case V1_4::RttPreamble::HE:
+ case V1_6::RttPreamble::HE:
return legacy_hal::WIFI_RTT_PREAMBLE_HE;
+ case V1_6::RttPreamble::EHT:
+ return legacy_hal::WIFI_RTT_PREAMBLE_EHT;
};
CHECK(false);
}
-V1_4::RttPreamble convertLegacyRttPreambleToHidl(legacy_hal::wifi_rtt_preamble type) {
+V1_6::RttPreamble convertLegacyRttPreambleToHidl(legacy_hal::wifi_rtt_preamble type) {
switch (type) {
case legacy_hal::WIFI_RTT_PREAMBLE_LEGACY:
- return V1_4::RttPreamble::LEGACY;
+ return V1_6::RttPreamble::LEGACY;
case legacy_hal::WIFI_RTT_PREAMBLE_HT:
- return V1_4::RttPreamble::HT;
+ return V1_6::RttPreamble::HT;
case legacy_hal::WIFI_RTT_PREAMBLE_VHT:
- return V1_4::RttPreamble::VHT;
+ return V1_6::RttPreamble::VHT;
case legacy_hal::WIFI_RTT_PREAMBLE_HE:
- return V1_4::RttPreamble::HE;
+ return V1_6::RttPreamble::HE;
+ case legacy_hal::WIFI_RTT_PREAMBLE_EHT:
+ return V1_6::RttPreamble::EHT;
};
CHECK(false) << "Unknown legacy type: " << type;
}
@@ -2329,6 +2338,8 @@
return legacy_hal::WIFI_RTT_BW_80;
case RttBw::BW_160MHZ:
return legacy_hal::WIFI_RTT_BW_160;
+ case RttBw::BW_320MHZ:
+ return legacy_hal::WIFI_RTT_BW_320;
};
CHECK(false);
}
@@ -2347,6 +2358,8 @@
return RttBw::BW_80MHZ;
case legacy_hal::WIFI_RTT_BW_160:
return RttBw::BW_160MHZ;
+ case legacy_hal::WIFI_RTT_BW_320:
+ return RttBw::BW_320MHZ;
};
CHECK(false) << "Unknown legacy type: " << type;
}
@@ -2363,20 +2376,22 @@
CHECK(false);
}
-V1_4::WifiRatePreamble convertLegacyWifiRatePreambleToHidl(uint8_t preamble) {
+V1_6::WifiRatePreamble convertLegacyWifiRatePreambleToHidl(uint8_t preamble) {
switch (preamble) {
case 0:
- return V1_4::WifiRatePreamble::OFDM;
+ return V1_6::WifiRatePreamble::OFDM;
case 1:
- return V1_4::WifiRatePreamble::CCK;
+ return V1_6::WifiRatePreamble::CCK;
case 2:
- return V1_4::WifiRatePreamble::HT;
+ return V1_6::WifiRatePreamble::HT;
case 3:
- return V1_4::WifiRatePreamble::VHT;
+ return V1_6::WifiRatePreamble::VHT;
case 4:
- return V1_4::WifiRatePreamble::HE;
+ return V1_6::WifiRatePreamble::HE;
+ case 5:
+ return V1_6::WifiRatePreamble::EHT;
default:
- return V1_4::WifiRatePreamble::RESERVED;
+ return V1_6::WifiRatePreamble::RESERVED;
};
CHECK(false) << "Unknown legacy preamble: " << preamble;
}
@@ -2464,7 +2479,7 @@
return true;
}
-bool convertHidlRttConfigToLegacy(const V1_4::RttConfig& hidl_config,
+bool convertHidlRttConfigToLegacy(const V1_6::RttConfig& hidl_config,
legacy_hal::wifi_rtt_config* legacy_config) {
if (!legacy_config) {
return false;
@@ -2491,7 +2506,7 @@
}
bool convertHidlVectorOfRttConfigToLegacy(
- const std::vector<V1_4::RttConfig>& hidl_configs,
+ const std::vector<V1_6::RttConfig>& hidl_configs,
std::vector<legacy_hal::wifi_rtt_config>* legacy_configs) {
if (!legacy_configs) {
return false;
@@ -2542,7 +2557,7 @@
return true;
}
-bool convertHidlRttResponderToLegacy(const V1_4::RttResponder& hidl_responder,
+bool convertHidlRttResponderToLegacy(const V1_6::RttResponder& hidl_responder,
legacy_hal::wifi_rtt_responder* legacy_responder) {
if (!legacy_responder) {
return false;
@@ -2556,7 +2571,7 @@
}
bool convertLegacyRttResponderToHidl(const legacy_hal::wifi_rtt_responder& legacy_responder,
- V1_4::RttResponder* hidl_responder) {
+ V1_6::RttResponder* hidl_responder) {
if (!hidl_responder) {
return false;
}
@@ -2570,7 +2585,7 @@
bool convertLegacyRttCapabilitiesToHidl(
const legacy_hal::wifi_rtt_capabilities& legacy_capabilities,
- V1_4::RttCapabilities* hidl_capabilities) {
+ V1_6::RttCapabilities* hidl_capabilities) {
if (!hidl_capabilities) {
return false;
}
@@ -2582,17 +2597,19 @@
hidl_capabilities->responderSupported = legacy_capabilities.responder_supported;
hidl_capabilities->preambleSupport = 0;
for (const auto flag : {legacy_hal::WIFI_RTT_PREAMBLE_LEGACY, legacy_hal::WIFI_RTT_PREAMBLE_HT,
- legacy_hal::WIFI_RTT_PREAMBLE_VHT, legacy_hal::WIFI_RTT_PREAMBLE_HE}) {
+ legacy_hal::WIFI_RTT_PREAMBLE_VHT, legacy_hal::WIFI_RTT_PREAMBLE_HE,
+ legacy_hal::WIFI_RTT_PREAMBLE_EHT}) {
if (legacy_capabilities.preamble_support & flag) {
hidl_capabilities->preambleSupport |=
- static_cast<std::underlying_type<V1_4::RttPreamble>::type>(
+ static_cast<std::underlying_type<V1_6::RttPreamble>::type>(
convertLegacyRttPreambleToHidl(flag));
}
}
hidl_capabilities->bwSupport = 0;
for (const auto flag :
{legacy_hal::WIFI_RTT_BW_5, legacy_hal::WIFI_RTT_BW_10, legacy_hal::WIFI_RTT_BW_20,
- legacy_hal::WIFI_RTT_BW_40, legacy_hal::WIFI_RTT_BW_80, legacy_hal::WIFI_RTT_BW_160}) {
+ legacy_hal::WIFI_RTT_BW_40, legacy_hal::WIFI_RTT_BW_80, legacy_hal::WIFI_RTT_BW_160,
+ legacy_hal::WIFI_RTT_BW_320}) {
if (legacy_capabilities.bw_support & flag) {
hidl_capabilities->bwSupport |=
static_cast<std::underlying_type<RttBw>::type>(convertLegacyRttBwToHidl(flag));
@@ -2603,7 +2620,7 @@
}
bool convertLegacyWifiRateInfoToHidl(const legacy_hal::wifi_rate& legacy_rate,
- V1_4::WifiRateInfo* hidl_rate) {
+ V1_6::WifiRateInfo* hidl_rate) {
if (!hidl_rate) {
return false;
}
@@ -2618,7 +2635,7 @@
}
bool convertLegacyRttResultToHidl(const legacy_hal::wifi_rtt_result& legacy_result,
- V1_4::RttResult* hidl_result) {
+ V1_6::RttResult* hidl_result) {
if (!hidl_result) {
return false;
}
@@ -2660,13 +2677,13 @@
bool convertLegacyVectorOfRttResultToHidl(
const std::vector<const legacy_hal::wifi_rtt_result*>& legacy_results,
- std::vector<V1_4::RttResult>* hidl_results) {
+ std::vector<V1_6::RttResult>* hidl_results) {
if (!hidl_results) {
return false;
}
*hidl_results = {};
for (const auto legacy_result : legacy_results) {
- V1_4::RttResult hidl_result;
+ V1_6::RttResult hidl_result;
if (!convertLegacyRttResultToHidl(*legacy_result, &hidl_result)) {
return false;
}
diff --git a/wifi/1.6/default/hidl_struct_util.h b/wifi/1.6/default/hidl_struct_util.h
index 15a3205..7f0266a 100644
--- a/wifi/1.6/default/hidl_struct_util.h
+++ b/wifi/1.6/default/hidl_struct_util.h
@@ -25,8 +25,8 @@
#include <android/hardware/wifi/1.3/types.h>
#include <android/hardware/wifi/1.4/IWifiChipEventCallback.h>
#include <android/hardware/wifi/1.4/types.h>
-#include <android/hardware/wifi/1.5/IWifiChip.h>
-#include <android/hardware/wifi/1.5/types.h>
+#include <android/hardware/wifi/1.6/IWifiChip.h>
+#include <android/hardware/wifi/1.6/types.h>
#include "wifi_legacy_hal.h"
@@ -95,7 +95,7 @@
const std::vector<legacy_hal::wifi_cached_scan_results>& legacy_cached_scan_results,
std::vector<StaScanData>* hidl_scan_datas);
bool convertLegacyLinkLayerStatsToHidl(const legacy_hal::LinkLayerStats& legacy_stats,
- V1_5::StaLinkLayerStats* hidl_stats);
+ V1_6::StaLinkLayerStats* hidl_stats);
bool convertLegacyRoamingCapabilitiesToHidl(
const legacy_hal::wifi_roaming_capabilities& legacy_caps,
StaRoamingCapabilities* hidl_caps);
@@ -156,40 +156,40 @@
bool convertLegacyNanDataPathRequestIndToHidl(const legacy_hal::NanDataPathRequestInd& legacy_ind,
NanDataPathRequestInd* hidl_ind);
bool convertLegacyNanDataPathConfirmIndToHidl(const legacy_hal::NanDataPathConfirmInd& legacy_ind,
- V1_2::NanDataPathConfirmInd* hidl_ind);
+ V1_6::NanDataPathConfirmInd* hidl_ind);
bool convertLegacyNanDataPathScheduleUpdateIndToHidl(
const legacy_hal::NanDataPathScheduleUpdateInd& legacy_ind,
- V1_2::NanDataPathScheduleUpdateInd* hidl_ind);
+ V1_6::NanDataPathScheduleUpdateInd* hidl_ind);
// RTT controller conversion methods.
-bool convertHidlVectorOfRttConfigToLegacy(const std::vector<V1_4::RttConfig>& hidl_configs,
+bool convertHidlVectorOfRttConfigToLegacy(const std::vector<V1_6::RttConfig>& hidl_configs,
std::vector<legacy_hal::wifi_rtt_config>* legacy_configs);
bool convertHidlRttLciInformationToLegacy(const RttLciInformation& hidl_info,
legacy_hal::wifi_lci_information* legacy_info);
bool convertHidlRttLcrInformationToLegacy(const RttLcrInformation& hidl_info,
legacy_hal::wifi_lcr_information* legacy_info);
-bool convertHidlRttResponderToLegacy(const V1_4::RttResponder& hidl_responder,
+bool convertHidlRttResponderToLegacy(const V1_6::RttResponder& hidl_responder,
legacy_hal::wifi_rtt_responder* legacy_responder);
-bool convertHidlWifiChannelInfoToLegacy(const WifiChannelInfo& hidl_info,
+bool convertHidlWifiChannelInfoToLegacy(const V1_6::WifiChannelInfo& hidl_info,
legacy_hal::wifi_channel_info* legacy_info);
bool convertLegacyRttResponderToHidl(const legacy_hal::wifi_rtt_responder& legacy_responder,
- V1_4::RttResponder* hidl_responder);
+ V1_6::RttResponder* hidl_responder);
bool convertLegacyRttCapabilitiesToHidl(
const legacy_hal::wifi_rtt_capabilities& legacy_capabilities,
- V1_4::RttCapabilities* hidl_capabilities);
+ V1_6::RttCapabilities* hidl_capabilities);
bool convertLegacyVectorOfRttResultToHidl(
const std::vector<const legacy_hal::wifi_rtt_result*>& legacy_results,
- std::vector<V1_4::RttResult>* hidl_results);
+ std::vector<V1_6::RttResult>* hidl_results);
uint32_t convertHidlWifiBandToLegacyMacBand(V1_5::WifiBand band);
uint32_t convertHidlWifiIfaceModeToLegacy(uint32_t hidl_iface_mask);
uint32_t convertHidlUsableChannelFilterToLegacy(uint32_t hidl_filter_mask);
bool convertLegacyWifiUsableChannelsToHidl(
const std::vector<legacy_hal::wifi_usable_channel>& legacy_usable_channels,
- std::vector<V1_5::WifiUsableChannel>* hidl_usable_channels);
+ std::vector<V1_6::WifiUsableChannel>* hidl_usable_channels);
bool convertLegacyPeerInfoStatsToHidl(const legacy_hal::WifiPeerInfo& legacy_peer_info_stats,
- V1_5::StaPeerInfo* hidl_peer_info_stats);
+ V1_6::StaPeerInfo* hidl_peer_info_stats);
bool convertLegacyWifiRateInfoToHidl(const legacy_hal::wifi_rate& legacy_rate,
- V1_4::WifiRateInfo* hidl_rate);
+ V1_6::WifiRateInfo* hidl_rate);
} // namespace hidl_struct_util
} // namespace implementation
} // namespace V1_6
diff --git a/wifi/1.6/default/tests/hidl_struct_util_unit_tests.cpp b/wifi/1.6/default/tests/hidl_struct_util_unit_tests.cpp
index 1182a58..077c6cc 100644
--- a/wifi/1.6/default/tests/hidl_struct_util_unit_tests.cpp
+++ b/wifi/1.6/default/tests/hidl_struct_util_unit_tests.cpp
@@ -37,7 +37,7 @@
namespace V1_6 {
namespace implementation {
using namespace android::hardware::wifi::V1_0;
-using ::android::hardware::wifi::V1_0::WifiChannelWidthInMhz;
+using ::android::hardware::wifi::V1_6::WifiChannelWidthInMhz;
class HidlStructUtilTest : public Test {};
@@ -216,7 +216,7 @@
peer.rate_stats.push_back(rate_stat2);
}
- V1_5::StaLinkLayerStats converted{};
+ V1_6::StaLinkLayerStats converted{};
hidl_struct_util::convertLegacyLinkLayerStatsToHidl(legacy_stats, &converted);
EXPECT_EQ(legacy_stats.iface.beacon_rx, converted.iface.V1_0.beaconRx);
EXPECT_EQ(legacy_stats.iface.rssi_mgmt, converted.iface.V1_0.avgRssiMgmt);
@@ -294,43 +294,42 @@
EXPECT_EQ(legacy_stats.radios.size(), converted.radios.size());
for (size_t i = 0; i < legacy_stats.radios.size(); i++) {
EXPECT_EQ(legacy_stats.radios[i].stats.radio, converted.radios[i].radioId);
- EXPECT_EQ(legacy_stats.radios[i].stats.on_time, converted.radios[i].V1_3.V1_0.onTimeInMs);
- EXPECT_EQ(legacy_stats.radios[i].stats.tx_time, converted.radios[i].V1_3.V1_0.txTimeInMs);
- EXPECT_EQ(legacy_stats.radios[i].stats.rx_time, converted.radios[i].V1_3.V1_0.rxTimeInMs);
+ EXPECT_EQ(legacy_stats.radios[i].stats.on_time, converted.radios[i].V1_0.onTimeInMs);
+ EXPECT_EQ(legacy_stats.radios[i].stats.tx_time, converted.radios[i].V1_0.txTimeInMs);
+ EXPECT_EQ(legacy_stats.radios[i].stats.rx_time, converted.radios[i].V1_0.rxTimeInMs);
EXPECT_EQ(legacy_stats.radios[i].stats.on_time_scan,
- converted.radios[i].V1_3.V1_0.onTimeInMsForScan);
+ converted.radios[i].V1_0.onTimeInMsForScan);
EXPECT_EQ(legacy_stats.radios[i].tx_time_per_levels.size(),
- converted.radios[i].V1_3.V1_0.txTimeInMsPerLevel.size());
+ converted.radios[i].V1_0.txTimeInMsPerLevel.size());
for (size_t j = 0; j < legacy_stats.radios[i].tx_time_per_levels.size(); j++) {
EXPECT_EQ(legacy_stats.radios[i].tx_time_per_levels[j],
- converted.radios[i].V1_3.V1_0.txTimeInMsPerLevel[j]);
+ converted.radios[i].V1_0.txTimeInMsPerLevel[j]);
}
EXPECT_EQ(legacy_stats.radios[i].stats.on_time_nbd,
- converted.radios[i].V1_3.onTimeInMsForNanScan);
+ converted.radios[i].onTimeInMsForNanScan);
EXPECT_EQ(legacy_stats.radios[i].stats.on_time_gscan,
- converted.radios[i].V1_3.onTimeInMsForBgScan);
+ converted.radios[i].onTimeInMsForBgScan);
EXPECT_EQ(legacy_stats.radios[i].stats.on_time_roam_scan,
- converted.radios[i].V1_3.onTimeInMsForRoamScan);
+ converted.radios[i].onTimeInMsForRoamScan);
EXPECT_EQ(legacy_stats.radios[i].stats.on_time_pno_scan,
- converted.radios[i].V1_3.onTimeInMsForPnoScan);
+ converted.radios[i].onTimeInMsForPnoScan);
EXPECT_EQ(legacy_stats.radios[i].stats.on_time_hs20,
- converted.radios[i].V1_3.onTimeInMsForHs20Scan);
+ converted.radios[i].onTimeInMsForHs20Scan);
EXPECT_EQ(legacy_stats.radios[i].channel_stats.size(),
- converted.radios[i].V1_3.channelStats.size());
+ converted.radios[i].channelStats.size());
for (size_t k = 0; k < legacy_stats.radios[i].channel_stats.size(); k++) {
auto& legacy_channel_st = legacy_stats.radios[i].channel_stats[k];
EXPECT_EQ(WifiChannelWidthInMhz::WIDTH_20,
- converted.radios[i].V1_3.channelStats[k].channel.width);
+ converted.radios[i].channelStats[k].channel.width);
EXPECT_EQ(WifiChannelInMhz(legacy_channel_st.channel.center_freq),
- converted.radios[i].V1_3.channelStats[k].channel.centerFreq);
+ converted.radios[i].channelStats[k].channel.centerFreq);
EXPECT_EQ(WifiChannelInMhz(legacy_channel_st.channel.center_freq0),
- converted.radios[i].V1_3.channelStats[k].channel.centerFreq0);
+ converted.radios[i].channelStats[k].channel.centerFreq0);
EXPECT_EQ(WifiChannelInMhz(legacy_channel_st.channel.center_freq1),
- converted.radios[i].V1_3.channelStats[k].channel.centerFreq1);
+ converted.radios[i].channelStats[k].channel.centerFreq1);
EXPECT_EQ(legacy_channel_st.cca_busy_time,
- converted.radios[i].V1_3.channelStats[k].ccaBusyTimeInMs);
- EXPECT_EQ(legacy_channel_st.on_time,
- converted.radios[i].V1_3.channelStats[k].onTimeInMs);
+ converted.radios[i].channelStats[k].ccaBusyTimeInMs);
+ EXPECT_EQ(legacy_channel_st.on_time, converted.radios[i].channelStats[k].onTimeInMs);
}
}
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 5390411..542b180 100644
--- a/wifi/1.6/default/tests/wifi_chip_unit_tests.cpp
+++ b/wifi/1.6/default/tests/wifi_chip_unit_tests.cpp
@@ -238,7 +238,7 @@
bool createRttController() {
bool success = false;
- chip_->createRttController_1_4(
+ chip_->createRttController_1_6(
NULL, [&success](const WifiStatus& status, const sp<IWifiRttController>& rtt) {
if (WifiStatusCode::SUCCESS == status.code) {
ASSERT_NE(rtt.get(), nullptr);
@@ -716,7 +716,7 @@
// Create RTT controller
sp<IWifiRttController> rtt_controller;
- chip_->createRttController_1_4(
+ chip_->createRttController_1_6(
NULL, [&rtt_controller](const WifiStatus& status, const sp<IWifiRttController>& rtt) {
if (WifiStatusCode::SUCCESS == status.code) {
ASSERT_NE(rtt.get(), nullptr);
diff --git a/wifi/1.6/default/tests/wifi_nan_iface_unit_tests.cpp b/wifi/1.6/default/tests/wifi_nan_iface_unit_tests.cpp
index c7c566b..13b2849 100644
--- a/wifi/1.6/default/tests/wifi_nan_iface_unit_tests.cpp
+++ b/wifi/1.6/default/tests/wifi_nan_iface_unit_tests.cpp
@@ -85,8 +85,13 @@
MOCK_METHOD1(eventDataPathConfirm,
Return<void>(const android::hardware::wifi::V1_0::NanDataPathConfirmInd&));
MOCK_METHOD1(eventDataPathTerminated, Return<void>(uint32_t));
- MOCK_METHOD1(eventDataPathConfirm_1_2, Return<void>(const NanDataPathConfirmInd&));
- MOCK_METHOD1(eventDataPathScheduleUpdate, Return<void>(const NanDataPathScheduleUpdateInd&));
+ MOCK_METHOD1(eventDataPathConfirm_1_2,
+ Return<void>(const android::hardware::wifi::V1_2::NanDataPathConfirmInd&));
+ MOCK_METHOD1(eventDataPathConfirm_1_6, Return<void>(const NanDataPathConfirmInd&));
+ MOCK_METHOD1(eventDataPathScheduleUpdate,
+ Return<void>(const android::hardware::wifi::V1_2::NanDataPathScheduleUpdateInd&));
+ MOCK_METHOD1(eventDataPathScheduleUpdate_1_6,
+ Return<void>(const NanDataPathScheduleUpdateInd&));
MOCK_METHOD3(notifyCapabilitiesResponse_1_5,
Return<void>(uint16_t, const WifiNanStatus&, const V1_5::NanCapabilities&));
};
diff --git a/wifi/1.6/default/wifi_chip.cpp b/wifi/1.6/default/wifi_chip.cpp
index c1ce766..11512f4 100644
--- a/wifi/1.6/default/wifi_chip.cpp
+++ b/wifi/1.6/default/wifi_chip.cpp
@@ -707,6 +707,21 @@
&WifiChip::triggerSubsystemRestartInternal, hidl_status_cb);
}
+Return<void> WifiChip::createRttController_1_6(const sp<IWifiIface>& bound_iface,
+ createRttController_1_6_cb hidl_status_cb) {
+ return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID,
+ &WifiChip::createRttControllerInternal_1_6, hidl_status_cb, bound_iface);
+}
+
+Return<void> WifiChip::getUsableChannels_1_6(
+ WifiBand band, hidl_bitfield<V1_5::WifiIfaceMode> ifaceModeMask,
+ hidl_bitfield<V1_5::IWifiChip::UsableChannelFilter> filterMask,
+ getUsableChannels_1_6_cb _hidl_cb) {
+ return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID,
+ &WifiChip::getUsableChannelsInternal_1_6, _hidl_cb, band, ifaceModeMask,
+ filterMask);
+}
+
void WifiChip::invalidateAndRemoveAllIfaces() {
invalidateAndClearBridgedApAll();
invalidateAndClearAll(ap_ifaces_);
@@ -1114,7 +1129,7 @@
return createWifiStatus(WifiStatusCode::SUCCESS);
}
-std::pair<WifiStatus, sp<V1_5::IWifiStaIface>> WifiChip::createStaIfaceInternal() {
+std::pair<WifiStatus, sp<V1_6::IWifiStaIface>> WifiChip::createStaIfaceInternal() {
if (!canCurrentModeSupportIfaceOfTypeWithCurrentIfaces(IfaceType::STA)) {
return {createWifiStatus(WifiStatusCode::ERROR_NOT_AVAILABLE), {}};
}
@@ -1144,7 +1159,7 @@
return {createWifiStatus(WifiStatusCode::SUCCESS), getNames(sta_ifaces_)};
}
-std::pair<WifiStatus, sp<V1_5::IWifiStaIface>> WifiChip::getStaIfaceInternal(
+std::pair<WifiStatus, sp<V1_6::IWifiStaIface>> WifiChip::getStaIfaceInternal(
const std::string& ifname) {
const auto iface = findUsingName(sta_ifaces_, ifname);
if (!iface.get()) {
@@ -1351,16 +1366,9 @@
}
std::pair<WifiStatus, sp<V1_4::IWifiRttController>> WifiChip::createRttControllerInternal_1_4(
- const sp<IWifiIface>& bound_iface) {
- if (sta_ifaces_.size() == 0 && !canCurrentModeSupportIfaceOfType(IfaceType::STA)) {
- LOG(ERROR) << "createRttControllerInternal_1_4: Chip cannot support STAs "
- "(and RTT by extension)";
- return {createWifiStatus(WifiStatusCode::ERROR_NOT_AVAILABLE), {}};
- }
- sp<WifiRttController> rtt =
- new WifiRttController(getFirstActiveWlanIfaceName(), bound_iface, legacy_hal_);
- rtt_controllers_.emplace_back(rtt);
- return {createWifiStatus(WifiStatusCode::SUCCESS), rtt};
+ const sp<IWifiIface>& /*bound_iface*/) {
+ LOG(ERROR) << "createRttController_1_4 is not supported on this HAL";
+ return {createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED), {}};
}
WifiStatus WifiChip::registerEventCallbackInternal_1_4(
@@ -1409,7 +1417,31 @@
return createWifiStatusFromLegacyError(legacy_status);
}
-std::pair<WifiStatus, std::vector<WifiUsableChannel>> WifiChip::getUsableChannelsInternal(
+std::pair<WifiStatus, std::vector<V1_5::WifiUsableChannel>> WifiChip::getUsableChannelsInternal(
+ WifiBand /*band*/, uint32_t /*ifaceModeMask*/, uint32_t /*filterMask*/) {
+ LOG(ERROR) << "getUsableChannels is not supported on this HAL";
+ return {createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED), {}};
+}
+
+WifiStatus WifiChip::triggerSubsystemRestartInternal() {
+ auto legacy_status = legacy_hal_.lock()->triggerSubsystemRestart();
+ return createWifiStatusFromLegacyError(legacy_status);
+}
+
+std::pair<WifiStatus, sp<V1_6::IWifiRttController>> WifiChip::createRttControllerInternal_1_6(
+ const sp<IWifiIface>& bound_iface) {
+ if (sta_ifaces_.size() == 0 && !canCurrentModeSupportIfaceOfType(IfaceType::STA)) {
+ LOG(ERROR) << "createRttControllerInternal_1_6: Chip cannot support STAs "
+ "(and RTT by extension)";
+ return {createWifiStatus(WifiStatusCode::ERROR_NOT_AVAILABLE), {}};
+ }
+ sp<WifiRttController> rtt =
+ new WifiRttController(getFirstActiveWlanIfaceName(), bound_iface, legacy_hal_);
+ rtt_controllers_.emplace_back(rtt);
+ return {createWifiStatus(WifiStatusCode::SUCCESS), rtt};
+}
+
+std::pair<WifiStatus, std::vector<V1_6::WifiUsableChannel>> WifiChip::getUsableChannelsInternal_1_6(
WifiBand band, uint32_t ifaceModeMask, uint32_t filterMask) {
legacy_hal::wifi_error legacy_status;
std::vector<legacy_hal::wifi_usable_channel> legacy_usable_channels;
@@ -1421,7 +1453,7 @@
if (legacy_status != legacy_hal::WIFI_SUCCESS) {
return {createWifiStatusFromLegacyError(legacy_status), {}};
}
- std::vector<WifiUsableChannel> hidl_usable_channels;
+ std::vector<V1_6::WifiUsableChannel> hidl_usable_channels;
if (!hidl_struct_util::convertLegacyWifiUsableChannelsToHidl(legacy_usable_channels,
&hidl_usable_channels)) {
return {createWifiStatus(WifiStatusCode::ERROR_UNKNOWN), {}};
@@ -1429,11 +1461,6 @@
return {createWifiStatus(WifiStatusCode::SUCCESS), hidl_usable_channels};
}
-WifiStatus WifiChip::triggerSubsystemRestartInternal() {
- auto legacy_status = legacy_hal_.lock()->triggerSubsystemRestart();
- return createWifiStatusFromLegacyError(legacy_status);
-}
-
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
diff --git a/wifi/1.6/default/wifi_chip.h b/wifi/1.6/default/wifi_chip.h
index 8a06898..73bdf3a 100644
--- a/wifi/1.6/default/wifi_chip.h
+++ b/wifi/1.6/default/wifi_chip.h
@@ -22,8 +22,9 @@
#include <mutex>
#include <android-base/macros.h>
-#include <android/hardware/wifi/1.4/IWifiRttController.h>
-#include <android/hardware/wifi/1.5/IWifiChip.h>
+#include <android/hardware/wifi/1.6/IWifiChip.h>
+#include <android/hardware/wifi/1.6/IWifiRttController.h>
+#include <android/hardware/wifi/1.6/IWifiStaIface.h>
#include "hidl_callback_util.h"
#include "ringbuffer.h"
@@ -43,14 +44,13 @@
namespace implementation {
using namespace android::hardware::wifi::V1_0;
using V1_5::WifiBand;
-using V1_5::WifiUsableChannel;
/**
* HIDL interface object used to control a Wifi HAL chip instance.
* Since there is only a single chip instance used today, there is no
* identifying handle information stored here.
*/
-class WifiChip : public V1_5::IWifiChip {
+class WifiChip : public V1_6::IWifiChip {
public:
WifiChip(ChipId chip_id, bool is_primary,
const std::weak_ptr<legacy_hal::WifiLegacyHal> legacy_hal,
@@ -154,6 +154,12 @@
hidl_bitfield<UsableChannelFilter> filterMask,
getUsableChannels_cb _hidl_cb) override;
Return<void> triggerSubsystemRestart(triggerSubsystemRestart_cb hidl_status_cb) override;
+ Return<void> createRttController_1_6(const sp<IWifiIface>& bound_iface,
+ createRttController_1_6_cb hidl_status_cb) override;
+ Return<void> getUsableChannels_1_6(WifiBand band,
+ hidl_bitfield<V1_5::WifiIfaceMode> ifaceModeMask,
+ hidl_bitfield<UsableChannelFilter> filterMask,
+ getUsableChannels_1_6_cb _hidl_cb) override;
private:
void invalidateAndRemoveAllIfaces();
@@ -191,9 +197,9 @@
std::pair<WifiStatus, std::vector<hidl_string>> getP2pIfaceNamesInternal();
std::pair<WifiStatus, sp<IWifiP2pIface>> getP2pIfaceInternal(const std::string& ifname);
WifiStatus removeP2pIfaceInternal(const std::string& ifname);
- std::pair<WifiStatus, sp<V1_5::IWifiStaIface>> createStaIfaceInternal();
+ std::pair<WifiStatus, sp<V1_6::IWifiStaIface>> createStaIfaceInternal();
std::pair<WifiStatus, std::vector<hidl_string>> getStaIfaceNamesInternal();
- std::pair<WifiStatus, sp<V1_5::IWifiStaIface>> getStaIfaceInternal(const std::string& ifname);
+ std::pair<WifiStatus, sp<V1_6::IWifiStaIface>> getStaIfaceInternal(const std::string& ifname);
WifiStatus removeStaIfaceInternal(const std::string& ifname);
std::pair<WifiStatus, sp<V1_0::IWifiRttController>> createRttControllerInternal(
const sp<IWifiIface>& bound_iface);
@@ -225,13 +231,12 @@
WifiStatus setCoexUnsafeChannelsInternal(std::vector<CoexUnsafeChannel> unsafe_channels,
uint32_t restrictions);
WifiStatus setCountryCodeInternal(const std::array<int8_t, 2>& code);
- std::pair<WifiStatus, std::vector<WifiUsableChannel>> getUsableChannelsInternal(
+ std::pair<WifiStatus, std::vector<V1_5::WifiUsableChannel>> getUsableChannelsInternal(
WifiBand band, uint32_t ifaceModeMask, uint32_t filterMask);
WifiStatus handleChipConfiguration(std::unique_lock<std::recursive_mutex>* lock,
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(
@@ -258,6 +263,10 @@
void invalidateAndClearBridgedAp(const std::string& br_name);
bool findUsingNameFromBridgedApInstances(const std::string& name);
WifiStatus triggerSubsystemRestartInternal();
+ std::pair<WifiStatus, sp<V1_6::IWifiRttController>> createRttControllerInternal_1_6(
+ const sp<IWifiIface>& bound_iface);
+ std::pair<WifiStatus, std::vector<V1_6::WifiUsableChannel>> getUsableChannelsInternal_1_6(
+ WifiBand band, uint32_t ifaceModeMask, uint32_t filterMask);
ChipId chip_id_;
std::weak_ptr<legacy_hal::WifiLegacyHal> legacy_hal_;
diff --git a/wifi/1.6/default/wifi_legacy_hal.h b/wifi/1.6/default/wifi_legacy_hal.h
index d87242c..7dc6bd6 100644
--- a/wifi/1.6/default/wifi_legacy_hal.h
+++ b/wifi/1.6/default/wifi_legacy_hal.h
@@ -216,6 +216,7 @@
using ::WIFI_CHAN_WIDTH_10;
using ::WIFI_CHAN_WIDTH_160;
using ::WIFI_CHAN_WIDTH_20;
+using ::WIFI_CHAN_WIDTH_320;
using ::WIFI_CHAN_WIDTH_40;
using ::WIFI_CHAN_WIDTH_5;
using ::WIFI_CHAN_WIDTH_80;
@@ -289,12 +290,14 @@
using ::WIFI_RTT_BW_10;
using ::WIFI_RTT_BW_160;
using ::WIFI_RTT_BW_20;
+using ::WIFI_RTT_BW_320;
using ::WIFI_RTT_BW_40;
using ::WIFI_RTT_BW_5;
using ::WIFI_RTT_BW_80;
using ::wifi_rtt_capabilities;
using ::wifi_rtt_config;
using ::wifi_rtt_preamble;
+using ::WIFI_RTT_PREAMBLE_EHT;
using ::WIFI_RTT_PREAMBLE_HE;
using ::WIFI_RTT_PREAMBLE_HT;
using ::WIFI_RTT_PREAMBLE_LEGACY;
diff --git a/wifi/1.6/default/wifi_nan_iface.cpp b/wifi/1.6/default/wifi_nan_iface.cpp
index 236cb64..1add6dc 100644
--- a/wifi/1.6/default/wifi_nan_iface.cpp
+++ b/wifi/1.6/default/wifi_nan_iface.cpp
@@ -378,15 +378,15 @@
LOG(ERROR) << "Callback invoked on an invalid object";
return;
}
- V1_2::NanDataPathConfirmInd hidl_struct;
+ V1_6::NanDataPathConfirmInd hidl_struct;
if (!hidl_struct_util::convertLegacyNanDataPathConfirmIndToHidl(msg,
&hidl_struct)) {
LOG(ERROR) << "Failed to convert nan capabilities response";
return;
}
- for (const auto& callback : shared_ptr_this->getEventCallbacks_1_2()) {
- if (!callback->eventDataPathConfirm_1_2(hidl_struct).isOk()) {
+ for (const auto& callback : shared_ptr_this->getEventCallbacks_1_6()) {
+ if (!callback->eventDataPathConfirm_1_6(hidl_struct).isOk()) {
LOG(ERROR) << "Failed to invoke the callback";
}
}
@@ -430,15 +430,15 @@
LOG(ERROR) << "Callback invoked on an invalid object";
return;
}
- V1_2::NanDataPathScheduleUpdateInd hidl_struct;
+ V1_6::NanDataPathScheduleUpdateInd hidl_struct;
if (!hidl_struct_util::convertLegacyNanDataPathScheduleUpdateIndToHidl(
msg, &hidl_struct)) {
LOG(ERROR) << "Failed to convert nan capabilities response";
return;
}
- for (const auto& callback : shared_ptr_this->getEventCallbacks_1_2()) {
- if (!callback->eventDataPathScheduleUpdate(hidl_struct).isOk()) {
+ for (const auto& callback : shared_ptr_this->getEventCallbacks_1_6()) {
+ if (!callback->eventDataPathScheduleUpdate_1_6(hidl_struct).isOk()) {
LOG(ERROR) << "Failed to invoke the callback";
}
}
@@ -510,6 +510,10 @@
return event_cb_handler_1_5_.getCallbacks();
}
+std::set<sp<V1_6::IWifiNanIfaceEventCallback>> WifiNanIface::getEventCallbacks_1_6() {
+ return event_cb_handler_1_6_.getCallbacks();
+}
+
Return<void> WifiNanIface::getName(getName_cb hidl_status_cb) {
return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
&WifiNanIface::getNameInternal, hidl_status_cb);
@@ -703,6 +707,14 @@
return {createWifiStatus(WifiStatusCode::SUCCESS), IfaceType::NAN};
}
+Return<void> WifiNanIface::registerEventCallback_1_6(
+ const sp<V1_6::IWifiNanIfaceEventCallback>& callback,
+ registerEventCallback_1_6_cb hidl_status_cb) {
+ return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
+ &WifiNanIface::registerEventCallback_1_6Internal, hidl_status_cb,
+ callback);
+}
+
WifiStatus WifiNanIface::registerEventCallbackInternal(
const sp<V1_0::IWifiNanIfaceEventCallback>& callback) {
if (!event_cb_handler_.addCallback(callback)) {
@@ -898,6 +910,25 @@
return createWifiStatusFromLegacyError(legacy_status);
}
+WifiStatus WifiNanIface::registerEventCallback_1_6Internal(
+ const sp<V1_6::IWifiNanIfaceEventCallback>& callback) {
+ sp<V1_0::IWifiNanIfaceEventCallback> callback_1_0 = callback;
+ if (!event_cb_handler_.addCallback(callback_1_0)) {
+ return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN);
+ }
+ sp<V1_2::IWifiNanIfaceEventCallback> callback_1_2 = callback;
+ if (!event_cb_handler_1_2_.addCallback(callback_1_2)) {
+ return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN);
+ }
+ sp<V1_5::IWifiNanIfaceEventCallback> callback_1_5 = callback;
+ if (!event_cb_handler_1_5_.addCallback(callback_1_5)) {
+ return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN);
+ }
+ if (!event_cb_handler_1_6_.addCallback(callback)) {
+ return createWifiStatus(WifiStatusCode::ERROR_UNKNOWN);
+ }
+ return createWifiStatus(WifiStatusCode::SUCCESS);
+}
} // namespace implementation
} // namespace V1_6
} // namespace wifi
diff --git a/wifi/1.6/default/wifi_nan_iface.h b/wifi/1.6/default/wifi_nan_iface.h
index c445afc..b732ef1 100644
--- a/wifi/1.6/default/wifi_nan_iface.h
+++ b/wifi/1.6/default/wifi_nan_iface.h
@@ -18,8 +18,8 @@
#define WIFI_NAN_IFACE_H_
#include <android-base/macros.h>
-#include <android/hardware/wifi/1.5/IWifiNanIface.h>
-#include <android/hardware/wifi/1.5/IWifiNanIfaceEventCallback.h>
+#include <android/hardware/wifi/1.6/IWifiNanIface.h>
+#include <android/hardware/wifi/1.6/IWifiNanIfaceEventCallback.h>
#include "hidl_callback_util.h"
#include "wifi_iface_util.h"
@@ -36,7 +36,7 @@
/**
* HIDL interface object used to control a NAN Iface instance.
*/
-class WifiNanIface : public V1_5::IWifiNanIface {
+class WifiNanIface : public V1_6::IWifiNanIface {
public:
WifiNanIface(const std::string& ifname, bool is_dedicated_iface,
const std::weak_ptr<legacy_hal::WifiLegacyHal> legacy_hal,
@@ -104,6 +104,8 @@
configRequest_1_4_cb hidl_status_cb) override;
Return<void> getCapabilitiesRequest_1_5(uint16_t cmd_id,
getCapabilitiesRequest_cb hidl_status_cb) override;
+ Return<void> registerEventCallback_1_6(const sp<V1_6::IWifiNanIfaceEventCallback>& callback,
+ registerEventCallback_1_6_cb hidl_status_cb) override;
private:
// Corresponding worker functions for the HIDL methods.
@@ -145,6 +147,8 @@
WifiStatus configRequest_1_5Internal(uint16_t cmd_id, const V1_4::NanConfigRequest& msg,
const V1_5::NanConfigRequestSupplemental& msg2);
WifiStatus getCapabilitiesRequest_1_5Internal(uint16_t cmd_id);
+ WifiStatus registerEventCallback_1_6Internal(
+ const sp<V1_6::IWifiNanIfaceEventCallback>& callback);
// all 1_0 and descendant callbacks
std::set<sp<V1_0::IWifiNanIfaceEventCallback>> getEventCallbacks();
@@ -152,6 +156,8 @@
std::set<sp<V1_2::IWifiNanIfaceEventCallback>> getEventCallbacks_1_2();
// all 1_5 and descendant callbacks
std::set<sp<V1_5::IWifiNanIfaceEventCallback>> getEventCallbacks_1_5();
+ // all 1_6 and descendant callbacks
+ std::set<sp<V1_6::IWifiNanIfaceEventCallback>> getEventCallbacks_1_6();
std::string ifname_;
bool is_dedicated_iface_;
@@ -161,6 +167,7 @@
hidl_callback_util::HidlCallbackHandler<V1_0::IWifiNanIfaceEventCallback> event_cb_handler_;
hidl_callback_util::HidlCallbackHandler<V1_2::IWifiNanIfaceEventCallback> event_cb_handler_1_2_;
hidl_callback_util::HidlCallbackHandler<V1_5::IWifiNanIfaceEventCallback> event_cb_handler_1_5_;
+ hidl_callback_util::HidlCallbackHandler<V1_6::IWifiNanIfaceEventCallback> event_cb_handler_1_6_;
DISALLOW_COPY_AND_ASSIGN(WifiNanIface);
};
diff --git a/wifi/1.6/default/wifi_rtt_controller.cpp b/wifi/1.6/default/wifi_rtt_controller.cpp
index f5e1d5a..b328f31 100644
--- a/wifi/1.6/default/wifi_rtt_controller.cpp
+++ b/wifi/1.6/default/wifi_rtt_controller.cpp
@@ -43,7 +43,7 @@
return is_valid_;
}
-std::vector<sp<V1_4::IWifiRttControllerEventCallback>> WifiRttController::getEventCallbacks() {
+std::vector<sp<V1_6::IWifiRttControllerEventCallback>> WifiRttController::getEventCallbacks() {
return event_callbacks_;
}
@@ -102,7 +102,7 @@
}
Return<void> WifiRttController::enableResponder(uint32_t cmd_id,
- const WifiChannelInfo& channel_hint,
+ const V1_0::WifiChannelInfo& channel_hint,
uint32_t max_duration_seconds,
const V1_0::RttResponder& info,
enableResponder_cb hidl_status_cb) {
@@ -144,7 +144,7 @@
}
Return<void> WifiRttController::enableResponder_1_4(uint32_t cmd_id,
- const WifiChannelInfo& channel_hint,
+ const V1_0::WifiChannelInfo& channel_hint,
uint32_t max_duration_seconds,
const V1_4::RttResponder& info,
enableResponder_1_4_cb hidl_status_cb) {
@@ -153,6 +153,42 @@
channel_hint, max_duration_seconds, info);
}
+Return<void> WifiRttController::registerEventCallback_1_6(
+ const sp<V1_6::IWifiRttControllerEventCallback>& callback,
+ registerEventCallback_1_6_cb hidl_status_cb) {
+ return validateAndCall(this, WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID,
+ &WifiRttController::registerEventCallbackInternal_1_6, hidl_status_cb,
+ callback);
+}
+
+Return<void> WifiRttController::rangeRequest_1_6(uint32_t cmd_id,
+ const hidl_vec<V1_6::RttConfig>& rtt_configs,
+ rangeRequest_1_6_cb hidl_status_cb) {
+ return validateAndCall(this, WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID,
+ &WifiRttController::rangeRequestInternal_1_6, hidl_status_cb, cmd_id,
+ rtt_configs);
+}
+
+Return<void> WifiRttController::getCapabilities_1_6(getCapabilities_1_6_cb hidl_status_cb) {
+ return validateAndCall(this, WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID,
+ &WifiRttController::getCapabilitiesInternal_1_6, hidl_status_cb);
+}
+
+Return<void> WifiRttController::getResponderInfo_1_6(getResponderInfo_1_6_cb hidl_status_cb) {
+ return validateAndCall(this, WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID,
+ &WifiRttController::getResponderInfoInternal_1_6, hidl_status_cb);
+}
+
+Return<void> WifiRttController::enableResponder_1_6(uint32_t cmd_id,
+ const V1_6::WifiChannelInfo& channel_hint,
+ uint32_t max_duration_seconds,
+ const V1_6::RttResponder& info,
+ enableResponder_1_6_cb hidl_status_cb) {
+ return validateAndCall(this, WifiStatusCode::ERROR_WIFI_RTT_CONTROLLER_INVALID,
+ &WifiRttController::enableResponderInternal_1_6, hidl_status_cb, cmd_id,
+ channel_hint, max_duration_seconds, info);
+}
+
std::pair<WifiStatus, sp<IWifiIface>> WifiRttController::getBoundIfaceInternal() {
return {createWifiStatus(WifiStatusCode::SUCCESS), bound_iface_};
}
@@ -210,10 +246,9 @@
return {createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED), {}};
}
-WifiStatus WifiRttController::enableResponderInternal(uint32_t /* cmd_id */,
- const WifiChannelInfo& /* channel_hint */,
- uint32_t /* max_duration_seconds */,
- const V1_0::RttResponder& /* info */) {
+WifiStatus WifiRttController::enableResponderInternal(
+ uint32_t /* cmd_id */, const V1_0::WifiChannelInfo& /* channel_hint */,
+ uint32_t /* max_duration_seconds */, const V1_0::RttResponder& /* info */) {
// Deprecated support for this api
return {createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED)};
}
@@ -224,14 +259,43 @@
}
WifiStatus WifiRttController::registerEventCallbackInternal_1_4(
- const sp<V1_4::IWifiRttControllerEventCallback>& callback) {
+ const sp<V1_4::IWifiRttControllerEventCallback>& /* callback */) {
+ // Deprecated support for this api
+ return createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED);
+}
+
+WifiStatus WifiRttController::rangeRequestInternal_1_4(
+ uint32_t /* cmd_id */, const std::vector<V1_4::RttConfig>& /* rtt_configs */) {
+ // Deprecated support for this api
+ return createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED);
+}
+
+std::pair<WifiStatus, V1_4::RttCapabilities> WifiRttController::getCapabilitiesInternal_1_4() {
+ // Deprecated support for this api
+ return {createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED), {}};
+}
+
+std::pair<WifiStatus, V1_4::RttResponder> WifiRttController::getResponderInfoInternal_1_4() {
+ // Deprecated support for this api
+ return {createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED), {}};
+}
+
+WifiStatus WifiRttController::enableResponderInternal_1_4(
+ uint32_t /* cmd_id */, const V1_0::WifiChannelInfo& /* channel_hint */,
+ uint32_t /* max_duration_seconds */, const V1_4::RttResponder& /* info */) {
+ // Deprecated support for this api
+ return {createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED)};
+}
+
+WifiStatus WifiRttController::registerEventCallbackInternal_1_6(
+ const sp<V1_6::IWifiRttControllerEventCallback>& callback) {
// TODO(b/31632518): remove the callback when the client is destroyed
event_callbacks_.emplace_back(callback);
return createWifiStatus(WifiStatusCode::SUCCESS);
}
-WifiStatus WifiRttController::rangeRequestInternal_1_4(
- uint32_t cmd_id, const std::vector<V1_4::RttConfig>& rtt_configs) {
+WifiStatus WifiRttController::rangeRequestInternal_1_6(
+ uint32_t cmd_id, const std::vector<V1_6::RttConfig>& rtt_configs) {
std::vector<legacy_hal::wifi_rtt_config> legacy_configs;
if (!hidl_struct_util::convertHidlVectorOfRttConfigToLegacy(rtt_configs, &legacy_configs)) {
return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS);
@@ -245,14 +309,14 @@
LOG(ERROR) << "Callback invoked on an invalid object";
return;
}
- std::vector<V1_4::RttResult> hidl_results;
+ std::vector<V1_6::RttResult> hidl_results;
if (!hidl_struct_util::convertLegacyVectorOfRttResultToHidl(results,
&hidl_results)) {
LOG(ERROR) << "Failed to convert rtt results to HIDL structs";
return;
}
for (const auto& callback : shared_ptr_this->getEventCallbacks()) {
- callback->onResults_1_4(id, hidl_results);
+ callback->onResults_1_6(id, hidl_results);
}
};
legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->startRttRangeRequest(
@@ -260,38 +324,38 @@
return createWifiStatusFromLegacyError(legacy_status);
}
-std::pair<WifiStatus, V1_4::RttCapabilities> WifiRttController::getCapabilitiesInternal_1_4() {
+std::pair<WifiStatus, V1_6::RttCapabilities> WifiRttController::getCapabilitiesInternal_1_6() {
legacy_hal::wifi_error legacy_status;
legacy_hal::wifi_rtt_capabilities legacy_caps;
std::tie(legacy_status, legacy_caps) = legacy_hal_.lock()->getRttCapabilities(ifname_);
if (legacy_status != legacy_hal::WIFI_SUCCESS) {
return {createWifiStatusFromLegacyError(legacy_status), {}};
}
- V1_4::RttCapabilities hidl_caps;
+ V1_6::RttCapabilities hidl_caps;
if (!hidl_struct_util::convertLegacyRttCapabilitiesToHidl(legacy_caps, &hidl_caps)) {
return {createWifiStatus(WifiStatusCode::ERROR_UNKNOWN), {}};
}
return {createWifiStatus(WifiStatusCode::SUCCESS), hidl_caps};
}
-std::pair<WifiStatus, V1_4::RttResponder> WifiRttController::getResponderInfoInternal_1_4() {
+std::pair<WifiStatus, V1_6::RttResponder> WifiRttController::getResponderInfoInternal_1_6() {
legacy_hal::wifi_error legacy_status;
legacy_hal::wifi_rtt_responder legacy_responder;
std::tie(legacy_status, legacy_responder) = legacy_hal_.lock()->getRttResponderInfo(ifname_);
if (legacy_status != legacy_hal::WIFI_SUCCESS) {
return {createWifiStatusFromLegacyError(legacy_status), {}};
}
- V1_4::RttResponder hidl_responder;
+ V1_6::RttResponder hidl_responder;
if (!hidl_struct_util::convertLegacyRttResponderToHidl(legacy_responder, &hidl_responder)) {
return {createWifiStatus(WifiStatusCode::ERROR_UNKNOWN), {}};
}
return {createWifiStatus(WifiStatusCode::SUCCESS), hidl_responder};
}
-WifiStatus WifiRttController::enableResponderInternal_1_4(uint32_t cmd_id,
- const WifiChannelInfo& channel_hint,
+WifiStatus WifiRttController::enableResponderInternal_1_6(uint32_t cmd_id,
+ const V1_6::WifiChannelInfo& channel_hint,
uint32_t max_duration_seconds,
- const V1_4::RttResponder& info) {
+ const V1_6::RttResponder& info) {
legacy_hal::wifi_channel_info legacy_channel_info;
if (!hidl_struct_util::convertHidlWifiChannelInfoToLegacy(channel_hint, &legacy_channel_info)) {
return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS);
diff --git a/wifi/1.6/default/wifi_rtt_controller.h b/wifi/1.6/default/wifi_rtt_controller.h
index b4a2116..fd5f68b 100644
--- a/wifi/1.6/default/wifi_rtt_controller.h
+++ b/wifi/1.6/default/wifi_rtt_controller.h
@@ -19,8 +19,8 @@
#include <android-base/macros.h>
#include <android/hardware/wifi/1.0/IWifiIface.h>
-#include <android/hardware/wifi/1.4/IWifiRttController.h>
-#include <android/hardware/wifi/1.4/IWifiRttControllerEventCallback.h>
+#include <android/hardware/wifi/1.6/IWifiRttController.h>
+#include <android/hardware/wifi/1.6/IWifiRttControllerEventCallback.h>
#include "wifi_legacy_hal.h"
@@ -33,14 +33,14 @@
/**
* HIDL interface object used to control all RTT operations.
*/
-class WifiRttController : public V1_4::IWifiRttController {
+class WifiRttController : public V1_6::IWifiRttController {
public:
WifiRttController(const std::string& iface_name, const sp<IWifiIface>& bound_iface,
const std::weak_ptr<legacy_hal::WifiLegacyHal> legacy_hal);
// Refer to |WifiChip::invalidate()|.
void invalidate();
bool isValid();
- std::vector<sp<V1_4::IWifiRttControllerEventCallback>> getEventCallbacks();
+ std::vector<sp<V1_6::IWifiRttControllerEventCallback>> getEventCallbacks();
std::string getIfaceName();
// HIDL methods exposed.
@@ -57,7 +57,7 @@
Return<void> setLcr(uint32_t cmd_id, const RttLcrInformation& lcr,
setLcr_cb hidl_status_cb) override;
Return<void> getResponderInfo(getResponderInfo_cb hidl_status_cb) override;
- Return<void> enableResponder(uint32_t cmd_id, const WifiChannelInfo& channel_hint,
+ Return<void> enableResponder(uint32_t cmd_id, const V1_0::WifiChannelInfo& channel_hint,
uint32_t max_duration_seconds, const V1_0::RttResponder& info,
enableResponder_cb hidl_status_cb) override;
Return<void> disableResponder(uint32_t cmd_id, disableResponder_cb hidl_status_cb) override;
@@ -68,9 +68,19 @@
rangeRequest_1_4_cb hidl_status_cb) override;
Return<void> getCapabilities_1_4(getCapabilities_1_4_cb hidl_status_cb) override;
Return<void> getResponderInfo_1_4(getResponderInfo_1_4_cb hidl_status_cb) override;
- Return<void> enableResponder_1_4(uint32_t cmd_id, const WifiChannelInfo& channel_hint,
+ Return<void> enableResponder_1_4(uint32_t cmd_id, const V1_0::WifiChannelInfo& channel_hint,
uint32_t max_duration_seconds, const V1_4::RttResponder& info,
enableResponder_1_4_cb hidl_status_cb) override;
+ Return<void> registerEventCallback_1_6(
+ const sp<V1_6::IWifiRttControllerEventCallback>& callback,
+ registerEventCallback_1_6_cb hidl_status_cb) override;
+ Return<void> rangeRequest_1_6(uint32_t cmd_id, const hidl_vec<V1_6::RttConfig>& rtt_configs,
+ rangeRequest_1_6_cb hidl_status_cb) override;
+ Return<void> getCapabilities_1_6(getCapabilities_1_6_cb hidl_status_cb) override;
+ Return<void> getResponderInfo_1_6(getResponderInfo_1_6_cb hidl_status_cb) override;
+ Return<void> enableResponder_1_6(uint32_t cmd_id, const V1_6::WifiChannelInfo& channel_hint,
+ uint32_t max_duration_seconds, const V1_6::RttResponder& info,
+ enableResponder_1_6_cb hidl_status_cb) override;
private:
// Corresponding worker functions for the HIDL methods.
@@ -85,7 +95,7 @@
WifiStatus setLciInternal(uint32_t cmd_id, const RttLciInformation& lci);
WifiStatus setLcrInternal(uint32_t cmd_id, const RttLcrInformation& lcr);
std::pair<WifiStatus, V1_0::RttResponder> getResponderInfoInternal();
- WifiStatus enableResponderInternal(uint32_t cmd_id, const WifiChannelInfo& channel_hint,
+ WifiStatus enableResponderInternal(uint32_t cmd_id, const V1_0::WifiChannelInfo& channel_hint,
uint32_t max_duration_seconds,
const V1_0::RttResponder& info);
WifiStatus disableResponderInternal(uint32_t cmd_id);
@@ -95,14 +105,25 @@
const std::vector<V1_4::RttConfig>& rtt_configs);
std::pair<WifiStatus, V1_4::RttCapabilities> getCapabilitiesInternal_1_4();
std::pair<WifiStatus, V1_4::RttResponder> getResponderInfoInternal_1_4();
- WifiStatus enableResponderInternal_1_4(uint32_t cmd_id, const WifiChannelInfo& channel_hint,
+ WifiStatus enableResponderInternal_1_4(uint32_t cmd_id,
+ const V1_0::WifiChannelInfo& channel_hint,
uint32_t max_duration_seconds,
const V1_4::RttResponder& info);
+ WifiStatus registerEventCallbackInternal_1_6(
+ const sp<V1_6::IWifiRttControllerEventCallback>& callback);
+ WifiStatus rangeRequestInternal_1_6(uint32_t cmd_id,
+ const std::vector<V1_6::RttConfig>& rtt_configs);
+ std::pair<WifiStatus, V1_6::RttCapabilities> getCapabilitiesInternal_1_6();
+ std::pair<WifiStatus, V1_6::RttResponder> getResponderInfoInternal_1_6();
+ WifiStatus enableResponderInternal_1_6(uint32_t cmd_id,
+ const V1_6::WifiChannelInfo& channel_hint,
+ uint32_t max_duration_seconds,
+ const V1_6::RttResponder& info);
std::string ifname_;
sp<IWifiIface> bound_iface_;
std::weak_ptr<legacy_hal::WifiLegacyHal> legacy_hal_;
- std::vector<sp<V1_4::IWifiRttControllerEventCallback>> event_callbacks_;
+ std::vector<sp<V1_6::IWifiRttControllerEventCallback>> event_callbacks_;
bool is_valid_;
DISALLOW_COPY_AND_ASSIGN(WifiRttController);
diff --git a/wifi/1.6/default/wifi_sta_iface.cpp b/wifi/1.6/default/wifi_sta_iface.cpp
index f852d36..dd11839 100644
--- a/wifi/1.6/default/wifi_sta_iface.cpp
+++ b/wifi/1.6/default/wifi_sta_iface.cpp
@@ -150,6 +150,11 @@
&WifiStaIface::getLinkLayerStatsInternal_1_5, hidl_status_cb);
}
+Return<void> WifiStaIface::getLinkLayerStats_1_6(getLinkLayerStats_1_6_cb hidl_status_cb) {
+ return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
+ &WifiStaIface::getLinkLayerStatsInternal_1_6, hidl_status_cb);
+}
+
Return<void> WifiStaIface::startRssiMonitoring(uint32_t cmd_id, int32_t max_rssi, int32_t min_rssi,
startRssiMonitoring_cb hidl_status_cb) {
return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
@@ -422,13 +427,17 @@
}
std::pair<WifiStatus, V1_5::StaLinkLayerStats> WifiStaIface::getLinkLayerStatsInternal_1_5() {
+ return {createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED), {}};
+}
+
+std::pair<WifiStatus, V1_6::StaLinkLayerStats> WifiStaIface::getLinkLayerStatsInternal_1_6() {
legacy_hal::wifi_error legacy_status;
legacy_hal::LinkLayerStats legacy_stats;
std::tie(legacy_status, legacy_stats) = legacy_hal_.lock()->getLinkLayerStats(ifname_);
if (legacy_status != legacy_hal::WIFI_SUCCESS) {
return {createWifiStatusFromLegacyError(legacy_status), {}};
}
- V1_5::StaLinkLayerStats hidl_stats;
+ V1_6::StaLinkLayerStats hidl_stats;
if (!hidl_struct_util::convertLegacyLinkLayerStatsToHidl(legacy_stats, &hidl_stats)) {
return {createWifiStatus(WifiStatusCode::ERROR_UNKNOWN), {}};
}
diff --git a/wifi/1.6/default/wifi_sta_iface.h b/wifi/1.6/default/wifi_sta_iface.h
index 37358a5..c01c50b 100644
--- a/wifi/1.6/default/wifi_sta_iface.h
+++ b/wifi/1.6/default/wifi_sta_iface.h
@@ -19,7 +19,7 @@
#include <android-base/macros.h>
#include <android/hardware/wifi/1.0/IWifiStaIfaceEventCallback.h>
-#include <android/hardware/wifi/1.5/IWifiStaIface.h>
+#include <android/hardware/wifi/1.6/IWifiStaIface.h>
#include "hidl_callback_util.h"
#include "wifi_iface_util.h"
@@ -35,7 +35,7 @@
/**
* HIDL interface object used to control a STA Iface instance.
*/
-class WifiStaIface : public V1_5::IWifiStaIface {
+class WifiStaIface : public V1_6::IWifiStaIface {
public:
WifiStaIface(const std::string& ifname,
const std::weak_ptr<legacy_hal::WifiLegacyHal> legacy_hal,
@@ -71,6 +71,7 @@
Return<void> getLinkLayerStats(getLinkLayerStats_cb hidl_status_cb) override;
Return<void> getLinkLayerStats_1_3(getLinkLayerStats_1_3_cb hidl_status_cb) override;
Return<void> getLinkLayerStats_1_5(getLinkLayerStats_1_5_cb hidl_status_cb) override;
+ Return<void> getLinkLayerStats_1_6(getLinkLayerStats_1_6_cb hidl_status_cb) override;
Return<void> startRssiMonitoring(uint32_t cmd_id, int32_t max_rssi, int32_t min_rssi,
startRssiMonitoring_cb hidl_status_cb) override;
Return<void> stopRssiMonitoring(uint32_t cmd_id, stopRssiMonitoring_cb hidl_status_cb) override;
@@ -116,6 +117,7 @@
std::pair<WifiStatus, V1_0::StaLinkLayerStats> getLinkLayerStatsInternal();
std::pair<WifiStatus, V1_3::StaLinkLayerStats> getLinkLayerStatsInternal_1_3();
std::pair<WifiStatus, V1_5::StaLinkLayerStats> getLinkLayerStatsInternal_1_5();
+ std::pair<WifiStatus, V1_6::StaLinkLayerStats> getLinkLayerStatsInternal_1_6();
WifiStatus startRssiMonitoringInternal(uint32_t cmd_id, int32_t max_rssi, int32_t min_rssi);
WifiStatus stopRssiMonitoringInternal(uint32_t cmd_id);
std::pair<WifiStatus, StaRoamingCapabilities> getRoamingCapabilitiesInternal();