Browse Source

Include BSS table unconditionally in the wpa_supplicant build

This will allow more cleanup to be done for scan results processing
since all code can now be made to depend on the BSS table instead of
the temporary scan results.

Once remaining code has been converted to use the BSS table, the new
scan results can be freed immediately after the BSS table has been
updated. In addition, filtering of BSS information should be added
to better support systems with limited resources. For now, memory
use can be limited by defining WPA_BSS_MAX_COUNT to be smaller.
Anyway, better filtering of results to only the configured networks
should be added to improve this.
Jouni Malinen 15 years ago
parent
commit
34359a3fb1
3 changed files with 7 additions and 24 deletions
  1. 1 5
      wpa_supplicant/Makefile
  2. 0 5
      wpa_supplicant/defconfig
  3. 6 14
      wpa_supplicant/wpa_supplicant.c

+ 1 - 5
wpa_supplicant/Makefile

@@ -40,6 +40,7 @@ install: all
 
 OBJS = config.o
 OBJS += notify.o
+OBJS += bss.o
 OBJS += eap_register.o
 OBJS += ../src/utils/common.o
 OBJS += ../src/utils/wpa_debug.o
@@ -1162,11 +1163,6 @@ OBJS += $(SHA1OBJS) $(DESOBJS)
 
 OBJS_p += $(SHA1OBJS)
 
-ifdef CONFIG_BSS_TABLE
-CFLAGS += -DCONFIG_BSS_TABLE
-OBJS += bss.o
-endif
-
 ifdef CONFIG_BGSCAN_SIMPLE
 CFLAGS += -DCONFIG_BGSCAN_SIMPLE
 OBJS += bgscan_simple.o

+ 0 - 5
wpa_supplicant/defconfig

@@ -344,8 +344,6 @@ CONFIG_PEERKEY=y
 
 # Add support for new DBus control interface
 # (fi.w1.hostap.wpa_supplicant1)
-# Note: You will also need to enable CONFIG_BSS_TABLE if you want to have full
-# support for the documented D-Bus signals.
 #CONFIG_CTRL_IFACE_DBUS_NEW=y
 
 # Add introspection support for new DBus control interface (requires libxml2)
@@ -394,6 +392,3 @@ CONFIG_PEERKEY=y
 # This enables use of libbfd to get more detailed symbols for the backtraces
 # generated by CONFIG_WPA_TRACE=y.
 #CONFIG_WPA_TRACE_BFD=y
-
-# Maintain a local BSS table to track neighboring BSSes.
-CONFIG_BSS_TABLE=y

+ 6 - 14
wpa_supplicant/wpa_supplicant.c

@@ -399,9 +399,7 @@ static void wpa_supplicant_cleanup(struct wpa_supplicant *wpa_s)
 
 	wpa_scan_results_free(wpa_s->scan_res);
 	wpa_s->scan_res = NULL;
-#ifdef CONFIG_BSS_TABLE
 	wpa_bss_deinit(wpa_s);
-#endif /* CONFIG_BSS_TABLE */
 
 	wpa_supplicant_cancel_scan(wpa_s);
 	wpa_supplicant_cancel_auth_timeout(wpa_s);
@@ -1573,6 +1571,8 @@ int wpa_supplicant_set_debug_params(struct wpa_global *global, int debug_level,
  */
 int wpa_supplicant_get_scan_results(struct wpa_supplicant *wpa_s)
 {
+	size_t i;
+
 	wpa_scan_results_free(wpa_s->scan_res);
 	if (wpa_s->drv_flags & WPA_DRIVER_FLAGS_USER_SPACE_MLME)
 		wpa_s->scan_res = ieee80211_sta_get_scan_results(wpa_s);
@@ -1585,16 +1585,10 @@ int wpa_supplicant_get_scan_results(struct wpa_supplicant *wpa_s)
 
 	wpa_scan_sort_results(wpa_s->scan_res);
 
-#ifdef CONFIG_BSS_TABLE
-	{
-		size_t i;
-		wpa_bss_update_start(wpa_s);
-		for (i = 0; i < wpa_s->scan_res->num; i++)
-			wpa_bss_update_scan_res(wpa_s,
-						wpa_s->scan_res->res[i]);
-		wpa_bss_update_end(wpa_s);
-	}
-#endif /* CONFIG_BSS_TABLE */
+	wpa_bss_update_start(wpa_s);
+	for (i = 0; i < wpa_s->scan_res->num; i++)
+		wpa_bss_update_scan_res(wpa_s, wpa_s->scan_res->res[i]);
+	wpa_bss_update_end(wpa_s);
 
 	return 0;
 }
@@ -2099,10 +2093,8 @@ next_driver:
 	}
 #endif /* CONFIG_IBSS_RSN */
 
-#ifdef CONFIG_BSS_TABLE
 	if (wpa_bss_init(wpa_s) < 0)
 		return -1;
-#endif /* CONFIG_BSS_TABLE */
 
 	return 0;
 }