blob: 70de7c2ece5687a14180c657daa41c73bf639f57 [file] [log] [blame]
lesldf75bc12020-08-04 17:04:57 +08001/*
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
17package android.hardware.wifi.hostapd@1.3;
18
lesldf75bc12020-08-04 17:04:57 +080019import @1.2::HostapdStatus;
Jimmy Chena67701d2020-11-05 16:06:20 +080020import @1.2::IHostapd.BandMask;
21import @1.2::IHostapd.HwModeParams;
leslc9d109f2020-09-16 22:45:00 +080022import @1.2::IHostapd.IfaceParams;
23import @1.2::IHostapd.NetworkParams;
24import @1.2::IHostapd;
lesldf75bc12020-08-04 17:04:57 +080025import IHostapdCallback;
lesld91c5402020-08-10 13:23:29 +080026
lesldf75bc12020-08-04 17:04:57 +080027/**
28 * Top-level object for managing SoftAPs.
29 */
30interface IHostapd extends @1.2::IHostapd {
lesl65caf762020-10-30 16:45:25 +080031
Jimmy Chena67701d2020-11-05 16:06:20 +080032 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
lesl65caf762020-10-30 16:45:25 +080054 /**
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 Chena67701d2020-11-05 16:06:20 +080079 * If |enableEdmg| is true, the channel must be set. Refer to
80 * P802.11ay_D4.0 29.3.4.
81 *
lesl65caf762020-10-30 16:45:25 +080082 * 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 Chena67701d2020-11-05 16:06:20 +080086
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;
lesl65caf762020-10-30 16:45:25 +080093 };
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 Chena67701d2020-11-05 16:06:20 +0800105 * Additional Hw mode params for the interface
106 */
107 HwModeParams hwModeParams;
108
109 /**
lesl65caf762020-10-30 16:45:25 +0800110 * The list of the channel params for the dual interfaces.
111 */
112 vec<ChannelParams> channelParamsList;
113 };
114
lesldf75bc12020-08-04 17:04:57 +0800115 /**
leslc9d109f2020-09-16 22:45:00 +0800116 * 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 */
lesl65caf762020-10-30 16:45:25 +0800146 addAccessPoint_1_3(IfaceParams ifaceParams, NetworkParams nwParams)
leslc9d109f2020-09-16 22:45:00 +0800147 generates (HostapdStatus status);
148
149 /**
lesldf75bc12020-08-04 17:04:57 +0800150 * 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 */
lesld91c5402020-08-10 13:23:29 +0800164 registerCallback_1_3(IHostapdCallback callback) generates (HostapdStatus status);
lesldf75bc12020-08-04 17:04:57 +0800165};