mirror of
https://github.com/dingusdev/dingusppc.git
synced 2025-08-05 18:25:42 +00:00
sc53c94: preliminary support for CMD_XFER_PAD_BYTES.
MkLinux uses this command during synchronous transfer negotiation.
This commit is contained in:
@@ -345,6 +345,21 @@ void Sc53C94::exec_command()
|
||||
this->update_irq();
|
||||
exec_next_command();
|
||||
break;
|
||||
case CMD_XFER_PAD_BYTES:
|
||||
if (this->bus_obj->current_phase() != ScsiPhase::COMMAND)
|
||||
ABORT_F("%s: unsupported phase %d in CMD_XFER_PAD_BYTES",
|
||||
this->name.c_str(), this->bus_obj->current_phase());
|
||||
std::memset(this->data_fifo, 0, DATA_FIFO_MAX);
|
||||
// FIXME: does the non-DMA version of this command use the transfer counter?
|
||||
this->data_fifo_pos = std::min((int)this->set_xfer_count, DATA_FIFO_MAX);
|
||||
this->cur_state = SeqState::SEND_CMD;
|
||||
this->sequencer();
|
||||
if (this->bus_obj->current_phase() != ScsiPhase::COMMAND) {
|
||||
this->int_status |= INTSTAT_SR;
|
||||
this->update_irq();
|
||||
exec_next_command();
|
||||
}
|
||||
break;
|
||||
case CMD_RESET_ATN:
|
||||
this->bus_obj->release_ctrl_line(this->my_bus_id, SCSI_CTRL_ATN);
|
||||
exec_next_command();
|
||||
@@ -407,8 +422,6 @@ void Sc53C94::exec_next_command()
|
||||
}
|
||||
}
|
||||
|
||||
constexpr auto DATA_FIFO_MAX = 16;
|
||||
|
||||
void Sc53C94::fifo_push(const uint8_t data)
|
||||
{
|
||||
if (this->data_fifo_pos < DATA_FIFO_MAX) {
|
||||
|
@@ -94,7 +94,7 @@ enum {
|
||||
CMD_XFER = 0x10,
|
||||
CMD_COMPLETE_STEPS = 0x11,
|
||||
CMD_MSG_ACCEPTED = 0x12,
|
||||
//CMD_TRANSFER_PAD_BYTES = 0x18,
|
||||
CMD_XFER_PAD_BYTES = 0x18,
|
||||
CMD_SET_ATN = 0x1A, // no interrupt
|
||||
CMD_RESET_ATN = 0x1B, // no interrupt
|
||||
|
||||
@@ -182,6 +182,8 @@ namespace SeqState {
|
||||
};
|
||||
};
|
||||
|
||||
constexpr auto DATA_FIFO_MAX = 16;
|
||||
|
||||
/** Sequence descriptor for multistep commands. */
|
||||
typedef struct {
|
||||
int step_num;
|
||||
@@ -268,7 +270,7 @@ private:
|
||||
uint32_t my_timer_id = 0;
|
||||
|
||||
uint8_t cmd_fifo[2];
|
||||
uint8_t data_fifo[16];
|
||||
uint8_t data_fifo[DATA_FIFO_MAX];
|
||||
int cmd_fifo_pos = 0;
|
||||
int data_fifo_pos = 0;
|
||||
int bytes_out = 0;
|
||||
|
Reference in New Issue
Block a user