hw/sd/sdcard: Track last command used to help logging
commit702ff29c8ff397e6f3aa7e46f30f9ccdd74fb492
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Thu, 13 Jun 2024 23:44:28 +0000 (14 01:44 +0200)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Tue, 2 Jul 2024 07:19:20 +0000 (2 09:19 +0200)
treef8f0c9e8152aae25d89fb97e35d1a708320cea2b
parent6a414c01100359b799498a2a9f4f3883834df86e
hw/sd/sdcard: Track last command used to help logging

The command is selected on the I/O lines, and further
processing might be done on the DAT lines via the
sd_read_byte() and sd_write_byte() handlers. Since
these methods can't distinct between normal and APP
commands, keep the name of the current command in
the SDState and use it in the DAT handlers. This
fixes a bug that all normal commands were displayed
as APP commands.

Fixes: 2ed61fb57b ("sdcard: Display command name when tracing CMD/ACMD")
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Tested-by: Cédric Le Goater <clg@redhat.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Message-Id: <20240628070216.92609-4-philmd@linaro.org>
hw/sd/sd.c