mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:47:44 +00:00
Kernel: Convert klog() => AK::Format in UHCIController
This commit is contained in:
parent
f432f104fc
commit
4c7f486f39
1 changed files with 12 additions and 17 deletions
|
@ -141,8 +141,8 @@ void UHCIController::reset()
|
||||||
// Let's allocate the physical page for the Frame List (which is 4KiB aligned)
|
// Let's allocate the physical page for the Frame List (which is 4KiB aligned)
|
||||||
auto framelist_vmobj = ContiguousVMObject::create_with_size(PAGE_SIZE);
|
auto framelist_vmobj = ContiguousVMObject::create_with_size(PAGE_SIZE);
|
||||||
m_framelist = MemoryManager::the().allocate_kernel_region_with_vmobject(*framelist_vmobj, PAGE_SIZE, "UHCI Framelist", Region::Access::Write);
|
m_framelist = MemoryManager::the().allocate_kernel_region_with_vmobject(*framelist_vmobj, PAGE_SIZE, "UHCI Framelist", Region::Access::Write);
|
||||||
klog() << "UHCI: Allocated framelist at physical address " << m_framelist->physical_page(0)->paddr();
|
dbgln("UHCI: Allocated framelist at physical address {}", m_framelist->physical_page(0)->paddr());
|
||||||
klog() << "UHCI: Framelist is at virtual address " << m_framelist->vaddr();
|
dbgln("UHCI: Framelist is at virtual address {}", m_framelist->vaddr());
|
||||||
write_sofmod(64); // 1mS frame time
|
write_sofmod(64); // 1mS frame time
|
||||||
|
|
||||||
create_structures();
|
create_structures();
|
||||||
|
@ -153,7 +153,7 @@ void UHCIController::reset()
|
||||||
|
|
||||||
// Enable all interrupt types
|
// Enable all interrupt types
|
||||||
write_frnum(UHCI_USBINTR_TIMEOUT_CRC_ENABLE | UHCI_USBINTR_RESUME_INTR_ENABLE | UHCI_USBINTR_IOC_ENABLE | UHCI_USBINTR_SHORT_PACKET_INTR_ENABLE);
|
write_frnum(UHCI_USBINTR_TIMEOUT_CRC_ENABLE | UHCI_USBINTR_RESUME_INTR_ENABLE | UHCI_USBINTR_IOC_ENABLE | UHCI_USBINTR_SHORT_PACKET_INTR_ENABLE);
|
||||||
klog() << "UHCI: Reset completed!";
|
dbgln("UHCI: Reset completed");
|
||||||
}
|
}
|
||||||
|
|
||||||
UNMAP_AFTER_INIT void UHCIController::create_structures()
|
UNMAP_AFTER_INIT void UHCIController::create_structures()
|
||||||
|
@ -222,11 +222,11 @@ UNMAP_AFTER_INIT void UHCIController::create_structures()
|
||||||
# endif
|
# endif
|
||||||
}
|
}
|
||||||
|
|
||||||
# if UHCI_DEBUG
|
if constexpr (UHCI_DEBUG) {
|
||||||
klog() << "UHCI: Pool information:";
|
dbgln("UHCI: Pool information:");
|
||||||
klog() << "\tqh_pool: " << PhysicalAddress(m_qh_pool->physical_page(0)->paddr()) << ", length: " << m_qh_pool->range().size();
|
dbgln(" qh_pool: {}, length: {}", PhysicalAddress(m_qh_pool->physical_page(0)->paddr()), m_qh_pool->range().size());
|
||||||
klog() << "\ttd_pool: " << PhysicalAddress(m_td_pool->physical_page(0)->paddr()) << ", length: " << m_td_pool->range().size();
|
dbgln(" td_pool: {}, length: {}", PhysicalAddress(m_td_pool->physical_page(0)->paddr()), m_td_pool->range().size());
|
||||||
# endif
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
UNMAP_AFTER_INIT void UHCIController::setup_schedule()
|
UNMAP_AFTER_INIT void UHCIController::setup_schedule()
|
||||||
|
@ -279,7 +279,6 @@ UNMAP_AFTER_INIT void UHCIController::setup_schedule()
|
||||||
for (int frame = 0; frame < UHCI_NUMBER_OF_FRAMES; frame++) {
|
for (int frame = 0; frame < UHCI_NUMBER_OF_FRAMES; frame++) {
|
||||||
// Each frame pointer points to iso_td % NUM_ISO_TDS
|
// Each frame pointer points to iso_td % NUM_ISO_TDS
|
||||||
framelist[frame] = m_iso_td_list.at(frame % UHCI_NUMBER_OF_ISOCHRONOUS_TDS)->paddr();
|
framelist[frame] = m_iso_td_list.at(frame % UHCI_NUMBER_OF_ISOCHRONOUS_TDS)->paddr();
|
||||||
// klog() << PhysicalAddress(framelist[frame]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
m_interrupt_transfer_queue->print();
|
m_interrupt_transfer_queue->print();
|
||||||
|
@ -294,9 +293,7 @@ QueueHead* UHCIController::allocate_queue_head() const
|
||||||
for (QueueHead* queue_head : m_free_qh_pool) {
|
for (QueueHead* queue_head : m_free_qh_pool) {
|
||||||
if (!queue_head->in_use()) {
|
if (!queue_head->in_use()) {
|
||||||
queue_head->set_in_use(true);
|
queue_head->set_in_use(true);
|
||||||
# if UHCI_DEBUG
|
dbgln_if(UHCI_DEBUG, "UHCI: Allocated a new Queue Head! Located @ {} ({})", VirtualAddress(queue_head), PhysicalAddress(queue_head->paddr()));
|
||||||
klog() << "UHCI: Allocated a new Queue Head! Located @ " << VirtualAddress(queue_head) << "(" << PhysicalAddress(queue_head->paddr()) << ")";
|
|
||||||
# endif
|
|
||||||
return queue_head;
|
return queue_head;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -310,9 +307,7 @@ TransferDescriptor* UHCIController::allocate_transfer_descriptor() const
|
||||||
for (TransferDescriptor* transfer_descriptor : m_free_td_pool) {
|
for (TransferDescriptor* transfer_descriptor : m_free_td_pool) {
|
||||||
if (!transfer_descriptor->in_use()) {
|
if (!transfer_descriptor->in_use()) {
|
||||||
transfer_descriptor->set_in_use(true);
|
transfer_descriptor->set_in_use(true);
|
||||||
# if UHCI_DEBUG
|
dbgln_if(UHCI_DEBUG, "UHCI: Allocated a new Transfer Descriptor! Located @ {} ({})", VirtualAddress(transfer_descriptor), PhysicalAddress(transfer_descriptor->paddr()));
|
||||||
klog() << "UHCI: Allocated a new Transfer Descriptor! Located @ " << VirtualAddress(transfer_descriptor) << "(" << PhysicalAddress(transfer_descriptor->paddr()) << ")";
|
|
||||||
# endif
|
|
||||||
return transfer_descriptor;
|
return transfer_descriptor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -339,7 +334,7 @@ void UHCIController::start()
|
||||||
if (!(read_usbsts() & UHCI_USBSTS_HOST_CONTROLLER_HALTED))
|
if (!(read_usbsts() & UHCI_USBSTS_HOST_CONTROLLER_HALTED))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
klog() << "UHCI: Started!";
|
dbgln("UHCI: Started");
|
||||||
}
|
}
|
||||||
|
|
||||||
struct setup_packet {
|
struct setup_packet {
|
||||||
|
@ -352,7 +347,7 @@ struct setup_packet {
|
||||||
|
|
||||||
void UHCIController::do_debug_transfer()
|
void UHCIController::do_debug_transfer()
|
||||||
{
|
{
|
||||||
klog() << "UHCI: Attempting a dummy transfer...";
|
dbgln("UHCI: Attempting a dummy transfer...");
|
||||||
|
|
||||||
// Okay, let's set up the buffer so we can write some data
|
// Okay, let's set up the buffer so we can write some data
|
||||||
auto vmobj = ContiguousVMObject::create_with_size(PAGE_SIZE);
|
auto vmobj = ContiguousVMObject::create_with_size(PAGE_SIZE);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue