udp: Merge udp_send and udp_output
[dragonfly.git] / contrib / hostapd / hostapd / hw_features.h
1 /*
2  * hostapd / Hardware feature query and different modes
3  * Copyright 2002-2003, Instant802 Networks, Inc.
4  * Copyright 2005-2006, Devicescape Software, Inc.
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 #ifndef HW_FEATURES_H
17 #define HW_FEATURES_H
18
19 #define HOSTAPD_CHAN_DISABLED 0x00000001
20 #define HOSTAPD_CHAN_PASSIVE_SCAN 0x00000002
21 #define HOSTAPD_CHAN_NO_IBSS 0x00000004
22 #define HOSTAPD_CHAN_RADAR 0x00000008
23
24 struct hostapd_channel_data {
25         short chan; /* channel number (IEEE 802.11) */
26         short freq; /* frequency in MHz */
27         int flag; /* flag for hostapd use (HOSTAPD_CHAN_*) */
28         u8 max_tx_power; /* maximum transmit power in dBm */
29 };
30
31 #define HOSTAPD_RATE_ERP 0x00000001
32 #define HOSTAPD_RATE_BASIC 0x00000002
33 #define HOSTAPD_RATE_PREAMBLE2 0x00000004
34 #define HOSTAPD_RATE_SUPPORTED 0x00000010
35 #define HOSTAPD_RATE_OFDM 0x00000020
36 #define HOSTAPD_RATE_CCK 0x00000040
37 #define HOSTAPD_RATE_MANDATORY 0x00000100
38
39 struct hostapd_rate_data {
40         int rate; /* rate in 100 kbps */
41         int flags; /* HOSTAPD_RATE_ flags */
42 };
43
44 struct hostapd_hw_modes {
45         int mode;
46         int num_channels;
47         struct hostapd_channel_data *channels;
48         int num_rates;
49         struct hostapd_rate_data *rates;
50         u16 ht_capab;
51 };
52
53
54 void hostapd_free_hw_features(struct hostapd_hw_modes *hw_features,
55                               size_t num_hw_features);
56 int hostapd_get_hw_features(struct hostapd_iface *iface);
57 int hostapd_select_hw_mode(struct hostapd_iface *iface);
58 const char * hostapd_hw_mode_txt(int mode);
59 int hostapd_hw_get_freq(struct hostapd_data *hapd, int chan);
60 int hostapd_hw_get_channel(struct hostapd_data *hapd, int freq);
61
62 #endif /* HW_FEATURES_H */