summaryrefslogtreecommitdiff
path: root/sys/include
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2024-06-02 23:08:43 -0400
committerIan Moffett <ian@osmora.org>2024-06-02 23:10:32 -0400
commit04fa82397e3a58a496e9d6883eb7495ef3ecea64 (patch)
treee9814b58052f467f29c353fe6c6ec20f1a525204 /sys/include
parent614ffa927eb7acb1c1fb31f5186f5e3d4b1bca74 (diff)
kernel: ahci: Add SATA read/write support
This commit introduces SATA read/write support and exposes SATA devices to userland as /dev/sdN files Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/include')
-rw-r--r--sys/include/dev/ic/ahcivar.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/sys/include/dev/ic/ahcivar.h b/sys/include/dev/ic/ahcivar.h
index 0b945ae..edef4f6 100644
--- a/sys/include/dev/ic/ahcivar.h
+++ b/sys/include/dev/ic/ahcivar.h
@@ -33,6 +33,7 @@
#include <sys/types.h>
#include <sys/cdefs.h>
#include <sys/mutex.h>
+#include <sys/queue.h>
#include <dev/ic/ahciregs.h>
struct ata_identity {
@@ -113,6 +114,13 @@ struct ahci_fis_h2d {
uint8_t rsvd1[4];
};
+struct ahci_device {
+ struct ahci_hba *hba;
+ struct hba_port *port;
+ dev_t minor;
+ TAILQ_ENTRY(ahci_device) link;
+};
+
struct ahci_hba {
struct hba_memspace *abar;
struct ahci_cmd_hdr *cmdlist;
@@ -121,8 +129,10 @@ struct ahci_hba {
};
/* Commands */
-#define ATA_CMD_NOP 0x00
-#define ATA_CMD_IDENTIFY 0xEC
+#define ATA_CMD_NOP 0x00
+#define ATA_CMD_IDENTIFY 0xEC
+#define ATA_CMD_READ_DMA 0x25
+#define ATA_CMD_WRITE_DMA 0x35
/* FIS types */
#define FIS_TYPE_H2D 0x27