Skip to content

Commit

Permalink
Reduce DaynaPort logging
Browse files Browse the repository at this point in the history
  • Loading branch information
uweseimet committed Jan 21, 2024
1 parent 2bc517a commit f216589
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions cpp/devices/daynaport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,6 @@ int DaynaPort::Read(cdb_t cdb, vector<uint8_t> &buf, uint64_t)

const int requested_length = cdb[4];

LogTrace(fmt::format("Read maximum length: {}", requested_length));

// At startup the host may send a READ(6) command with a sector count of 1 to read the root sector.
// We should respond by going into the status mode with a code of 0x02.
if (requested_length == 1) {
Expand Down Expand Up @@ -213,14 +211,12 @@ bool DaynaPort::Write(cdb_t cdb, span<const uint8_t> buf)
const int data_length = GetInt16(cdb, 3);
tap.Send(buf.data(), data_length);
byte_write_count += data_length;
LogTrace(fmt::format("Transmitted {} byte(s) (00 format)", data_length));
}
else if (data_format == 0x80) {
// The data length is specified in the first 2 bytes of the payload
const int data_length = buf[1] + ((static_cast<int>(buf[0]) & 0xff) << 8);
tap.Send(&(buf.data()[4]), data_length);
byte_write_count += data_length;
LogTrace(fmt::format("Transmitted {} byte(s) (80 format)", data_length));
}
else {
LogWarn(fmt::format("Unknown data format: ${:02x}", data_format));
Expand Down Expand Up @@ -279,14 +275,10 @@ void DaynaPort::Read6()
// If any commands have a bogus control value, they were probably not
// generated by the DaynaPort driver so ignore them
if (GetController()->GetCmdByte(5) != 0xc0 && GetController()->GetCmdByte(5) != 0x80) {
LogTrace("Control value: " + to_string(GetController()->GetCmdByte(5)));
throw scsi_exception(sense_key::illegal_request, asc::invalid_field_in_cdb);
}

LogTrace(fmt::format("READ(6) command, record: ${:02x}", record));

const int length = Read(GetController()->GetCmd(), GetController()->GetBuffer(), record);
LogTrace(fmt::format("Length is {}", GetController()->GetLength()));
GetController()->SetLength(length);

// Set next block
Expand All @@ -311,8 +303,6 @@ void DaynaPort::Write6() const
throw scsi_exception(sense_key::illegal_request, asc::invalid_field_in_cdb);
}

LogTrace(fmt::format("Length: {0}, format: ${1:02x}", GetController()->GetLength(), data_format));

GetController()->SetLength(length);

// Set next block
Expand Down

0 comments on commit f216589

Please sign in to comment.