uint32_t currTxDesc;
/* C+ mode */
+ uint32_t cplus_enabled;
+
uint32_t currCPlusRxDesc;
uint32_t currCPlusTxDesc;
s->CSCR = CSCR_F_LINK_100 | CSCR_HEART_BIT | CSCR_LD;
s->CpCmd = 0x0; /* reset C+ mode */
+ s->cplus_enabled = 0;
+
// s->BasicModeCtrl = 0x3100; // 100Mbps, full duplex, autonegotiation
// s->BasicModeCtrl = 0x2100; // 100Mbps, full duplex
DEBUG_PRINT(("RTL8139C+ command register write(w) val=0x%04x\n", val));
+ s->cplus_enabled = 1;
+
/* mask unwriteable bits */
val = SET_MASKED(val, 0xff84, s->CpCmd);
/* handle C+ transmit mode register configuration */
- if (rtl8139_cp_transmitter_enabled(s))
+ if (s->cplus_enabled)
{
DEBUG_PRINT(("RTL8139C+ DTCCR write offset=0x%x val=0x%08x descriptor=%d\n", txRegOffset, val, descriptor));
qemu_put_be64(f, s->TCTR_base);
RTL8139TallyCounters_save(f, &s->tally_counters);
+
+ qemu_put_be32s(f, &s->cplus_enabled);
}
static int rtl8139_load(QEMUFile* f,void* opaque,int version_id)
int ret;
/* just 2 versions for now */
- if (version_id > 3)
+ if (version_id > 4)
return -EINVAL;
if (version_id >= 3) {
RTL8139TallyCounters_clear(&s->tally_counters);
}
+ if (version_id >= 4) {
+ qemu_get_be32s(f, &s->cplus_enabled);
+ } else {
+ s->cplus_enabled = s->CpCmd != 0;
+ }
+
return 0;
}
s->cplus_txbuffer_len = 0;
s->cplus_txbuffer_offset = 0;
- register_savevm("rtl8139", -1, 3, rtl8139_save, rtl8139_load, s);
+ register_savevm("rtl8139", -1, 4, rtl8139_save, rtl8139_load, s);
#ifdef RTL8139_ONBOARD_TIMER
s->timer = qemu_new_timer(vm_clock, rtl8139_timer, s);