1 #ifndef __LUNAIX_SATA_H
2 #define __LUNAIX_SATA_H
4 #include <hal/ahci/hba.h>
6 #define SATA_REG_FIS_D2H 0x34
7 #define SATA_REG_FIS_H2D 0x27
8 #define SATA_REG_FIS_COMMAND 0x80
9 #define SATA_LBA_COMPONENT(lba, offset) ((((lba) >> (offset)) & 0xff))
11 #define ATA_IDENTIFY_DEVICE 0xec
12 #define ATA_IDENTIFY_PAKCET_DEVICE 0xa1
13 #define ATA_PACKET 0xa0
14 #define ATA_READ_DMA_EXT 0x25
15 #define ATA_READ_DMA 0xc8
16 #define ATA_WRITE_DMA_EXT 0x35
17 #define ATA_WRITE_DMA 0xca
31 struct sata_fis_head head;
33 uint8_t lba0, lba8, lba16;
35 uint8_t lba24, lba32, lba40;
45 struct sata_fis_head head;
51 sata_create_fis(struct sata_reg_fis* cmd_fis,
54 uint16_t sector_count);
57 sata_submit(struct hba_device* dev, struct blkio_req* io_req);
60 sata_read_error(struct hba_port* port);
61 #endif /* __LUNAIX_SATA_H */