~vcs-imports/qemu/maemo

« back to all changes in this revision

Viewing changes to hw/rtl8139.c

  • Committer: Riku Voipio
  • Date: 2009-06-08 15:31:58 UTC
  • mfrom: (6281.2.366)
  • mto: This revision was merged to the branch mainline in revision 6452.
  • Revision ID: git-v1:759b334a9739814df2883aa4c41b1c0f5670e90a
Merge commit 'gnu/master' into test

Epic merge

Conflicts:
        Makefile
        block.c
        block.h
        configure
        hw/boards.h
        hw/flash.h
        hw/integratorcp.c
        hw/nand.c
        hw/omap2.c
        hw/omap_i2c.c
        hw/sd.c
        hw/smc91c111.c
        hw/tsc2005.c
        hw/tusb6010.c
        hw/usb-musb.c
        linux-user/syscall.c
        target-arm/machine.c
        target-arm/translate.c

Show diffs side-by-side

added added

removed removed

Lines of Context:
3441
3441
    return 0;
3442
3442
}
3443
3443
 
3444
 
PCIDevice *pci_rtl8139_init(PCIBus *bus, NICInfo *nd, int devfn)
 
3444
static void pci_rtl8139_init(PCIDevice *dev)
3445
3445
{
3446
 
    PCIRTL8139State *d;
 
3446
    PCIRTL8139State *d = (PCIRTL8139State *)dev;
3447
3447
    RTL8139State *s;
3448
3448
    uint8_t *pci_conf;
3449
3449
 
3450
 
    d = (PCIRTL8139State *)pci_register_device(bus,
3451
 
                                              "RTL8139", sizeof(PCIRTL8139State),
3452
 
                                              devfn,
3453
 
                                              NULL, NULL);
3454
 
    if (!d)
3455
 
        return NULL;
3456
 
 
3457
3450
    d->dev.unregister = pci_rtl8139_uninit;
3458
3451
 
3459
3452
    pci_conf = d->dev.config;
3479
3472
                           PCI_ADDRESS_SPACE_MEM, rtl8139_mmio_map);
3480
3473
 
3481
3474
    s->pci_dev = (PCIDevice *)d;
3482
 
    memcpy(s->macaddr, nd->macaddr, 6);
 
3475
    qdev_get_macaddr(&dev->qdev, s->macaddr);
3483
3476
    rtl8139_reset(s);
3484
 
    s->vc = qemu_new_vlan_client(nd->vlan, nd->model, nd->name,
 
3477
    s->vc = qdev_get_vlan_client(&dev->qdev,
3485
3478
                                 rtl8139_receive, rtl8139_can_receive,
3486
3479
                                 rtl8139_cleanup, s);
3487
3480
 
3499
3492
    qemu_mod_timer(s->timer,
3500
3493
        rtl8139_get_next_tctr_time(s,qemu_get_clock(vm_clock)));
3501
3494
#endif /* RTL8139_ONBOARD_TIMER */
3502
 
    return (PCIDevice *)d;
3503
 
}
 
3495
}
 
3496
 
 
3497
static void rtl8139_register_devices(void)
 
3498
{
 
3499
    pci_qdev_register("rtl8139", sizeof(PCIRTL8139State), pci_rtl8139_init);
 
3500
}
 
3501
 
 
3502
device_init(rtl8139_register_devices)