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: 9859221 X-Patchwork-Delegate: kvalo@adurom.com 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 6E967600F5 for ; Mon, 24 Jul 2017 10:56:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 60F63283FD for ; Mon, 24 Jul 2017 10:56:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 55B652857E; Mon, 24 Jul 2017 10:56:15 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9AEFD283FD for ; Mon, 24 Jul 2017 10:56:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754421AbdGXK4M (ORCPT ); Mon, 24 Jul 2017 06:56:12 -0400 Received: from smtp-relay-02-9.dondominio.net ([31.214.176.42]:46883 "EHLO smtp-relay-02-9.dondominio.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753158AbdGXK4E (ORCPT ); Mon, 24 Jul 2017 06:56:04 -0400 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 Cc: linux-wireless@vger.kernel.org, =?UTF-8?Q?Ignacio_N=c3=ba=c3=b1ez_Hernanz?= 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) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.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 */