fix dependency check logic cause config always disabled
[lunaix-os.git] / lunaix-os / includes / hal / ahci / sata.h
index 99a45bc20c191cb60396b41634d1f18a68f4086e..0edb5a3d6a7d4cf946e2fcc685222b5b1e060add 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef __LUNAIX_SATA_H
 #define __LUNAIX_SATA_H
 
-#include <stdint.h>
+#include <hal/ahci/hba.h>
 
 #define SATA_REG_FIS_D2H 0x34
 #define SATA_REG_FIS_H2D 0x27
 
 struct sata_fis_head
 {
-    uint8_t type;
-    uint8_t options;
-    uint8_t status_cmd;
-    uint8_t feat_err;
+    u8_t type;
+    u8_t options;
+    u8_t status_cmd;
+    u8_t feat_err;
 } __HBA_PACKED__;
 
 struct sata_reg_fis
 {
     struct sata_fis_head head;
 
-    uint8_t lba0, lba8, lba16;
-    uint8_t dev;
-    uint8_t lba24, lba32, lba40;
-    uint8_t feature;
+    u8_t lba0, lba8, lba16;
+    u8_t dev;
+    u8_t lba24, lba32, lba40;
+    u8_t feature;
 
-    uint16_t count;
+    u16_t count;
 
-    uint8_t reserved[6];
+    u8_t reserved[6];
 } __HBA_PACKED__;
 
 struct sata_data_fis
 {
     struct sata_fis_head head;
 
-    uint8_t data[0];
+    u8_t data[0];
 } __HBA_PACKED__;
 
 void
 sata_create_fis(struct sata_reg_fis* cmd_fis,
-                uint8_t command,
-                uint64_t lba,
-                uint16_t sector_count);
+                u8_t command,
+                lba_t lba,
+                u16_t sector_count);
 
-int
-sata_read_buffer(struct hba_port* port,
-                 uint64_t lba,
-                 void* buffer,
-                 uint32_t size);
-
-int
-sata_write_buffer(struct hba_port* port,
-                  uint64_t lba,
-                  void* buffer,
-                  uint32_t size);
+void
+sata_submit(struct hba_device* dev, struct blkio_req* io_req);
 
+void
+sata_read_error(struct hba_port* port);
 #endif /* __LUNAIX_SATA_H */