From 3995e22535551eda05c64872a5c6e04c7581adb7 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Wed, 7 May 2025 17:51:56 -0400 Subject: kernel: ahci: Implement initial HBA port logic - Implement logic to scan the HBA for ports - Implement logic to stop HBA ports - Add ahci_init_port() stub Signed-off-by: Ian Moffett --- sys/include/dev/ic/ahcivar.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'sys/include/dev/ic/ahcivar.h') diff --git a/sys/include/dev/ic/ahcivar.h b/sys/include/dev/ic/ahcivar.h index 0d307cd..cc6d346 100644 --- a/sys/include/dev/ic/ahcivar.h +++ b/sys/include/dev/ic/ahcivar.h @@ -30,10 +30,40 @@ #ifndef _IC_AHCIVAR_H_ #define _IC_AHCIVAR_H_ +#include +#include #include +/* + * AHCI Host Bus Adapter + * + * @io: HBA MMIO + * @maxports: Max number of HBA ports + * @nports: Number of implemented HBA ports. + * @nslots: Number of command slots + * @ems: Enclosure management support + * @sal: Supports activity LED + */ struct ahci_hba { struct hba_memspace *io; + uint32_t maxports; + uint32_t nports; + uint32_t nslots; + uint8_t ems : 1; + uint8_t sal : 1; +}; + +/* + * A device attached to a physical HBA port. + * + * @io: Memory mapped port registers + * @hba: HBA descriptor + * @dev: Device minor number. + */ +struct hba_device { + struct hba_port *io; + struct ahci_hba *hba; + dev_t dev; }; #define AHCI_TIMEOUT 500 /* In ms */ -- cgit v1.2.3