qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH V4 08/12] hw/sd.c: add SD card save/load support


From: Igor Mitsyanko
Subject: Re: [Qemu-devel] [PATCH V4 08/12] hw/sd.c: add SD card save/load support
Date: Tue, 31 Jul 2012 14:27:47 +0400
User-agent: Mozilla/5.0 (X11; Linux i686; rv:14.0) Gecko/20120714 Thunderbird/14.0

On 07/31/2012 01:33 PM, Markus Armbruster wrote:
Igor Mitsyanko <address@hidden> writes:

This patch updates SD card model to support save/load of card's state.

Signed-off-by: Igor Mitsyanko <address@hidden>
---
  hw/sd.c |   88 +++++++++++++++++++++++++++++++++++++++++++++-----------------
  1 files changed, 64 insertions(+), 24 deletions(-)

diff --git a/hw/sd.c b/hw/sd.c
index 20ebd8e..f8ab045 100644
--- a/hw/sd.c
+++ b/hw/sd.c
@@ -55,24 +55,28 @@ typedef enum {
      sd_illegal = -2,
  } sd_rsp_type_t;
+enum {
+    sd_inactive,
+    sd_card_identification_mode,
+    sd_data_transfer_mode,
+};
+
+enum {
+    sd_inactive_state = -1,
+    sd_idle_state = 0,
+    sd_ready_state,
+    sd_identification_state,
+    sd_standby_state,
+    sd_transfer_state,
+    sd_sendingdata_state,
+    sd_receivingdata_state,
+    sd_programming_state,
+    sd_disconnect_state,
+};
+
  struct SDState {
-    enum {
-        sd_inactive,
-        sd_card_identification_mode,
-        sd_data_transfer_mode,
-    } mode;
-    enum {
-        sd_inactive_state = -1,
-        sd_idle_state = 0,
-        sd_ready_state,
-        sd_identification_state,
-        sd_standby_state,
-        sd_transfer_state,
-        sd_sendingdata_state,
-        sd_receivingdata_state,
-        sd_programming_state,
-        sd_disconnect_state,
-    } state;
+    uint32_t mode;
+    int32_t state;
Comment pointing to the related enum?

Ok, I'll have to give them names then.

      uint32_t ocr;
      uint8_t scr[8];
      uint8_t cid[16];
[...]





reply via email to

[Prev in Thread] Current Thread [Next in Thread]