From patchwork Thu Jan 21 13:46:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Kazior X-Patchwork-Id: 8081341 Return-Path: X-Original-To: patchwork-ath10k@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D26CB9F440 for ; Thu, 21 Jan 2016 13:46:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E872420502 for ; Thu, 21 Jan 2016 13:46:29 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0A75E203A9 for ; Thu, 21 Jan 2016 13:46:29 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aMFZ7-0000cB-W6; Thu, 21 Jan 2016 13:46:22 +0000 Received: from mail-lf0-x232.google.com ([2a00:1450:4010:c07::232]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aMFYw-0000Nq-7D for ath10k@lists.infradead.org; Thu, 21 Jan 2016 13:46:15 +0000 Received: by mail-lf0-x232.google.com with SMTP id m198so26897329lfm.0 for ; Thu, 21 Jan 2016 05:45:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tieto.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=L5Et0cU09dG6RwG5o5L9HDQkRCMCUAtx6wlc0liwJS0=; b=ASaA7P83XHHOurcFa5oqlhUzWrZAOPjlcKJsthVqfNXmOzcBTXk/9iz1rKgOihZoYr YGtXza6Vbsh//fVOSI8kdsdTUH/lVQ7KSLMY69lOuOMClvyXuh0cln8uqfAanY2fYHmd S4mRZ8BfI2GujRtSApzuSoVd5uXLzp9nehrHM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=L5Et0cU09dG6RwG5o5L9HDQkRCMCUAtx6wlc0liwJS0=; b=jYFO3CiD89Ht4/AJE1BEuPjZp8S37i0IlNwKdcRUA865P3ph9EWs8DTyYOghS+pgce oFln/JVUQfmngBde4wp443FLnOcsHbD5Xxk7gJs/8QTc9E4Y9mFoHAp+gR9+wtPpRvbd uWfC6Z0D196v1vSt46XuT/9emxdWCeHR1Ufod+VmVEoRXQXbMkJO/ZihtuFsbz+0QaoS DvcTwLnWI/B0Fr7GihKCJda3j0+5Mx456CfVupirXnCni0j1jI2KfuAr9UWoY0lH0jD4 O3a2NuKf6/wocN+IgGfzrwxUbgOTgNFwzLjSm1QaYeepG0OqoPVftpStWK2/5XQB5wYG 8hcA== X-Gm-Message-State: ALoCoQn2N/cD66Ih2To7GGtSSFWhFN6lnsNFl8hyVTlzdYAv/G7spOwotdlh7E7N7hF0V1C95kkz4F4OT7bFPTSe1kh/3PTHXjZOgjDyoSCEjpat8gYVqpP/WS7/UaRu185zWUntCzI0dTq5P7UOJXQ404ka6DNATiSZovVtitFX2/DchBmQ5oAHE3MkzxfXS0emp6P48hf/Yc56TWHxyQWU+jAM8zLIhQ== X-Received: by 10.25.43.212 with SMTP id r203mr15777779lfr.162.1453383951060; Thu, 21 Jan 2016 05:45:51 -0800 (PST) Received: from localhost.localdomain ([91.198.246.10]) by smtp.gmail.com with ESMTPSA id c192sm207382lfb.16.2016.01.21.05.45.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 21 Jan 2016 05:45:50 -0800 (PST) From: Michal Kazior To: ath10k@lists.infradead.org Subject: [PATCH 11/13] ath10k: store txq in skb_cb Date: Thu, 21 Jan 2016 14:46:44 +0100 Message-Id: <1453384006-31907-12-git-send-email-michal.kazior@tieto.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1453384006-31907-1-git-send-email-michal.kazior@tieto.com> References: <1453384006-31907-1-git-send-email-michal.kazior@tieto.com> X-DomainID: tieto.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160121_054610_840569_F2807B3E X-CRM114-Status: GOOD ( 13.09 ) X-Spam-Score: -2.7 (--) X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-wireless@vger.kernel.org, Michal Kazior MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This will be necessary for later. Signed-off-by: Michal Kazior --- drivers/net/wireless/ath/ath10k/core.h | 1 + drivers/net/wireless/ath/ath10k/mac.c | 32 ++++++++++++++++++++++++++++++-- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h index 38ed4bbd220b..5be56a8343bd 100644 --- a/drivers/net/wireless/ath/ath10k/core.h +++ b/drivers/net/wireless/ath/ath10k/core.h @@ -95,6 +95,7 @@ struct ath10k_skb_cb { u8 eid; u16 msdu_id; struct ieee80211_vif *vif; + struct ieee80211_txq *txq; } __packed; struct ath10k_skb_rxcb { diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index 42020c22eaed..639da03572e0 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -3311,6 +3311,7 @@ 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 sk_buff *skb) { struct ieee80211_hdr *hdr = (void *)skb->data; @@ -3327,6 +3328,7 @@ static void ath10k_mac_tx_h_fill_cb(struct ath10k *ar, cb->flags |= ATH10K_SKB_F_QOS; cb->vif = vif; + cb->txq = txq; } bool ath10k_mac_tx_frm_has_freq(struct ath10k *ar) @@ -3660,7 +3662,7 @@ static int ath10k_mac_tx_push_txq(struct ieee80211_hw *hw, return -ENOENT; } - ath10k_mac_tx_h_fill_cb(ar, vif, skb); + ath10k_mac_tx_h_fill_cb(ar, vif, txq, skb); txmode = ath10k_mac_tx_h_get_txmode(ar, vif, sta, skb); txpath = ath10k_mac_tx_h_get_txpath(ar, skb, txmode); @@ -3792,6 +3794,27 @@ void ath10k_mac_tx_push_pending(struct ath10k *ar) spin_unlock_bh(&ar->htt.tx_lock); } +static void ath10k_mac_txq_unref(struct ath10k *ar, + struct ieee80211_txq *txq) +{ + struct ath10k_skb_cb *cb; + struct sk_buff *msdu; + int msdu_id; + + if (!txq) + return; + + spin_lock_bh(&ar->htt.tx_lock); + + idr_for_each_entry(&ar->htt.pending_tx, msdu, msdu_id) { + cb = ATH10K_SKB_CB(msdu); + if (cb->txq == txq) + cb->txq = NULL; + } + + spin_unlock_bh(&ar->htt.tx_lock); +} + /************/ /* Scanning */ /************/ @@ -3963,6 +3986,7 @@ static void ath10k_mac_op_tx(struct ieee80211_hw *hw, struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); struct ieee80211_vif *vif = info->control.vif; struct ieee80211_sta *sta = control->sta; + struct ieee80211_txq *txq = NULL; struct ieee80211_hdr *hdr = (void *)skb->data; enum ath10k_hw_txrx_mode txmode; enum ath10k_mac_tx_path txpath; @@ -3971,7 +3995,7 @@ static void ath10k_mac_op_tx(struct ieee80211_hw *hw, bool is_presp; int ret; - ath10k_mac_tx_h_fill_cb(ar, vif, skb); + ath10k_mac_tx_h_fill_cb(ar, vif, txq, skb); txmode = ath10k_mac_tx_h_get_txmode(ar, vif, sta, skb); txpath = ath10k_mac_tx_h_get_txpath(ar, skb, txmode); @@ -5010,6 +5034,7 @@ static void ath10k_remove_interface(struct ieee80211_hw *hw, spin_unlock_bh(&ar->data_lock); ath10k_peer_cleanup(ar, arvif->vdev_id); + ath10k_mac_txq_unref(ar, vif->txq); if (vif->type == NL80211_IFTYPE_MONITOR) { ar->monitor_arvif = NULL; @@ -5872,6 +5897,9 @@ static int ath10k_sta_state(struct ieee80211_hw *hw, } spin_unlock_bh(&ar->data_lock); + for (i = 0; i < ARRAY_SIZE(sta->txq); i++) + ath10k_mac_txq_unref(ar, sta->txq[i]); + if (!sta->tdls) goto exit;