From d88c40fc062f28c63ae7bc3836407df3470287a3 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Sun, 21 Sep 2025 14:54:26 -0400 Subject: kern: ahci: Add initial port startup logic Here we ensure that the port is in a stopped state, we have also added port descriptor lists to keep track of each port. Signed-off-by: Ian Moffett --- src/sys/include/io/ic/ahcivar.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/sys/include/io/ic') diff --git a/src/sys/include/io/ic/ahcivar.h b/src/sys/include/io/ic/ahcivar.h index 250630c..fd75b10 100644 --- a/src/sys/include/io/ic/ahcivar.h +++ b/src/sys/include/io/ic/ahcivar.h @@ -30,16 +30,37 @@ #ifndef _IC_AHCIVAR_H_ #define _IC_AHCIVAR_H_ 1 +#include #include +/* + * Represents an AHCI host bus adapter (HBA) + * + * @io: HBA register space + * @pi: Ports implemented + * @nport: Number of ports supported + * + * XXX: Just because 'n' ports are _supported_ by the HBA does + * not mean the host will implement exactly 'n' ports. + */ struct ahci_hba { volatile struct hba_memspace *io; uint32_t pi; uint32_t nport; }; +/* + * Represents a port on the host bus adapter + * + * @parent: Parent HBA this port belongs to + * @io: Port register space + * @portno: Port number + */ struct ahci_port { + volatile struct ahci_hba *parent; volatile struct hba_port *io; + uint32_t portno; + TAILQ_ENTRY(ahci_port) link; }; #define AHCI_TIMEOUT 500 -- cgit v1.2.3