liberis
|
00001 /* 00002 liberis -- A set of libraries for controlling the NEC PC-FX 00003 00004 Copyright (C) 2011 Alex Marshall "trap15" <trap15@raidenii.net> 00005 00006 # This code is licensed to you under the terms of the MIT license; 00007 # see file LICENSE or http://www.opensource.org/licenses/mit-license.php 00008 */ 00009 00014 #ifndef _LIBERIS_LOW_SCSI_H_ 00015 #define _LIBERIS_LOW_SCSI_H_ 00016 00017 #include <eris/types.h> 00018 00019 typedef enum 00020 { 00021 SCSI_LOW_PHASE_BUS_FREE = 0, 00022 SCSI_LOW_PHASE_SELECT = 1, 00023 SCSI_LOW_PHASE_DATA_OUT = 2, 00024 SCSI_LOW_PHASE_DATA_IN = 3, 00025 SCSI_LOW_PHASE_COMMAND = 4, 00026 SCSI_LOW_PHASE_STATUS = 5, 00027 SCSI_LOW_PHASE_MESSAGE_OUT = 6, 00028 SCSI_LOW_PHASE_MESSAGE_IN = 7, 00029 SCSI_LOW_PHASE_ILLEGAL = 8 00030 } scsi_low_phase; 00031 typedef enum 00032 { 00033 // Our special statuses, indicating that the command is still in-progress. 00034 SCSI_LOW_STATUS_MISC = -5, 00035 SCSI_LOW_STATUS_NEED_MESSAGE = -4, 00036 SCSI_LOW_STATUS_NEED_DATA = -3, 00037 SCSI_LOW_STATUS_HAVE_DATA = -2, 00038 SCSI_LOW_STATUS_IN_PROGRESS = -1, 00039 00040 SCSI_LOW_STATUS_GOOD = 0x0, 00041 SCSI_LOW_STATUS_CHECK_CONDITION = 0x2, 00042 SCSI_LOW_STATUS_CONDITION_MET = 0x4, 00043 SCSI_LOW_STATUS_BUSY = 0x6, 00044 SCSI_LOW_STATUS_INTERMEDIATE = 0x10 00045 } scsi_low_status; 00046 typedef enum { 00047 SCSI_LOW_CMD_TEST_UNIT_READY = 0x00, 00048 SCSI_LOW_CMD_REQ_SENSE = 0x03, 00049 SCSI_LOW_CMD_READ10 = 0x28, 00050 SCSI_LOW_CMD_SEEK10 = 0x2B, 00051 SCSI_LOW_CMD_PREFETCH10 = 0x34, 00052 SCSI_LOW_CMD_READ_SUBQ = 0x42, 00053 SCSI_LOW_CMD_READ_TOC = 0x43, 00054 SCSI_LOW_CMD_READ_HEADER = 0x44, 00055 SCSI_LOW_CMD_PLAY_AUDIO_INDEX = 0x48, 00056 SCSI_LOW_CMD_PAUSE = 0x4B, 00057 } scsi_low_cmd; 00061 scsi_low_phase eris_low_scsi_get_phase(void); 00066 scsi_low_status eris_low_scsi_status(void); 00069 void eris_low_scsi_reset(void); 00076 u32 eris_low_scsi_data_in(u8 *buf, u32 maxlen); 00082 u32 eris_low_scsi_data_out(u8 *buf, u32 len); 00088 void eris_low_scsi_begin_dma(u32 kram_addr, u32 size); 00093 int eris_low_scsi_check_dma(void); 00096 void eris_low_scsi_finish_dma(void); 00099 void eris_low_scsi_abort(void); 00105 int eris_low_scsi_command(u8 *cdb, u32 len); 00106 // Get Error? 00107 00108 #endif 00109