PATCH: remove flush from driver independent part

Gunter Burchardt gbur at informatik.uni-rostock.de
Thu Aug 19 08:02:54 EDT 2004


Hello,

This patch removes hostapd_flush from driver independent part. A
function pointer to this function was added in driver info.

regards
gunter
-------------- next part --------------
diff -Nur hostap.old/hostapd/driver.c hostap/hostapd/driver.c
--- hostap.old/hostapd/driver.c	2004-08-19 13:18:56.000000000 +0200
+++ hostap/hostapd/driver.c	2004-08-19 13:42:56.000000000 +0200
@@ -325,7 +325,7 @@
 }
 
 
-int hostapd_flush(void *priv)
+static int hostapd_flush(void *priv)
 {
 	struct hostap_driver_data *drv = priv;
 	struct prism2_hostapd_param param;
@@ -710,6 +710,7 @@
 	hapd->driver.init_1x = hostapd_init_1x;
 	hapd->driver.set_privacy_invoked = hostapd_set_privacy_invoked;
 	hapd->driver.set_encryption = hostapd_set_encryption;
+	hapd->driver.flush = hostapd_flush;
 
 	return 0;
 }
@@ -730,6 +731,7 @@
 	hapd->driver.init_1x = NULL;
 	hapd->driver.set_privacy_invoked = NULL;
 	hapd->driver.set_encryption = NULL;
+	hapd->driver.flush = NULL;
 
 	(void) hostapd_set_iface_flags(drv, 0);
 	(void) hostap_ioctl_prism2param(drv, PRISM2_PARAM_HOSTAPD, 0);
diff -Nur hostap.old/hostapd/driver.h hostap/hostapd/driver.h
--- hostap.old/hostapd/driver.h	2004-08-19 13:18:56.000000000 +0200
+++ hostap/hostapd/driver.h	2004-08-19 13:40:52.000000000 +0200
@@ -16,7 +16,6 @@
 int hostapd_set_iface_flags(void *priv, int dev_up);
 int hostap_ioctl_setiwessid(void *priv, char *buf, int len);
 int hostapd_get_seqnum(void *priv, u8 *addr, int idx, u8 *seq);
-int hostapd_flush(void *priv);
 int hostapd_set_generic_elem(void *priv,
 			     const char *elem, size_t elem_len);
 int hostapd_wireless_event_init(void *priv);
diff -Nur hostap.old/hostapd/hostapd.c hostap/hostapd/hostapd.c
--- hostap.old/hostapd/hostapd.c	2004-08-19 13:18:56.000000000 +0200
+++ hostap/hostapd/hostapd.c	2004-08-19 13:42:04.000000000 +0200
@@ -368,7 +368,8 @@
 	int ret = 0;
 
 	printf("Flushing old station entries\n");
-	if (hostapd_flush(hapd->driver.data)) {
+	if (hapd->driver.flush &&
+		hapd->driver.flush(hapd->driver.data)) {
 		printf("Could not connect to kernel driver.\n");
 		ret = -1;
 	}
diff -Nur hostap.old/hostapd/hostapd.h hostap/hostapd/hostapd.h
--- hostap.old/hostapd/hostapd.h	2004-08-19 13:18:56.000000000 +0200
+++ hostap/hostapd/hostapd.h	2004-08-19 13:41:16.000000000 +0200
@@ -53,6 +53,7 @@
 struct driver_info {
 	void *data; /* driver specific data - each driver can store data for
 		     * its own use in this pointer */
+	int (*flush)(void *priv);
 	int (*set_encryption)(void *priv, const char *alg, u8 *addr,
 			      int idx, u8 *key, size_t key_len);
 	int (*set_privacy_invoked)(void *priv, int flag);


More information about the HostAP mailing list