|
Voxia OS v0.0.1
Hobby Project Operating System Targeting x86-64
|
#include <ehci.hpp>
Static Public Member Functions | |
| static void | fireHandler () |
| static EHCIModule * | getInstance () |
Private Member Functions | |
| void | push_to_qh (ehci_queue_head_node_t *qh_node) |
| void | pop_from_qh (ehci_queue_head_node_t *qh) |
| void | call_completion_callback (ioforge_device *dev) |
Additional Inherited Members | |
Protected Attributes inherited from IOForge | |
| const char * | mod |
| EHCIModule::EHCIModule | ( | ) |
Definition at line 8 of file init.cpp.
References IOforgePCI::IOforgePCI().
Referenced by fireHandler(), getInstance(), and unload().
| void EHCIModule::assign_address | ( | int | address | ) |
Definition at line 781 of file ehci.cpp.
References address, cmd, log, IOForge::mod, send_async_with_response(), and USB_SETUP_PACKET_SET_ADDRESS.
Referenced by probe().
|
private |
Definition at line 827 of file ehci.cpp.
References call_completion_callback(), EHCIPipe::data_node_, EHCI_QTD_TOKEN_STATUS_ACTIVE, ioforge_device::first_child, IOFORGE_USB_DEVICE, log, next, ioforge_device::next_sibling, EHCIPipe::on_complete(), ehci_queue_task_descriptor_node::task_descriptor, ehci_queue_task_descriptor::token, token, and ioforge_device::type.
Referenced by call_completion_callback().
|
static |
Definition at line 868 of file ehci.cpp.
References EHCIModule(), getInstance(), ioforge_get_usb_devices_root(), log, and status.
Referenced by load().
|
static |
Definition at line 10 of file init.cpp.
References EHCIModule(), and instance.
Referenced by fireHandler().
| void EHCIModule::init_controller | ( | ) |
Definition at line 33 of file ehci.cpp.
References ehci_queue_head::altTD, ehci_queue_head::ch, ehci_queue_head::currentTD, EHCI_MAX_QH_CACHE, EHCI_MAX_QTD_CACHE, ehci_op, EHCI_Q_SELECT_QH, EHCI_QH_CAP_HEAD_OF_RECLAMATION, EHCI_QTD_TERMINATE, EHCI_START_ASYNC_SCHEDULE, ehci_queue_head_node::head, ioforge_memset(), log, main_async_qh, IOForge::mod, ehci_queue_head::nextTD, offset, ehci_queue_head_node::physaddr, qh_pool, qh_ring, qh_ring_head, qh_ring_tail, ehci_queue_head::qhlp, qtd_pool, qtd_ring, qtd_ring_head, qtd_ring_tail, and retrieve_qh().
Referenced by load().
| void EHCIModule::init_periodic | ( | ) |
Definition at line 200 of file ehci.cpp.
References ehci_queue_head::altTD, ehci_queue_head::cap, ehci_queue_head::ch, ehci_queue_head::currentTD, ehci_op, EHCI_Q_SELECT_QH, EHCI_QH_CAP_HEAD_OF_RECLAMATION, EHCI_QTD_TERMINATE, framelist, framelist_node, ehci_queue_head_node::head, log, IOForge::mod, ehci_queue_head::nextTD, ehci_queue_head_node::physaddr, ehci_queue_head::qhlp, retrieve_qh(), start_periodic(), and ehci_queue_head::token.
Referenced by load().
| void EHCIModule::insert_periodic | ( | ehci_queue_head_node_t * | qh_node, |
| uint16_t | interval_ms ) |
Definition at line 234 of file ehci.cpp.
References EHCI_Q_SELECT_QH, framelist_node, ehci_queue_head_node::head, log, IOForge::mod, ehci_queue_head_node::physaddr, ehci_queue_head::qhlp, and ring.
|
virtual |
Implements IOforgePCI.
Definition at line 12 of file init.cpp.
References bar, controller, device, EHCI_1_MICRO_FRAME, EHCI_DEVICE_ID, ehci_op, EHCI_VENDOR_ID, IOforgePCI::findDevice(), fireHandler(), hccparam, hcsparam, init_controller(), init_periodic(), isr_irq_register(), log, IOForge::mod, probe(), reset_device(), serial2_printf(), start_device(), stop_device(), and vector.
|
private |
| void EHCIModule::port_reset | ( | int | port | ) |
Definition at line 569 of file ehci.cpp.
References ehci_op, EHCI_PORT_RESET, log, and IOForge::mod.
Referenced by probe().
| void EHCIModule::probe | ( | ) |
Definition at line 284 of file ehci.cpp.
References addr, ioforge_usb_device::addr, ioforge_usb_endpoint::address, assign_address(), ioforge_usb_device::base, usb_device_descriptor::bcdUSB, usb_device_descriptor::bDescriptorType, usb_endpoint_descriptor::bDescriptorType, usb_device_descriptor::bDeviceClass, usb_device_descriptor::bDeviceProtocol, usb_device_descriptor::bDeviceSubClass, usb_endpoint_descriptor::bEndpointAddress, usb_endpoint_descriptor::bInterval, usb_device_descriptor::bLength, usb_endpoint_descriptor::bLength, usb_endpoint_descriptor::bmAttributes, usb_device_descriptor::bMaxPacketSize0, usb_device_descriptor::bNumConfigurations, ioforge_usb_device::class_code, config, controller, ioforge_usb_device::controller, data, ehci_op, EHCI_PORT_ENABLED, ioforge_usb_device::endpoints, ioforge_usb_device::ep_count, hcsparam, HCSPARAM_N_PORTS_MASK, iConfiguration, usb_device_descriptor::idProduct, usb_device_descriptor::idVendor, usb_device_descriptor::iManufacturer, ioforge_attach(), ioforge_get_usb_devices_root(), IOFORGE_USB_DEVICE, IoForgeUSB_VERSION_2, usb_device_descriptor::iProduct, usb_device_descriptor::iSerialNumber, kalloc(), log, ioforge_usb_device::max_power, IOForge::mod, ioforge_device::name, ioforge_usb_device::pipe, port_reset(), ioforge_usb_device::product_id, ioforge_usb_device::protocol, ptr, send_async_with_response(), serial2_printf(), ioforge_usb_device::serial_number, setup(), ioforge_usb_device::subclass_code, ioforge_device::type, usb_get_descriptor(), usb_get_string_descriptor(), ioforge_usb_device::usb_version, ioforge_usb_device::vendor_id, and usb_endpoint_descriptor::wMaxPacketSize.
Referenced by load().
| void EHCIModule::procces_async | ( | ehci_queue_task_descriptor * | qtd | ) |
Definition at line 742 of file ehci.cpp.
References ehci_op, EHCI_START_ASYNC_SCHEDULE, log, IOForge::mod, and ehci_queue_task_descriptor::token.
|
private |
Definition at line 979 of file ehci.cpp.
References EHCI_Q_SELECT_QH, ehci_queue_head_node::head, main_async_qh, ehci_queue_head_node::physaddr, and ehci_queue_head::qhlp.
Referenced by send_async_with_response().
| void EHCIModule::reset_device | ( | ) |
Definition at line 166 of file ehci.cpp.
References EHCI_CONTROLLER_RESET, ehci_op, log, and IOForge::mod.
Referenced by load().
| boolean_t EHCIModule::retrieve_qh | ( | ehci_queue_head_node_t ** | out | ) |
Definition at line 897 of file ehci.cpp.
References EHCI_MAX_QH_CACHE_MASK, h, idx, qh_pool, qh_ring, qh_ring_head, and qh_ring_tail.
Referenced by init_controller(), init_periodic(), and send_async_with_response().
| boolean_t EHCIModule::retrieve_qtd | ( | ehci_queue_task_descriptor_node_t ** | out | ) |
Definition at line 913 of file ehci.cpp.
References EHCI_MAX_QTD_CACHE_MASK, h, idx, qtd_pool, qtd_ring, qtd_ring_head, and qtd_ring_tail.
Referenced by send_async_with_response().
| void EHCIModule::send_async_with_response | ( | uint8_t | addr, |
| uint8_t | endpoint, | ||
| uint32_t | data_phys, | ||
| size_t | size, | ||
| uint32_t | response, | ||
| size_t | response_size ) |
Definition at line 578 of file ehci.cpp.
References addr, ehci_queue_task_descriptor::altlink, ehci_queue_head::altTD, ehci_queue_task_descriptor::buffer, ehci_queue_head::cap, ehci_queue_head::ch, ehci_queue_head::currentTD, ehci_op, EHCI_QH_CAP_DTC, EHCI_QH_CAP_MAX_PACKET_LENGTH, EHCI_QH_CAP_MULT_1, EHCI_QTD_TERMINATE, EHCI_QTD_TOKEN_DATA, EHCI_QTD_TOKEN_ERROR_COUNT_3, EHCI_QTD_TOKEN_IOC, EHCI_QTD_TOKEN_LENGTH, EHCI_QTD_TOKEN_PID_IN, EHCI_QTD_TOKEN_PID_OUT, EHCI_QTD_TOKEN_PID_SETUP, EHCI_QTD_TOKEN_STATUS_ACTIVE, ehci_queue_head_node::head, ehci_queue_task_descriptor::link, log, main_async_qh, IOForge::mod, ehci_queue_head::nextTD, ehci_queue_head_node::physaddr, ehci_queue_task_descriptor_node::physaddr, push_to_qh(), ehci_queue_head::qhlp, retrieve_qh(), retrieve_qtd(), setup(), size, status, store_qh(), store_qtd(), ehci_queue_task_descriptor_node::task_descriptor, and ehci_queue_task_descriptor::token.
Referenced by assign_address(), probe(), and usb_get_descriptor().
| void EHCIModule::set_controller | ( | ioforge_usb_controller_service * | controller | ) |
Definition at line 892 of file ehci.cpp.
References controller.
| void EHCIModule::setup | ( | ) |
Referenced by probe(), and send_async_with_response().
| void EHCIModule::start_device | ( | ) |
Definition at line 193 of file ehci.cpp.
References EHCI_CONTROLLER_START, EHCI_HC_HALTED_STATUS, ehci_op, log, and IOForge::mod.
Referenced by load().
| void EHCIModule::start_periodic | ( | ) |
Definition at line 251 of file ehci.cpp.
References ehci_op, and EHCI_PERIODIC_SCHEDULE_ENABLE.
Referenced by init_periodic().
| void EHCIModule::stop_device | ( | ) |
| void EHCIModule::stop_periodic | ( | ) |
Definition at line 255 of file ehci.cpp.
References ehci_op, and EHCI_PERIODIC_SCHEDULE_ENABLE.
| void EHCIModule::store_qh | ( | ehci_queue_head_node_t ** | in | ) |
Definition at line 929 of file ehci.cpp.
References EHCI_MAX_QH_CACHE, EHCI_MAX_QH_CACHE_MASK, h, idx, ioforge_memset(), qh_pool, qh_ring, qh_ring_head, and qh_ring_tail.
Referenced by send_async_with_response().
| void EHCIModule::store_qtd | ( | ehci_queue_task_descriptor_node_t ** | in | ) |
Definition at line 953 of file ehci.cpp.
References EHCI_MAX_QTD_CACHE, EHCI_MAX_QTD_CACHE_MASK, h, idx, ioforge_memset(), qtd_pool, qtd_ring, qtd_ring_head, and qtd_ring_tail.
Referenced by send_async_with_response().
|
virtual |
Implements IOforgePCI.
References addr, address, controller, data, EHCIModule(), len, size, and type.
| void EHCIModule::usb_get_descriptor | ( | uint8_t | addr, |
| uint8_t | type, | ||
| uint8_t | index, | ||
| uint8_t | len, | ||
| uint8_t * | data ) |
Definition at line 800 of file ehci.cpp.
References addr, cmd, data, len, send_async_with_response(), and type.
Referenced by probe(), and usb_get_string_descriptor().
|
private |
|
private |
|
private |
Definition at line 234 of file ehci.hpp.
Referenced by init_controller(), init_periodic(), load(), port_reset(), probe(), procces_async(), reset_device(), send_async_with_response(), start_device(), start_periodic(), stop_device(), and stop_periodic().
|
private |
Definition at line 243 of file ehci.hpp.
Referenced by init_periodic().
|
private |
|
private |
|
private |
|
private |