fix: READ_CAPACITY command for 12 bytes CDB SCSI device.
[lunaix-os.git] / lunaix-os / includes / hal / ahci / scsi.h
index cce9af467725486a33985d09068071db1b7e68e8..fee899fa916ebb72b9b2c347537ce9ebf89ef94c 100644 (file)
@@ -14,6 +14,9 @@
 #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;
@@ -47,14 +50,14 @@ scsi_create_packet16(struct scsi_cdb16* cdb,
                      uint64_t lba,
                      uint32_t alloc_size);
 
-void
-scsi_read_buffer(struct hba_port* port,
+int
+scsi_read_buffer(struct hba_device* dev,
                  uint64_t lba,
                  void* buffer,
                  uint32_t size);
 
-void
-scsi_write_buffer(struct hba_port* port,
+int
+scsi_write_buffer(struct hba_device* dev,
                   uint64_t lba,
                   void* buffer,
                   uint32_t size);