libiwinfo: probe for vap availability in mbssid_support(), fix return type, fix descr...
[project/luci.git] / contrib / package / iwinfo / src / include / madwifi.h
1 /*
2  * Header bits derived from MadWifi source:
3  *   Copyright (c) 2001 Atsushi Onoe
4  *   Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
5  *   All rights reserved.
6  *
7  * Distributed under the terms of the GPLv2 license.
8  *
9  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
10  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
11  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
12  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
13  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
14  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
15  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
16  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
17  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
18  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
19  */
20
21 #ifndef _MADWIFI_H
22 #define _MADWIFI_H
23
24 /* ieee80211.h */
25 #define IEEE80211_ADDR_LEN              6
26 #define IEEE80211_RATE_VAL              0x7f
27
28
29 /* ieee80211_crypto.h */
30 #define IEEE80211_KEYBUF_SIZE           16
31 #define IEEE80211_MICBUF_SIZE           16
32 #define IEEE80211_TID_SIZE                      17
33
34 #define IEEE80211_CIPHER_WEP            0
35 #define IEEE80211_CIPHER_TKIP           1
36 #define IEEE80211_CIPHER_AES_OCB        2
37 #define IEEE80211_CIPHER_AES_CCM        3
38 #define IEEE80211_CIPHER_CKIP           5
39 #define IEEE80211_CIPHER_NONE           6
40 #define IEEE80211_CIPHER_MAX            (IEEE80211_CIPHER_NONE + 1)
41
42
43 /* ieee80211_ioctl.h */
44 #define IEEE80211_KEY_DEFAULT           0x80
45 #define IEEE80211_CHAN_MAX                      255
46 #define IEEE80211_CHAN_BYTES            32
47 #define IEEE80211_RATE_MAXSIZE          15
48
49 #define IEEE80211_IOCTL_GETKEY          (SIOCDEVPRIVATE+3)
50 #define IEEE80211_IOCTL_STA_STATS       (SIOCDEVPRIVATE+5)
51 #define IEEE80211_IOCTL_STA_INFO        (SIOCDEVPRIVATE+6)
52
53 #define IEEE80211_IOCTL_GETPARAM        (SIOCIWFIRSTPRIV+1)
54 #define IEEE80211_IOCTL_GETMODE         (SIOCIWFIRSTPRIV+3)
55 #define IEEE80211_IOCTL_GETCHANLIST     (SIOCIWFIRSTPRIV+7)
56 #define IEEE80211_IOCTL_GETCHANINFO     (SIOCIWFIRSTPRIV+13)
57
58 enum {
59         IEEE80211_PARAM_AUTHMODE                = 3,    /* authentication mode */
60         IEEE80211_PARAM_MCASTCIPHER             = 5,    /* multicast/default cipher */
61         IEEE80211_PARAM_MCASTKEYLEN             = 6,    /* multicast key length */
62         IEEE80211_PARAM_UCASTCIPHERS    = 7,    /* unicast cipher suites */
63         IEEE80211_PARAM_WPA                             = 10,   /* WPA mode (0,1,2) */
64 };
65
66 /*
67  * Authentication mode.
68  */
69 enum ieee80211_authmode {
70         IEEE80211_AUTH_NONE     = 0,
71         IEEE80211_AUTH_OPEN     = 1,    /* open */
72         IEEE80211_AUTH_SHARED   = 2,    /* shared-key */
73         IEEE80211_AUTH_8021X    = 3,    /* 802.1x */
74         IEEE80211_AUTH_AUTO     = 4,    /* auto-select/accept */
75         /* NB: these are used only for ioctls */
76         IEEE80211_AUTH_WPA      = 5,    /* WPA/RSN w/ 802.1x/PSK */
77 };
78
79 struct ieee80211_channel {
80         u_int16_t ic_freq;      /* setting in MHz */
81         u_int16_t ic_flags;     /* see below */
82         u_int8_t ic_ieee;       /* IEEE channel number */
83         int8_t ic_maxregpower;  /* maximum regulatory tx power in dBm */
84         int8_t ic_maxpower;     /* maximum tx power in dBm */
85         int8_t ic_minpower;     /* minimum tx power in dBm */
86         u_int8_t ic_scanflags;
87         u_int8_t ic_idletime; /* phy idle time in % */
88 };
89
90 struct ieee80211req_key {
91         u_int8_t ik_type;               /* key/cipher type */
92         u_int8_t ik_pad;
93         u_int16_t ik_keyix;     /* key index */
94         u_int8_t ik_keylen;             /* key length in bytes */
95         u_int8_t ik_flags;
96         u_int8_t ik_macaddr[IEEE80211_ADDR_LEN];
97         u_int64_t ik_keyrsc;            /* key receive sequence counter */
98         u_int64_t ik_keytsc;            /* key transmit sequence counter */
99         u_int8_t ik_keydata[IEEE80211_KEYBUF_SIZE+IEEE80211_MICBUF_SIZE];
100 };
101
102 struct ieee80211req_chanlist {
103         u_int8_t ic_channels[IEEE80211_CHAN_BYTES];
104 };
105
106 struct ieee80211req_chaninfo {
107         u_int ic_nchans;
108         struct ieee80211_channel ic_chans[IEEE80211_CHAN_MAX];
109 };
110
111 struct ieee80211req_sta_info {
112         u_int16_t isi_len;              /* length (mult of 4) */
113         u_int16_t isi_freq;             /* MHz */
114         u_int16_t isi_flags;            /* channel flags */
115         u_int16_t isi_state;            /* state flags */
116         u_int8_t isi_authmode;          /* authentication algorithm */
117         u_int8_t isi_rssi;
118         int8_t isi_noise;
119         u_int16_t isi_capinfo;          /* capabilities */
120         u_int8_t isi_athflags;          /* Atheros capabilities */
121         u_int8_t isi_erp;               /* ERP element */
122         u_int8_t isi_macaddr[IEEE80211_ADDR_LEN];
123         u_int8_t isi_nrates;            /* negotiated rates */
124         u_int8_t isi_rates[IEEE80211_RATE_MAXSIZE];
125         u_int8_t isi_txrate;            /* index to isi_rates[] */
126         u_int16_t isi_ie_len;           /* IE length */
127         u_int16_t isi_associd;          /* assoc response */
128         u_int16_t isi_txpower;          /* current tx power */
129         u_int16_t isi_vlan;             /* vlan tag */
130         u_int16_t isi_txseqs[17];       /* seq to be transmitted */
131         u_int16_t isi_rxseqs[17];       /* seq previous for qos frames*/
132         u_int16_t isi_inact;            /* inactivity timer */
133         u_int8_t isi_uapsd;             /* UAPSD queues */
134         u_int8_t isi_opmode;            /* sta operating mode */
135 };
136
137 #endif