Skip to content

Commit

Permalink
mt76: introduce tx_queue_skb function pointer in mt76_bus_ops
Browse files Browse the repository at this point in the history
Add tx_queue_skb function pointer in mt76_bus_ops since mt76x2u based
devices do not map mt76x2_txwi on dma buffers and it is not possible
to reuse mt76_dma_tx_queue_skb() routine to enqueue tx frames to
hw buffers

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
  • Loading branch information
LorenzoBianconi authored and nbd168 committed Sep 11, 2018
1 parent 7ac6dac commit 66f3949
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,7 @@ static const struct mt76_queue_ops mt76_dma_ops = {
.init = mt76_dma_init,
.alloc = mt76_dma_alloc_queue,
.add_buf = mt76_dma_add_buf,
.tx_queue_skb = mt76_dma_tx_queue_skb,
.tx_cleanup = mt76_dma_tx_cleanup,
.rx_reset = mt76_dma_rx_reset,
.kick = mt76_dma_kick_queue,
Expand Down
5 changes: 5 additions & 0 deletions mt76.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#define MT_RX_BUF_SIZE 2048

struct mt76_dev;
struct mt76_wcid;

struct mt76_bus_ops {
u32 (*rr)(struct mt76_dev *dev, u32 offset);
Expand Down Expand Up @@ -110,6 +111,10 @@ struct mt76_queue_ops {
struct mt76_queue_buf *buf, int nbufs, u32 info,
struct sk_buff *skb, void *txwi);

int (*tx_queue_skb)(struct mt76_dev *dev, struct mt76_queue *q,
struct sk_buff *skb, struct mt76_wcid *wcid,
struct ieee80211_sta *sta);

void *(*dequeue)(struct mt76_dev *dev, struct mt76_queue *q, bool flush,
int *len, u32 *info, bool *more);

Expand Down
9 changes: 5 additions & 4 deletions tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ mt76_tx(struct mt76_dev *dev, struct ieee80211_sta *sta,
q = &dev->q_tx[qid];

spin_lock_bh(&q->lock);
mt76_dma_tx_queue_skb(dev, q, skb, wcid, sta);
dev->queue_ops->tx_queue_skb(dev, q, skb, wcid, sta);
dev->queue_ops->kick(dev, q);

if (q->queued > q->ndesc - 8)
Expand Down Expand Up @@ -167,7 +167,7 @@ mt76_queue_ps_skb(struct mt76_dev *dev, struct ieee80211_sta *sta,
info->flags |= IEEE80211_TX_STATUS_EOSP;

mt76_skb_set_moredata(skb, !last);
mt76_dma_tx_queue_skb(dev, hwq, skb, wcid, sta);
dev->queue_ops->tx_queue_skb(dev, hwq, skb, wcid, sta);
}

void
Expand Down Expand Up @@ -247,7 +247,7 @@ mt76_txq_send_burst(struct mt76_dev *dev, struct mt76_queue *hwq,
if (ampdu)
mt76_check_agg_ssn(mtxq, skb);

idx = mt76_dma_tx_queue_skb(dev, hwq, skb, wcid, txq->sta);
idx = dev->queue_ops->tx_queue_skb(dev, hwq, skb, wcid, txq->sta);

if (idx < 0)
return idx;
Expand Down Expand Up @@ -282,7 +282,8 @@ mt76_txq_send_burst(struct mt76_dev *dev, struct mt76_queue *hwq,
if (cur_ampdu)
mt76_check_agg_ssn(mtxq, skb);

idx = mt76_dma_tx_queue_skb(dev, hwq, skb, wcid, txq->sta);
idx = dev->queue_ops->tx_queue_skb(dev, hwq, skb, wcid,
txq->sta);
if (idx < 0)
return idx;

Expand Down

0 comments on commit 66f3949

Please sign in to comment.