Revision 9d29cdea

b/hw/rtl8139.c
1328 1328
}
1329 1329

  
1330 1330
/* Loads values of tally counters from VM state file */
1331

  
1332
static const VMStateDescription vmstate_tally_counters = {
1333
    .name = "tally_counters",
1334
    .version_id = 1,
1335
    .minimum_version_id = 1,
1336
    .minimum_version_id_old = 1,
1337
    .fields      = (VMStateField []) {
1338
        VMSTATE_UINT64(TxOk, RTL8139TallyCounters),
1339
        VMSTATE_UINT64(RxOk, RTL8139TallyCounters),
1340
        VMSTATE_UINT64(TxERR, RTL8139TallyCounters),
1341
        VMSTATE_UINT32(RxERR, RTL8139TallyCounters),
1342
        VMSTATE_UINT16(MissPkt, RTL8139TallyCounters),
1343
        VMSTATE_UINT16(FAE, RTL8139TallyCounters),
1344
        VMSTATE_UINT32(Tx1Col, RTL8139TallyCounters),
1345
        VMSTATE_UINT32(TxMCol, RTL8139TallyCounters),
1346
        VMSTATE_UINT64(RxOkPhy, RTL8139TallyCounters),
1347
        VMSTATE_UINT64(RxOkBrd, RTL8139TallyCounters),
1348
        VMSTATE_UINT16(TxAbt, RTL8139TallyCounters),
1349
        VMSTATE_UINT16(TxUndrn, RTL8139TallyCounters),
1350
        VMSTATE_END_OF_LIST()
1351
    }
1352
};
1331 1353
static void RTL8139TallyCounters_load(QEMUFile* f, RTL8139TallyCounters *tally_counters)
1332 1354
{
1333
    qemu_get_be64s(f, &tally_counters->TxOk);
1334
    qemu_get_be64s(f, &tally_counters->RxOk);
1335
    qemu_get_be64s(f, &tally_counters->TxERR);
1336
    qemu_get_be32s(f, &tally_counters->RxERR);
1337
    qemu_get_be16s(f, &tally_counters->MissPkt);
1338
    qemu_get_be16s(f, &tally_counters->FAE);
1339
    qemu_get_be32s(f, &tally_counters->Tx1Col);
1340
    qemu_get_be32s(f, &tally_counters->TxMCol);
1341
    qemu_get_be64s(f, &tally_counters->RxOkPhy);
1342
    qemu_get_be64s(f, &tally_counters->RxOkBrd);
1343
    qemu_get_be32s(f, &tally_counters->RxOkMul);
1344
    qemu_get_be16s(f, &tally_counters->TxAbt);
1345
    qemu_get_be16s(f, &tally_counters->TxUndrn);
1355
    vmstate_load_state(f, &vmstate_tally_counters, tally_counters, vmstate_tally_counters.version_id);
1346 1356
}
1347 1357

  
1348 1358
/* Saves values of tally counters to VM state file */
1349 1359
static void RTL8139TallyCounters_save(QEMUFile* f, RTL8139TallyCounters *tally_counters)
1350 1360
{
1351
    qemu_put_be64s(f, &tally_counters->TxOk);
1352
    qemu_put_be64s(f, &tally_counters->RxOk);
1353
    qemu_put_be64s(f, &tally_counters->TxERR);
1354
    qemu_put_be32s(f, &tally_counters->RxERR);
1355
    qemu_put_be16s(f, &tally_counters->MissPkt);
1356
    qemu_put_be16s(f, &tally_counters->FAE);
1357
    qemu_put_be32s(f, &tally_counters->Tx1Col);
1358
    qemu_put_be32s(f, &tally_counters->TxMCol);
1359
    qemu_put_be64s(f, &tally_counters->RxOkPhy);
1360
    qemu_put_be64s(f, &tally_counters->RxOkBrd);
1361
    qemu_put_be32s(f, &tally_counters->RxOkMul);
1362
    qemu_put_be16s(f, &tally_counters->TxAbt);
1363
    qemu_put_be16s(f, &tally_counters->TxUndrn);
1361
    vmstate_save_state(f, &vmstate_tally_counters, tally_counters);
1364 1362
}
1365 1363

  
1366 1364
static void rtl8139_ChipCmd_write(RTL8139State *s, uint32_t val)

Also available in: Unified diff