hostapd: remove version tag from directory
[dragonfly.git] / contrib / hostapd / ieee802_11h.c
1 /*
2  * hostapd / IEEE 802.11h
3  * Copyright (c) 2005-2006, Devicescape Software, Inc.
4  * Copyright (c) 2007, Jouni Malinen <j@w1.fi>
5  *
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.
9  *
10  * Alternatively, this software may be distributed under the terms of BSD
11  * license.
12  *
13  * See README and COPYING for more details.
14  */
15
16 #include "includes.h"
17
18 #include "hostapd.h"
19
20
21 int hostapd_check_power_cap(struct hostapd_data *hapd, u8 *power, u8 len)
22 {
23         unsigned int max_pwr;
24
25         if (len < 2) {
26                 HOSTAPD_DEBUG(HOSTAPD_DEBUG_MINIMAL,
27                               "Too short power capability IE\n");
28                 return -1;
29         }
30         max_pwr = power[1];
31         if (max_pwr > hapd->iface->sta_max_power)
32                 return -1;
33         return 0;
34 }