aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2007-01-10 16:17:21 +0000
committerths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2007-01-10 16:17:21 +0000
commitabcebc7e803f243ef244e06349a4b911daa738f4 (patch)
treedfdf7fd8882c42e5124487063909c5eca019fddb /hw
parentf158755072f368d539b31851b308bec985893abb (diff)
downloadqemu-abcebc7e803f243ef244e06349a4b911daa738f4.zip
qemu-abcebc7e803f243ef244e06349a4b911daa738f4.tar.gz
qemu-abcebc7e803f243ef244e06349a4b911daa738f4.tar.bz2
Devfn number for network PCI cards, by Aurelien Jarno.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2314 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw')
-rw-r--r--hw/ne2000.c4
-rw-r--r--hw/pc.c2
-rw-r--r--hw/pci.c8
-rw-r--r--hw/pcnet.c4
-rw-r--r--hw/ppc_chrp.c4
-rw-r--r--hw/realview.c2
-rw-r--r--hw/rtl8139.c4
-rw-r--r--hw/sun4u.c2
-rw-r--r--hw/versatilepb.c2
9 files changed, 16 insertions, 16 deletions
diff --git a/hw/ne2000.c b/hw/ne2000.c
index 94700c1..a045a20 100644
--- a/hw/ne2000.c
+++ b/hw/ne2000.c
@@ -781,7 +781,7 @@ static void ne2000_map(PCIDevice *pci_dev, int region_num,
register_ioport_read(addr + 0x1f, 1, 1, ne2000_reset_ioport_read, s);
}
-void pci_ne2000_init(PCIBus *bus, NICInfo *nd)
+void pci_ne2000_init(PCIBus *bus, NICInfo *nd, int devfn)
{
PCINE2000State *d;
NE2000State *s;
@@ -789,7 +789,7 @@ void pci_ne2000_init(PCIBus *bus, NICInfo *nd)
d = (PCINE2000State *)pci_register_device(bus,
"NE2000", sizeof(PCINE2000State),
- -1,
+ devfn,
NULL, NULL);
pci_conf = d->dev.config;
pci_conf[0x00] = 0xec; // Realtek 8029
diff --git a/hw/pc.c b/hw/pc.c
index 1c141ae..408a9fb 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -668,7 +668,7 @@ static void pc_init1(int ram_size, int vga_ram_size, int boot_device,
if (strcmp(nd->model, "ne2k_isa") == 0) {
pc_init_ne2k_isa(nd);
} else if (pci_enabled) {
- pci_nic_init(pci_bus, nd);
+ pci_nic_init(pci_bus, nd, -1);
} else {
fprintf(stderr, "qemu: Unsupported NIC: %s\n", nd->model);
exit(1);
diff --git a/hw/pci.c b/hw/pci.c
index d8fcd7b..b895f98 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -544,14 +544,14 @@ void pci_info(void)
}
/* Initialize a PCI NIC. */
-void pci_nic_init(PCIBus *bus, NICInfo *nd)
+void pci_nic_init(PCIBus *bus, NICInfo *nd, int devfn)
{
if (strcmp(nd->model, "ne2k_pci") == 0) {
- pci_ne2000_init(bus, nd);
+ pci_ne2000_init(bus, nd, devfn);
} else if (strcmp(nd->model, "rtl8139") == 0) {
- pci_rtl8139_init(bus, nd);
+ pci_rtl8139_init(bus, nd, devfn);
} else if (strcmp(nd->model, "pcnet") == 0) {
- pci_pcnet_init(bus, nd);
+ pci_pcnet_init(bus, nd, devfn);
} else {
fprintf(stderr, "qemu: Unsupported NIC: %s\n", nd->model);
exit (1);
diff --git a/hw/pcnet.c b/hw/pcnet.c
index f242cd1..3bdddeb 100644
--- a/hw/pcnet.c
+++ b/hw/pcnet.c
@@ -1889,7 +1889,7 @@ static void pci_physical_memory_read(void *dma_opaque, target_phys_addr_t addr,
cpu_physical_memory_read(addr, buf, len);
}
-void pci_pcnet_init(PCIBus *bus, NICInfo *nd)
+void pci_pcnet_init(PCIBus *bus, NICInfo *nd, int devfn)
{
PCNetState *d;
uint8_t *pci_conf;
@@ -1900,7 +1900,7 @@ void pci_pcnet_init(PCIBus *bus, NICInfo *nd)
#endif
d = (PCNetState *)pci_register_device(bus, "PCNet", sizeof(PCNetState),
- -1, NULL, NULL);
+ devfn, NULL, NULL);
pci_conf = d->dev.config;
diff --git a/hw/ppc_chrp.c b/hw/ppc_chrp.c
index 7599eab..1e0fd2e 100644
--- a/hw/ppc_chrp.c
+++ b/hw/ppc_chrp.c
@@ -436,7 +436,7 @@ static void ppc_chrp_init(int ram_size, int vga_ram_size, int boot_device,
for(i = 0; i < nb_nics; i++) {
if (!nd_table[i].model)
nd_table[i].model = "ne2k_pci";
- pci_nic_init(pci_bus, &nd_table[i]);
+ pci_nic_init(pci_bus, &nd_table[i], -1);
}
pci_cmd646_ide_init(pci_bus, &bs_table[0], 0);
@@ -483,7 +483,7 @@ static void ppc_chrp_init(int ram_size, int vga_ram_size, int boot_device,
serial_init(&pic_set_irq_new, isa_pic, 0x3f8, 4, serial_hds[0]);
for(i = 0; i < nb_nics; i++) {
- pci_ne2000_init(pci_bus, &nd_table[i]);
+ pci_ne2000_init(pci_bus, &nd_table[i], -1);
}
#if 1
diff --git a/hw/realview.c b/hw/realview.c
index 11b0916..6d057ce 100644
--- a/hw/realview.c
+++ b/hw/realview.c
@@ -71,7 +71,7 @@ static void realview_init(int ram_size, int vga_ram_size, int boot_device,
if (strcmp(nd->model, "smc91c111") == 0) {
smc91c111_init(nd, 0x4e000000, pic, 28);
} else {
- pci_nic_init(pci_bus, nd);
+ pci_nic_init(pci_bus, nd, -1);
}
}
diff --git a/hw/rtl8139.c b/hw/rtl8139.c
index db6353a..94fc2fc 100644
--- a/hw/rtl8139.c
+++ b/hw/rtl8139.c
@@ -3409,7 +3409,7 @@ static void rtl8139_timer(void *opaque)
}
#endif /* RTL8139_ONBOARD_TIMER */
-void pci_rtl8139_init(PCIBus *bus, NICInfo *nd)
+void pci_rtl8139_init(PCIBus *bus, NICInfo *nd, int devfn)
{
PCIRTL8139State *d;
RTL8139State *s;
@@ -3417,7 +3417,7 @@ void pci_rtl8139_init(PCIBus *bus, NICInfo *nd)
d = (PCIRTL8139State *)pci_register_device(bus,
"RTL8139", sizeof(PCIRTL8139State),
- -1,
+ devfn,
NULL, NULL);
pci_conf = d->dev.config;
pci_conf[0x00] = 0xec; /* Realtek 8139 */
diff --git a/hw/sun4u.c b/hw/sun4u.c
index 6d41369..61069a6 100644
--- a/hw/sun4u.c
+++ b/hw/sun4u.c
@@ -344,7 +344,7 @@ static void sun4u_init(int ram_size, int vga_ram_size, int boot_device,
for(i = 0; i < nb_nics; i++) {
if (!nd_table[i].model)
nd_table[i].model = "ne2k_pci";
- pci_nic_init(pci_bus, &nd_table[i]);
+ pci_nic_init(pci_bus, &nd_table[i], -1);
}
pci_cmd646_ide_init(pci_bus, bs_table, 1);
diff --git a/hw/versatilepb.c b/hw/versatilepb.c
index 475cb48..12b7303 100644
--- a/hw/versatilepb.c
+++ b/hw/versatilepb.c
@@ -188,7 +188,7 @@ static void versatile_init(int ram_size, int vga_ram_size, int boot_device,
if (strcmp(nd->model, "smc91c111") == 0) {
smc91c111_init(nd, 0x10010000, sic, 25);
} else {
- pci_nic_init(pci_bus, nd);
+ pci_nic_init(pci_bus, nd, -1);
}
}
if (usb_enabled) {