x86: interrupt return path checks kmsgs
[akaros.git] / kern / arch / i686 / ne2k.c
index c4a429d..5576550 100644 (file)
@@ -85,6 +85,9 @@ void ne2k_init() {
        ne2k_mem_alloc();
        ne2k_configure_nic();
        ne2k_read_mac();
+       printk("Network Card MAC Address: %02x:%02x:%02x:%02x:%02x:%02x\n", 
+          device_mac[0],device_mac[1],device_mac[2],
+          device_mac[3],device_mac[4],device_mac[5]);
        //ne2k_test_interrupts();
        send_frame = &ne2k_send_frame;
 
@@ -199,7 +202,13 @@ void ne2k_setup_interrupts() {
        // Kernel based interrupt stuff
        register_interrupt_handler(interrupt_handlers, KERNEL_IRQ_OFFSET + ne2k_irq, ne2k_interrupt_handler, (void *)0);
        
-       ioapic_route_irq(ne2k_irq, 6);  
+#ifdef __CONFIG_DISABLE_MPTABLES__
+       pic_unmask_irq(ne2k_irq);
+       unmask_lapic_lvt(LAPIC_LVT_LINT0);
+       enable_irq();
+#else
+       ioapic_route_irq(ne2k_irq, 0);  
+#endif
        
        SET_PAGE_0();
 
@@ -382,7 +391,7 @@ void ne2k_handle_rx_packet() {
                return;
        }
 
-
+#ifdef __CONFIG_APPSERVER__
        // Treat as a syscall frontend response packet if eth_type says so
        // Will eventually go away, so not too worried about elegance here...
        #include <frontend.h>
@@ -393,6 +402,7 @@ void ne2k_handle_rx_packet() {
                kfree(rx_buffer);
                return;
        }
+#endif
 
        spin_lock(&packet_buffers_lock);