devfn number for network PCI cards
PATCH 1/1 devfn number for network PCI cards
This patch adds a way to specify a devfn number for the network PCI cards, as the Malta platform rely on this number to setup the IRQ. Passing the value -1 makes the devfn automatically assigned, as before.
hw/ne2000.c +2 -2
@@ -781,7 +781,7 @@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 @@ d = (PCINE2000State *)pci_register_device (bus,"NE2000" ,sizeof (PCINE2000State), --1 , + devfn,NULL ,NULL ); pci_conf = d->dev.config; pci_conf[0x00 ] =0xec ;// Realtek 8029
hw/pc.c +1 -1
@@ -651,7 +651,7 @@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 );
hw/pci.c +4 -4
@@ -544,14 +544,14 @@ }/* 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 );
hw/pcnet.c +2 -2
@@ -1889,7 +1889,7 @@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 @@#endif d = (PCNetState *)pci_register_device (bus,"PCNet" ,sizeof (PCNetState), --1 ,NULL ,NULL ); + devfn,NULL ,NULL ); pci_conf = d->dev.config;
hw/ppc_chrp.c +2 -2
@@ -436,7 +436,7 @@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 @@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
hw/realview.c +1 -1
@@ -71,7 +71,7 @@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 ); } }
hw/rtl8139.c +2 -2
@@ -3409,7 +3409,7 @@ }#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 @@ d = (PCIRTL8139State *)pci_register_device (bus,"RTL8139" ,sizeof (PCIRTL8139State), --1 , + devfn,NULL ,NULL ); pci_conf = d->dev.config; pci_conf[0x00 ] =0xec ;/* Realtek 8139 */
hw/sun4u.c +1 -1
@@ -344,7 +344,7 @@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 );
hw/versatilepb.c +1 -1
@@ -188,7 +188,7 @@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) {
vl.h +4 -4
@@ -762,7 +762,7 @@PCIBus *pci_register_bus (pci_set_irq_fn set_irq,pci_map_irq_fn map_irq,void *pic,int devfn_min,int nirq); -void pci_nic_init (PCIBus *bus,NICInfo *nd); +void pci_nic_init (PCIBus *bus,NICInfo *nd,int devfn);void pci_data_write (void *opaque,uint32_t addr,uint32_t val,int len);uint32_t pci_data_read (void *opaque,uint32_t addr,int len);int pci_bus_num (PCIBus *s);
@@ -925,15 +925,15 @@/* ne2000.c */ void isa_ne2000_init (int base,int irq,NICInfo *nd); -void pci_ne2000_init (PCIBus *bus,NICInfo *nd); +void pci_ne2000_init (PCIBus *bus,NICInfo *nd,int devfn);/* rtl8139.c */ -void pci_rtl8139_init (PCIBus *bus,NICInfo *nd); +void pci_rtl8139_init (PCIBus *bus,NICInfo *nd,int devfn);/* pcnet.c */ -void pci_pcnet_init (PCIBus *bus,NICInfo *nd); +void pci_pcnet_init (PCIBus *bus,NICInfo *nd,int devfn);void pcnet_h_reset (void *opaque);void *lance_init (NICInfo *nd,uint32_t leaddr,void *dma_opaque);
Signature · 4 lines
.''`. Aurelien Jarno | GPG: 1024D/F1BCDB73 : :' : Debian developer | Electrical Engineer `. `' [email protected] | [email protected] `- people.debian.org/~aurel32 | www.aurel32.net