blob: 2702759c416dac618eb20c968c02a56ff234b055 [file] [log] [blame]
Jimmy Chen1bdf1a72019-12-23 17:53:40 +02001/*
2 * Copyright 2020 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 android.hardware.wifi@1.5;
18
19import @1.0::WifiStatus;
lesl420c4fc2020-11-23 19:33:04 +080020import @1.5::IWifiApIface;
Jimmy Chen1bdf1a72019-12-23 17:53:40 +020021import @1.0::IWifiIface;
22import @1.3::IWifiChip;
23import @1.4::IWifiChip;
24
25/**
26 * Interface that represents a chip that must be configured as a single unit.
27 */
28interface IWifiChip extends @1.4::IWifiChip {
29 /**
30 * Capabilities exposed by this chip.
31 */
32 enum ChipCapabilityMask : @1.3::IWifiChip.ChipCapabilityMask {
33 /**
34 * chip can operate in the 60GHz band(WiGig chip)
35 */
36 WIGIG = 1 << 14,
37 };
38
39 /**
Roshan Piuse9d1e7d2020-11-04 11:44:16 -080040 * When there are 2 or more simultaneous STA connections, this use case hint indicates what
41 * use-case is being enabled by the framework. This use case hint can be used by the firmware
42 * to modify various firmware configurations like:
43 * - Allowed BSSIDs the firmware can choose for the initial connection/roaming attempts.
44 * - Duty cycle to choose for the 2 STA connections if the radio is in MCC mode.
45 * - Whether roaming, APF and other offloads needs to be enabled or not.
46 * Note:
47 * - This will be invoked before an active wifi connection is established on the second
48 * interface.
49 * - This use-case hint is implicitly void when the second STA interface is brought down.
50 */
51 enum MultiStaUseCase : uint8_t {
52 /**
53 * Usage:
54 * - This will be sent down for make before break use-case.
55 * - Platform is trying to speculatively connect to a second network and evaluate it without
56 * disrupting the primary connection.
57 * Requirements for Firmware:
58 * - Do not reduce the number of tx/rx chains of primary connection.
59 * - If using MCC, should set the MCC duty cycle of the primary connection to be higher than
60 * the secondary connection (maybe 70/30 split).
61 * - Should pick the best BSSID for the secondary STA (disregard the chip mode) independent
62 * of the primary STA:
63 * - Don’t optimize for DBS vs MCC/SCC
64 * - Should not impact the primary connection’s bssid selection:
65 * - Don’t downgrade chains of the existing primary connection.
66 * - Don’t optimize for DBS vs MCC/SCC.
67 */
68 DUAL_STA_TRANSIENT_PREFER_PRIMARY = 0,
69 /**
70 * Usage:
71 * - This will be sent down for any app requested peer to peer connections.
72 * - In this case, both the connections needs to be allocated equal resources.
73 * - For the peer to peer use case, BSSID for the secondary connection will be chosen by the
74 * framework.
75 *
76 * Requirements for Firmware:
77 * - Can choose MCC or DBS mode depending on the MCC efficiency and HW capability.
78 * - If using MCC, set the MCC duty cycle of the primary connection to be equal to the
79 * secondary connection.
80 * - Prefer BSSID candidates which will help provide the best "overall" performance for both
81 * the connections.
82 */
83 DUAL_STA_NON_TRANSIENT_UNBIASED = 1,
84 };
85
86 /**
Jimmy Chen1bdf1a72019-12-23 17:53:40 +020087 * Get the capabilities supported by this chip.
88 *
89 * @return status WifiStatus of the operation.
90 * Possible status codes:
91 * |WifiStatusCode.SUCCESS|,
92 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
93 * |WifiStatusCode.ERROR_NOT_AVAILABLE|,
94 * |WifiStatusCode.ERROR_UNKNOWN|
95 * @return capabilities Bitset of |ChipCapabilityMask| values.
96 */
97 getCapabilities_1_5()
98 generates (WifiStatus status, bitfield<ChipCapabilityMask> capabilities);
Roshan Piuse9d1e7d2020-11-04 11:44:16 -080099
100 /**
101 * Invoked to indicate that the provided iface is the primary STA iface when there are more
102 * than 1 STA iface concurrently active.
103 * Note: If the wifi firmware/chip cannot support multiple instances of any offload
104 * (like roaming, APF, rssi threshold, etc), the firmware should ensure that these
105 * offloads are at least enabled for the primary interface. If the new primary interface is
106 * already connected to a network, the firmware must switch all the offloads on
107 * this new interface without disconnecting.
108 *
109 * @param ifname Name of the STA iface.
110 * @return status WifiStatus of the operation.
111 * Possible status codes:
112 * |WifiStatusCode.SUCCESS|,
113 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
114 * |WifiStatusCode.ERROR_INVALID_ARGS|
115 */
116 setMultiStaPrimaryConnection(string ifName) generates (WifiStatus status);
117
118 /**
119 * Invoked to indicate the STA + STA use-case that is active.
120 *
121 * Refer to documentation of |MultiStaUseCase| for details.
122 *
123 * @param useCase Use case that is active.
124 * @return status WifiStatus of the operation.
125 * Possible status codes:
126 * |WifiStatusCode.SUCCESS|,
127 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
128 * |WifiStatusCode.ERROR_INVALID_ARGS|
129 */
130 setMultiStaUseCase(MultiStaUseCase useCase) generates (WifiStatus status);
lesl94d28242020-11-18 22:17:37 +0800131
132
133 /**
134 * Create bridged IWifiApIface.
135 *
136 * Depending on the mode the chip is configured in, the interface creation
137 * may fail (code: |ERROR_NOT_AVAILABLE|) if we've already reached the maximum
138 * allowed (specified in |ChipIfaceCombination|) number of ifaces of the AP
139 * type.
140 *
141 * @return status WifiStatus of the operation.
142 * Possible status codes:
143 * |WifiStatusCode.SUCCESS|,
144 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
145 * |WifiStatusCode.ERROR_NOT_SUPPORTED|,
146 * |WifiStatusCode.ERROR_NOT_AVAILABLE|
147 * @return iface HIDL interface object representing the iface if
148 * successful, null otherwise.
149 */
150 createBridgedApIface() generates (WifiStatus status, IWifiApIface iface);
151
152 /**
153 * Removes one of the instance on the AP Iface with the provided ifaceName and
154 * ifaceInstanceName.
155 *
156 * Use the API: removeApIface with brIfaceName in the V1_0::WifiChip.hal to remove bridge Iface.
157 *
158 * @param brIfaceName Name of the bridged AP iface.
159 * @param ifaceInstanceName Name of the instance. The empty instance is
160 * invalid.
161 * @return status WifiStatus of the operation.
162 * Possible status codes:
163 * |WifiStatusCode.SUCCESS|,
164 * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
165 * |WifiStatusCode.ERROR_INVALID_ARGS|,
166 * |WifiStatusCode.ERROR_NOT_AVAILABLE|
167 */
168 removeIfaceInstanceFromBridgedApIface(string brIfaceName, string ifaceInstanceName)
169 generates (WifiStatus status);
Jimmy Chen1bdf1a72019-12-23 17:53:40 +0200170};