diff options
Diffstat (limited to 'hw/pc.c')
-rw-r--r-- | hw/pc.c | 26 |
1 files changed, 5 insertions, 21 deletions
@@ -764,7 +764,6 @@ static void pc_init1(ram_addr_t ram_size, int vga_ram_size, PCIBus *pci_bus; int piix3_devfn = -1; CPUState *env; - NICInfo *nd; qemu_irq *cpu_irq; qemu_irq *i8259; int index; @@ -1000,27 +999,12 @@ static void pc_init1(ram_addr_t ram_size, int vga_ram_size, } for(i = 0; i < nb_nics; i++) { - nd = &nd_table[i]; - if (!nd->model) { - if (pci_enabled) { - nd->model = "ne2k_pci"; - } else { - nd->model = "ne2k_isa"; - } - } - if (strcmp(nd->model, "ne2k_isa") == 0) { + NICInfo *nd = &nd_table[i]; + + if (!pci_enabled || (nd->model && strcmp(nd->model, "ne2k_isa") == 0)) pc_init_ne2k_isa(nd, i8259); - } else if (pci_enabled) { - if (strcmp(nd->model, "?") == 0) - fprintf(stderr, "qemu: Supported ISA NICs: ne2k_isa\n"); - pci_nic_init(pci_bus, nd, -1); - } else if (strcmp(nd->model, "?") == 0) { - fprintf(stderr, "qemu: Supported ISA NICs: ne2k_isa\n"); - exit(1); - } else { - fprintf(stderr, "qemu: Unsupported NIC: %s\n", nd->model); - exit(1); - } + else + pci_nic_init(pci_bus, nd, -1, "ne2k_pci"); } if (drive_get_max_bus(IF_IDE) >= MAX_IDE_BUS) { |