aboutsummaryrefslogtreecommitdiff
path: root/hw/pc.c
diff options
context:
space:
mode:
authoraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2009-01-13 19:47:10 +0000
committeraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2009-01-13 19:47:10 +0000
commitcb457d7679840b95de361c42921e601bd224ecf5 (patch)
treeaf60a521573a5250d95ba671f69bea12cb49baa0 /hw/pc.c
parent0ae18ceeaaa2c1749e742c4b112f6c3bf0896408 (diff)
Make pci_nic_init() use qemu_setup_nic_model() (Mark McLoughlin)
Add a table of PCI NIC models to pass to qemu_setup_nic_model(). While we're at it, also add a corresponding table of NIC init functions. Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6287 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/pc.c')
-rw-r--r--hw/pc.c26
1 files changed, 5 insertions, 21 deletions
diff --git a/hw/pc.c b/hw/pc.c
index 64c08a4342..6a1c8ec242 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -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) {