[PATCH 3/3] nl80211: send uapsd_queues and max_sp values on sta additon
Eliad Peller
eliad
Wed Aug 31 03:30:30 PDT 2011
When a new station is added, send its configured WME params.
Signed-off-by: Eliad Peller <eliad at wizery.com>
---
src/drivers/driver_nl80211.c | 19 ++++++++++++++++++-
1 files changed, 18 insertions(+), 1 deletions(-)
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index b0eaac5..092afd3 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -4033,7 +4033,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;
@@ -4062,13 +4062,30 @@ 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);
+ }
+
ret = send_and_recv_msgs(drv, msg, NULL, NULL);
if (ret)
wpa_printf(MSG_DEBUG, "nl80211: NL80211_CMD_NEW_STATION "
"result: %d (%s)", ret, strerror(-ret));
if (ret == -EEXIST)
ret = 0;
+
+ return ret;
nla_put_failure:
+ if (wme)
+ nlmsg_free(wme);
return ret;
}
--
1.7.0.4
More information about the Hostap
mailing list