# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID a8b1d4fad72d2b0bba1b121bc250b4ac80fcf9ac
# Parent 056e571ce462d44612f2300ff17f589b2e43368b
Fix a protocol violation in the pcnet emulation. Tested on at least
two systems and fixes the 'corrupt MAC' with scp or sftp. See bug 574
for more information.
Signed-off-by: Don Fry <brazilnut@xxxxxxxxxx>
diff -r 056e571ce462 -r a8b1d4fad72d tools/ioemu/hw/pcnet.h
--- a/tools/ioemu/hw/pcnet.h Mon Mar 20 11:00:58 2006
+++ b/tools/ioemu/hw/pcnet.h Mon Mar 20 11:01:32 2006
@@ -225,9 +225,11 @@
((uint32_t *)tmd)[3] = 0;
}
else
- if (BCR_SWSTYLE(s) != 3)
- cpu_physical_memory_read(addr, (void *)tmd, 16);
- else {
+ if (BCR_SWSTYLE(s) != 3) {
+ ((uint32_t *)tmd)[2] = 0;
+ cpu_physical_memory_read(addr+4, (void *)&tmd->tmd1, 4);
+ cpu_physical_memory_read(addr, (void *)&tmd->tmd0, 4);
+ } else {
uint32_t xda[4];
cpu_physical_memory_read(addr,
(void *)&xda[0], sizeof(xda));
@@ -253,9 +255,10 @@
cpu_physical_memory_set_dirty(addr+7);
}
else {
- if (BCR_SWSTYLE(s) != 3)
- cpu_physical_memory_write(addr, (void *)tmd, 16);
- else {
+ if (BCR_SWSTYLE(s) != 3) {
+ cpu_physical_memory_write(addr+8, (void *)&tmd->tmd2, 4);
+ cpu_physical_memory_write(addr+4, (void *)&tmd->tmd1, 4);
+ } else {
uint32_t xda[4];
xda[0] = ((uint32_t *)tmd)[2];
xda[1] = ((uint32_t *)tmd)[1];
@@ -282,9 +285,11 @@
((uint32_t *)rmd)[3] = 0;
}
else
- if (BCR_SWSTYLE(s) != 3)
- cpu_physical_memory_read(addr, (void *)rmd, 16);
- else {
+ if (BCR_SWSTYLE(s) != 3) {
+ rmd->rmd2.zeros = 0;
+ cpu_physical_memory_read(addr+4, (void *)&rmd->rmd1, 4);
+ cpu_physical_memory_read(addr, (void *)&rmd->rmd0, 4);
+ } else {
uint32_t rda[4];
cpu_physical_memory_read(addr,
(void *)&rda[0], sizeof(rda));
@@ -310,9 +315,10 @@
cpu_physical_memory_set_dirty(addr+7);
}
else {
- if (BCR_SWSTYLE(s) != 3)
- cpu_physical_memory_write(addr, (void *)rmd, 16);
- else {
+ if (BCR_SWSTYLE(s) != 3) {
+ cpu_physical_memory_write(addr+8, (void *)&rmd->rmd2, 4);
+ cpu_physical_memory_write(addr+4, (void *)&rmd->rmd1, 4);
+ } else {
uint32_t rda[4];
rda[0] = ((uint32_t *)rmd)[2];
rda[1] = ((uint32_t *)rmd)[1];
@@ -339,8 +345,7 @@
#define CHECK_RMD(ADDR,RES) do { \
struct pcnet_RMD rmd; \
RMDLOAD(&rmd,(ADDR)); \
- (RES) |= (rmd.rmd1.ones != 15) \
- || (rmd.rmd2.zeros != 0); \
+ (RES) |= (rmd.rmd1.ones != 15); \
} while (0)
#define CHECK_TMD(ADDR,RES) do { \
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|