diff --git a/e1000d/Cargo.toml b/e1000d/Cargo.toml index 6261f65df5..9a9f2ab0a9 100644 --- a/e1000d/Cargo.toml +++ b/e1000d/Cargo.toml @@ -7,5 +7,5 @@ bitflags = "*" dma = { path = "../../crates/dma/" } event = { path = "../../crates/event/" } io = { path = "../../crates/io/" } -spin = "*" +netutils = { path = "../../programs/netutils/" } syscall = { path = "../../syscall/" } diff --git a/e1000d/src/device.rs b/e1000d/src/device.rs index 257369c906..d8c518b7a7 100644 --- a/e1000d/src/device.rs +++ b/e1000d/src/device.rs @@ -1,6 +1,7 @@ use std::{cmp, mem, ptr, slice}; use dma::Dma; +use netutils::setcfg; use syscall::error::{Error, EACCES, EWOULDBLOCK, Result}; use syscall::scheme::Scheme; @@ -272,6 +273,7 @@ impl Intel8254x { mac_high as u8, (mac_high >> 8) as u8]; println!(" - MAC: {:>02X}:{:>02X}:{:>02X}:{:>02X}:{:>02X}:{:>02X}", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); + let _ = setcfg("mac", &format!("{:>02X}.{:>02X}.{:>02X}.{:>02X}.{:>02X}.{:>02X}", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5])); // // MTA => 0; diff --git a/e1000d/src/main.rs b/e1000d/src/main.rs index fbec102b3d..9dbcf790ed 100644 --- a/e1000d/src/main.rs +++ b/e1000d/src/main.rs @@ -2,6 +2,7 @@ extern crate dma; extern crate event; +extern crate netutils; extern crate syscall; use std::cell::RefCell; diff --git a/rtl8168d/Cargo.toml b/rtl8168d/Cargo.toml index 394f156677..a4243e736d 100644 --- a/rtl8168d/Cargo.toml +++ b/rtl8168d/Cargo.toml @@ -7,5 +7,5 @@ bitflags = "*" dma = { path = "../../crates/dma/" } event = { path = "../../crates/event/" } io = { path = "../../crates/io/" } -spin = "*" +netutils = { path = "../../programs/netutils/" } syscall = { path = "../../syscall/" } diff --git a/rtl8168d/src/device.rs b/rtl8168d/src/device.rs index 4e8f53ce74..e0b8998aa9 100644 --- a/rtl8168d/src/device.rs +++ b/rtl8168d/src/device.rs @@ -2,6 +2,7 @@ use std::mem; use dma::Dma; use io::{Mmio, Io, ReadOnly}; +use netutils::setcfg; use syscall::error::{Error, EACCES, EWOULDBLOCK, Result}; use syscall::scheme::SchemeMut; @@ -221,6 +222,7 @@ impl Rtl8168 { mac_high as u8, (mac_high >> 8) as u8]; println!(" - MAC: {:>02X}:{:>02X}:{:>02X}:{:>02X}:{:>02X}:{:>02X}", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); + let _ = setcfg("mac", &format!("{:>02X}.{:>02X}.{:>02X}.{:>02X}.{:>02X}.{:>02X}", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5])); // Reset - this will disable tx and rx, reinitialize FIFOs, and set the system buffer pointer to the initial value self.regs.cmd.writef(1 << 4, true); diff --git a/rtl8168d/src/main.rs b/rtl8168d/src/main.rs index 44609030c0..ddfa9e0935 100644 --- a/rtl8168d/src/main.rs +++ b/rtl8168d/src/main.rs @@ -3,6 +3,7 @@ extern crate dma; extern crate event; extern crate io; +extern crate netutils; extern crate syscall; use std::cell::RefCell;