summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mediatek/mt76/mt76x02_mac.c
diff options
context:
space:
mode:
authorFelix Fietkau2019-01-31 21:01:24 +0100
committerFelix Fietkau2019-02-18 19:54:33 +0100
commit128b75bf5cf93bca71da740d3cb623c1febb6bf6 (patch)
tree8fb59e595d32cf675e58d7a1b2409ecfef96d0aa /drivers/net/wireless/mediatek/mt76/mt76x02_mac.c
parentmt76: remove add_buf pointer in mt76_queue_ops (diff)
downloadkernel-qcow2-linux-128b75bf5cf93bca71da740d3cb623c1febb6bf6.tar.gz
kernel-qcow2-linux-128b75bf5cf93bca71da740d3cb623c1febb6bf6.tar.xz
kernel-qcow2-linux-128b75bf5cf93bca71da740d3cb623c1febb6bf6.zip
mt76: fix software encryption issues
Software encrypted packets can be passed not just through the drv_tx callback, but also through the intermediate tx queue. In order to deal with that, move the override to mt76x02_mac_write_txwi and also take care of filling in the per-packet rate information Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76/mt76x02_mac.c')
-rw-r--r--drivers/net/wireless/mediatek/mt76/mt76x02_mac.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_mac.c b/drivers/net/wireless/mediatek/mt76/mt76x02_mac.c
index 2dc80ea26752..6bd7f87644a4 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x02_mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x02_mac.c
@@ -291,6 +291,13 @@ void mt76x02_mac_write_txwi(struct mt76x02_dev *dev, struct mt76x02_txwi *txwi,
memset(txwi, 0, sizeof(*txwi));
+ if (!info->control.hw_key && wcid && wcid->hw_key_idx != 0xff &&
+ ieee80211_has_protected(hdr->frame_control)) {
+ wcid = NULL;
+ ieee80211_get_tx_rates(info->control.vif, sta, skb,
+ info->control.rates, 1);
+ }
+
if (wcid)
txwi->wcid = wcid->idx;
else