11Subject: [PATCH] For intel Wi-Fi cards, force to scan other wireless networks so the drive is able to set the correct region - hostap v2.11
22
3- Signed-off-by: ------------- <
[email protected] >
4- ---
5- Index: src/ap/hostapd.h
6- IDEA additional info:
7- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
8- <+>UTF-8
93===================================================================
4+ diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
5+ index a05de030d..3cf01a296 100644
6+ --- a/src/ap/hostapd.c
7+ +++ b/src/ap/hostapd.c
8+ @@ -1985,18 +1985,15 @@ static void channel_list_update_timeout(void *eloop_ctx, void *timeout_ctx)
9+
10+
11+ void hostapd_channel_list_updated(struct hostapd_iface *iface, int initiator)
12+ - {
13+ - if (initiator == REGDOM_SET_BY_DRIVER) {
14+ - hostapd_for_each_interface(iface->interfaces,
15+ - hostapd_no_ir_channel_list_updated,
16+ - NULL);
17+ - return;
18+ - }
19+ + {}
20+
21+ - if (!iface->wait_channel_update || initiator != REGDOM_SET_BY_USER)
22+ +
23+ + void hostapd_scan_results_updated(struct hostapd_iface *iface)
24+ + {
25+ + if (!iface->wait_channel_update)
26+ return;
27+
28+ - wpa_printf(MSG_DEBUG, "Channel list updated - continue setup");
29+ + wpa_printf(MSG_DEBUG, "Scan results updated - continue setup");
30+ eloop_cancel_timeout(channel_list_update_timeout, iface, NULL);
31+ setup_interface2(iface);
32+ }
33+ @@ -2064,7 +2061,8 @@ static int setup_interface(struct hostapd_iface *iface)
34+ if (os_strncmp(previous_country, country, 2) != 0) {
35+ wpa_printf(MSG_DEBUG, "Continue interface setup after channel list update");
36+ iface->wait_channel_update = 1;
37+ - eloop_register_timeout(5, 0,
38+ + int timeout = hostapd_scan_region_before_setting_channel(iface, NULL) ? 10 : 5;
39+ + eloop_register_timeout(timeout, 0,
40+ channel_list_update_timeout,
41+ iface, NULL);
42+ return 0;
1043diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h
11- --- a/src/ap/hostapd.h (revision d945ddd368085f255e68328f2d3b020ceea359af)
12- +++ b/src/ap/hostapd.h (date 1735583802487)
13- @@ -746,6 +746,7 @@
44+ index dcf395ca5..adb0a5b38 100644
45+ --- a/src/ap/hostapd.h
46+ +++ b/src/ap/hostapd.h
47+ @@ -746,6 +746,7 @@ void hostapd_cleanup_iface_partial(struct hostapd_iface *iface);
1448 int hostapd_add_iface(struct hapd_interfaces *ifaces, char *buf);
1549 int hostapd_remove_iface(struct hapd_interfaces *ifaces, char *buf);
1650 void hostapd_channel_list_updated(struct hostapd_iface *iface, int initiator);
1751+ void hostapd_scan_results_updated(struct hostapd_iface *iface);
1852 void hostapd_set_state(struct hostapd_iface *iface, enum hostapd_iface_state s);
1953 const char * hostapd_state_text(enum hostapd_iface_state s);
2054 int hostapd_csa_in_progress(struct hostapd_iface *iface);
21- Index: src/ap/hw_features.c
22- IDEA additional info:
23- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
24- <+>UTF-8
25- ===================================================================
2655diff --git a/src/ap/hw_features.c b/src/ap/hw_features.c
27- --- a/src/ap/hw_features.c (revision d945ddd368085f255e68328f2d3b020ceea359af)
28- +++ b/src/ap/hw_features.c (date 1735583802511)
29- @@ -42,6 +42,14 @@
56+ index c4556603d..639ce4088 100644
57+ --- a/src/ap/hw_features.c
58+ +++ b/src/ap/hw_features.c
59+ @@ -42,6 +42,14 @@ void hostapd_free_hw_features(struct hostapd_hw_modes *hw_features,
3060 }
3161
3262
@@ -41,7 +71,7 @@ diff --git a/src/ap/hw_features.c b/src/ap/hw_features.c
4171 #ifndef CONFIG_NO_STDOUT_DEBUG
4272 static char * dfs_info(struct hostapd_channel_data *chan)
4373 {
44- @@ -85,6 +93,10 @@
74+ @@ -85,6 +93,10 @@ int hostapd_get_hw_features(struct hostapd_iface *iface)
4575
4676 if (hostapd_drv_none(hapd))
4777 return -1;
@@ -52,7 +82,7 @@ diff --git a/src/ap/hw_features.c b/src/ap/hw_features.c
5282 modes = hostapd_get_hw_feature_data(hapd, &num_modes, &flags,
5383 &dfs_domain);
5484 if (modes == NULL) {
55- @@ -539,6 +551,34 @@
85+ @@ -539,6 +551,34 @@ static void ap_ht40_scan_retry(void *eloop_data, void *user_data)
5686 }
5787
5888
@@ -87,59 +117,11 @@ diff --git a/src/ap/hw_features.c b/src/ap/hw_features.c
87117 void hostapd_stop_setup_timers(struct hostapd_iface *iface)
88118 {
89119 eloop_cancel_timeout(ap_ht40_scan_retry, iface, NULL);
90- Index: src/ap/hostapd.c
91- IDEA additional info:
92- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
93- <+>UTF-8
94- ===================================================================
95- diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
96- --- a/src/ap/hostapd.c (revision d945ddd368085f255e68328f2d3b020ceea359af)
97- +++ b/src/ap/hostapd.c (date 1735583802473)
98- @@ -1983,8 +1983,11 @@
99- setup_interface2(iface);
100- }
101-
102- -
103- void hostapd_channel_list_updated(struct hostapd_iface *iface, int initiator)
104- + {}
105- +
106- +
107- + void hostapd_scan_results_updated(struct hostapd_iface *iface)
108- {
109- if (initiator == REGDOM_SET_BY_DRIVER) {
110- hostapd_for_each_interface(iface->interfaces,
111- @@ -1993,10 +1996,10 @@
112- return;
113- }
114-
115- - if (!iface->wait_channel_update || initiator != REGDOM_SET_BY_USER)
116- + if (!iface->wait_channel_update)
117- return;
118-
119- - wpa_printf(MSG_DEBUG, "Channel list updated - continue setup");
120- + wpa_printf(MSG_DEBUG, "Scan results updated - continue setup");
121- eloop_cancel_timeout(channel_list_update_timeout, iface, NULL);
122- setup_interface2(iface);
123- }
124- @@ -2064,7 +2067,8 @@
125- if (os_strncmp(previous_country, country, 2) != 0) {
126- wpa_printf(MSG_DEBUG, "Continue interface setup after channel list update");
127- iface->wait_channel_update = 1;
128- - eloop_register_timeout(5, 0,
129- + int timeout = hostapd_scan_region_before_setting_channel(iface, NULL) ? 10 : 5;
130- + eloop_register_timeout(timeout, 0,
131- channel_list_update_timeout,
132- iface, NULL);
133- return 0;
134- Index: src/ap/hw_features.h
135- IDEA additional info:
136- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
137- <+>UTF-8
138- ===================================================================
139120diff --git a/src/ap/hw_features.h b/src/ap/hw_features.h
140- --- a/src/ap/hw_features.h (revision d945ddd368085f255e68328f2d3b020ceea359af)
141- +++ b/src/ap/hw_features.h (date 1735583802520)
142- @@ -21,6 +21,7 @@
121+ index c682c6d20..ad4b6cf7d 100644
122+ --- a/src/ap/hw_features.h
123+ +++ b/src/ap/hw_features.h
124+ @@ -21,6 +21,7 @@ int hostapd_select_hw_mode(struct hostapd_iface *iface);
143125 const char * hostapd_hw_mode_txt(int mode);
144126 int hostapd_hw_get_freq(struct hostapd_data *hapd, int chan);
145127 int hostapd_hw_get_channel(struct hostapd_data *hapd, int freq);
0 commit comments