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

Commit 34906c9b authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Remove unused wifi offload HAL." into udc-dev am: a60e28c8

parents 90d67d8d a60e28c8
Loading
Loading
Loading
Loading

wifi/offload/1.0/Android.bp

deleted100644 → 0
+0 −24
Original line number Diff line number Diff line
// This file is autogenerated by hidl-gen -Landroidbp.

package {
    // See: http://go/android-license-faq
    // A large-scale-change added 'default_applicable_licenses' to import
    // all of the 'license_kinds' from "hardware_interfaces_license"
    // to get the below license kinds:
    //   SPDX-license-identifier-Apache-2.0
    default_applicable_licenses: ["hardware_interfaces_license"],
}

hidl_interface {
    name: "android.hardware.wifi.offload@1.0",
    root: "android.hardware",
    srcs: [
        "types.hal",
        "IOffload.hal",
        "IOffloadCallback.hal",
    ],
    interfaces: [
        "android.hidl.base@1.0",
    ],
    gen_java: false,
}

wifi/offload/1.0/IOffload.hal

deleted100644 → 0
+0 −87
Original line number Diff line number Diff line
/*
 * Copyright 2016 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.offload@1.0;

import IOffloadCallback;

interface IOffload {
    /**
     * Configure the offload module to perform scans and filter results
     * Scans must not be triggered due to configuration of the module.
     *
     * @param ScanParam paramters for scanning
     * @param ScanFilter settings to filter scan result
     * @return OffloadStatus indicating status of operation provided by this API
     * If OffloadStatusCode::OK is returned, the operation was successful
     * If OffloadStatusCode::NO_CONNECTION is returned, connection to the hardware is lost
     * If OffloadStatusCode::ERROR is returned, requested operation could not be completed
     */
    @entry
    @callflow(next={"setEventCallback", "subscribeScanResults"})
    configureScans(ScanParam param, ScanFilter filter) generates (OffloadStatus status);

    /**
     * Get scan statistics
     *
     * @return OffloadStatus indicating status of operation provided by this API
     * @return ScanStats statistics of scans performed
     * If OffloadStatusCode::OK is returned, the operation was successful
     * If OffloadStatusCode::NO_CONNECTION is returned, connection to the hardware is lost
     * If OffloadStatusCode::ERROR is returned, requested operation could not be completed
     * If OffloadStatusCode::TIMEOUT is returned, time out waiting for the requested data
     */
    @exit
    @callflow(next={"subscribeScanResults", "unsubscribeScanResults", "getScanStats"})
    getScanStats() generates (OffloadStatus status, ScanStats scanStats);

    /**
     * Subscribe to asynchronous scan events sent by offload module. This enables
     * offload scans to be performed as per scan parameters, filtering the scan
     * results based on configured scan filter and delivering the results after
     * at least delayMs milliseconds from this call. If the client is already
     * subscribed to the scan results, a call to this API must be a no-op.
     *
     * @param delayMs an integer expressing the minimum delay in mS after
     *        subscribing when scan results must be delivered to the client
     * @return OffloadStatus indicating status of operation provided by this API
     * If OffloadStatusCode::OK is returned, the operation was successful
     * If OffloadStatusCode::NO_CONNECTION is returned, connection to the hardware is lost
     * If OffloadStatusCode::ERROR is returned, requested operation could not be completed
     */
    @callflow(next={"unsubscribeScanResults", "getScanStats"})
    subscribeScanResults(uint32_t delayMs) generates (OffloadStatus status);

    /**
     * Unsubscribe to scan events sent by the offload module, hence disabling scans.
     * If the client is already unsubscribed, a call to this API will be a no-op.
     */
    @exit
    @callflow(next={"*"})
    unsubscribeScanResults();

    /**
     * Setup the HIDL interface for reporting asynchronous scan events. A maximum
     * of one callback interface is supported. Only one callback must be registered
     * at any given time. If two consecutive calls are made with different callback
     * interface objects, the latest one must be used to deliver events to client.
     *
     * @param cb An instance of the |IOffloadCallback| HIDL interface object
     */
    @entry
    @callflow(next={"subscribeScanStats", "configureScans"})
    setEventCallback(IOffloadCallback cb);
};
+0 −32
Original line number Diff line number Diff line
/*
 * Copyright 2016 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.offload@1.0;

interface IOffloadCallback {
    /**
     * Interface for the Offload HAL to return scan events to the client
     *
     * @param scanResult a vector of scan result objects
     */
    oneway onScanResult(vec<ScanResult> scanResult);
    /**
     * Interface for the Offload HAL to inform the client of error conditions
     * see OffloadStatus for the error conditions to be reported
     *
     * @param status OffloadStatus
     */
    oneway onError(OffloadStatus status);
};

wifi/offload/1.0/types.hal

deleted100644 → 0
+0 −226
Original line number Diff line number Diff line
/*
 * Copyright 2017 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.offload@1.0;

/**
 * Defines a bitmap of security modes
 */
enum SecurityMode : uint8_t {
    OPEN                    = 0x1 << 1,
    WEP                     = 0x1 << 2,
    PSK                     = 0x1 << 3,
    EAP                     = 0x1 << 4,
};

/**
 * SSID of the Access Point, maximum 32 characters
 */
typedef vec<uint8_t> Ssid;

/**
 * Preferred network information
 * SSID and associated security mode(s)
 */
struct NetworkInfo {
    Ssid ssid;
    /* SecurityMode flags that are associated with this SSID
     * More than one security mode can be supported, see SecurityMode */
    bitfield<SecurityMode> flags;
};

/**
 * This is a bit mask describing the capabilities of a BSS.
 * See IEEE Std 802.11: 8.4.1.4
 */
enum Capability : uint16_t {
    ESS                     = 1 << 0,
    IBSS                    = 1 << 1,
    CF_POLLABLE             = 1 << 2,
    CF_PLL_REQ              = 1 << 3,
    PRIVACY                 = 1 << 4,
    SHORT_PREAMBLE          = 1 << 5,
    PBCC                    = 1 << 6,
    CHANNEL_AGILITY         = 1 << 7,
    SPECTURM_MGMT           = 1 << 8,
    QOS                     = 1 << 9,
    SHORT_SLOT_TIME         = 1 << 10,
    APSD                    = 1 << 11,
    RADIO_MEASUREMENT       = 1 << 12,
    DSSS_OFDM               = 1 << 13,
    DELAYED_BLOCK_ACK       = 1 << 14,
    IMMEDIATE_BLOCK_ACK     = 1 << 15,
};

/**
 * Scan Results returned by the offload Hal
 */
struct ScanResult {
    /* Information about this BSS
     * SSID and security modes supported */
    NetworkInfo networkInfo;
    /* BSSID of the BSS */
    uint8_t[6] bssid;
    /* Can have multiple bits set, see Capability */
    bitfield<Capability> capability;
    /* Frequency scanned, in mHz */
    uint32_t frequency;
    /* Signal strength in dBm */
    int8_t rssi;
    /* TSF found in beacon/probe response */
    uint64_t tsf;
};


/**
 * Parameters for performing offload scans
 */
struct ScanParam {
    /* Specify a list of SSIDs to scan, an empty list implies no preferred
     * networks to scan */
    vec<Ssid> ssidList;
    /* Frequencies to scan, in mHz, an empty frequency list implies a full scan */
    vec<uint32_t> frequencyList;
    /* Periodicity of the scans to be performed by the offload module
     * A value of zero indicates disable periodic scans. For this revision,
     * where offload module is performing scans in disconnected mode, this value
     * should not be zero. In future versions, periodic scans can be eliminated */
    uint32_t disconnectedModeScanIntervalMs;
};

/**
 * Instruction on how to filter the scan result before performing network
 * selection and waking up the AP to connect
 */
struct ScanFilter {
    /* Preferred network List of SSIDs and their security mode of interest
     * The filter will drop the remaining scan results in the scan event.
     * An empty list implies no filtering of scan result based on SSID and
     * security mode. */
    vec<NetworkInfo> preferredNetworkInfoList;
    /* Minimum qualifying RSSI to be considered for network selection (dBm) */
    int8_t rssiThreshold;
};

struct ScanRecord {
    /* Amount of time spent scanning */
    uint64_t durationMs;
    /* Number of channels scanned */
    uint32_t numChannelsScanned;
    /* Number of entries aggregated into this record */
    uint32_t numEntriesAggregated;
};

/**
 * Enumerates the type of log that is recorded
 */
enum RecordName : uint32_t {
    CMD_BASE                        = 0x00001000,
    /* Record name corresponding to initialization */
    CMD_INT                         = CMD_BASE + 0,
   /* Record name corresponding to configureScans() API */
    CMD_CONFIG_SCANS                = CMD_BASE + 1,
    /* Record name corresponding to subscribeScanResults() API */
    CMD_SUBSCRIBE_SCAN_RESULTS      = CMD_BASE + 2,
    /* Record name corresponding to unsubscribeScanResults() API */
    CMD_UNSUBSCRIBE_SCAN_RESULTS    = CMD_BASE + 3,
    /* Record name corresponding to getScanStats() API */
    CMD_GET_SCAN_STATS              = CMD_BASE + 4,
    /* Record name corresponding to a reset*/
    CMD_RESET                       = CMD_BASE + 5,
    /* Add new commands here */
    EVENT_RECVD_BASE                = 0x00002000,
    /* Record name corresponding to scan monitor event*/
    EVENT_RECVD_SCAN_RESULT_ASYNC   = EVENT_RECVD_BASE + 0,
    /* Record name corresponding to scan response event */
    EVENT_RECVD_SCAN_RESULT         = EVENT_RECVD_BASE + 1,
    /* Add new events received here */
    EVENT_SENT_BASE                 = 0x00003000,
    /* Record name corresponding to scan event sent */
    EVENT_SENT_SCAN_RESULT          = EVENT_SENT_BASE + 0,
    /* Record name corresponding to abort event sent */
    EVENT_SENT_ABORT                = EVENT_SENT_BASE + 1,
    /* Record name corresponding to error event sent */
    EVENT_SENT_ERROR                = EVENT_SENT_BASE + 2,
    /* Add new events sent here */
    REQ_BASE                        = 0x00004000,
    /* Record name corresponding to scan request sent*/
    REQ_SCAN                        = REQ_BASE + 0,
    /* Add new requests here */
};

/**
 * Defines the structure of each log record
 */
struct LogRecord {
    /* Indicates the log recorded */
    RecordName recordName;
    /* Platform reference time in milliseconds when the log is recorded */
    uint64_t logTimeMs;
};

/**
 * Defines the scan statistics to be returned to the framework
 */
struct ScanStats {
    /* Incremented everytime a new scan is requested */
    uint32_t numScansRequestedByWifi;
    /* Incremented everytime the scan is serviced by performing a scan*/
    uint32_t numScansServicedByWifi;
    /* Incremented everytime the scan is serviced by the scan cache */
    uint32_t numScansServicedbyCache;
    /* The last (CHRE reference) time this data structure is updated */
    uint64_t lastUpdated;
    /* The last (CHRE reference) time this data structure is read */
    uint64_t lastRead;
    /* The total time when the Offload module could be performing scans (T2 - T1)
     * T1 - time when the framework subscribes for scan result (includes delayMs)
     * T2 - min (time when the framework unsubscribes for scan result,
     * currentTime) */
    uint64_t subscriptionDurationMs;
    /* Histograms of the channels scanned, 802.11 and with an 8 bit
     * representation, only 256 channels are available */
    uint8_t[256] histogramChannelsScanned;
    /* Scan Record for this subscribe duration */
    vec<ScanRecord> scanRecord;
    /* Vector of the logRecord entries */
    vec<LogRecord> logRecord;
};

/**
 * Defines a list of return codes to indicate status of Offload HAL
 */
enum OffloadStatusCode : uint32_t {
    /* No error */
    OK,
    /* No Connection to underlying implementation */
    NO_CONNECTION,
    /* Operation timeout */
    TIMEOUT,
    /* Other errors */
    ERROR
};

/**
 * Generic structures to return the status of an operation
 */
struct OffloadStatus {
  OffloadStatusCode code;
  /* Error message */
  string description;
};


+0 −32
Original line number Diff line number Diff line
//
// Copyright (C) 2017 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 {
    // See: http://go/android-license-faq
    // A large-scale-change added 'default_applicable_licenses' to import
    // all of the 'license_kinds' from "hardware_interfaces_license"
    // to get the below license kinds:
    //   SPDX-license-identifier-Apache-2.0
    default_applicable_licenses: ["hardware_interfaces_license"],
}

cc_test {
    name: "VtsHalWifiOffloadV1_0TargetTest",
    defaults: ["VtsHalTargetTestDefaults"],
    srcs: ["VtsHalWifiOffloadV1_0TargetTest.cpp"],
    static_libs: ["android.hardware.wifi.offload@1.0"],
    test_suites: ["general-tests", "vts"],
}
Loading