]> git.ipfire.org Git - thirdparty/hostap.git/blame - src/drivers/driver_none.c
Use a shared helper function for RSN supplicant capabilities
[thirdparty/hostap.git] / src / drivers / driver_none.c
CommitLineData
d64dabee 1/*
a3c6598f 2 * Driver interface for RADIUS server or WPS ER only (no driver)
d64dabee
JM
3 * Copyright (c) 2008, Atheros Communications
4 *
e22d4d95
JM
5 * This software may be distributed under the terms of the BSD license.
6 * See README for more details.
d64dabee
JM
7 */
8
9#include "includes.h"
10
90973fb2 11#include "common.h"
d64dabee
JM
12#include "driver.h"
13
14
15struct none_driver_data {
16 struct hostapd_data *hapd;
a3c6598f 17 void *ctx;
d64dabee
JM
18};
19
20
a3c6598f
JM
21static void * none_driver_hapd_init(struct hostapd_data *hapd,
22 struct wpa_init_params *params)
d64dabee
JM
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
a3c6598f 38static void none_driver_hapd_deinit(void *priv)
d64dabee
JM
39{
40 struct none_driver_data *drv = priv;
41
42 os_free(drv);
43}
44
45
a3c6598f
JM
46static void * none_driver_init(void *ctx, const char *ifname)
47{
48 struct none_driver_data *drv;
49
50 drv = os_zalloc(sizeof(struct none_driver_data));
51 if (drv == NULL) {
52 wpa_printf(MSG_ERROR, "Could not allocate memory for none "
53 "driver data");
54 return NULL;
55 }
56 drv->ctx = ctx;
57
58 return drv;
59}
60
61
62static void none_driver_deinit(void *priv)
63{
64 struct none_driver_data *drv = priv;
65
66 os_free(drv);
67}
68
69
c5121837 70const struct wpa_driver_ops wpa_driver_none_ops = {
d64dabee 71 .name = "none",
a3c6598f
JM
72 .desc = "no driver (RADIUS server/WPS ER)",
73 .hapd_init = none_driver_hapd_init,
74 .hapd_deinit = none_driver_hapd_deinit,
a3c6598f
JM
75 .init = none_driver_init,
76 .deinit = none_driver_deinit,
d64dabee 77};