-fail:
- vfree_dma(table);
- return 0;
-}
-
-void
-scsi_read_buffer(struct hba_port* port,
- uint64_t lba,
- void* buffer,
- uint32_t size)
-{
- __scsi_buffer_io(port, lba, buffer, size, 0);
-}
-
-void
-scsi_write_buffer(struct hba_port* port,
- uint64_t lba,
- void* buffer,
- uint32_t size)
-{
- __scsi_buffer_io(port, lba, buffer, size, 1);
+ // The async way...
+ struct hba_cmd_state* cmds = valloc(sizeof(struct hba_cmd_state));
+ *cmds = (struct hba_cmd_state){ .cmd_table = table, .state_ctx = io_req };
+ ahci_post(port, cmds, slot);