1*4d7e907cSAndroid Build Coastguard Worker/* 2*4d7e907cSAndroid Build Coastguard Worker * Copyright 2020 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.5::IWifiApIface; 21*4d7e907cSAndroid Build Coastguard Workerimport @1.0::IWifiIface; 22*4d7e907cSAndroid Build Coastguard Workerimport @1.3::IWifiChip; 23*4d7e907cSAndroid Build Coastguard Workerimport @1.4::IWifiChip; 24*4d7e907cSAndroid Build Coastguard Worker 25*4d7e907cSAndroid Build Coastguard Worker/** 26*4d7e907cSAndroid Build Coastguard Worker * Interface that represents a chip that must be configured as a single unit. 27*4d7e907cSAndroid Build Coastguard Worker */ 28*4d7e907cSAndroid Build Coastguard Workerinterface IWifiChip extends @1.4::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.3::IWifiChip.ChipCapabilityMask { 33*4d7e907cSAndroid Build Coastguard Worker /** 34*4d7e907cSAndroid Build Coastguard Worker * chip can operate in the 60GHz band(WiGig chip) 35*4d7e907cSAndroid Build Coastguard Worker */ 36*4d7e907cSAndroid Build Coastguard Worker WIGIG = 1 << 14, 37*4d7e907cSAndroid Build Coastguard Worker }; 38*4d7e907cSAndroid Build Coastguard Worker 39*4d7e907cSAndroid Build Coastguard Worker /** 40*4d7e907cSAndroid Build Coastguard Worker * When there are 2 or more simultaneous STA connections, this use case hint indicates what 41*4d7e907cSAndroid Build Coastguard Worker * use-case is being enabled by the framework. This use case hint can be used by the firmware 42*4d7e907cSAndroid Build Coastguard Worker * to modify various firmware configurations like: 43*4d7e907cSAndroid Build Coastguard Worker * - Allowed BSSIDs the firmware can choose for the initial connection/roaming attempts. 44*4d7e907cSAndroid Build Coastguard Worker * - Duty cycle to choose for the 2 STA connections if the radio is in MCC mode. 45*4d7e907cSAndroid Build Coastguard Worker * - Whether roaming, APF and other offloads needs to be enabled or not. 46*4d7e907cSAndroid Build Coastguard Worker * Note: 47*4d7e907cSAndroid Build Coastguard Worker * - This will be invoked before an active wifi connection is established on the second 48*4d7e907cSAndroid Build Coastguard Worker * interface. 49*4d7e907cSAndroid Build Coastguard Worker * - This use-case hint is implicitly void when the second STA interface is brought down. 50*4d7e907cSAndroid Build Coastguard Worker * - When there is only 1 STA interface, the must should still retain the last use case 51*4d7e907cSAndroid Build Coastguard Worker * set, which must become active the next time multi STA is enabled. 52*4d7e907cSAndroid Build Coastguard Worker * 1. Initialize with single STA. 53*4d7e907cSAndroid Build Coastguard Worker * 2. Framework creates second STA. 54*4d7e907cSAndroid Build Coastguard Worker * 3. Framework sets use case to DUAL_STA_NON_TRANSIENT_UNBIASED. 55*4d7e907cSAndroid Build Coastguard Worker * 4. Framework destroys second STA. Only 1 STA remains. 56*4d7e907cSAndroid Build Coastguard Worker * 5. Framework recreates second STA. 57*4d7e907cSAndroid Build Coastguard Worker * 6. The active use case remains DUAL_STA_NON_TRANSIENT_UNBIASED (i.e. firmware should not 58*4d7e907cSAndroid Build Coastguard Worker * automatically change it during period of single STA unless requested by framework). 59*4d7e907cSAndroid Build Coastguard Worker */ 60*4d7e907cSAndroid Build Coastguard Worker enum MultiStaUseCase : uint8_t { 61*4d7e907cSAndroid Build Coastguard Worker /** 62*4d7e907cSAndroid Build Coastguard Worker * Usage: 63*4d7e907cSAndroid Build Coastguard Worker * - This will be sent down for make before break use-case. 64*4d7e907cSAndroid Build Coastguard Worker * - Platform is trying to speculatively connect to a second network and evaluate it without 65*4d7e907cSAndroid Build Coastguard Worker * disrupting the primary connection. 66*4d7e907cSAndroid Build Coastguard Worker * Requirements for Firmware: 67*4d7e907cSAndroid Build Coastguard Worker * - Do not reduce the number of tx/rx chains of primary connection. 68*4d7e907cSAndroid Build Coastguard Worker * - If using MCC, should set the MCC duty cycle of the primary connection to be higher than 69*4d7e907cSAndroid Build Coastguard Worker * the secondary connection (maybe 70/30 split). 70*4d7e907cSAndroid Build Coastguard Worker * - Should pick the best BSSID for the secondary STA (disregard the chip mode) independent 71*4d7e907cSAndroid Build Coastguard Worker * of the primary STA: 72*4d7e907cSAndroid Build Coastguard Worker * - Don’t optimize for DBS vs MCC/SCC 73*4d7e907cSAndroid Build Coastguard Worker * - Should not impact the primary connection’s bssid selection: 74*4d7e907cSAndroid Build Coastguard Worker * - Don’t downgrade chains of the existing primary connection. 75*4d7e907cSAndroid Build Coastguard Worker * - Don’t optimize for DBS vs MCC/SCC. 76*4d7e907cSAndroid Build Coastguard Worker */ 77*4d7e907cSAndroid Build Coastguard Worker DUAL_STA_TRANSIENT_PREFER_PRIMARY = 0, 78*4d7e907cSAndroid Build Coastguard Worker /** 79*4d7e907cSAndroid Build Coastguard Worker * Usage: 80*4d7e907cSAndroid Build Coastguard Worker * - This will be sent down for any app requested peer to peer connections. 81*4d7e907cSAndroid Build Coastguard Worker * - In this case, both the connections needs to be allocated equal resources. 82*4d7e907cSAndroid Build Coastguard Worker * - For the peer to peer use case, BSSID for the secondary connection will be chosen by the 83*4d7e907cSAndroid Build Coastguard Worker * framework. 84*4d7e907cSAndroid Build Coastguard Worker * 85*4d7e907cSAndroid Build Coastguard Worker * Requirements for Firmware: 86*4d7e907cSAndroid Build Coastguard Worker * - Can choose MCC or DBS mode depending on the MCC efficiency and HW capability. 87*4d7e907cSAndroid Build Coastguard Worker * - If using MCC, set the MCC duty cycle of the primary connection to be equal to the 88*4d7e907cSAndroid Build Coastguard Worker * secondary connection. 89*4d7e907cSAndroid Build Coastguard Worker * - Prefer BSSID candidates which will help provide the best "overall" performance for both 90*4d7e907cSAndroid Build Coastguard Worker * the connections. 91*4d7e907cSAndroid Build Coastguard Worker */ 92*4d7e907cSAndroid Build Coastguard Worker DUAL_STA_NON_TRANSIENT_UNBIASED = 1, 93*4d7e907cSAndroid Build Coastguard Worker }; 94*4d7e907cSAndroid Build Coastguard Worker 95*4d7e907cSAndroid Build Coastguard Worker /** 96*4d7e907cSAndroid Build Coastguard Worker * Get the capabilities supported by this chip. 97*4d7e907cSAndroid Build Coastguard Worker * 98*4d7e907cSAndroid Build Coastguard Worker * @return status WifiStatus of the operation. 99*4d7e907cSAndroid Build Coastguard Worker * Possible status codes: 100*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.SUCCESS|, 101*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|, 102*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.ERROR_NOT_AVAILABLE|, 103*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.ERROR_UNKNOWN| 104*4d7e907cSAndroid Build Coastguard Worker * @return capabilities Bitset of |ChipCapabilityMask| values. 105*4d7e907cSAndroid Build Coastguard Worker */ 106*4d7e907cSAndroid Build Coastguard Worker getCapabilities_1_5() 107*4d7e907cSAndroid Build Coastguard Worker generates (WifiStatus status, bitfield<ChipCapabilityMask> capabilities); 108*4d7e907cSAndroid Build Coastguard Worker 109*4d7e907cSAndroid Build Coastguard Worker /** 110*4d7e907cSAndroid Build Coastguard Worker * Invoked to indicate that the provided iface is the primary STA iface when there are more 111*4d7e907cSAndroid Build Coastguard Worker * than 1 STA iface concurrently active. 112*4d7e907cSAndroid Build Coastguard Worker * Notes: 113*4d7e907cSAndroid Build Coastguard Worker * - If the wifi firmware/chip cannot support multiple instances of any offload 114*4d7e907cSAndroid Build Coastguard Worker * (like roaming, APF, rssi threshold, etc), the firmware should ensure that these 115*4d7e907cSAndroid Build Coastguard Worker * offloads are at least enabled for the primary interface. If the new primary interface is 116*4d7e907cSAndroid Build Coastguard Worker * already connected to a network, the firmware must switch all the offloads on 117*4d7e907cSAndroid Build Coastguard Worker * this new interface without disconnecting. 118*4d7e907cSAndroid Build Coastguard Worker * - When there is only 1 STA interface, the firmware must still retain the last primary 119*4d7e907cSAndroid Build Coastguard Worker * connection, which must become active the next time multi STA is enabled. 120*4d7e907cSAndroid Build Coastguard Worker * 121*4d7e907cSAndroid Build Coastguard Worker * @param ifname Name of the STA iface. 122*4d7e907cSAndroid Build Coastguard Worker * @return status WifiStatus of the operation. 123*4d7e907cSAndroid Build Coastguard Worker * Possible status codes: 124*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.SUCCESS|, 125*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|, 126*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.ERROR_INVALID_ARGS| 127*4d7e907cSAndroid Build Coastguard Worker */ 128*4d7e907cSAndroid Build Coastguard Worker setMultiStaPrimaryConnection(string ifName) generates (WifiStatus status); 129*4d7e907cSAndroid Build Coastguard Worker 130*4d7e907cSAndroid Build Coastguard Worker /** 131*4d7e907cSAndroid Build Coastguard Worker * Invoked to indicate the STA + STA use-case that is active. 132*4d7e907cSAndroid Build Coastguard Worker * 133*4d7e907cSAndroid Build Coastguard Worker * Refer to documentation of |MultiStaUseCase| for details. 134*4d7e907cSAndroid Build Coastguard Worker * 135*4d7e907cSAndroid Build Coastguard Worker * @param useCase Use case that is active. 136*4d7e907cSAndroid Build Coastguard Worker * @return status WifiStatus of the operation. 137*4d7e907cSAndroid Build Coastguard Worker * Possible status codes: 138*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.SUCCESS|, 139*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|, 140*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.ERROR_INVALID_ARGS| 141*4d7e907cSAndroid Build Coastguard Worker */ 142*4d7e907cSAndroid Build Coastguard Worker setMultiStaUseCase(MultiStaUseCase useCase) generates (WifiStatus status); 143*4d7e907cSAndroid Build Coastguard Worker 144*4d7e907cSAndroid Build Coastguard Worker /** 145*4d7e907cSAndroid Build Coastguard Worker * Create bridged IWifiApIface. 146*4d7e907cSAndroid Build Coastguard Worker * 147*4d7e907cSAndroid Build Coastguard Worker * Depending on the mode the chip is configured in, the interface creation 148*4d7e907cSAndroid Build Coastguard Worker * may fail (code: |ERROR_NOT_AVAILABLE|) if we've already reached the maximum 149*4d7e907cSAndroid Build Coastguard Worker * allowed (specified in |ChipIfaceCombination|) number of ifaces of the AP 150*4d7e907cSAndroid Build Coastguard Worker * type. 151*4d7e907cSAndroid Build Coastguard Worker * 152*4d7e907cSAndroid Build Coastguard Worker * @return status WifiStatus of the operation. 153*4d7e907cSAndroid Build Coastguard Worker * Possible status codes: 154*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.SUCCESS|, 155*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|, 156*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.ERROR_NOT_SUPPORTED|, 157*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.ERROR_NOT_AVAILABLE| 158*4d7e907cSAndroid Build Coastguard Worker * @return iface HIDL interface object representing the iface if 159*4d7e907cSAndroid Build Coastguard Worker * successful, null otherwise. 160*4d7e907cSAndroid Build Coastguard Worker */ 161*4d7e907cSAndroid Build Coastguard Worker createBridgedApIface() generates (WifiStatus status, IWifiApIface iface); 162*4d7e907cSAndroid Build Coastguard Worker 163*4d7e907cSAndroid Build Coastguard Worker /** 164*4d7e907cSAndroid Build Coastguard Worker * Removes one of the instance on the AP Iface with the provided ifaceName and 165*4d7e907cSAndroid Build Coastguard Worker * ifaceInstanceName. 166*4d7e907cSAndroid Build Coastguard Worker * 167*4d7e907cSAndroid Build Coastguard Worker * Use the API: removeApIface with brIfaceName in the V1_0::WifiChip.hal to remove bridge Iface. 168*4d7e907cSAndroid Build Coastguard Worker * 169*4d7e907cSAndroid Build Coastguard Worker * @param brIfaceName Name of the bridged AP iface. 170*4d7e907cSAndroid Build Coastguard Worker * @param ifaceInstanceName Name of the instance. The empty instance is 171*4d7e907cSAndroid Build Coastguard Worker * invalid. 172*4d7e907cSAndroid Build Coastguard Worker * @return status WifiStatus of the operation. 173*4d7e907cSAndroid Build Coastguard Worker * Possible status codes: 174*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.SUCCESS|, 175*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|, 176*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.ERROR_INVALID_ARGS|, 177*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.ERROR_NOT_AVAILABLE| 178*4d7e907cSAndroid Build Coastguard Worker */ 179*4d7e907cSAndroid Build Coastguard Worker removeIfaceInstanceFromBridgedApIface(string brIfaceName, string ifaceInstanceName) 180*4d7e907cSAndroid Build Coastguard Worker generates (WifiStatus status); 181*4d7e907cSAndroid Build Coastguard Worker 182*4d7e907cSAndroid Build Coastguard Worker /** 183*4d7e907cSAndroid Build Coastguard Worker * Representation of a Wi-Fi channel for Wi-Fi coex channel avoidance. 184*4d7e907cSAndroid Build Coastguard Worker */ 185*4d7e907cSAndroid Build Coastguard Worker struct CoexUnsafeChannel { 186*4d7e907cSAndroid Build Coastguard Worker /* The band of the channel */ 187*4d7e907cSAndroid Build Coastguard Worker WifiBand band; 188*4d7e907cSAndroid Build Coastguard Worker /* The channel number */ 189*4d7e907cSAndroid Build Coastguard Worker uint32_t channel; 190*4d7e907cSAndroid Build Coastguard Worker /** The power cap will be a maximum power value in dbm that is allowed to be transmitted by 191*4d7e907cSAndroid Build Coastguard Worker the chip on this channel. A value of PowerCapConstant.NO_POWER_CAP means no limitation 192*4d7e907cSAndroid Build Coastguard Worker on transmitted power is needed by the chip for this channel. 193*4d7e907cSAndroid Build Coastguard Worker */ 194*4d7e907cSAndroid Build Coastguard Worker int32_t powerCapDbm; 195*4d7e907cSAndroid Build Coastguard Worker }; 196*4d7e907cSAndroid Build Coastguard Worker 197*4d7e907cSAndroid Build Coastguard Worker enum PowerCapConstant : int32_t { 198*4d7e907cSAndroid Build Coastguard Worker NO_POWER_CAP = 0x7FFFFFFF, 199*4d7e907cSAndroid Build Coastguard Worker }; 200*4d7e907cSAndroid Build Coastguard Worker 201*4d7e907cSAndroid Build Coastguard Worker enum CoexRestriction : uint32_t { 202*4d7e907cSAndroid Build Coastguard Worker WIFI_DIRECT = 1 << 0, 203*4d7e907cSAndroid Build Coastguard Worker SOFTAP = 1 << 1, 204*4d7e907cSAndroid Build Coastguard Worker WIFI_AWARE = 1 << 2 205*4d7e907cSAndroid Build Coastguard Worker }; 206*4d7e907cSAndroid Build Coastguard Worker 207*4d7e907cSAndroid Build Coastguard Worker /** 208*4d7e907cSAndroid Build Coastguard Worker * Invoked to indicate that the provided |CoexUnsafeChannels| should be avoided with the 209*4d7e907cSAndroid Build Coastguard Worker * specified restrictions. 210*4d7e907cSAndroid Build Coastguard Worker * 211*4d7e907cSAndroid Build Coastguard Worker * Channel avoidance is a suggestion and should be done on a best-effort approach. If a provided 212*4d7e907cSAndroid Build Coastguard Worker * channel is used, then the specified power cap should be applied. 213*4d7e907cSAndroid Build Coastguard Worker * 214*4d7e907cSAndroid Build Coastguard Worker * In addition, hard restrictions on the Wifi modes may be indicated by |CoexRestriction| bits 215*4d7e907cSAndroid Build Coastguard Worker * (WIFI_DIRECT, SOFTAP, WIFI_AWARE) in the |restrictions| bitfield. If a hard restriction is 216*4d7e907cSAndroid Build Coastguard Worker * provided, then the channels should be completely avoided for the provided Wifi modes instead 217*4d7e907cSAndroid Build Coastguard Worker * of by best-effort. 218*4d7e907cSAndroid Build Coastguard Worker * 219*4d7e907cSAndroid Build Coastguard Worker * @param unsafeChannels List of |CoexUnsafeChannels| to avoid. 220*4d7e907cSAndroid Build Coastguard Worker * @param restrictions Bitset of |CoexRestriction| values indicating Wifi interfaces to 221*4d7e907cSAndroid Build Coastguard Worker * completely avoid. 222*4d7e907cSAndroid Build Coastguard Worker * @return status WifiStatus of the operation. 223*4d7e907cSAndroid Build Coastguard Worker * Possible status codes: 224*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.SUCCESS|, 225*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|, 226*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.ERROR_INVALID_ARGS|, 227*4d7e907cSAndroid Build Coastguard Worker */ 228*4d7e907cSAndroid Build Coastguard Worker setCoexUnsafeChannels( 229*4d7e907cSAndroid Build Coastguard Worker vec<CoexUnsafeChannel> unsafeChannels, bitfield<CoexRestriction> restrictions) 230*4d7e907cSAndroid Build Coastguard Worker generates (WifiStatus status); 231*4d7e907cSAndroid Build Coastguard Worker 232*4d7e907cSAndroid Build Coastguard Worker /** 233*4d7e907cSAndroid Build Coastguard Worker * Set country code for this Wifi chip. 234*4d7e907cSAndroid Build Coastguard Worker * 235*4d7e907cSAndroid Build Coastguard Worker * Country code is global setting across the Wifi chip and not Wifi 236*4d7e907cSAndroid Build Coastguard Worker * interface (STA or AP) specific. Legacy HAL API's for country code in 237*4d7e907cSAndroid Build Coastguard Worker * @1.0::ISupplicantStaIface::setCountryCode & 238*4d7e907cSAndroid Build Coastguard Worker * @1.0::IWifiApIface:setCountryCode are deprecated in favor of this 239*4d7e907cSAndroid Build Coastguard Worker * chip level API. 240*4d7e907cSAndroid Build Coastguard Worker * 241*4d7e907cSAndroid Build Coastguard Worker * @param code 2 byte country code (as defined in ISO 3166) to set. 242*4d7e907cSAndroid Build Coastguard Worker * @return status Status of the operation. 243*4d7e907cSAndroid Build Coastguard Worker * Possible status codes: 244*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.SUCCESS|, 245*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.FAILURE_UNKNOWN|, 246*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.FAILURE_IFACE_INVALID| 247*4d7e907cSAndroid Build Coastguard Worker */ 248*4d7e907cSAndroid Build Coastguard Worker setCountryCode(int8_t[2] code) generates (WifiStatus status); 249*4d7e907cSAndroid Build Coastguard Worker 250*4d7e907cSAndroid Build Coastguard Worker /** 251*4d7e907cSAndroid Build Coastguard Worker * Usable Wifi channels filter masks. 252*4d7e907cSAndroid Build Coastguard Worker */ 253*4d7e907cSAndroid Build Coastguard Worker enum UsableChannelFilter : uint32_t { 254*4d7e907cSAndroid Build Coastguard Worker /** 255*4d7e907cSAndroid Build Coastguard Worker * Filter Wifi channels that should be avoided due to extreme 256*4d7e907cSAndroid Build Coastguard Worker * cellular coexistence restrictions. Some Wifi channels can have 257*4d7e907cSAndroid Build Coastguard Worker * extreme interference from/to cellular due to short frequency 258*4d7e907cSAndroid Build Coastguard Worker * seperation with neighboring cellular channels or when there 259*4d7e907cSAndroid Build Coastguard Worker * is harmonic and intermodulation interference. Channels which 260*4d7e907cSAndroid Build Coastguard Worker * only have some performance degradation (e.g. power back off is 261*4d7e907cSAndroid Build Coastguard Worker * sufficient to deal with coexistence issue) can be included and 262*4d7e907cSAndroid Build Coastguard Worker * should not be filtered out. 263*4d7e907cSAndroid Build Coastguard Worker */ 264*4d7e907cSAndroid Build Coastguard Worker CELLULAR_COEXISTENCE = 1 << 0, 265*4d7e907cSAndroid Build Coastguard Worker /** 266*4d7e907cSAndroid Build Coastguard Worker * Filter based on concurrency state. 267*4d7e907cSAndroid Build Coastguard Worker * Examples: 268*4d7e907cSAndroid Build Coastguard Worker * - 5GHz SAP operation may be supported in standalone mode, but if 269*4d7e907cSAndroid Build Coastguard Worker * there is STA connection on 5GHz DFS channel, none of the 5GHz 270*4d7e907cSAndroid Build Coastguard Worker * channels are usable for SAP if device does not support DFS SAP mode. 271*4d7e907cSAndroid Build Coastguard Worker * - P2P GO may not be supported on indoor channels in EU during 272*4d7e907cSAndroid Build Coastguard Worker * standalone mode but if there is a STA connection on indoor channel, 273*4d7e907cSAndroid Build Coastguard Worker * P2P GO may be supported by some vendors on the same STA channel. 274*4d7e907cSAndroid Build Coastguard Worker */ 275*4d7e907cSAndroid Build Coastguard Worker CONCURRENCY = 1 << 1, 276*4d7e907cSAndroid Build Coastguard Worker }; 277*4d7e907cSAndroid Build Coastguard Worker 278*4d7e907cSAndroid Build Coastguard Worker /** 279*4d7e907cSAndroid Build Coastguard Worker * Retrieve list of usable Wifi channels for the specified band & 280*4d7e907cSAndroid Build Coastguard Worker * operational modes. 281*4d7e907cSAndroid Build Coastguard Worker * 282*4d7e907cSAndroid Build Coastguard Worker * The list of usable Wifi channels in a given band depends on factors 283*4d7e907cSAndroid Build Coastguard Worker * like current country code, operational mode (e.g. STA, SAP, WFD-CLI, 284*4d7e907cSAndroid Build Coastguard Worker * WFD-GO, TDLS, NAN) and other restrictons due to DFS, cellular coexistence 285*4d7e907cSAndroid Build Coastguard Worker * and conncurency state of the device. 286*4d7e907cSAndroid Build Coastguard Worker * 287*4d7e907cSAndroid Build Coastguard Worker * @param band |WifiBand| for which list of usable channels is requested. 288*4d7e907cSAndroid Build Coastguard Worker * @param ifaceModeMask Bitmask of the modes represented by |WifiIfaceMode| 289*4d7e907cSAndroid Build Coastguard Worker * Bitmask respresents all the modes that the caller is interested 290*4d7e907cSAndroid Build Coastguard Worker * in (e.g. STA, SAP, CLI, GO, TDLS, NAN). E.g. If the caller is 291*4d7e907cSAndroid Build Coastguard Worker * interested in knowing usable channels for P2P CLI, P2P GO & NAN, 292*4d7e907cSAndroid Build Coastguard Worker * ifaceModeMask would be set to 293*4d7e907cSAndroid Build Coastguard Worker * IFACE_MODE_P2P_CLIENT|IFACE_MODE_P2P_GO|IFACE_MODE_NAN. 294*4d7e907cSAndroid Build Coastguard Worker * @param filterMask Bitmask of filters represented by 295*4d7e907cSAndroid Build Coastguard Worker * |UsableChannelFilter|. Specifies whether driver should filter 296*4d7e907cSAndroid Build Coastguard Worker * channels based on additional criteria. If no filter is specified 297*4d7e907cSAndroid Build Coastguard Worker * driver should return usable channels purely based on regulatory 298*4d7e907cSAndroid Build Coastguard Worker * constraints. 299*4d7e907cSAndroid Build Coastguard Worker * @return status WifiStatus of the operation. 300*4d7e907cSAndroid Build Coastguard Worker * Possible status codes: 301*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.SUCCESS|, 302*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.ERROR_NOT_SUPPORTED|, 303*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.ERROR_INVALID_ARGS|, 304*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.FAILURE_UNKNOWN| 305*4d7e907cSAndroid Build Coastguard Worker * @return channels List of channels represented by |WifiUsableChannel| 306*4d7e907cSAndroid Build Coastguard Worker * Each entry represents a channel frequency, bandwidth and 307*4d7e907cSAndroid Build Coastguard Worker * bitmask of modes (e.g. STA, SAP, CLI, GO, TDLS, NAN) that are 308*4d7e907cSAndroid Build Coastguard Worker * allowed on that channel. E.g. If only STA mode can be supported 309*4d7e907cSAndroid Build Coastguard Worker * on an indoor channel, only the IFACE_MODE_STA bit would be set 310*4d7e907cSAndroid Build Coastguard Worker * for that channel. If 5GHz SAP cannot be supported, then none of 311*4d7e907cSAndroid Build Coastguard Worker * the 5GHz channels will have IFACE_MODE_SOFTAP bit set. 312*4d7e907cSAndroid Build Coastguard Worker * Note: Bits do not represent concurrency state. Each bit only 313*4d7e907cSAndroid Build Coastguard Worker * represents whether particular mode is allowed on that channel. 314*4d7e907cSAndroid Build Coastguard Worker */ 315*4d7e907cSAndroid Build Coastguard Worker getUsableChannels(WifiBand band, bitfield<WifiIfaceMode> ifaceModeMask, 316*4d7e907cSAndroid Build Coastguard Worker bitfield<UsableChannelFilter> filterMask) 317*4d7e907cSAndroid Build Coastguard Worker generates (WifiStatus status, vec<WifiUsableChannel> channels); 318*4d7e907cSAndroid Build Coastguard Worker 319*4d7e907cSAndroid Build Coastguard Worker /** 320*4d7e907cSAndroid Build Coastguard Worker * Trigger subsystem restart 321*4d7e907cSAndroid Build Coastguard Worker * 322*4d7e907cSAndroid Build Coastguard Worker * If the framework detects a problem (e.g. connection failure), 323*4d7e907cSAndroid Build Coastguard Worker * it must call this function to attempt recovery. 324*4d7e907cSAndroid Build Coastguard Worker * 325*4d7e907cSAndroid Build Coastguard Worker * When the wifi HAL receiveds triggerSubsystemRestart(), it must restart 326*4d7e907cSAndroid Build Coastguard Worker * the wlan subsystem, especially the wlan firmware. 327*4d7e907cSAndroid Build Coastguard Worker * 328*4d7e907cSAndroid Build Coastguard Worker * Regarding the callback function for subsystem restart, refer to documentation of 329*4d7e907cSAndroid Build Coastguard Worker * |IWifiEventCallback.onSubsystemRestart| for details. 330*4d7e907cSAndroid Build Coastguard Worker * 331*4d7e907cSAndroid Build Coastguard Worker * @return status WifiStatus of the operation. 332*4d7e907cSAndroid Build Coastguard Worker * Possible status codes: 333*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.SUCCESS|, 334*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|, 335*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.ERROR_NOT_AVAILABLE|, 336*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.ERROR_UNKNOWN| 337*4d7e907cSAndroid Build Coastguard Worker */ 338*4d7e907cSAndroid Build Coastguard Worker triggerSubsystemRestart() generates (WifiStatus status); 339*4d7e907cSAndroid Build Coastguard Worker}; 340