static void pci_map(PCIDevice * pci_dev, int region_num,
uint32_t addr, uint32_t size, int type)
{
- PCIEEPRO100State *d = (PCIEEPRO100State *) pci_dev;
+ PCIEEPRO100State *d = DO_UPCAST(PCIEEPRO100State, dev, pci_dev);
EEPRO100State *s = &d->eepro100;
logout("region %d, addr=0x%08x, size=0x%08x, type=%d\n",
static void pci_mmio_map(PCIDevice * pci_dev, int region_num,
uint32_t addr, uint32_t size, int type)
{
- PCIEEPRO100State *d = (PCIEEPRO100State *) pci_dev;
+ PCIEEPRO100State *d = DO_UPCAST(PCIEEPRO100State, dev, pci_dev);
logout("region %d, addr=0x%08x, size=0x%08x, type=%d\n",
region_num, addr, size, type);
static int pci_nic_uninit(PCIDevice *dev)
{
- PCIEEPRO100State *d = (PCIEEPRO100State *) dev;
+ PCIEEPRO100State *d = DO_UPCAST(PCIEEPRO100State, dev, dev);
EEPRO100State *s = &d->eepro100;
cpu_unregister_io_memory(s->mmio_index);
static int nic_init(PCIDevice *pci_dev, uint32_t device)
{
- PCIEEPRO100State *d = (PCIEEPRO100State *)pci_dev;
+ PCIEEPRO100State *d = DO_UPCAST(PCIEEPRO100State, dev, pci_dev);
EEPRO100State *s;
logout("\n");