From patchwork Tue Oct 21 12:16:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilan Peer X-Patchwork-Id: 401857 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from maxx.maxx.shmoo.com (maxx.shmoo.com [205.134.188.171]) by ozlabs.org (Postfix) with ESMTP id 584F914007B for ; Wed, 22 Oct 2014 09:50:28 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id A191A9D470; Tue, 21 Oct 2014 18:50:24 -0400 (EDT) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rYYlyIQYSvFi; Tue, 21 Oct 2014 18:50:24 -0400 (EDT) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 85B579D44B; Tue, 21 Oct 2014 18:49:30 -0400 (EDT) X-Original-To: mailman-post+hostap@maxx.shmoo.com Delivered-To: mailman-post+hostap@maxx.shmoo.com Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id E53CB9D28D for ; Tue, 21 Oct 2014 18:49:27 -0400 (EDT) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id C9gHWFa8bcSR for ; Tue, 21 Oct 2014 18:49:22 -0400 (EDT) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id B129D9D453 for ; Tue, 21 Oct 2014 18:49:04 -0400 (EDT) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP; 21 Oct 2014 11:15:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.97,862,1389772800"; d="scan'208";a="403606331" Received: from unknown (HELO ipeer-e6430-3.jer.intel.com) ([10.12.217.164]) by FMSMGA003.fm.intel.com with ESMTP; 21 Oct 2014 11:07:23 -0700 From: Ilan Peer To: hostap@lists.shmoo.com Subject: [PATCH 10/13] nl80211: implement add_ts/del_ts ops Date: Tue, 21 Oct 2014 08:16:49 -0400 Message-Id: <1413893812-5122-11-git-send-email-ilan.peer@intel.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1413893812-5122-1-git-send-email-ilan.peer@intel.com> References: <1413893812-5122-1-git-send-email-ilan.peer@intel.com> Cc: Moshe Benji , Moshe Benji X-BeenThere: hostap@lists.shmoo.com X-Mailman-Version: 2.1.11 Precedence: list List-Id: HostAP Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: hostap-bounces@lists.shmoo.com Errors-To: hostap-bounces@lists.shmoo.com From: Moshe Benji Add ops to notify about tspecs to add/remove. Additionally, subscribe to ADDTS/DELTS action frames in order to be able to process wmm ac public action frames. Signed-off-by: Moshe Benji Signed-off-by: Eliad Peller --- src/drivers/driver_nl80211.c | 92 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index f662616..5a8e05f 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -540,6 +540,8 @@ static const char * nl80211_command_to_string(enum nl80211_commands cmd) C2S(NL80211_CMD_CHANNEL_SWITCH) C2S(NL80211_CMD_VENDOR) C2S(NL80211_CMD_SET_QOS_MAP) + C2S(NL80211_CMD_ADD_TX_TS) + C2S(NL80211_CMD_DEL_TX_TS) default: return "NL80211_CMD_UNKNOWN"; } @@ -3569,6 +3571,7 @@ struct wiphy_info_data { unsigned int p2p_client_supported:1; unsigned int p2p_concurrent:1; unsigned int channel_switch_supported:1; + unsigned int wmm_ac_supported:1; unsigned int set_qos_map_supported:1; unsigned int have_low_prio_scan:1; }; @@ -3736,6 +3739,9 @@ static void wiphy_info_supp_cmds(struct wiphy_info_data *info, case NL80211_CMD_CHANNEL_SWITCH: info->channel_switch_supported = 1; break; + case NL80211_CMD_ADD_TX_TS: + info->wmm_ac_supported = 1; + break; case NL80211_CMD_SET_QOS_MAP: info->set_qos_map_supported = 1; break; @@ -4098,6 +4104,7 @@ static int wpa_driver_nl80211_get_info(struct wpa_driver_nl80211_data *drv, if (info->channel_switch_supported) drv->capa.flags |= WPA_DRIVER_FLAGS_AP_CSA; + drv->capa.wmm_ac_supported = info->wmm_ac_supported; return 0; nla_put_failure: @@ -4707,6 +4714,14 @@ static int nl80211_mgmt_subscribe_non_ap(struct i802_bss *bss) if (nl80211_register_action_frame(bss, (u8 *) "\x0a\x11", 2) < 0) ret = -1; + /* WMM-AC ADDTS Response */ + if (nl80211_register_action_frame(bss, (u8 *) "\x11\x01", 2) < 0) + return -1; + + /* WMM-AC DELTS */ + if (nl80211_register_action_frame(bss, (u8 *) "\x11\x02", 2) < 0) + return -1; + #ifdef CONFIG_HS20 /* WNM-Notification */ if (nl80211_register_action_frame(bss, (u8 *) "\x0a\x1a", 2) < 0) @@ -12386,6 +12401,81 @@ error: } +static int nl80211_add_ts(void *priv, u8 tsid, const u8 *addr, + u8 user_priority, u16 admitted_time) +{ + struct i802_bss *bss = priv; + struct wpa_driver_nl80211_data *drv = bss->drv; + struct nl_msg *msg; + int ret; + + wpa_printf(MSG_INFO, + "nl80211: add_ts request: tsid=%u admitted_time=%u up=%d", + tsid, admitted_time, user_priority); + + if (!is_sta_interface(drv->nlmode)) + return -ENOTSUP; + + msg = nlmsg_alloc(); + if (!msg) + return -ENOMEM; + + nl80211_cmd(drv, msg, 0, NL80211_CMD_ADD_TX_TS); + if (nl80211_set_iface_id(msg, bss) < 0) + goto nla_put_failure; + + NLA_PUT_U8(msg, NL80211_ATTR_TSID, tsid); + NLA_PUT(msg, NL80211_ATTR_MAC, ETH_ALEN, addr); + NLA_PUT_U8(msg, NL80211_ATTR_USER_PRIO, user_priority); + NLA_PUT_U16(msg, NL80211_ATTR_ADMITTED_TIME, admitted_time); + + ret = send_and_recv_msgs(drv, msg, NULL, NULL); + if (ret) + wpa_printf(MSG_DEBUG, "nl80211: add_ts failed err=%d (%s)", + ret, strerror(-ret)); + return ret; + +nla_put_failure: + nlmsg_free(msg); + return -ENOBUFS; +} + + +static int nl80211_del_ts(void *priv, u8 tsid, const u8 *addr) +{ + struct i802_bss *bss = priv; + struct wpa_driver_nl80211_data *drv = bss->drv; + struct nl_msg *msg; + int ret; + + wpa_printf(MSG_INFO, "nl80211: del_ts request: tsid=%u", tsid); + + if (!is_sta_interface(drv->nlmode)) + return -ENOTSUP; + + msg = nlmsg_alloc(); + if (!msg) + return -ENOMEM; + + nl80211_cmd(drv, msg, 0, NL80211_CMD_DEL_TX_TS); + if (nl80211_set_iface_id(msg, bss) < 0) + goto nla_put_failure; + + NLA_PUT_U8(msg, NL80211_ATTR_TSID, tsid); + NLA_PUT(msg, NL80211_ATTR_MAC, ETH_ALEN, addr); + + ret = send_and_recv_msgs(drv, msg, NULL, NULL); + if (ret) + wpa_printf(MSG_DEBUG, "nl80211: del_ts failed err=%d (%s)", + ret, strerror(-ret)); + return ret; + +nla_put_failure: + nlmsg_free(msg); + return -ENOBUFS; +} + + #ifdef CONFIG_TESTING_OPTIONS static int cmd_reply_handler(struct nl_msg *msg, void *arg) { @@ -12889,4 +12979,6 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = { .join_mesh = wpa_driver_nl80211_join_mesh, .leave_mesh = wpa_driver_nl80211_leave_mesh, #endif /* CONFIG_MESH */ + .add_tx_ts = nl80211_add_ts, + .del_tx_ts = nl80211_del_ts, };