AP: Pass station's WMM configuration to driver wrappers

This updates a previous patch did more or less the same thing by
providing the qosinfo as a single variable to the driver wrappers.

Signed-hostap: Jason Young <jason.young@dspg.com>
This commit is contained in:
Jason Young 2011-12-17 12:38:06 +02:00 committed by Jouni Malinen
parent 9e088e743d
commit 5d06163714
7 changed files with 17 additions and 21 deletions

View file

@ -318,7 +318,7 @@ int hostapd_sta_add(struct hostapd_data *hapd,
const u8 *supp_rates, size_t supp_rates_len, const u8 *supp_rates, size_t supp_rates_len,
u16 listen_interval, u16 listen_interval,
const struct ieee80211_ht_capabilities *ht_capab, const struct ieee80211_ht_capabilities *ht_capab,
u32 flags, u8 uapsd_queues, u8 max_sp) u32 flags, u8 qosinfo)
{ {
struct hostapd_sta_add_params params; struct hostapd_sta_add_params params;
@ -336,8 +336,7 @@ int hostapd_sta_add(struct hostapd_data *hapd,
params.listen_interval = listen_interval; params.listen_interval = listen_interval;
params.ht_capabilities = ht_capab; params.ht_capabilities = ht_capab;
params.flags = hostapd_sta_flags_to_drv(flags); params.flags = hostapd_sta_flags_to_drv(flags);
params.uapsd_queues = uapsd_queues; params.qosinfo = qosinfo;
params.max_sp = max_sp;
return hapd->driver->sta_add(hapd->drv_priv, &params); return hapd->driver->sta_add(hapd->drv_priv, &params);
} }

View file

@ -43,7 +43,7 @@ int hostapd_sta_add(struct hostapd_data *hapd,
const u8 *supp_rates, size_t supp_rates_len, const u8 *supp_rates, size_t supp_rates_len,
u16 listen_interval, u16 listen_interval,
const struct ieee80211_ht_capabilities *ht_capab, const struct ieee80211_ht_capabilities *ht_capab,
u32 flags, u8 uapsd_queues, u8 max_sp); u32 flags, u8 qosinfo);
int hostapd_set_privacy(struct hostapd_data *hapd, int enabled); int hostapd_set_privacy(struct hostapd_data *hapd, int enabled);
int hostapd_set_generic_elem(struct hostapd_data *hapd, const u8 *elem, int hostapd_set_generic_elem(struct hostapd_data *hapd, const u8 *elem,
size_t elem_len); size_t elem_len);

View file

@ -551,9 +551,9 @@ static u16 check_wmm(struct hostapd_data *hapd, struct sta_info *sta,
const u8 *wmm_ie, size_t wmm_ie_len) const u8 *wmm_ie, size_t wmm_ie_len)
{ {
sta->flags &= ~WLAN_STA_WMM; sta->flags &= ~WLAN_STA_WMM;
sta->qosinfo = 0;
if (wmm_ie && hapd->conf->wmm_enabled) { if (wmm_ie && hapd->conf->wmm_enabled) {
struct wmm_information_element *wmm; struct wmm_information_element *wmm;
u8 qos_info;
if (hostapd_eid_wmm_valid(hapd, wmm_ie, wmm_ie_len)) { if (hostapd_eid_wmm_valid(hapd, wmm_ie, wmm_ie_len)) {
hostapd_logger(hapd, sta->addr, hostapd_logger(hapd, sta->addr,
@ -566,9 +566,7 @@ static u16 check_wmm(struct hostapd_data *hapd, struct sta_info *sta,
sta->flags |= WLAN_STA_WMM; sta->flags |= WLAN_STA_WMM;
wmm = (struct wmm_information_element *) wmm_ie; wmm = (struct wmm_information_element *) wmm_ie;
qos_info = wmm->qos_info; sta->qosinfo = wmm->qos_info;
sta->uapsd_queues = qos_info & 0xf;
sta->max_sp = qos_info >> 5;
} }
return WLAN_STATUS_SUCCESS; return WLAN_STATUS_SUCCESS;
} }
@ -1571,7 +1569,7 @@ static void handle_assoc_cb(struct hostapd_data *hapd,
sta->supported_rates, sta->supported_rates_len, sta->supported_rates, sta->supported_rates_len,
sta->listen_interval, sta->listen_interval,
sta->flags & WLAN_STA_HT ? &ht_cap : NULL, sta->flags & WLAN_STA_HT ? &ht_cap : NULL,
sta->flags, sta->uapsd_queues, sta->max_sp)) { sta->flags, sta->qosinfo)) {
hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211, hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211,
HOSTAPD_LEVEL_NOTICE, HOSTAPD_LEVEL_NOTICE,
"Could not add STA to kernel driver"); "Could not add STA to kernel driver");

View file

@ -52,6 +52,7 @@ struct sta_info {
u16 listen_interval; /* or beacon_int for APs */ u16 listen_interval; /* or beacon_int for APs */
u8 supported_rates[WLAN_SUPP_RATES_MAX]; u8 supported_rates[WLAN_SUPP_RATES_MAX];
int supported_rates_len; int supported_rates_len;
u8 qosinfo; /* Valid when WLAN_STA_WMM is set */
unsigned int nonerp_set:1; unsigned int nonerp_set:1;
unsigned int no_short_slot_time_set:1; unsigned int no_short_slot_time_set:1;
@ -61,9 +62,6 @@ struct sta_info {
unsigned int ht_20mhz_set:1; unsigned int ht_20mhz_set:1;
unsigned int no_p2p_set:1; unsigned int no_p2p_set:1;
u8 uapsd_queues;
u8 max_sp;
u16 auth_alg; u16 auth_alg;
u8 previous_ap[6]; u8 previous_ap[6];

View file

@ -677,6 +677,10 @@ struct wmm_information_element {
} STRUCT_PACKED; } STRUCT_PACKED;
#define WMM_QOSINFO_STA_AC_MASK 0x0f
#define WMM_QOSINFO_STA_SP_MASK 0x03
#define WMM_QOSINFO_STA_SP_SHIFT 5
#define WMM_AC_AIFSN_MASK 0x0f #define WMM_AC_AIFSN_MASK 0x0f
#define WMM_AC_AIFNS_SHIFT 0 #define WMM_AC_AIFNS_SHIFT 0
#define WMM_AC_ACM 0x10 #define WMM_AC_ACM 0x10

View file

@ -834,8 +834,7 @@ struct hostapd_sta_add_params {
const struct ieee80211_ht_capabilities *ht_capabilities; const struct ieee80211_ht_capabilities *ht_capabilities;
u32 flags; /* bitmask of WPA_STA_* flags */ u32 flags; /* bitmask of WPA_STA_* flags */
int set; /* Set STA parameters instead of add */ int set; /* Set STA parameters instead of add */
u8 uapsd_queues; u8 qosinfo;
u8 max_sp;
}; };
struct hostapd_freq_params { struct hostapd_freq_params {

View file

@ -5406,12 +5406,11 @@ static int wpa_driver_nl80211_sta_add(void *priv,
goto nla_put_failure; goto nla_put_failure;
NLA_PUT_U8(wme, NL80211_STA_WME_UAPSD_QUEUES, NLA_PUT_U8(wme, NL80211_STA_WME_UAPSD_QUEUES,
params->uapsd_queues); params->qosinfo & WMM_QOSINFO_STA_AC_MASK);
NLA_PUT_U8(wme, NL80211_STA_WME_MAX_SP, params->max_sp); NLA_PUT_U8(wme, NL80211_STA_WME_MAX_SP,
(params->qosinfo > WMM_QOSINFO_STA_SP_SHIFT) &
WMM_QOSINFO_STA_SP_MASK);
nla_put_nested(msg, NL80211_ATTR_STA_WME, wme); nla_put_nested(msg, NL80211_ATTR_STA_WME, wme);
nlmsg_free(wme);
wme = NULL;
} }
ret = send_and_recv_msgs(drv, msg, NULL, NULL); ret = send_and_recv_msgs(drv, msg, NULL, NULL);
@ -5423,8 +5422,7 @@ static int wpa_driver_nl80211_sta_add(void *priv,
if (ret == -EEXIST) if (ret == -EEXIST)
ret = 0; ret = 0;
nla_put_failure: nla_put_failure:
if (wme) nlmsg_free(wme);
nlmsg_free(wme);
nlmsg_free(msg); nlmsg_free(msg);
return ret; return ret;
} }