mt76: move pad estimation out of mt76_skb_adjust_pad

Move frame pad computation out of mt76_skb_adjust_pad routine.
This is a preliminary patch to introduce sdio tx aggregation.

Tested-by: Sean Wang <[email protected]>
Co-developed-by: Sean Wang <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
Lorenzo Bianconi
2020-09-08 23:44:29 +02:00
committed by Felix Fietkau
parent d62ba15b1b
commit fdf14d1b6a
7 changed files with 18 additions and 14 deletions
+3 -2
View File
@@ -226,12 +226,13 @@ mt76s_tx_queue_skb_raw(struct mt76_dev *dev, enum mt76_txq_id qid,
struct sk_buff *skb, u32 tx_info)
{
struct mt76_queue *q = dev->q_tx[qid];
int ret = -ENOSPC, len = skb->len;
int ret = -ENOSPC, len = skb->len, pad;
if (q->queued == q->ndesc)
goto error;
ret = mt76_skb_adjust_pad(skb);
pad = round_up(skb->len, 4) - skb->len;
ret = mt76_skb_adjust_pad(skb, pad);
if (ret)
goto error;