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/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