2 * hostapd / WMM (Wi-Fi Multimedia)
3 * Copyright 2002-2003, Instant802 Networks, Inc.
4 * Copyright 2005-2006, Devicescape Software, Inc.
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.
10 * Alternatively, this software may be distributed under the terms of BSD
13 * See README and COPYING for more details.
21 #endif /* __linux__ */
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__) */
31 * WMM Information Element (used in (Re)Association Request frames; may also be
32 * used in Beacon frames)
34 struct wmm_information_element {
35 /* Element ID: 221 (0xdd); Length: 7 */
36 /* required fields for WMM version 1 */
37 u8 oui[3]; /* 00:50:f2 */
39 u8 oui_subtype; /* 0 */
40 u8 version; /* 1 for WMM version 1.0 */
41 u8 qos_info; /* AP/STA specific QoS info */
43 } __attribute__ ((packed));
45 struct wmm_ac_parameter {
46 #if __BYTE_ORDER == __LITTLE_ENDIAN
47 /* byte 1: ACI/AIFSN */
53 /* byte 2: ECWmin/ECWmax (CW = 2^ECW - 1) */
56 #elif __BYTE_ORDER == __BIG_ENDIAN
57 /* byte 1: ACI/AIFSN */
63 /* byte 2: ECWmin/ECWmax */
67 #error "Please fix <endian.h>"
72 } __attribute__ ((packed));
75 * WMM Parameter Element (used in Beacon, Probe Response, and (Re)Association
78 struct wmm_parameter_element {
79 /* Element ID: 221 (0xdd); Length: 24 */
80 /* required fields for WMM version 1 */
81 u8 oui[3]; /* 00:50:f2 */
83 u8 oui_subtype; /* 1 */
84 u8 version; /* 1 for WMM version 1.0 */
85 u8 qos_info; /* AP/STA specif QoS info */
87 struct wmm_ac_parameter ac[4]; /* AC_BE, AC_BK, AC_VI, AC_VO */
89 } __attribute__ ((packed));
91 /* WMM TSPEC Element */
92 struct wmm_tspec_element {
93 u8 eid; /* 221 = 0xdd */
94 u8 length; /* 6 + 55 = 61 */
95 u8 oui[3]; /* 00:50:f2 */
97 u8 oui_subtype; /* 2 */
99 /* WMM TSPEC body (55 octets): */
101 le16 nominal_msdu_size;
102 le16 maximum_msdu_size;
103 le32 minimum_service_interval;
104 le32 maximum_service_interval;
105 le32 inactivity_interval;
106 le32 suspension_interval;
107 le32 service_start_time;
108 le32 minimum_data_rate;
111 le32 maximum_burst_size;
113 le32 minimum_phy_rate;
114 le16 surplus_bandwidth_allowance;
116 } __attribute__ ((packed));
119 /* Access Categories / ACI to AC coding */
121 WMM_AC_BE = 0 /* Best Effort */,
122 WMM_AC_BK = 1 /* Background */,
123 WMM_AC_VI = 2 /* Video */,
124 WMM_AC_VO = 3 /* Voice */
127 struct ieee80211_mgmt;
129 u8 * hostapd_eid_wmm(struct hostapd_data *hapd, u8 *eid);
130 int hostapd_eid_wmm_valid(struct hostapd_data *hapd, u8 *eid, size_t len);
132 int hostapd_wmm_sta_config(struct hostapd_data *hapd, struct sta_info *sta);
133 #else /* NEED_MLME */
134 static inline int hostapd_wmm_sta_config(struct hostapd_data *hapd,
135 struct sta_info *sta)
139 #endif /* NEED_MLME */
140 void hostapd_wmm_action(struct hostapd_data *hapd, struct ieee80211_mgmt *mgmt,