X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/af8e873ae38b72a56a89485c62bb5ccd22a9f8a7..4b61c735d6ab7cb250c9a170b87784746476434f:/lunaix-os/includes/hal/ahci/scsi.h diff --git a/lunaix-os/includes/hal/ahci/scsi.h b/lunaix-os/includes/hal/ahci/scsi.h index 0635614..d658229 100644 --- a/lunaix-os/includes/hal/ahci/scsi.h +++ b/lunaix-os/includes/hal/ahci/scsi.h @@ -14,12 +14,15 @@ #define SCSI_WRITE_BLOCKS_16 0x8a #define SCSI_WRITE_BLOCKS_12 0xaa +#define SCSI_CDB16 16 +#define SCSI_CDB12 12 + struct scsi_cdb12 { uint8_t opcode; uint8_t misc1; - uint32_t lba_be; - uint32_t length; + u32_t lba_be; + u32_t length; uint8_t misc2; uint8_t ctrl; } __attribute__((packed)); @@ -28,9 +31,9 @@ struct scsi_cdb16 { uint8_t opcode; uint8_t misc1; - uint32_t lba_be_hi; - uint32_t lba_be_lo; - uint32_t length; + u32_t lba_be_hi; + u32_t lba_be_lo; + u32_t length; uint8_t misc2; uint8_t ctrl; } __attribute__((packed)); @@ -38,25 +41,19 @@ struct scsi_cdb16 void scsi_create_packet12(struct scsi_cdb12* cdb, uint8_t opcode, - uint32_t lba, - uint32_t alloc_size); + u32_t lba, + u32_t alloc_size); void scsi_create_packet16(struct scsi_cdb16* cdb, uint8_t opcode, uint64_t lba, - uint32_t alloc_size); - -int -scsi_read_buffer(struct hba_device* dev, - uint64_t lba, - void* buffer, - uint32_t size); - -int -scsi_write_buffer(struct hba_device* dev, - uint64_t lba, - void* buffer, - uint32_t size); + u32_t alloc_size); + +void +scsi_submit(struct hba_device* dev, struct blkio_req* io_req); + +void +scsi_parse_capacity(struct hba_device* device, u32_t* parameter); #endif /* __LUNAIX_ATAPI_H */