aboutsummaryrefslogtreecommitdiffstats
path: root/hostapd/ieee802_11h.c
diff options
context:
space:
mode:
Diffstat (limited to 'hostapd/ieee802_11h.c')
-rw-r--r--hostapd/ieee802_11h.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/hostapd/ieee802_11h.c b/hostapd/ieee802_11h.c
new file mode 100644
index 0000000..0229dca
--- /dev/null
+++ b/hostapd/ieee802_11h.c
@@ -0,0 +1,33 @@
+/*
+ * hostapd / IEEE 802.11h
+ * Copyright (c) 2005-2006, Devicescape Software, Inc.
+ * Copyright (c) 2007, 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.
+ */
+
+#include "includes.h"
+
+#include "hostapd.h"
+
+
+int hostapd_check_power_cap(struct hostapd_data *hapd, u8 *power, u8 len)
+{
+ unsigned int max_pwr;
+
+ if (len < 2) {
+ wpa_printf(MSG_DEBUG, "Too short power capability IE");
+ return -1;
+ }
+ max_pwr = power[1];
+ if (max_pwr > hapd->iface->sta_max_power)
+ return -1;
+ return 0;
+}