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; |
lesl | c9d109f | 2020-09-16 22:45:00 +0800 | [diff] [blame] | 20 | import @1.2::IHostapd.IfaceParams; |
| 21 | import @1.2::IHostapd.NetworkParams; |
| 22 | import @1.2::IHostapd; |
lesl | df75bc1 | 2020-08-04 17:04:57 +0800 | [diff] [blame] | 23 | import IHostapdCallback; |
lesl | d91c540 | 2020-08-10 13:23:29 +0800 | [diff] [blame] | 24 | |
lesl | df75bc1 | 2020-08-04 17:04:57 +0800 | [diff] [blame] | 25 | /** |
| 26 | * Top-level object for managing SoftAPs. |
| 27 | */ |
| 28 | interface IHostapd extends @1.2::IHostapd { |
lesl | 65caf76 | 2020-10-30 16:45:25 +0800 | [diff] [blame] | 29 | |
| 30 | /** |
| 31 | * Parameters to control the channel selection for the interface. |
| 32 | */ |
| 33 | struct ChannelParams { |
| 34 | /** |
| 35 | * Baseline information as defined in HAL 1.2. |
| 36 | * |
| 37 | * Includes bandMask and acsChannelFreqRangesMhz |
| 38 | */ |
| 39 | @1.2::IHostapd.ChannelParams V1_2; |
| 40 | |
| 41 | /** |
| 42 | * Whether to enable ACS (Automatic Channel Selection) or not. |
| 43 | * The channel can be selected automatically at run time by setting |
| 44 | * this flag, which must enable the ACS survey based algorithm. |
| 45 | * |
| 46 | * Note: It is used instead of V1_0::ChannelParams.enableAcs inside |
| 47 | * V1_3::IfaceParams.V1_2.V1_1.V1_0. |
| 48 | */ |
| 49 | bool enableAcs; |
| 50 | |
| 51 | /** |
| 52 | * Channel number (IEEE 802.11) to use for the interface. |
| 53 | * If ACS is enabled, this field is ignored. |
| 54 | * |
| 55 | * Note: It is used instead of V1_0::ChannelParams.channel inside |
| 56 | * V1_3::IfaceParams.V1_2.V1_1.V1_0. |
| 57 | */ |
| 58 | uint32_t channel; |
| 59 | }; |
| 60 | |
| 61 | /** |
| 62 | * Parameters to use for setting up the dual access point interfaces. |
| 63 | */ |
| 64 | struct IfaceParams { |
| 65 | /** |
| 66 | * Baseline information as defined in HAL 1.2. |
| 67 | */ |
| 68 | @1.2::IHostapd.IfaceParams V1_2; |
| 69 | |
| 70 | /** |
| 71 | * The list of the channel params for the dual interfaces. |
| 72 | */ |
| 73 | vec<ChannelParams> channelParamsList; |
| 74 | }; |
| 75 | |
lesl | df75bc1 | 2020-08-04 17:04:57 +0800 | [diff] [blame] | 76 | /** |
lesl | c9d109f | 2020-09-16 22:45:00 +0800 | [diff] [blame] | 77 | * Parameters to use for setting up the access point network. |
| 78 | */ |
| 79 | struct NetworkParams { |
| 80 | /** |
| 81 | * Baseline information as defined in HAL 1.2. |
| 82 | */ |
| 83 | @1.2::IHostapd.NetworkParams V1_2; |
| 84 | |
| 85 | /** |
| 86 | * Enable the interworking service and set access network type to |
| 87 | * CHARGEABLE_PUBLIC_NETWORK when set to true. |
| 88 | */ |
| 89 | bool isMetered; |
| 90 | }; |
| 91 | |
| 92 | /** |
| 93 | * Adds a new access point for hostapd to control. |
| 94 | * |
| 95 | * This should trigger the setup of an access point with the specified |
| 96 | * interface and network params. |
| 97 | * |
| 98 | * @param ifaceParams AccessPoint Params for the access point. |
| 99 | * @param nwParams Network Params for the access point. |
| 100 | * @return status Status of the operation. |
| 101 | * Possible status codes: |
| 102 | * |HostapdStatusCode.SUCCESS|, |
| 103 | * |HostapdStatusCode.FAILURE_ARGS_INVALID|, |
| 104 | * |HostapdStatusCode.FAILURE_UNKNOWN|, |
| 105 | * |HostapdStatusCode.FAILURE_IFACE_EXISTS| |
| 106 | */ |
lesl | 65caf76 | 2020-10-30 16:45:25 +0800 | [diff] [blame] | 107 | addAccessPoint_1_3(IfaceParams ifaceParams, NetworkParams nwParams) |
lesl | c9d109f | 2020-09-16 22:45:00 +0800 | [diff] [blame] | 108 | generates (HostapdStatus status); |
| 109 | |
| 110 | /** |
lesl | df75bc1 | 2020-08-04 17:04:57 +0800 | [diff] [blame] | 111 | * Register for callbacks from the hostapd service. |
| 112 | * |
| 113 | * These callbacks are invoked for global events that are not specific |
| 114 | * to any interface or network. Registration of multiple callback |
| 115 | * objects is supported. These objects must be deleted when the corresponding |
| 116 | * client process is dead. |
| 117 | * |
| 118 | * @param callback An instance of the |IHostapdCallback| HIDL interface |
| 119 | * object. |
| 120 | * @return status Status of the operation. |
| 121 | * Possible status codes: |
| 122 | * |HostapdStatusCode.SUCCESS|, |
| 123 | * |HostapdStatusCode.FAILURE_UNKNOWN| |
| 124 | */ |
lesl | d91c540 | 2020-08-10 13:23:29 +0800 | [diff] [blame] | 125 | registerCallback_1_3(IHostapdCallback callback) generates (HostapdStatus status); |
lesl | df75bc1 | 2020-08-04 17:04:57 +0800 | [diff] [blame] | 126 | }; |