Rust XHCI Implementation.
This commit is contained in:
parent
0b95098748
commit
a10c615b95
10 changed files with 438 additions and 30 deletions
25
rust/sys/voyageurs/src/xhci/event_ring.rs
Normal file
25
rust/sys/voyageurs/src/xhci/event_ring.rs
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
use alloc::vec::Vec;
|
||||
|
||||
use crate::xhci::data_structures::{EventRingSegmentTable, TrbRing};
|
||||
|
||||
pub struct EventRing {
|
||||
segment_table: EventRingSegmentTable,
|
||||
segments: Vec<TrbRing>,
|
||||
}
|
||||
|
||||
impl EventRing {
|
||||
pub fn new() -> Self {
|
||||
let mut event_ring = Self {
|
||||
segment_table: EventRingSegmentTable::new(1),
|
||||
segments: [TrbRing::new(100)].into(),
|
||||
};
|
||||
|
||||
event_ring.segment_table[0].from_trb_fing(&event_ring.segments[0]);
|
||||
|
||||
event_ring
|
||||
}
|
||||
|
||||
pub fn segment_table(&self) -> &EventRingSegmentTable {
|
||||
&self.segment_table
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue