]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Move wpa_scan_results_free() into shared C file
authorJouni Malinen <j@w1.fi>
Sun, 13 Nov 2011 16:56:26 +0000 (18:56 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 13 Nov 2011 16:56:26 +0000 (18:56 +0200)
Replace the inline helper function with a new C file that can be used
for common driver API related function.

Signed-hostap: Jouni Malinen <j@w1.fi>

hostapd/Android.mk
hostapd/Makefile
src/drivers/driver.h
src/drivers/driver_common.c [new file with mode: 0644]
wpa_supplicant/Android.mk
wpa_supplicant/Makefile
wpa_supplicant/symbian/wpa_supplicant.mmp
wpa_supplicant/vs2005/eapol_test/eapol_test.vcproj
wpa_supplicant/vs2005/wpa_supplicant/wpa_supplicant.vcproj
wpa_supplicant/vs2005/wpasvc/wpasvc.vcproj

index 2b53f03d884a4a7c10500eb127c0ff6a91214d20..44bc2a13b030972eb437deab4fd06d8317785c9b 100644 (file)
@@ -766,6 +766,8 @@ L_CFLAGS += -DCONFIG_P2P_MANAGER
 OBJS += src/ap/p2p_hostapd.c
 endif
 
+OBJS += src/drivers/driver_common.c
+
 ifdef CONFIG_NO_STDOUT_DEBUG
 L_CFLAGS += -DCONFIG_NO_STDOUT_DEBUG
 endif
index efa1011f7d7da23dfe0b159a1b06dc0b4fee3c07..e46561e709f646d5317e0662515f993af0e41cad 100644 (file)
@@ -749,6 +749,8 @@ ifdef CONFIG_INTERWORKING
 CFLAGS += -DCONFIG_INTERWORKING
 endif
 
+OBJS += ../src/drivers/driver_common.o
+
 ifdef CONFIG_WPA_CLI_EDIT
 OBJS_c += ../src/utils/edit.o
 else
index 06f2db32fa70804268bc2ceb0cf2cd13509e4329..e84fe441051e52dc91517c3ae4d67bbfd6f41c0c 100644 (file)
@@ -3492,17 +3492,7 @@ static inline void drv_event_eapol_rx(void *ctx, const u8 *src, const u8 *data,
        wpa_supplicant_event(ctx, EVENT_EAPOL_RX, &event);
 }
 
-static inline void wpa_scan_results_free(struct wpa_scan_results *res)
-{
-       size_t i;
-
-       if (res == NULL)
-               return;
-
-       for (i = 0; i < res->num; i++)
-               os_free(res->res[i]);
-       os_free(res->res);
-       os_free(res);
-}
+/* driver_common.c */
+void wpa_scan_results_free(struct wpa_scan_results *res);
 
 #endif /* DRIVER_H */
diff --git a/src/drivers/driver_common.c b/src/drivers/driver_common.c
new file mode 100644 (file)
index 0000000..3ea16e9
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * Common driver-related functions
+ * Copyright (c) 2003-2011, Jouni Malinen <j@w1.fi>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Alternatively, this software may be distributed under the terms of BSD
+ * license.
+ *
+ * See README and COPYING for more details.
+ */
+
+#include "includes.h"
+#include "utils/common.h"
+#include "driver.h"
+
+void wpa_scan_results_free(struct wpa_scan_results *res)
+{
+       size_t i;
+
+       if (res == NULL)
+               return;
+
+       for (i = 0; i < res->num; i++)
+               os_free(res->res[i]);
+       os_free(res->res);
+       os_free(res);
+}
index a717be44880f8b557da444e62c9478c8cc6c5b7b..7a76bc466efb03fb7ba9ac3ae64060584e00b741 100644 (file)
@@ -1330,6 +1330,8 @@ OBJS += offchannel.c
 L_CFLAGS += -DCONFIG_OFFCHANNEL
 endif
 
+OBJS += src/drivers/driver_common.c
+
 OBJS_wpa_rm := ctrl_iface.c ctrl_iface_unix.c
 OBJS_wpa := $(filter-out $(OBJS_wpa_rm),$(OBJS)) $(OBJS_h) tests/test_wpa.c
 ifdef CONFIG_AUTHENTICATOR
index 3641a58d6abb1f79086200ce77884f8028400a02..bb04db4d17340b0180cbf1e9553664f0b0c33dad 100644 (file)
@@ -1305,6 +1305,8 @@ OBJS += offchannel.o
 CFLAGS += -DCONFIG_OFFCHANNEL
 endif
 
+OBJS += ../src/drivers/driver_common.o
+
 OBJS_wpa_rm := ctrl_iface.o ctrl_iface_unix.o
 OBJS_wpa := $(filter-out $(OBJS_wpa_rm),$(OBJS)) $(OBJS_h) tests/test_wpa.o
 ifdef CONFIG_AUTHENTICATOR
index 217908e9b0032d733a21a5b45a01b7becac37f72..e018e056910d6dfaefb6846c54bf6ba724614a2d 100644 (file)
@@ -15,7 +15,7 @@ SOURCE                wpa_supplicant.c events.c
 SOURCEPATH     ..\..\src\rsn_supp
 SOURCE         wpa.c preauth.c pmksa_cache.c peerkey.c wpa_ie.c
 SOURCEPATH     ..\..\src\drivers
-SOURCE         drivers.c
+SOURCE         drivers.c driver_common.c
 SOURCEPATH     ..\..\src\common
 SOURCE         wpa_common.c
 SOURCEPATH     ..\..\src\utils
index d96f6613cd5437675875b7805374d8f39d94eb6e..38b29c486d5903135a01e9a8cf6400413320ae80 100755 (executable)
                                RelativePath="..\..\ctrl_iface_named_pipe.c"\r
                                >\r
                        </File>\r
+                       <File\r
+                               RelativePath="..\..\..\src\drivers\driver_common.c"\r
+                               >\r
+                       </File>\r
                        <File\r
                                RelativePath="..\..\..\src\eap_peer\eap.c"\r
                                >\r
index e59cc6cce87415d9972e16865391e05017dc838e..e3886b7af13c947767d83f725bace25b92286b89 100755 (executable)
                                RelativePath="..\..\ctrl_iface_named_pipe.c"\r
                                >\r
                        </File>\r
+                       <File\r
+                               RelativePath="..\..\..\src\drivers\driver_common.c"\r
+                               >\r
+                       </File>\r
                        <File\r
                                RelativePath="..\..\..\src\drivers\driver_ndis.c"\r
                                >\r
index 4d402e5ce851fdad454fc5d6231699d39ec90768..1034891046bde68aeec1d904108a42ac1ea0ff14 100755 (executable)
                                RelativePath="..\..\ctrl_iface_named_pipe.c"\r
                                >\r
                        </File>\r
+                       <File\r
+                               RelativePath="..\..\..\src\drivers\driver_common.c"\r
+                               >\r
+                       </File>\r
                        <File\r
                                RelativePath="..\..\..\src\drivers\driver_ndis.c"\r
                                >\r