Skip to content

Commit

Permalink
Update EventSte structure
Browse files Browse the repository at this point in the history
  • Loading branch information
jackpot51 committed Aug 2, 2017
1 parent e83471f commit 832f830
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions xhcid/src/xhci/event.rs
Expand Up @@ -6,8 +6,9 @@ use super::trb::Trb;
#[repr(packed)]
pub struct EventRingSte {
pub address: Mmio<u64>,
pub size: Mmio<u32>,
_rsvd: Mmio<u32>,
pub size: Mmio<u16>,
_rsvd: Mmio<u16>,
_rsvd2: Mmio<u32>,
}

pub struct EventRing {
Expand All @@ -23,7 +24,7 @@ impl EventRing {
};

ring.ste.address.write(ring.trbs.physical() as u64);
ring.ste.size.write(ring.trbs.len() as u32);
ring.ste.size.write(ring.trbs.len() as u16);

Ok(ring)
}
Expand Down
4 changes: 2 additions & 2 deletions xhcid/src/xhci/mod.rs
Expand Up @@ -111,12 +111,12 @@ impl Xhci {

// Set event ring segment table registers
println!(" - Interrupter 0: {:X}", self.run.ints.as_ptr() as usize);
println!(" - Write ERDP");
self.run.ints[0].erdp.write(self.cmd.events.trbs.physical() as u64);
println!(" - Write ERSTZ");
self.run.ints[0].erstsz.write(1);
println!(" - Write ERSTBA: {:X}", self.cmd.events.ste.physical() as u64);
self.run.ints[0].erstba.write(self.cmd.events.ste.physical() as u64);
println!(" - Write ERDP");
self.run.ints[0].erdp.write(self.cmd.events.trbs.physical() as u64);

// Set run/stop to 1
println!(" - Start");
Expand Down

0 comments on commit 832f830

Please sign in to comment.