Kernel: Enable IRQs before sending commands to the E1000 adapter

This change prevents a race condition, in which case we send a command
and we are losing an interrupt.
This commit is contained in:
Liav A 2020-03-06 15:52:44 +02:00 committed by Andreas Kling
parent 7c859efa85
commit 893d4a41c2
Notes: sideshowbarker 2024-07-19 08:09:36 +09:00

View file

@ -377,9 +377,9 @@ void E1000NetworkAdapter::send_raw(const u8* data, size_t length)
klog() << "E1000: Using tx descriptor " << tx_current << " (head is at " << in32(REG_TXDESCHEAD) << ")";
#endif
tx_current = (tx_current + 1) % number_of_tx_descriptors;
out32(REG_TXDESCTAIL, tx_current);
cli();
enable_irq();
out32(REG_TXDESCTAIL, tx_current);
for (;;) {
if (descriptor.status) {
sti();