Jimmy Chen | 1bdf1a7 | 2019-12-23 17:53:40 +0200 | [diff] [blame] | 1 | /* |
| 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 | |
| 17 | package android.hardware.wifi@1.5; |
| 18 | |
| 19 | import @1.0::WifiStatus; |
Quang Luong | 94bcce5 | 2020-11-25 17:52:19 -0800 | [diff] [blame] | 20 | import @1.0::IfaceType; |
lesl | 420c4fc | 2020-11-23 19:33:04 +0800 | [diff] [blame] | 21 | import @1.5::IWifiApIface; |
Jimmy Chen | 1bdf1a7 | 2019-12-23 17:53:40 +0200 | [diff] [blame] | 22 | import @1.0::IWifiIface; |
| 23 | import @1.3::IWifiChip; |
| 24 | import @1.4::IWifiChip; |
| 25 | |
| 26 | /** |
| 27 | * Interface that represents a chip that must be configured as a single unit. |
| 28 | */ |
| 29 | interface IWifiChip extends @1.4::IWifiChip { |
| 30 | /** |
| 31 | * Capabilities exposed by this chip. |
| 32 | */ |
| 33 | enum ChipCapabilityMask : @1.3::IWifiChip.ChipCapabilityMask { |
| 34 | /** |
| 35 | * chip can operate in the 60GHz band(WiGig chip) |
| 36 | */ |
| 37 | WIGIG = 1 << 14, |
| 38 | }; |
| 39 | |
| 40 | /** |
Roshan Pius | e9d1e7d | 2020-11-04 11:44:16 -0800 | [diff] [blame] | 41 | * When there are 2 or more simultaneous STA connections, this use case hint indicates what |
| 42 | * use-case is being enabled by the framework. This use case hint can be used by the firmware |
| 43 | * to modify various firmware configurations like: |
| 44 | * - Allowed BSSIDs the firmware can choose for the initial connection/roaming attempts. |
| 45 | * - Duty cycle to choose for the 2 STA connections if the radio is in MCC mode. |
| 46 | * - Whether roaming, APF and other offloads needs to be enabled or not. |
| 47 | * Note: |
| 48 | * - This will be invoked before an active wifi connection is established on the second |
| 49 | * interface. |
| 50 | * - This use-case hint is implicitly void when the second STA interface is brought down. |
| 51 | */ |
| 52 | enum MultiStaUseCase : uint8_t { |
| 53 | /** |
| 54 | * Usage: |
| 55 | * - This will be sent down for make before break use-case. |
| 56 | * - Platform is trying to speculatively connect to a second network and evaluate it without |
| 57 | * disrupting the primary connection. |
| 58 | * Requirements for Firmware: |
| 59 | * - Do not reduce the number of tx/rx chains of primary connection. |
| 60 | * - If using MCC, should set the MCC duty cycle of the primary connection to be higher than |
| 61 | * the secondary connection (maybe 70/30 split). |
| 62 | * - Should pick the best BSSID for the secondary STA (disregard the chip mode) independent |
| 63 | * of the primary STA: |
| 64 | * - Don’t optimize for DBS vs MCC/SCC |
| 65 | * - Should not impact the primary connection’s bssid selection: |
| 66 | * - Don’t downgrade chains of the existing primary connection. |
| 67 | * - Don’t optimize for DBS vs MCC/SCC. |
| 68 | */ |
| 69 | DUAL_STA_TRANSIENT_PREFER_PRIMARY = 0, |
| 70 | /** |
| 71 | * Usage: |
| 72 | * - This will be sent down for any app requested peer to peer connections. |
| 73 | * - In this case, both the connections needs to be allocated equal resources. |
| 74 | * - For the peer to peer use case, BSSID for the secondary connection will be chosen by the |
| 75 | * framework. |
| 76 | * |
| 77 | * Requirements for Firmware: |
| 78 | * - Can choose MCC or DBS mode depending on the MCC efficiency and HW capability. |
| 79 | * - If using MCC, set the MCC duty cycle of the primary connection to be equal to the |
| 80 | * secondary connection. |
| 81 | * - Prefer BSSID candidates which will help provide the best "overall" performance for both |
| 82 | * the connections. |
| 83 | */ |
| 84 | DUAL_STA_NON_TRANSIENT_UNBIASED = 1, |
| 85 | }; |
| 86 | |
| 87 | /** |
Jimmy Chen | 1bdf1a7 | 2019-12-23 17:53:40 +0200 | [diff] [blame] | 88 | * Get the capabilities supported by this chip. |
| 89 | * |
| 90 | * @return status WifiStatus of the operation. |
| 91 | * Possible status codes: |
| 92 | * |WifiStatusCode.SUCCESS|, |
| 93 | * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|, |
| 94 | * |WifiStatusCode.ERROR_NOT_AVAILABLE|, |
| 95 | * |WifiStatusCode.ERROR_UNKNOWN| |
| 96 | * @return capabilities Bitset of |ChipCapabilityMask| values. |
| 97 | */ |
| 98 | getCapabilities_1_5() |
| 99 | generates (WifiStatus status, bitfield<ChipCapabilityMask> capabilities); |
Roshan Pius | e9d1e7d | 2020-11-04 11:44:16 -0800 | [diff] [blame] | 100 | |
| 101 | /** |
| 102 | * Invoked to indicate that the provided iface is the primary STA iface when there are more |
| 103 | * than 1 STA iface concurrently active. |
| 104 | * Note: If the wifi firmware/chip cannot support multiple instances of any offload |
| 105 | * (like roaming, APF, rssi threshold, etc), the firmware should ensure that these |
| 106 | * offloads are at least enabled for the primary interface. If the new primary interface is |
| 107 | * already connected to a network, the firmware must switch all the offloads on |
| 108 | * this new interface without disconnecting. |
| 109 | * |
| 110 | * @param ifname Name of the STA iface. |
| 111 | * @return status WifiStatus of the operation. |
| 112 | * Possible status codes: |
| 113 | * |WifiStatusCode.SUCCESS|, |
| 114 | * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|, |
| 115 | * |WifiStatusCode.ERROR_INVALID_ARGS| |
| 116 | */ |
| 117 | setMultiStaPrimaryConnection(string ifName) generates (WifiStatus status); |
| 118 | |
| 119 | /** |
| 120 | * Invoked to indicate the STA + STA use-case that is active. |
| 121 | * |
| 122 | * Refer to documentation of |MultiStaUseCase| for details. |
| 123 | * |
| 124 | * @param useCase Use case that is active. |
| 125 | * @return status WifiStatus of the operation. |
| 126 | * Possible status codes: |
| 127 | * |WifiStatusCode.SUCCESS|, |
| 128 | * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|, |
| 129 | * |WifiStatusCode.ERROR_INVALID_ARGS| |
| 130 | */ |
| 131 | setMultiStaUseCase(MultiStaUseCase useCase) generates (WifiStatus status); |
lesl | 94d2824 | 2020-11-18 22:17:37 +0800 | [diff] [blame] | 132 | |
lesl | 94d2824 | 2020-11-18 22:17:37 +0800 | [diff] [blame] | 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); |
Quang Luong | 94bcce5 | 2020-11-25 17:52:19 -0800 | [diff] [blame] | 170 | |
| 171 | /** |
| 172 | * Representation of a Wi-Fi channel for Wi-Fi coex channel avoidance. |
| 173 | */ |
| 174 | struct CoexUnsafeChannel { |
| 175 | /* The band of the channel */ |
| 176 | WifiBand band; |
| 177 | /* The channel number */ |
| 178 | uint32_t channel; |
| 179 | /** The power cap will be a maximum power value in dbm that is allowed to be transmitted by |
| 180 | the chip on this channel. A value of PowerCapConstant.NO_POWER_CAP means no limitation |
| 181 | on transmitted power is needed by the chip for this channel. |
| 182 | */ |
| 183 | int32_t powerCapDbm; |
| 184 | }; |
| 185 | |
| 186 | enum PowerCapConstant : int32_t { |
| 187 | NO_POWER_CAP = 0x7FFFFFFF, |
| 188 | }; |
| 189 | |
| 190 | /** |
| 191 | * Invoked to indicate that the provided |CoexUnsafeChannels| should be avoided with the |
| 192 | * specified restrictions. |
| 193 | * |
| 194 | * Channel avoidance is a suggestion and should be done on a best-effort approach. If a provided |
| 195 | * channel is used, then the specified power cap should be applied. |
| 196 | * |
| 197 | * In addition, hard restrictions on the Wifi modes may be indicated by |IfaceType| bits |
| 198 | * (STA, AP, P2P, NAN, etc) in the |restrictions| bitfield. If a hard restriction is provided, |
| 199 | * then the channels should be completely avoided for the provided Wifi modes instead of by |
| 200 | * best-effort. |
| 201 | * |
| 202 | * @param unsafeChannels List of |CoexUnsafeChannels| to avoid. |
| 203 | * @param restrictions Bitset of |IfaceType| values indicating Wifi modes to completely avoid. |
| 204 | * @return status WifiStatus of the operation. |
| 205 | * Possible status codes: |
| 206 | * |WifiStatusCode.SUCCESS|, |
| 207 | * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|, |
| 208 | * |WifiStatusCode.ERROR_INVALID_ARGS|, |
| 209 | */ |
| 210 | setCoexUnsafeChannels( |
| 211 | vec<CoexUnsafeChannel> unsafeChannels, bitfield<IfaceType> restrictions) |
| 212 | generates (WifiStatus status); |
Jimmy Chen | 1bdf1a7 | 2019-12-23 17:53:40 +0200 | [diff] [blame] | 213 | }; |