#ifndef SCSI_H_
#define SCSI_H_

#include <system.h>
#include <req.h>

typedef struct cdb_st {
  enum {
    SCSI_READ,
    SCSI_WRITE,
    SCSI_PREREAD,
    SCSI_PREWRITE,
  } cmd;
  uint32_t lba_size;
  uint32_t start_lba;
  uint32_t len;
  uint32_t magic_num;

  uint8_t* buf;
  void* private;
} cdb_t;

typedef struct scsi_specific_st {
  cdb_t*     cdb;
  handler_t  notifier;

  enum {
    SCSI_INITIAL,
    SCSI_TM_READY,
    SCSI_CHM_READY,
    SCSI_ALMOST_DONE,
    SCSI_DONE
  } state; // should be enum
  bool_t is_hint;
} scsi_specific_t;

void scsiInit();

req_t* scsiRequest(handler_t notifier, cdb_t* cdb, bool_t is_hint) ;

void scsiHandler(req_t* req, void* response);


#endif
