hostapd: adjust patches to work with git am
[openwrt/staging/xback.git] / package / network / services / hostapd / patches / 300-noscan.patch
1 From c61daab867671af884a7bb707f9bc0f086241bcd Mon Sep 17 00:00:00 2001
2 From: Felix Fietkau <nbd@openwrt.org>
3 Date: Wed, 20 Jan 2010 02:26:00 +0000
4 Subject: [PATCH] Add noscan, no_ht_coex config options
5
6 --- a/hostapd/config_file.c
7 +++ b/hostapd/config_file.c
8 @@ -3656,6 +3656,10 @@ static int hostapd_config_fill(struct ho
9 if (bss->ocv && !bss->ieee80211w)
10 bss->ieee80211w = 1;
11 #endif /* CONFIG_OCV */
12 + } else if (os_strcmp(buf, "noscan") == 0) {
13 + conf->noscan = atoi(pos);
14 + } else if (os_strcmp(buf, "ht_coex") == 0) {
15 + conf->no_ht_coex = !atoi(pos);
16 } else if (os_strcmp(buf, "ieee80211n") == 0) {
17 conf->ieee80211n = atoi(pos);
18 } else if (os_strcmp(buf, "ht_capab") == 0) {
19 --- a/src/ap/ap_config.h
20 +++ b/src/ap/ap_config.h
21 @@ -1093,6 +1093,8 @@ struct hostapd_config {
22
23 int ht_op_mode_fixed;
24 u16 ht_capab;
25 + int noscan;
26 + int no_ht_coex;
27 int ieee80211n;
28 int secondary_channel;
29 int no_pri_sec_switch;
30 --- a/src/ap/hw_features.c
31 +++ b/src/ap/hw_features.c
32 @@ -544,7 +544,8 @@ static int ieee80211n_check_40mhz(struct
33 int ret;
34
35 /* Check that HT40 is used and PRI / SEC switch is allowed */
36 - if (!iface->conf->secondary_channel || iface->conf->no_pri_sec_switch)
37 + if (!iface->conf->secondary_channel || iface->conf->no_pri_sec_switch ||
38 + iface->conf->noscan)
39 return 0;
40
41 hostapd_set_state(iface, HAPD_IFACE_HT_SCAN);
42 --- a/src/ap/ieee802_11_ht.c
43 +++ b/src/ap/ieee802_11_ht.c
44 @@ -239,6 +239,9 @@ void hostapd_2040_coex_action(struct hos
45 return;
46 }
47
48 + if (iface->conf->noscan || iface->conf->no_ht_coex)
49 + return;
50 +
51 if (len < IEEE80211_HDRLEN + 2 + sizeof(*bc_ie)) {
52 wpa_printf(MSG_DEBUG,
53 "Ignore too short 20/40 BSS Coexistence Management frame");
54 @@ -399,6 +402,9 @@ void ht40_intolerant_add(struct hostapd_
55 if (iface->current_mode->mode != HOSTAPD_MODE_IEEE80211G)
56 return;
57
58 + if (iface->conf->noscan || iface->conf->no_ht_coex)
59 + return;
60 +
61 wpa_printf(MSG_INFO, "HT: Forty MHz Intolerant is set by STA " MACSTR
62 " in Association Request", MAC2STR(sta->addr));
63