From: Felix Fietkau <nbd@nbd.name>
To: linux-wireless@vger.kernel.org
Cc: kvalo@codeaurora.org
Subject: [PATCH 2/8] mt76: fix TSF value in probe responses
Date: Wed, 24 Jan 2018 16:19:11 +0100 [thread overview]
Message-ID: <20180124151917.70962-2-nbd@nbd.name> (raw)
In-Reply-To: <20180124151917.70962-1-nbd@nbd.name>
Like beacons, probe responses need a hardware-generated TSF value. Set
the flag that causes the hw to generate it
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
drivers/net/wireless/mediatek/mt76/mt76x2_mac.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2_mac.c b/drivers/net/wireless/mediatek/mt76/mt76x2_mac.c
index a7416a01baa4..98219b971463 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x2_mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x2_mac.c
@@ -172,6 +172,7 @@ void mt76x2_mac_write_txwi(struct mt76x2_dev *dev, struct mt76x2_txwi *txwi,
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
struct ieee80211_tx_rate *rate = &info->control.rates[0];
struct ieee80211_key_conf *key = info->control.hw_key;
+ struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
u16 rate_ht_mask = FIELD_PREP(MT_RXWI_RATE_PHY, BIT(1) | BIT(2));
u16 txwi_flags = 0;
u8 nss;
@@ -248,6 +249,10 @@ void mt76x2_mac_write_txwi(struct mt76x2_dev *dev, struct mt76x2_txwi *txwi,
sta->ht_cap.ampdu_density);
}
+ if (ieee80211_is_probe_resp(hdr->frame_control) ||
+ ieee80211_is_beacon(hdr->frame_control))
+ txwi_flags |= MT_TXWI_FLAGS_TS;
+
txwi->flags |= cpu_to_le16(txwi_flags);
txwi->len_ctl = cpu_to_le16(skb->len);
}
@@ -634,7 +639,6 @@ mt76_write_beacon(struct mt76x2_dev *dev, int offset, struct sk_buff *skb)
return -ENOSPC;
mt76x2_mac_write_txwi(dev, &txwi, skb, NULL, NULL);
- txwi.flags |= cpu_to_le16(MT_TXWI_FLAGS_TS);
mt76_wr_copy(dev, offset, &txwi, sizeof(txwi));
offset += sizeof(txwi);
--
2.14.2
next prev parent reply other threads:[~2018-01-24 15:19 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-24 15:19 [PATCH 1/8] mt76: retry rx polling as long as there is budget left Felix Fietkau
2018-01-24 15:19 ` Felix Fietkau [this message]
2018-01-24 15:19 ` [PATCH 3/8] mt76: add an intermediate struct for rx status information Felix Fietkau
2018-01-24 15:19 ` [PATCH 4/8] mt76: get station pointer by wcid and pass it to mac80211 Felix Fietkau
2018-01-24 15:19 ` [PATCH 5/8] mt76: implement A-MPDU rx reordering in the driver code Felix Fietkau
2018-01-24 15:19 ` [PATCH 6/8] mt76: split mt76_rx_complete Felix Fietkau
2018-01-24 15:19 ` [PATCH 7/8] mt76: pass the per-vif wcid to the core for multicast rx Felix Fietkau
2018-01-24 15:19 ` [PATCH 8/8] mt76: validate rx CCMP PN Felix Fietkau
2018-01-24 15:56 ` Johannes Berg
2018-01-24 16:11 ` Felix Fietkau
2018-01-24 16:20 ` Johannes Berg
2018-01-24 16:23 ` Felix Fietkau
2018-01-25 10:44 ` [PATCH v2 " Felix Fietkau
2018-01-26 9:21 ` [v2,8/8] " Kalle Valo
2018-01-26 9:20 ` [1/8] mt76: retry rx polling as long as there is budget left Kalle Valo
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=20180124151917.70962-2-nbd@nbd.name \
--to=nbd@nbd.name \
--cc=kvalo@codeaurora.org \
--cc=linux-wireless@vger.kernel.org \
/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).