linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lorenzo Bianconi <lorenzo@kernel.org>
To: nbd@nbd.name
Cc: lorenzo.bianconi@redhat.com, ryder.lee@mediatek.com,
	royluo@google.com, linux-wireless@vger.kernel.org
Subject: [PATCH 2/7] mt76: mt7615: add mt7615_mac_wtbl_addr routine
Date: Sat, 13 Jul 2019 17:09:02 +0200	[thread overview]
Message-ID: <8ebcb9d6fe715a9a7683cd25250325c5a3d2ddb2.1563029769.git.lorenzo@kernel.org> (raw)
In-Reply-To: <cover.1563029769.git.lorenzo@kernel.org>

Introduce mt7615_mac_wtbl_addr rouinte to compute sta wtbl address.
This is a preliminary patch to update wtbl key directly from host
processor

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
 drivers/net/wireless/mediatek/mt76/mt7615/mac.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mac.c b/drivers/net/wireless/mediatek/mt76/mt7615/mac.c
index 53937573662f..fb28f68486fd 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7615/mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/mac.c
@@ -449,13 +449,18 @@ void mt7615_txp_skb_unmap(struct mt76_dev *dev,
 				 le16_to_cpu(txp->len[i]), DMA_TO_DEVICE);
 }
 
+static u32 mt7615_mac_wtbl_addr(int wcid)
+{
+	return MT_WTBL_BASE + wcid * MT_WTBL_ENTRY_SIZE;
+}
+
 void mt7615_mac_set_rates(struct mt7615_dev *dev, struct mt7615_sta *sta,
 			  struct ieee80211_tx_rate *probe_rate,
 			  struct ieee80211_tx_rate *rates)
 {
 	struct ieee80211_tx_rate *ref;
 	int wcid = sta->wcid.idx;
-	u32 addr = MT_WTBL_BASE + wcid * MT_WTBL_ENTRY_SIZE;
+	u32 addr = mt7615_mac_wtbl_addr(wcid);
 	bool stbc = false;
 	int n_rates = sta->n_rates;
 	u8 bw, bw_prev, bw_idx = 0;
-- 
2.21.0


  parent reply	other threads:[~2019-07-13 15:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-13 15:09 [PATCH 0/7] mt7615: add BIP_CMAC_128 hw support Lorenzo Bianconi
2019-07-13 15:09 ` [PATCH 1/7] mt76: mt7615: move mt7615_mac_get_key_info in mac.c Lorenzo Bianconi
2019-07-13 15:09 ` Lorenzo Bianconi [this message]
2019-07-13 15:09 ` [PATCH 3/7] mt76: mt7615: introduce mt7615_mac_wtbl_set_key routine Lorenzo Bianconi
2019-07-13 15:09 ` [PATCH 4/7] mt76: mt7615: remove wtbl_sec_key definition Lorenzo Bianconi
2019-07-13 15:09 ` [PATCH 5/7] mt76: mt7615: add set_key_cmd and mt76_wcid to mt7615_mac_wtbl_set_key signature Lorenzo Bianconi
2019-07-13 15:09 ` [PATCH 6/7] mt76: intorduce mt76_mmio_read_copy routine Lorenzo Bianconi
2019-07-13 15:09 ` [PATCH 7/7] mt76: mt7615: add BIP_CMAC_128 cipher support 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=8ebcb9d6fe715a9a7683cd25250325c5a3d2ddb2.1563029769.git.lorenzo@kernel.org \
    --to=lorenzo@kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=lorenzo.bianconi@redhat.com \
    --cc=nbd@nbd.name \
    --cc=royluo@google.com \
    --cc=ryder.lee@mediatek.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).