Commit 290a0933c0488a5072bed5458b1b9fe4dc84cba4

Authored by ths
1 parent 63a654bb

Fix big endian host operation, by Ben Taylor and Igor Kovalenko.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2509 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 6 additions and 3 deletions
hw/rtl8139.c
@@ -1192,7 +1192,10 @@ static void rtl8139_reset(RTL8139State *s) @@ -1192,7 +1192,10 @@ static void rtl8139_reset(RTL8139State *s)
1192 s->eeprom.contents[1] = 0x10ec; 1192 s->eeprom.contents[1] = 0x10ec;
1193 s->eeprom.contents[2] = 0x8139; 1193 s->eeprom.contents[2] = 0x8139;
1194 #endif 1194 #endif
1195 - memcpy(&s->eeprom.contents[7], s->macaddr, 6); 1195 +
  1196 + s->eeprom.contents[7] = s->macaddr[0] | s->macaddr[1] << 8;
  1197 + s->eeprom.contents[8] = s->macaddr[2] | s->macaddr[3] << 8;
  1198 + s->eeprom.contents[9] = s->macaddr[4] | s->macaddr[5] << 8;
1196 1199
1197 /* mark all status registers as owned by host */ 1200 /* mark all status registers as owned by host */
1198 for (i = 0; i < 4; ++i) 1201 for (i = 0; i < 4; ++i)
@@ -2455,12 +2458,12 @@ static void rtl8139_TxAddr_write(RTL8139State *s, uint32_t txAddrOffset, uint32_ @@ -2455,12 +2458,12 @@ static void rtl8139_TxAddr_write(RTL8139State *s, uint32_t txAddrOffset, uint32_
2455 { 2458 {
2456 DEBUG_PRINT(("RTL8139: TxAddr write offset=0x%x val=0x%08x\n", txAddrOffset, val)); 2459 DEBUG_PRINT(("RTL8139: TxAddr write offset=0x%x val=0x%08x\n", txAddrOffset, val));
2457 2460
2458 - s->TxAddr[txAddrOffset/4] = le32_to_cpu(val); 2461 + s->TxAddr[txAddrOffset/4] = val;
2459 } 2462 }
2460 2463
2461 static uint32_t rtl8139_TxAddr_read(RTL8139State *s, uint32_t txAddrOffset) 2464 static uint32_t rtl8139_TxAddr_read(RTL8139State *s, uint32_t txAddrOffset)
2462 { 2465 {
2463 - uint32_t ret = cpu_to_le32(s->TxAddr[txAddrOffset/4]); 2466 + uint32_t ret = s->TxAddr[txAddrOffset/4];
2464 2467
2465 DEBUG_PRINT(("RTL8139: TxAddr read offset=0x%x val=0x%08x\n", txAddrOffset, ret)); 2468 DEBUG_PRINT(("RTL8139: TxAddr read offset=0x%x val=0x%08x\n", txAddrOffset, ret));
2466 2469