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 zero length packet handling #73

Merged
merged 1 commit into from
Sep 7, 2023
Merged

Conversation

fysnet
Copy link
Collaborator

@fysnet fysnet commented Sep 6, 2023

This fixes zero length packet handling.
See the following example that requests 128 bytes:

SETUP(8)
IN(64)
IN(64)
STATUS(0)

The current code erroneously assumes that there are no more IN packets after the first two 64-byte packets.

However, what happens with the following:

SETUP(8)
IN(64)
IN(64)
IN(64)    <--- current code assumes this will be, and expects a STATUS packet
STATUS(0)

Currently, the third IN(64) above will result in a coding error because the code is expecting the STATUS packet, not another IN packet.

The "controller" must allow for more packets than expected, returning a short packet detect on the third IN(64) packet shown above, actually returning zero bytes, hence the Short Packet Detect.

This patch was tested on WinXP, Win7, and Win10.

@fysnet fysnet marked this pull request as ready for review September 6, 2023 20:18
@stlintel stlintel merged commit 43dd416 into bochs-emu:master Sep 7, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants