aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEliad Peller <eliad@wizery.com>2011-12-17 09:55:14 (GMT)
committerJouni Malinen <j@w1.fi>2011-12-17 09:55:14 (GMT)
commit5f32f79c6e071f02076e09931adc8fc4e0ecd383 (patch)
treeaaede82ec1e98de36186cb46520f37a65456aa8e /src
parent70619a5d8a3d32faa43d66bcb1b670cacf0c243e (diff)
downloadhostap-5f32f79c6e071f02076e09931adc8fc4e0ecd383.zip
hostap-5f32f79c6e071f02076e09931adc8fc4e0ecd383.tar.gz
hostap-5f32f79c6e071f02076e09931adc8fc4e0ecd383.tar.bz2
AP: Add uapsd_queues and max_sp fields
Add uapsd_queues and max_sp fields to sta_info struct, and pass them to the sta_add callback. These values are determined by the WMM IE in the (Re)Association Request. Signed-off-by: Eliad Peller <eliad@wizery.com>
Diffstat (limited to 'src')
-rw-r--r--src/ap/ap_drv_ops.c4
-rw-r--r--src/ap/ap_drv_ops.h2
-rw-r--r--src/ap/ieee802_11.c17
-rw-r--r--src/ap/sta_info.h3
-rw-r--r--src/drivers/driver.h2
5 files changed, 22 insertions, 6 deletions
diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c
index 9419440..9bc01db 100644
--- a/src/ap/ap_drv_ops.c
+++ b/src/ap/ap_drv_ops.c
@@ -318,7 +318,7 @@ int hostapd_sta_add(struct hostapd_data *hapd,
const u8 *supp_rates, size_t supp_rates_len,
u16 listen_interval,
const struct ieee80211_ht_capabilities *ht_capab,
- u32 flags)
+ u32 flags, u8 uapsd_queues, u8 max_sp)
{
struct hostapd_sta_add_params params;
@@ -336,6 +336,8 @@ int hostapd_sta_add(struct hostapd_data *hapd,
params.listen_interval = listen_interval;
params.ht_capabilities = ht_capab;
params.flags = hostapd_sta_flags_to_drv(flags);
+ params.uapsd_queues = uapsd_queues;
+ params.max_sp = max_sp;
return hapd->driver->sta_add(hapd->drv_priv, &params);
}
diff --git a/src/ap/ap_drv_ops.h b/src/ap/ap_drv_ops.h
index 477a1b7..ad22308 100644
--- a/src/ap/ap_drv_ops.h
+++ b/src/ap/ap_drv_ops.h
@@ -43,7 +43,7 @@ int hostapd_sta_add(struct hostapd_data *hapd,
const u8 *supp_rates, size_t supp_rates_len,
u16 listen_interval,
const struct ieee80211_ht_capabilities *ht_capab,
- u32 flags);
+ u32 flags, u8 uapsd_queues, u8 max_sp);
int hostapd_set_privacy(struct hostapd_data *hapd, int enabled);
int hostapd_set_generic_elem(struct hostapd_data *hapd, const u8 *elem,
size_t elem_len);
diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
index 617a035..8b5a45f 100644
--- a/src/ap/ieee802_11.c
+++ b/src/ap/ieee802_11.c
@@ -552,14 +552,23 @@ static u16 check_wmm(struct hostapd_data *hapd, struct sta_info *sta,
{
sta->flags &= ~WLAN_STA_WMM;
if (wmm_ie && hapd->conf->wmm_enabled) {
- if (hostapd_eid_wmm_valid(hapd, wmm_ie, wmm_ie_len))
+ struct wmm_information_element *wmm;
+ u8 qos_info;
+
+ if (hostapd_eid_wmm_valid(hapd, wmm_ie, wmm_ie_len)) {
hostapd_logger(hapd, sta->addr,
HOSTAPD_MODULE_WPA,
HOSTAPD_LEVEL_DEBUG,
"invalid WMM element in association "
"request");
- else
- sta->flags |= WLAN_STA_WMM;
+ return WLAN_STATUS_UNSPECIFIED_FAILURE;
+ }
+
+ sta->flags |= WLAN_STA_WMM;
+ wmm = (struct wmm_information_element *) wmm_ie;
+ qos_info = wmm->qos_info;
+ sta->uapsd_queues = qos_info & 0xf;
+ sta->max_sp = qos_info >> 5;
}
return WLAN_STATUS_SUCCESS;
}
@@ -1562,7 +1571,7 @@ static void handle_assoc_cb(struct hostapd_data *hapd,
sta->supported_rates, sta->supported_rates_len,
sta->listen_interval,
sta->flags & WLAN_STA_HT ? &ht_cap : NULL,
- sta->flags)) {
+ sta->flags, sta->uapsd_queues, sta->max_sp)) {
hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211,
HOSTAPD_LEVEL_NOTICE,
"Could not add STA to kernel driver");
diff --git a/src/ap/sta_info.h b/src/ap/sta_info.h
index 4d3b5e9..f874270 100644
--- a/src/ap/sta_info.h
+++ b/src/ap/sta_info.h
@@ -61,6 +61,9 @@ struct sta_info {
unsigned int ht_20mhz_set:1;
unsigned int no_p2p_set:1;
+ u8 uapsd_queues;
+ u8 max_sp;
+
u16 auth_alg;
u8 previous_ap[6];
diff --git a/src/drivers/driver.h b/src/drivers/driver.h
index 98d82e6..783102e 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
@@ -834,6 +834,8 @@ struct hostapd_sta_add_params {
const struct ieee80211_ht_capabilities *ht_capabilities;
u32 flags; /* bitmask of WPA_STA_* flags */
int set; /* Set STA parameters instead of add */
+ u8 uapsd_queues;
+ u8 max_sp;
};
struct hostapd_freq_params {