IGbE: Remove is8257 variable
authorAli Saidi <saidi@eecs.umich.edu>
Tue, 6 Jan 2009 15:36:55 +0000 (10:36 -0500)
committerAli Saidi <saidi@eecs.umich.edu>
Tue, 6 Jan 2009 15:36:55 +0000 (10:36 -0500)
src/dev/Ethernet.py
src/dev/i8254xGBe.cc

index 670f48eac2a0427ea2f01d0bb9798892ce4936b2..d73d56d039af7ccee5e292381d55020f755106be 100644 (file)
@@ -69,7 +69,6 @@ class EtherDevice(PciDevice):
 class IGbE(EtherDevice):
     # Base class for two IGbE adapters listed above
     type = 'IGbE'
-    #abstract = True
     hardware_address = Param.EthernetAddr(NextEthernetAddr,
         "Ethernet Hardware Address")
     use_flow_control = Param.Bool(False,
@@ -105,20 +104,22 @@ class IGbE(EtherDevice):
     wb_comp_delay = Param.Latency('10ns', "delay after desc wb occurs")
     tx_read_delay = Param.Latency('0ns', "delay after tx dma read")
     rx_write_delay = Param.Latency('0ns', "delay after rx dma read")
-    is8257 = Param.Bool("Select between and 8254x and 8257x device")
-
+    phy_pid = Param.UInt16("Phy PID that corresponds to device ID")
+    phy_epid = Param.UInt16("Phy EPID that corresponds to device ID")
 
 class IGbE_e1000(IGbE):
     # Older Intel 8254x based gigabit ethernet adapter
     # Uses Intel e1000 driver
     DeviceID = 0x1075
-    is8257 = False
+    phy_pid = 0x02A8
+    phy_epid = 0x0380
 
 class IGbE_igb(IGbE):
     # Newer Intel 8257x based gigabit ethernet adapter
     # Uses Intel igb driver and in theory supports packet splitting and LRO
     DeviceID = 0x10C9
-    is8257 = True 
+    phy_pid = 0x0141
+    phy_epid = 0x0CC0
 
 class EtherDevBase(EtherDevice):
     type = 'EtherDevBase'
index 2a7ba0b3167b0ef6d348eef4e13e1410c6e01431..1e4fd130c5085df8269902ba64fbe40470a4cd6f 100644 (file)
@@ -446,16 +446,10 @@ IGbE::write(PacketPtr pkt)
                 regs.mdic.data(0x796D); // link up
                 break;
             case PHY_PID:
-                if (params()->is8257)
-                    regs.mdic.data(0x0141);
-                else
-                    regs.mdic.data(0x02A8);
+                regs.mdic.data(params()->phy_pid);
                 break;
             case PHY_EPID:
-                if (params()->is8257)
-                    regs.mdic.data(0x0CC0);
-                else
-                    regs.mdic.data(0x0380);
+                regs.mdic.data(params()->phy_epid);
                 break;
             case PHY_GSTATUS:
                 regs.mdic.data(0x7C00);