[voyageurs] Zero-out command structures before passing them to XHCI.

This fixes two XHCI driver issues.
This commit is contained in:
Drew Galbraith 2025-05-08 00:34:40 -07:00
parent bddf26b645
commit 2258135cfc
2 changed files with 3 additions and 0 deletions

View File

@ -31,6 +31,7 @@ XhciTrb DeviceSlot::CreateAddressDeviceCommand(uint8_t root_port,
uint16_t max_packet_size) {
// Initialize Slot Context and Endpoint 0 Context.
input_context_->input.add_contexts = 0x3;
input_context_->input.drop_contexts = 0;
// Set context_entries to 1. XHCI 4.3.3
input_context_->slot_context.route_speed_entries = (0x1 << 27) | route_string;
input_context_->slot_context.latency_port_number = root_port << 16;

View File

@ -293,6 +293,8 @@ glcr::ErrorCode XhciDriver::InitiateEventRingSegmentTable() {
event_ring_segment_table_[0].ring_segment_base =
event_ring_.PhysicalAddress();
event_ring_segment_table_[0].ring_segment_size = ers_size & 0xFFFF;
event_ring_segment_table_[0].reserved1 = 0;
event_ring_segment_table_[0].reserved2 = 0;
runtime_->interrupters[0].event_ring_dequeue_pointer =
event_ring_.PhysicalAddress() | 0x8;