lesl | df75bc1 | 2020-08-04 17:04:57 +0800 | [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.hostapd@1.3; |
| 18 | |
lesl | df75bc1 | 2020-08-04 17:04:57 +0800 | [diff] [blame] | 19 | import @1.2::HostapdStatus; |
Jimmy Chen | a67701d | 2020-11-05 16:06:20 +0800 | [diff] [blame] | 20 | import @1.2::IHostapd.BandMask; |
| 21 | import @1.2::IHostapd.HwModeParams; |
lesl | c9d109f | 2020-09-16 22:45:00 +0800 | [diff] [blame] | 22 | import @1.2::IHostapd.IfaceParams; |
| 23 | import @1.2::IHostapd.NetworkParams; |
| 24 | import @1.2::IHostapd; |
lesl | df75bc1 | 2020-08-04 17:04:57 +0800 | [diff] [blame] | 25 | import IHostapdCallback; |
lesl | d91c540 | 2020-08-10 13:23:29 +0800 | [diff] [blame] | 26 | |
lesl | df75bc1 | 2020-08-04 17:04:57 +0800 | [diff] [blame] | 27 | /** |
| 28 | * Top-level object for managing SoftAPs. |
| 29 | */ |
| 30 | interface IHostapd extends @1.2::IHostapd { |
lesl | 65caf76 | 2020-10-30 16:45:25 +0800 | [diff] [blame] | 31 | |
Jimmy Chen | a67701d | 2020-11-05 16:06:20 +0800 | [diff] [blame] | 32 | enum BandMask : @1.2::IHostapd.BandMask { |
| 33 | /** |
| 34 | * 60 GHz band. |
| 35 | */ |
| 36 | BAND_60_GHZ = 1 << 3, |
| 37 | }; |
| 38 | |
| 39 | /** |
| 40 | * Parameters to control the HW mode for the interface. |
| 41 | */ |
| 42 | struct HwModeParams { |
| 43 | /** |
| 44 | * Baseline information as defined in HAL 1.2. |
| 45 | */ |
| 46 | @1.2::IHostapd.HwModeParams V1_2; |
| 47 | |
| 48 | /** |
| 49 | * Enable EDMG (802.11ay), this option is only allowed for the 60GHz band. |
| 50 | */ |
| 51 | bool enableEdmg; |
| 52 | }; |
| 53 | |
lesl | 65caf76 | 2020-10-30 16:45:25 +0800 | [diff] [blame] | 54 | /** |
| 55 | * Parameters to control the channel selection for the interface. |
| 56 | */ |
| 57 | struct ChannelParams { |
| 58 | /** |
| 59 | * Baseline information as defined in HAL 1.2. |
| 60 | * |
| 61 | * Includes bandMask and acsChannelFreqRangesMhz |
| 62 | */ |
| 63 | @1.2::IHostapd.ChannelParams V1_2; |
| 64 | |
| 65 | /** |
| 66 | * Whether to enable ACS (Automatic Channel Selection) or not. |
| 67 | * The channel can be selected automatically at run time by setting |
| 68 | * this flag, which must enable the ACS survey based algorithm. |
| 69 | * |
| 70 | * Note: It is used instead of V1_0::ChannelParams.enableAcs inside |
| 71 | * V1_3::IfaceParams.V1_2.V1_1.V1_0. |
| 72 | */ |
| 73 | bool enableAcs; |
| 74 | |
| 75 | /** |
| 76 | * Channel number (IEEE 802.11) to use for the interface. |
| 77 | * If ACS is enabled, this field is ignored. |
| 78 | * |
Jimmy Chen | a67701d | 2020-11-05 16:06:20 +0800 | [diff] [blame] | 79 | * If |enableEdmg| is true, the channel must be set. Refer to |
| 80 | * P802.11ay_D4.0 29.3.4. |
| 81 | * |
lesl | 65caf76 | 2020-10-30 16:45:25 +0800 | [diff] [blame] | 82 | * Note: It is used instead of V1_0::ChannelParams.channel inside |
| 83 | * V1_3::IfaceParams.V1_2.V1_1.V1_0. |
| 84 | */ |
| 85 | uint32_t channel; |
Jimmy Chen | a67701d | 2020-11-05 16:06:20 +0800 | [diff] [blame] | 86 | |
| 87 | /** |
| 88 | * Band to use for the SoftAp operations. |
| 89 | * Note: It is used instead of V1_2::ChannelParams.bandMask inside |
| 90 | * V1_3::IfaceParams.V1_2.channelParams |
| 91 | */ |
| 92 | bitfield<BandMask> bandMask; |
lesl | 65caf76 | 2020-10-30 16:45:25 +0800 | [diff] [blame] | 93 | }; |
| 94 | |
| 95 | /** |
| 96 | * Parameters to use for setting up the dual access point interfaces. |
| 97 | */ |
| 98 | struct IfaceParams { |
| 99 | /** |
| 100 | * Baseline information as defined in HAL 1.2. |
| 101 | */ |
| 102 | @1.2::IHostapd.IfaceParams V1_2; |
| 103 | |
| 104 | /** |
Jimmy Chen | a67701d | 2020-11-05 16:06:20 +0800 | [diff] [blame] | 105 | * Additional Hw mode params for the interface |
| 106 | */ |
| 107 | HwModeParams hwModeParams; |
| 108 | |
| 109 | /** |
lesl | 65caf76 | 2020-10-30 16:45:25 +0800 | [diff] [blame] | 110 | * The list of the channel params for the dual interfaces. |
| 111 | */ |
| 112 | vec<ChannelParams> channelParamsList; |
| 113 | }; |
| 114 | |
lesl | df75bc1 | 2020-08-04 17:04:57 +0800 | [diff] [blame] | 115 | /** |
lesl | c9d109f | 2020-09-16 22:45:00 +0800 | [diff] [blame] | 116 | * Parameters to use for setting up the access point network. |
| 117 | */ |
| 118 | struct NetworkParams { |
| 119 | /** |
| 120 | * Baseline information as defined in HAL 1.2. |
| 121 | */ |
| 122 | @1.2::IHostapd.NetworkParams V1_2; |
| 123 | |
| 124 | /** |
| 125 | * Enable the interworking service and set access network type to |
| 126 | * CHARGEABLE_PUBLIC_NETWORK when set to true. |
| 127 | */ |
| 128 | bool isMetered; |
| 129 | }; |
| 130 | |
| 131 | /** |
| 132 | * Adds a new access point for hostapd to control. |
| 133 | * |
| 134 | * This should trigger the setup of an access point with the specified |
| 135 | * interface and network params. |
| 136 | * |
| 137 | * @param ifaceParams AccessPoint Params for the access point. |
| 138 | * @param nwParams Network Params for the access point. |
| 139 | * @return status Status of the operation. |
| 140 | * Possible status codes: |
| 141 | * |HostapdStatusCode.SUCCESS|, |
| 142 | * |HostapdStatusCode.FAILURE_ARGS_INVALID|, |
| 143 | * |HostapdStatusCode.FAILURE_UNKNOWN|, |
| 144 | * |HostapdStatusCode.FAILURE_IFACE_EXISTS| |
| 145 | */ |
lesl | 65caf76 | 2020-10-30 16:45:25 +0800 | [diff] [blame] | 146 | addAccessPoint_1_3(IfaceParams ifaceParams, NetworkParams nwParams) |
lesl | c9d109f | 2020-09-16 22:45:00 +0800 | [diff] [blame] | 147 | generates (HostapdStatus status); |
| 148 | |
| 149 | /** |
lesl | df75bc1 | 2020-08-04 17:04:57 +0800 | [diff] [blame] | 150 | * Register for callbacks from the hostapd service. |
| 151 | * |
| 152 | * These callbacks are invoked for global events that are not specific |
| 153 | * to any interface or network. Registration of multiple callback |
| 154 | * objects is supported. These objects must be deleted when the corresponding |
| 155 | * client process is dead. |
| 156 | * |
| 157 | * @param callback An instance of the |IHostapdCallback| HIDL interface |
| 158 | * object. |
| 159 | * @return status Status of the operation. |
| 160 | * Possible status codes: |
| 161 | * |HostapdStatusCode.SUCCESS|, |
| 162 | * |HostapdStatusCode.FAILURE_UNKNOWN| |
| 163 | */ |
lesl | d91c540 | 2020-08-10 13:23:29 +0800 | [diff] [blame] | 164 | registerCallback_1_3(IHostapdCallback callback) generates (HostapdStatus status); |
lesl | df75bc1 | 2020-08-04 17:04:57 +0800 | [diff] [blame] | 165 | }; |