Roshan Pius | 3c4e8a3 | 2016-10-03 14:53:58 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2016 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 | #ifndef WIFI_CHIP_H_ |
| 18 | #define WIFI_CHIP_H_ |
| 19 | |
xshu | 5899e8e | 2018-01-09 15:36:03 -0800 | [diff] [blame] | 20 | #include <list> |
Roshan Pius | 35d958c | 2016-10-06 16:47:38 -0700 | [diff] [blame] | 21 | #include <map> |
Veerendranath Jakkam | 25b3a6f | 2020-04-14 22:04:39 +0530 | [diff] [blame] | 22 | #include <mutex> |
Roshan Pius | 3c4e8a3 | 2016-10-03 14:53:58 -0700 | [diff] [blame] | 23 | |
Roshan Pius | 3c4e8a3 | 2016-10-03 14:53:58 -0700 | [diff] [blame] | 24 | #include <android-base/macros.h> |
Ahmed ElArabawy | eeb5338 | 2019-10-10 20:18:31 -0700 | [diff] [blame] | 25 | #include <android/hardware/wifi/1.4/IWifiChip.h> |
| 26 | #include <android/hardware/wifi/1.4/IWifiRttController.h> |
Roshan Pius | 3c4e8a3 | 2016-10-03 14:53:58 -0700 | [diff] [blame] | 27 | |
Roshan Pius | d37341f | 2017-01-31 13:13:28 -0800 | [diff] [blame] | 28 | #include "hidl_callback_util.h" |
xshu | 5899e8e | 2018-01-09 15:36:03 -0800 | [diff] [blame] | 29 | #include "ringbuffer.h" |
Roshan Pius | 35d958c | 2016-10-06 16:47:38 -0700 | [diff] [blame] | 30 | #include "wifi_ap_iface.h" |
Roshan Pius | 200a17d | 2017-11-01 13:03:35 -0700 | [diff] [blame] | 31 | #include "wifi_feature_flags.h" |
Roshan Pius | aabe575 | 2016-09-29 09:03:59 -0700 | [diff] [blame] | 32 | #include "wifi_legacy_hal.h" |
Roshan Pius | 52947fb | 2016-11-18 11:38:07 -0800 | [diff] [blame] | 33 | #include "wifi_mode_controller.h" |
Roshan Pius | 35d958c | 2016-10-06 16:47:38 -0700 | [diff] [blame] | 34 | #include "wifi_nan_iface.h" |
| 35 | #include "wifi_p2p_iface.h" |
Roshan Pius | 5926828 | 2016-10-06 20:23:47 -0700 | [diff] [blame] | 36 | #include "wifi_rtt_controller.h" |
Roshan Pius | 35d958c | 2016-10-06 16:47:38 -0700 | [diff] [blame] | 37 | #include "wifi_sta_iface.h" |
Roshan Pius | 3c4e8a3 | 2016-10-03 14:53:58 -0700 | [diff] [blame] | 38 | |
| 39 | namespace android { |
| 40 | namespace hardware { |
| 41 | namespace wifi { |
Ahmed ElArabawy | f501a98 | 2019-07-23 15:02:22 -0700 | [diff] [blame] | 42 | namespace V1_4 { |
Roshan Pius | 79a9975 | 2016-10-04 13:03:58 -0700 | [diff] [blame] | 43 | namespace implementation { |
Roshan Pius | dbd83ef | 2017-06-20 12:05:40 -0700 | [diff] [blame] | 44 | using namespace android::hardware::wifi::V1_0; |
Roshan Pius | 3c4e8a3 | 2016-10-03 14:53:58 -0700 | [diff] [blame] | 45 | |
Roshan Pius | aabe575 | 2016-09-29 09:03:59 -0700 | [diff] [blame] | 46 | /** |
| 47 | * HIDL interface object used to control a Wifi HAL chip instance. |
| 48 | * Since there is only a single chip instance used today, there is no |
| 49 | * identifying handle information stored here. |
| 50 | */ |
Ahmed ElArabawy | eeb5338 | 2019-10-10 20:18:31 -0700 | [diff] [blame] | 51 | class WifiChip : public V1_4::IWifiChip { |
Roshan Pius | abcf78f | 2017-10-06 16:30:38 -0700 | [diff] [blame] | 52 | public: |
Roshan Pius | 200a17d | 2017-11-01 13:03:35 -0700 | [diff] [blame] | 53 | WifiChip( |
| 54 | ChipId chip_id, |
| 55 | const std::weak_ptr<legacy_hal::WifiLegacyHal> legacy_hal, |
| 56 | const std::weak_ptr<mode_controller::WifiModeController> |
| 57 | mode_controller, |
Roshan Pius | 99dab38 | 2019-02-14 07:57:10 -0800 | [diff] [blame] | 58 | const std::weak_ptr<iface_util::WifiIfaceUtil> iface_util, |
Roshan Pius | 200a17d | 2017-11-01 13:03:35 -0700 | [diff] [blame] | 59 | const std::weak_ptr<feature_flags::WifiFeatureFlags> feature_flags); |
Roshan Pius | abcf78f | 2017-10-06 16:30:38 -0700 | [diff] [blame] | 60 | // HIDL does not provide a built-in mechanism to let the server invalidate |
| 61 | // a HIDL interface object after creation. If any client process holds onto |
| 62 | // a reference to the object in their context, any method calls on that |
| 63 | // reference will continue to be directed to the server. |
| 64 | // |
| 65 | // However Wifi HAL needs to control the lifetime of these objects. So, add |
| 66 | // a public |invalidate| method to |WifiChip| and it's child objects. This |
| 67 | // will be used to mark an object invalid when either: |
| 68 | // a) Wifi HAL is stopped, or |
| 69 | // b) Wifi Chip is reconfigured. |
| 70 | // |
| 71 | // All HIDL method implementations should check if the object is still |
| 72 | // marked valid before processing them. |
| 73 | void invalidate(); |
| 74 | bool isValid(); |
Ahmed ElArabawy | fd809fc | 2019-11-15 18:19:15 -0800 | [diff] [blame] | 75 | std::set<sp<IWifiChipEventCallback>> getEventCallbacks(); |
Roshan Pius | 3c4e8a3 | 2016-10-03 14:53:58 -0700 | [diff] [blame] | 76 | |
Roshan Pius | abcf78f | 2017-10-06 16:30:38 -0700 | [diff] [blame] | 77 | // HIDL methods exposed. |
| 78 | Return<void> getId(getId_cb hidl_status_cb) override; |
Jong Wook Kim | da830c9 | 2018-07-23 15:29:38 -0700 | [diff] [blame] | 79 | // Deprecated support for this callback |
Roshan Pius | abcf78f | 2017-10-06 16:30:38 -0700 | [diff] [blame] | 80 | Return<void> registerEventCallback( |
Roshan Pius | 1ce92cf | 2018-01-22 16:12:19 -0800 | [diff] [blame] | 81 | const sp<V1_0::IWifiChipEventCallback>& event_callback, |
Roshan Pius | abcf78f | 2017-10-06 16:30:38 -0700 | [diff] [blame] | 82 | registerEventCallback_cb hidl_status_cb) override; |
| 83 | Return<void> getCapabilities(getCapabilities_cb hidl_status_cb) override; |
| 84 | Return<void> getAvailableModes( |
| 85 | getAvailableModes_cb hidl_status_cb) override; |
| 86 | Return<void> configureChip(ChipModeId mode_id, |
| 87 | configureChip_cb hidl_status_cb) override; |
| 88 | Return<void> getMode(getMode_cb hidl_status_cb) override; |
| 89 | Return<void> requestChipDebugInfo( |
| 90 | requestChipDebugInfo_cb hidl_status_cb) override; |
| 91 | Return<void> requestDriverDebugDump( |
| 92 | requestDriverDebugDump_cb hidl_status_cb) override; |
| 93 | Return<void> requestFirmwareDebugDump( |
| 94 | requestFirmwareDebugDump_cb hidl_status_cb) override; |
| 95 | Return<void> createApIface(createApIface_cb hidl_status_cb) override; |
| 96 | Return<void> getApIfaceNames(getApIfaceNames_cb hidl_status_cb) override; |
| 97 | Return<void> getApIface(const hidl_string& ifname, |
| 98 | getApIface_cb hidl_status_cb) override; |
| 99 | Return<void> removeApIface(const hidl_string& ifname, |
| 100 | removeApIface_cb hidl_status_cb) override; |
| 101 | Return<void> createNanIface(createNanIface_cb hidl_status_cb) override; |
| 102 | Return<void> getNanIfaceNames(getNanIfaceNames_cb hidl_status_cb) override; |
| 103 | Return<void> getNanIface(const hidl_string& ifname, |
| 104 | getNanIface_cb hidl_status_cb) override; |
| 105 | Return<void> removeNanIface(const hidl_string& ifname, |
| 106 | removeNanIface_cb hidl_status_cb) override; |
| 107 | Return<void> createP2pIface(createP2pIface_cb hidl_status_cb) override; |
| 108 | Return<void> getP2pIfaceNames(getP2pIfaceNames_cb hidl_status_cb) override; |
| 109 | Return<void> getP2pIface(const hidl_string& ifname, |
| 110 | getP2pIface_cb hidl_status_cb) override; |
| 111 | Return<void> removeP2pIface(const hidl_string& ifname, |
| 112 | removeP2pIface_cb hidl_status_cb) override; |
| 113 | Return<void> createStaIface(createStaIface_cb hidl_status_cb) override; |
| 114 | Return<void> getStaIfaceNames(getStaIfaceNames_cb hidl_status_cb) override; |
| 115 | Return<void> getStaIface(const hidl_string& ifname, |
| 116 | getStaIface_cb hidl_status_cb) override; |
| 117 | Return<void> removeStaIface(const hidl_string& ifname, |
| 118 | removeStaIface_cb hidl_status_cb) override; |
| 119 | Return<void> createRttController( |
| 120 | const sp<IWifiIface>& bound_iface, |
| 121 | createRttController_cb hidl_status_cb) override; |
| 122 | Return<void> getDebugRingBuffersStatus( |
| 123 | getDebugRingBuffersStatus_cb hidl_status_cb) override; |
| 124 | Return<void> startLoggingToDebugRingBuffer( |
| 125 | const hidl_string& ring_name, |
| 126 | WifiDebugRingBufferVerboseLevel verbose_level, |
| 127 | uint32_t max_interval_in_sec, uint32_t min_data_size_in_bytes, |
| 128 | startLoggingToDebugRingBuffer_cb hidl_status_cb) override; |
| 129 | Return<void> forceDumpToDebugRingBuffer( |
| 130 | const hidl_string& ring_name, |
| 131 | forceDumpToDebugRingBuffer_cb hidl_status_cb) override; |
Roger Wang | b294c76 | 2018-11-02 15:34:39 +0800 | [diff] [blame] | 132 | Return<void> flushRingBufferToFile( |
| 133 | flushRingBufferToFile_cb hidl_status_cb) override; |
Roshan Pius | abcf78f | 2017-10-06 16:30:38 -0700 | [diff] [blame] | 134 | Return<void> stopLoggingToDebugRingBuffer( |
| 135 | stopLoggingToDebugRingBuffer_cb hidl_status_cb) override; |
| 136 | Return<void> getDebugHostWakeReasonStats( |
| 137 | getDebugHostWakeReasonStats_cb hidl_status_cb) override; |
| 138 | Return<void> enableDebugErrorAlerts( |
| 139 | bool enable, enableDebugErrorAlerts_cb hidl_status_cb) override; |
| 140 | Return<void> selectTxPowerScenario( |
Ahmed ElArabawy | 6a1accf | 2018-01-23 10:57:29 -0800 | [diff] [blame] | 141 | V1_1::IWifiChip::TxPowerScenario scenario, |
Roshan Pius | abcf78f | 2017-10-06 16:30:38 -0700 | [diff] [blame] | 142 | selectTxPowerScenario_cb hidl_status_cb) override; |
| 143 | Return<void> resetTxPowerScenario( |
| 144 | resetTxPowerScenario_cb hidl_status_cb) override; |
Ahmed ElArabawy | eaf8240 | 2018-10-26 09:46:04 -0700 | [diff] [blame] | 145 | Return<void> setLatencyMode(LatencyMode mode, |
| 146 | setLatencyMode_cb hidl_status_cb) override; |
Roshan Pius | 1ce92cf | 2018-01-22 16:12:19 -0800 | [diff] [blame] | 147 | Return<void> registerEventCallback_1_2( |
Jong Wook Kim | da830c9 | 2018-07-23 15:29:38 -0700 | [diff] [blame] | 148 | const sp<V1_2::IWifiChipEventCallback>& event_callback, |
Roshan Pius | 1ce92cf | 2018-01-22 16:12:19 -0800 | [diff] [blame] | 149 | registerEventCallback_1_2_cb hidl_status_cb) override; |
Ahmed ElArabawy | 6a1accf | 2018-01-23 10:57:29 -0800 | [diff] [blame] | 150 | Return<void> selectTxPowerScenario_1_2( |
| 151 | TxPowerScenario scenario, |
| 152 | selectTxPowerScenario_cb hidl_status_cb) override; |
Ahmed ElArabawy | eaf8240 | 2018-10-26 09:46:04 -0700 | [diff] [blame] | 153 | Return<void> getCapabilities_1_3( |
| 154 | getCapabilities_cb hidl_status_cb) override; |
Ahmed ElArabawy | 6a1accf | 2018-01-23 10:57:29 -0800 | [diff] [blame] | 155 | Return<void> debug(const hidl_handle& handle, |
| 156 | const hidl_vec<hidl_string>& options) override; |
Ahmed ElArabawy | eeb5338 | 2019-10-10 20:18:31 -0700 | [diff] [blame] | 157 | Return<void> createRttController_1_4( |
| 158 | const sp<IWifiIface>& bound_iface, |
| 159 | createRttController_1_4_cb hidl_status_cb) override; |
Ahmed ElArabawy | fd809fc | 2019-11-15 18:19:15 -0800 | [diff] [blame] | 160 | Return<void> registerEventCallback_1_4( |
| 161 | const sp<IWifiChipEventCallback>& event_callback, |
| 162 | registerEventCallback_1_4_cb hidl_status_cb) override; |
Jong Wook Kim | da830c9 | 2018-07-23 15:29:38 -0700 | [diff] [blame] | 163 | |
Roshan Pius | abcf78f | 2017-10-06 16:30:38 -0700 | [diff] [blame] | 164 | private: |
| 165 | void invalidateAndRemoveAllIfaces(); |
Roshan Pius | 8236850 | 2019-05-16 12:53:02 -0700 | [diff] [blame] | 166 | // When a STA iface is removed any dependent NAN-ifaces/RTT-controllers are |
| 167 | // invalidated & removed. |
| 168 | void invalidateAndRemoveDependencies(const std::string& removed_iface_name); |
Roshan Pius | 35d958c | 2016-10-06 16:47:38 -0700 | [diff] [blame] | 169 | |
Roshan Pius | abcf78f | 2017-10-06 16:30:38 -0700 | [diff] [blame] | 170 | // Corresponding worker functions for the HIDL methods. |
| 171 | std::pair<WifiStatus, ChipId> getIdInternal(); |
Jong Wook Kim | da830c9 | 2018-07-23 15:29:38 -0700 | [diff] [blame] | 172 | // Deprecated support for this callback |
Roshan Pius | abcf78f | 2017-10-06 16:30:38 -0700 | [diff] [blame] | 173 | WifiStatus registerEventCallbackInternal( |
Roshan Pius | 1ce92cf | 2018-01-22 16:12:19 -0800 | [diff] [blame] | 174 | const sp<V1_0::IWifiChipEventCallback>& event_callback); |
Roshan Pius | abcf78f | 2017-10-06 16:30:38 -0700 | [diff] [blame] | 175 | std::pair<WifiStatus, uint32_t> getCapabilitiesInternal(); |
| 176 | std::pair<WifiStatus, std::vector<ChipMode>> getAvailableModesInternal(); |
Roshan Pius | ba38d9c | 2017-12-08 07:32:08 -0800 | [diff] [blame] | 177 | WifiStatus configureChipInternal( |
| 178 | std::unique_lock<std::recursive_mutex>* lock, ChipModeId mode_id); |
Roshan Pius | abcf78f | 2017-10-06 16:30:38 -0700 | [diff] [blame] | 179 | std::pair<WifiStatus, uint32_t> getModeInternal(); |
| 180 | std::pair<WifiStatus, IWifiChip::ChipDebugInfo> |
| 181 | requestChipDebugInfoInternal(); |
| 182 | std::pair<WifiStatus, std::vector<uint8_t>> |
| 183 | requestDriverDebugDumpInternal(); |
| 184 | std::pair<WifiStatus, std::vector<uint8_t>> |
| 185 | requestFirmwareDebugDumpInternal(); |
| 186 | std::pair<WifiStatus, sp<IWifiApIface>> createApIfaceInternal(); |
| 187 | std::pair<WifiStatus, std::vector<hidl_string>> getApIfaceNamesInternal(); |
| 188 | std::pair<WifiStatus, sp<IWifiApIface>> getApIfaceInternal( |
| 189 | const std::string& ifname); |
| 190 | WifiStatus removeApIfaceInternal(const std::string& ifname); |
| 191 | std::pair<WifiStatus, sp<IWifiNanIface>> createNanIfaceInternal(); |
| 192 | std::pair<WifiStatus, std::vector<hidl_string>> getNanIfaceNamesInternal(); |
| 193 | std::pair<WifiStatus, sp<IWifiNanIface>> getNanIfaceInternal( |
| 194 | const std::string& ifname); |
| 195 | WifiStatus removeNanIfaceInternal(const std::string& ifname); |
| 196 | std::pair<WifiStatus, sp<IWifiP2pIface>> createP2pIfaceInternal(); |
| 197 | std::pair<WifiStatus, std::vector<hidl_string>> getP2pIfaceNamesInternal(); |
| 198 | std::pair<WifiStatus, sp<IWifiP2pIface>> getP2pIfaceInternal( |
| 199 | const std::string& ifname); |
| 200 | WifiStatus removeP2pIfaceInternal(const std::string& ifname); |
Ahmed ElArabawy | b23485d | 2019-12-09 15:24:16 -0800 | [diff] [blame] | 201 | std::pair<WifiStatus, sp<V1_3::IWifiStaIface>> createStaIfaceInternal(); |
Roshan Pius | abcf78f | 2017-10-06 16:30:38 -0700 | [diff] [blame] | 202 | std::pair<WifiStatus, std::vector<hidl_string>> getStaIfaceNamesInternal(); |
Ahmed ElArabawy | b23485d | 2019-12-09 15:24:16 -0800 | [diff] [blame] | 203 | std::pair<WifiStatus, sp<V1_3::IWifiStaIface>> getStaIfaceInternal( |
Roshan Pius | abcf78f | 2017-10-06 16:30:38 -0700 | [diff] [blame] | 204 | const std::string& ifname); |
| 205 | WifiStatus removeStaIfaceInternal(const std::string& ifname); |
Ahmed ElArabawy | eeb5338 | 2019-10-10 20:18:31 -0700 | [diff] [blame] | 206 | std::pair<WifiStatus, sp<V1_0::IWifiRttController>> |
| 207 | createRttControllerInternal(const sp<IWifiIface>& bound_iface); |
Roshan Pius | abcf78f | 2017-10-06 16:30:38 -0700 | [diff] [blame] | 208 | std::pair<WifiStatus, std::vector<WifiDebugRingBufferStatus>> |
| 209 | getDebugRingBuffersStatusInternal(); |
| 210 | WifiStatus startLoggingToDebugRingBufferInternal( |
| 211 | const hidl_string& ring_name, |
| 212 | WifiDebugRingBufferVerboseLevel verbose_level, |
| 213 | uint32_t max_interval_in_sec, uint32_t min_data_size_in_bytes); |
| 214 | WifiStatus forceDumpToDebugRingBufferInternal(const hidl_string& ring_name); |
Roger Wang | b294c76 | 2018-11-02 15:34:39 +0800 | [diff] [blame] | 215 | WifiStatus flushRingBufferToFileInternal(); |
Roshan Pius | abcf78f | 2017-10-06 16:30:38 -0700 | [diff] [blame] | 216 | WifiStatus stopLoggingToDebugRingBufferInternal(); |
| 217 | std::pair<WifiStatus, WifiDebugHostWakeReasonStats> |
| 218 | getDebugHostWakeReasonStatsInternal(); |
| 219 | WifiStatus enableDebugErrorAlertsInternal(bool enable); |
Jong Wook Kim | da830c9 | 2018-07-23 15:29:38 -0700 | [diff] [blame] | 220 | WifiStatus selectTxPowerScenarioInternal( |
| 221 | V1_1::IWifiChip::TxPowerScenario scenario); |
Roshan Pius | abcf78f | 2017-10-06 16:30:38 -0700 | [diff] [blame] | 222 | WifiStatus resetTxPowerScenarioInternal(); |
Ahmed ElArabawy | eaf8240 | 2018-10-26 09:46:04 -0700 | [diff] [blame] | 223 | WifiStatus setLatencyModeInternal(LatencyMode mode); |
Roshan Pius | 1ce92cf | 2018-01-22 16:12:19 -0800 | [diff] [blame] | 224 | WifiStatus registerEventCallbackInternal_1_2( |
Jong Wook Kim | da830c9 | 2018-07-23 15:29:38 -0700 | [diff] [blame] | 225 | const sp<V1_2::IWifiChipEventCallback>& event_callback); |
Ahmed ElArabawy | 6a1accf | 2018-01-23 10:57:29 -0800 | [diff] [blame] | 226 | WifiStatus selectTxPowerScenarioInternal_1_2(TxPowerScenario scenario); |
Ahmed ElArabawy | eaf8240 | 2018-10-26 09:46:04 -0700 | [diff] [blame] | 227 | std::pair<WifiStatus, uint32_t> getCapabilitiesInternal_1_3(); |
Ahmed ElArabawy | eeb5338 | 2019-10-10 20:18:31 -0700 | [diff] [blame] | 228 | std::pair<WifiStatus, sp<IWifiRttController>> |
| 229 | createRttControllerInternal_1_4(const sp<IWifiIface>& bound_iface); |
Ahmed ElArabawy | fd809fc | 2019-11-15 18:19:15 -0800 | [diff] [blame] | 230 | WifiStatus registerEventCallbackInternal_1_4( |
| 231 | const sp<IWifiChipEventCallback>& event_callback); |
| 232 | |
Roshan Pius | ba38d9c | 2017-12-08 07:32:08 -0800 | [diff] [blame] | 233 | WifiStatus handleChipConfiguration( |
| 234 | std::unique_lock<std::recursive_mutex>* lock, ChipModeId mode_id); |
Roshan Pius | abcf78f | 2017-10-06 16:30:38 -0700 | [diff] [blame] | 235 | WifiStatus registerDebugRingBufferCallback(); |
Roshan Pius | 85c6441 | 2018-01-22 17:58:40 -0800 | [diff] [blame] | 236 | WifiStatus registerRadioModeChangeCallback(); |
Roshan Pius | 2c06a3f | 2016-12-15 17:51:40 -0800 | [diff] [blame] | 237 | |
Roshan Pius | cc33820 | 2017-11-02 13:54:09 -0700 | [diff] [blame] | 238 | std::vector<IWifiChip::ChipIfaceCombination> |
| 239 | getCurrentModeIfaceCombinations(); |
| 240 | std::map<IfaceType, size_t> getCurrentIfaceCombination(); |
| 241 | std::vector<std::map<IfaceType, size_t>> expandIfaceCombinations( |
| 242 | const IWifiChip::ChipIfaceCombination& combination); |
Roshan Pius | a3e5b7f | 2019-03-25 13:52:45 -0700 | [diff] [blame] | 243 | bool canExpandedIfaceComboSupportIfaceOfTypeWithCurrentIfaces( |
| 244 | const std::map<IfaceType, size_t>& expanded_combo, |
| 245 | IfaceType requested_type); |
| 246 | bool canCurrentModeSupportIfaceOfTypeWithCurrentIfaces( |
| 247 | IfaceType requested_type); |
| 248 | bool canExpandedIfaceComboSupportIfaceCombo( |
| 249 | const std::map<IfaceType, size_t>& expanded_combo, |
| 250 | const std::map<IfaceType, size_t>& req_combo); |
| 251 | bool canCurrentModeSupportIfaceCombo( |
| 252 | const std::map<IfaceType, size_t>& req_combo); |
| 253 | bool canCurrentModeSupportIfaceOfType(IfaceType requested_type); |
Roshan Pius | cc33820 | 2017-11-02 13:54:09 -0700 | [diff] [blame] | 254 | bool isValidModeId(ChipModeId mode_id); |
Roshan Pius | a3e5b7f | 2019-03-25 13:52:45 -0700 | [diff] [blame] | 255 | bool isStaApConcurrencyAllowedInCurrentMode(); |
James Mattis | d2e4c07 | 2019-05-22 16:14:48 -0700 | [diff] [blame] | 256 | bool isDualApAllowedInCurrentMode(); |
Roshan Pius | 6036c02 | 2019-03-27 10:41:58 -0700 | [diff] [blame] | 257 | std::string getFirstActiveWlanIfaceName(); |
Roshan Pius | a3e5b7f | 2019-03-25 13:52:45 -0700 | [diff] [blame] | 258 | std::string allocateApOrStaIfaceName(uint32_t start_idx); |
| 259 | std::string allocateApIfaceName(); |
| 260 | std::string allocateStaIfaceName(); |
xshu | 5899e8e | 2018-01-09 15:36:03 -0800 | [diff] [blame] | 261 | bool writeRingbufferFilesInternal(); |
Roshan Pius | cc33820 | 2017-11-02 13:54:09 -0700 | [diff] [blame] | 262 | |
Roshan Pius | abcf78f | 2017-10-06 16:30:38 -0700 | [diff] [blame] | 263 | ChipId chip_id_; |
| 264 | std::weak_ptr<legacy_hal::WifiLegacyHal> legacy_hal_; |
| 265 | std::weak_ptr<mode_controller::WifiModeController> mode_controller_; |
Roshan Pius | 99dab38 | 2019-02-14 07:57:10 -0800 | [diff] [blame] | 266 | std::weak_ptr<iface_util::WifiIfaceUtil> iface_util_; |
Roshan Pius | 675609b | 2017-10-31 14:24:58 -0700 | [diff] [blame] | 267 | std::vector<sp<WifiApIface>> ap_ifaces_; |
| 268 | std::vector<sp<WifiNanIface>> nan_ifaces_; |
| 269 | std::vector<sp<WifiP2pIface>> p2p_ifaces_; |
| 270 | std::vector<sp<WifiStaIface>> sta_ifaces_; |
Roshan Pius | abcf78f | 2017-10-06 16:30:38 -0700 | [diff] [blame] | 271 | std::vector<sp<WifiRttController>> rtt_controllers_; |
xshu | 5899e8e | 2018-01-09 15:36:03 -0800 | [diff] [blame] | 272 | std::map<std::string, Ringbuffer> ringbuffer_map_; |
Roshan Pius | abcf78f | 2017-10-06 16:30:38 -0700 | [diff] [blame] | 273 | bool is_valid_; |
Roshan Pius | cc33820 | 2017-11-02 13:54:09 -0700 | [diff] [blame] | 274 | // Members pertaining to chip configuration. |
Roshan Pius | abcf78f | 2017-10-06 16:30:38 -0700 | [diff] [blame] | 275 | uint32_t current_mode_id_; |
Veerendranath Jakkam | 25b3a6f | 2020-04-14 22:04:39 +0530 | [diff] [blame] | 276 | std::mutex lock_t; |
Roshan Pius | cc33820 | 2017-11-02 13:54:09 -0700 | [diff] [blame] | 277 | std::vector<IWifiChip::ChipMode> modes_; |
Roshan Pius | abcf78f | 2017-10-06 16:30:38 -0700 | [diff] [blame] | 278 | // The legacy ring buffer callback API has only a global callback |
| 279 | // registration mechanism. Use this to check if we have already |
| 280 | // registered a callback. |
| 281 | bool debug_ring_buffer_cb_registered_; |
Ahmed ElArabawy | fd809fc | 2019-11-15 18:19:15 -0800 | [diff] [blame] | 282 | hidl_callback_util::HidlCallbackHandler<IWifiChipEventCallback> |
Roshan Pius | abcf78f | 2017-10-06 16:30:38 -0700 | [diff] [blame] | 283 | event_cb_handler_; |
Roshan Pius | 3c4e8a3 | 2016-10-03 14:53:58 -0700 | [diff] [blame] | 284 | |
Roshan Pius | abcf78f | 2017-10-06 16:30:38 -0700 | [diff] [blame] | 285 | DISALLOW_COPY_AND_ASSIGN(WifiChip); |
Roshan Pius | 3c4e8a3 | 2016-10-03 14:53:58 -0700 | [diff] [blame] | 286 | }; |
| 287 | |
Roshan Pius | 79a9975 | 2016-10-04 13:03:58 -0700 | [diff] [blame] | 288 | } // namespace implementation |
Ahmed ElArabawy | f501a98 | 2019-07-23 15:02:22 -0700 | [diff] [blame] | 289 | } // namespace V1_4 |
Roshan Pius | 3c4e8a3 | 2016-10-03 14:53:58 -0700 | [diff] [blame] | 290 | } // namespace wifi |
| 291 | } // namespace hardware |
| 292 | } // namespace android |
| 293 | |
| 294 | #endif // WIFI_CHIP_H_ |