From 4c47d7b7656c64e35673a45c1bfe8a6a002174cc Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Fri, 9 May 2025 20:35:07 -0400 Subject: kernel: ahci: Add command table + PRD definition Signed-off-by: Ian Moffett --- sys/include/dev/ic/ahcivar.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'sys/include/dev/ic') 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 @@ -106,6 +106,38 @@ struct ahci_cmd_hdr { uint32_t rsvd1[4]; }; +/* + * 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 * -- cgit v1.2.3