aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <jouni.malinen@atheros.com>2009-03-04 10:33:24 (GMT)
committerJouni Malinen <j@w1.fi>2009-11-22 09:33:18 (GMT)
commit8e2a2b9e9accb1664cb91569d65153fc900447c9 (patch)
treeeaf0a12168fa5f9f167b6fba9c93ab1bba21a489
parent0bc2099c50440ba8b1ea19f19472d7936f2754ec (diff)
downloadhostap-06-8e2a2b9e9accb1664cb91569d65153fc900447c9.zip
hostap-06-8e2a2b9e9accb1664cb91569d65153fc900447c9.tar.gz
hostap-06-8e2a2b9e9accb1664cb91569d65153fc900447c9.tar.bz2
WMM cleanup (WME -> WMM rename, comments, etc.)
This updates the terminogy to match with the final WMM specification. In addition, some of the WMM TSPEC structure fields were in incorrect order and used without byte order swapping. Those are also taken care of this cleanup patch. This is a manual merge of the 3ae0800c5f24e1b62c0e66be9fd487a051a37c62 parts that were not brought in as part of 0fa9694a141be19643936462ce679d82b58dfdda.
-rw-r--r--hostapd/ap.h2
-rw-r--r--hostapd/beacon.c8
-rw-r--r--hostapd/config.c44
-rw-r--r--hostapd/config.h10
-rw-r--r--hostapd/driver_nl80211.c2
-rw-r--r--hostapd/hostapd.c6
-rw-r--r--hostapd/hostapd.conf43
-rw-r--r--hostapd/ieee802_11.c16
-rw-r--r--hostapd/wme.c173
-rw-r--r--hostapd/wme.h93
-rw-r--r--hostapd/wpa.h2
-rw-r--r--hostapd/wpa_auth_ie.c4
-rw-r--r--src/common/ieee802_11_common.c27
-rw-r--r--src/common/ieee802_11_common.h8
-rw-r--r--src/common/ieee802_11_defs.h42
15 files changed, 253 insertions, 227 deletions
diff --git a/hostapd/ap.h b/hostapd/ap.h
index 98f8ee7..2c6d7e9 100644
--- a/hostapd/ap.h
+++ b/hostapd/ap.h
@@ -30,7 +30,7 @@
#define WLAN_STA_PENDING_POLL BIT(6) /* pending activity poll not ACKed */
#define WLAN_STA_SHORT_PREAMBLE BIT(7)
#define WLAN_STA_PREAUTH BIT(8)
-#define WLAN_STA_WME BIT(9)
+#define WLAN_STA_WMM BIT(9)
#define WLAN_STA_MFP BIT(10)
#define WLAN_STA_HT BIT(11)
#define WLAN_STA_WPS BIT(12)
diff --git a/hostapd/beacon.c b/hostapd/beacon.c
index 31323e8..1f82d9c 100644
--- a/hostapd/beacon.c
+++ b/hostapd/beacon.c
@@ -298,8 +298,8 @@ void handle_probe_req(struct hostapd_data *hapd, struct ieee80211_mgmt *mgmt,
pos = hostapd_eid_wpa(hapd, pos, epos - pos, sta);
- /* Wi-Fi Wireless Multimedia Extensions */
- pos = hostapd_eid_wme(hapd, pos);
+ /* Wi-Fi Alliance WMM */
+ pos = hostapd_eid_wmm(hapd, pos);
pos = hostapd_eid_ht_capabilities_info(hapd, pos);
pos = hostapd_eid_ht_operation(hapd, pos);
@@ -395,8 +395,8 @@ void ieee802_11_set_beacon(struct hostapd_data *hapd)
tailpos = hostapd_eid_wpa(hapd, tailpos, tail + BEACON_TAIL_BUF_SIZE -
tailpos, NULL);
- /* Wi-Fi Wireless Multimedia Extensions */
- tailpos = hostapd_eid_wme(hapd, tailpos);
+ /* Wi-Fi Alliance WMM */
+ tailpos = hostapd_eid_wmm(hapd, tailpos);
#ifdef CONFIG_IEEE80211N
if (hapd->iconf->ieee80211n) {
diff --git a/hostapd/config.c b/hostapd/config.c
index 24adc68..35bf17a 100644
--- a/hostapd/config.c
+++ b/hostapd/config.c
@@ -202,13 +202,13 @@ static struct hostapd_config * hostapd_config_defaults(void)
struct hostapd_bss_config *bss;
int i;
const int aCWmin = 15, aCWmax = 1024;
- const struct hostapd_wme_ac_params ac_bk =
+ const struct hostapd_wmm_ac_params ac_bk =
{ aCWmin, aCWmax, 7, 0, 0 }; /* background traffic */
- const struct hostapd_wme_ac_params ac_be =
+ const struct hostapd_wmm_ac_params ac_be =
{ aCWmin, aCWmax, 3, 0, 0 }; /* best effort traffic */
- const struct hostapd_wme_ac_params ac_vi = /* video traffic */
+ const struct hostapd_wmm_ac_params ac_vi = /* video traffic */
{ aCWmin >> 1, aCWmin, 2, 3000 / 32, 1 };
- const struct hostapd_wme_ac_params ac_vo = /* voice traffic */
+ const struct hostapd_wmm_ac_params ac_vo = /* voice traffic */
{ aCWmin >> 2, aCWmin >> 1, 2, 1500 / 32, 1 };
conf = os_zalloc(sizeof(*conf));
@@ -251,10 +251,10 @@ static struct hostapd_config * hostapd_config_defaults(void)
for (i = 0; i < NUM_TX_QUEUES; i++)
conf->tx_queue[i].aifs = -1; /* use hw default */
- conf->wme_ac_params[0] = ac_be;
- conf->wme_ac_params[1] = ac_bk;
- conf->wme_ac_params[2] = ac_vi;
- conf->wme_ac_params[3] = ac_vo;
+ conf->wmm_ac_params[0] = ac_be;
+ conf->wmm_ac_params[1] = ac_bk;
+ conf->wmm_ac_params[2] = ac_vi;
+ conf->wmm_ac_params[3] = ac_vo;
#ifdef CONFIG_IEEE80211N
conf->ht_capab = HT_CAP_INFO_SMPS_DISABLED;
@@ -1166,14 +1166,14 @@ static int hostapd_config_tx_queue(struct hostapd_config *conf, char *name,
}
-static int hostapd_config_wme_ac(struct hostapd_config *conf, char *name,
- char *val)
+static int hostapd_config_wmm_ac(struct hostapd_config *conf, char *name,
+ char *val)
{
int num, v;
char *pos;
- struct hostapd_wme_ac_params *ac;
+ struct hostapd_wmm_ac_params *ac;
- /* skip 'wme_ac_' prefix */
+ /* skip 'wme_ac_' or 'wmm_ac_' prefix */
pos = name + 7;
if (os_strncmp(pos, "be_", 3) == 0) {
num = 0;
@@ -1188,11 +1188,11 @@ static int hostapd_config_wme_ac(struct hostapd_config *conf, char *name,
num = 3;
pos += 3;
} else {
- wpa_printf(MSG_ERROR, "Unknown wme name '%s'", pos);
+ wpa_printf(MSG_ERROR, "Unknown WMM name '%s'", pos);
return -1;
}
- ac = &conf->wme_ac_params[num];
+ ac = &conf->wmm_ac_params[num];
if (os_strcmp(pos, "aifs") == 0) {
v = atoi(val);
@@ -1221,7 +1221,7 @@ static int hostapd_config_wme_ac(struct hostapd_config *conf, char *name,
wpa_printf(MSG_ERROR, "Invalid txop value %d", v);
return -1;
}
- ac->txopLimit = v;
+ ac->txop_limit = v;
} else if (os_strcmp(pos, "acm") == 0) {
v = atoi(val);
if (v < 0 || v > 1) {
@@ -1230,7 +1230,7 @@ static int hostapd_config_wme_ac(struct hostapd_config *conf, char *name,
}
ac->admission_control_mandatory = v;
} else {
- wpa_printf(MSG_ERROR, "Unknown wme_ac_ field '%s'", pos);
+ wpa_printf(MSG_ERROR, "Unknown wmm_ac_ field '%s'", pos);
return -1;
}
@@ -2070,11 +2070,13 @@ struct hostapd_config * hostapd_config_read(const char *fname)
"queue item", line);
errors++;
}
- } else if (os_strcmp(buf, "wme_enabled") == 0) {
- bss->wme_enabled = atoi(pos);
- } else if (os_strncmp(buf, "wme_ac_", 7) == 0) {
- if (hostapd_config_wme_ac(conf, buf, pos)) {
- wpa_printf(MSG_ERROR, "Line %d: invalid wme "
+ } else if (os_strcmp(buf, "wme_enabled") == 0 ||
+ os_strcmp(buf, "wmm_enabled") == 0) {
+ bss->wmm_enabled = atoi(pos);
+ } else if (os_strncmp(buf, "wme_ac_", 7) == 0 ||
+ os_strncmp(buf, "wmm_ac_", 7) == 0) {
+ if (hostapd_config_wmm_ac(conf, buf, pos)) {
+ wpa_printf(MSG_ERROR, "Line %d: invalid WMM "
"ac item", line);
errors++;
}
diff --git a/hostapd/config.h b/hostapd/config.h
index a3247f2..ea530d4 100644
--- a/hostapd/config.h
+++ b/hostapd/config.h
@@ -135,11 +135,11 @@ struct hostapd_tx_queue_params {
int configured;
};
-struct hostapd_wme_ac_params {
+struct hostapd_wmm_ac_params {
int cwmin;
int cwmax;
int aifs;
- int txopLimit; /* in units of 32us */
+ int txop_limit; /* in units of 32us */
int admission_control_mandatory;
};
@@ -271,7 +271,7 @@ struct hostapd_bss_config {
int ap_max_inactivity;
int ignore_broadcast_ssid;
- int wme_enabled;
+ int wmm_enabled;
struct hostapd_vlan *vlan, *vlan_tail;
@@ -371,13 +371,13 @@ struct hostapd_config {
struct hostapd_tx_queue_params tx_queue[NUM_TX_QUEUES];
/*
- * WME AC parameters, in same order as 802.1D, i.e.
+ * WMM AC parameters, in same order as 802.1D, i.e.
* 0 = BE (best effort)
* 1 = BK (background)
* 2 = VI (video)
* 3 = VO (voice)
*/
- struct hostapd_wme_ac_params wme_ac_params[4];
+ struct hostapd_wmm_ac_params wmm_ac_params[4];
enum {
INTERNAL_BRIDGE_DO_NOT_CONTROL = -1,
diff --git a/hostapd/driver_nl80211.c b/hostapd/driver_nl80211.c
index 2f386ec..4599e99 100644
--- a/hostapd/driver_nl80211.c
+++ b/hostapd/driver_nl80211.c
@@ -908,7 +908,7 @@ static int i802_sta_set_flags(void *priv, const u8 *addr,
if (total_flags & WLAN_STA_AUTHORIZED || !drv->ieee802_1x_active)
NLA_PUT_FLAG(flags, NL80211_STA_FLAG_AUTHORIZED);
- if (total_flags & WLAN_STA_WME)
+ if (total_flags & WLAN_STA_WMM)
NLA_PUT_FLAG(flags, NL80211_STA_FLAG_WME);
if (total_flags & WLAN_STA_SHORT_PREAMBLE)
diff --git a/hostapd/hostapd.c b/hostapd/hostapd.c
index 2696bd6..e8a792e 100644
--- a/hostapd/hostapd.c
+++ b/hostapd/hostapd.c
@@ -249,7 +249,7 @@ void hostapd_new_assoc_sta(struct hostapd_data *hapd, struct sta_info *sta,
if (!hapd->conf->ieee802_1x && !hapd->conf->wpa)
accounting_sta_start(hapd, sta);
- hostapd_wme_sta_config(hapd, sta);
+ hostapd_wmm_sta_config(hapd, sta);
/* Start IEEE 802.1X authentication process for new stations */
ieee802_1x_new_station(hapd, sta);
@@ -306,7 +306,7 @@ static void hostapd_wpa_auth_conf(struct hostapd_bss_config *conf,
wconf->rsn_preauth = conf->rsn_preauth;
wconf->eapol_version = conf->eapol_version;
wconf->peerkey = conf->peerkey;
- wconf->wme_enabled = conf->wme_enabled;
+ wconf->wmm_enabled = conf->wmm_enabled;
wconf->okc = conf->okc;
#ifdef CONFIG_IEEE80211W
wconf->ieee80211w = conf->ieee80211w;
@@ -477,7 +477,7 @@ static void hostapd_dump_state(struct hostapd_data *hapd)
(sta->flags & WLAN_STA_SHORT_PREAMBLE ?
"[SHORT_PREAMBLE]" : ""),
(sta->flags & WLAN_STA_PREAUTH ? "[PREAUTH]" : ""),
- (sta->flags & WLAN_STA_WME ? "[WME]" : ""),
+ (sta->flags & WLAN_STA_WMM ? "[WMM]" : ""),
(sta->flags & WLAN_STA_MFP ? "[MFP]" : ""),
(sta->flags & WLAN_STA_WPS ? "[WPS]" : ""),
(sta->flags & WLAN_STA_MAYBE_WPS ? "[MAYBE_WPS]" : ""),
diff --git a/hostapd/hostapd.conf b/hostapd/hostapd.conf
index b4fc63d..703b646 100644
--- a/hostapd/hostapd.conf
+++ b/hostapd/hostapd.conf
@@ -273,38 +273,38 @@ ignore_broadcast_ssid=0
# note - here cwMin and cmMax are in exponent form. the actual cw value used
# will be (2^n)-1 where n is the value given here
#
-wme_enabled=1
+wmm_enabled=1
#
# Low priority / AC_BK = background
-wme_ac_bk_cwmin=4
-wme_ac_bk_cwmax=10
-wme_ac_bk_aifs=7
-wme_ac_bk_txop_limit=0
-wme_ac_bk_acm=0
+wmm_ac_bk_cwmin=4
+wmm_ac_bk_cwmax=10
+wmm_ac_bk_aifs=7
+wmm_ac_bk_txop_limit=0
+wmm_ac_bk_acm=0
# Note: for IEEE 802.11b mode: cWmin=5 cWmax=10
#
# Normal priority / AC_BE = best effort
-wme_ac_be_aifs=3
-wme_ac_be_cwmin=4
-wme_ac_be_cwmax=10
-wme_ac_be_txop_limit=0
-wme_ac_be_acm=0
+wmm_ac_be_aifs=3
+wmm_ac_be_cwmin=4
+wmm_ac_be_cwmax=10
+wmm_ac_be_txop_limit=0
+wmm_ac_be_acm=0
# Note: for IEEE 802.11b mode: cWmin=5 cWmax=7
#
# High priority / AC_VI = video
-wme_ac_vi_aifs=2
-wme_ac_vi_cwmin=3
-wme_ac_vi_cwmax=4
-wme_ac_vi_txop_limit=94
-wme_ac_vi_acm=0
+wmm_ac_vi_aifs=2
+wmm_ac_vi_cwmin=3
+wmm_ac_vi_cwmax=4
+wmm_ac_vi_txop_limit=94
+wmm_ac_vi_acm=0
# Note: for IEEE 802.11b mode: cWmin=4 cWmax=5 txop_limit=188
#
# Highest priority / AC_VO = voice
-wme_ac_vo_aifs=2
-wme_ac_vo_cwmin=2
-wme_ac_vo_cwmax=3
-wme_ac_vo_txop_limit=47
-wme_ac_vo_acm=0
+wmm_ac_vo_aifs=2
+wmm_ac_vo_cwmin=2
+wmm_ac_vo_cwmax=3
+wmm_ac_vo_txop_limit=47
+wmm_ac_vo_acm=0
# Note: for IEEE 802.11b mode: cWmin=3 cWmax=4 burst=102
# Static WEP key configuration
@@ -375,6 +375,7 @@ wme_ac_vo_acm=0
# ieee80211n: Whether IEEE 802.11n (HT) is enabled
# 0 = disabled (default)
# 1 = enabled
+# Note: You will also need to enable WMM for full HT functionality.
#ieee80211n=1
# ht_capab: HT capabilities (list of flags)
diff --git a/hostapd/ieee802_11.c b/hostapd/ieee802_11.c
index 9869cb3..e91bddd 100644
--- a/hostapd/ieee802_11.c
+++ b/hostapd/ieee802_11.c
@@ -766,16 +766,16 @@ static void handle_assoc(struct hostapd_data *hapd,
goto fail;
}
- sta->flags &= ~WLAN_STA_WME;
- if (elems.wme && hapd->conf->wme_enabled) {
- if (hostapd_eid_wme_valid(hapd, elems.wme, elems.wme_len))
+ sta->flags &= ~WLAN_STA_WMM;
+ if (elems.wmm && hapd->conf->wmm_enabled) {
+ if (hostapd_eid_wmm_valid(hapd, elems.wmm, elems.wmm_len))
hostapd_logger(hapd, sta->addr,
HOSTAPD_MODULE_WPA,
HOSTAPD_LEVEL_DEBUG,
- "invalid WME element in association "
+ "invalid WMM element in association "
"request");
else
- sta->flags |= WLAN_STA_WME;
+ sta->flags |= WLAN_STA_WMM;
}
if (!elems.supp_rates) {
@@ -1124,8 +1124,8 @@ static void handle_assoc(struct hostapd_data *hapd,
p = hostapd_eid_supp_rates(hapd, reply->u.assoc_resp.variable);
/* Extended supported rates */
p = hostapd_eid_ext_supp_rates(hapd, p);
- if (sta->flags & WLAN_STA_WME)
- p = hostapd_eid_wme(hapd, p);
+ if (sta->flags & WLAN_STA_WMM)
+ p = hostapd_eid_wmm(hapd, p);
p = hostapd_eid_ht_capabilities_info(hapd, p);
p = hostapd_eid_ht_operation(hapd, p);
@@ -1396,7 +1396,7 @@ static void handle_action(struct hostapd_data *hapd,
}
#endif /* CONFIG_IEEE80211R */
case WLAN_ACTION_WMM:
- hostapd_wme_action(hapd, mgmt, len);
+ hostapd_wmm_action(hapd, mgmt, len);
return;
#ifdef CONFIG_IEEE80211W
case WLAN_ACTION_SA_QUERY:
diff --git a/hostapd/wme.c b/hostapd/wme.c
index 9710dd6..d178dbc 100644
--- a/hostapd/wme.c
+++ b/hostapd/wme.c
@@ -24,47 +24,50 @@
/* TODO: maintain separate sequence and fragment numbers for each AC
* TODO: IGMP snooping to track which multicasts to forward - and use QOS-DATA
- * if only WME stations are receiving a certain group */
+ * if only WMM stations are receiving a certain group */
-static u8 wme_oui[3] = { 0x00, 0x50, 0xf2 };
+static u8 wmm_oui[3] = { 0x00, 0x50, 0xf2 };
-/* Add WME Parameter Element to Beacon and Probe Response frames. */
-u8 * hostapd_eid_wme(struct hostapd_data *hapd, u8 *eid)
+/*
+ * Add WMM Parameter Element to Beacon, Probe Response, and (Re)Association
+ * Response frames.
+ */
+u8 * hostapd_eid_wmm(struct hostapd_data *hapd, u8 *eid)
{
u8 *pos = eid;
- struct wme_parameter_element *wme =
- (struct wme_parameter_element *) (pos + 2);
+ struct wmm_parameter_element *wmm =
+ (struct wmm_parameter_element *) (pos + 2);
int e;
- if (!hapd->conf->wme_enabled)
+ if (!hapd->conf->wmm_enabled)
return eid;
eid[0] = WLAN_EID_VENDOR_SPECIFIC;
- wme->oui[0] = 0x00;
- wme->oui[1] = 0x50;
- wme->oui[2] = 0xf2;
- wme->oui_type = WME_OUI_TYPE;
- wme->oui_subtype = WME_OUI_SUBTYPE_PARAMETER_ELEMENT;
- wme->version = WME_VERSION;
- wme->acInfo = hapd->parameter_set_count & 0xf;
+ wmm->oui[0] = 0x00;
+ wmm->oui[1] = 0x50;
+ wmm->oui[2] = 0xf2;
+ wmm->oui_type = WMM_OUI_TYPE;
+ wmm->oui_subtype = WMM_OUI_SUBTYPE_PARAMETER_ELEMENT;
+ wmm->version = WMM_VERSION;
+ wmm->qos_info = hapd->parameter_set_count & 0xf;
/* fill in a parameter set record for each AC */
for (e = 0; e < 4; e++) {
- struct wme_ac_parameter *ac = &wme->ac[e];
- struct hostapd_wme_ac_params *acp =
- &hapd->iconf->wme_ac_params[e];
+ struct wmm_ac_parameter *ac = &wmm->ac[e];
+ struct hostapd_wmm_ac_params *acp =
+ &hapd->iconf->wmm_ac_params[e];
ac->aifsn = acp->aifs;
ac->acm = acp->admission_control_mandatory;
ac->aci = e;
ac->reserved = 0;
- ac->eCWmin = acp->cwmin;
- ac->eCWmax = acp->cwmax;
- ac->txopLimit = host_to_le16(acp->txopLimit);
+ ac->e_cw_min = acp->cwmin;
+ ac->e_cw_max = acp->cwmax;
+ ac->txop_limit = host_to_le16(acp->txop_limit);
}
- pos = (u8 *) (wme + 1);
+ pos = (u8 *) (wmm + 1);
eid[1] = pos - eid - 2; /* element length */
return pos;
@@ -72,30 +75,30 @@ u8 * hostapd_eid_wme(struct hostapd_data *hapd, u8 *eid)
/* This function is called when a station sends an association request with
- * WME info element. The function returns zero on success or non-zero on any
- * error in WME element. eid does not include Element ID and Length octets. */
-int hostapd_eid_wme_valid(struct hostapd_data *hapd, u8 *eid, size_t len)
+ * WMM info element. The function returns zero on success or non-zero on any
+ * error in WMM element. eid does not include Element ID and Length octets. */
+int hostapd_eid_wmm_valid(struct hostapd_data *hapd, u8 *eid, size_t len)
{
- struct wme_information_element *wme;
+ struct wmm_information_element *wmm;
- wpa_hexdump(MSG_MSGDUMP, "WME IE", eid, len);
+ wpa_hexdump(MSG_MSGDUMP, "WMM IE", eid, len);
- if (len < sizeof(struct wme_information_element)) {
- wpa_printf(MSG_DEBUG, "Too short WME IE (len=%lu)",
+ if (len < sizeof(struct wmm_information_element)) {
+ wpa_printf(MSG_DEBUG, "Too short WMM IE (len=%lu)",
(unsigned long) len);
return -1;
}
- wme = (struct wme_information_element *) eid;
- wpa_printf(MSG_DEBUG, "Validating WME IE: OUI %02x:%02x:%02x "
+ wmm = (struct wmm_information_element *) eid;
+ wpa_printf(MSG_DEBUG, "Validating WMM IE: OUI %02x:%02x:%02x "
"OUI type %d OUI sub-type %d version %d",
- wme->oui[0], wme->oui[1], wme->oui[2], wme->oui_type,
- wme->oui_subtype, wme->version);
- if (os_memcmp(wme->oui, wme_oui, sizeof(wme_oui)) != 0 ||
- wme->oui_type != WME_OUI_TYPE ||
- wme->oui_subtype != WME_OUI_SUBTYPE_INFORMATION_ELEMENT ||
- wme->version != WME_VERSION) {
- wpa_printf(MSG_DEBUG, "Unsupported WME IE OUI/Type/Subtype/"
+ wmm->oui[0], wmm->oui[1], wmm->oui[2], wmm->oui_type,
+ wmm->oui_subtype, wmm->version);
+ if (os_memcmp(wmm->oui, wmm_oui, sizeof(wmm_oui)) != 0 ||
+ wmm->oui_type != WMM_OUI_TYPE ||
+ wmm->oui_subtype != WMM_OUI_SUBTYPE_INFORMATION_ELEMENT ||
+ wmm->version != WMM_VERSION) {
+ wpa_printf(MSG_DEBUG, "Unsupported WMM IE OUI/Type/Subtype/"
"Version");
return -1;
}
@@ -105,31 +108,30 @@ int hostapd_eid_wme_valid(struct hostapd_data *hapd, u8 *eid, size_t len)
/* This function is called when a station sends an ACK frame for an AssocResp
- * frame (status=success) and the matching AssocReq contained a WME element.
+ * frame (status=success) and the matching AssocReq contained a WMM element.
*/
-int hostapd_wme_sta_config(struct hostapd_data *hapd, struct sta_info *sta)
+int hostapd_wmm_sta_config(struct hostapd_data *hapd, struct sta_info *sta)
{
- /* update kernel STA data for WME related items (WLAN_STA_WPA flag) */
- if (sta->flags & WLAN_STA_WME)
+ /* update kernel STA data for WMM related items (WLAN_STA_WPA flag) */
+ if (sta->flags & WLAN_STA_WMM)
hostapd_sta_set_flags(hapd, sta->addr, sta->flags,
- WLAN_STA_WME, ~0);
+ WLAN_STA_WMM, ~0);
else
hostapd_sta_set_flags(hapd, sta->addr, sta->flags,
- 0, ~WLAN_STA_WME);
+ 0, ~WLAN_STA_WMM);
return 0;
}
-static void wme_send_action(struct hostapd_data *hapd, const u8 *addr,
- const struct wme_tspec_info_element *tspec,
+static void wmm_send_action(struct hostapd_data *hapd, const u8 *addr,
+ const struct wmm_tspec_element *tspec,
u8 action_code, u8 dialogue_token, u8 status_code)
{
u8 buf[256];
struct ieee80211_mgmt *m = (struct ieee80211_mgmt *) buf;
- struct wme_tspec_info_element *t =
- (struct wme_tspec_info_element *)
- m->u.action.u.wme_action.variable;
+ struct wmm_tspec_element *t = (struct wmm_tspec_element *)
+ m->u.action.u.wmm_action.variable;
int len;
hostapd_logger(hapd, addr, HOSTAPD_MODULE_IEEE80211,
@@ -142,20 +144,20 @@ static void wme_send_action(struct hostapd_data *hapd, const u8 *addr,
os_memcpy(m->sa, hapd->own_addr, ETH_ALEN);
os_memcpy(m->bssid, hapd->own_addr, ETH_ALEN);
m->u.action.category = WLAN_ACTION_WMM;
- m->u.action.u.wme_action.action_code = action_code;
- m->u.action.u.wme_action.dialog_token = dialogue_token;
- m->u.action.u.wme_action.status_code = status_code;
- os_memcpy(t, tspec, sizeof(struct wme_tspec_info_element));
+ m->u.action.u.wmm_action.action_code = action_code;
+ m->u.action.u.wmm_action.dialog_token = dialogue_token;
+ m->u.action.u.wmm_action.status_code = status_code;
+ os_memcpy(t, tspec, sizeof(struct wmm_tspec_element));
len = ((u8 *) (t + 1)) - buf;
if (hostapd_send_mgmt_frame(hapd, m, len, 0) < 0)
- perror("wme_send_action: send");
+ perror("wmm_send_action: send");
}
-static void wme_setup_request(struct hostapd_data *hapd,
- struct ieee80211_mgmt *mgmt,
- struct wme_tspec_info_element *tspec, size_t len)
+static void wmm_addts_req(struct hostapd_data *hapd,
+ struct ieee80211_mgmt *mgmt,
+ struct wmm_tspec_element *tspec, size_t len)
{
u8 *end = ((u8 *) mgmt) + len;
int medium_time, pps, duration;
@@ -169,7 +171,7 @@ static void wme_setup_request(struct hostapd_data *hapd,
wpa_printf(MSG_DEBUG, "WMM: ADDTS Request (Dialog Token %d) for TSPEC "
"from " MACSTR,
- mgmt->u.action.u.wme_action.dialog_token,
+ mgmt->u.action.u.wmm_action.dialog_token,
MAC2STR(mgmt->sa));
up = (tspec->ts_info[1] >> 3) & 0x07;
@@ -229,30 +231,30 @@ static void wme_setup_request(struct hostapd_data *hapd,
if (medium_time > 750000) {
wpa_printf(MSG_DEBUG, "WMM: Refuse TSPEC request for over "
"75%% of available bandwidth");
- wme_send_action(hapd, mgmt->sa, tspec,
- WME_ACTION_CODE_SETUP_RESPONSE,
- mgmt->u.action.u.wme_action.dialog_token,
- WME_SETUP_RESPONSE_STATUS_REFUSED);
+ wmm_send_action(hapd, mgmt->sa, tspec,
+ WMM_ACTION_CODE_ADDTS_RESP,
+ mgmt->u.action.u.wmm_action.dialog_token,
+ WMM_ADDTS_STATUS_REFUSED);
return;
}
/* Convert to 32 microseconds per second unit */
tspec->medium_time = host_to_le16(medium_time / 32);
- wme_send_action(hapd, mgmt->sa, tspec, WME_ACTION_CODE_SETUP_RESPONSE,
- mgmt->u.action.u.wme_action.dialog_token,
- WME_SETUP_RESPONSE_STATUS_ADMISSION_ACCEPTED);
+ wmm_send_action(hapd, mgmt->sa, tspec, WMM_ACTION_CODE_ADDTS_RESP,
+ mgmt->u.action.u.wmm_action.dialog_token,
+ WMM_ADDTS_STATUS_ADMISSION_ACCEPTED);
return;
invalid:
- wme_send_action(hapd, mgmt->sa, tspec,
- WME_ACTION_CODE_SETUP_RESPONSE,
- mgmt->u.action.u.wme_action.dialog_token,
- WME_SETUP_RESPONSE_STATUS_INVALID_PARAMETERS);
+ wmm_send_action(hapd, mgmt->sa, tspec,
+ WMM_ACTION_CODE_ADDTS_RESP,
+ mgmt->u.action.u.wmm_action.dialog_token,
+ WMM_ADDTS_STATUS_INVALID_PARAMETERS);
}
-void hostapd_wme_action(struct hostapd_data *hapd, struct ieee80211_mgmt *mgmt,
+void hostapd_wmm_action(struct hostapd_data *hapd, struct ieee80211_mgmt *mgmt,
size_t len)
{
int action_code;
@@ -263,11 +265,11 @@ void hostapd_wme_action(struct hostapd_data *hapd, struct ieee80211_mgmt *mgmt,
/* check that the request comes from a valid station */
if (!sta ||
- (sta->flags & (WLAN_STA_ASSOC | WLAN_STA_WME)) !=
- (WLAN_STA_ASSOC | WLAN_STA_WME)) {
+ (sta->flags & (WLAN_STA_ASSOC | WLAN_STA_WMM)) !=
+ (WLAN_STA_ASSOC | WLAN_STA_WMM)) {
hostapd_logger(hapd, mgmt->sa, HOSTAPD_MODULE_IEEE80211,
HOSTAPD_LEVEL_DEBUG,
- "wme action received is not from associated wme"
+ "wmm action received is not from associated wmm"
" station");
/* TODO: respond with action frame refused status code */
return;
@@ -277,19 +279,18 @@ void hostapd_wme_action(struct hostapd_data *hapd, struct ieee80211_mgmt *mgmt,
if (ieee802_11_parse_elems(pos, left, &elems, 1) == ParseFailed) {
hostapd_logger(hapd, mgmt->sa, HOSTAPD_MODULE_IEEE80211,
HOSTAPD_LEVEL_DEBUG,
- "hostapd_wme_action - could not parse wme "
+ "hostapd_wmm_action - could not parse wmm "
"action");
/* TODO: respond with action frame invalid parameters status
* code */
return;
}
- if (!elems.wme_tspec ||
- elems.wme_tspec_len != (sizeof(struct wme_tspec_info_element) - 2))
- {
+ if (!elems.wmm_tspec ||
+ elems.wmm_tspec_len != (sizeof(struct wmm_tspec_element) - 2)) {
hostapd_logger(hapd, mgmt->sa, HOSTAPD_MODULE_IEEE80211,
HOSTAPD_LEVEL_DEBUG,
- "hostapd_wme_action - missing or wrong length "
+ "hostapd_wmm_action - missing or wrong length "
"tspec");
/* TODO: respond with action frame invalid parameters status
* code */
@@ -299,26 +300,26 @@ void hostapd_wme_action(struct hostapd_data *hapd, struct ieee80211_mgmt *mgmt,
/* TODO: check the request is for an AC with ACM set, if not, refuse
* request */
- action_code = mgmt->u.action.u.wme_action.action_code;
+ action_code = mgmt->u.action.u.wmm_action.action_code;
switch (action_code) {
- case WME_ACTION_CODE_SETUP_REQUEST:
- wme_setup_request(hapd, mgmt, (struct wme_tspec_info_element *)
- elems.wme_tspec, len);
+ case WMM_ACTION_CODE_ADDTS_REQ:
+ wmm_addts_req(hapd, mgmt, (struct wmm_tspec_element *)
+ (elems.wmm_tspec - 2), len);
return;
#if 0
/* TODO: needed for client implementation */
- case WME_ACTION_CODE_SETUP_RESPONSE:
- wme_setup_request(hapd, mgmt, len);
+ case WMM_ACTION_CODE_ADDTS_RESP:
+ wmm_setup_request(hapd, mgmt, len);
return;
/* TODO: handle station teardown requests */
- case WME_ACTION_CODE_TEARDOWN:
- wme_teardown(hapd, mgmt, len);
+ case WMM_ACTION_CODE_DELTS:
+ wmm_teardown(hapd, mgmt, len);
return;
#endif
}
hostapd_logger(hapd, mgmt->sa, HOSTAPD_MODULE_IEEE80211,
HOSTAPD_LEVEL_DEBUG,
- "hostapd_wme_action - unknown action code %d",
+ "hostapd_wmm_action - unknown action code %d",
action_code);
}
diff --git a/hostapd/wme.h b/hostapd/wme.h
index d99e869..37767de 100644
--- a/hostapd/wme.h
+++ b/hostapd/wme.h
@@ -27,58 +27,69 @@
* defined(__DragonFly__) */
-struct wme_information_element {
- /* required fields for WME version 1 */
- u8 oui[3];
- u8 oui_type;
- u8 oui_subtype;
- u8 version;
- u8 acInfo;
+/*
+ * WMM Information Element (used in (Re)Association Request frames; may also be
+ * used in Beacon frames)
+ */
+struct wmm_information_element {
+ /* Element ID: 221 (0xdd); Length: 7 */
+ /* required fields for WMM version 1 */
+ u8 oui[3]; /* 00:50:f2 */
+ u8 oui_type; /* 2 */
+ u8 oui_subtype; /* 0 */
+ u8 version; /* 1 for WMM version 1.0 */
+ u8 qos_info; /* AP/STA specific QoS info */
} __attribute__ ((packed));
-struct wme_ac_parameter {
+struct wmm_ac_parameter {
#if __BYTE_ORDER == __LITTLE_ENDIAN
- /* byte 1 */
+ /* byte 1: ACI/AIFSN */
u8 aifsn:4,
acm:1,
- aci:2,
- reserved:1;
+ aci:2,
+ reserved:1;
- /* byte 2 */
- u8 eCWmin:4,
- eCWmax:4;
+ /* byte 2: ECWmin/ECWmax (CW = 2^ECW - 1) */
+ u8 e_cw_min:4,
+ e_cw_max:4;
#elif __BYTE_ORDER == __BIG_ENDIAN
- /* byte 1 */
+ /* byte 1: ACI/AIFSN */
u8 reserved:1,
- aci:2,
- acm:1,
- aifsn:4;
+ aci:2,
+ acm:1,
+ aifsn:4;
- /* byte 2 */
- u8 eCWmax:4,
- eCWmin:4;
+ /* byte 2: ECWmin/ECWmax */
+ u8 e_cw_max:4,
+ e_cw_min:4;
#else
#error "Please fix <endian.h>"
#endif
/* bytes 3 & 4 */
- le16 txopLimit;
+ le16 txop_limit;
} __attribute__ ((packed));
-struct wme_parameter_element {
- /* required fields for WME version 1 */
- u8 oui[3];
- u8 oui_type;
- u8 oui_subtype;
- u8 version;
- u8 acInfo;
- u8 reserved;
- struct wme_ac_parameter ac[4];
+/*
+ * WMM Parameter Element (used in Beacon, Probe Response, and (Re)Association
+ * Response frmaes)
+ */
+struct wmm_parameter_element {
+ /* Element ID: 221 (0xdd); Length: 24 */
+ /* required fields for WMM version 1 */
+ u8 oui[3]; /* 00:50:f2 */
+ u8 oui_type; /* 2 */
+ u8 oui_subtype; /* 1 */
+ u8 version; /* 1 for WMM version 1.0 */
+ u8 qos_info; /* AP/STA specif QoS info */
+ u8 reserved; /* 0 */
+ struct wmm_ac_parameter ac[4]; /* AC_BE, AC_BK, AC_VI, AC_VO */
} __attribute__ ((packed));
-struct wme_tspec_info_element {
+/* WMM TSPEC Element */
+struct wmm_tspec_element {
u8 eid; /* 221 = 0xdd */
u8 length; /* 6 + 55 = 61 */
u8 oui[3]; /* 00:50:f2 */
@@ -105,20 +116,20 @@ struct wme_tspec_info_element {
} __attribute__ ((packed));
-/* Access Categories */
+/* Access Categories / ACI to AC coding */
enum {
- WME_AC_BK = 1,
- WME_AC_BE = 0,
- WME_AC_VI = 2,
- WME_AC_VO = 3
+ WMM_AC_BE = 0 /* Best Effort */,
+ WMM_AC_BK = 1 /* Background */,
+ WMM_AC_VI = 2 /* Video */,
+ WMM_AC_VO = 3 /* Voice */
};
struct ieee80211_mgmt;
-u8 * hostapd_eid_wme(struct hostapd_data *hapd, u8 *eid);
-int hostapd_eid_wme_valid(struct hostapd_data *hapd, u8 *eid, size_t len);
-int hostapd_wme_sta_config(struct hostapd_data *hapd, struct sta_info *sta);
-void hostapd_wme_action(struct hostapd_data *hapd, struct ieee80211_mgmt *mgmt,
+u8 * hostapd_eid_wmm(struct hostapd_data *hapd, u8 *eid);
+int hostapd_eid_wmm_valid(struct hostapd_data *hapd, u8 *eid, size_t len);
+int hostapd_wmm_sta_config(struct hostapd_data *hapd, struct sta_info *sta);
+void hostapd_wmm_action(struct hostapd_data *hapd, struct ieee80211_mgmt *mgmt,
size_t len);
#endif /* WME_H */
diff --git a/hostapd/wpa.h b/hostapd/wpa.h
index d353844..7d9b3d3 100644
--- a/hostapd/wpa.h
+++ b/hostapd/wpa.h
@@ -141,7 +141,7 @@ struct wpa_auth_config {
int rsn_preauth;
int eapol_version;
int peerkey;
- int wme_enabled;
+ int wmm_enabled;
int okc;
#ifdef CONFIG_IEEE80211W
enum {
diff --git a/hostapd/wpa_auth_ie.c b/hostapd/wpa_auth_ie.c
index 3ac9d67..7e01635 100644
--- a/hostapd/wpa_auth_ie.c
+++ b/hostapd/wpa_auth_ie.c
@@ -215,8 +215,8 @@ int wpa_write_rsn_ie(struct wpa_auth_config *conf, u8 *buf, size_t len,
capab |= WPA_CAPABILITY_PREAUTH;
if (conf->peerkey)
capab |= WPA_CAPABILITY_PEERKEY_ENABLED;
- if (conf->wme_enabled) {
- /* 4 PTKSA replay counters when using WME */
+ if (conf->wmm_enabled) {
+ /* 4 PTKSA replay counters when using WMM */
capab |= (RSN_NUM_REPLAY_COUNTERS_16 << 2);
}
#ifdef CONFIG_IEEE80211W
diff --git a/src/common/ieee802_11_common.c b/src/common/ieee802_11_common.c
index 991c989..242f933 100644
--- a/src/common/ieee802_11_common.c
+++ b/src/common/ieee802_11_common.c
@@ -49,26 +49,33 @@ static int ieee802_11_parse_vendor_specific(u8 *pos, size_t elen,
elems->wpa_ie = pos;
elems->wpa_ie_len = elen;
break;
- case WME_OUI_TYPE: /* this is a Wi-Fi WME info. element */
+ case WMM_OUI_TYPE:
+ /* WMM information element */
if (elen < 5) {
- wpa_printf(MSG_MSGDUMP, "short WME "
+ wpa_printf(MSG_MSGDUMP, "short WMM "
"information element ignored "
"(len=%lu)",
(unsigned long) elen);
return -1;
}
switch (pos[4]) {
- case WME_OUI_SUBTYPE_INFORMATION_ELEMENT:
- case WME_OUI_SUBTYPE_PARAMETER_ELEMENT:
- elems->wme = pos;
- elems->wme_len = elen;
+ case WMM_OUI_SUBTYPE_INFORMATION_ELEMENT:
+ case WMM_OUI_SUBTYPE_PARAMETER_ELEMENT:
+ /*
+ * Share same pointer since only one of these
+ * is used and they start with same data.
+ * Length field can be used to distinguish the
+ * IEs.
+ */
+ elems->wmm = pos;
+ elems->wmm_len = elen;
break;
- case WME_OUI_SUBTYPE_TSPEC_ELEMENT:
- elems->wme_tspec = pos;
- elems->wme_tspec_len = elen;
+ case WMM_OUI_SUBTYPE_TSPEC_ELEMENT:
+ elems->wmm_tspec = pos;
+ elems->wmm_tspec_len = elen;
break;
default:
- wpa_printf(MSG_MSGDUMP, "unknown WME "
+ wpa_printf(MSG_MSGDUMP, "unknown WMM "
"information element ignored "
"(subtype=%d len=%lu)",
pos[4], (unsigned long) elen);
diff --git a/src/common/ieee802_11_common.h b/src/common/ieee802_11_common.h
index 2aff993..b7e497b 100644
--- a/src/common/ieee802_11_common.h
+++ b/src/common/ieee802_11_common.h
@@ -41,10 +41,10 @@ struct ieee802_11_elems {
u8 wpa_ie_len;
u8 *rsn_ie;
u8 rsn_ie_len;
- u8 *wme;
- u8 wme_len;
- u8 *wme_tspec;
- u8 wme_tspec_len;
+ u8 *wmm; /* WMM Information or Parameter Element */
+ u8 wmm_len; /* 7 = WMM Information; 24 = WMM Parameter */
+ u8 *wmm_tspec;
+ u8 wmm_tspec_len;
u8 *wps_ie;
u8 wps_ie_len;
u8 *power_cap;
diff --git a/src/common/ieee802_11_defs.h b/src/common/ieee802_11_defs.h
index 1564026..d9e54a9 100644
--- a/src/common/ieee802_11_defs.h
+++ b/src/common/ieee802_11_defs.h
@@ -215,7 +215,7 @@
#define WLAN_ACTION_FT 6
#define WLAN_ACTION_HT 7
#define WLAN_ACTION_SA_QUERY 8
-#define WLAN_ACTION_WMM 17
+#define WLAN_ACTION_WMM 17 /* WMM Specification 1.1 */
/* SA Query Action frame (IEEE 802.11w/D8.0, 7.4.9) */
#define WLAN_SA_QUERY_REQUEST 0
@@ -302,7 +302,7 @@ struct ieee80211_mgmt {
u8 dialog_token;
u8 status_code;
u8 variable[0];
- } STRUCT_PACKED wme_action;
+ } STRUCT_PACKED wmm_action;
struct{
u8 action_code;
u8 element_id;
@@ -563,23 +563,27 @@ struct mimo_pwr_save_action {
#define OUI_MICROSOFT 0x0050f2 /* Microsoft (also used in Wi-Fi specs)
* 00:50:F2 */
-#define WME_OUI_TYPE 2
-#define WME_OUI_SUBTYPE_INFORMATION_ELEMENT 0
-#define WME_OUI_SUBTYPE_PARAMETER_ELEMENT 1
-#define WME_OUI_SUBTYPE_TSPEC_ELEMENT 2
-#define WME_VERSION 1
-
-#define WME_ACTION_CODE_SETUP_REQUEST 0
-#define WME_ACTION_CODE_SETUP_RESPONSE 1
-#define WME_ACTION_CODE_TEARDOWN 2
-
-#define WME_SETUP_RESPONSE_STATUS_ADMISSION_ACCEPTED 0
-#define WME_SETUP_RESPONSE_STATUS_INVALID_PARAMETERS 1
-#define WME_SETUP_RESPONSE_STATUS_REFUSED 3
-
-#define WME_TSPEC_DIRECTION_UPLINK 0
-#define WME_TSPEC_DIRECTION_DOWNLINK 1
-#define WME_TSPEC_DIRECTION_BI_DIRECTIONAL 3
+#define WMM_OUI_TYPE 2
+#define WMM_OUI_SUBTYPE_INFORMATION_ELEMENT 0
+#define WMM_OUI_SUBTYPE_PARAMETER_ELEMENT 1
+#define WMM_OUI_SUBTYPE_TSPEC_ELEMENT 2
+#define WMM_VERSION 1
+
+#define WMM_ACTION_CODE_ADDTS_REQ 0
+#define WMM_ACTION_CODE_ADDTS_RESP 1
+#define WMM_ACTION_CODE_DELTS 2
+
+#define WMM_ADDTS_STATUS_ADMISSION_ACCEPTED 0
+#define WMM_ADDTS_STATUS_INVALID_PARAMETERS 1
+/* 2 - Reserved */
+#define WMM_ADDTS_STATUS_REFUSED 3
+/* 4-255 - Reserved */
+
+/* WMM TSPEC Direction Field Values */
+#define WMM_TSPEC_DIRECTION_UPLINK 0
+#define WMM_TSPEC_DIRECTION_DOWNLINK 1
+/* 2 - Reserved */
+#define WMM_TSPEC_DIRECTION_BI_DIRECTIONAL 3
#define OUI_BROADCOM 0x00904c /* Broadcom (Epigram) */