From bd94b43bc988aeb53d2d19ed852a6d222602272e Mon Sep 17 00:00:00 2001 From: Bernie Innocenti Date: Fri, 2 Mar 2018 12:49:40 +0900 Subject: [PATCH] Add a wifi hal interface to read-back the APF memory. Test: builds, boots on marlin. Change-Id: I860ee093b585bedd800830ea05516ad054a8dc3a --- wifi/1.2/Android.bp | 1 + wifi/1.2/IWifiStaIface.hal | 54 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 wifi/1.2/IWifiStaIface.hal diff --git a/wifi/1.2/Android.bp b/wifi/1.2/Android.bp index f41324ed1d..c144f22a1b 100644 --- a/wifi/1.2/Android.bp +++ b/wifi/1.2/Android.bp @@ -13,6 +13,7 @@ hidl_interface { "IWifiChipEventCallback.hal", "IWifiNanIface.hal", "IWifiNanIfaceEventCallback.hal", + "IWifiStaIface.hal", ], interfaces: [ "android.hardware.wifi@1.0", diff --git a/wifi/1.2/IWifiStaIface.hal b/wifi/1.2/IWifiStaIface.hal new file mode 100644 index 0000000000..be4e5376d7 --- /dev/null +++ b/wifi/1.2/IWifiStaIface.hal @@ -0,0 +1,54 @@ +/* + * Copyright 2018 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@1.2; + +import @1.0::WifiStatus; +import @1.0::IWifiStaIface; + +/** + * Interface used to represent a single STA iface. + * + * IWifiChip.createStaIface() may return a @1.2::IWifiStaIface when supported. + */ +interface IWifiStaIface extends @1.0::IWifiStaIface { + /** + * Fetches a consistent snapshot of the entire APF program and working + * memory buffer and returns it to the host. The returned buffer contains + * both code and data. Its length must match the most recently returned + * |StaApfPacketFilterCapabilities.maxLength|. + * + * While the snapshot is being fetched, the APF intepreter must not execute + * and all incoming packets must be passed to the host as if there was no + * APF program installed. + * + * Must fail with |WifiStatusCode.ERROR_NOT_SUPPORTED| if + * |StaIfaceCapabilityMask.APF| is not set. + * + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, + * |WifiStatusCode.ERROR_NOT_SUPPORTED|, + * |WifiStatusCode.ERROR_NOT_AVAILABLE|, + * |WifiStatusCode.ERROR_UNKNOWN| + * @return data The entire APF working memory buffer when status is + * |WifiStatusCode.SUCCESS|, empty otherwise. + * @see getApfPacketFilterCapabilities() + * @see installApfPacketFilter() + */ + readApfPacketFilterData() generates (WifiStatus status, vec data); +};