lede/package/network/services/hostapd/patches/800-hostapd-2.10-lar.patch

88 lines
2.4 KiB
Diff

diff -ru a/src/ap/hw_features.c b/src/ap/hw_features.c
--- a/src/ap/hw_features.c 2022-01-16 15:51:29.000000000 -0500
+++ b/src/ap/hw_features.c 2022-07-06 22:57:53.007315518 -0500
@@ -24,6 +24,19 @@
#include "beacon.h"
#include "hw_features.h"
+#ifdef CONFIG_IWLWIFI
+static void ieee80211n_do_nothing(struct hostapd_iface *iface)
+{
+ wpa_printf(MSG_DEBUG,
+ "Scan finished!");
+}
+
+static void ieee80211n_scan_channels_2g4(struct hostapd_iface *iface,
+ struct wpa_driver_scan_params *params);
+static void ieee80211n_scan_channels_5g(struct hostapd_iface *iface,
+ struct wpa_driver_scan_params *params);
+
+#endif
void hostapd_free_hw_features(struct hostapd_hw_modes *hw_features,
size_t num_hw_features)
@@ -82,6 +93,35 @@
if (hostapd_drv_none(hapd))
return -1;
+#ifdef CONFIG_IWLWIFI
+
+
+ if (!iface->conf->noscan) {
+ // scan
+ struct wpa_driver_scan_params params;
+ int ret1;
+
+ os_memset(&params, 0, sizeof(params));
+ ieee80211n_scan_channels_5g(iface, &params);
+
+ ret1 = hostapd_driver_scan(iface->bss[0], &params);
+
+ if (ret1 == -EBUSY) {
+ wpa_printf(MSG_ERROR,
+ "Failed to request a scan of neighboring BSSes ret=%d (%s)!",
+ ret1, strerror(-ret1));
+ }
+
+ if (ret1 == 0) {
+ iface->scan_cb = ieee80211n_do_nothing;
+ wpa_printf(MSG_DEBUG,
+ "Sleeping...");
+ for (int i=0; i<110; i++) {
+ usleep(100000);
+ }
+ }
+ }
+#endif
modes = hostapd_get_hw_feature_data(hapd, &num_modes, &flags,
&dfs_domain);
if (modes == NULL) {
@@ -518,8 +556,15 @@
/* Check that HT40 is used and PRI / SEC switch is allowed */
if (!iface->conf->secondary_channel || iface->conf->no_pri_sec_switch ||
+#ifdef CONFIG_IWLWIFI
+ iface->conf->noscan) {
+ wpa_printf(MSG_DEBUG, "Not scanning due to noscan?");
+ return 0;
+ }
+#else
iface->conf->noscan)
return 0;
+#endif
hostapd_set_state(iface, HAPD_IFACE_HT_SCAN);
wpa_printf(MSG_DEBUG, "Scan for neighboring BSSes prior to enabling "
@@ -916,7 +954,11 @@
if (!hostapd_is_usable_edmg(iface))
return 0;
+#ifdef CONFIG_IWLWIFI
+ if (!iface->conf->secondary_channel || iface->conf->noscan)
+#else
if (!iface->conf->secondary_channel)
+#endif
return 1;
if (hostapd_is_usable_chan(iface, iface->freq +