@@ -96,37 +96,19 @@ public AMDPCNetII(PCIDevice device)
96
96
mTransmitBuffer = new Queue < byte [ ] > ( ) ;
97
97
mRecvBuffer = new Queue < byte [ ] > ( ) ;
98
98
99
- //INTs.SetIntHandler((byte)(0x20 + device.InterruptLine), HandleNetworkInterrupt);
100
- //IOAPIC.SetEntry(19, (byte)(0x20 + device.InterruptLine));
99
+ INTs . SetIntHandler ( ( byte ) ( 0x20 + device . InterruptLine ) , HandleNetworkInterrupt ) ;
101
100
102
- /*Global.mDebugger.Send("device slot=" + device.slot);
103
- Global.mDebugger.Send("device function=" + device.function);
104
-
105
- foreach (var irqRouting in ACPI.IrqRoutingTable )
101
+ //Route IRQ for all IO/APIC PCI IRQ (I16-I20)
102
+ //We will have to fix this if we use multiple PCI devices that requires interrupts
103
+ //TODO: Use ACPI to find IRQ route
104
+ for ( byte i = 0 ; i < 4 ; i ++ )
106
105
{
107
- byte slot = (byte)((irqRouting.Address >> 16) & 0xFFFF);
108
- byte function = (byte)(irqRouting.Address & 0xFFFF);
109
-
110
- Global.mDebugger.Send("slot=" + slot);
111
- Global.mDebugger.Send("function=" + function);
112
- Global.mDebugger.Send("Address=0x" + (irqRouting.Address).ToString("X"));
113
- Global.mDebugger.Send("Pin=" + irqRouting.Pin);
114
- Global.mDebugger.Send("Source=" + irqRouting.Source);
115
- Global.mDebugger.Send("Source Index=" + irqRouting.SourceIndex);
116
-
117
- if (device.slot == slot && device.function == function)
118
- {
119
- Global.mDebugger.Send("DEVICE FOUND SETTING CUSTOM IRQ " + irqRouting.SourceIndex);
120
-
121
-
122
- }
123
- }*/
106
+ IOAPIC . SetEntry ( ( byte ) ( 16 + i ) , ( ulong ) ( 0x20 + device . InterruptLine ) ) ;
107
+ }
124
108
}
125
109
126
110
protected void HandleNetworkInterrupt ( ref INTs . IRQContext aContext )
127
111
{
128
- Global . mDebugger . Send ( "Network IRQ!" ) ;
129
-
130
112
uint cur_status = StatusRegister ;
131
113
132
114
if ( ( cur_status & 0x100 ) != 0 )
0 commit comments