summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/mediatek/mt76/mt7603
diff options
context:
space:
mode:
authorLorenzo Bianconi <lorenzo@kernel.org>2020-11-11 14:47:28 +0100
committerFelix Fietkau <nbd@nbd.name>2020-12-04 14:31:14 +0100
commit8987059475f503cbf8c5fbb8e8fe537d602bec92 (patch)
tree5154ce17379da3060f2bdfe0ba8895e6c1ab43d4 /drivers/net/wireless/mediatek/mt76/mt7603
parente5655492e33c2e6b83ddb07c75fe91a64f07b8bc (diff)
downloadlwn-8987059475f503cbf8c5fbb8e8fe537d602bec92.tar.gz
lwn-8987059475f503cbf8c5fbb8e8fe537d602bec92.zip
mt76: rely on mt76_queue in tx_queue_skb signature
Rely on mt76_queue instead of qid in tx_queue_skb signature. This is a preliminary patch to move data queues in mt76_phy and add dbdc support to mt7915 driver Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76/mt7603')
-rw-r--r--drivers/net/wireless/mediatek/mt76/mt7603/beacon.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt7603/beacon.c b/drivers/net/wireless/mediatek/mt76/mt7603/beacon.c
index 2d2b429c9ffc..c78321ea0a4f 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7603/beacon.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7603/beacon.c
@@ -13,23 +13,25 @@ static void
mt7603_update_beacon_iter(void *priv, u8 *mac, struct ieee80211_vif *vif)
{
struct mt7603_dev *dev = (struct mt7603_dev *)priv;
+ struct mt76_dev *mdev = &dev->mt76;
struct mt7603_vif *mvif = (struct mt7603_vif *)vif->drv_priv;
struct sk_buff *skb = NULL;
- if (!(dev->mt76.beacon_mask & BIT(mvif->idx)))
+ if (!(mdev->beacon_mask & BIT(mvif->idx)))
return;
skb = ieee80211_beacon_get(mt76_hw(dev), vif);
if (!skb)
return;
- mt76_tx_queue_skb(dev, MT_TXQ_BEACON, skb, &mvif->sta.wcid, NULL);
+ mt76_tx_queue_skb(dev, mdev->q_tx[MT_TXQ_BEACON], skb,
+ &mvif->sta.wcid, NULL);
spin_lock_bh(&dev->ps_lock);
mt76_wr(dev, MT_DMA_FQCR0, MT_DMA_FQCR0_BUSY |
FIELD_PREP(MT_DMA_FQCR0_TARGET_WCID, mvif->sta.wcid.idx) |
FIELD_PREP(MT_DMA_FQCR0_TARGET_QID,
- dev->mt76.q_tx[MT_TXQ_CAB]->hw_idx) |
+ mdev->q_tx[MT_TXQ_CAB]->hw_idx) |
FIELD_PREP(MT_DMA_FQCR0_DEST_PORT_ID, 3) |
FIELD_PREP(MT_DMA_FQCR0_DEST_QUEUE_ID, 8));
@@ -67,6 +69,7 @@ mt7603_add_buffered_bc(void *priv, u8 *mac, struct ieee80211_vif *vif)
void mt7603_pre_tbtt_tasklet(struct tasklet_struct *t)
{
struct mt7603_dev *dev = from_tasklet(dev, t, mt76.pre_tbtt_tasklet);
+ struct mt76_dev *mdev = &dev->mt76;
struct mt76_queue *q;
struct beacon_bc_data data = {};
struct sk_buff *skb;
@@ -78,7 +81,7 @@ void mt7603_pre_tbtt_tasklet(struct tasklet_struct *t)
data.dev = dev;
__skb_queue_head_init(&data.q);
- q = dev->mt76.q_tx[MT_TXQ_BEACON];
+ q = mdev->q_tx[MT_TXQ_BEACON];
spin_lock_bh(&q->lock);
ieee80211_iterate_active_interfaces_atomic(mt76_hw(dev),
IEEE80211_IFACE_ITER_RESUME_ALL,
@@ -89,13 +92,13 @@ void mt7603_pre_tbtt_tasklet(struct tasklet_struct *t)
/* Flush all previous CAB queue packets */
mt76_wr(dev, MT_WF_ARB_CAB_FLUSH, GENMASK(30, 16) | BIT(0));
- mt76_queue_tx_cleanup(dev, dev->mt76.q_tx[MT_TXQ_CAB], false);
+ mt76_queue_tx_cleanup(dev, mdev->q_tx[MT_TXQ_CAB], false);
- mt76_csa_check(&dev->mt76);
- if (dev->mt76.csa_complete)
+ mt76_csa_check(mdev);
+ if (mdev->csa_complete)
goto out;
- q = dev->mt76.q_tx[MT_TXQ_CAB];
+ q = mdev->q_tx[MT_TXQ_CAB];
do {
nframes = skb_queue_len(&data.q);
ieee80211_iterate_active_interfaces_atomic(mt76_hw(dev),
@@ -120,7 +123,8 @@ void mt7603_pre_tbtt_tasklet(struct tasklet_struct *t)
struct ieee80211_vif *vif = info->control.vif;
struct mt7603_vif *mvif = (struct mt7603_vif *)vif->drv_priv;
- mt76_tx_queue_skb(dev, MT_TXQ_CAB, skb, &mvif->sta.wcid, NULL);
+ mt76_tx_queue_skb(dev, mdev->q_tx[MT_TXQ_CAB], skb,
+ &mvif->sta.wcid, NULL);
}
mt76_queue_kick(dev, q);
spin_unlock_bh(&q->lock);
@@ -135,9 +139,8 @@ void mt7603_pre_tbtt_tasklet(struct tasklet_struct *t)
((1 << (MT7603_MAX_INTERFACES - 1)) - 1)));
out:
- mt76_queue_tx_cleanup(dev, dev->mt76.q_tx[MT_TXQ_BEACON], false);
- if (dev->mt76.q_tx[MT_TXQ_BEACON]->queued >
- hweight8(dev->mt76.beacon_mask))
+ mt76_queue_tx_cleanup(dev, mdev->q_tx[MT_TXQ_BEACON], false);
+ if (mdev->q_tx[MT_TXQ_BEACON]->queued > hweight8(mdev->beacon_mask))
dev->beacon_check++;
}