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

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

Merge "Revert "Revert "Wifi: Support check on device capability for 6GHZ"""

parents 964a1a67 95e36b70
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -13,6 +13,7 @@ hidl_interface {
        "IWifiChip.hal",
        "IWifiRttController.hal",
        "IWifiRttControllerEventCallback.hal",
        "IWifiStaIface.hal",
    ],
    interfaces: [
        "android.hardware.wifi@1.0",
+50 −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::MacAddress;
import @1.0::IWifiStaIface;
import @1.3::IWifiStaIface;

/**
 * Interface used to represent a single STA iface.
 *
 * IWifiChip.createStaIface() may return a @1.4::IWifiStaIface when supported.
 */
interface IWifiStaIface extends @1.3::IWifiStaIface {

    enum StaIfaceCapabilityMask : @1.0::IWifiStaIface.StaIfaceCapabilityMask {
        STA_6G = 1 << 15
    };

  /**
   * Get the capabilities supported by this STA iface.
   *
   * @return status WifiStatus of the operation.
   *         Possible status codes:
   *         |WifiStatusCode.SUCCESS|,
   *         |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
   *         |WifiStatusCode.ERROR_NOT_AVAILABLE|,
   *         |WifiStatusCode.ERROR_NOT_SUPPORTED|,
   *         |WifiStatusCode.ERROR_UNKNOWN|
   * @return capabilities Bitset of |StaIfaceCapabilityMask| values.
   */
  getCapabilities_1_4()
      generates (WifiStatus status,
                 bitfield<StaIfaceCapabilityMask> capabilities);
};
+6 −3
Original line number Diff line number Diff line
@@ -91,7 +91,7 @@ V1_3::IWifiChip::ChipCapabilityMask convertLegacyFeatureToHidlChipCapability(
}

IWifiStaIface::StaIfaceCapabilityMask
convertLegacyFeatureToHidlStaIfaceCapability(uint32_t feature) {
convertLegacyFeatureToHidlStaIfaceCapability(uint64_t feature) {
    using HidlStaIfaceCaps = IWifiStaIface::StaIfaceCapabilityMask;
    switch (feature) {
        case WIFI_FEATURE_GSCAN:
@@ -120,6 +120,8 @@ convertLegacyFeatureToHidlStaIfaceCapability(uint32_t feature) {
            return HidlStaIfaceCaps::ND_OFFLOAD;
        case WIFI_FEATURE_MKEEP_ALIVE:
            return HidlStaIfaceCaps::KEEP_ALIVE;
        case WIFI_FEATURE_INFRA_6G:
            return HidlStaIfaceCaps::STA_6G;
    };
    CHECK(false) << "Unknown legacy feature: " << feature;
    return {};
@@ -365,7 +367,7 @@ bool convertLegacyWifiMacInfosToHidl(
}

bool convertLegacyFeaturesToHidlStaCapabilities(
    uint32_t legacy_feature_set, uint32_t legacy_logger_feature_set,
    uint64_t legacy_feature_set, uint32_t legacy_logger_feature_set,
    uint32_t* hidl_caps) {
    if (!hidl_caps) {
        return false;
@@ -384,7 +386,8 @@ bool convertLegacyFeaturesToHidlStaCapabilities(
          WIFI_FEATURE_IE_WHITELIST, WIFI_FEATURE_SCAN_RAND,
          WIFI_FEATURE_INFRA_5G, WIFI_FEATURE_HOTSPOT, WIFI_FEATURE_PNO,
          WIFI_FEATURE_TDLS, WIFI_FEATURE_TDLS_OFFCHANNEL,
          WIFI_FEATURE_CONFIG_NDO, WIFI_FEATURE_MKEEP_ALIVE}) {
          WIFI_FEATURE_CONFIG_NDO, WIFI_FEATURE_MKEEP_ALIVE,
          WIFI_FEATURE_INFRA_6G}) {
        if (feature & legacy_feature_set) {
            *hidl_caps |= convertLegacyFeatureToHidlStaIfaceCapability(feature);
        }
+2 −1
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@
#include <android/hardware/wifi/1.2/types.h>
#include <android/hardware/wifi/1.3/IWifiChip.h>
#include <android/hardware/wifi/1.3/types.h>
#include <android/hardware/wifi/1.4/IWifiStaIface.h>
#include <android/hardware/wifi/1.4/types.h>

#include "wifi_legacy_hal.h"
@@ -69,7 +70,7 @@ bool convertLegacyWifiMacInfosToHidl(

// STA iface conversion methods.
bool convertLegacyFeaturesToHidlStaCapabilities(
    uint32_t legacy_feature_set, uint32_t legacy_logger_feature_set,
    uint64_t legacy_feature_set, uint32_t legacy_logger_feature_set,
    uint32_t* hidl_caps);
bool convertLegacyApfCapabilitiesToHidl(
    const legacy_hal::PacketFilterCapabilities& legacy_caps,
+1 −1
Original line number Diff line number Diff line
@@ -479,7 +479,7 @@ WifiLegacyHal::requestFirmwareMemoryDump(const std::string& iface_name) {
std::pair<wifi_error, uint32_t> WifiLegacyHal::getSupportedFeatureSet(
    const std::string& iface_name) {
    feature_set set;
    static_assert(sizeof(set) == sizeof(uint32_t),
    static_assert(sizeof(set) == sizeof(uint64_t),
                  "Some feature_flags can not be represented in output");
    wifi_error status = global_func_table_.wifi_get_supported_feature_set(
        getIfaceHandle(iface_name), &set);
Loading