mt76: sdio: honor the largest Tx buffer the hardware can support
A message that is not in the archive (sent off-list or not yet received): Yd/sYYP1XJ3J8RuR@lore-desk--annotate
From: Sean Wang <[email protected]>
<snip>
Quoted 13 lines
Review int mt76s_hw_init(struct mt76_dev *dev, struct · line 310
Quoted 11 lines
(quoted diff) +8
-0@@ -299,6 +301,17 @@ int mt76s_hw_init(struct mt76_dev *dev, struct sdio_func *func, int hw_ver) } EXPORT_SYMBOL_GPL(mt76s_hw_init); +u32 mt76s_get_xmit_buf_sz(struct mt76_dev *dev, u32 dev_max_len) { + struct sdio_func *func = dev->sdio.func; + u32 host_max_len = min_t(u32, func->card->host->max_req_size, + func->cur_blksize * + func->card->host->max_blk_count); + + return min_t(u32, host_max_len, dev_max_len); } +EXPORT_SYMBOL_GPL(mt76s_get_xmit_buf_sz);I think we can squash this patch with the previous one and move the code above in
mt76s_init(). Agree?
these comments you have in the patchset all look fine to me, I will post v2 soon.
Sean
Quoted 26 lines
Regards,
LorenzoQuoted 21 lines
(quoted diff) +1
-0+ int mt76s_alloc_rx_queue(struct mt76_dev *dev, enum mt76_rxq_id qid) { struct mt76_queue *q = &dev->q_rx[qid]; diff --git
a/drivers/net/wireless/mediatek/mt76/sdio_txrx.cb/drivers/net/wireless/mediatek/mt76/sdio_txrx.c
indexa04cd2444247..9fcf507e09bd100644drivers/net/wireless/mediatek/mt76/sdio_txrx.c +1
-2@@ -254,7 +254,7 @@ static int mt76s_tx_run_queue(struct mt76_dev *dev, struct mt76_queue *q) } pad =roundup (e->skb->len,4 ) - e->skb->len; -if (len + e->skb->len + pad +4 >MT76S_XMIT_BUF_SZ ) +if (len + e->skb->len + pad +4 > dev->sdio.xmit_buf_sz)break ; if (mt76s_tx_pick_quota(sdio, mcu, e->buf_sz, &pse_sz, --2.25.1