aboutsummaryrefslogtreecommitdiffstats
path: root/src/drivers/driver_none.c
diff options
context:
space:
mode:
authorJouni Malinen <jouni.malinen@atheros.com>2009-04-09 10:40:12 (GMT)
committerJouni Malinen <j@w1.fi>2009-04-09 10:40:12 (GMT)
commitc51218372f6ee40c3830b4cb06fa58752e546d06 (patch)
tree42936f385bc11c7fe257cd8ab62e1561c84379b7 /src/drivers/driver_none.c
parentc2220ec0b7f47841fbec71d9f4626e2705a03a89 (diff)
downloadhostap-c51218372f6ee40c3830b4cb06fa58752e546d06.zip
hostap-c51218372f6ee40c3830b4cb06fa58752e546d06.tar.gz
hostap-c51218372f6ee40c3830b4cb06fa58752e546d06.tar.bz2
Merge wpa_supplicant and hostapd driver wrapper implementations
This commit merges the driver_ops structures and implementations from hostapd/driver*.[ch] into src/drivers. This is only an initial step and there is room for number of cleanups to share code between the hostapd and wpa_supplicant parts of the wrappers to avoid unnecessary source code duplication.
Diffstat (limited to 'src/drivers/driver_none.c')
-rw-r--r--src/drivers/driver_none.c62
1 files changed, 62 insertions, 0 deletions
diff --git a/src/drivers/driver_none.c b/src/drivers/driver_none.c
new file mode 100644
index 0000000..56fb344
--- /dev/null
+++ b/src/drivers/driver_none.c
@@ -0,0 +1,62 @@
+/*
+ * hostapd / Driver interface for RADIUS server only (no driver)
+ * Copyright (c) 2008, Atheros Communications
+ *
+ * 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 "../hostapd/hostapd.h"
+#include "driver.h"
+
+
+struct none_driver_data {
+ struct hostapd_data *hapd;
+};
+
+
+static void * none_driver_init(struct hostapd_data *hapd)
+{
+ struct none_driver_data *drv;
+
+ drv = os_zalloc(sizeof(struct none_driver_data));
+ if (drv == NULL) {
+ wpa_printf(MSG_ERROR, "Could not allocate memory for none "
+ "driver data");
+ return NULL;
+ }
+ drv->hapd = hapd;
+
+ return drv;
+}
+
+
+static void none_driver_deinit(void *priv)
+{
+ struct none_driver_data *drv = priv;
+
+ os_free(drv);
+}
+
+
+static int none_driver_send_ether(void *priv, const u8 *dst, const u8 *src,
+ u16 proto, const u8 *data, size_t data_len)
+{
+ return 0;
+}
+
+
+const struct wpa_driver_ops wpa_driver_none_ops = {
+ .name = "none",
+ .hapd_init = none_driver_init,
+ .hapd_deinit = none_driver_deinit,
+ .send_ether = none_driver_send_ether,
+};