]> Git Repo - qemu.git/blobdiff - hw/etraxfs_eth.c
vmstate: port cuda
[qemu.git] / hw / etraxfs_eth.c
index dedd1077fcd9d1749de6a97208eda34628479dcf..6aa4007203d1d3a0fbf072e648627e5f5919234d 100644 (file)
@@ -401,7 +401,7 @@ static void eth_update_ma(struct fs_eth *eth, int ma)
        eth->macaddr[ma][i++] = eth->regs[reg] >> 16;
        eth->macaddr[ma][i++] = eth->regs[reg] >> 24;
        eth->macaddr[ma][i++] = eth->regs[reg + 1];
-       eth->macaddr[ma][i++] = eth->regs[reg + 1] >> 8;
+       eth->macaddr[ma][i] = eth->regs[reg + 1] >> 8;
 
        D(printf("set mac%d=%x.%x.%x.%x.%x.%x\n", ma,
                 eth->macaddr[ma][0], eth->macaddr[ma][1],
@@ -437,6 +437,7 @@ eth_writel (void *opaque, target_phys_addr_t addr, uint32_t value)
                                eth_validate_duplex(eth);
                        }
                        eth->mdio_bus.mdc = !!(value & 4);
+                       eth->regs[addr] = value;
                        break;
 
                case RW_REC_CTRL:
@@ -463,7 +464,7 @@ static int eth_match_groupaddr(struct fs_eth *eth, const unsigned char *sa)
 
        /* First bit on the wire of a MAC address signals multicast or
           physical address.  */
-       if (!m_individual && !sa[0] & 1)
+       if (!m_individual && !(sa[0] & 1))
                return 0;
 
        /* Calculate the hash index for the GA registers. */
@@ -597,7 +598,8 @@ void *etraxfs_eth_init(NICInfo *nd, target_phys_addr_t base, int phyaddr)
        tdk_init(&eth->phy);
        mdio_attach(&eth->mdio_bus, &eth->phy, eth->phyaddr);
 
-       eth->ethregs = cpu_register_io_memory(eth_read, eth_write, eth);
+       eth->ethregs = cpu_register_io_memory(eth_read, eth_write, eth,
+                                              DEVICE_NATIVE_ENDIAN);
        cpu_register_physical_memory (base, 0x5c, eth->ethregs);
 
        memcpy(eth->conf.macaddr.a, nd->macaddr, sizeof(nd->macaddr));
This page took 0.025157 seconds and 4 git commands to generate.