diff options
author | Lorenzo Bianconi <lorenzo@kernel.org> | 2021-04-20 23:05:31 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2021-04-21 20:55:55 +0200 |
commit | b17aff3368916136ba2a87669bb3c319e5c6d0b2 (patch) | |
tree | 086b19e007dd3c9d03130997a393e74455213dc6 /drivers/net/wireless/mediatek/mt76/mt7615/pci_mac.c | |
parent | fe3fccde8870764ba3e60610774bd7bc9f8faeff (diff) |
mt76: move token_lock, token and token_count in mt76_dev
Move token_lock, token and token_count data structures in mt76_dev.
This is a preliminary patch to move token management in mt76 common
module since it is shared by mt7615, mt7915 and mt7921 drivers.
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76/mt7615/pci_mac.c')
-rw-r--r-- | drivers/net/wireless/mediatek/mt76/mt7615/pci_mac.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/pci_mac.c b/drivers/net/wireless/mediatek/mt76/mt7615/pci_mac.c index d20962cdecc8..d5aff409132d 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/pci_mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/pci_mac.c @@ -37,9 +37,9 @@ void mt7615_tx_complete_skb(struct mt76_dev *mdev, struct mt76_queue_entry *e) token = le16_to_cpu(txp->hw.msdu_id[0]) & ~MT_MSDU_ID_VALID; - spin_lock_bh(&dev->token_lock); - t = idr_remove(&dev->token, token); - spin_unlock_bh(&dev->token_lock); + spin_lock_bh(&mdev->token_lock); + t = idr_remove(&mdev->token, token); + spin_unlock_bh(&mdev->token_lock); e->skb = t ? t->skb : NULL; } @@ -161,9 +161,9 @@ int mt7615_tx_prepare_skb(struct mt76_dev *mdev, void *txwi_ptr, t = (struct mt76_txwi_cache *)(txwi + mdev->drv->txwi_size); t->skb = tx_info->skb; - spin_lock_bh(&dev->token_lock); - id = idr_alloc(&dev->token, t, 0, MT7615_TOKEN_SIZE, GFP_ATOMIC); - spin_unlock_bh(&dev->token_lock); + spin_lock_bh(&mdev->token_lock); + id = idr_alloc(&mdev->token, t, 0, MT7615_TOKEN_SIZE, GFP_ATOMIC); + spin_unlock_bh(&mdev->token_lock); if (id < 0) return id; @@ -314,7 +314,7 @@ void mt7615_mac_reset_work(struct work_struct *work) mt7615_dma_reset(dev); mt7615_tx_token_put(dev); - idr_init(&dev->token); + idr_init(&dev->mt76.token); mt76_wr(dev, MT_WPDMA_MEM_RNG_ERR, 0); |