From patchwork Mon Jul 24 10:49:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ignacio_N=C3=BA=C3=B1ez_Hernanz?= X-Patchwork-Id: 9859229 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 508DA600F5 for ; Mon, 24 Jul 2017 10:56:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 42AC9283FD for ; Mon, 24 Jul 2017 10:56:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 318F92857E; Mon, 24 Jul 2017 10:56:39 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.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 8823B283FD for ; Mon, 24 Jul 2017 10:56:38 +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-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Date:Message-ID:Subject:From:To: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=Sv41tZpofPqLXwICppYSG41Ax3kPUey6aLqGr1ORVic=; b=q3aJIlOw1Rl4tdgH/Enw/DqglT LSlVsCU5w/JI37nNDOZburv3f+zRdLjJVBjBU+FXqxKYp9X24PN19xZmWPMjXvN6p1NE8+T3lOyq/ csD0T0a9bI25tOBNpUkqc6W08Ej+U5v4mpxJ3btyZsTZnA7reap4/E+nYGLussFpuHasDheVxXh5t +ZgaYnI0/0TO1ut1vBTDMBKSLYZkvu7RT6bsm5uPrybySS+M6TJjTvh0vpY/nPerc9ZfEaP9J7BDl /fU2Kw8A0JUyRyzzlMcN0V4Yj+v84sniVWp9HkBSQjnyr1EDGlTnE0TVQQWLYyhj+B4HG7tlLBMn4 VCOT8ufQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dZb2M-0003Ey-T6; Mon, 24 Jul 2017 10:56:30 +0000 Received: from smtp-relay-02.dondominio.net ([31.214.176.33]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dZb2J-0003Ah-66 for ath10k@lists.infradead.org; Mon, 24 Jul 2017 10:56:29 +0000 Received: from mail-node.dondominio.com by smtp-relay.dondominio.com (Postfix) with ESMTP id 5803C4160C; Mon, 24 Jul 2017 12:49:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aoifes.com; s=dddk; t=1500893345; bh=jleIlCu+V15MifsQFRMAaynOjh5HL4eug7lF+slzEAQ=; h=To:From:Subject:Message-ID:Date:Content-Type; b=jXYeEEdHmDH65zEBLIKheUcxDbmJmJiaa8+uVOV9Yo52AbvRdD64ipyvf+//bdH66 TSyYx1FxTUEuM+Da5ACdt135NYceI2r0i+UBqpBgoBTiu3L8XrAg+T+7w8mE2+XxnG +jxjCkXMbfHQ5GncACoDm8fUZ5/+XUUxvq/RLqv0= Received: from [192.168.100.140] (221.233.132.37.dynamic.jazztel.es [37.132.233.221]) (Authenticated sender: nacho.nunez@aoifes.com) by mail-node.dondominio.com (Postfix) with ESMTPA id 2E4CA408DA; Mon, 24 Jul 2017 12:49:05 +0200 (CEST) To: ath10k@lists.infradead.org From: =?UTF-8?Q?Ignacio_N=c3=ba=c3=b1ez_Hernanz?= Subject: [PATCH] ath10k: Make ath10k report discarded packets to mac80211 Message-ID: <863ed21f-d2fe-f1e1-6f3c-b4061c777f59@aoifes.com> Date: Mon, 24 Jul 2017 12:49:04 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 Content-Language: en-US X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (mail-node.dondominio.com [0.0.0.0]); Mon, 24 Jul 2017 12:49:05 +0200 (CEST) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170724_035627_422250_015CF48A X-CRM114-Status: UNSURE ( 9.05 ) 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: linux-wireless@vger.kernel.org, =?UTF-8?Q?Ignacio_N=c3=ba=c3=b1ez_Hernanz?= Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From 2caef0e851a23cc9e979a3f36a2ae0d964cfeba7 Mon Sep 17 00:00:00 2001 From: Ignacio Nunez Hernanz Date: Mon, 24 Jul 2017 11:52:48 +0200 Subject: [PATCH] ath10k: Make ath10k report discarded packets to mac80211 Whenever ath10k firmware discards a packet (HTT_TX_COMPL_STATE_DISCARD flag), the skb is freed and mac80211 does not get feedback through ieee80211_tx_status(). Instead, make sure that the IEEE80211_TX_STAT_ACK flag is disabled and let the packet go through, like ath9k does. Signed-off-by: Ignacio Nunez Hernanz --- drivers/net/wireless/ath/ath10k/txrx.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/txrx.c b/drivers/net/wireless/ath/ath10k/txrx.c index d4986f626c35..37537530de76 100644 --- a/drivers/net/wireless/ath/ath10k/txrx.c +++ b/drivers/net/wireless/ath/ath10k/txrx.c @@ -102,11 +102,6 @@ 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 (tx_done->status == HTT_TX_COMPL_STATE_DISCARD) { - ieee80211_free_txskb(htt->ar->hw, msdu); - return 0; - } - if (!(info->flags & IEEE80211_TX_CTL_NO_ACK)) info->flags |= IEEE80211_TX_STAT_ACK; @@ -117,6 +112,13 @@ int ath10k_txrx_tx_unref(struct ath10k_htt *htt, (info->flags & IEEE80211_TX_CTL_NO_ACK)) info->flags |= IEEE80211_TX_STAT_NOACK_TRANSMITTED; + if (tx_done->status == HTT_TX_COMPL_STATE_DISCARD) { + if (info->flags & IEEE80211_TX_CTL_NO_ACK) + info->flags &= ~IEEE80211_TX_STAT_NOACK_TRANSMITTED; + else + info->flags &= ~IEEE80211_TX_STAT_ACK; + } + ieee80211_tx_status(htt->ar->hw, msdu); /* we do not own the msdu anymore */