X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/eb037efe9f30ae166684e99146024abf8740984d..df1e857ac4d1410ae2bd354e361210b842ab7bc8:/lunaix-os/includes/hal/ahci/sata.h?ds=sidebyside diff --git a/lunaix-os/includes/hal/ahci/sata.h b/lunaix-os/includes/hal/ahci/sata.h index f898d32..d573a93 100644 --- a/lunaix-os/includes/hal/ahci/sata.h +++ b/lunaix-os/includes/hal/ahci/sata.h @@ -1,7 +1,7 @@ #ifndef __LUNAIX_SATA_H #define __LUNAIX_SATA_H -#include +#include #define SATA_REG_FIS_D2H 0x34 #define SATA_REG_FIS_H2D 0x27 @@ -11,10 +11,12 @@ #define ATA_IDENTIFY_DEVICE 0xec #define ATA_IDENTIFY_PAKCET_DEVICE 0xa1 #define ATA_PACKET 0xa0 -#define ATA_READ_DMA_EXT 0xc8 -#define ATA_READ_DMA 0x25 -#define ATA_WRITE_DMA_EXT 0xca -#define ATA_WRITE_DMA 0x35 +#define ATA_READ_DMA_EXT 0x25 +#define ATA_READ_DMA 0xc8 +#define ATA_WRITE_DMA_EXT 0x35 +#define ATA_WRITE_DMA 0xca + +#define MAX_RETRY 2 struct sata_fis_head { @@ -31,7 +33,7 @@ struct sata_reg_fis uint8_t lba0, lba8, lba16; uint8_t dev; uint8_t lba24, lba32, lba40; - uint8_t reserved1; + uint8_t feature; uint16_t count; @@ -51,16 +53,9 @@ sata_create_fis(struct sata_reg_fis* cmd_fis, uint64_t lba, uint16_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 */