Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix USIO fault when it received unsupported FW commands #12593

Merged
merged 1 commit into from
Sep 7, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions rpcs3/Emu/Io/usio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,9 @@ void usb_device_usio::usio_write(u8 channel, u16 reg, const std::vector<u8>& dat
}
else
{
usio_log.fatal("Unexpected write channel: 0x%02X!", channel);
// Channel 1 is the endpoint for firmware update.
// We are not using any firmware since this is emulation.
usio_log.warning("Unsupported write operation(channel: 0x%02X, addr: 0x%04X)", channel, reg);
}
}

Expand Down Expand Up @@ -356,7 +358,9 @@ void usb_device_usio::usio_read(u8 channel, u16 reg, u16 size)
}
else
{
usio_log.fatal("Unexpected read channel: 0x%02X!", channel);
// Channel 1 is the endpoint for firmware update.
// We are not using any firmware since this is emulation.
usio_log.warning("Unsupported read operation(channel: 0x%02X, addr: 0x%04X)", channel, reg);
}
}

Expand Down Expand Up @@ -419,11 +423,11 @@ void usb_device_usio::interrupt_transfer(u32 buf_size, u8* buf, u32 endpoint, Us
return;
}

// Unknown, happens only once, boot command?
// Init and reset commands
if ((buf[0] & 0xA0) == 0xA0)
{
const std::array<u8, 6> boot_command = {0xA0, 0xF0, 0x28, 0x00, 0x00, 0x80};
ensure(memcmp(buf, boot_command.data(), 6) == 0);
const std::array<u8, 2> init_command = {0xA0, 0xF0}; // This kind of command starts with 0xA0, 0xF0 commonly. For example, {0xA0, 0xF0, 0x28, 0x00, 0x00, 0x80}
ensure(memcmp(buf, init_command.data(), 2) == 0);
return;
}

Expand Down