1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-02 23:22:07 +00:00

Kernel: Make sure we read all packets

The previous patch already helped with this, however my idea of only
reading a few packets didn't work and we'd still sometimes end up not
receiving any more packets from the E1000 interface.

With this patch applied my NIC seems to receive packets just fine, at
least for now.
This commit is contained in:
Gunnar Beutner 2021-05-01 19:51:24 +02:00 committed by Andreas Kling
parent 1dec93f45c
commit cf7df418ed

View file

@ -426,7 +426,7 @@ void E1000NetworkAdapter::receive()
{
auto* rx_descriptors = (e1000_tx_desc*)m_rx_descriptors_region->vaddr().as_ptr();
u32 rx_current;
for (u32 i = 0; i < number_of_rx_descriptors; i++) {
for (;;) {
rx_current = in32(REG_RXDESCTAIL) % number_of_rx_descriptors;
rx_current = (rx_current + 1) % number_of_rx_descriptors;
if (!(rx_descriptors[rx_current].status & 1))