Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c71f0f17 authored by Ahmed ElArabawy's avatar Ahmed ElArabawy Committed by Android (Google) Code Review
Browse files

Merge "Wifi: Add 802.11ax support to RTT"

parents 7519669a eeb53385
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -7,8 +7,12 @@ hidl_interface {
        enabled: true,
    },
    srcs: [
        "types.hal",
        "IWifi.hal",
        "IWifiApIface.hal",
        "IWifiChip.hal",
        "IWifiRttController.hal",
        "IWifiRttControllerEventCallback.hal",
    ],
    interfaces: [
        "android.hardware.wifi@1.0",

wifi/1.4/IWifiChip.hal

0 → 100644
+46 −0
Original line number Diff line number Diff line
/*
 * Copyright 2019 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.4;

import @1.0::WifiStatus;
import @1.0::IWifiIface;
import @1.3::IWifiChip;
import IWifiRttController;

/**
 * Interface that represents a chip that must be configured as a single unit.
 */
interface IWifiChip extends @1.3::IWifiChip {
    /**
     * Create a RTTController instance.
     *
     * RTT controller can be either:
     * a) Bound to a specific iface by passing in the corresponding |IWifiIface|
     * object in |iface| param, OR
     * b) Let the implementation decide the iface to use for RTT operations by
     * passing null in |iface| param.
     *
     * @param boundIface HIDL interface object representing the iface if
     *        the responder must be bound to a specific iface, null otherwise.
     * @return status WifiStatus of the operation.
     *         Possible status codes:
     *         |WifiStatusCode.SUCCESS|,
     *         |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|
     */
    createRttController_1_4(IWifiIface boundIface)
        generates (WifiStatus status, IWifiRttController rtt);
};
+102 −0
Original line number Diff line number Diff line
/*
 * Copyright 2019 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.4;

import @1.0::IWifiRttController;
import @1.0::CommandId;
import @1.0::WifiChannelInfo;
import @1.0::WifiStatus;
import IWifiRttControllerEventCallback;

/**
 * Interface used to perform RTT(Round trip time) operations.
 */
interface IWifiRttController extends @1.0::IWifiRttController {
    /**
     * Requests notifications of significant events on this rtt controller.
     * Multiple calls to this must register multiple callbacks each of which must
     * receive all events.
     *
     * @param callback An instance of the |IWifiRttControllerEventCallback| HIDL
     *        interface object.
     * @return status WifiStatus of the operation.
     *         Possible status codes:
     *         |WifiStatusCode.SUCCESS|,
     *         |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|
     */
    registerEventCallback_1_4(IWifiRttControllerEventCallback callback)
        generates (WifiStatus status);

    /**
     * API to request RTT measurement.
     *
     * @param cmdId command Id to use for this invocation.
     * @param rttConfigs Vector of |RttConfig| parameters.
     * @return status WifiStatus of the operation.
     *         Possible status codes:
     *         |WifiStatusCode.SUCCESS|,
     *         |WifiStatusCode.ERROR_WIFI_RTT_CONTROLLER_INVALID|,
     *         |WifiStatusCode.ERROR_INVALID_ARGS|,
     *         |WifiStatusCode.ERROR_NOT_AVAILABLE|,
     *         |WifiStatusCode.ERROR_UNKNOWN|
     */
    rangeRequest_1_4(CommandId cmdId, vec<RttConfig> rttConfigs) generates (WifiStatus status);

    /**
     * RTT capabilities of the device.
     *
     * @return status WifiStatus of the operation.
     *         Possible status codes:
     *         |WifiStatusCode.SUCCESS|,
     *         |WifiStatusCode.ERROR_WIFI_RTT_CONTROLLER_INVALID|,
     *         |WifiStatusCode.ERROR_UNKNOWN|
     * @return capabilities Instance of |RttCapabilities|.
     */
    getCapabilities_1_4() generates (WifiStatus status, RttCapabilities capabilities);

    /**
     * Get RTT responder information e.g. WiFi channel to enable responder on.
     *
     * @return status WifiStatus of the operation.
     *         Possible status codes:
     *         |WifiStatusCode.SUCCESS|,
     *         |WifiStatusCode.ERROR_WIFI_RTT_CONTROLLER_INVALID|,
     *         |WifiStatusCode.ERROR_NOT_AVAILABLE|,
     *         |WifiStatusCode.ERROR_UNKNOWN|
     * @return info Instance of |RttResponderInfo|.
     */
    getResponderInfo_1_4() generates (WifiStatus status, RttResponder info);

    /**
     * Enable RTT responder mode.
     *
     * @param cmdId command Id to use for this invocation.
     * @parm channelHint Hint of the channel information where RTT responder must
     *       be enabled on.
     * @param maxDurationInSeconds Timeout of responder mode.
     * @param info Instance of |RttResponderInfo|.
     * @return status WifiStatus of the operation.
     *         Possible status codes:
     *         |WifiStatusCode.SUCCESS|,
     *         |WifiStatusCode.ERROR_WIFI_RTT_CONTROLLER_INVALID|,
     *         |WifiStatusCode.ERROR_INVALID_ARGS|,
     *         |WifiStatusCode.ERROR_NOT_AVAILABLE|,
     *         |WifiStatusCode.ERROR_UNKNOWN|
     */
    enableResponder_1_4(CommandId cmdId, WifiChannelInfo channelHint,
        uint32_t maxDurationInSeconds, RttResponder info) generates (WifiStatus status);
};
+33 −0
Original line number Diff line number Diff line
/*
 * Copyright 2019 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.4;

import @1.0::IWifiRttControllerEventCallback;
import @1.0::CommandId;

/**
 * RTT Response and Event Callbacks.
 */
interface IWifiRttControllerEventCallback extends @1.0::IWifiRttControllerEventCallback {
    /*
     * Invoked when an RTT result is available.
     *
     * @param cmdId command Id corresponding to the original request.
     * @param results Vector of |RttResult| instances.
     */
    oneway onResults_1_4(CommandId cmdId, vec<RttResult> results);
};
+10 −3
Original line number Diff line number Diff line
@@ -2279,6 +2279,8 @@ legacy_hal::wifi_rtt_preamble convertHidlRttPreambleToLegacy(RttPreamble type) {
            return legacy_hal::WIFI_RTT_PREAMBLE_HT;
        case RttPreamble::VHT:
            return legacy_hal::WIFI_RTT_PREAMBLE_VHT;
        case RttPreamble::HE:
            return legacy_hal::WIFI_RTT_PREAMBLE_HE;
    };
    CHECK(false);
}
@@ -2291,6 +2293,8 @@ RttPreamble convertLegacyRttPreambleToHidl(legacy_hal::wifi_rtt_preamble type) {
            return RttPreamble::HT;
        case legacy_hal::WIFI_RTT_PREAMBLE_VHT:
            return RttPreamble::VHT;
        case legacy_hal::WIFI_RTT_PREAMBLE_HE:
            return RttPreamble::HE;
    };
    CHECK(false) << "Unknown legacy type: " << type;
}
@@ -2354,6 +2358,8 @@ WifiRatePreamble convertLegacyWifiRatePreambleToHidl(uint8_t preamble) {
            return WifiRatePreamble::HT;
        case 3:
            return WifiRatePreamble::VHT;
        case 4:
            return WifiRatePreamble::HE;
        default:
            return WifiRatePreamble::RESERVED;
    };
@@ -2579,9 +2585,10 @@ bool convertLegacyRttCapabilitiesToHidl(
    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}) {
    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}) {
        if (legacy_capabilities.preamble_support & flag) {
            hidl_capabilities->preambleSupport |=
                static_cast<std::underlying_type<RttPreamble>::type>(
Loading