This commit is contained in:
Sebastien Bourdeauducq 2021-07-05 13:45:22 +08:00
parent a42e5a95ff
commit 2c161720fa
1 changed files with 97 additions and 138 deletions

View File

@ -1,4 +1,5 @@
pub mod id;
use id::{identify_phy, PhyIdentifier};
mod status;
pub use status::Status;
mod control;
@ -34,10 +35,6 @@ pub trait PhyRegister {
fn addr() -> u8;
}
#[cfg(not(feature = "target_kasli_soc"))]
mod phy_impl {
use super::*;
use id::{identify_phy, PhyIdentifier};
#[derive(Clone)]
pub struct Phy {
@ -143,41 +140,3 @@ mod phy_impl {
);
}
}
}
#[cfg(feature = "target_kasli_soc")]
mod phy_impl {
use super::*;
#[derive(Clone)]
pub struct Phy {
}
impl Phy {
pub fn find<PA: PhyAccess>(_pa: &mut PA) -> Option<Phy> {
Some(Phy {})
}
pub fn get_link<PA: PhyAccess>(&self, _pa: &mut PA) -> Option<Link> {
Some(Link {
speed: LinkSpeed::S1000,
duplex: LinkDuplex::Full,
})
}
pub fn modify_control<PA, F>(&self, _pa: &mut PA, _f: F)
where
PA: PhyAccess,
F: FnMut(Control) -> Control,
{
}
pub fn reset<PA: PhyAccess>(&self, _pa: &mut PA) {
}
pub fn restart_autoneg<PA: PhyAccess>(&self, _pa: &mut PA) {
}
}
}
pub use phy_impl::*;