怎么把WiFi热点设置为5GHZ

如题。

尝试修改 /data/misc/wifi/hostapd.conf,但是无效。

把wifichannel设置到5Gchannel

JCoder 发表于 2016-6-24 12:41
把wifichannel设置到5Gchannel

您好 怎么设置为5Gchannel 能和我说一下么

JCoder 发表于 2016-6-24 12:41
把wifichannel设置到5Gchannel

您好 怎么设置为5Gchannel 能和我说一下么

diff --git a/service/java/com/android/server/wifi/SoftApManager.java b/service/java/com/android/server/wifi/SoftApManager.java
index 2dfb754..3e60ede 100644
— a/service/java/com/android/server/wifi/SoftApManager.java
+++ b/service/java/com/android/server/wifi/SoftApManager.java
@@ -137,12 +137,13 @@ public class SoftApManager {
* Country code is mandatory for 5GHz band, return an error if failed to set
* country code when AP is configured for 5GHz band.
*/

  •        if (!mWifiNative.setCountryCodeHal(mCountryCode.toUpperCase(Locale.ROOT))
    
  •        /*if (!mWifiNative.setCountryCodeHal(mCountryCode.toUpperCase(Locale.ROOT))
                   && config.apBand == WifiConfiguration.AP_BAND_5GHZ) {
               Log.e(TAG, "Failed to set country code, required for setting up "
                       + "soft ap in 5GHz");
               return ERROR_GENERIC;
    
  •        }
    
  •        }*/
       }
    
       try {
    

diff --git a/service/java/com/android/server/wifi/util/ApConfigUtil.java b/service/java/com/android/server/wifi/util/ApConfigUtil.java
index 7bbbc03..0e12f06 100644
— a/service/java/com/android/server/wifi/util/ApConfigUtil.java
+++ b/service/java/com/android/server/wifi/util/ApConfigUtil.java
@@ -133,15 +133,14 @@ public class ApConfigUtil {
config.apBand, allowed2GChannels,
wifiNative.getChannelsForBand(WifiScanner.WIFI_BAND_5_GHZ));
if (config.apChannel == -1) {

  •            if (wifiNative.isGetChannelsForBandSupported()) {
    
  •                /* We're not able to get channel when it is supported by HAL. */
    
  •                Log.e(TAG, "Failed to get available channel.");
    
  •                return ERROR_NO_CHANNEL;
    
  •            }
    
  •            /* Use the default for HAL without get channel support. */
    
  •            config.apBand = DEFAULT_AP_BAND;
    
  •            config.apChannel = DEFAULT_AP_CHANNEL;
    
  •   if (config.apBand == WifiConfiguration.AP_BAND_5GHZ) {
    
  •   	Log.e(TAG, "kernel not support,set to chanel 153");
    
  •   	config.apChannel = 153;
    
  •            } else {
    
  •   	config.apBand = DEFAULT_AP_BAND;
    
  •   	config.apChannel = DEFAULT_AP_CHANNEL;
    
  •            }
           }
       }
    

Netd 配置 SoftAp 5G 支持 HT40
wifi驱动是否支持5g中的雷达信道,不支持,驱动中设置cfg80211中的prohibited_flags,取消标志IEEE80211_CHAN_NO_IR ,chan->flags &= ~(prohibited_flags);

u32 prohibited_flags = IEEE80211_CHAN_NO_IR;

_Eason 发表于 2018-4-17 18:15
Netd 配置 SoftAp 5G 支持 HT40
wifi驱动是否支持5g中的雷达信道,不支持,驱动中设置cfg80211中的prohib …

大佬,能否详细说下如何配置HT40