hw/sd.c: Fix the set of commands which are failed when card is locked
commit25881d33905798e6fddda3827b4345e867c02b7f
authorPeter Maydell <peter.maydell@linaro.org>
Sun, 18 Dec 2011 20:37:51 +0000 (18 21:37 +0100)
committerAndrzej Zaborowski <andrew.zaborowski@intel.com>
Wed, 21 Dec 2011 03:59:49 +0000 (21 04:59 +0100)
treeea877fd9061488c4f1092598904168be0bee5c2c
parente114fead273e2a7d453c2fb67c74cad58c34581d
hw/sd.c: Fix the set of commands which are failed when card is locked

Fix bugs in the code determining whether to accept a command when the
SD card is locked. Most notably, we had the condition completely
reversed, so we would accept all the commands we should refuse and
refuse all the commands we should accept. Correct this by refactoring
the enormous if () clause into a separate function.
We had also missed ACMD42 off the list of commands which are accepted
in locked state: add it.

This is one of the two problems reported in LP:597641.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
hw/sd.c