mac_via: don't re-inject ADB response when switching to IDLE state
commita67ffaf0ec0b38f62fa27e09c69b00518e5945f3
authorMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Thu, 11 Mar 2021 10:05:02 +0000 (11 10:05 +0000)
committerLaurent Vivier <laurent@vivier.eu>
Tue, 16 Mar 2021 20:41:37 +0000 (16 21:41 +0100)
treeba83d3024c843961cfad6cc409e292ef03b8c748
parentadd4dbfbfc426719d16bdfdc4e5be1a5138ceccd
mac_via: don't re-inject ADB response when switching to IDLE state

The current workaround for the Linux ADB state machine in kernels < 5.6 switching
the VIA back to IDLE state between send and receive modes is to re-inject the
first byte of the response in the IDLE state, and then force the state machine
into generating an autopoll reply.

In fact what is happening is much simpler: analysis of traces from a real Quadra
suggest that the existing data is returned as the first autopoll response rather
than generating an immediate response starting whilst still in IDLE state.

Update the ADB receive code to work in the same way, which allows the re-injection
code to be completely removed from adb_via_receive() and for adb_via_poll() to
be simplified accordingly.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Message-Id: <20210311100505.22596-5-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
hw/misc/mac_via.c