]> Projects (at) Tadryanom (dot) Me - AdrOS.git/commitdiff
fix: rx_thread uses ksem_wait_timeout on e1000_rx_sem instead of blind process_sleep...
authorTulio A M Mendes <[email protected]>
Fri, 13 Feb 2026 19:29:19 +0000 (16:29 -0300)
committerTulio A M Mendes <[email protected]>
Fri, 13 Feb 2026 19:29:19 +0000 (16:29 -0300)
src/net/e1000_netif.c

index 2bec758722f1ad1fddd7c37278dd78a972cfe7a2..8631cd407e53fadb44747642ce493d24894f1d64 100644 (file)
@@ -98,9 +98,9 @@ static uint8_t rx_tmp[2048];
 
 static void e1000_rx_thread(void) {
     for (;;) {
-        /* Poll every tick (~20ms at 50Hz).  The E1000 IRQ sets
-         * e1000_rx_sem, but for robustness we also poll. */
-        process_sleep(1);
+        /* Wait for the E1000 IRQ to signal a packet, with a 20ms
+         * timeout for robustness (catches missed interrupts). */
+        ksem_wait_timeout(&e1000_rx_sem, 20);
 
         for (;;) {
             int len = e1000_recv(rx_tmp, sizeof(rx_tmp));