All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
To: nbd@nbd.name
Cc: linux-wireless@vger.kernel.org, sgruszka@redhat.com
Subject: [RFC 07/18] mt76x2: add napi struct to mt76_rx_poll_complete/mt76_rx_complete signatures
Date: Mon, 30 Apr 2018 16:12:22 +0200	[thread overview]
Message-ID: <eadbb6c315ca05e06c0fd26a26519fe662266ead.1525096206.git.lorenzo.bianconi@redhat.com> (raw)
In-Reply-To: <cover.1525096206.git.lorenzo.bianconi@redhat.com>

in order to reuse mt76_rx_complete routine supporting mt76x2u based
devices add napi struct to mt76_rx_poll_complete and mt76_rx_complete
routine signatures and do not fetch it according to the rx queue index

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
---
 drivers/net/wireless/mediatek/mt76/agg-rx.c   |  2 +-
 drivers/net/wireless/mediatek/mt76/dma.c      |  2 +-
 drivers/net/wireless/mediatek/mt76/mac80211.c | 12 +++++-------
 drivers/net/wireless/mediatek/mt76/mt76.h     |  5 +++--
 4 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/drivers/net/wireless/mediatek/mt76/agg-rx.c b/drivers/net/wireless/mediatek/mt76/agg-rx.c
index b67acc6189bf..8df0d41f7317 100644
--- a/drivers/net/wireless/mediatek/mt76/agg-rx.c
+++ b/drivers/net/wireless/mediatek/mt76/agg-rx.c
@@ -113,7 +113,7 @@ mt76_rx_aggr_reorder_work(struct work_struct *work)
 	if (nframes)
 		ieee80211_queue_delayed_work(tid->dev->hw, &tid->reorder_work,
 					     REORDER_TIMEOUT);
-	mt76_rx_complete(dev, &frames, -1);
+	mt76_rx_complete(dev, &frames, NULL);
 
 	rcu_read_unlock();
 	local_bh_enable();
diff --git a/drivers/net/wireless/mediatek/mt76/dma.c b/drivers/net/wireless/mediatek/mt76/dma.c
index 3518703524e7..528132c3d1cd 100644
--- a/drivers/net/wireless/mediatek/mt76/dma.c
+++ b/drivers/net/wireless/mediatek/mt76/dma.c
@@ -396,7 +396,7 @@ mt76_dma_rx_poll(struct napi_struct *napi, int budget)
 
 	do {
 		cur = mt76_dma_rx_process(dev, &dev->q_rx[qid], budget - done);
-		mt76_rx_poll_complete(dev, qid);
+		mt76_rx_poll_complete(dev, qid, napi);
 		done += cur;
 	} while (cur && done < budget);
 
diff --git a/drivers/net/wireless/mediatek/mt76/mac80211.c b/drivers/net/wireless/mediatek/mt76/mac80211.c
index da5254b48cf7..600db8e689aa 100644
--- a/drivers/net/wireless/mediatek/mt76/mac80211.c
+++ b/drivers/net/wireless/mediatek/mt76/mac80211.c
@@ -537,15 +537,11 @@ mt76_check_ps(struct mt76_dev *dev, struct sk_buff *skb)
 }
 
 void mt76_rx_complete(struct mt76_dev *dev, struct sk_buff_head *frames,
-		      int queue)
+		      struct napi_struct *napi)
 {
-	struct napi_struct *napi = NULL;
 	struct ieee80211_sta *sta;
 	struct sk_buff *skb;
 
-	if (queue >= 0)
-	    napi = &dev->napi[queue];
-
 	spin_lock(&dev->rx_lock);
 	while ((skb = __skb_dequeue(frames)) != NULL) {
 		if (mt76_check_ccmp_pn(skb)) {
@@ -559,7 +555,8 @@ void mt76_rx_complete(struct mt76_dev *dev, struct sk_buff_head *frames,
 	spin_unlock(&dev->rx_lock);
 }
 
-void mt76_rx_poll_complete(struct mt76_dev *dev, enum mt76_rxq_id q)
+void mt76_rx_poll_complete(struct mt76_dev *dev, enum mt76_rxq_id q,
+			   struct napi_struct *napi)
 {
 	struct sk_buff_head frames;
 	struct sk_buff *skb;
@@ -571,5 +568,6 @@ void mt76_rx_poll_complete(struct mt76_dev *dev, enum mt76_rxq_id q)
 		mt76_rx_aggr_reorder(skb, &frames);
 	}
 
-	mt76_rx_complete(dev, &frames, q);
+	mt76_rx_complete(dev, &frames, napi);
 }
+EXPORT_SYMBOL_GPL(mt76_rx_poll_complete);
diff --git a/drivers/net/wireless/mediatek/mt76/mt76.h b/drivers/net/wireless/mediatek/mt76/mt76.h
index a74e6eef51e9..f4144c3e70d3 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76.h
+++ b/drivers/net/wireless/mediatek/mt76/mt76.h
@@ -439,8 +439,9 @@ void mt76_wcid_key_setup(struct mt76_dev *dev, struct mt76_wcid *wcid,
 void mt76_tx_free(struct mt76_dev *dev);
 void mt76_put_txwi(struct mt76_dev *dev, struct mt76_txwi_cache *t);
 void mt76_rx_complete(struct mt76_dev *dev, struct sk_buff_head *frames,
-		      int queue);
-void mt76_rx_poll_complete(struct mt76_dev *dev, enum mt76_rxq_id q);
+		      struct napi_struct *napi);
+void mt76_rx_poll_complete(struct mt76_dev *dev, enum mt76_rxq_id q,
+			   struct napi_struct *napi);
 void mt76_rx_aggr_reorder(struct sk_buff *skb, struct sk_buff_head *frames);
 
 #endif
-- 
2.14.3

  parent reply	other threads:[~2018-04-30 14:13 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-30 14:12 [RFC 00/18] add mt76x2u support to mt76 driver Lorenzo Bianconi
2018-04-30 14:12 ` [RFC 01/18] mt76x2: use completion instead of wait_queue for mcu rx queue Lorenzo Bianconi
2018-04-30 14:12 ` [RFC 02/18] mt76x2: move mt76x2_fw_header and mt76x2_patch_header definitions in mcu.h Lorenzo Bianconi
2018-04-30 14:12 ` [RFC 03/18] mt76x2: move utility routines in mt76x2.h Lorenzo Bianconi
2018-04-30 14:12 ` [RFC 04/18] mt76x2: introduce mt76x2_init_device routine Lorenzo Bianconi
2018-04-30 14:12 ` [RFC 05/18] mt76x2: move currently mt76x2u unsupported features to mt76x2_init Lorenzo Bianconi
2018-04-30 14:12 ` [RFC 06/18] mt76x2: introduce mt76x2_mac_load_tx_status routine Lorenzo Bianconi
2018-05-02 13:07   ` Stanislaw Gruszka
2018-05-02 13:34     ` Lorenzo Bianconi
2018-04-30 14:12 ` Lorenzo Bianconi [this message]
2018-04-30 14:12 ` [RFC 08/18] mt76x2: add buffer len to mt76x2_mac_write_txwi signature Lorenzo Bianconi
2018-04-30 14:12 ` [RFC 09/18] mt76: introduce tx_queue_skb function pointer in mt76_bus_ops Lorenzo Bianconi
2018-04-30 14:12 ` [RFC 10/18] mt76: introduce mt76x2-common module Lorenzo Bianconi
2018-04-30 14:12 ` [RFC 11/18] mt76: add mt76x2_tx_common to " Lorenzo Bianconi
2018-04-30 14:12 ` [RFC 12/18] mt76: add mt76x2_mac_common " Lorenzo Bianconi
2018-04-30 14:12 ` [RFC 13/18] mt76: add mt76x2_init_common " Lorenzo Bianconi
2018-04-30 14:12 ` [RFC 14/18] mt76: add mt76x2_common " Lorenzo Bianconi
2018-04-30 14:12 ` [RFC 15/18] mt76: add mt76x2_phy_common " Lorenzo Bianconi
2018-04-30 14:12 ` [RFC 16/18] mt76: move mt76x2_debugfs in mt76-common module Lorenzo Bianconi
2018-04-30 14:12 ` [RFC 17/18] mt76: add usb suppor to mt76 layer Lorenzo Bianconi
2018-04-30 14:12 ` [RFC 18/18] mt76: add driver code for MT76x2u based devices Lorenzo Bianconi

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=eadbb6c315ca05e06c0fd26a26519fe662266ead.1525096206.git.lorenzo.bianconi@redhat.com \
    --to=lorenzo.bianconi@redhat.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=nbd@nbd.name \
    --cc=sgruszka@redhat.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.