hostapd: adjust patches to work with git am
[openwrt/staging/xback.git] / package / network / services / hostapd / patches / 301-mesh-noscan.patch
1 From: Daniel Golle <daniel@makrotopia.org>
2 Date: Fri, 20 Apr 2018 07:41:03 +0200
3 Subject: [PATCH] Allow HT40 also on 2.4GHz if noscan option is set, which also
4 skips secondary channel scan just like noscan works in AP mode.
5
6 --- a/wpa_supplicant/config.c
7 +++ b/wpa_supplicant/config.c
8 @@ -2639,6 +2639,7 @@ static const struct parse_data ssid_fiel
9 #else /* CONFIG_MESH */
10 { INT_RANGE(mode, 0, 4) },
11 #endif /* CONFIG_MESH */
12 + { INT_RANGE(noscan, 0, 1) },
13 { INT_RANGE(proactive_key_caching, 0, 1) },
14 { INT_RANGE(disabled, 0, 2) },
15 { STR(id_str) },
16 --- a/wpa_supplicant/config_file.c
17 +++ b/wpa_supplicant/config_file.c
18 @@ -775,6 +775,7 @@ static void wpa_config_write_network(FIL
19 #endif /* IEEE8021X_EAPOL */
20 INT(mode);
21 INT(no_auto_peer);
22 + INT(noscan);
23 INT(mesh_fwding);
24 INT(frequency);
25 INT(enable_edmg);
26 --- a/wpa_supplicant/config_ssid.h
27 +++ b/wpa_supplicant/config_ssid.h
28 @@ -1035,6 +1035,8 @@ struct wpa_ssid {
29 */
30 int no_auto_peer;
31
32 + int noscan;
33 +
34 /**
35 * mesh_rssi_threshold - Set mesh parameter mesh_rssi_threshold (dBm)
36 *
37 --- a/wpa_supplicant/mesh.c
38 +++ b/wpa_supplicant/mesh.c
39 @@ -506,6 +506,8 @@ static int wpa_supplicant_mesh_init(stru
40 frequency);
41 goto out_free;
42 }
43 + if (conf->noscan)
44 + ssid->noscan = 1;
45
46 if (ssid->mesh_basic_rates == NULL) {
47 /*
48 --- a/wpa_supplicant/wpa_supplicant.c
49 +++ b/wpa_supplicant/wpa_supplicant.c
50 @@ -2770,7 +2770,7 @@ static bool ibss_mesh_can_use_vht(struct
51 const struct wpa_ssid *ssid,
52 struct hostapd_hw_modes *mode)
53 {
54 - if (mode->mode != HOSTAPD_MODE_IEEE80211A)
55 + if (mode->mode != HOSTAPD_MODE_IEEE80211A && !(ssid->noscan))
56 return false;
57
58 if (!drv_supports_vht(wpa_s, ssid))
59 @@ -2843,7 +2843,7 @@ static void ibss_mesh_select_40mhz(struc
60 int i, res;
61 unsigned int j;
62 static const int ht40plus[] = {
63 - 36, 44, 52, 60, 100, 108, 116, 124, 132, 140,
64 + 1, 2, 3, 4, 5, 6, 7, 36, 44, 52, 60, 100, 108, 116, 124, 132, 140,
65 149, 157, 165, 173, 184, 192
66 };
67 int ht40 = -1;
68 @@ -3093,7 +3093,7 @@ void ibss_mesh_setup_freq(struct wpa_sup
69 int ieee80211_mode = wpas_mode_to_ieee80211_mode(ssid->mode);
70 enum hostapd_hw_mode hw_mode;
71 struct hostapd_hw_modes *mode = NULL;
72 - int i, obss_scan = 1;
73 + int i, obss_scan = !(ssid->noscan);
74 u8 channel;
75 bool is_6ghz, is_24ghz;
76 bool dfs_enabled = wpa_s->conf->country[0] && (wpa_s->drv_flags & WPA_DRIVER_FLAGS_RADAR);
77 @@ -3143,6 +3143,8 @@ void ibss_mesh_setup_freq(struct wpa_sup
78 freq->he_enabled = ibss_mesh_can_use_he(wpa_s, ssid, mode,
79 ieee80211_mode);
80 freq->channel = channel;
81 + if (mode->mode == HOSTAPD_MODE_IEEE80211G && ssid->noscan)
82 + ibss_mesh_select_40mhz(wpa_s, ssid, mode, freq, obss_scan, dfs_enabled);
83 /* Setup higher BW only for 5 GHz */
84 if (mode->mode == HOSTAPD_MODE_IEEE80211A) {
85 ibss_mesh_select_40mhz(wpa_s, ssid, mode, freq, obss_scan, dfs_enabled);