summaryrefslogtreecommitdiff
path: root/sys/include
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2025-05-09 20:35:07 -0400
committerIan Moffett <ian@osmora.org>2025-05-09 20:37:35 -0400
commit4c47d7b7656c64e35673a45c1bfe8a6a002174cc (patch)
treee0216cef998c7d79cc1c782d81e5b7214cc05c74 /sys/include
parent249d1e0449d3beb097525d847b23461dc818e50a (diff)
kernel: ahci: Add command table + PRD definition
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/include')
-rw-r--r--sys/include/dev/ic/ahcivar.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/sys/include/dev/ic/ahcivar.h b/sys/include/dev/ic/ahcivar.h
index 98fdf81..4b6cf12 100644
--- a/sys/include/dev/ic/ahcivar.h
+++ b/sys/include/dev/ic/ahcivar.h
@@ -107,6 +107,38 @@ struct ahci_cmd_hdr {
};
/*
+ * Physical region descriptor
+ *
+ * @dba: Data base address
+ * @rsvd0: Reserved
+ * @dbc: Count
+ * @rsvd1: Reserved
+ * @i: Interrupt on completion
+ */
+struct ahci_prdt_entry {
+ uintptr_t dba;
+ uint32_t rsvd0;
+ uint32_t dbc : 22;
+ uint16_t rsvd1 : 9;
+ uint8_t i : 1;
+};
+
+/*
+ * Command table
+ *
+ * @cfis: Command FIS
+ * @acmd: ATAPI command
+ * @rsvd: Reserved
+ * @prdt: Physical region descriptors
+ */
+struct ahci_cmdtab {
+ uint8_t cfis[64];
+ uint8_t acmd[16];
+ uint8_t rsvd[48];
+ struct ahci_prdt_entry prdt[1];
+};
+
+/*
* Host to device FIS
*
* [h]: Set by host