Remove unused tsinfo()
[wpasupplicant] / hostapd / wme.h
1 /*
2  * hostapd / WMM (Wi-Fi Multimedia)
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 WME_H
17 #define WME_H
18
19 #ifdef __linux__
20 #include <endian.h>
21 #endif /* __linux__ */
22
23 #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__DragonFly__)
24 #include <sys/types.h>
25 #include <sys/endian.h>
26 #endif /* defined(__FreeBSD__) || defined(__NetBSD__) ||
27         * defined(__DragonFly__) */
28
29
30 struct wme_information_element {
31         /* required fields for WME version 1 */
32         u8 oui[3];
33         u8 oui_type;
34         u8 oui_subtype;
35         u8 version;
36         u8 acInfo;
37
38 } __attribute__ ((packed));
39
40 struct wme_ac_parameter {
41 #if __BYTE_ORDER == __LITTLE_ENDIAN
42         /* byte 1 */
43         u8      aifsn:4,
44                 acm:1,
45                 aci:2,
46                 reserved:1;
47
48         /* byte 2 */
49         u8      eCWmin:4,
50                 eCWmax:4;
51 #elif __BYTE_ORDER == __BIG_ENDIAN
52         /* byte 1 */
53         u8      reserved:1,
54                 aci:2,
55                 acm:1,
56                 aifsn:4;
57
58         /* byte 2 */
59         u8      eCWmax:4,
60                 eCWmin:4;
61 #else
62 #error  "Please fix <endian.h>"
63 #endif
64
65         /* bytes 3 & 4 */
66         le16 txopLimit;
67 } __attribute__ ((packed));
68
69 struct wme_parameter_element {
70         /* required fields for WME version 1 */
71         u8 oui[3];
72         u8 oui_type;
73         u8 oui_subtype;
74         u8 version;
75         u8 acInfo;
76         u8 reserved;
77         struct wme_ac_parameter ac[4];
78
79 } __attribute__ ((packed));
80
81 struct wme_tspec_info_element {
82         u8 eid;
83         u8 length;
84         u8 oui[3];
85         u8 oui_type;
86         u8 oui_subtype;
87         u8 version;
88         u16 ts_info;
89         u16 nominal_msdu_size;
90         u16 maximum_msdu_size;
91         u32 minimum_service_interval;
92         u32 maximum_service_interval;
93         u32 inactivity_interval;
94         u32 start_time;
95         u32 minimum_data_rate;
96         u32 mean_data_rate;
97         u32 maximum_burst_size;
98         u32 minimum_phy_rate;
99         u32 peak_data_rate;
100         u32 delay_bound;
101         u16 surplus_bandwidth_allowance;
102         u16 medium_time;
103 } __attribute__ ((packed));
104
105
106 /* Access Categories */
107 enum {
108         WME_AC_BK = 1,
109         WME_AC_BE = 0,
110         WME_AC_VI = 2,
111         WME_AC_VO = 3
112 };
113
114 struct ieee80211_mgmt;
115
116 u8 * hostapd_eid_wme(struct hostapd_data *hapd, u8 *eid);
117 int hostapd_eid_wme_valid(struct hostapd_data *hapd, u8 *eid, size_t len);
118 #ifdef NEED_MLME
119 int hostapd_wme_sta_config(struct hostapd_data *hapd, struct sta_info *sta);
120 #else /* NEED_MLME */
121 static inline int hostapd_wme_sta_config(struct hostapd_data *hapd,
122                                          struct sta_info *sta)
123 {
124         return 0;
125 }
126 #endif /* NEED_MLME */
127 void hostapd_wme_action(struct hostapd_data *hapd, struct ieee80211_mgmt *mgmt,
128                         size_t len);
129
130 #endif /* WME_H */