From patchwork Tue Oct 16 18:41:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tamizh chelvam X-Patchwork-Id: 10644145 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4032A157A for ; Tue, 16 Oct 2018 18:43:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 30DC428ECB for ; Tue, 16 Oct 2018 18:43:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 24FC42915F; Tue, 16 Oct 2018 18:43:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A8CAC28ECB for ; Tue, 16 Oct 2018 18:43:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=FGZ3tVc+rJPedlkCxtjcbwe94ZHgh5et22JnTB+ydqI=; b=a6LGaEivRsPB9i3IKnWMDABeI7 nt9uDGl1kM5eqKLceKVXp9/weNlMOX2UKL77K8i3jo7GKEb8a6/owAh7KnZ8nk1/wmEVBcA1XJk2w CF5ocRdXIN84bHNaCHfy5wgV9a6NdVhSPX15hmmnZ48101DfODHuLBgCrX0goWwhTDNihwoO7Atqs O0vCOfVWjUccSjE4t+TDNlPI2zp/qEGbkRSO7z0jVGwWsfn/OiRDWwgBkndlfLTMFnuz4p4/ifuA8 B35vprv0csEH7cOAsHChC7x2DoQpoy/VGQ5l0a7MJS+nbtggBvAw0T3zzkyNOP6ZdT+MkAyZhvD02 zG8I5VwA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gCUJp-0001D1-Vz; Tue, 16 Oct 2018 18:43:50 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gCUJ5-0000rW-87 for ath10k@lists.infradead.org; Tue, 16 Oct 2018 18:43:07 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 4676F61310; Tue, 16 Oct 2018 18:42:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1539715374; bh=eL9qDZzXrcvzVKCRlFObzeWGXEZrr2Z17WzpMrK3Ufg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HkoEv0puCIKrIvyVeA7mwNqU8XjZd5Y+M8rpG2BnxZhsO4OjPaHqI3zKRYuC69I5A WKekv0BiqeQ4VR8yQg5mwJuwW+XDKkM4y4LwQkD+w37RKatjFX6ZfqFmmo9lr963cp xH/WssRDOq5vAsB1ddpO0WVX1PyXXGlVNGGXPs3Q= Received: from cheath10p342229-lin.qca.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: tamizhr@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id E447F61308; Tue, 16 Oct 2018 18:42:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1539715373; bh=eL9qDZzXrcvzVKCRlFObzeWGXEZrr2Z17WzpMrK3Ufg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SeJUinsWdlK9ScCmOWVfzT2tkAnjPOlfs/VAvkbnsQY5g54DwFr3O5XkhLwvsgfLH klrQuz718NQ7rXEgP8baSv2/1cXkt6tX5P61MLZZjHRD1FCuv2UALho2oU9uzeM4w6 F9iZyvwiSWbolFB1Ta0gi5b2UZx7R1L3Y5HsRlH8= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org E447F61308 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=tamizhr@codeaurora.org From: Tamizh chelvam To: ath10k@lists.infradead.org, johannes@sipsolutions.net Subject: [PATCH 1/6] mac80211: Add NoAck policy functionality offload infrastructure Date: Wed, 17 Oct 2018 00:11:06 +0530 Message-Id: <1539715271-14325-2-git-send-email-tamizhr@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1539715271-14325-1-git-send-email-tamizhr@codeaurora.org> References: <1539715271-14325-1-git-send-email-tamizhr@codeaurora.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181016_114303_373606_BD3046E0 X-CRM114-Status: GOOD ( 15.13 ) X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vasanthakumar Thiagarajan , linux-wireless@vger.kernel.org, Tamizh chelvam MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Vasanthakumar Thiagarajan Add infrastructure for drivers to implement NoAck policy functionlity. Driver like ath10k does not use the per-packet TID NoAck policy configuration. Instead NoAck map is sent to the firmware/hardware in control path. Firmware takes care of setting up QOS header with NoAck policy based on the TID NoAck map. Drivers having this support should implement callback set_noack_tid_bitmap(). Supporting drivers would receive TID NoAck map through set_noack_tid_bitmap() instead of receiving as part of every tx skb. Signed-off-by: Vasanthakumar Thiagarajan Signed-off-by: Tamizh chelvam --- include/net/mac80211.h | 7 +++++++ net/mac80211/cfg.c | 10 ++++++++-- net/mac80211/driver-ops.h | 21 +++++++++++++++++++++ net/mac80211/iface.c | 4 ++++ net/mac80211/trace.h | 25 +++++++++++++++++++++++++ net/mac80211/tx.c | 2 +- net/mac80211/wme.c | 3 ++- 7 files changed, 68 insertions(+), 4 deletions(-) diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 71985e9..7da9d30 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h @@ -3623,6 +3623,10 @@ enum ieee80211_reconfig_type { * skb is always a real frame, head may or may not be an A-MSDU. * @get_ftm_responder_stats: Retrieve FTM responder statistics, if available. * Statistics should be cumulative, currently no way to reset is provided. + * + * @set_noack_tid_bitmap: Set NoAck policy TID bitmap for a virtual interface. + * Drivers mplementing this callback must take care of setting NoAck policy + * in QOS control field based on the configured TID bitmap. */ struct ieee80211_ops { void (*tx)(struct ieee80211_hw *hw, @@ -3911,6 +3915,9 @@ struct ieee80211_ops { int (*get_ftm_responder_stats)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct cfg80211_ftm_responder_stats *ftm_stats); + + int (*set_noack_tid_bitmap)(struct ieee80211_hw *hw, + struct ieee80211_vif *vif, u16 noack_map); }; /** diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 5162233..4d8cc8d 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -346,9 +346,15 @@ static int ieee80211_set_noack_map(struct wiphy *wiphy, sdata->noack_map = noack_map; - ieee80211_check_fast_xmit_iface(sdata); + if (!sdata->local->ops->set_noack_tid_bitmap) { + ieee80211_check_fast_xmit_iface(sdata); + return 0; + } - return 0; + if (!ieee80211_sdata_running(sdata)) + return 0; + + return drv_set_noack_tid_bitmap(sdata->local, sdata, noack_map); } static int ieee80211_add_key(struct wiphy *wiphy, struct net_device *dev, diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h index 0b1747a..a6dcef5 100644 --- a/net/mac80211/driver-ops.h +++ b/net/mac80211/driver-ops.h @@ -1278,4 +1278,25 @@ static inline void drv_del_nan_func(struct ieee80211_local *local, trace_drv_return_void(local); } +static inline int drv_set_noack_tid_bitmap(struct ieee80211_local *local, + struct ieee80211_sub_if_data *sdata, + u16 noack_map) +{ + int ret; + + might_sleep(); + if (!check_sdata_in_driver(sdata)) + return -EIO; + + if (!local->ops->set_noack_tid_bitmap) + return -EOPNOTSUPP; + + trace_drv_set_noack_tid_bitmap(local, sdata, noack_map); + ret = local->ops->set_noack_tid_bitmap(&local->hw, &sdata->vif, + noack_map); + trace_drv_return_int(local, ret); + + return ret; +} + #endif /* __MAC80211_DRIVER_OPS */ diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index 5836dde..06106f2 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c @@ -633,6 +633,10 @@ int ieee80211_do_open(struct wireless_dev *wdev, bool coming_up) ieee80211_vif_type_p2p(&sdata->vif)); if (res) goto err_del_interface; + + if (sdata->noack_map) + drv_set_noack_tid_bitmap(local, sdata, + sdata->noack_map); } if (sdata->vif.type == NL80211_IFTYPE_AP) { diff --git a/net/mac80211/trace.h b/net/mac80211/trace.h index 588c51a..a563904 100644 --- a/net/mac80211/trace.h +++ b/net/mac80211/trace.h @@ -1882,6 +1882,31 @@ struct trace_switch_entry { ) ); +TRACE_EVENT(drv_set_noack_tid_bitmap, + TP_PROTO(struct ieee80211_local *local, + struct ieee80211_sub_if_data *sdata, + u16 noack_map), + + TP_ARGS(local, sdata, noack_map), + TP_STRUCT__entry( + LOCAL_ENTRY + VIF_ENTRY + __field(u16, noack_map) + ), + + TP_fast_assign( + LOCAL_ASSIGN; + VIF_ASSIGN; + __entry->noack_map = noack_map; + ), + + TP_printk( + LOCAL_PR_FMT VIF_PR_FMT + ", noack_map: %u", + LOCAL_PR_ARG, VIF_PR_ARG, __entry->noack_map + ) +); + /* * Tracing for API calls that drivers call. */ diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index e0ccee2..d744c4b 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -2872,7 +2872,7 @@ void ieee80211_check_fast_xmit(struct sta_info *sta) test_sta_flag(sta, WLAN_STA_CLEAR_PS_FILT)) goto out; - if (sdata->noack_map) + if (sdata->noack_map && !local->ops->set_noack_tid_bitmap) goto out; /* fast-xmit doesn't handle fragmentation at all */ diff --git a/net/mac80211/wme.c b/net/mac80211/wme.c index 5f7c963..11c14b9 100644 --- a/net/mac80211/wme.c +++ b/net/mac80211/wme.c @@ -256,7 +256,8 @@ void ieee80211_set_qos_hdr(struct ieee80211_sub_if_data *sdata, IEEE80211_QOS_CTL_ACK_POLICY_MASK); if (is_multicast_ether_addr(hdr->addr1) || - sdata->noack_map & BIT(tid)) { + (!sdata->local->ops->set_noack_tid_bitmap && + sdata->noack_map & BIT(tid))) { flags |= IEEE80211_QOS_CTL_ACK_POLICY_NOACK; info->flags |= IEEE80211_TX_CTL_NO_ACK; } From patchwork Tue Oct 16 18:41:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tamizh chelvam X-Patchwork-Id: 10644143 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B1D67157A for ; Tue, 16 Oct 2018 18:43:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9F2BF287A2 for ; Tue, 16 Oct 2018 18:43:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 932E328911; Tue, 16 Oct 2018 18:43:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D9E83287A2 for ; Tue, 16 Oct 2018 18:43:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=BFWvv0edVulM4hEFhQhq0+vvOTfv4ThosbryfOH3iLc=; b=UY2z6A4lLO5YRzPmiIgmMVtT2b eX2AsRngJxS2mTeaVaK6ltOzsi8VFur9Nnf+Qj8p/kWxEcGna9C5cGs+9TYNI7krG3lTtaKgg2pMN +JtqA1g8hD0EwvXcQYNJoP7C5sqUeOk4dVLqcV+ES04jO0TCARC4hwHqJFH1sdB3Ip9a7ae/5YjTl KhriTM+u050qkNcNdfOVGZfNq9ZOkcTO745mRV9iF4kJlObNS1ojLL7i36oEbnEXO7KKTaM2foLsz AqVHYL9Ss0JA8ywCuhz6y3cM5EFWLHkFX4+OZRLdTfpGIoxtHqpwTi09Hm0HrDN8zrQDreAPx6iBM 5mT3gXkw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gCUJf-00018K-Cy; Tue, 16 Oct 2018 18:43:39 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gCUJ5-0000rd-A0 for ath10k@lists.infradead.org; Tue, 16 Oct 2018 18:43:08 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id E217A61321; Tue, 16 Oct 2018 18:42:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1539715376; bh=IYIxR43lgo32Eyjowx4Rhy5kMjIpwdhWFkC2btawqMs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=d+yKbZ0jc3lM6qGJEXPZzePJNkIc5RF+ywSUNlJTFw0sZlfcTouFHU7pRWr2oTlcM NLN5rXEQZ5YTiFXdxvEq2wKXFNvjeNzP7xvQNIpuwTjbmfWXoLTgmiIlSnhqiWF4wv X0Li+O+Rzq29JFYDwP24ASxneLbUEa6eR4/64j38= Received: from cheath10p342229-lin.qca.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: tamizhr@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 0DBA960BFA; Tue, 16 Oct 2018 18:42:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1539715375; bh=IYIxR43lgo32Eyjowx4Rhy5kMjIpwdhWFkC2btawqMs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Cih1fN2RJ+EV4SMsIkPGVjitVlmVhMbWDkxz1psH6H51KF2iAo2JhBtLyBvrc2TYr 5FYIorELnWFhoPI72VLxiYiAq+/ITjlCPon5p10TKyh7+8rnelhByErV3YQuO3hZdL VHui7lFGaUqEohmsnvIfEmvz85ACrRBgshuhALos= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 0DBA960BFA Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=tamizhr@codeaurora.org From: Tamizh chelvam To: ath10k@lists.infradead.org, johannes@sipsolutions.net Subject: [PATCH 2/6] nl80211/mac80211: Extend NoAck policy command with peer MAC address Date: Wed, 17 Oct 2018 00:11:07 +0530 Message-Id: <1539715271-14325-3-git-send-email-tamizhr@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1539715271-14325-1-git-send-email-tamizhr@codeaurora.org> References: <1539715271-14325-1-git-send-email-tamizhr@codeaurora.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181016_114303_457098_8AD0165D X-CRM114-Status: GOOD ( 20.94 ) X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vasanthakumar Thiagarajan , linux-wireless@vger.kernel.org, Tamizh chelvam MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Vasanthakumar Thiagarajan Provides peer level NoAck policy configuration by extending NL80211_CMD_SET_NOACK_MAP command with peer MAC address. If user space does not give any peer mac address, the driver should retain the existing functionality of applying the NoAck policy for all the staions connected to the netdev. For a connected peer, the peer specific configuration takes precedence over netdev level configuration when both are set by the user. When the command is given without attribute NL80211_ATTR_NOACK_MAP for a peer, the NoAck policy for the peer will be reset to default which is peer's netdev NoAck policy. Newly connected stations will have default NoAck policy. Drivers supporting per-sta NoAck policy must advertise the support through the extended flag index NL80211_EXT_FEATURE_PER_STA_NOACK_MAP. Since a value of -1 NoAck map is used for default configuration, redefine noack_map as int from u16. Signed-off-by: Vasanthakumar Thiagarajan Signed-off-by: Tamizh chelvam --- include/net/cfg80211.h | 12 ++++++++++-- include/net/mac80211.h | 2 +- include/uapi/linux/nl80211.h | 16 +++++++++++++++- net/mac80211/cfg.c | 3 ++- net/mac80211/driver-ops.h | 2 +- net/mac80211/ieee80211_i.h | 2 +- net/mac80211/trace.h | 6 +++--- net/wireless/nl80211.c | 22 +++++++++++++++++----- net/wireless/rdev-ops.h | 7 ++++--- net/wireless/trace.h | 15 +++++++++------ 10 files changed, 63 insertions(+), 24 deletions(-) diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 1fa41b7..5801d76 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h @@ -3086,7 +3086,15 @@ struct cfg80211_ftm_responder_stats { * @probe_client: probe an associated client, must return a cookie that it * later passes to cfg80211_probe_status(). * - * @set_noack_map: Set the NoAck Map for the TIDs. + * @set_noack_map: Set the NoAck Map for the TIDs. When peer is not %NULL NoAck + * map will be applied for that particular peer. A NoAck map value of -1 + * for non-%NULL peer would indicate that the peer's current NoAck + * configuration should be reset to the default one. The default NoAck + * configuration for a peer uses the currently configured NoAck setting of + * netdev. When peer is %NULL NoAck map will be applied for all the + * connected stations on the netdev which have default NoAck policy + * configuration. Default NoAck configuration should be used for newly + * connected stations. * * @get_channel: Get the current operating channel for the virtual interface. * For monitor interfaces, it should return %NULL unless there's a single @@ -3403,7 +3411,7 @@ struct cfg80211_ops { int (*set_noack_map)(struct wiphy *wiphy, struct net_device *dev, - u16 noack_map); + const u8 *peer, int noack_map); int (*get_channel)(struct wiphy *wiphy, struct wireless_dev *wdev, diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 7da9d30..5ce7ce7 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h @@ -3917,7 +3917,7 @@ struct ieee80211_ops { struct cfg80211_ftm_responder_stats *ftm_stats); int (*set_noack_tid_bitmap)(struct ieee80211_hw *hw, - struct ieee80211_vif *vif, u16 noack_map); + struct ieee80211_vif *vif, int noack_map); }; /** diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h index 6d610ba..31b7a4b 100644 --- a/include/uapi/linux/nl80211.h +++ b/include/uapi/linux/nl80211.h @@ -788,7 +788,18 @@ * messages. Note that per PHY only one application may register. * * @NL80211_CMD_SET_NOACK_MAP: sets a bitmap for the individual TIDs whether - * No Acknowledgement Policy should be applied. + * No Acknowledgement Policy should be applied. %NL80211_ATTR_MAC is used + * to apply No Acknowledgement policy for a particular connected station. + * When the command is received without %NL80211_ATTR_NOACK_MAP for a + * connected station (%NL80211_ATTR_MAC), the station's current NoAck + * policy configuration should be reset to default. The default + * configuration for a peer should use the current ndev level NoAck + * policy configuration. Station specific NoAck policy configuration is + * valid only for STA's current connection, i.e. the configuration will + * be reset to default when the station connects back after disconnection/ + * roaming. When user-space does not include %NL80211_ATTR_MAC, the No + * Acknowledgement Policy setting should be treated as per-netdev + * configuration. * * @NL80211_CMD_CH_SWITCH_NOTIFY: An AP or GO may decide to switch channels * independently of the userspace SME, send this event indicating @@ -5257,6 +5268,8 @@ enum nl80211_feature_flags { * able to rekey an in-use key correctly. Userspace must not rekey PTK keys * if this flag is not set. Ignoring this can leak clear text packets and/or * freeze the connection. + * @NL80211_EXT_FEATURE_PER_STA_NOACK_MAP: Driver supports STA specific NoAck + * policy functionality. * * @NUM_NL80211_EXT_FEATURES: number of extended features. * @MAX_NL80211_EXT_FEATURES: highest extended feature index. @@ -5297,6 +5310,7 @@ enum nl80211_ext_feature_index { NL80211_EXT_FEATURE_SCAN_MIN_PREQ_CONTENT, NL80211_EXT_FEATURE_CAN_REPLACE_PTK0, NL80211_EXT_FEATURE_ENABLE_FTM_RESPONDER, + NL80211_EXT_FEATURE_PER_STA_NOACK_MAP, /* add new features before the definition below */ NUM_NL80211_EXT_FEATURES, diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 4d8cc8d..7a7e423 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -340,7 +340,8 @@ static void ieee80211_del_nan_func(struct wiphy *wiphy, static int ieee80211_set_noack_map(struct wiphy *wiphy, struct net_device *dev, - u16 noack_map) + const u8 *peer, + int noack_map) { struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h index a6dcef5..d705938 100644 --- a/net/mac80211/driver-ops.h +++ b/net/mac80211/driver-ops.h @@ -1280,7 +1280,7 @@ static inline void drv_del_nan_func(struct ieee80211_local *local, static inline int drv_set_noack_tid_bitmap(struct ieee80211_local *local, struct ieee80211_sub_if_data *sdata, - u16 noack_map) + int noack_map) { int ret; diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index 10a0506..257dec5 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h @@ -891,7 +891,7 @@ struct ieee80211_sub_if_data { unsigned int fragment_next; /* TID bitmap for NoAck policy */ - u16 noack_map; + int noack_map; /* bit field of ACM bits (BIT(802.1D tag)) */ u8 wmm_acm; diff --git a/net/mac80211/trace.h b/net/mac80211/trace.h index a563904..e0e6c9a 100644 --- a/net/mac80211/trace.h +++ b/net/mac80211/trace.h @@ -1885,13 +1885,13 @@ struct trace_switch_entry { TRACE_EVENT(drv_set_noack_tid_bitmap, TP_PROTO(struct ieee80211_local *local, struct ieee80211_sub_if_data *sdata, - u16 noack_map), + int noack_map), TP_ARGS(local, sdata, noack_map), TP_STRUCT__entry( LOCAL_ENTRY VIF_ENTRY - __field(u16, noack_map) + __field(int, noack_map) ), TP_fast_assign( @@ -1902,7 +1902,7 @@ struct trace_switch_entry { TP_printk( LOCAL_PR_FMT VIF_PR_FMT - ", noack_map: %u", + ", noack_map: %d", LOCAL_PR_ARG, VIF_PR_ARG, __entry->noack_map ) ); diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 744b585..d744388 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -3331,17 +3331,29 @@ static int nl80211_set_noack_map(struct sk_buff *skb, struct genl_info *info) { struct cfg80211_registered_device *rdev = info->user_ptr[0]; struct net_device *dev = info->user_ptr[1]; - u16 noack_map; + int noack_map = -1; + const u8 *peer = NULL; - if (!info->attrs[NL80211_ATTR_NOACK_MAP]) + if (!(info->attrs[NL80211_ATTR_NOACK_MAP] || + info->attrs[NL80211_ATTR_MAC])) return -EINVAL; + if (info->attrs[NL80211_ATTR_NOACK_MAP]) + noack_map = nla_get_u16(info->attrs[NL80211_ATTR_NOACK_MAP]); + + if (info->attrs[NL80211_ATTR_MAC]) { + if (!wiphy_ext_feature_isset( + &rdev->wiphy, + NL80211_EXT_FEATURE_PER_STA_NOACK_MAP)) + return -EOPNOTSUPP; + + peer = nla_data(info->attrs[NL80211_ATTR_MAC]); + } + if (!rdev->ops->set_noack_map) return -EOPNOTSUPP; - noack_map = nla_get_u16(info->attrs[NL80211_ATTR_NOACK_MAP]); - - return rdev_set_noack_map(rdev, dev, noack_map); + return rdev_set_noack_map(rdev, dev, peer, noack_map); } struct get_key_cookie { diff --git a/net/wireless/rdev-ops.h b/net/wireless/rdev-ops.h index 51380b5..8426eb1 100644 --- a/net/wireless/rdev-ops.h +++ b/net/wireless/rdev-ops.h @@ -908,11 +908,12 @@ static inline int rdev_probe_client(struct cfg80211_registered_device *rdev, } static inline int rdev_set_noack_map(struct cfg80211_registered_device *rdev, - struct net_device *dev, u16 noack_map) + struct net_device *dev, const u8 *peer, + int noack_map) { int ret; - trace_rdev_set_noack_map(&rdev->wiphy, dev, noack_map); - ret = rdev->ops->set_noack_map(&rdev->wiphy, dev, noack_map); + trace_rdev_set_noack_map(&rdev->wiphy, dev, peer, noack_map); + ret = rdev->ops->set_noack_map(&rdev->wiphy, dev, peer, noack_map); trace_rdev_return_int(&rdev->wiphy, ret); return ret; } diff --git a/net/wireless/trace.h b/net/wireless/trace.h index c6a9446..2ff78dd 100644 --- a/net/wireless/trace.h +++ b/net/wireless/trace.h @@ -1909,21 +1909,24 @@ ); TRACE_EVENT(rdev_set_noack_map, - TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, - u16 noack_map), - TP_ARGS(wiphy, netdev, noack_map), + TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, const u8 *peer, + int noack_map), + TP_ARGS(wiphy, netdev, peer, noack_map), TP_STRUCT__entry( WIPHY_ENTRY NETDEV_ENTRY - __field(u16, noack_map) + MAC_ENTRY(peer) + __field(int, noack_map) ), TP_fast_assign( WIPHY_ASSIGN; NETDEV_ASSIGN; + MAC_ASSIGN(peer, peer); __entry->noack_map = noack_map; ), - TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", noack_map: %u", - WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->noack_map) + TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", " MAC_PR_FMT + ", noack_map: %d", WIPHY_PR_ARG, NETDEV_PR_ARG, + MAC_PR_ARG(peer), __entry->noack_map) ); DEFINE_EVENT(wiphy_wdev_evt, rdev_get_channel, From patchwork Tue Oct 16 18:41:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tamizh chelvam X-Patchwork-Id: 10644139 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 458AF157A for ; Tue, 16 Oct 2018 18:43:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 353E5288F1 for ; Tue, 16 Oct 2018 18:43:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 28FE028911; Tue, 16 Oct 2018 18:43:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 82E2D288F1 for ; Tue, 16 Oct 2018 18:43:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=Q71XKdcEIknuoKl6crU7716HQYqofc8AKMbbhckyW4g=; b=oo3W87KBUOjLBZQtae8RTrbxzW NWJQGFSolOfFJ9BuejAH+jNon0VJ3d6RKJta3iF7yYd0EX2xrj6fEJsiYzRAx7kUCtfZHNfozHEC6 3Dj+O+mGD+WJu8iqzTcm5tZPS1csSpmYLfA7IC7mM4tlyZGruxYr5N/zQmjLULTtKkRLCk/cN4b56 S07y9V+waebTSI/u+HW5FjBmepyID5m8KzhHBcTgQ2v+klhaQUiTuc5U1r4aqZ0Hu9dhJJrSJKUd3 C6+M6ji8yBiZXD5TCJSCZSErp5PnNJJPTPsbMUOcxyuezX3WSiujRSMDROOLkZWVJyP5AZvru20t4 1Cyw3hrA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gCUJE-0000vZ-Hw; Tue, 16 Oct 2018 18:43:12 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gCUJ5-0000rg-09 for ath10k@lists.infradead.org; Tue, 16 Oct 2018 18:43:05 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 057C561320; Tue, 16 Oct 2018 18:42:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1539715379; bh=VwOuUUTs5I4FpiQqbOm4qFTSAjMsp8Mb9KuaWdZYemk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cDVd4EjFFneJR7BIpaoEWiLok3sgimYtowx0K4MOwXTDDvkVokd4/1yLLALWEVfgN 03Wt28lptOfNz3pTE+QOSO4RgRDn6auhgtAkjNa4Wz/MN/wQdhUrZYtH7DYYivplhn erwCPDdjPqbubD0v4JH2dMIXcljGzK+/OPJwTpWU= Received: from cheath10p342229-lin.qca.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: tamizhr@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 2B039612F6; Tue, 16 Oct 2018 18:42:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1539715377; bh=VwOuUUTs5I4FpiQqbOm4qFTSAjMsp8Mb9KuaWdZYemk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jbRdMY+89Qw72oin9Wlu9gmEIeASUQrxMuYNgMPV3bcYM9PM8A+ZPXzj0/pwvbIix 6p3bUSzlK4s3plpbLvv2UYtGQb5raoBpJBsSyvGfzJKtL2q+f76NjcZPDglNZjfZPs OcICOyxi8Lp3Fw/YQjdkKwXq36uhZ1VzW/Je7ovY= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 2B039612F6 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=tamizhr@codeaurora.org From: Tamizh chelvam To: ath10k@lists.infradead.org, johannes@sipsolutions.net Subject: [PATCH 3/6] mac80211: Apply per-peer NoAck tid bitmap configuration Date: Wed, 17 Oct 2018 00:11:08 +0530 Message-Id: <1539715271-14325-4-git-send-email-tamizhr@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1539715271-14325-1-git-send-email-tamizhr@codeaurora.org> References: <1539715271-14325-1-git-send-email-tamizhr@codeaurora.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181016_114303_112568_1C681A14 X-CRM114-Status: GOOD ( 19.39 ) X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vasanthakumar Thiagarajan , linux-wireless@vger.kernel.org, Tamizh chelvam MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Vasanthakumar Thiagarajan Use per-peer NoAck tid bitmap, if it is configured, when setting up the qos header. If the NoAck tid bitmap is default (-1) for a peer, use the netdev wide noack policy configuration. The NoAck tid bitmap for newly connected stations is set to default (-1). Also modifies callback set_noack_tid_bitmap() with the provision to send per-peer NoAck policy configuration to the drivers. Signed-off-by: Vasanthakumar Thiagarajan Signed-off-by: Tamizh chelvam --- include/net/mac80211.h | 14 ++++++++++---- net/mac80211/cfg.c | 43 ++++++++++++++++++++++++++++++++++++++----- net/mac80211/driver-ops.h | 3 ++- net/mac80211/iface.c | 2 +- net/mac80211/sta_info.c | 2 ++ net/mac80211/sta_info.h | 3 +++ net/mac80211/tx.c | 4 +++- net/mac80211/wme.c | 34 +++++++++++++++++++++++++++++++++- 8 files changed, 92 insertions(+), 13 deletions(-) diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 5ce7ce7..b6cc3e33 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h @@ -3624,9 +3624,14 @@ enum ieee80211_reconfig_type { * @get_ftm_responder_stats: Retrieve FTM responder statistics, if available. * Statistics should be cumulative, currently no way to reset is provided. * - * @set_noack_tid_bitmap: Set NoAck policy TID bitmap for a virtual interface. - * Drivers mplementing this callback must take care of setting NoAck policy - * in QOS control field based on the configured TID bitmap. + * @set_noack_tid_bitmap: Set NoAck policy TID bitmap. Apply the TID NoAck + * configuration for a particular station when @sta is non-NULL. NoAck + * policy is set to default for a peer when noack_map is -1 for the peer. + * The default NoAck policy for a peer is using netdev NoAck policy. + * When @sta is NULL, apply TID NoAck configuration at virtual interface + * level. Drivers mplementing this callback must take care of setting NoAck + * policy in QOS control field based on the configured TID bitmap. + * This callback may sleep. */ struct ieee80211_ops { void (*tx)(struct ieee80211_hw *hw, @@ -3917,7 +3922,8 @@ struct ieee80211_ops { struct cfg80211_ftm_responder_stats *ftm_stats); int (*set_noack_tid_bitmap)(struct ieee80211_hw *hw, - struct ieee80211_vif *vif, int noack_map); + struct ieee80211_vif *vif, + struct ieee80211_sta *sta, int noack_map); }; /** diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 7a7e423..02e6d49 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -344,18 +344,51 @@ static int ieee80211_set_noack_map(struct wiphy *wiphy, int noack_map) { struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); + struct sta_info *sta; + int ret; - sdata->noack_map = noack_map; + if (!peer) { + sdata->noack_map = noack_map; - if (!sdata->local->ops->set_noack_tid_bitmap) { - ieee80211_check_fast_xmit_iface(sdata); - return 0; + if (!sdata->local->ops->set_noack_tid_bitmap) { + ieee80211_check_fast_xmit_iface(sdata); + return 0; + } + + if (!ieee80211_sdata_running(sdata)) + return 0; + + return drv_set_noack_tid_bitmap(sdata->local, sdata, NULL, + noack_map); } + /* NoAck policy is for a connected client on the dev */ + if (!ieee80211_sdata_running(sdata)) + return -ENETDOWN; + + mutex_lock(&sdata->local->sta_mtx); + + sta = sta_info_get_bss(sdata, peer); + if (!sta) { + mutex_unlock(&sdata->local->sta_mtx); + return -ENOENT; + } + + sta->noack_map = noack_map; + + if (!sdata->local->ops->set_noack_tid_bitmap) { + ieee80211_check_fast_xmit(sta); + mutex_unlock(&sdata->local->sta_mtx); return 0; + } + + ret = drv_set_noack_tid_bitmap(sdata->local, sdata, + &sta->sta, noack_map); - return drv_set_noack_tid_bitmap(sdata->local, sdata, noack_map); + mutex_unlock(&sdata->local->sta_mtx); + + return ret; } static int ieee80211_add_key(struct wiphy *wiphy, struct net_device *dev, diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h index d705938..ed9bd59 100644 --- a/net/mac80211/driver-ops.h +++ b/net/mac80211/driver-ops.h @@ -1280,6 +1280,7 @@ static inline void drv_del_nan_func(struct ieee80211_local *local, static inline int drv_set_noack_tid_bitmap(struct ieee80211_local *local, struct ieee80211_sub_if_data *sdata, + struct ieee80211_sta *sta, int noack_map) { int ret; @@ -1293,7 +1294,7 @@ static inline int drv_set_noack_tid_bitmap(struct ieee80211_local *local, trace_drv_set_noack_tid_bitmap(local, sdata, noack_map); ret = local->ops->set_noack_tid_bitmap(&local->hw, &sdata->vif, - noack_map); + sta, noack_map); trace_drv_return_int(local, ret); return ret; diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index 06106f2..4999977 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c @@ -635,7 +635,7 @@ int ieee80211_do_open(struct wireless_dev *wdev, bool coming_up) goto err_del_interface; if (sdata->noack_map) - drv_set_noack_tid_bitmap(local, sdata, + drv_set_noack_tid_bitmap(local, sdata, NULL, sdata->noack_map); } diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c index fb8c225..d2ea8ee 100644 --- a/net/mac80211/sta_info.c +++ b/net/mac80211/sta_info.c @@ -606,6 +606,8 @@ static int sta_info_insert_finish(struct sta_info *sta) __acquires(RCU) cfg80211_new_sta(sdata->dev, sta->sta.addr, sinfo, GFP_KERNEL); kfree(sinfo); + sta->noack_map = -1; + sta_dbg(sdata, "Inserted STA %pM\n", sta->sta.addr); /* move reference to rcu-protected */ diff --git a/net/mac80211/sta_info.h b/net/mac80211/sta_info.h index 9a04327..863601a 100644 --- a/net/mac80211/sta_info.h +++ b/net/mac80211/sta_info.h @@ -583,6 +583,9 @@ struct sta_info { struct cfg80211_chan_def tdls_chandef; + /* TID bitmap for station's NoAck policy */ + int noack_map; + /* keep last! */ struct ieee80211_sta sta; }; diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index d744c4b..b57cd1f 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -2872,7 +2872,9 @@ void ieee80211_check_fast_xmit(struct sta_info *sta) test_sta_flag(sta, WLAN_STA_CLEAR_PS_FILT)) goto out; - if (sdata->noack_map && !local->ops->set_noack_tid_bitmap) + if (((sta->noack_map == -1 && sdata->noack_map) || + (sta->noack_map != -1 && sta->noack_map)) && + !local->ops->set_noack_tid_bitmap) goto out; /* fast-xmit doesn't handle fragmentation at all */ diff --git a/net/mac80211/wme.c b/net/mac80211/wme.c index 11c14b9..b1722b8 100644 --- a/net/mac80211/wme.c +++ b/net/mac80211/wme.c @@ -227,6 +227,38 @@ u16 ieee80211_select_queue(struct ieee80211_sub_if_data *sdata, } /** + * ieee80211_get_noack_map - Get TID bitmap of NoAck policy. NoAck policy + * could be device wide or per-station. + * + * @sdata: local subif + * @mac: MAC address of the receiver + */ +int ieee80211_get_noack_map(struct ieee80211_sub_if_data *sdata, const u8 *mac) +{ + struct sta_info *sta; + int noack_map = 0; + + /* Retrieve per-station noack_map config for the receiver, if any */ + + rcu_read_lock(); + + sta = sta_info_get(sdata, mac); + if (!sta) { + rcu_read_unlock(); + return noack_map; + } + + noack_map = sta->noack_map; + + rcu_read_unlock(); + + if (noack_map == -1) + noack_map = sdata->noack_map; + + return noack_map; +} + +/** * ieee80211_set_qos_hdr - Fill in the QoS header if there is one. * * @sdata: local subif @@ -257,7 +289,7 @@ void ieee80211_set_qos_hdr(struct ieee80211_sub_if_data *sdata, if (is_multicast_ether_addr(hdr->addr1) || (!sdata->local->ops->set_noack_tid_bitmap && - sdata->noack_map & BIT(tid))) { + ieee80211_get_noack_map(sdata, hdr->addr1) & BIT(tid))) { flags |= IEEE80211_QOS_CTL_ACK_POLICY_NOACK; info->flags |= IEEE80211_TX_CTL_NO_ACK; } From patchwork Tue Oct 16 18:41:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tamizh chelvam X-Patchwork-Id: 10644141 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E7743157A for ; Tue, 16 Oct 2018 18:43:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D8D6D288F1 for ; Tue, 16 Oct 2018 18:43:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CCE4B287A2; Tue, 16 Oct 2018 18:43:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7F549287A2 for ; Tue, 16 Oct 2018 18:43:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=cLkey/EbFQG1ymOamJaky9yGLI/iE5/rh7uM1ILcunc=; b=Fz7eRwIdoZh+MWHOKNupckHU+d jqkK3C1AMuEMgsq2J3XTYfadTaiKRag4ZT1qRR3tzVSqhlAG31+zKf17tIMSUJYkxpscJbsasIE6K D+EV+SJfgJOMKC1DKj8FhlprjQMaavVNkjqaB7MHkKGyfhLma7kDpL0Yusc5iOX5V3ak+1kYyUpwG NthlobNbBiG8xYBS6Z4DPGyzOjf1A9x/0aeFhBvXJjt2+kX3k5dMheBADxomTDGq4WAfN/0fCUEpH Xf6IV/MyQETkm3VfZHYDhuAQDftYNBRdA/atvDynH+XHHK1Bh1BqHlwx/Oz6mjNskbK3tqMosW5ze Gbxtc3fw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gCUJU-00013n-Pt; Tue, 16 Oct 2018 18:43:28 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gCUJ5-0000rn-9M for ath10k@lists.infradead.org; Tue, 16 Oct 2018 18:43:06 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 2DAC761325; Tue, 16 Oct 2018 18:43:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1539715380; bh=CYEYBNcn/sBlpt1MycMnFGEJ2cN1njvKHe/uBmtiU2U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Is/vWkzbfbLk1wcjV6Fs6CfhpFDw7Vl1zRx3dKDN+XFi1GpANQKY6xXXmzLkPMddq h7Y1Eqb7a43hyAHovfKncUW15vRJqlh757xDhmPAgnu4bAaMaouP5UeGFbqineWG71 s96hYJGaLbwxRXBuzY6I54/+6658fhxBSp3stDpc= Received: from cheath10p342229-lin.qca.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: tamizhr@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 522BB60558; Tue, 16 Oct 2018 18:42:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1539715379; bh=CYEYBNcn/sBlpt1MycMnFGEJ2cN1njvKHe/uBmtiU2U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gcoTMYZaSJP6MRZtgkHhJR1rxhNBFAmXVNlD9OCJiG3K72AyvRLHpbgxsAWTcfaH6 wBt8D5h/v93HAdE8EMpJFk3qONN66nZ995kWdJVxBEB7sgVWR4P/6HLm5R1AWbvFOa m+CC99bdNuCHn01IY9L4fNSLQUibYofzzWjxEPbE= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 522BB60558 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=tamizhr@codeaurora.org From: Tamizh chelvam To: ath10k@lists.infradead.org, johannes@sipsolutions.net Subject: [PATCH 4/6] mac80211: Advertise per-peer NoAck policy support Date: Wed, 17 Oct 2018 00:11:09 +0530 Message-Id: <1539715271-14325-5-git-send-email-tamizhr@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1539715271-14325-1-git-send-email-tamizhr@codeaurora.org> References: <1539715271-14325-1-git-send-email-tamizhr@codeaurora.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181016_114303_373097_B5CF7AD8 X-CRM114-Status: UNSURE ( 8.81 ) X-CRM114-Notice: Please train this message. X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vasanthakumar Thiagarajan , linux-wireless@vger.kernel.org, Tamizh chelvam MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Vasanthakumar Thiagarajan This enables per-peer NoAck handling in mac80211 when the functionality is not offloaded to the drivers. Signed-off-by: Vasanthakumar Thiagarajan Signed-off-by: Tamizh chelvam --- net/mac80211/main.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/net/mac80211/main.c b/net/mac80211/main.c index 83e71e6..698cf56 100644 --- a/net/mac80211/main.c +++ b/net/mac80211/main.c @@ -597,6 +597,10 @@ struct ieee80211_hw *ieee80211_alloc_hw_nm(size_t priv_data_len, wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_RRM); + if (!ops->set_noack_tid_bitmap) + wiphy_ext_feature_set(wiphy, + NL80211_EXT_FEATURE_PER_STA_NOACK_MAP); + wiphy->bss_priv_size = sizeof(struct ieee80211_bss); local = wiphy_priv(wiphy); From patchwork Tue Oct 16 18:41:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tamizh chelvam X-Patchwork-Id: 10644147 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9E2AB157A for ; Tue, 16 Oct 2018 18:44:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8D61928ECB for ; Tue, 16 Oct 2018 18:44:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 815FC2915F; Tue, 16 Oct 2018 18:44:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 05C9C28ECB for ; Tue, 16 Oct 2018 18:44:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=TwMIFfdvi6sL6ZaXOw2bPpwA7R0fn1J17pLLScO8RTw=; b=FZnXcfbMHpEqmE/NEIlRSVflsH 4xfozYLFbPwGdNekAN04V8m7lJ/XTwJbkoGzFfClHFSZAmJaouVBoszbdmGxYXLJBBS9Kv2HpGK/x VayGXkbK5jH8UTcjariQ0ofD9V2DyYkyaGzcyri3dBlskh0ryfTaWNV7gXBuIdbCsWlOxSZAaKQ7T o6p3tsywdGER2l9DYqCZLS/qs6zSlPhWePc00WeIO9qZ+XHl2PsOhY4KAbaHBFs/rXu5EJKxj8NAM JTgznkfQwBAEhk+ebmWwIaM1R8gnbYdE/ZTpI99jZbcqjhTyEyfIXkBsS5A1exx+NCZGx7KBKKmWg KVFIY8Fg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gCUK5-0001L7-AK; Tue, 16 Oct 2018 18:44:05 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gCUJH-0000tk-0h for ath10k@lists.infradead.org; Tue, 16 Oct 2018 18:43:29 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 8DE91612F6; Tue, 16 Oct 2018 18:43:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1539715382; bh=82m2gsDQbZXrDpXY1XyFC5VJxW+ZGNw7dplweqRPZKg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JZQ4dAblzLJD6j83Vl0n9cGlX9aAy2gOENFJ0LUXx3TLHVpNCv22zpM6b5oUJt5GJ T9fIFb7MDupm+7d2wdJ2HRIO/oJwehYTjuC0znjg/mOxzC7M/0v3ZAE5GktzvSOTLJ ULkmAUbxOtD0WjhE38UVm4XymdqP5A4Yny26Li8g= Received: from cheath10p342229-lin.qca.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: tamizhr@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 7328A61322; Tue, 16 Oct 2018 18:43:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1539715381; bh=82m2gsDQbZXrDpXY1XyFC5VJxW+ZGNw7dplweqRPZKg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Sm0wE2SZgkIAg34Y5TEMvdyAcnIpV5r2CYie/oj4HbmdDImsAlgGLYSaGOu7lVWHa jNan7+zxUtzgnoF+tseKWx8gXe/ucrr2jBgBrqVYDhnEL7ciSSwlCtKKppoV6234e2 k5NRNRJkF3HWuT4enHqBCbe4IQo+tFzrBURpB+1c= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 7328A61322 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=tamizhr@codeaurora.org From: Tamizh chelvam To: ath10k@lists.infradead.org, johannes@sipsolutions.net Subject: [PATCH 5/6] ath10k: Add wmi command support for station specific TID config Date: Wed, 17 Oct 2018 00:11:10 +0530 Message-Id: <1539715271-14325-6-git-send-email-tamizhr@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1539715271-14325-1-git-send-email-tamizhr@codeaurora.org> References: <1539715271-14325-1-git-send-email-tamizhr@codeaurora.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181016_114315_177742_9F51A1B9 X-CRM114-Status: GOOD ( 11.59 ) X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-wireless@vger.kernel.org, Tamizh chelvam MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds WMI interface to support station specific TID configuration like setting noack policy. Host needs to send station's MAC address, ack policy and TID info to target through WMI_10_4_PER_PEER_PER_TID_CONFIG_CMDID. WMI_SERVICE_PEER_TID_CONFIGS_SUPPORT flag is added to advertise this support. Testing: * Tested HW: QCA9888 * Tested FW: 10.4-3.5.1-00052 Signed-off-by: Tamizh chelvam --- drivers/net/wireless/ath/ath10k/wmi-ops.h | 19 ++++++++++++ drivers/net/wireless/ath/ath10k/wmi.c | 29 ++++++++++++++++++ drivers/net/wireless/ath/ath10k/wmi.h | 50 +++++++++++++++++++++++++++++++ 3 files changed, 98 insertions(+) diff --git a/drivers/net/wireless/ath/ath10k/wmi-ops.h b/drivers/net/wireless/ath/ath10k/wmi-ops.h index 7978a77..65be00e 100644 --- a/drivers/net/wireless/ath/ath10k/wmi-ops.h +++ b/drivers/net/wireless/ath/ath10k/wmi-ops.h @@ -219,6 +219,8 @@ struct wmi_ops { struct sk_buff *(*gen_echo)(struct ath10k *ar, u32 value); struct sk_buff *(*gen_pdev_get_tpc_table_cmdid)(struct ath10k *ar, u32 param); + struct sk_buff *(*gen_per_peer_per_tid_cfg)(struct ath10k *ar, + const struct wmi_per_peer_per_tid_cfg_arg *arg); }; @@ -1576,4 +1578,21 @@ struct wmi_ops { ar->wmi.cmd->radar_found_cmdid); } +static inline int +ath10k_wmi_set_per_peer_per_tid_cfg(struct ath10k *ar, + const struct wmi_per_peer_per_tid_cfg_arg *arg) +{ + struct sk_buff *skb; + + if (!ar->wmi.ops->gen_per_peer_per_tid_cfg) + return -EOPNOTSUPP; + + skb = ar->wmi.ops->gen_per_peer_per_tid_cfg(ar, arg); + if (IS_ERR(skb)) + return PTR_ERR(skb); + + return ath10k_wmi_cmd_send(ar, skb, + ar->wmi.cmd->per_peer_per_tid_config_cmdid); +} + #endif diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c index 25e8fa7..14fdc94 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.c +++ b/drivers/net/wireless/ath/ath10k/wmi.c @@ -750,6 +750,7 @@ .tdls_peer_update_cmdid = WMI_10_4_TDLS_PEER_UPDATE_CMDID, .tdls_set_offchan_mode_cmdid = WMI_10_4_TDLS_SET_OFFCHAN_MODE_CMDID, .radar_found_cmdid = WMI_10_4_RADAR_FOUND_CMDID, + .per_peer_per_tid_config_cmdid = WMI_10_4_PER_PEER_PER_TID_CONFIG_CMDID, }; /* MAIN WMI VDEV param map */ @@ -8744,6 +8745,33 @@ static u32 ath10k_wmi_prepare_peer_qos(u8 uapsd_queues, u8 sp) } static struct sk_buff * +ath10k_wmi_10_4_gen_per_peer_per_tid_cfg(struct ath10k *ar, + const struct wmi_per_peer_per_tid_cfg_arg *arg) +{ + struct wmi_peer_per_tid_cfg_cmd *cmd; + struct sk_buff *skb; + + skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd)); + if (!skb) + return ERR_PTR(-ENOMEM); + + memset(skb->data, 0, sizeof(*cmd)); + + cmd = (struct wmi_peer_per_tid_cfg_cmd *)skb->data; + cmd->vdev_id = cpu_to_le32(arg->vdev_id); + ether_addr_copy(cmd->peer_macaddr.addr, arg->peer_macaddr.addr); + cmd->tid = cpu_to_le32(arg->tid); + cmd->ack_policy = cpu_to_le32(arg->ack_policy); + cmd->aggr_control = cpu_to_le32(arg->aggr_control); + cmd->rate_control = cpu_to_le32(arg->rate_ctrl); + + ath10k_dbg(ar, ATH10K_DBG_WMI, + "wmi noack tid %d vdev id %d ack_policy %d aggr %u rate %u mac_addr %pM\n", + arg->tid, arg->vdev_id, arg->ack_policy, arg->aggr_control, arg->rate_ctrl, arg->peer_macaddr.addr); + return skb; +} + +static struct sk_buff * ath10k_wmi_op_gen_echo(struct ath10k *ar, u32 value) { struct wmi_echo_cmd *cmd; @@ -9128,6 +9156,7 @@ static u32 ath10k_wmi_prepare_peer_qos(u8 uapsd_queues, u8 sp) .gen_pdev_get_tpc_table_cmdid = ath10k_wmi_10_4_op_gen_pdev_get_tpc_table_cmdid, .gen_radar_found = ath10k_wmi_10_4_gen_radar_found, + .gen_per_peer_per_tid_cfg = ath10k_wmi_10_4_gen_per_peer_per_tid_cfg, /* shared with 10.2 */ .pull_echo_ev = ath10k_wmi_op_pull_echo_ev, diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h index f7badd0..d3571b6 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.h +++ b/drivers/net/wireless/ath/ath10k/wmi.h @@ -205,6 +205,7 @@ enum wmi_service { WMI_SERVICE_SPOOF_MAC_SUPPORT, WMI_SERVICE_TX_DATA_ACK_RSSI, WMI_SERVICE_VDEV_DIFFERENT_BEACON_INTERVAL_SUPPORT, + WMI_SERVICE_PEER_TID_CONFIGS_SUPPORT, /* keep last */ WMI_SERVICE_MAX, @@ -474,6 +475,7 @@ static inline char *wmi_service_name(int service_id) SVCSTR(WMI_SERVICE_RESET_CHIP); SVCSTR(WMI_SERVICE_TX_DATA_ACK_RSSI); SVCSTR(WMI_SERVICE_VDEV_DIFFERENT_BEACON_INTERVAL_SUPPORT); + SVCSTR(WMI_SERVICE_PEER_TID_CONFIGS_SUPPORT); default: return NULL; } @@ -786,6 +788,8 @@ static inline void wmi_10_4_svc_map(const __le32 *in, unsigned long *out, WMI_SERVICE_TX_DATA_ACK_RSSI, len); SVCMAP(WMI_10_4_SERVICE_VDEV_DIFFERENT_BEACON_INTERVAL_SUPPORT, WMI_SERVICE_VDEV_DIFFERENT_BEACON_INTERVAL_SUPPORT, len); + SVCMAP(WMI_10_4_SERVICE_PEER_TID_CONFIGS_SUPPORT, + WMI_SERVICE_PEER_TID_CONFIGS_SUPPORT, len); } #undef SVCMAP @@ -986,6 +990,7 @@ struct wmi_cmd_map { u32 pdev_wds_entry_list_cmdid; u32 tdls_set_offchan_mode_cmdid; u32 radar_found_cmdid; + u32 per_peer_per_tid_config_cmdid; }; /* @@ -1825,6 +1830,8 @@ enum wmi_10_4_cmd_id { WMI_10_4_PDEV_SET_BRIDGE_MACADDR_CMDID, WMI_10_4_ATF_GROUP_WMM_AC_CONFIG_REQUEST_CMDID, WMI_10_4_RADAR_FOUND_CMDID, + WMI_10_4_PEER_CFR_CAPTURE_CMDID, + WMI_10_4_PER_PEER_PER_TID_CONFIG_CMDID, WMI_10_4_PDEV_UTF_CMDID = WMI_10_4_END_CMDID - 1, }; @@ -7053,6 +7060,49 @@ struct wmi_tdls_peer_event { __le32 vdev_id; } __packed; +enum wmi_tid_aggr_control_conf { + WMI_TID_CONFIG_AGGR_CONTROL_IGNORE, + WMI_TID_CONFIG_AGGR_CONTROL_ENABLE, + WMI_TID_CONFIG_AGGR_CONTROL_DISABLE, +}; + +enum wmi_noack_tid_conf { + WMI_NOACK_TID_CONFIG_IGNORE_ACK_POLICY, + WMI_PEER_TID_CONFIG_ACK, + WMI_PEER_TID_CONFIG_NOACK, +}; + +enum wmi_tid_rate_ctrl_conf { + WMI_TID_CONFIG_RATE_CONTROL_IGNORE, + WMI_TID_CONFIG_RATE_CONTROL_AUTO, + WMI_TID_CONFIG_RATE_CONTROL_FIXED_RATE, + WMI_TID_CONFIG_RATE_CONTROL_DEFAULT_LOWEST_RATE, +}; + +struct wmi_per_peer_per_tid_cfg_arg { + u32 vdev_id; + struct wmi_mac_addr peer_macaddr; + u32 tid; + enum wmi_noack_tid_conf ack_policy; + enum wmi_tid_aggr_control_conf aggr_control; + enum wmi_tid_rate_ctrl_conf rate_ctrl; +}; + +struct wmi_peer_per_tid_cfg_cmd { + __le32 vdev_id; + struct wmi_mac_addr peer_macaddr; + __le32 tid; + + /* see enum wmi_noack_tid_conf */ + __le32 ack_policy; + /* see enum wmi_tid_aggr_control_conf */ + __le32 aggr_control; + /* see enum wmi_tid_rate_ctrl_conf */ + __le32 rate_control; + __le32 rcode_rcflags; + __le32 sw_retry_threshold; +} __packed; + enum wmi_txbf_conf { WMI_TXBF_CONF_UNSUPPORTED, WMI_TXBF_CONF_BEFORE_ASSOC, From patchwork Tue Oct 16 18:41:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tamizh chelvam X-Patchwork-Id: 10644149 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4E93E109C for ; Tue, 16 Oct 2018 18:44:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3F80328ECB for ; Tue, 16 Oct 2018 18:44:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 33F542915F; Tue, 16 Oct 2018 18:44:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6942F28ECB for ; Tue, 16 Oct 2018 18:44:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=lcUctPub0eTuQq1b5qtX30OmHsxV+zZ667ODNVY84IY=; b=hJKDqtolRcf4LG8ZFoziUdEJg6 Z/m+VUMF9dl41ZYpMzzvS+zb4fhKTB/JBZQnwqX6LkskEP0Jyar4uGVmcAzJ5bphY1X0KJM15RH5C lB/Es1u/DI5F/XkcRaaRz/Vlr91LCiys+c/gTl0/zc7gvxTIv9vFhumZzG2k1rZIlPqPfL7w0VtWw HHNEzASZCwOFz7SkJ9x5k4Sq55JaBoiX+BqB3zNqPTDfena4O1d2uAvLOVeG59gS4RhD+7c1zq+aT UJ19MfrK93EKOQMRIQ6njcEv+yYudQ9zVUsS1riiTyP8FYBpULc7u7fjNkx8X1wrCbbd8MMAoWY3V dGnlHAaQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gCUKF-0001Pb-DJ; Tue, 16 Oct 2018 18:44:15 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gCUJH-0000uW-0g for ath10k@lists.infradead.org; Tue, 16 Oct 2018 18:43:36 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id D96B26021C; Tue, 16 Oct 2018 18:43:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1539715388; bh=aqvMJJAZTsxuImCpcfdG+ohEtAHpCsmXdGsyESGiXts=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ay8X8j1AA3vxSKDGitYlU4IxVYYEr8WJ39jfPL/7B7SI7c7bvZqCgN0Mn7WDclOhE Bg5bUMIZVmTp+gKJ62Or6h6jhkRqjDTmC4yxICJxU/mQP/DnsOMKdmk+Tmnt1XrBZ6 xLl/7SLnu8RuMaVkwBB1Mv9cW2yiJX7Ns+OfxtMQ= Received: from cheath10p342229-lin.qca.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: tamizhr@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 63BE46021C; Tue, 16 Oct 2018 18:43:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1539715384; bh=aqvMJJAZTsxuImCpcfdG+ohEtAHpCsmXdGsyESGiXts=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RWjH62Ry2tuehYklFI/1aYPdRzUlkX4ACh9v5Wh35nEm3rCh78LG4kRxMpRp3zYCU yxya4Z0hKLL6JhEGhX+b9mkq52/UvtkacJ25tVFbmpAbaVJWyYat+UzqcfKROoQB/B ZjS1nHUBkp5ERnPUNMFfKQmPO2J0GhR9IYY6AzXs= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 63BE46021C Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=tamizhr@codeaurora.org From: Tamizh chelvam To: ath10k@lists.infradead.org, johannes@sipsolutions.net Subject: [PATCH 6/6] ath10k: Add support for station specific noack TID policy Date: Wed, 17 Oct 2018 00:11:11 +0530 Message-Id: <1539715271-14325-7-git-send-email-tamizhr@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1539715271-14325-1-git-send-email-tamizhr@codeaurora.org> References: <1539715271-14325-1-git-send-email-tamizhr@codeaurora.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181016_114315_241094_3350EBB1 X-CRM114-Status: GOOD ( 20.14 ) X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-wireless@vger.kernel.org, Tamizh chelvam MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This patch add ops for set_noack_tid_bitmap to support station specific noack policy functionality for a TID. TID will be parsed from noack_map parameter and pass to target with station's mac address and the ack policy, and the value is stored in arsta. Suppose if the station entry is not mentioned in the command, the configuration will be applied for all the connected stations in the vif which have default value(-1) in the arsta structure. And this will be applied for newly connecting station as well. ATH10K_SKB_F_NOACK_TID skb cb flag introduced to avoid setting IEEE80211_TX_STAT_ACK flag in the tx completion. WMI_SERVICE_PEER_TID_CONFIGS_SUPPORT flag is added to advertise this command support Testing: * Tested HW: QCA9888 * Tested FW: 10.4-3.5.1-00052 Signed-off-by: Tamizh chelvam --- drivers/net/wireless/ath/ath10k/core.h | 11 +++ drivers/net/wireless/ath/ath10k/mac.c | 172 ++++++++++++++++++++++++++++++++- drivers/net/wireless/ath/ath10k/txrx.c | 12 ++- 3 files changed, 188 insertions(+), 7 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h index 0424180..418eb19 100644 --- a/drivers/net/wireless/ath/ath10k/core.h +++ b/drivers/net/wireless/ath/ath10k/core.h @@ -90,6 +90,9 @@ /* The magic used by QCA spec */ #define ATH10K_SMBIOS_BDF_EXT_MAGIC "BDF_" +/* Number of TID target accepts from host */ +#define ATH10K_MAX_TIDS 0x8 + struct ath10k; static inline const char *ath10k_bus_str(enum ath10k_bus bus) @@ -116,6 +119,7 @@ enum ath10k_skb_flags { ATH10K_SKB_F_DELIVER_CAB = BIT(2), ATH10K_SKB_F_MGMT = BIT(3), ATH10K_SKB_F_QOS = BIT(4), + ATH10K_SKB_F_NOACK_TID = BIT(5), }; struct ath10k_skb_cb { @@ -498,6 +502,10 @@ struct ath10k_sta { u64 rx_duration; struct ath10k_htt_tx_stats *tx_stats; + /* TID bitmap for station's NoAck policy, protected by conf_mutex */ + int noack_map; + struct work_struct noack_map_wk; + #ifdef CONFIG_MAC80211_DEBUGFS /* protected by conf_mutex */ bool aggr_mode; @@ -573,6 +581,9 @@ struct ath10k_vif { struct work_struct ap_csa_work; struct delayed_work connection_loss_work; struct cfg80211_bitrate_mask bitrate_mask; + + /* TID bitmap for station's NoAck policy, protected by conf_mutex */ + int noack_map; }; struct ath10k_vif_iter { diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index a1c2801..54ec919 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -2940,6 +2940,39 @@ static void ath10k_bss_disassoc(struct ieee80211_hw *hw, cancel_delayed_work_sync(&arvif->connection_loss_work); } +static int +ath10k_mac_set_noack_tid_bitmap(struct ath10k *ar, + struct wmi_per_peer_per_tid_cfg_arg *arg, + int noack_map) +{ + int tid, ret; + + for (tid = 0; tid < ATH10K_MAX_TIDS; tid++) { + if (noack_map & BIT(tid)) { + arg->ack_policy = WMI_PEER_TID_CONFIG_NOACK; + /* It is preferred to transmit the noack policy frames + * in basic rate. for 5G -> 6Mbps 2G -> 1Mbps + */ + arg->rate_ctrl = + WMI_TID_CONFIG_RATE_CONTROL_DEFAULT_LOWEST_RATE; + arg->aggr_control = WMI_TID_CONFIG_AGGR_CONTROL_DISABLE; + } else { + arg->ack_policy = WMI_PEER_TID_CONFIG_ACK; + arg->rate_ctrl = WMI_TID_CONFIG_RATE_CONTROL_AUTO; + arg->aggr_control = WMI_TID_CONFIG_AGGR_CONTROL_ENABLE; + } + + arg->tid = tid; + ret = ath10k_wmi_set_per_peer_per_tid_cfg(ar, arg); + if (ret) { + ath10k_warn(ar, "failed to set noack map for STA %pM for vdev %i: %d\n", + arg->peer_macaddr.addr, arg->vdev_id, ret); + break; + } + } + return ret; +} + static int ath10k_station_assoc(struct ath10k *ar, struct ieee80211_vif *vif, struct ieee80211_sta *sta, @@ -2947,6 +2980,7 @@ static int ath10k_station_assoc(struct ath10k *ar, { struct ath10k_vif *arvif = (void *)vif->drv_priv; struct wmi_peer_assoc_complete_arg peer_arg; + struct ath10k_sta *arsta = (struct ath10k_sta *)sta->drv_priv; int ret = 0; lockdep_assert_held(&ar->conf_mutex); @@ -3005,6 +3039,23 @@ static int ath10k_station_assoc(struct ath10k *ar, } } + if (arvif->noack_map) { + struct wmi_per_peer_per_tid_cfg_arg arg = {}; + + arg.vdev_id = arvif->vdev_id; + ether_addr_copy(arg.peer_macaddr.addr, sta->addr); + + ret = ath10k_mac_set_noack_tid_bitmap(ar, &arg, + arvif->noack_map); + if (ret) + return ret; + } + + /* Assign default noack_map value (-1) to newly connecting station. + * This default value used to identify the station configured with + * vif specific noack configuration rather than station specific. + */ + arsta->noack_map = -1; return ret; } @@ -3543,10 +3594,15 @@ static void ath10k_tx_h_add_p2p_noa_ie(struct ath10k *ar, static void ath10k_mac_tx_h_fill_cb(struct ath10k *ar, struct ieee80211_vif *vif, struct ieee80211_txq *txq, + struct ieee80211_sta *sta, struct sk_buff *skb) { struct ieee80211_hdr *hdr = (void *)skb->data; struct ath10k_skb_cb *cb = ATH10K_SKB_CB(skb); + struct ath10k_vif *arvif = (void *)vif->drv_priv; + int noack_map = arvif->noack_map; + struct ath10k_sta *arsta; + u8 tid, *p; cb->flags = 0; if (!ath10k_tx_h_use_hwcrypto(vif, skb)) @@ -3555,8 +3611,20 @@ static void ath10k_mac_tx_h_fill_cb(struct ath10k *ar, if (ieee80211_is_mgmt(hdr->frame_control)) cb->flags |= ATH10K_SKB_F_MGMT; - if (ieee80211_is_data_qos(hdr->frame_control)) + if (ieee80211_is_data_qos(hdr->frame_control)) { cb->flags |= ATH10K_SKB_F_QOS; + p = ieee80211_get_qos_ctl(hdr); + tid = (*p) & IEEE80211_QOS_CTL_TID_MASK; + + if (sta) { + arsta = (struct ath10k_sta *)sta->drv_priv; + if (arsta->noack_map != -1) + noack_map = arsta->noack_map; + } + + if (noack_map & BIT(tid)) + cb->flags |= ATH10K_SKB_F_NOACK_TID; + } cb->vif = vif; cb->txq = txq; @@ -3987,7 +4055,7 @@ int ath10k_mac_tx_push_txq(struct ieee80211_hw *hw, return -ENOENT; } - ath10k_mac_tx_h_fill_cb(ar, vif, txq, skb); + ath10k_mac_tx_h_fill_cb(ar, vif, txq, sta, skb); skb_len = skb->len; txmode = ath10k_mac_tx_h_get_txmode(ar, vif, sta, skb); @@ -4258,7 +4326,7 @@ static void ath10k_mac_op_tx(struct ieee80211_hw *hw, bool is_presp; int ret; - ath10k_mac_tx_h_fill_cb(ar, vif, txq, skb); + ath10k_mac_tx_h_fill_cb(ar, vif, txq, sta, skb); txmode = ath10k_mac_tx_h_get_txmode(ar, vif, sta, skb); txpath = ath10k_mac_tx_h_get_txpath(ar, skb, txmode); @@ -6247,6 +6315,42 @@ static void ath10k_mac_dec_num_stations(struct ath10k_vif *arvif, ar->num_stations--; } +struct ath10k_mac_iter_noack_map_data { + struct ieee80211_vif *curr_vif; + struct ath10k *ar; +}; + +static void ath10k_sta_set_noack_tid_bitmap(struct work_struct *wk) +{ + struct wmi_per_peer_per_tid_cfg_arg arg = {}; + struct ieee80211_sta *sta; + struct ath10k_sta *arsta; + struct ath10k_vif *arvif; + struct ath10k *ar; + + arsta = container_of(wk, struct ath10k_sta, noack_map_wk); + sta = container_of((void *)arsta, struct ieee80211_sta, drv_priv); + arvif = arsta->arvif; + ar = arvif->ar; + + arg.vdev_id = arvif->vdev_id; + ether_addr_copy(arg.peer_macaddr.addr, sta->addr); + ath10k_mac_set_noack_tid_bitmap(ar, &arg, arvif->noack_map); +} + +static void ath10k_mac_vif_stations_noack_map(void *data, + struct ieee80211_sta *sta) +{ + struct ath10k_sta *arsta = (struct ath10k_sta *)sta->drv_priv; + struct ath10k_mac_iter_noack_map_data *iter_data = data; + struct ieee80211_vif *sta_vif = arsta->arvif->vif; + + if (sta_vif != iter_data->curr_vif || arsta->noack_map != -1) + return; + + ieee80211_queue_work(iter_data->ar->hw, &arsta->noack_map_wk); +} + static int ath10k_sta_state(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_sta *sta, @@ -6266,6 +6370,8 @@ static int ath10k_sta_state(struct ieee80211_hw *hw, arsta->arvif = arvif; arsta->peer_ps_state = WMI_PEER_PS_STATE_DISABLED; INIT_WORK(&arsta->update_wk, ath10k_sta_rc_update_wk); + INIT_WORK(&arsta->noack_map_wk, + ath10k_sta_set_noack_tid_bitmap); for (i = 0; i < ARRAY_SIZE(sta->txq); i++) ath10k_mac_txq_init(sta->txq[i]); @@ -6273,8 +6379,10 @@ static int ath10k_sta_state(struct ieee80211_hw *hw, /* cancel must be done outside the mutex to avoid deadlock */ if ((old_state == IEEE80211_STA_NONE && - new_state == IEEE80211_STA_NOTEXIST)) + new_state == IEEE80211_STA_NOTEXIST)) { cancel_work_sync(&arsta->update_wk); + cancel_work_sync(&arsta->noack_map_wk); + } mutex_lock(&ar->conf_mutex); @@ -7882,6 +7990,55 @@ static void ath10k_sta_statistics(struct ieee80211_hw *hw, sinfo->filled |= BIT_ULL(NL80211_STA_INFO_TX_BITRATE); } +static int ath10k_mac_op_set_noack_tid_bitmap(struct ieee80211_hw *hw, + struct ieee80211_vif *vif, + struct ieee80211_sta *sta, + int noack_map) +{ + struct ath10k_vif *arvif = (void *)vif->drv_priv; + struct ath10k_mac_iter_noack_map_data data = {}; + struct wmi_per_peer_per_tid_cfg_arg arg = {}; + struct ath10k *ar = hw->priv; + struct ath10k_sta *arsta; + int ret; + + mutex_lock(&ar->conf_mutex); + + arg.vdev_id = arvif->vdev_id; + if (sta) { + arsta = (struct ath10k_sta *)sta->drv_priv; + ether_addr_copy(arg.peer_macaddr.addr, sta->addr); + if (arsta->noack_map == noack_map) + goto exit; + + if (noack_map == -1) + ret = ath10k_mac_set_noack_tid_bitmap(ar, &arg, + arvif->noack_map); + else + ret = ath10k_mac_set_noack_tid_bitmap(ar, &arg, + noack_map); + if (!ret) + arsta->noack_map = noack_map; + + goto exit; + } + + if (arvif->noack_map == noack_map) + goto exit; + + data.curr_vif = vif; + data.ar = ar; + arvif->noack_map = noack_map; + ieee80211_iterate_stations_atomic(hw, + ath10k_mac_vif_stations_noack_map, + &data); + arvif->noack_map = noack_map; + +exit: + mutex_unlock(&ar->conf_mutex); + return ret; +} + static const struct ieee80211_ops ath10k_ops = { .tx = ath10k_mac_op_tx, .wake_tx_queue = ath10k_mac_op_wake_tx_queue, @@ -7924,6 +8081,7 @@ static void ath10k_sta_statistics(struct ieee80211_hw *hw, .switch_vif_chanctx = ath10k_mac_op_switch_vif_chanctx, .sta_pre_rcu_remove = ath10k_mac_op_sta_pre_rcu_remove, .sta_statistics = ath10k_sta_statistics, + .set_noack_tid_bitmap = ath10k_mac_op_set_noack_tid_bitmap, CFG80211_TESTMODE_CMD(ath10k_tm_cmd) @@ -8578,6 +8736,12 @@ int ath10k_mac_register(struct ath10k *ar) wiphy_ext_feature_set(ar->hw->wiphy, NL80211_EXT_FEATURE_ACK_SIGNAL_SUPPORT); + if (test_bit(WMI_SERVICE_PEER_TID_CONFIGS_SUPPORT, ar->wmi.svc_map)) + wiphy_ext_feature_set(ar->hw->wiphy, + NL80211_EXT_FEATURE_PER_STA_NOACK_MAP); + else + ar->ops->set_noack_tid_bitmap = NULL; + /* * on LL hardware queues are managed entirely by the FW * so we only advertise to mac we can do the queues thing diff --git a/drivers/net/wireless/ath/ath10k/txrx.c b/drivers/net/wireless/ath/ath10k/txrx.c index 23606b6..3b385d4 100644 --- a/drivers/net/wireless/ath/ath10k/txrx.c +++ b/drivers/net/wireless/ath/ath10k/txrx.c @@ -61,6 +61,7 @@ int ath10k_txrx_tx_unref(struct ath10k_htt *htt, struct ath10k_skb_cb *skb_cb; struct ath10k_txq *artxq; struct sk_buff *msdu; + u8 flags; ath10k_dbg(ar, ATH10K_DBG_HTT, "htt tx completion msdu_id %u status %d\n", @@ -89,6 +90,8 @@ int ath10k_txrx_tx_unref(struct ath10k_htt *htt, artxq->num_fw_queued--; } + flags = skb_cb->flags; + ath10k_htt_tx_free_msdu_id(htt, tx_done->msdu_id); ath10k_htt_tx_dec_pending(htt); if (htt->num_pending_tx == 0) @@ -104,18 +107,21 @@ int ath10k_txrx_tx_unref(struct ath10k_htt *htt, memset(&info->status, 0, sizeof(info->status)); trace_ath10k_txrx_tx_unref(ar, tx_done->msdu_id); - if (!(info->flags & IEEE80211_TX_CTL_NO_ACK)) + if (!(info->flags & IEEE80211_TX_CTL_NO_ACK) && + !(flags & ATH10K_SKB_F_NOACK_TID)) info->flags |= IEEE80211_TX_STAT_ACK; if (tx_done->status == HTT_TX_COMPL_STATE_NOACK) info->flags &= ~IEEE80211_TX_STAT_ACK; if ((tx_done->status == HTT_TX_COMPL_STATE_ACK) && - (info->flags & IEEE80211_TX_CTL_NO_ACK)) + ((info->flags & IEEE80211_TX_CTL_NO_ACK) || + (flags & ATH10K_SKB_F_NOACK_TID))) info->flags |= IEEE80211_TX_STAT_NOACK_TRANSMITTED; if (tx_done->status == HTT_TX_COMPL_STATE_DISCARD) { - if (info->flags & IEEE80211_TX_CTL_NO_ACK) + if ((info->flags & IEEE80211_TX_CTL_NO_ACK) || + (flags & ATH10K_SKB_F_NOACK_TID)) info->flags &= ~IEEE80211_TX_STAT_NOACK_TRANSMITTED; else info->flags &= ~IEEE80211_TX_STAT_ACK;