平台:Android7.1
芯片:RK3328
Wifi:rtl8822cu
1、hostapd.conf 增加ieee80211ac=1
系统起热点(AP)的时候,会走SoftapController生成hostapd.conf,我们让他生成的时候附带上需要的参数
system/netd/server/SoftapController.cpp
diff --git a/server/SoftapController.cpp b/server/SoftapController.cpp
old mode 100644
new mode 100755
index 7e99cf3..7a34662
--- a/server/SoftapController.cpp
+++ b/server/SoftapController.cpp
@@ -145,7 +145,10 @@ int SoftapController::setSoftap(int argc, char *argv[]) {
"ssid=%s\n"
"channel=%d\n"
"ieee80211n=1\n"
+ "ieee80211ac=1\n"
"hw_mode=%c\n"
+ //速度有提高,但部分电脑会不支持导致连接不上
+ //"ht_capab=[SHORT-GI-20][SHORT-GI-40][HT40+] \n"
"ignore_broadcast_ssid=%d\n"
"wowlan_triggers=any\n",
argv[2], argv[3], channel, (channel <= 14) ? 'g' : 'a', hidden));
rk3328_box:/ # cat data/misc/wifi/hostapd.conf
interface=wap0
driver=nl80211
ctrl_interface=/data/misc/wifi/hostapd
ssid=TEST-AP
channel=48
ieee80211n=1
ieee80211ac=1
hw_mode=a
ignore_broadcast_ssid=0
wowlan_triggers=any
wpa=2
rsn_pairwise=CCMP
wpa_psk=f8a7abffc92c6d16b5dcfdae0aaaf34e5734b11775d0925c80eba154e9ff2643
2、 瑞昱(RTW)的wifi模块 insmod的时候需要增加参数,rtw_vht_enable=2
这个根据设备起AP的方式来,我是脚本的方式就直接 insmod rtl8822cu.ko rtw_vht_enable=2
3、wpa增加CONFIG_IEEE80211AC=y
这里两个配置文件增加CONFIG_IEEE80211AC=y,让wpa代码支持CONFIG_IEEE80211AC
external\wpa_supplicant_8\wpa_supplicant\android.config
external\wpa_supplicant_8\hostapd\android.config