|
Voxia OS v0.0.1
Hobby Project Operating System Targeting x86-64
|
#include <ahci.hpp>
Public Member Functions | |
| AHCIModule () | |
| void | load () override |
| void | unload () override |
| int | submit_impl (struct ioforge_block_device *dev, struct ioforge_block_request *req) |
Public Member Functions inherited from IOforgePCI | |
| IOforgePCI (const char *mod) | |
| struct ioforge_pci_device * | findDevice (uint16_t vendor_id, uint16_t device_id) |
Public Member Functions inherited from IOForge | |
| IOForge (const char *mod) | |
Static Public Member Functions | |
| static AHCIModule * | getInstance () |
Protected Member Functions | |
| void | port_power_off (ahci_port_t *port) |
| void | port_power_on (ahci_port_t *port) |
| void | port_reset (ahci_port_t *port) |
| void | setup () |
| void | probe () |
| void | port_configure (ahci_port_t *port, struct ahci_internal_vaddr *vaddr) |
| bool | ata_rw (ahci_port_t *p, struct ahci_internal_vaddr *vaddr, struct ioforge_block_request *req) |
| int | atapi_packet (ahci_port_t *p, struct ahci_internal_vaddr *vaddr, struct ioforge_block_request *req) |
| int | ata_identify (ahci_port_t *p, struct ahci_internal_vaddr *vaddr, struct ioforge_block_request *req, bool is_atapi) |
| int | ata_flush (ahci_port_t *p, struct ahci_internal_vaddr *vaddr, struct ioforge_block_request *req) |
| boolean_t | issue_and_wait (ahci_port_t *p, int slot, uint32_t timeout) |
Private Member Functions | |
| void | build_prdt (ahci_cmd_t *cmd, ahci_cmd_tbl_t *cmdtbl, void *buffer, size_t size) |
Private Attributes | |
| struct ioforge_pci_device * | dev_ |
| ahci_op_t * | op |
Additional Inherited Members | |
Protected Attributes inherited from IOForge | |
| const char * | mod |
| AHCIModule::AHCIModule | ( | ) |
Definition at line 7 of file init.cpp.
References IOforgePCI::IOforgePCI().
Referenced by getInstance().
|
protected |
Definition at line 340 of file ahci.cpp.
References ahci_fis_h2d_t::c, ahci_internal_vaddr::clb, ahci_internal_vaddr::cmd, cmd, ahci_fis_h2d_t::command, find_cmdslot(), ahci_fis_h2d_t::fis_type, FIS_TYPE_REG_H2D, issue_and_wait(), memset(), ioforge_block_request::packet_cmd, ioforge_block_request::packet_cmd_len, and ioforge_block_request::timeout_ms.
|
protected |
Definition at line 296 of file ahci.cpp.
References ATA_CMD_IDENTIFY, ATA_CMD_IDENTIFY_PACKET, ioforge_block_request::buffer, build_prdt(), ahci_fis_h2d_t::c, ahci_internal_vaddr::clb, ahci_internal_vaddr::cmd, cmd, ahci_fis_h2d_t::command, ahci_fis_h2d_t::counth, ahci_fis_h2d_t::countl, ahci_fis_h2d_t::device, find_cmdslot(), ahci_fis_h2d_t::fis_type, FIS_TYPE_REG_H2D, ahci_port_t::is, issue_and_wait(), ahci_fis_h2d_t::lba0, ahci_fis_h2d_t::lba1, ahci_fis_h2d_t::lba2, ahci_fis_h2d_t::lba3, ahci_fis_h2d_t::lba4, ahci_fis_h2d_t::lba5, memset(), and ioforge_block_request::timeout_ms.
Referenced by submit_impl().
|
protected |
Definition at line 185 of file ahci.cpp.
References ATA_CMD_READ_DMA_EXT, ATA_CMD_WRITE_DMA_EXT, ioforge_block_request::block_count, ioforge_block_request::buffer, build_prdt(), ahci_fis_h2d_t::c, ahci_internal_vaddr::clb, ahci_internal_vaddr::cmd, cmd, ahci_fis_h2d_t::command, ahci_fis_h2d_t::counth, ahci_fis_h2d_t::countl, ahci_fis_h2d_t::device, ahci_fis_h2d_t::featureh, ahci_fis_h2d_t::featurel, find_cmdslot(), ahci_fis_h2d_t::fis_type, FIS_TYPE_REG_H2D, IOFORGE_BLOCK_OP_WRITE, ahci_port_t::is, issue_and_wait(), ioforge_block_request::lba, ahci_fis_h2d_t::lba0, ahci_fis_h2d_t::lba1, ahci_fis_h2d_t::lba2, ahci_fis_h2d_t::lba3, ahci_fis_h2d_t::lba4, ahci_fis_h2d_t::lba5, memset(), ioforge_block_request::op, and ioforge_block_request::timeout_ms.
Referenced by submit_impl().
|
protected |
Definition at line 235 of file ahci.cpp.
References ATA_CMD_PACKET, ioforge_block_request::buffer, ioforge_block_request::buffer_size, build_prdt(), ahci_fis_h2d_t::c, ahci_internal_vaddr::clb, ahci_internal_vaddr::cmd, cmd, ahci_fis_h2d_t::command, ahci_fis_h2d_t::device, ahci_fis_h2d_t::featureh, ahci_fis_h2d_t::featurel, find_cmdslot(), ahci_fis_h2d_t::fis_type, FIS_TYPE_REG_H2D, ioforge_block_request::flags, IOFORGE_FLAG_DMA, IOFORGE_FLAG_WRITE, ahci_port_t::is, issue_and_wait(), ahci_fis_h2d_t::lba1, ahci_fis_h2d_t::lba2, memcopy(), memset(), ioforge_block_request::packet_cmd, ioforge_block_request::packet_cmd_len, ahci_port_t::serr, and ioforge_block_request::timeout_ms.
Referenced by submit_impl().
|
private |
Definition at line 159 of file ahci.cpp.
References addr, buffer, cmd, idx, and size.
Referenced by ata_identify(), ata_rw(), and atapi_packet().
|
static |
Definition at line 10 of file init.cpp.
References AHCIModule(), and instance.
Referenced by submit().
|
protected |
Definition at line 98 of file ahci.cpp.
References ATA_DEV_BUSY, ATA_DEV_DRQ, ahci_port_t::ci, ioforge_sleep(), ahci_port_t::is, log, port_power_off(), port_power_on(), ahci_port_t::serr, slot, and ahci_port_t::tfd.
Referenced by ata_flush(), ata_identify(), ata_rw(), and atapi_packet().
|
overridevirtual |
Implements IOforgePCI.
Definition at line 17 of file init.cpp.
References dev_, IOforgePCI::findDevice(), log, IOForge::mod, and setup().
|
protected |
Definition at line 418 of file ahci.cpp.
References ahci_internal_vaddr::clb, ahci_port_t::clb, ahci_port_t::clbu, ahci_internal_vaddr::cmd, cmd, IOForge::IOUtils::DMAAlloc(), ahci_internal_vaddr::fb, ahci_port_t::fb, ahci_port_t::fbu, IOForge::IOUtils::memset(), port_power_off(), and port_power_on().
Referenced by probe().
|
protected |
Definition at line 42 of file ahci.cpp.
References ahci_port_t::cmd, log, IOForge::mod, and IOForge::IOUtils::sleep().
Referenced by issue_and_wait(), and port_configure().
|
protected |
Definition at line 70 of file ahci.cpp.
References ahci_port_t::cmd, and IOForge::IOUtils::sleep().
Referenced by issue_and_wait(), port_configure(), and probe().
|
protected |
References slot.
|
protected |
Definition at line 459 of file ahci.cpp.
References AHCI_DEV_NULL, AHCI_DEV_PM, AHCI_DEV_SATA, AHCI_DEV_SATAPI, AHCI_DEV_SEMB, ioforge_block_device::base, get_device_type(), ioforge_attach(), IOFORGE_BLOCK, IOFORGE_BLOCK_TYPE_SATA, IOFORGE_BLOCK_TYPE_SATAPI, ioforge_get_block_devices_root(), is_device_present(), kalloc(), log, memset(), IOForge::mod, ioforge_device::name, op, ioforge_block_device::ops, ioforge_block_device::port, port_configure(), port_power_on(), port_vaddr, strcpy(), ioforge_block_op::submit, submit(), ioforge_block_device::type, ioforge_device::type, and type.
Referenced by setup().
|
protected |
| int AHCIModule::submit_impl | ( | struct ioforge_block_device * | dev, |
| struct ioforge_block_request * | req ) |
Definition at line 378 of file ahci.cpp.
References ata_identify(), ata_rw(), atapi_packet(), IOFORGE_BLOCK_OP_FLUSH, IOFORGE_BLOCK_OP_IDENTIFY, IOFORGE_BLOCK_OP_PACKET, IOFORGE_BLOCK_OP_READ, IOFORGE_BLOCK_OP_WRITE, IOFORGE_BLOCK_TYPE_SATAPI, ahci_port_t::is, log, IOForge::mod, op, ioforge_block_request::op, ioforge_block_device::port, port_vaddr, and ioforge_block_device::type.
|
overridevirtual |
Implements IOforgePCI.
|
private |
|
private |
Definition at line 47 of file ahci.hpp.
Referenced by probe(), setup(), and submit_impl().