Merge commit 'garage/master'
[wpasupplicant] / src / drivers / driver_none.c
1 /*
2  * hostapd / Driver interface for RADIUS server only (no driver)
3  * Copyright (c) 2008, Atheros Communications
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation.
8  *
9  * Alternatively, this software may be distributed under the terms of BSD
10  * license.
11  *
12  * See README and COPYING for more details.
13  */
14
15 #include "includes.h"
16
17 #include "../hostapd/hostapd.h"
18 #include "driver.h"
19
20
21 struct none_driver_data {
22         struct hostapd_data *hapd;
23 };
24
25
26 static void * none_driver_init(struct hostapd_data *hapd,
27                                struct wpa_init_params *params)
28 {
29         struct none_driver_data *drv;
30
31         drv = os_zalloc(sizeof(struct none_driver_data));
32         if (drv == NULL) {
33                 wpa_printf(MSG_ERROR, "Could not allocate memory for none "
34                            "driver data");
35                 return NULL;
36         }
37         drv->hapd = hapd;
38
39         return drv;
40 }
41
42
43 static void none_driver_deinit(void *priv)
44 {
45         struct none_driver_data *drv = priv;
46
47         os_free(drv);
48 }
49
50
51 static int none_driver_send_ether(void *priv, const u8 *dst, const u8 *src,
52                                   u16 proto, const u8 *data, size_t data_len)
53 {
54         return 0;
55 }
56
57
58 const struct wpa_driver_ops wpa_driver_none_ops = {
59         .name = "none",
60         .hapd_init = none_driver_init,
61         .hapd_deinit = none_driver_deinit,
62         .send_ether = none_driver_send_ether,
63 };