Skip to content

Commit

Permalink
Remove ReceiveBytes()
Browse files Browse the repository at this point in the history
  • Loading branch information
uweseimet committed Feb 2, 2024
1 parent aae1973 commit 58a4edc
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 52 deletions.
52 changes: 1 addition & 51 deletions cpp/controllers/generic_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -395,12 +395,7 @@ void GenericController::Receive()
return;
}

if (IsByteTransfer()) {
ReceiveBytes();
return;
}

const bool in_transfer = UpdateTransferSize();
const bool in_transfer = IsByteTransfer() ? false : UpdateTransferSize();

// Processing after receiving data
switch (GetPhase()) {
Expand Down Expand Up @@ -450,51 +445,6 @@ void GenericController::Receive()
}
}

void GenericController::ReceiveBytes()
{
bool result = true;

// Processing after receiving data
switch (GetPhase()) {
case phase_t::dataout:
result = XferOut(false);
break;

case phase_t::msgout:
SetMessage(GetBuffer()[0]);

XferMsg(GetMessage());

// Clear message data in preparation for Message In
SetMessage(0x00);
break;

default:
break;
}

if (!result) {
Error(sense_key::aborted_command, asc::controller_receive_bytes_result);
return;
}

// Move to next phase
switch (GetPhase()) {
case phase_t::msgout:
ProcessMessage();
break;

case phase_t::dataout:
Status();
break;

default:
error("Unexpected bus phase: " + Bus::GetPhaseName(GetPhase()));
assert(false);
break;
}
}

bool GenericController::XferOut(bool cont)
{
if (!IsByteTransfer()) {
Expand Down
1 change: 0 additions & 1 deletion cpp/controllers/generic_controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ class GenericController : public AbstractController
void Send();
virtual void XferMsg(int) = 0;
bool XferOutBlockOriented(bool);
void ReceiveBytes();

void LogCdb() const;

Expand Down

0 comments on commit 58a4edc

Please sign in to comment.