e1000: fix resetting bug
authorBarret Rhoden <brho@cs.berkeley.edu>
Tue, 26 Mar 2013 22:44:15 +0000 (15:44 -0700)
committerBarret Rhoden <brho@cs.berkeley.edu>
Tue, 26 Mar 2013 22:45:18 +0000 (15:45 -0700)
Need to replace our buggy e1000 with a real one.

kern/arch/i686/e1000.c

index 955e4ca..7b57188 100644 (file)
@@ -607,14 +607,7 @@ void e1000_configure() {
 void e1000_reset() {
        e1000_debug("-->Resetting device..... ");
 
-       // Get control
-       uint32_t ctrl = e1000_rr32(E1000_CTRL);
-
-       // Set the reset bit
-       ctrl = ctrl & E1000_CTRL_RST;
-
-       // Write the reset bit
-       e1000_wr32(E1000_CTRL, ctrl);
+       e1000_wr32(E1000_CTRL, e1000_rr32(E1000_CTRL) | E1000_CTRL_RST);
 
        e1000_debug(" done.\n");