All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vladimir Kondratiev <QCA_vkondrat@QCA.qualcomm.com>
To: Kalle Valo <kvalo@qca.qualcomm.com>
Cc: Vladimir Kondratiev <QCA_vkondrat@QCA.qualcomm.com>,
	linux-wireless@vger.kernel.org, wil6210@qca.qualcomm.com
Subject: [PATCH 08/10] wil6210: Tx status
Date: Sun, 25 Jan 2015 10:52:49 +0200	[thread overview]
Message-ID: <1422175971-8075-9-git-send-email-qca_vkondrat@qca.qualcomm.com> (raw)
In-Reply-To: <1422175971-8075-1-git-send-email-qca_vkondrat@qca.qualcomm.com>

Implement Tx status reporting

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
---
 drivers/net/wireless/ath/wil6210/cfg80211.c |  1 +
 drivers/net/wireless/ath/wil6210/txrx.c     | 19 +++++++++++++++++--
 2 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/wil6210/cfg80211.c b/drivers/net/wireless/ath/wil6210/cfg80211.c
index 6b7664d..f65da91 100644
--- a/drivers/net/wireless/ath/wil6210/cfg80211.c
+++ b/drivers/net/wireless/ath/wil6210/cfg80211.c
@@ -858,6 +858,7 @@ static void wil_wiphy_init(struct wiphy *wiphy)
 	wiphy->cipher_suites = wil_cipher_suites;
 	wiphy->n_cipher_suites = ARRAY_SIZE(wil_cipher_suites);
 	wiphy->mgmt_stypes = wil_mgmt_stypes;
+	wiphy->features |= NL80211_FEATURE_SK_TX_STATUS;
 }
 
 struct wireless_dev *wil_cfg80211_init(struct device *dev)
diff --git a/drivers/net/wireless/ath/wil6210/txrx.c b/drivers/net/wireless/ath/wil6210/txrx.c
index b58ee52..0499ebc 100644
--- a/drivers/net/wireless/ath/wil6210/txrx.c
+++ b/drivers/net/wireless/ath/wil6210/txrx.c
@@ -1121,6 +1121,22 @@ netdev_tx_t wil_start_xmit(struct sk_buff *skb, struct net_device *ndev)
 	return NET_XMIT_DROP;
 }
 
+static inline bool wil_need_txstat(struct sk_buff *skb)
+{
+	struct ethhdr *eth = (void *)skb->data;
+
+	return is_unicast_ether_addr(eth->h_dest) && skb->sk &&
+	       (skb_shinfo(skb)->tx_flags & SKBTX_WIFI_STATUS);
+}
+
+static inline void wil_consume_skb(struct sk_buff *skb, bool acked)
+{
+	if (unlikely(wil_need_txstat(skb)))
+		skb_complete_wifi_ack(skb, acked);
+	else
+		acked ? dev_consume_skb_any(skb) : dev_kfree_skb_any(skb);
+}
+
 /**
  * Clean up transmitted skb's from the Tx VRING
  *
@@ -1199,8 +1215,7 @@ int wil_tx_complete(struct wil6210_priv *wil, int ringid)
 					ndev->stats.tx_errors++;
 					stats->tx_errors++;
 				}
-
-				dev_kfree_skb_any(skb);
+				wil_consume_skb(skb, d->dma.error == 0);
 			}
 			memset(ctx, 0, sizeof(*ctx));
 			/* There is no need to touch HW descriptor:
-- 
2.1.0


  parent reply	other threads:[~2015-01-25  8:53 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-25  8:52 [PATCH 00/10] wil6210 patches Vladimir Kondratiev
2015-01-25  8:52 ` [PATCH 01/10] wil6210: sync WMI with firmware Vladimir Kondratiev
2015-01-29  7:56   ` [01/10] " Kalle Valo
2015-01-25  8:52 ` [PATCH 02/10] wil6210: fix timing of netif_carrier_on indication Vladimir Kondratiev
2015-01-25  8:52 ` [PATCH 03/10] wil6210: ignore firmware failure to gracefully stop AP Vladimir Kondratiev
2015-01-25  8:52 ` [PATCH 04/10] wil6210: Add Tx queue len configuration Vladimir Kondratiev
2015-01-25  8:52 ` [PATCH 05/10] wil6210: tuning rings size Vladimir Kondratiev
2015-01-25  8:52 ` [PATCH 06/10] wil6210: interrupt moderation configuration update Vladimir Kondratiev
2015-01-25  8:52 ` [PATCH 07/10] wil6210: remove unnecessary interrupt moderation module parameters Vladimir Kondratiev
2015-01-26 13:38   ` Kalle Valo
2015-01-25  8:52 ` Vladimir Kondratiev [this message]
2015-01-26 13:36   ` [PATCH 08/10] wil6210: Tx status Kalle Valo
2015-01-26 18:50     ` Vladimir Kondratiev
2015-01-25  8:52 ` [PATCH 09/10] wil6210: probe_client Vladimir Kondratiev
2015-01-26 13:38   ` Kalle Valo
2015-01-26 18:51     ` Vladimir Kondratiev
2015-01-25  8:52 ` [PATCH 10/10] wil6210: move Rx reorder buffer allocation out of spinlock Vladimir Kondratiev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1422175971-8075-9-git-send-email-qca_vkondrat@qca.qualcomm.com \
    --to=qca_vkondrat@qca.qualcomm.com \
    --cc=kvalo@qca.qualcomm.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=wil6210@qca.qualcomm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.