Ahmed ElArabawy | d73b64c | 2022-01-13 09:20:15 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2022 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.6; |
| 18 | |
| 19 | import @1.0::IWifiIface; |
| 20 | import @1.0::WifiStatus; |
| 21 | import @1.5::WifiBand; |
| 22 | import @1.5::IWifiChip; |
| 23 | import @1.5::WifiIfaceMode; |
| 24 | import IWifiRttController; |
| 25 | |
| 26 | /** |
| 27 | * Interface that represents a chip that must be configured as a single unit. |
| 28 | */ |
| 29 | interface IWifiChip extends @1.5::IWifiChip { |
Ahmed ElArabawy | d73b64c | 2022-01-13 09:20:15 -0800 | [diff] [blame] | 30 | /** |
Nate Jiang | 6e13599 | 2022-01-24 12:14:23 -0800 | [diff] [blame] | 31 | * Usable Wifi channels filter masks. |
| 32 | */ |
| 33 | enum UsableChannelFilter : @1.5::IWifiChip.UsableChannelFilter { |
| 34 | /** |
| 35 | * Filter Wifi channels that are supported for NAN3.1 Instant communication mode. This |
| 36 | * filter should only be applied to NAN interface. |
| 37 | * - If 5G is supported default discovery channel 149/44 is considered, |
| 38 | * - If 5G is not supported then channel 6 has to be considered. |
| 39 | */ |
| 40 | NAN_INSTANT_MODE = 1 << 2, |
| 41 | }; |
| 42 | |
| 43 | /** |
Ahmed ElArabawy | d73b64c | 2022-01-13 09:20:15 -0800 | [diff] [blame] | 44 | * Create a RTTController instance. |
| 45 | * |
| 46 | * RTT controller can be either: |
| 47 | * a) Bound to a specific iface by passing in the corresponding |IWifiIface| |
| 48 | * object in |iface| param, OR |
| 49 | * b) Let the implementation decide the iface to use for RTT operations by |
| 50 | * passing null in |iface| param. |
| 51 | * |
| 52 | * @param boundIface HIDL interface object representing the iface if |
| 53 | * the responder must be bound to a specific iface, null otherwise. |
| 54 | * @return status WifiStatus of the operation. |
| 55 | * Possible status codes: |
| 56 | * |WifiStatusCode.SUCCESS|, |
| 57 | * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID| |
| 58 | */ |
| 59 | createRttController_1_6(IWifiIface boundIface) |
| 60 | generates (WifiStatus status, IWifiRttController rtt); |
| 61 | |
| 62 | /** |
| 63 | * Retrieve list of usable Wifi channels for the specified band & |
| 64 | * operational modes. |
| 65 | * |
| 66 | * The list of usable Wifi channels in a given band depends on factors |
| 67 | * like current country code, operational mode (e.g. STA, SAP, WFD-CLI, |
| 68 | * WFD-GO, TDLS, NAN) and other restrictons due to DFS, cellular coexistence |
| 69 | * and conncurency state of the device. |
| 70 | * |
| 71 | * @param band |WifiBand| for which list of usable channels is requested. |
| 72 | * @param ifaceModeMask Bitmask of the modes represented by |WifiIfaceMode| |
| 73 | * Bitmask respresents all the modes that the caller is interested |
| 74 | * in (e.g. STA, SAP, CLI, GO, TDLS, NAN). E.g. If the caller is |
| 75 | * interested in knowing usable channels for P2P CLI, P2P GO & NAN, |
| 76 | * ifaceModeMask would be set to |
| 77 | * IFACE_MODE_P2P_CLIENT|IFACE_MODE_P2P_GO|IFACE_MODE_NAN. |
| 78 | * @param filterMask Bitmask of filters represented by |
| 79 | * |UsableChannelFilter|. Specifies whether driver should filter |
| 80 | * channels based on additional criteria. If no filter is specified |
| 81 | * driver should return usable channels purely based on regulatory |
| 82 | * constraints. |
| 83 | * @return status WifiStatus of the operation. |
| 84 | * Possible status codes: |
| 85 | * |WifiStatusCode.SUCCESS|, |
| 86 | * |WifiStatusCode.ERROR_NOT_SUPPORTED|, |
| 87 | * |WifiStatusCode.ERROR_INVALID_ARGS|, |
| 88 | * |WifiStatusCode.FAILURE_UNKNOWN| |
| 89 | * @return channels List of channels represented by |WifiUsableChannel| |
| 90 | * Each entry represents a channel frequency, bandwidth and |
| 91 | * bitmask of modes (e.g. STA, SAP, CLI, GO, TDLS, NAN) that are |
| 92 | * allowed on that channel. E.g. If only STA mode can be supported |
| 93 | * on an indoor channel, only the IFACE_MODE_STA bit would be set |
| 94 | * for that channel. If 5GHz SAP cannot be supported, then none of |
| 95 | * the 5GHz channels will have IFACE_MODE_SOFTAP bit set. |
| 96 | * Note: Bits do not represent concurrency state. Each bit only |
| 97 | * represents whether particular mode is allowed on that channel. |
| 98 | */ |
| 99 | getUsableChannels_1_6(WifiBand band, bitfield<WifiIfaceMode> ifaceModeMask, |
Nate Jiang | 50c001d | 2022-01-12 16:06:01 -0800 | [diff] [blame] | 100 | bitfield<UsableChannelFilter> filterMask) |
Ahmed ElArabawy | d73b64c | 2022-01-13 09:20:15 -0800 | [diff] [blame] | 101 | generates (WifiStatus status, vec<WifiUsableChannel> channels); |
| 102 | }; |