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