aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEliad Peller <eliad@wizery.com>2011-06-23 19:23:06 +0300
committerKeith Deacon <kdeacon@ti.com>2011-11-15 20:45:51 -0600
commitb061cc23fbd36b2f7d708e95471a90e4aefbded4 (patch)
tree80df27e5292c5c2e7bbc7eb92843501f350315cd
parent185a70a56de622e082cb1885d0ac01bec8e7ad1b (diff)
downloadandroid_external_wpa_supplicant_8-b061cc23fbd36b2f7d708e95471a90e4aefbded4.tar.gz
android_external_wpa_supplicant_8-b061cc23fbd36b2f7d708e95471a90e4aefbded4.tar.bz2
android_external_wpa_supplicant_8-b061cc23fbd36b2f7d708e95471a90e4aefbded4.zip
hostapd: 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 WME ie in the assoc request. Change-Id: I47b638c9da1c854865fc11dc58947317e2333e8d Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Vishal Mahaveer <a0271468@ti.com>
-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.c20
-rw-r--r--src/ap/sta_info.h3
-rw-r--r--src/drivers/driver.h2
5 files changed, 25 insertions, 6 deletions
diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c
index 71296440..fda65cd5 100644
--- a/src/ap/ap_drv_ops.c
+++ b/src/ap/ap_drv_ops.c
@@ -315,7 +315,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;
@@ -333,6 +333,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 6f947f95..eb700191 100644
--- a/src/ap/ap_drv_ops.h
+++ b/src/ap/ap_drv_ops.h
@@ -37,7 +37,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 b125040c..b47bd4ea 100644
--- a/src/ap/ieee802_11.c
+++ b/src/ap/ieee802_11.c
@@ -593,14 +593,26 @@ 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;
+
+ wpa_printf(MSG_DEBUG, "EPBUG: queues=0x%x, max_sp=%d",
+ sta->uapsd_queues, sta->max_sp);
}
return WLAN_STATUS_SUCCESS;
}
@@ -1723,7 +1735,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 9ec4fe33..4fe2117e 100644
--- a/src/ap/sta_info.h
+++ b/src/ap/sta_info.h
@@ -58,6 +58,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 2e52d791..82a0ec30 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
@@ -626,6 +626,8 @@ struct hostapd_sta_add_params {
u16 listen_interval;
const struct ieee80211_ht_capabilities *ht_capabilities;
u32 flags; /* bitmask of WPA_STA_* flags */
+ u8 uapsd_queues;
+ u8 max_sp;
};
struct hostapd_freq_params {