1/*
2 * Copyright 2017 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package [email protected];
18
19import @1.0::IWifiChip;
20import @1.0::WifiStatus;
21
22/**
23 * Interface that represents a chip that must be configured as a single unit.
24 * The HAL/driver/firmware will be responsible for determining which phy is used
25 * to perform operations like NAN, RTT, etc.
26 */
27interface IWifiChip extends @1.0::IWifiChip {
28  /**
29   * Capabilities exposed by this chip.
30   */
31  enum ChipCapabilityMask : @1.0::IWifiChip.ChipCapabilityMask {
32    /**
33     * Set/Reset Tx Power limits.
34     */
35    SET_TX_POWER_LIMIT = 1 << 8,
36    /**
37     * Device to Device RTT.
38     */
39    D2D_RTT            = 1 << 9,
40    /**
41     * Device to AP RTT.
42     */
43    D2AP_RTT           = 1 << 10
44  };
45
46  /**
47   * List of preset wifi radio TX power levels for different scenarios.
48   * The actual power values (typically varies based on the channel,
49   * 802.11 connection type, number of MIMO streams, etc) for each scenario
50   * is defined by the OEM as a BDF file since it varies for each wifi chip
51   * vendor and device.
52   */
53  enum TxPowerScenario : uint32_t {
54    VOICE_CALL = 0,
55  };
56
57  /**
58   * API to select one of the preset TX power scenarios.
59   *
60   * The framework must invoke this method with the appropriate scenario to let
61   * the wifi chip change it's transmitting power levels.
62   * OEM's should define various power profiles for each of the scenarios
63   * above (defined in |TxPowerScenario|).
64   *
65   * @param scenario One of the preselected scenarios defined in
66   *        |TxPowerScenario|.
67   * @return status WifiStatus of the operation.
68   *         Possible status codes:
69   *         |WifiStatusCode.SUCCESS|,
70   *         |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
71   *         |WifiStatusCode.ERROR_NOT_SUPPORTED|,
72   *         |WifiStatusCode.NOT_AVAILABLE|,
73   *         |WifiStatusCode.UNKNOWN|
74   */
75  selectTxPowerScenario(TxPowerScenario scenario) generates (WifiStatus status);
76
77  /**
78   * API to reset TX power levels.
79   * This is used to indicate the end of the previously selected TX power
80   * scenario and let the wifi chip fall back to the default power values.
81   *
82   * @return status WifiStatus of the operation.
83   *         Possible status codes:
84   *         |WifiStatusCode.SUCCESS|,
85   *         |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
86   *         |WifiStatusCode.ERROR_NOT_SUPPORTED|,
87   *         |WifiStatusCode.NOT_AVAILABLE|,
88   *         |WifiStatusCode.UNKNOWN|
89   */
90  resetTxPowerScenario() generates (WifiStatus status);
91};
92