mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-28 14:02:51 +00:00
Kernel: Make sure the E1000 network adapter keeps receiving packets
Previously the E1000 network adapter would stop receiving further packets when an RX buffer overrun occurred. This was the case when connecting the adapter to a real network where enough broadcast traffic caused the buffer to be full before the kernel had a chance to clear the RX buffer.
This commit is contained in:
parent
f4a05611c6
commit
addddb4880
Notes:
sideshowbarker
2024-07-18 19:02:41 +09:00
Author: https://github.com/gunnarbeutner
Commit: addddb4880
Pull-request: https://github.com/SerenityOS/serenity/pull/6669
Reviewed-by: https://github.com/IdanHo ✅
Reviewed-by: https://github.com/supercomputer7
1 changed files with 1 additions and 3 deletions
|
@ -425,10 +425,8 @@ void E1000NetworkAdapter::receive()
|
|||
{
|
||||
auto* rx_descriptors = (e1000_tx_desc*)m_rx_descriptors_region->vaddr().as_ptr();
|
||||
u32 rx_current;
|
||||
for (;;) {
|
||||
for (u32 i = 0; i < number_of_rx_descriptors; i++) {
|
||||
rx_current = in32(REG_RXDESCTAIL) % number_of_rx_descriptors;
|
||||
if (rx_current == (in32(REG_RXDESCHEAD) % number_of_rx_descriptors))
|
||||
return;
|
||||
rx_current = (rx_current + 1) % number_of_rx_descriptors;
|
||||
if (!(rx_descriptors[rx_current].status & 1))
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue