| <html devsite><head> |
| |
| <meta name="book_path" value="/_book.yaml"/> |
| |
| <meta name="project_path" value="/_project.yaml"/> |
| </head> |
| <body> |
| <!-- |
| Copyright 2018 The Android Open Source Project |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
| --> |
| |
| <h1 id="wi_fi_hal" class="page-title">WLAN HAL</h1> |
| |
| <p>WLAN 框架具有三个 WLAN HAL 表面,分别由三个不同的 HIDL 软件包表示:</p> |
| |
| <ul> |
| <li>供应商 HAL:Android 专用命令的 HAL 表面。HIDL 文件位于 <code>hardware/interfaces/wifi/1.x</code> 中。</li> |
| <li>客户端 HAL:<strong>wpa_supplicant</strong> 的 HAL 表面。HIDL 文件位于 <code>hardware/interfaces/supplicant/1.x</code> 中。</li> |
| <li>Hostapd HAL:<strong>hostapd</strong> 的 HAL 表面。HIDL 文件位于 <code>hardware/interfaces/hostapd/1.x</code> 中。</li> |
| </ul> |
| |
| <h2 id="vendor_hal">供应商 HAL</h2> |
| |
| <p>供应商 HAL 提供 Android 专用命令。供应商 HAL 对于基础架构 Station (STA) 和 Soft AP (SAP) 模式的正常运行而言是可选的(不是必需的)。不过,对于 <a href="/devices/tech/connect/wifi-aware">WLAN 感知</a>和 <a href="/devices/tech/connect/wifi-rtt">WLAN RTT</a> 服务而言,供应商 HAL 是必需的。</p> |
| |
| <p>在 HIDL 之前(即 Android 8.0 版本之前),Android 使用的是现在称为“旧版 HAL”的 HAL 机制。<em></em>Android 源代码目前使用在旧版 HAL 之上运行的 shim 来提供 HIDL 默认实现。</p> |
| |
| <p>旧版 HAL 标头位于 <code>hardware/libhardware_legacy/include/hardware_legacy/</code> 中。基于旧版 HAL 的实现位于 <code>hardware/interfaces/wifi/1.2/default</code> 中。</p> |
| |
| <h2 id="supplicant_hal">客户端 HAL</h2> |
| |
| <p>客户端 HAL 为 <strong>wpa_supplicant</strong> 守护进程提供 HIDL 接口。</p> |
| |
| <p>wpa_supplicant 源代码位于 <code>external/wpa_supplicant_8/wpa_supplicant</code> 中。提供 HIDL 接口的 wpa_supplicant 代码位于 <code>hidl</code> 子目录中。</p> |
| |
| <h2 id="hostapd_hal">Hostapd HAL</h2> |
| |
| <p>Hostapd HAL 为 <strong>hostapd</strong> 守护进程提供 HIDL 接口。</p> |
| |
| <p>hostapd 源代码位于 <code>external/wpa_supplicant_8/hostapd</code> 中。提供 HIDL 接口的 hostapd 代码位于 <code>hidl</code> 子目录中。</p> |
| |
| <h2 id="wi_fi_multi_interface_concurrency">WLAN 多接口并发</h2> |
| |
| <p>不同的 Android 设备可以并行支持不同的 WLAN 接口组合。受支持的组合在 HAL 中定义,并提供给框架。规范格式在 <code>android/hardware/interfaces/wifi/1.0/IWifiChip.hal</code> 中定义。例如,一台设备可以支持一个 STA 和一个 NAN(<a href="https://developer.android.com/guide/topics/connectivity/wifi-aware">WLAN 感知</a>)类型或点对点(<a href="https://developer.android.com/guide/topics/connectivity/wifip2p">WLAN 直连</a>)类型的接口(但不能同时支持这两种接口)。这可以表示为:</p> |
| |
| <p><code>[{STA} <= 1, {NAN,P2P} <= 1]</code></p> |
| |
| <p>并发规范格式非常灵活,且是通用格式。它可以表示框架尚不支持的组合。参考 HAL 具有适合多种组合的配置,这些配置可通过编译标记进行启用。有关配置说明,请参阅:</p> |
| |
| <ul> |
| <li><a href="/devices/tech/connect/wifi-sta-ap-concurrency">WLAN STA/AP 并发</a></li> |
| <li><a href="/devices/tech/connect/wifi-aware">WLAN 感知</a></li> |
| </ul> |
| |
| </body></html> |