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; }