From 774bfa62ce96e38261a3be7f63ef5c4579fbc787 Mon Sep 17 00:00:00 2001 From: Eliad Peller Date: Sat, 17 Dec 2011 11:59:34 +0200 Subject: [PATCH] nl80211: Send uapsd_queues and max_sp values on STA addition When a new station is added, send its configured WMM params. Signed-off-by: Eliad Peller --- src/drivers/driver_nl80211.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index e87b702e2..43e659779 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -5353,7 +5353,7 @@ static int wpa_driver_nl80211_sta_add(void *priv, { struct i802_bss *bss = priv; struct wpa_driver_nl80211_data *drv = bss->drv; - struct nl_msg *msg; + struct nl_msg *msg, *wme = NULL; struct nl80211_sta_flag_update upd; int ret = -ENOBUFS; @@ -5388,6 +5388,20 @@ static int wpa_driver_nl80211_sta_add(void *priv, upd.set = upd.mask; NLA_PUT(msg, NL80211_ATTR_STA_FLAGS2, sizeof(upd), &upd); + if (params->flags & WPA_STA_WMM) { + wme = nlmsg_alloc(); + if (!wme) + goto nla_put_failure; + + NLA_PUT_U8(wme, NL80211_STA_WME_UAPSD_QUEUES, + params->uapsd_queues); + NLA_PUT_U8(wme, NL80211_STA_WME_MAX_SP, params->max_sp); + nla_put_nested(msg, NL80211_ATTR_STA_WME, wme); + + nlmsg_free(wme); + wme = NULL; + } + ret = send_and_recv_msgs(drv, msg, NULL, NULL); if (ret) wpa_printf(MSG_DEBUG, "nl80211: NL80211_CMD_%s_STATION " @@ -5396,6 +5410,8 @@ static int wpa_driver_nl80211_sta_add(void *priv, if (ret == -EEXIST) ret = 0; nla_put_failure: + if (wme) + nlmsg_free(wme); return ret; }