nl80211: Add support for QoS Map configuration
authorKyeyoon Park <kyeyoonp@qca.qualcomm.com>
Wed, 9 Oct 2013 22:41:10 +0000 (15:41 -0700)
committerJouni Malinen <j@w1.fi>
Mon, 23 Dec 2013 08:44:59 +0000 (10:44 +0200)
This allows nl80211-based drivers to configure QoS Mapping in both AP
and station modes.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

src/drivers/driver_nl80211.c

index b693734..67f7366 100644 (file)
@@ -11394,6 +11394,37 @@ error:
 }
 
 
+static int nl80211_set_qos_map(void *priv, const u8 *qos_map_set,
+                              u8 qos_map_set_len)
+{
+       struct i802_bss *bss = priv;
+       struct wpa_driver_nl80211_data *drv = bss->drv;
+       struct nl_msg *msg;
+       int ret;
+
+       msg = nlmsg_alloc();
+       if (!msg)
+               return -ENOMEM;
+
+       wpa_hexdump(MSG_DEBUG, "nl80211: Setting QoS Map",
+                   qos_map_set, qos_map_set_len);
+
+       nl80211_cmd(drv, msg, 0, NL80211_CMD_SET_QOS_MAP);
+       NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX, drv->ifindex);
+       NLA_PUT(msg, NL80211_ATTR_QOS_MAP, qos_map_set_len, qos_map_set);
+
+       ret = send_and_recv_msgs(drv, msg, NULL, NULL);
+       if (ret)
+               wpa_printf(MSG_DEBUG, "nl80211: Setting QoS Map failed");
+
+       return ret;
+
+nla_put_failure:
+       nlmsg_free(msg);
+       return -ENOBUFS;
+}
+
+
 const struct wpa_driver_ops wpa_driver_nl80211_ops = {
        .name = "nl80211",
        .desc = "Linux nl80211/cfg80211",
@@ -11482,4 +11513,5 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = {
 #ifdef ANDROID
        .driver_cmd = wpa_driver_nl80211_driver_cmd,
 #endif /* ANDROID */
+       .set_qos_map = nl80211_set_qos_map,
 };