Rust XHCI Implementation.

This commit is contained in:
Drew 2025-12-05 22:01:13 -08:00
parent 0b95098748
commit a10c615b95
10 changed files with 438 additions and 30 deletions

View 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
}
}