From patchwork Tue Mar 1 10:32:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Kazior X-Patchwork-Id: 8463971 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@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 D3CCE9F372 for ; Tue, 1 Mar 2016 10:32:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D829820295 for ; Tue, 1 Mar 2016 10:32:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E4B6A2021F for ; Tue, 1 Mar 2016 10:32:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753108AbcCAKcX (ORCPT ); Tue, 1 Mar 2016 05:32:23 -0500 Received: from mail-lf0-f46.google.com ([209.85.215.46]:32830 "EHLO mail-lf0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753080AbcCAKcW (ORCPT ); Tue, 1 Mar 2016 05:32:22 -0500 Received: by mail-lf0-f46.google.com with SMTP id v124so17124231lff.0 for ; Tue, 01 Mar 2016 02:32:21 -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=oh4vWtQ5NkRBZbDdFPsP5VuvLVt8CbvdgvXzW4b3u8Q=; b=GAfVPpJ5pZ/lh/zhTsce8MQ2m143sACBAbCen//2pdQ4bBK+qT2OLVox+OiRNznBt4 kLIKHqm9jugufelmF6TxfROVTK7Vudpd0Tqdn5aWBMBG4YmnEC2z2+2+OwjSLVOHZvtU WDXsBcip9fXtFaQyylmibJvQlJTe0DWPnxb0c= 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=oh4vWtQ5NkRBZbDdFPsP5VuvLVt8CbvdgvXzW4b3u8Q=; b=NlkeV6V7NPPU5m8z6Yq3DFrS9MA09zLSzqup8i8O+pmmAjLYa54nDOKViNmmqU9xj0 BS+FPR+WdY6t7iKXPQ3InU2IKnKp63z4pXkEZGmHV4nlCa/OoW1wu625W/8Y/X+pUw/I loaYdiFmR1ktIQ+BVOfbrXeA3JJUVAXilFUIKCspRdEaIjhxeUGSIC6K7PElZXFNXuQm T9a6LWe1/dLcITN4WQEL+vd3TVGEF2Pw77nDy3Ce67TDMhQi7DOXJ5kGKsQaswfHaTTh LiWYvZisoPCYxC3W52IqFGWXY8lKak+GfqH0ZkwYnIYcKayrunLCLKXLPwNMj9eo1Ylr mCGw== X-Gm-Message-State: AD7BkJLuChiIjL893RjGajNNhZzYg5kjI+VeqeHuBG01KOXygFEq4DEeLdbRXZ+IgcSjtFjoH5gQYJ5p4EyavU7OkWDWQefYsveWImEpR9Jx3h0Txc+TbXrtvhRz13FJFNqugDcsihspig== X-Received: by 10.25.138.7 with SMTP id m7mr7971835lfd.109.1456828340806; Tue, 01 Mar 2016 02:32:20 -0800 (PST) Received: from localhost.localdomain ([91.198.246.10]) by smtp.gmail.com with ESMTPSA id i2sm4644857lfd.43.2016.03.01.02.32.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 01 Mar 2016 02:32:19 -0800 (PST) From: Michal Kazior To: ath10k@lists.infradead.org Cc: linux-wireless@vger.kernel.org, Michal Kazior Subject: [PATCH v2 09/11] ath10k: store txq in skb_cb Date: Tue, 1 Mar 2016 11:32:54 +0100 Message-Id: <1456828376-2795-10-git-send-email-michal.kazior@tieto.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1456828376-2795-1-git-send-email-michal.kazior@tieto.com> References: <1453384006-31907-1-git-send-email-michal.kazior@tieto.com> <1456828376-2795-1-git-send-email-michal.kazior@tieto.com> X-DomainID: tieto.com Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham 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 | 19 +++++++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h index 7df35628ca35..89f789f3e5b4 100644 --- a/drivers/net/wireless/ath/ath10k/core.h +++ b/drivers/net/wireless/ath/ath10k/core.h @@ -98,6 +98,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 900c64b65b43..8d02d53fdc2c 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -3307,6 +3307,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; @@ -3323,6 +3324,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) @@ -3633,6 +3635,9 @@ static void ath10k_mac_txq_init(struct ieee80211_txq *txq) static void ath10k_mac_txq_unref(struct ath10k *ar, struct ieee80211_txq *txq) { struct ath10k_txq *artxq = (void *)txq->drv_priv; + struct ath10k_skb_cb *cb; + struct sk_buff *msdu; + int msdu_id; if (!txq) return; @@ -3641,6 +3646,14 @@ static void ath10k_mac_txq_unref(struct ath10k *ar, struct ieee80211_txq *txq) if (!list_empty(&artxq->list)) list_del_init(&artxq->list); spin_unlock_bh(&ar->txqs_lock); + + 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); } static bool ath10k_mac_tx_can_push(struct ieee80211_hw *hw, @@ -3679,7 +3692,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); @@ -3909,6 +3922,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; @@ -3917,7 +3931,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); @@ -4985,6 +4999,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;