Commit d5c42613 authored by Lorenzo Bianconi's avatar Lorenzo Bianconi Committed by Felix Fietkau

mt76x2: use mt76_dev instead of mt76x2_dev in mt76x2_tx_queue_mcu

Use mt76_dev data structure instead of mt76x2_dev one in
mt76x2_tx_queue_mcu routine. This is a preliminary patch
to share mcu code between mt76x2e and mt76x0e
Signed-off-by: default avatarLorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent 8799b624
...@@ -209,7 +209,7 @@ void mt76x2_dma_cleanup(struct mt76x2_dev *dev); ...@@ -209,7 +209,7 @@ void mt76x2_dma_cleanup(struct mt76x2_dev *dev);
void mt76x2_cleanup(struct mt76x2_dev *dev); void mt76x2_cleanup(struct mt76x2_dev *dev);
int mt76x2_tx_queue_mcu(struct mt76x2_dev *dev, enum mt76_txq_id qid, int mt76x2_tx_queue_mcu(struct mt76_dev *dev, enum mt76_txq_id qid,
struct sk_buff *skb, int cmd, int seq); struct sk_buff *skb, int cmd, int seq);
void mt76x2_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control, void mt76x2_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control,
struct sk_buff *skb); struct sk_buff *skb);
......
...@@ -18,10 +18,10 @@ ...@@ -18,10 +18,10 @@
#include "mt76x02_dma.h" #include "mt76x02_dma.h"
int int
mt76x2_tx_queue_mcu(struct mt76x2_dev *dev, enum mt76_txq_id qid, mt76x2_tx_queue_mcu(struct mt76_dev *dev, enum mt76_txq_id qid,
struct sk_buff *skb, int cmd, int seq) struct sk_buff *skb, int cmd, int seq)
{ {
struct mt76_queue *q = &dev->mt76.q_tx[qid]; struct mt76_queue *q = &dev->q_tx[qid];
struct mt76_queue_buf buf; struct mt76_queue_buf buf;
dma_addr_t addr; dma_addr_t addr;
u32 tx_info; u32 tx_info;
...@@ -32,16 +32,16 @@ mt76x2_tx_queue_mcu(struct mt76x2_dev *dev, enum mt76_txq_id qid, ...@@ -32,16 +32,16 @@ mt76x2_tx_queue_mcu(struct mt76x2_dev *dev, enum mt76_txq_id qid,
FIELD_PREP(MT_MCU_MSG_PORT, CPU_TX_PORT) | FIELD_PREP(MT_MCU_MSG_PORT, CPU_TX_PORT) |
FIELD_PREP(MT_MCU_MSG_LEN, skb->len); FIELD_PREP(MT_MCU_MSG_LEN, skb->len);
addr = dma_map_single(dev->mt76.dev, skb->data, skb->len, addr = dma_map_single(dev->dev, skb->data, skb->len,
DMA_TO_DEVICE); DMA_TO_DEVICE);
if (dma_mapping_error(dev->mt76.dev, addr)) if (dma_mapping_error(dev->dev, addr))
return -ENOMEM; return -ENOMEM;
buf.addr = addr; buf.addr = addr;
buf.len = skb->len; buf.len = skb->len;
spin_lock_bh(&q->lock); spin_lock_bh(&q->lock);
mt76_queue_add_buf(dev, q, &buf, 1, tx_info, skb, NULL); dev->queue_ops->add_buf(dev, q, &buf, 1, tx_info, skb, NULL);
mt76_queue_kick(dev, q); dev->queue_ops->kick(dev, q);
spin_unlock_bh(&q->lock); spin_unlock_bh(&q->lock);
return 0; return 0;
......
...@@ -66,7 +66,7 @@ mt76x2_mcu_msg_send(struct mt76x2_dev *dev, struct sk_buff *skb, ...@@ -66,7 +66,7 @@ mt76x2_mcu_msg_send(struct mt76x2_dev *dev, struct sk_buff *skb,
if (!seq) if (!seq)
seq = ++dev->mcu.msg_seq & 0xf; seq = ++dev->mcu.msg_seq & 0xf;
ret = mt76x2_tx_queue_mcu(dev, MT_TXQ_MCU, skb, cmd, seq); ret = mt76x2_tx_queue_mcu(&dev->mt76, MT_TXQ_MCU, skb, cmd, seq);
if (ret) if (ret)
goto out; goto out;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment