1*4d7e907cSAndroid Build Coastguard Worker/* 2*4d7e907cSAndroid Build Coastguard Worker * Copyright 2022 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::ChipModeId; 20*4d7e907cSAndroid Build Coastguard Workerimport @1.0::IWifiIface; 21*4d7e907cSAndroid Build Coastguard Workerimport @1.0::WifiStatus; 22*4d7e907cSAndroid Build Coastguard Workerimport @1.5::WifiBand; 23*4d7e907cSAndroid Build Coastguard Workerimport @1.5::IWifiChip; 24*4d7e907cSAndroid Build Coastguard Workerimport @1.5::WifiIfaceMode; 25*4d7e907cSAndroid Build Coastguard Workerimport IWifiRttController; 26*4d7e907cSAndroid Build Coastguard Worker 27*4d7e907cSAndroid Build Coastguard Worker/** 28*4d7e907cSAndroid Build Coastguard Worker * Interface that represents a chip that must be configured as a single unit. 29*4d7e907cSAndroid Build Coastguard Worker */ 30*4d7e907cSAndroid Build Coastguard Workerinterface IWifiChip extends @1.5::IWifiChip { 31*4d7e907cSAndroid Build Coastguard Worker /** 32*4d7e907cSAndroid Build Coastguard Worker * Usable Wifi channels filter masks. 33*4d7e907cSAndroid Build Coastguard Worker */ 34*4d7e907cSAndroid Build Coastguard Worker enum UsableChannelFilter : @1.5::IWifiChip.UsableChannelFilter { 35*4d7e907cSAndroid Build Coastguard Worker /** 36*4d7e907cSAndroid Build Coastguard Worker * Filter Wifi channels that are supported for NAN3.1 Instant communication mode. This 37*4d7e907cSAndroid Build Coastguard Worker * filter should only be applied to NAN interface. 38*4d7e907cSAndroid Build Coastguard Worker * - If 5G is supported default discovery channel 149/44 is considered, 39*4d7e907cSAndroid Build Coastguard Worker * - If 5G is not supported then channel 6 has to be considered. 40*4d7e907cSAndroid Build Coastguard Worker */ 41*4d7e907cSAndroid Build Coastguard Worker NAN_INSTANT_MODE = 1 << 2, 42*4d7e907cSAndroid Build Coastguard Worker }; 43*4d7e907cSAndroid Build Coastguard Worker 44*4d7e907cSAndroid Build Coastguard Worker /** 45*4d7e907cSAndroid Build Coastguard Worker * Create a RTTController instance. 46*4d7e907cSAndroid Build Coastguard Worker * 47*4d7e907cSAndroid Build Coastguard Worker * RTT controller can be either: 48*4d7e907cSAndroid Build Coastguard Worker * a) Bound to a specific iface by passing in the corresponding |IWifiIface| 49*4d7e907cSAndroid Build Coastguard Worker * object in |iface| param, OR 50*4d7e907cSAndroid Build Coastguard Worker * b) Let the implementation decide the iface to use for RTT operations by 51*4d7e907cSAndroid Build Coastguard Worker * passing null in |iface| param. 52*4d7e907cSAndroid Build Coastguard Worker * 53*4d7e907cSAndroid Build Coastguard Worker * @param boundIface HIDL interface object representing the iface if 54*4d7e907cSAndroid Build Coastguard Worker * the responder must be bound to a specific iface, null otherwise. 55*4d7e907cSAndroid Build Coastguard Worker * @return status WifiStatus of the operation. 56*4d7e907cSAndroid Build Coastguard Worker * Possible status codes: 57*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.SUCCESS|, 58*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID| 59*4d7e907cSAndroid Build Coastguard Worker */ 60*4d7e907cSAndroid Build Coastguard Worker createRttController_1_6(IWifiIface boundIface) 61*4d7e907cSAndroid Build Coastguard Worker generates (WifiStatus status, IWifiRttController rtt); 62*4d7e907cSAndroid Build Coastguard Worker 63*4d7e907cSAndroid Build Coastguard Worker /** 64*4d7e907cSAndroid Build Coastguard Worker * Retrieve list of usable Wifi channels for the specified band & 65*4d7e907cSAndroid Build Coastguard Worker * operational modes. 66*4d7e907cSAndroid Build Coastguard Worker * 67*4d7e907cSAndroid Build Coastguard Worker * The list of usable Wifi channels in a given band depends on factors 68*4d7e907cSAndroid Build Coastguard Worker * like current country code, operational mode (e.g. STA, SAP, WFD-CLI, 69*4d7e907cSAndroid Build Coastguard Worker * WFD-GO, TDLS, NAN) and other restrictons due to DFS, cellular coexistence 70*4d7e907cSAndroid Build Coastguard Worker * and conncurency state of the device. 71*4d7e907cSAndroid Build Coastguard Worker * 72*4d7e907cSAndroid Build Coastguard Worker * @param band |WifiBand| for which list of usable channels is requested. 73*4d7e907cSAndroid Build Coastguard Worker * @param ifaceModeMask Bitmask of the modes represented by |WifiIfaceMode| 74*4d7e907cSAndroid Build Coastguard Worker * Bitmask respresents all the modes that the caller is interested 75*4d7e907cSAndroid Build Coastguard Worker * in (e.g. STA, SAP, CLI, GO, TDLS, NAN). E.g. If the caller is 76*4d7e907cSAndroid Build Coastguard Worker * interested in knowing usable channels for P2P CLI, P2P GO & NAN, 77*4d7e907cSAndroid Build Coastguard Worker * ifaceModeMask would be set to 78*4d7e907cSAndroid Build Coastguard Worker * IFACE_MODE_P2P_CLIENT|IFACE_MODE_P2P_GO|IFACE_MODE_NAN. 79*4d7e907cSAndroid Build Coastguard Worker * @param filterMask Bitmask of filters represented by 80*4d7e907cSAndroid Build Coastguard Worker * |UsableChannelFilter|. Specifies whether driver should filter 81*4d7e907cSAndroid Build Coastguard Worker * channels based on additional criteria. If no filter is specified 82*4d7e907cSAndroid Build Coastguard Worker * driver should return usable channels purely based on regulatory 83*4d7e907cSAndroid Build Coastguard Worker * constraints. 84*4d7e907cSAndroid Build Coastguard Worker * @return status WifiStatus of the operation. 85*4d7e907cSAndroid Build Coastguard Worker * Possible status codes: 86*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.SUCCESS|, 87*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.ERROR_NOT_SUPPORTED|, 88*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.ERROR_INVALID_ARGS|, 89*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.FAILURE_UNKNOWN| 90*4d7e907cSAndroid Build Coastguard Worker * @return channels List of channels represented by |WifiUsableChannel| 91*4d7e907cSAndroid Build Coastguard Worker * Each entry represents a channel frequency, bandwidth and 92*4d7e907cSAndroid Build Coastguard Worker * bitmask of modes (e.g. STA, SAP, CLI, GO, TDLS, NAN) that are 93*4d7e907cSAndroid Build Coastguard Worker * allowed on that channel. E.g. If only STA mode can be supported 94*4d7e907cSAndroid Build Coastguard Worker * on an indoor channel, only the IFACE_MODE_STA bit would be set 95*4d7e907cSAndroid Build Coastguard Worker * for that channel. If 5GHz SAP cannot be supported, then none of 96*4d7e907cSAndroid Build Coastguard Worker * the 5GHz channels will have IFACE_MODE_SOFTAP bit set. 97*4d7e907cSAndroid Build Coastguard Worker * Note: Bits do not represent concurrency state. Each bit only 98*4d7e907cSAndroid Build Coastguard Worker * represents whether particular mode is allowed on that channel. 99*4d7e907cSAndroid Build Coastguard Worker */ 100*4d7e907cSAndroid Build Coastguard Worker getUsableChannels_1_6(WifiBand band, bitfield<WifiIfaceMode> ifaceModeMask, 101*4d7e907cSAndroid Build Coastguard Worker bitfield<UsableChannelFilter> filterMask) 102*4d7e907cSAndroid Build Coastguard Worker generates (WifiStatus status, vec<WifiUsableChannel> channels); 103*4d7e907cSAndroid Build Coastguard Worker 104*4d7e907cSAndroid Build Coastguard Worker /** 105*4d7e907cSAndroid Build Coastguard Worker * Set of interface concurrency types with the maximum number of interfaces that can have 106*4d7e907cSAndroid Build Coastguard Worker * one of the specified concurrency types for a given ChipConcurrencyCombination. See 107*4d7e907cSAndroid Build Coastguard Worker * ChipConcurrencyCombination for examples. 108*4d7e907cSAndroid Build Coastguard Worker */ 109*4d7e907cSAndroid Build Coastguard Worker struct ChipConcurrencyCombinationLimit { 110*4d7e907cSAndroid Build Coastguard Worker // Each IfaceConcurrencyType must occur at most once. 111*4d7e907cSAndroid Build Coastguard Worker vec<IfaceConcurrencyType> types; 112*4d7e907cSAndroid Build Coastguard Worker uint32_t maxIfaces; 113*4d7e907cSAndroid Build Coastguard Worker }; 114*4d7e907cSAndroid Build Coastguard Worker 115*4d7e907cSAndroid Build Coastguard Worker /** 116*4d7e907cSAndroid Build Coastguard Worker * Set of interfaces that can operate concurrently when in a given mode. See 117*4d7e907cSAndroid Build Coastguard Worker * ChipMode below. 118*4d7e907cSAndroid Build Coastguard Worker * 119*4d7e907cSAndroid Build Coastguard Worker * For example: 120*4d7e907cSAndroid Build Coastguard Worker * [{STA} <= 2] 121*4d7e907cSAndroid Build Coastguard Worker * At most two STA interfaces are supported 122*4d7e907cSAndroid Build Coastguard Worker * [], [STA], [STA+STA] 123*4d7e907cSAndroid Build Coastguard Worker * 124*4d7e907cSAndroid Build Coastguard Worker * [{STA} <= 1, {NAN} <= 1, {AP_BRIDGED} <= 1] 125*4d7e907cSAndroid Build Coastguard Worker * Any combination of STA, NAN, AP_BRIDGED 126*4d7e907cSAndroid Build Coastguard Worker * [], [STA], [NAN], [AP_BRIDGED], [STA+NAN], [STA+AP_BRIDGED], [NAN+AP_BRIDGED], 127*4d7e907cSAndroid Build Coastguard Worker * [STA+NAN+AP_BRIDGED] 128*4d7e907cSAndroid Build Coastguard Worker * 129*4d7e907cSAndroid Build Coastguard Worker * [{STA} <= 1, {NAN,P2P} <= 1] 130*4d7e907cSAndroid Build Coastguard Worker * Optionally a STA and either NAN or P2P 131*4d7e907cSAndroid Build Coastguard Worker * [], [STA], [STA+NAN], [STA+P2P], [NAN], [P2P] 132*4d7e907cSAndroid Build Coastguard Worker * Not included [NAN+P2P], [STA+NAN+P2P] 133*4d7e907cSAndroid Build Coastguard Worker * 134*4d7e907cSAndroid Build Coastguard Worker * [{STA} <= 1, {STA,NAN} <= 1] 135*4d7e907cSAndroid Build Coastguard Worker * Optionally a STA and either a second STA or a NAN 136*4d7e907cSAndroid Build Coastguard Worker * [], [STA], [STA+NAN], [STA+STA], [NAN] 137*4d7e907cSAndroid Build Coastguard Worker * Not included [STA+STA+NAN] 138*4d7e907cSAndroid Build Coastguard Worker */ 139*4d7e907cSAndroid Build Coastguard Worker struct ChipConcurrencyCombination { 140*4d7e907cSAndroid Build Coastguard Worker vec<ChipConcurrencyCombinationLimit> limits; 141*4d7e907cSAndroid Build Coastguard Worker }; 142*4d7e907cSAndroid Build Coastguard Worker 143*4d7e907cSAndroid Build Coastguard Worker /** 144*4d7e907cSAndroid Build Coastguard Worker * A mode that the chip can be put in. A mode defines a set of constraints on 145*4d7e907cSAndroid Build Coastguard Worker * the interfaces that can exist while in that mode. Modes define a unit of 146*4d7e907cSAndroid Build Coastguard Worker * configuration where all interfaces must be torn down to switch to a 147*4d7e907cSAndroid Build Coastguard Worker * different mode. Some HALs may only have a single mode, but an example where 148*4d7e907cSAndroid Build Coastguard Worker * multiple modes would be required is if a chip has different firmwares with 149*4d7e907cSAndroid Build Coastguard Worker * different capabilities. 150*4d7e907cSAndroid Build Coastguard Worker * 151*4d7e907cSAndroid Build Coastguard Worker * When in a mode, it must be possible to perform any combination of creating 152*4d7e907cSAndroid Build Coastguard Worker * and removing interfaces as long as at least one of the 153*4d7e907cSAndroid Build Coastguard Worker * ChipConcurrencyCombinations is satisfied. This means that if a chip has two 154*4d7e907cSAndroid Build Coastguard Worker * available combinations, [{STA} <= 1] and [{AP_BRIDGED} <= 1] then it is expected 155*4d7e907cSAndroid Build Coastguard Worker * that exactly one STA type or one AP_BRIDGED type can be created, but it 156*4d7e907cSAndroid Build Coastguard Worker * is not expected that both a STA and AP_BRIDGED type could be created. If it 157*4d7e907cSAndroid Build Coastguard Worker * was then there would be a single available combination 158*4d7e907cSAndroid Build Coastguard Worker * [{STA} <=1, {AP_BRIDGED} <= 1]. 159*4d7e907cSAndroid Build Coastguard Worker * 160*4d7e907cSAndroid Build Coastguard Worker * When switching between two available combinations it is expected that 161*4d7e907cSAndroid Build Coastguard Worker * interfaces only supported by the initial combination must be removed until 162*4d7e907cSAndroid Build Coastguard Worker * the target combination is also satisfied. At that point new interfaces 163*4d7e907cSAndroid Build Coastguard Worker * satisfying only the target combination can be added (meaning the initial 164*4d7e907cSAndroid Build Coastguard Worker * combination limits will no longer satisfied). The addition of these new 165*4d7e907cSAndroid Build Coastguard Worker * interfaces must not impact the existence of interfaces that satisfy both 166*4d7e907cSAndroid Build Coastguard Worker * combinations. 167*4d7e907cSAndroid Build Coastguard Worker * 168*4d7e907cSAndroid Build Coastguard Worker * For example, a chip with available combinations: 169*4d7e907cSAndroid Build Coastguard Worker * [{STA} <= 2, {NAN} <=1] and [{STA} <=1, {NAN} <= 1, {AP_BRIDGED} <= 1}] 170*4d7e907cSAndroid Build Coastguard Worker * If the chip currently has 3 interfaces STA, STA and NAN and wants to add an 171*4d7e907cSAndroid Build Coastguard Worker * AP_BRIDGED interface in place of one of the STAs then first one of the STA 172*4d7e907cSAndroid Build Coastguard Worker * interfaces must be removed and then the AP interface can be created after 173*4d7e907cSAndroid Build Coastguard Worker * the STA had been torn down. During this process the remaining STA and NAN 174*4d7e907cSAndroid Build Coastguard Worker * interfaces must not be removed/recreated. 175*4d7e907cSAndroid Build Coastguard Worker * 176*4d7e907cSAndroid Build Coastguard Worker * If a chip does not support this kind of reconfiguration in this mode then 177*4d7e907cSAndroid Build Coastguard Worker * the combinations must be separated into two separate modes. Before 178*4d7e907cSAndroid Build Coastguard Worker * switching modes all interfaces must be torn down, the mode switch must be 179*4d7e907cSAndroid Build Coastguard Worker * enacted and when it completes the new interfaces must be brought up. 180*4d7e907cSAndroid Build Coastguard Worker */ 181*4d7e907cSAndroid Build Coastguard Worker struct ChipMode { 182*4d7e907cSAndroid Build Coastguard Worker /** 183*4d7e907cSAndroid Build Coastguard Worker * Id that can be used to put the chip in this mode. 184*4d7e907cSAndroid Build Coastguard Worker */ 185*4d7e907cSAndroid Build Coastguard Worker ChipModeId id; 186*4d7e907cSAndroid Build Coastguard Worker 187*4d7e907cSAndroid Build Coastguard Worker /** 188*4d7e907cSAndroid Build Coastguard Worker * A list of the possible interface concurrency type combinations that the chip can have 189*4d7e907cSAndroid Build Coastguard Worker * while in this mode. 190*4d7e907cSAndroid Build Coastguard Worker */ 191*4d7e907cSAndroid Build Coastguard Worker vec<ChipConcurrencyCombination> availableCombinations; 192*4d7e907cSAndroid Build Coastguard Worker }; 193*4d7e907cSAndroid Build Coastguard Worker 194*4d7e907cSAndroid Build Coastguard Worker /** 195*4d7e907cSAndroid Build Coastguard Worker * Get the set of operation modes that the chip supports. 196*4d7e907cSAndroid Build Coastguard Worker * 197*4d7e907cSAndroid Build Coastguard Worker * @return status WifiStatus of the operation. 198*4d7e907cSAndroid Build Coastguard Worker * Possible status codes: 199*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.SUCCESS|, 200*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID| 201*4d7e907cSAndroid Build Coastguard Worker * @return modes List of modes supported by the device. 202*4d7e907cSAndroid Build Coastguard Worker */ 203*4d7e907cSAndroid Build Coastguard Worker getAvailableModes_1_6() generates (WifiStatus status, vec<ChipMode> modes); 204*4d7e907cSAndroid Build Coastguard Worker 205*4d7e907cSAndroid Build Coastguard Worker /** 206*4d7e907cSAndroid Build Coastguard Worker * Retrieve the list of all the possible radio combinations supported by this 207*4d7e907cSAndroid Build Coastguard Worker * chip. 208*4d7e907cSAndroid Build Coastguard Worker * 209*4d7e907cSAndroid Build Coastguard Worker * @return status WifiStatus of the operation. 210*4d7e907cSAndroid Build Coastguard Worker * Possible status codes: 211*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.SUCCESS|, 212*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|, 213*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.ERROR_NOT_SUPPORTED|, 214*4d7e907cSAndroid Build Coastguard Worker * |WifiStatusCode.FAILURE_UNKNOWN| 215*4d7e907cSAndroid Build Coastguard Worker * @return radioCombinationMatrix 216*4d7e907cSAndroid Build Coastguard Worker * A list of all the possible radio combinations represented by 217*4d7e907cSAndroid Build Coastguard Worker * |WifiRadioCombinationMatrix|. 218*4d7e907cSAndroid Build Coastguard Worker * For Example in case of a chip which has two radios, where one radio is 219*4d7e907cSAndroid Build Coastguard Worker * capable of 2.4GHz 2X2 only and another radio which is capable of either 220*4d7e907cSAndroid Build Coastguard Worker * 5GHz or 6GHz 2X2, number of possible radio combinations in this case 221*4d7e907cSAndroid Build Coastguard Worker * are 5 and possible combinations are 222*4d7e907cSAndroid Build Coastguard Worker * {{{2G 2X2}}, //Standalone 2G 223*4d7e907cSAndroid Build Coastguard Worker * {{5G 2X2}}, //Standalone 5G 224*4d7e907cSAndroid Build Coastguard Worker * {{6G 2X2}}, //Standalone 6G 225*4d7e907cSAndroid Build Coastguard Worker * {{2G 2X2}, {5G 2X2}}, //2G+5G DBS 226*4d7e907cSAndroid Build Coastguard Worker * {{2G 2X2}, {6G 2X2}}} //2G+6G DBS 227*4d7e907cSAndroid Build Coastguard Worker * Note: Since this chip doesn’t support 5G+6G simultaneous operation 228*4d7e907cSAndroid Build Coastguard Worker * as there is only one radio which can support both bands, So it can only 229*4d7e907cSAndroid Build Coastguard Worker * do MCC 5G+6G. This table should not get populated with possible MCC 230*4d7e907cSAndroid Build Coastguard Worker * configurations. This is only for simultaneous radio configurations 231*4d7e907cSAndroid Build Coastguard Worker * (such as standalone, multi band simultaneous or single band simultaneous). 232*4d7e907cSAndroid Build Coastguard Worker */ 233*4d7e907cSAndroid Build Coastguard Worker getSupportedRadioCombinationsMatrix() 234*4d7e907cSAndroid Build Coastguard Worker generates (WifiStatus status, WifiRadioCombinationMatrix radioCombinationMatrix); 235*4d7e907cSAndroid Build Coastguard Worker}; 236