diff --git a/xhcid/src/xhci.rs b/xhcid/src/xhci.rs index afd78e5eaf..63b7b2d9ba 100644 --- a/xhcid/src/xhci.rs +++ b/xhcid/src/xhci.rs @@ -72,15 +72,21 @@ bitflags! { } } -pub struct XhciPort(Mmio); +#[repr(packed)] +pub struct XhciPort { + portsc : Mmio, + portpmsc : Mmio, + portli : Mmio, + porthlpmc : Mmio, +} impl XhciPort { fn read(&self) -> u32 { - self.0.read() + self.portsc.read() } fn state(&self) -> u32 { - (self.read() & (0b111 << 5)) >> 5 + (self.read() & (0b1111 << 5)) >> 5 } fn speed(&self) -> u32 {