blob: 6ff3eae6c4f9a5bd8297b90233af1aa4428e1927 [file] [log] [blame]
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001/*
2 * Driver interface for RADIUS server or WPS ER only (no driver)
3 * Copyright (c) 2008, Atheros Communications
4 *
Dmitry Shmidtc5ec7f52012-03-06 16:33:24 -08005 * This software may be distributed under the terms of the BSD license.
6 * See README for more details.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07007 */
8
9#include "includes.h"
10
11#include "common.h"
12#include "driver.h"
13
14
15struct none_driver_data {
16 struct hostapd_data *hapd;
17 void *ctx;
18};
19
20
21static void * none_driver_hapd_init(struct hostapd_data *hapd,
22 struct wpa_init_params *params)
23{
24 struct none_driver_data *drv;
25
26 drv = os_zalloc(sizeof(struct none_driver_data));
27 if (drv == NULL) {
28 wpa_printf(MSG_ERROR, "Could not allocate memory for none "
29 "driver data");
30 return NULL;
31 }
32 drv->hapd = hapd;
33
34 return drv;
35}
36
37
38static void none_driver_hapd_deinit(void *priv)
39{
40 struct none_driver_data *drv = priv;
41
42 os_free(drv);
43}
44
45
46static int none_driver_send_ether(void *priv, const u8 *dst, const u8 *src,
47 u16 proto, const u8 *data, size_t data_len)
48{
49 return 0;
50}
51
52
53static void * none_driver_init(void *ctx, const char *ifname)
54{
55 struct none_driver_data *drv;
56
57 drv = os_zalloc(sizeof(struct none_driver_data));
58 if (drv == NULL) {
59 wpa_printf(MSG_ERROR, "Could not allocate memory for none "
60 "driver data");
61 return NULL;
62 }
63 drv->ctx = ctx;
64
65 return drv;
66}
67
68
69static void none_driver_deinit(void *priv)
70{
71 struct none_driver_data *drv = priv;
72
73 os_free(drv);
74}
75
76
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -070077const struct wpa_driver_ops wpa_driver_none_ops = {
78 .name = "none",
79 .desc = "no driver (RADIUS server/WPS ER)",
80 .hapd_init = none_driver_hapd_init,
81 .hapd_deinit = none_driver_hapd_deinit,
82 .send_ether = none_driver_send_ether,
83 .init = none_driver_init,
84 .deinit = none_driver_deinit,
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -070085};