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 08/18] mt76x2: add buffer len to mt76x2_mac_write_txwi signature
Date: Mon, 30 Apr 2018 16:12:23 +0200	[thread overview]
Message-ID: <4804b1f0861d2088b9e4c242b6458c0851ba1b17.1525096206.git.lorenzo.bianconi@redhat.com> (raw)
In-Reply-To: <cover.1525096206.git.lorenzo.bianconi@redhat.com>

Add frame length to mt76x2_mac_write_txwi routine signature and do not
fetch it from skb since txwi data structure is added at the beginning of
the skb for usb based devices and mt76x2_mac_write_txwi will be shared
between pci and usb related code

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
---
 drivers/net/wireless/mediatek/mt76/mt76x2_mac.c | 6 +++---
 drivers/net/wireless/mediatek/mt76/mt76x2_mac.h | 2 +-
 drivers/net/wireless/mediatek/mt76/mt76x2_tx.c  | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2_mac.c b/drivers/net/wireless/mediatek/mt76/mt76x2_mac.c
index 0ddc84525ffa..aa9a8192f310 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x2_mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x2_mac.c
@@ -167,7 +167,7 @@ void mt76x2_mac_wcid_set_rate(struct mt76x2_dev *dev, struct mt76_wcid *wcid,
 
 void mt76x2_mac_write_txwi(struct mt76x2_dev *dev, struct mt76x2_txwi *txwi,
 			   struct sk_buff *skb, struct mt76_wcid *wcid,
-			   struct ieee80211_sta *sta)
+			   struct ieee80211_sta *sta, int len)
 {
 	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
 	struct ieee80211_tx_rate *rate = &info->control.rates[0];
@@ -254,7 +254,7 @@ void mt76x2_mac_write_txwi(struct mt76x2_dev *dev, struct mt76x2_txwi *txwi,
 		txwi_flags |= MT_TXWI_FLAGS_TS;
 
 	txwi->flags |= cpu_to_le16(txwi_flags);
-	txwi->len_ctl = cpu_to_le16(skb->len);
+	txwi->len_ctl = cpu_to_le16(len);
 }
 
 static void mt76x2_remove_hdr_pad(struct sk_buff *skb, int len)
@@ -711,7 +711,7 @@ mt76_write_beacon(struct mt76x2_dev *dev, int offset, struct sk_buff *skb)
 	if (WARN_ON_ONCE(beacon_len < skb->len + sizeof(struct mt76x2_txwi)))
 		return -ENOSPC;
 
-	mt76x2_mac_write_txwi(dev, &txwi, skb, NULL, NULL);
+	mt76x2_mac_write_txwi(dev, &txwi, skb, NULL, NULL, skb->len);
 
 	mt76_wr_copy(dev, offset, &txwi, sizeof(txwi));
 	offset += sizeof(txwi);
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2_mac.h b/drivers/net/wireless/mediatek/mt76/mt76x2_mac.h
index c048cd06df6b..5af0107ba748 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x2_mac.h
+++ b/drivers/net/wireless/mediatek/mt76/mt76x2_mac.h
@@ -166,7 +166,7 @@ int mt76x2_mac_process_rx(struct mt76x2_dev *dev, struct sk_buff *skb,
 			  void *rxi);
 void mt76x2_mac_write_txwi(struct mt76x2_dev *dev, struct mt76x2_txwi *txwi,
 			   struct sk_buff *skb, struct mt76_wcid *wcid,
-			   struct ieee80211_sta *sta);
+			   struct ieee80211_sta *sta, int len);
 void mt76x2_mac_wcid_setup(struct mt76x2_dev *dev, u8 idx, u8 vif_idx, u8 *mac);
 int mt76x2_mac_wcid_set_key(struct mt76x2_dev *dev, u8 idx,
 			    struct ieee80211_key_conf *key);
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2_tx.c b/drivers/net/wireless/mediatek/mt76/mt76x2_tx.c
index e46eafc4c436..d16d438173e4 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x2_tx.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x2_tx.c
@@ -159,7 +159,7 @@ int mt76x2_tx_prepare_skb(struct mt76_dev *mdev, void *txwi,
 	if (q == &dev->mt76.q_tx[MT_TXQ_PSD] && wcid && wcid->idx < 128)
 		mt76x2_mac_wcid_set_drop(dev, wcid->idx, false);
 
-	mt76x2_mac_write_txwi(dev, txwi, skb, wcid, sta);
+	mt76x2_mac_write_txwi(dev, txwi, skb, wcid, sta, skb->len);
 
 	ret = mt76x2_insert_hdr_pad(skb);
 	if (ret < 0)
-- 
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 ` [RFC 07/18] mt76x2: add napi struct to mt76_rx_poll_complete/mt76_rx_complete signatures Lorenzo Bianconi
2018-04-30 14:12 ` Lorenzo Bianconi [this message]
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=4804b1f0861d2088b9e4c242b6458c0851ba1b17.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.