summaryrefslogtreecommitdiff
path: root/src/sys/include/io
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2025-09-21 14:54:26 -0400
committerIan Moffett <ian@osmora.org>2025-09-21 15:11:17 -0400
commitd88c40fc062f28c63ae7bc3836407df3470287a3 (patch)
tree5dcb8faf7177793565f05409435fd85e51c4e117 /src/sys/include/io
parent561ad1494cad32243fa256af8acb755466ef12a7 (diff)
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 <ian@osmora.org>
Diffstat (limited to 'src/sys/include/io')
-rw-r--r--src/sys/include/io/ic/ahcivar.h21
1 files changed, 21 insertions, 0 deletions
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 <sys/queue.h>
#include <io/ic/ahciregs.h>
+/*
+ * 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