Igor Mitsyanko <i.mitsya...@samsung.com> writes: > This patch updates SD card model to support save/load of card's state. > > Signed-off-by: Igor Mitsyanko <i.mitsya...@samsung.com> > --- > 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? > uint32_t ocr; > uint8_t scr[8]; > uint8_t cid[16]; [...]