mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
wifi: mt76: sdio: add rx_check callback for sdio devices
Introduce rx_check callback support for mt7921s driver. 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:
committed by
Felix Fietkau
parent
9dd7be2c51
commit
0ad02c9a45
@@ -96,6 +96,7 @@ static int mt7921s_probe(struct sdio_func *func,
|
|||||||
.tx_complete_skb = mt7921_usb_sdio_tx_complete_skb,
|
.tx_complete_skb = mt7921_usb_sdio_tx_complete_skb,
|
||||||
.tx_status_data = mt7921_usb_sdio_tx_status_data,
|
.tx_status_data = mt7921_usb_sdio_tx_status_data,
|
||||||
.rx_skb = mt7921_queue_rx_skb,
|
.rx_skb = mt7921_queue_rx_skb,
|
||||||
|
.rx_check = mt7921_rx_check,
|
||||||
.sta_ps = mt7921_sta_ps,
|
.sta_ps = mt7921_sta_ps,
|
||||||
.sta_add = mt7921_mac_sta_add,
|
.sta_add = mt7921_mac_sta_add,
|
||||||
.sta_assoc = mt7921_mac_sta_assoc,
|
.sta_assoc = mt7921_mac_sta_assoc,
|
||||||
|
|||||||
+16
-7
@@ -85,7 +85,7 @@ mt76s_rx_run_queue(struct mt76_dev *dev, enum mt76_rxq_id qid,
|
|||||||
struct mt76_sdio *sdio = &dev->sdio;
|
struct mt76_sdio *sdio = &dev->sdio;
|
||||||
int len = 0, err, i;
|
int len = 0, err, i;
|
||||||
struct page *page;
|
struct page *page;
|
||||||
u8 *buf;
|
u8 *buf, *end;
|
||||||
|
|
||||||
for (i = 0; i < intr->rx.num[qid]; i++)
|
for (i = 0; i < intr->rx.num[qid]; i++)
|
||||||
len += round_up(intr->rx.len[qid][i] + 4, 4);
|
len += round_up(intr->rx.len[qid][i] + 4, 4);
|
||||||
@@ -112,20 +112,29 @@ mt76s_rx_run_queue(struct mt76_dev *dev, enum mt76_rxq_id qid,
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < intr->rx.num[qid]; i++) {
|
end = buf + len;
|
||||||
|
i = 0;
|
||||||
|
|
||||||
|
while (i < intr->rx.num[qid] && buf < end) {
|
||||||
int index = (q->head + i) % q->ndesc;
|
int index = (q->head + i) % q->ndesc;
|
||||||
struct mt76_queue_entry *e = &q->entry[index];
|
struct mt76_queue_entry *e = &q->entry[index];
|
||||||
__le32 *rxd = (__le32 *)buf;
|
__le32 *rxd = (__le32 *)buf;
|
||||||
|
|
||||||
/* parse rxd to get the actual packet length */
|
/* parse rxd to get the actual packet length */
|
||||||
len = le32_get_bits(rxd[0], GENMASK(15, 0));
|
len = le32_get_bits(rxd[0], GENMASK(15, 0));
|
||||||
e->skb = mt76s_build_rx_skb(buf, len, round_up(len + 4, 4));
|
|
||||||
if (!e->skb)
|
|
||||||
break;
|
|
||||||
|
|
||||||
|
/* Optimized path for TXS */
|
||||||
|
if (!dev->drv->rx_check || dev->drv->rx_check(dev, buf, len)) {
|
||||||
|
e->skb = mt76s_build_rx_skb(buf, len,
|
||||||
|
round_up(len + 4, 4));
|
||||||
|
if (!e->skb)
|
||||||
|
break;
|
||||||
|
|
||||||
|
if (q->queued + i + 1 == q->ndesc)
|
||||||
|
break;
|
||||||
|
i++;
|
||||||
|
}
|
||||||
buf += round_up(len + 4, 4);
|
buf += round_up(len + 4, 4);
|
||||||
if (q->queued + i + 1 == q->ndesc)
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
put_page(page);
|
put_page(page);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user