summaryrefslogtreecommitdiff
path: root/src/sys
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2025-09-22 13:11:08 -0400
committerIan Moffett <ian@osmora.org>2025-09-22 13:11:08 -0400
commit38043245f0b186421c355cce327d2567dd19f8e9 (patch)
tree2bf15a30878e791a3fed4e30ef00077428ebb6da /src/sys
parent3b0bc702963dab4248fc67c379e658aca4604eca (diff)
kern: ahci: Keep track of number of command slots
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'src/sys')
-rw-r--r--src/sys/include/io/ic/ahcivar.h2
-rw-r--r--src/sys/io/ic/ahci.c1
2 files changed, 3 insertions, 0 deletions
diff --git a/src/sys/include/io/ic/ahcivar.h b/src/sys/include/io/ic/ahcivar.h
index a07f75d..c3cb70d 100644
--- a/src/sys/include/io/ic/ahcivar.h
+++ b/src/sys/include/io/ic/ahcivar.h
@@ -39,6 +39,7 @@
* @io: HBA register space
* @pi: Ports implemented
* @nport: Number of ports supported
+ * @nslots: Number of command slots
*
* XXX: Just because 'n' ports are _supported_ by the HBA does
* not mean the host will implement exactly 'n' ports.
@@ -47,6 +48,7 @@ struct ahci_hba {
volatile struct hba_memspace *io;
uint32_t pi;
uint32_t nport;
+ uint8_t nslots;
};
/*
diff --git a/src/sys/io/ic/ahci.c b/src/sys/io/ic/ahci.c
index 5cc675f..9c56993 100644
--- a/src/sys/io/ic/ahci.c
+++ b/src/sys/io/ic/ahci.c
@@ -285,6 +285,7 @@ ahci_hba_init(struct ahci_hba *hba)
cap = mmio_read32(&io->cap);
hba->pi = mmio_read32(&io->pi);
hba->nport = AHCI_CAP_NP(cap) + 1;
+ hba->nslots = AHCI_CAP_NCS(cap) + 1;
/* Only support 64-bit addressing as of now */
if (AHCI_CAP_S64A(cap) == 0) {