2 * Host AP (software wireless LAN access point) user space daemon for
3 * Host AP kernel driver / Driver interface for development testing
4 * Copyright (c) 2004, Jouni Malinen <jkmaline@cc.hut.fi>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
10 * Alternatively, this software may be distributed under the terms of BSD
13 * See README and COPYING for more details.
21 #include <sys/ioctl.h>
22 #include <netinet/in.h>
24 #include <sys/types.h>
25 #include <sys/socket.h>
31 struct test_driver_data {
32 struct driver_ops ops;
33 struct hostapd_data *hapd;
36 static const struct driver_ops test_driver_ops;
39 static int test_driver_init(struct hostapd_data *hapd)
41 struct test_driver_data *drv;
43 drv = malloc(sizeof(struct test_driver_data));
45 printf("Could not allocate memory for test driver data\n");
49 memset(drv, 0, sizeof(*drv));
50 drv->ops = test_driver_ops;
53 hapd->driver = &drv->ops;
58 static void test_driver_deinit(void *priv)
60 struct test_driver_data *drv = priv;
62 drv->hapd->driver = NULL;
68 static const struct driver_ops test_driver_ops = {
70 .init = test_driver_init,
71 .deinit = test_driver_deinit,
75 void test_driver_register(void)
77 driver_register(test_driver_ops.name, &test_driver_ops);