Commit acff9df6a80455a8228dd6547cdd2714dbbe93ec
1 parent
039af320
rxcr save/restore (initial patch by Jürgen Pfennig
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1733 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
10 additions
and
3 deletions
hw/ne2000.c
@@ -643,6 +643,8 @@ static void ne2000_save(QEMUFile* f,void* opaque) | @@ -643,6 +643,8 @@ static void ne2000_save(QEMUFile* f,void* opaque) | ||
643 | { | 643 | { |
644 | NE2000State* s=(NE2000State*)opaque; | 644 | NE2000State* s=(NE2000State*)opaque; |
645 | 645 | ||
646 | + qemu_put_8s(f, &s->rxcr); | ||
647 | + | ||
646 | qemu_put_8s(f, &s->cmd); | 648 | qemu_put_8s(f, &s->cmd); |
647 | qemu_put_be32s(f, &s->start); | 649 | qemu_put_be32s(f, &s->start); |
648 | qemu_put_be32s(f, &s->stop); | 650 | qemu_put_be32s(f, &s->stop); |
@@ -667,8 +669,13 @@ static int ne2000_load(QEMUFile* f,void* opaque,int version_id) | @@ -667,8 +669,13 @@ static int ne2000_load(QEMUFile* f,void* opaque,int version_id) | ||
667 | { | 669 | { |
668 | NE2000State* s=(NE2000State*)opaque; | 670 | NE2000State* s=(NE2000State*)opaque; |
669 | 671 | ||
670 | - if (version_id != 1) | 672 | + if (version_id == 2) { |
673 | + qemu_get_8s(f, &s->rxcr); | ||
674 | + } else if (version_id == 1) { | ||
675 | + s->rxcr = 0x0c; | ||
676 | + } else { | ||
671 | return -EINVAL; | 677 | return -EINVAL; |
678 | + } | ||
672 | 679 | ||
673 | qemu_get_8s(f, &s->cmd); | 680 | qemu_get_8s(f, &s->cmd); |
674 | qemu_get_be32s(f, &s->start); | 681 | qemu_get_be32s(f, &s->start); |
@@ -726,7 +733,7 @@ void isa_ne2000_init(int base, int irq, NICInfo *nd) | @@ -726,7 +733,7 @@ void isa_ne2000_init(int base, int irq, NICInfo *nd) | ||
726 | s->macaddr[4], | 733 | s->macaddr[4], |
727 | s->macaddr[5]); | 734 | s->macaddr[5]); |
728 | 735 | ||
729 | - register_savevm("ne2000", 0, 1, ne2000_save, ne2000_load, s); | 736 | + register_savevm("ne2000", 0, 2, ne2000_save, ne2000_load, s); |
730 | } | 737 | } |
731 | 738 | ||
732 | /***********************************************************/ | 739 | /***********************************************************/ |
@@ -796,7 +803,7 @@ void pci_ne2000_init(PCIBus *bus, NICInfo *nd) | @@ -796,7 +803,7 @@ void pci_ne2000_init(PCIBus *bus, NICInfo *nd) | ||
796 | s->macaddr[5]); | 803 | s->macaddr[5]); |
797 | 804 | ||
798 | /* XXX: instance number ? */ | 805 | /* XXX: instance number ? */ |
799 | - register_savevm("ne2000", 0, 1, ne2000_save, ne2000_load, s); | 806 | + register_savevm("ne2000", 0, 2, ne2000_save, ne2000_load, s); |
800 | register_savevm("ne2000_pci", 0, 1, generic_pci_save, generic_pci_load, | 807 | register_savevm("ne2000_pci", 0, 1, generic_pci_save, generic_pci_load, |
801 | &d->dev); | 808 | &d->dev); |
802 | } | 809 | } |