]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
mt76: mt7615: fix monitor injection of beacon frames
authorFelix Fietkau <nbd@nbd.name>
Mon, 17 Feb 2020 16:46:33 +0000 (17:46 +0100)
committerFelix Fietkau <nbd@nbd.name>
Tue, 17 Mar 2020 16:13:59 +0000 (17:13 +0100)
When injecting beacon frames via monitor interface, they must not be sent to
the beacon hardware queue, because they don't follow normal hardware beacon tx
rules.
Fix sending them by adding a flag to mt7615_mac_write_txwi that selects the
beacon queue for tx, and use it only from mt7615_mcu_set_bcn.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt7615/mac.c
drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
drivers/net/wireless/mediatek/mt76/mt7615/mt7615.h

index 145366dbc39b6ce32d785bc19213f4238113c8de..1fbd240c2b478083f804703a770b53bc9068adca 100644 (file)
@@ -503,7 +503,7 @@ mt7615_mac_tx_rate_val(struct mt7615_dev *dev,
 int mt7615_mac_write_txwi(struct mt7615_dev *dev, __le32 *txwi,
                          struct sk_buff *skb, struct mt76_wcid *wcid,
                          struct ieee80211_sta *sta, int pid,
-                         struct ieee80211_key_conf *key)
+                         struct ieee80211_key_conf *key, bool beacon)
 {
        struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
        struct ieee80211_tx_rate *rate = &info->control.rates[0];
@@ -541,7 +541,7 @@ int mt7615_mac_write_txwi(struct mt7615_dev *dev, __le32 *txwi,
                q_idx = wmm_idx * MT7615_MAX_WMM_SETS +
                        skb_get_queue_mapping(skb);
                p_fmt = MT_TX_TYPE_CT;
-       } else if (ieee80211_is_beacon(fc)) {
+       } else if (beacon) {
                if (ext_phy)
                        q_idx = MT_LMAC_BCN1;
                else
@@ -1208,7 +1208,7 @@ int mt7615_tx_prepare_skb(struct mt76_dev *mdev, void *txwi_ptr,
                return id;
 
        mt7615_mac_write_txwi(dev, txwi_ptr, tx_info->skb, wcid, sta,
-                             pid, key);
+                             pid, key, false);
 
        txp = txwi + MT_TXD_SIZE;
        memset(txp, 0, sizeof(struct mt7615_txp_common));
index 7218a3041ead1406060326873ee212ecee117727..b51a3cb247c94e91b05701eb1846db5c94dd584b 100644 (file)
@@ -1476,7 +1476,7 @@ int mt7615_mcu_set_bcn(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
        }
 
        mt7615_mac_write_txwi(dev, (__le32 *)(req.pkt), skb, wcid, NULL,
-                             0, NULL);
+                             0, NULL, true);
        memcpy(req.pkt + MT_TXD_SIZE, skb->data, skb->len);
        req.pkt_len = cpu_to_le16(MT_TXD_SIZE + skb->len);
        req.tim_ie_pos = cpu_to_le16(MT_TXD_SIZE + offs.tim_offset);
index a84a9b4cbf4ee015645edb9afa1565b0fc767aa2..68c4f168320418ab9ace73db79460f3582875e2d 100644 (file)
@@ -347,7 +347,7 @@ void mt7615_mac_sta_poll(struct mt7615_dev *dev);
 int mt7615_mac_write_txwi(struct mt7615_dev *dev, __le32 *txwi,
                          struct sk_buff *skb, struct mt76_wcid *wcid,
                          struct ieee80211_sta *sta, int pid,
-                         struct ieee80211_key_conf *key);
+                         struct ieee80211_key_conf *key, bool beacon);
 void mt7615_mac_set_timing(struct mt7615_phy *phy);
 int mt7615_mac_fill_rx(struct mt7615_dev *dev, struct sk_buff *skb);
 void mt7615_mac_add_txs(struct mt7615_dev *dev, void *data);