debian.org / О Debian Где взять Debian Поддержка Уголок разработчика Новости Wiki

Автор Тема: Запуск hostapd на частоте 2.4GHz с шириной канала 40MHz  (Прочитано 1131 раз)

0 Пользователей и 1 Гость просматривают эту тему.

Оффлайн jelt

  • Новичок форума
  • Topic Author
  • Сообщений: 2
Разработчики hostapd строго придерживаются стандартов. Согласно стандарту, если вокруг точки есть работающие другие точки доступа, вещающие на одном канале(20 МГц), режим 40 МГц (20+20)не должен включаться. Скорость Wi-Fi подключения в этом случае будет 72 Мбит/c, несмотря на то, что адаптер заявлен на 150 Мбит/c или 300 Мбит/c.
Изменим  hostapd  в режиме стандарта 802.11n, на предмет проверки соседей, и в независимости от  занятости диапазонов, запуск будет осуществляться на двух каналах.
Исходные данные
адаптер TP-LINK TL-WN881ND
02:00.0 Network controller: Qualcomm Atheros AR9287 Wireless Network Adapter (PCI-Express) (rev 01)
driver=ath9k
iw list
Spoiler: ShowHide
Wiphy phy0
   max # scan SSIDs: 4
   max scan IEs length: 2257 bytes
   max # sched scan SSIDs: 0
   max # match sets: 0
   max # scan plans: 1
   max scan plan interval: -1
   max scan plan iterations: 0
   Retry short limit: 7
   Retry long limit: 4
   Coverage class: 0 (up to 0m)
   Device supports RSN-IBSS.
   Device supports AP-side u-APSD.
   Device supports T-DLS.
   Supported Ciphers:
      * WEP40 (00-0f-ac:1)
      * WEP104 (00-0f-ac:5)
      * TKIP (00-0f-ac:2)
      * CCMP-128 (00-0f-ac:4)
      * CCMP-256 (00-0f-ac:10)
      * GCMP-128 (00-0f-ac:8)
      * GCMP-256 (00-0f-ac:9)
      * CMAC (00-0f-ac:6)
      * CMAC-256 (00-0f-ac:13)
      * GMAC-128 (00-0f-ac:11)
      * GMAC-256 (00-0f-ac:12)
   Available Antennas: TX 0x3 RX 0x3
   Configured Antennas: TX 0x3 RX 0x3
   Supported interface modes:
       * IBSS
       * managed
       * AP
       * AP/VLAN
       * WDS
       * monitor
       * mesh point
       * P2P-client
       * P2P-GO
       * outside context of a BSS
   Band 1:
      Capabilities: 0x11ee
         HT20/HT40
         SM Power Save disabled
         RX HT20 SGI
         RX HT40 SGI
         TX STBC
         RX STBC 1-stream
         Max AMSDU length: 3839 bytes
         DSSS/CCK HT40
      Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
      Minimum RX AMPDU time spacing: 8 usec (0x06)
      HT TX/RX MCS rate indexes supported: 0-15
      Bitrates (non-HT):
         * 1.0 Mbps
         * 2.0 Mbps (short preamble supported)
         * 5.5 Mbps (short preamble supported)
         * 11.0 Mbps (short preamble supported)
         * 6.0 Mbps
         * 9.0 Mbps
         * 12.0 Mbps
         * 18.0 Mbps
         * 24.0 Mbps
         * 36.0 Mbps
         * 48.0 Mbps
         * 54.0 Mbps
      Frequencies:
         * 2412 MHz [1] (20.0 dBm)
         * 2417 MHz [2] (20.0 dBm)
         * 2422 MHz [3] (20.0 dBm)
         * 2427 MHz [4] (20.0 dBm)
         * 2432 MHz [5] (20.0 dBm)
         * 2437 MHz [6] (20.0 dBm)
         * 2442 MHz [7] (20.0 dBm)
         * 2447 MHz [8] (20.0 dBm)
         * 2452 MHz [9] (20.0 dBm)
         * 2457 MHz [10] (20.0 dBm)
         * 2462 MHz [11] (20.0 dBm)
         * 2467 MHz [12] (20.0 dBm)
         * 2472 MHz [13] (20.0 dBm)
         * 2484 MHz [14] (disabled)
   Supported commands:
       * new_interface
       * set_interface
       * new_key
       * start_ap
       * new_station
       * new_mpath
       * set_mesh_config
       * set_bss
       * authenticate
       * associate
       * deauthenticate
       * disassociate
       * join_ibss
       * join_mesh
       * remain_on_channel
       * set_tx_bitrate_mask
       * frame
       * frame_wait_cancel
       * set_wiphy_netns
       * set_channel
       * set_wds_peer
       * tdls_mgmt
       * tdls_oper
       * probe_client
       * set_noack_map
       * register_beacons
       * start_p2p_device
       * set_mcast_rate
       * channel_switch
       * set_qos_map
       * connect
       * disconnect
   Supported TX frame types:
       * IBSS: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
       * managed: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
       * AP: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
       * AP/VLAN: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
       * mesh point: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
       * P2P-client: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
       * P2P-GO: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
       * P2P-device: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
   Supported RX frame types:
       * IBSS: 0x40 0xb0 0xc0 0xd0
       * managed: 0x40 0xd0
       * AP: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
       * AP/VLAN: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
       * mesh point: 0xb0 0xc0 0xd0
       * P2P-client: 0x40 0xd0
       * P2P-GO: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
       * P2P-device: 0x40 0xd0
   software interface modes (can always be added):
       * AP/VLAN
       * monitor
   valid interface combinations:
       * #{ managed } <= 2048, #{ AP, mesh point } <= 8, #{ P2P-client, P2P-GO } <= 1,
         total <= 2048, #channels <= 1, STA/AP BI must match
       * #{ WDS } <= 2048,
         total <= 2048, #channels <= 1, STA/AP BI must match
   HT Capability overrides:
       * MCS: ff ff ff ff ff ff ff ff ff ff
       * maximum A-MSDU length
       * supported channel width
       * short GI for 40 MHz
       * max A-MPDU length exponent
       * min MPDU start spacing
   Device supports TX status socket option.
   Device supports HT-IBSS.
   Device supports SAE with AUTHENTICATE command
   Device supports low priority scan.
   Device supports scan flush.
   Device supports AP scan.
   Device supports per-vif TX power setting
   P2P GO supports CT window setting
   Driver supports full state transitions for AP/GO clients
   Driver supports a userspace MPM
   Device supports active monitor (which will ACK incoming frames)
   Driver/device bandwidth changes during BSS lifetime (AP/GO mode)
   Device supports configuring vdev MAC-addr on create.

Установим необходимые пакеты
apt-get install  build-essential fakeroot dpkg-dev autoconf  automake pkg-config libnl-genl-3-dev libssl-dev checkinstall build-dep devscripts
Создаём директорию для сборки пакета.
cp /home/wpaпереходим в неё
cd /home/wpaРаскомментируем строки deb-src в sources.list
nano /etc/apt/sources.listОбновим список пакетов
apt-get updateскачиваем исходники
apt-get source hostapdНа момент обновления в стабильной версии находятся hostapd_2.4-1 и wpasupplicant_2.4-1
Переходим в каталог wpa-2.4
cd wpa-2.4
Поскольку мы хотим добавить новый патч, мы должны сначала применить все исправления
в пакете.
export QUILT_PATCHES=debian/patchesquilt push -aПолностью применена серия файлов, заканчивается на патче debian/patches/2017-1/0012-бла-бла
создаём патч со следующим номером
quilt new 2017-1/0013-noscan.patchПатч debian/patches/0013-noscan.patch теперь наверху

добавляем первый файл
quilt add hostapd/config_file.cФайл hostapd/config_file.c добавлен к патчу debian/patches/0013-noscan.patch

Изменим оригинальный файл, как нам надо
Пояснение:
@@ -2750 номера строк, после которых идут исправления
+ то, что надо добавить вновь
- то, что надо удалить
nano hostapd/config_file.c
Spoiler: ShowHide
@@ -2750,6+2750,10 @@
       }
 #endif /* CONFIG_IEEE80211W */
 #ifdef CONFIG_IEEE80211N
+   } else if (os_strcmp(buf, "noscan") == 0) {
+      conf->noscan = atoi(pos);
+   } else if (os_strcmp(buf, "ht_coex") == 0) {
+      conf->no_ht_coex = !atoi(pos);
    } else if (os_strcmp(buf, "ieee80211n") == 0) {
       conf->ieee80211n = atoi(pos);
    } else if (os_strcmp(buf, "ht_capab") == 0) {
       if (hostapd_config_ht_capab(conf, pos) < 0) {

добавляем второй файл к патчу
quilt add hostapd/defconfigФайл hostapd/defconfig добавлен к патчу debian/patches/2017-1/0013-noscan.patch
правим
nano hostapd/defconfig
Spoiler: ShowHide

@@ -28,7 +28,7 @@ CONFIG_DRIVER_NL80211=y
 #CONFIG_LIBNL20=y
 
 # Use libnl 3.2 libraries (if this is selected, CONFIG_LIBNL20 is ignored)
-#CONFIG_LIBNL32=y
+CONFIG_LIBNL32=y
 
 
 # Driver interface for FreeBSD net80211 layer (e.g., Atheros driver)
@@ -138,21 +138,21 @@ CONFIG_PKCS12=y
 CONFIG_IPV6=y
 
 # IEEE Std 802.11r-2008 (Fast BSS Transition)
-#CONFIG_IEEE80211R=y
+CONFIG_IEEE80211R=y
 
 # Use the hostapd's IEEE 802.11 authentication (ACL), but without
 # the IEEE 802.11 Management capability (e.g., FreeBSD/net80211)
 #CONFIG_DRIVER_RADIUS_ACL=y
 
 # IEEE 802.11n (High Throughput) support
-#CONFIG_IEEE80211N=y
+CONFIG_IEEE80211N=y
 
 # Wireless Network Management (IEEE Std 802.11v-2011)
 # Note: This is experimental and not complete implementation.
-#CONFIG_WNM=y
+CONFIG_WNM=y
 
 # IEEE 802.11ac (Very High Throughput) support
-#CONFIG_IEEE80211AC=y
+CONFIG_IEEE80211AC=y
 
 # Remove debugging code that is printing out debug messages to stdout.
 # This can be used to reduce the size of the hostapd considerably if debugging
@@ -161,7 +161,7 @@ CONFIG_IPV6=y
 
 # Add support for writing debug log to a file: -f /tmp/hostapd.log
 # Disabled by default.
-#CONFIG_DEBUG_FILE=y
+CONFIG_DEBUG_FILE=y
 
 # Add support for sending all debug messages (regardless of debug verbosity)
 # to the Linux kernel tracing facility. This helps debug the entire stack by
@@ -245,16 +245,16 @@ CONFIG_IPV6=y
 # gnutls = GnuTLS
 # internal = Internal TLSv1 implementation (experimental)
 # none = Empty template
-#CONFIG_TLS=openssl
+CONFIG_TLS=openssl
 
 # TLS-based EAP methods require at least TLS v1.0. Newer version of TLS (v1.1)
 # can be enabled to get a stronger construction of messages when block ciphers
 # are used.
-#CONFIG_TLSV11=y
+CONFIG_TLSV11=y
 
 # TLS-based EAP methods require at least TLS v1.0. Newer version of TLS (v1.2)
 # can be enabled to enable use of stronger crypto algorithms.
-#CONFIG_TLSV12=y
+CONFIG_TLSV12=y
 
 # If CONFIG_TLS=internal is used, additional library and include paths are
 # needed for LibTomMath. Alternatively, an integrated, minimal version of
@@ -289,7 +289,7 @@ CONFIG_IPV6=y
 # connect to this hostapd. These options allow, for example, to drop a
 # certain percentage of probe requests or auth/(re)assoc frames.
 #
-#CONFIG_TESTING_OPTIONS=y
+CONFIG_TESTING_OPTIONS=y
 
 # Automatic Channel Selection
 # This will allow hostapd to pick the channel automatically when channel is set
@@ -313,4 +313,7 @@ CONFIG_IPV6=y
 # For more details refer to:
 # http://wireless.kernel.org/en/users/Documentation/acs
 #
-#CONFIG_ACS=y
+CONFIG_ACS=y
+
+CONFIG_NOSCAN=y
+

добавляем третий файл
quilt add hostapd/MakefileФайл hostapd/Makefile добавлен к патчу debian/patches/2017-1/0013-noscan.patch
правим
nano hostapd/Makefile
Spoiler: ShowHide
@@ -242,6 +242,10 @@ ifdef CONFIG_IEEE80211AC
 CFLAGS += -DCONFIG_IEEE80211AC
 endif
 
+ifdef CONFIG_NOSCAN
+CFLAGS += -DCONFIG_NOSCAN
+endif
+
 include ../src/drivers/drivers.mak
 OBJS += $(DRV_AP_OBJS)
 CFLAGS += $(DRV_AP_CFLAGS)

добавляем четвёртый файл
quilt add src/ap/ap_config.hФайл src/ap/ap_config.h добавлен к патчу debian/patches/2017-1/0013-noscan.patch
правим
nano src/ap/ap_config.h
Spoiler: ShowHide
@@ -618,8 +618,11 @@ struct hostapd_config {
 
    int ht_op_mode_fixed;
    u16 ht_capab;
+   int noscan;
+   int no_ht_coex;
    int ieee80211n;
    int secondary_channel;
+   int no_pri_sec_switch;
    int require_ht;
    int obss_interval;
    u32 vht_capab;

добавляем пятый файл
quilt add src/ap/hw_features.cФайл src/ap/hw_features.c добавлен к патчу debian/patches/2017-1/0013-noscan.patch
правим
nano src/ap/hw_features.c
Spoiler: ShowHide
@@ -461,8 +461,10 @@ static int ieee80211n_check_40mhz(struct
    struct wpa_driver_scan_params params;
    int ret;
 
-   if (!iface->conf->secondary_channel)
-      return 0; /* HT40 not used */
+    /* Check that HT40 is used and PRI / SEC switch is allowed */
+   if (!iface->conf->secondary_channel || iface->conf->no_pri_sec_switch ||
+      iface->conf->noscan)
+      return 0;
 
    hostapd_set_state(iface, HAPD_IFACE_HT_SCAN);
    wpa_printf(MSG_DEBUG, "Scan for neighboring BSSes prior to enabling "

добавляем шестой файл
quilt add src/ap/ieee802_11_ht.cФайл src/ap/ieee802_11_ht.c добавлен к патчу debian/patches/2017-1/0013-noscan.patch
правим
nano src/ap/ieee802_11_ht.c
Spoiler: ShowHide
@@ -221,6 +221,9 @@ void hostapd_2040_coex_action(struct hos
    if (!(iface->conf->ht_capab & HT_CAP_INFO_SUPP_CHANNEL_WIDTH_SET))
       return;
 
+   if (iface->conf->noscan || iface->conf->no_ht_coex)
+      return;
+
    if (len < IEEE80211_HDRLEN + 2 + sizeof(*bc_ie))
       return;
 
@@ -342,6 +345,9 @@ void ht40_intolerant_add(struct hostapd_
    if (iface->current_mode->mode != HOSTAPD_MODE_IEEE80211G)
       return;
 
+   if (iface->conf->noscan || iface->conf->no_ht_coex)
+      return;
+
    wpa_printf(MSG_INFO, "HT: Forty MHz Intolerant is set by STA " MACSTR
          " in Association Request", MAC2STR(sta->addr));

 Запишем все изменения в наш патч
quilt refreshПатч debian/patches/2017-1/0013-noscan.patch обновлён
Отменяем все патчи, включая наш
quilt pop -aС помощью команды dch -i изменим версию пакета, чтобы пересобраный нами пакет можно было отличить от оригинальных, предоставляемых Debian. Можно ничего не менять, при вызове команды, система сама увеличит номер версии в debian/changelog
dch -iустановим все зависимости hostapd
apt-get build-dep hostapdсобираем
debuild -uc -us -bУстанавливаем
dpkg -i hostapd_2.4-1+deb9u1.1_amd64.deb wpasupplicant_2.4-1+deb9u1.1_amd64.deb«Заморозим» пакеты
apt-mark hold hostapd wpasupplicant
конфиг hostapd
Spoiler: ShowHide
interface=wlp2s0
driver=nl80211
bridge=br0
ssid=
country_code=RU
hw_mode=g
channel=9
#channel=acs_survey
#acs_num_scans=5
#acs_chan_bias=1:0.8 6:0.8 11:0.8
wmm_enabled=1
wme_enabled=1
ieee80211n=1
ieee80211d=1
noscan=1
ht_capab=[HT40-][HT40+][SHORT-GI-40][TX-STBC][RX-STBC1][DSSS_CCK-40]
ctrl_interface=/var/run/hostapd
ctrl_interface_group=0
auth_algs=1
eapol_key_index_workaround=0
eap_server=0
wpa=2
wpa_psk_file=/etc/hostapd/wpa_psk
wpa_key_mgmt=WPA-PSK
wpa_pairwise=CCMP
rsn_pairwise=CCMP
logger_syslog=-1
logger_syslog_level=0

Точка поднимается на 40 MHz
iw wlp2s0 infoInterface wlp2s0
ifindex 4
wdev 0x1
addr
ssid
type AP
wiphy 0
channel 9 (2452 MHz), width: 40 MHz, center1: 2462 MHz
txpower 16.00 dBm
Готовый патч
Spoiler: ShowHide
Description: <short summary of the patch>
 TODO: Put a short summary on the line above and replace this paragraph
 with a longer explanation of this change. Complete the meta-information
 with other relevant fields (see below for details). To make it easier, the
 information below has been extracted from the changelog. Adjust it or drop
 it.
 .
 wpa (2:2.4-1+deb9u1noscan0.1) stretch; urgency=medium
 .
   * Non-maintainer upload.
   *
Author: root <root@debian.debi.dom>

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: https://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: 2018-01-04

--- wpa-2.4.orig/hostapd/Makefile
+++ wpa-2.4/hostapd/Makefile
@@ -242,6 +242,10 @@ ifdef CONFIG_IEEE80211AC
 CFLAGS += -DCONFIG_IEEE80211AC
 endif
 
+ifdef CONFIG_NOSCAN
+CFLAGS += -DCONFIG_NOSCAN
+endif
+
 include ../src/drivers/drivers.mak
 OBJS += $(DRV_AP_OBJS)
 CFLAGS += $(DRV_AP_CFLAGS)
--- wpa-2.4.orig/hostapd/config_file.c
+++ wpa-2.4/hostapd/config_file.c
@@ -2750,6 +2750,10 @@ static int hostapd_config_fill(struct ho
       }
 #endif /* CONFIG_IEEE80211W */
 #ifdef CONFIG_IEEE80211N
+   } else if (os_strcmp(buf, "noscan") == 0) {
+      conf->noscan = atoi(pos);
+   } else if (os_strcmp(buf, "ht_coex") == 0) {
+      conf->no_ht_coex = !atoi(pos);
    } else if (os_strcmp(buf, "ieee80211n") == 0) {
       conf->ieee80211n = atoi(pos);
    } else if (os_strcmp(buf, "ht_capab") == 0) {
--- wpa-2.4.orig/hostapd/defconfig
+++ wpa-2.4/hostapd/defconfig
@@ -28,7 +28,7 @@ CONFIG_DRIVER_NL80211=y
 #CONFIG_LIBNL20=y
 
 # Use libnl 3.2 libraries (if this is selected, CONFIG_LIBNL20 is ignored)
-#CONFIG_LIBNL32=y
+CONFIG_LIBNL32=y
 
 
 # Driver interface for FreeBSD net80211 layer (e.g., Atheros driver)
@@ -138,21 +138,21 @@ CONFIG_PKCS12=y
 CONFIG_IPV6=y
 
 # IEEE Std 802.11r-2008 (Fast BSS Transition)
-#CONFIG_IEEE80211R=y
+CONFIG_IEEE80211R=y
 
 # Use the hostapd's IEEE 802.11 authentication (ACL), but without
 # the IEEE 802.11 Management capability (e.g., FreeBSD/net80211)
 #CONFIG_DRIVER_RADIUS_ACL=y
 
 # IEEE 802.11n (High Throughput) support
-#CONFIG_IEEE80211N=y
+CONFIG_IEEE80211N=y
 
 # Wireless Network Management (IEEE Std 802.11v-2011)
 # Note: This is experimental and not complete implementation.
-#CONFIG_WNM=y
+CONFIG_WNM=y
 
 # IEEE 802.11ac (Very High Throughput) support
-#CONFIG_IEEE80211AC=y
+CONFIG_IEEE80211AC=y
 
 # Remove debugging code that is printing out debug messages to stdout.
 # This can be used to reduce the size of the hostapd considerably if debugging
@@ -161,7 +161,7 @@ CONFIG_IPV6=y
 
 # Add support for writing debug log to a file: -f /tmp/hostapd.log
 # Disabled by default.
-#CONFIG_DEBUG_FILE=y
+CONFIG_DEBUG_FILE=y
 
 # Add support for sending all debug messages (regardless of debug verbosity)
 # to the Linux kernel tracing facility. This helps debug the entire stack by
@@ -245,16 +245,16 @@ CONFIG_IPV6=y
 # gnutls = GnuTLS
 # internal = Internal TLSv1 implementation (experimental)
 # none = Empty template
-#CONFIG_TLS=openssl
+CONFIG_TLS=openssl
 
 # TLS-based EAP methods require at least TLS v1.0. Newer version of TLS (v1.1)
 # can be enabled to get a stronger construction of messages when block ciphers
 # are used.
-#CONFIG_TLSV11=y
+CONFIG_TLSV11=y
 
 # TLS-based EAP methods require at least TLS v1.0. Newer version of TLS (v1.2)
 # can be enabled to enable use of stronger crypto algorithms.
-#CONFIG_TLSV12=y
+CONFIG_TLSV12=y
 
 # If CONFIG_TLS=internal is used, additional library and include paths are
 # needed for LibTomMath. Alternatively, an integrated, minimal version of
@@ -289,7 +289,7 @@ CONFIG_IPV6=y
 # connect to this hostapd. These options allow, for example, to drop a
 # certain percentage of probe requests or auth/(re)assoc frames.
 #
-#CONFIG_TESTING_OPTIONS=y
+CONFIG_TESTING_OPTIONS=y
 
 # Automatic Channel Selection
 # This will allow hostapd to pick the channel automatically when channel is set
@@ -313,4 +313,7 @@ CONFIG_IPV6=y
 # For more details refer to:
 # http://wireless.kernel.org/en/users/Documentation/acs
 #
-#CONFIG_ACS=y
+CONFIG_ACS=y
+
+CONFIG_NOSCAN=y
+
--- wpa-2.4.orig/src/ap/ap_config.h
+++ wpa-2.4/src/ap/ap_config.h
@@ -618,8 +618,11 @@ struct hostapd_config {
 
    int ht_op_mode_fixed;
    u16 ht_capab;
+   int noscan;
+   int no_ht_coex;
    int ieee80211n;
    int secondary_channel;
+   int no_pri_sec_switch;
    int require_ht;
    int obss_interval;
    u32 vht_capab;
--- wpa-2.4.orig/src/ap/hw_features.c
+++ wpa-2.4/src/ap/hw_features.c
@@ -461,8 +461,10 @@ static int ieee80211n_check_40mhz(struct
    struct wpa_driver_scan_params params;
    int ret;
 
-   if (!iface->conf->secondary_channel)
-      return 0; /* HT40 not used */
+    /* Check that HT40 is used and PRI / SEC switch is allowed */
+   if (!iface->conf->secondary_channel || iface->conf->no_pri_sec_switch ||
+      iface->conf->noscan)
+      return 0;
 
    hostapd_set_state(iface, HAPD_IFACE_HT_SCAN);
    wpa_printf(MSG_DEBUG, "Scan for neighboring BSSes prior to enabling "
--- wpa-2.4.orig/src/ap/ieee802_11_ht.c
+++ wpa-2.4/src/ap/ieee802_11_ht.c
@@ -221,6 +221,9 @@ void hostapd_2040_coex_action(struct hos
    if (!(iface->conf->ht_capab & HT_CAP_INFO_SUPP_CHANNEL_WIDTH_SET))
       return;
 
+   if (iface->conf->noscan || iface->conf->no_ht_coex)
+      return;
+
    if (len < IEEE80211_HDRLEN + 2 + sizeof(*bc_ie))
       return;
 
@@ -342,6 +345,9 @@ void ht40_intolerant_add(struct hostapd_
    if (iface->current_mode->mode != HOSTAPD_MODE_IEEE80211G)
       return;
 
+   if (iface->conf->noscan || iface->conf->no_ht_coex)
+      return;
+
    wpa_printf(MSG_INFO, "HT: Forty MHz Intolerant is set by STA " MACSTR
          " in Association Request", MAC2STR(sta->addr));

Из нереализованного:
нет автоматического перехода на более свободный канал, поэтому в конфиге это закоментированно.

Критика и указание на ошибки приветствуются.
« Последнее редактирование: 08 Март 2018, 08:30:11 от jelt »
 
Пользователи, которые поблагодарили этот пост: ogost, CoolAller

Русскоязычное сообщество Debian GNU/Linux



Теги:
 

[How-To] Запуск LiceCD Ubuntu (и не только) с любого ПК в сети с помощью PXE

Автор gardarea51

Ответов: 3
Просмотров: 7223
Последний ответ 26 Ноябрь 2014, 08:43:38
от gardarea51
HOW-TO: установка и запуск MediaTomb на Debian 8 "Jessie" с Systemd

Автор saint-denis

Ответов: 0
Просмотров: 1694
Последний ответ 17 Июнь 2017, 15:20:51
от saint-denis