]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
hostapd: Remove unused passive scan functionality
authorJouni Malinen <jouni.malinen@atheros.com>
Fri, 17 Apr 2009 12:47:37 +0000 (15:47 +0300)
committerJouni Malinen <j@w1.fi>
Fri, 17 Apr 2009 12:47:37 +0000 (15:47 +0300)
This was not really supported by any of the included driver wrappers. If
this functionality is desired in the future, this (or something similar)
can be added with the changes needed into a driver wrapper to use the
mechanism.

hostapd/ap_list.c
hostapd/config.c
hostapd/config.h
hostapd/driver_i.h
hostapd/hostapd.conf
hostapd/hw_features.c
hostapd/ieee802_11.c
src/drivers/driver.h
src/drivers/driver_ndis.c
src/drivers/driver_privsep.c
src/drivers/driver_test.c

index 46670fa89f02e1fd46af6cc653025065fd563e14..a4eeb373488dc271918f4c7f081e1a16bd8d6c54 100644 (file)
@@ -72,23 +72,6 @@ enum ieee80211_phytype {
  * in this link will thus be the least recently used entry. */
 
 
-static void ap_list_new_ap(struct hostapd_iface *iface, struct ap_info *ap)
-{
-       wpa_printf(MSG_DEBUG, "New AP detected: " MACSTR, MAC2STR(ap->addr));
-
-       /* TODO: could send a notification message to an external program that
-        * would then determine whether a rogue AP has been detected */
-}
-
-
-static void ap_list_expired_ap(struct hostapd_iface *iface, struct ap_info *ap)
-{
-       wpa_printf(MSG_DEBUG, "AP info expired: " MACSTR, MAC2STR(ap->addr));
-
-       /* TODO: could send a notification message to an external program */
-}
-
-
 static int ap_list_beacon_olbc(struct hostapd_iface *iface, struct ap_info *ap)
 {
        int i;
@@ -278,8 +261,6 @@ static struct ap_info * ap_ap_add(struct hostapd_iface *iface, u8 *addr)
        if (iface->num_ap > iface->conf->ap_table_max_size && ap != ap->prev) {
                wpa_printf(MSG_DEBUG, "Removing the least recently used AP "
                           MACSTR " from AP table", MAC2STR(ap->prev->addr));
-               if (iface->conf->passive_scan_interval > 0)
-                       ap_list_expired_ap(iface, ap->prev);
                ap_free_ap(iface, ap->prev);
        }
 
@@ -365,10 +346,7 @@ void ap_list_process_beacon(struct hostapd_iface *iface,
                ap->datarate = fi->datarate;
        }
 
-       if (new_ap) {
-               if (iface->conf->passive_scan_interval > 0)
-                       ap_list_new_ap(iface, ap);
-       } else if (ap != iface->ap_list) {
+       if (!new_ap && ap != iface->ap_list) {
                /* move AP entry into the beginning of the list so that the
                 * oldest entry is always in the end of the list */
                ap_ap_list_del(iface, ap);
@@ -412,18 +390,12 @@ static void ap_list_timer(void *eloop_ctx, void *timeout_ctx)
 
        time(&now);
 
-       /* FIX: it looks like jkm-Purina ended up in busy loop in this
-        * function. Apparently, something can still cause a loop in the AP
-        * list.. */
-
        while (iface->ap_list) {
                ap = iface->ap_list->prev;
                if (ap->last_beacon + iface->conf->ap_table_expiration_time >=
                    now)
                        break;
 
-               if (iface->conf->passive_scan_interval > 0)
-                       ap_list_expired_ap(iface, ap);
                ap_free_ap(iface, ap);
        }
 
@@ -495,8 +467,6 @@ int ap_list_reconfig(struct hostapd_iface *iface,
                    now)
                        break;
 
-               if (iface->conf->passive_scan_interval > 0)
-                       ap_list_expired_ap(iface, iface->ap_list->prev);
                ap_free_ap(iface, iface->ap_list->prev);
        }
 
index 12c15ba79d1cc7f3279aca63eba8291d2a28e1d2..e0061cadb2fbdcf1e129688285bc7486206da1f6 100644 (file)
@@ -2066,12 +2066,6 @@ struct hostapd_config * hostapd_config_read(const char *fname)
                        bss->ssid.vlan_tagged_interface = os_strdup(pos);
 #endif /* CONFIG_FULL_DYNAMIC_VLAN */
 #endif /* CONFIG_NO_VLAN */
-               } else if (os_strcmp(buf, "passive_scan_interval") == 0) {
-                       conf->passive_scan_interval = atoi(pos);
-               } else if (os_strcmp(buf, "passive_scan_listen") == 0) {
-                       conf->passive_scan_listen = atoi(pos);
-               } else if (os_strcmp(buf, "passive_scan_mode") == 0) {
-                       conf->passive_scan_mode = atoi(pos);
                } else if (os_strcmp(buf, "ap_table_max_size") == 0) {
                        conf->ap_table_max_size = atoi(pos);
                } else if (os_strcmp(buf, "ap_table_expiration_time") == 0) {
index c6a615b59fb1734e822c9faa8b6eefdf41006deb..6844bd4895c8a0fdaf2a1a91f935dc714571143d 100644 (file)
@@ -341,9 +341,6 @@ struct hostapd_config {
 
        const struct wpa_driver_ops *driver;
 
-       int passive_scan_interval; /* seconds, 0 = disabled */
-       int passive_scan_listen; /* usec */
-       int passive_scan_mode;
        int ap_table_max_size;
        int ap_table_expiration_time;
 
index 3fe0594ef56ad49f3574848d4cf6f410619d7c22..a5e9d40a2342590ec3677b14bc1005d77cd9b6bc 100644 (file)
@@ -458,17 +458,6 @@ hostapd_if_remove(struct hostapd_data *hapd, enum hostapd_driver_if_type type,
        return hapd->driver->if_remove(hapd->drv_priv, type, ifname, addr);
 }
 
-static inline int
-hostapd_passive_scan(struct hostapd_data *hapd, int now, int our_mode_only,
-                    int interval, int _listen, int *channel,
-                    int *last_rx)
-{
-       if (hapd->driver == NULL || hapd->driver->passive_scan == NULL)
-               return -1;
-       return hapd->driver->passive_scan(hapd->drv_priv, now, our_mode_only,
-                                         interval, _listen, channel, last_rx);
-}
-
 static inline struct hostapd_hw_modes *
 hostapd_get_hw_feature_data(struct hostapd_data *hapd, u16 *num_modes,
                            u16 *flags)
index 117e1d5b37e17fadeea8a56bd568a4465a95cd57..796c0d6f115a7ac61b4757ed67e6f23dc5829ff9 100644 (file)
@@ -825,27 +825,11 @@ own_ip_addr=127.0.0.1
 # 1 = push PMK-R1 to all configured R1KHs whenever a new PMK-R0 is derived
 #pmk_r1_push=1
 
-##### Passive scanning ########################################################
-# Scan different channels every N seconds. 0 = disable passive scanning.
-#passive_scan_interval=60
-
-# Listen N usecs on each channel when doing passive scanning.
-# This value plus the time needed for changing channels should be less than
-# 32 milliseconds (i.e. 32000 usec) to avoid interruptions to normal
-# operations. Time needed for channel changing varies based on the used wlan
-# hardware.
-# default: disabled (0)
-#passive_scan_listen=10000
-
-# Passive scanning mode:
-# 0 = scan all supported modes (802.11a/b/g/Turbo) (default)
-# 1 = scan only the mode that is currently used for normal operations
-#passive_scan_mode=1
-
-# Maximum number of entries kept in AP table (either for passive scanning or
-# for detecting Overlapping Legacy BSS Condition). The oldest entry will be
+##### Neighbor table ##########################################################
+# Maximum number of entries kept in AP table (either for neigbor table or for
+# detecting Overlapping Legacy BSS Condition). The oldest entry will be
 # removed when adding a new entry that would make the list grow over this
-# limit. Note! Wi-Fi certification for IEEE 802.11g requires that OLBC is
+# limit. Note! WFA certification for IEEE 802.11g requires that OLBC is
 # enabled, so this field should not be set to 0 when using IEEE 802.11g.
 # default: 255
 #ap_table_max_size=255
index c29cd1938c0868ab1318e2f20844a73d950329bb..f5be71f42bf2ff6a6b1a74ca5c474ac49f8d6779 100644 (file)
@@ -593,7 +593,7 @@ int hostapd_check_ht_capab(struct hostapd_iface *iface)
  */
 int hostapd_select_hw_mode(struct hostapd_iface *iface)
 {
-       int i, j, ok, ret;
+       int i, j, ok;
 
        if (iface->num_hw_features < 1)
                return -1;
@@ -654,23 +654,7 @@ int hostapd_select_hw_mode(struct hostapd_iface *iface)
                return -1;
        }
 
-       ret = hostapd_passive_scan(iface->bss[0], 0,
-                                  iface->conf->passive_scan_mode,
-                                  iface->conf->passive_scan_interval,
-                                  iface->conf->passive_scan_listen,
-                                  NULL, NULL);
-       if (ret) {
-               if (ret == -1) {
-                       wpa_printf(MSG_DEBUG, "Passive scanning not "
-                                  "supported");
-               } else {
-                       wpa_printf(MSG_ERROR, "Could not set passive "
-                                  "scanning: %s", strerror(ret));
-               }
-               ret = 0;
-       }
-
-       return ret;
+       return 0;
 }
 
 
index f60c72d05db56585480dd69439f8f59211d35016..de76f61981bbb7a2b09e3a8847a8530838bc0ecb 100644 (file)
@@ -1446,9 +1446,6 @@ void ieee802_11_mgmt(struct hostapd_data *hapd, u8 *buf, size_t len, u16 stype,
                return;
        }
 
-       if (fi && fi->passive_scan)
-               return;
-
        broadcast = mgmt->bssid[0] == 0xff && mgmt->bssid[1] == 0xff &&
                mgmt->bssid[2] == 0xff && mgmt->bssid[3] == 0xff &&
                mgmt->bssid[4] == 0xff && mgmt->bssid[5] == 0xff;
index cadc5818a2bc375475fb0ba9e42f1b4cd5293c43..efe66e64a3e10942d4a99248692933f6e5e87f94 100644 (file)
@@ -1298,9 +1298,6 @@ struct wpa_driver_ops {
        int (*bss_add)(void *priv, const char *ifname, const u8 *bssid);
        int (*bss_remove)(void *priv, const char *ifname);
        int (*valid_bss_mask)(void *priv, const u8 *addr, const u8 *mask);
-       int (*passive_scan)(void *priv, int now, int our_mode_only,
-                           int interval, int _listen, int *channel,
-                           int *last_rx);
        int (*if_add)(const char *iface, void *priv,
                      enum hostapd_driver_if_type type, char *ifname,
                      const u8 *addr);
@@ -1747,8 +1744,6 @@ struct hostapd_frame_info {
        u32 channel;
        u32 datarate;
        u32 ssi_signal;
-
-       unsigned int passive_scan:1;
 };
 
 void hostapd_mgmt_rx(struct hostapd_data *hapd, u8 *buf, size_t len,
index 7223ca1334f99ebb9fc31377a8a43722d97fa946..b1762296657843d79174fce3137a6ca038a83ade 100644 (file)
@@ -3255,7 +3255,6 @@ const struct wpa_driver_ops wpa_driver_ndis_ops = {
        NULL /* bss_add */,
        NULL /* bss_remove */,
        NULL /* valid_bss_mask */,
-       NULL /* passive_scan */,
        NULL /* if_add */,
        NULL /* if_update */,
        NULL /* if_remove */,
index 7522527fc4251cbaadc3fd58e94f9983e3a61adb..d6ef79278187ce6472762d7dc8883d36472ea1b9 100644 (file)
@@ -851,7 +851,6 @@ struct wpa_driver_ops wpa_driver_privsep_ops = {
        NULL /* bss_add */,
        NULL /* bss_remove */,
        NULL /* valid_bss_mask */,
-       NULL /* passive_scan */,
        NULL /* if_add */,
        NULL /* if_update */,
        NULL /* if_remove */,
index ecc748727cdcd8b7e5e05a9a0c9b68892d4b69d0..c766ab72dde21ab778173827df3dc8f4898f4555 100644 (file)
@@ -2558,7 +2558,6 @@ const struct wpa_driver_ops wpa_driver_test_ops = {
        NULL /* bss_add */,
        NULL /* bss_remove */,
        NULL /* valid_bss_mask */,
-       NULL /* passive_scan */,
        NULL /* if_add */,
        NULL /* if_update */,
        NULL /* if_remove */,