aboutsummaryrefslogtreecommitdiffstats
path: root/src/drivers/rfkill.h
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2010-05-23 07:27:32 (GMT)
committerJouni Malinen <j@w1.fi>2010-05-23 07:27:32 (GMT)
commit8401a6b028c464a427654496b7b4a4cfb4ab8492 (patch)
tree2a58f83fd3564e81314b8620debcea376e7585c9 /src/drivers/rfkill.h
parent6deb41e73f74270656150e70cf6323276dd54f14 (diff)
downloadhostap-8401a6b028c464a427654496b7b4a4cfb4ab8492.zip
hostap-8401a6b028c464a427654496b7b4a4cfb4ab8492.tar.gz
hostap-8401a6b028c464a427654496b7b4a4cfb4ab8492.tar.bz2
Add Linux rfkill support
Add a new wpa_supplicant state: interface disabled. This can be used to allow wpa_supplicant to be running with the network interface even when the driver does not actually allow any radio operations (e.g., due to rfkill). Allow driver_nl80211.c and driver_wext.c to start while rfkill is in blocked state (i.e., when ifconfig up fails) and process rfkill events to block/unblock WLAN.
Diffstat (limited to 'src/drivers/rfkill.h')
-rw-r--r--src/drivers/rfkill.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/drivers/rfkill.h b/src/drivers/rfkill.h
new file mode 100644
index 0000000..7a984a6
--- /dev/null
+++ b/src/drivers/rfkill.h
@@ -0,0 +1,31 @@
+/*
+ * Linux rfkill helper functions for driver wrappers
+ * Copyright (c) 2010, Jouni Malinen <j@w1.fi>
+ *
+ * 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.
+ */
+
+#ifndef RFKILL_H
+#define RFKILL_H
+
+struct rfkill_data;
+
+struct rfkill_config {
+ void *ctx;
+ char ifname[IFNAMSIZ];
+ void (*blocked_cb)(void *ctx);
+ void (*unblocked_cb)(void *ctx);
+};
+
+struct rfkill_data * rfkill_init(struct rfkill_config *cfg);
+void rfkill_deinit(struct rfkill_data *rfkill);
+int rfkill_is_blocked(struct rfkill_data *rfkill);
+
+#endif /* RFKILL_H */