aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2018-01-24 10:19:11 -0500
committerKalle Valo <kvalo@codeaurora.org>2018-01-26 04:18:31 -0500
commit1342cfea315aaffdc66e26fb595694928723e205 (patch)
tree84437a13406fba74197c9e80232b7a946a042090
parent2b4307f538ab31954e9b6d4ff64b6cf5b33196e1 (diff)
mt76: fix TSF value in probe responses
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> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
-rw-r--r--drivers/net/wireless/mediatek/mt76/mt76x2_mac.c6
1 files changed, 5 insertions, 1 deletions
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,
172 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); 172 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
173 struct ieee80211_tx_rate *rate = &info->control.rates[0]; 173 struct ieee80211_tx_rate *rate = &info->control.rates[0];
174 struct ieee80211_key_conf *key = info->control.hw_key; 174 struct ieee80211_key_conf *key = info->control.hw_key;
175 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
175 u16 rate_ht_mask = FIELD_PREP(MT_RXWI_RATE_PHY, BIT(1) | BIT(2)); 176 u16 rate_ht_mask = FIELD_PREP(MT_RXWI_RATE_PHY, BIT(1) | BIT(2));
176 u16 txwi_flags = 0; 177 u16 txwi_flags = 0;
177 u8 nss; 178 u8 nss;
@@ -248,6 +249,10 @@ void mt76x2_mac_write_txwi(struct mt76x2_dev *dev, struct mt76x2_txwi *txwi,
248 sta->ht_cap.ampdu_density); 249 sta->ht_cap.ampdu_density);
249 } 250 }
250 251
252 if (ieee80211_is_probe_resp(hdr->frame_control) ||
253 ieee80211_is_beacon(hdr->frame_control))
254 txwi_flags |= MT_TXWI_FLAGS_TS;
255
251 txwi->flags |= cpu_to_le16(txwi_flags); 256 txwi->flags |= cpu_to_le16(txwi_flags);
252 txwi->len_ctl = cpu_to_le16(skb->len); 257 txwi->len_ctl = cpu_to_le16(skb->len);
253} 258}
@@ -634,7 +639,6 @@ mt76_write_beacon(struct mt76x2_dev *dev, int offset, struct sk_buff *skb)
634 return -ENOSPC; 639 return -ENOSPC;
635 640
636 mt76x2_mac_write_txwi(dev, &txwi, skb, NULL, NULL); 641 mt76x2_mac_write_txwi(dev, &txwi, skb, NULL, NULL);
637 txwi.flags |= cpu_to_le16(MT_TXWI_FLAGS_TS);
638 642
639 mt76_wr_copy(dev, offset, &txwi, sizeof(txwi)); 643 mt76_wr_copy(dev, offset, &txwi, sizeof(txwi));
640 offset += sizeof(txwi); 644 offset += sizeof(txwi);