Skip to content

Commit 24289e4

Browse files
committed
virtionet: Add back legacy IRQ support
1 parent 720031b commit 24289e4

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

src/drivers/virtionet.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,8 @@ VirtioNet::VirtioNet(hw::PCI_Device& d)
156156
}
157157
else
158158
{
159-
assert(0 && "Legacy IRQs not supported");
159+
auto irq = Virtio::get_legacy_irq();
160+
IRQ_manager::get().subscribe(irq, {this, &VirtioNet::legacy_handler});
160161
}
161162

162163
#ifndef NO_DEFERRED_KICK
@@ -243,6 +244,12 @@ void VirtioNet::msix_xmit_handler()
243244
}
244245
}
245246

247+
void VirtioNet::legacy_handler()
248+
{
249+
msix_recv_handler();
250+
msix_xmit_handler();
251+
}
252+
246253
void VirtioNet::add_receive_buffer(uint8_t* pkt)
247254
{
248255
// offset pointer to virtionet header

src/drivers/virtionet.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,8 @@ class VirtioNet : Virtio, public net::Link_layer<net::Ethernet> {
220220
void msix_xmit_handler();
221221
void msix_conf_handler();
222222

223+
void legacy_handler();
224+
223225
/** Allocate and queue buffer from bufstore_ in RX queue. */
224226
void add_receive_buffer(uint8_t*);
225227

0 commit comments

Comments
 (0)