X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fdevices%2Frtl8139.c;h=18e966a77dbd34f7901c2b9e0c6fda9a014a5023;hb=d597d493eb303496f3bb32e2a73a094a8a20a022;hp=176d05345b2c1f0bbcabff340f7a2a0ccef2af69;hpb=603f73496c7025fc3929f209fd4185627370751c;p=palacios.git diff --git a/palacios/src/devices/rtl8139.c b/palacios/src/devices/rtl8139.c index 176d053..18e966a 100644 --- a/palacios/src/devices/rtl8139.c +++ b/palacios/src/devices/rtl8139.c @@ -582,7 +582,7 @@ static inline void rtl8139_update_irq(struct rtl8139_state * nic_state) { int isr = ((nic_state->regs.isr & nic_state->regs.imr) & 0xffff); if(isr & 0xffff){ - v3_pci_raise_irq(nic_state->pci_bus, 0, nic_state->pci_dev); + v3_pci_raise_irq(nic_state->pci_bus, nic_state->pci_dev, 0); nic_state->statistic.tx_interrupts ++; } } @@ -1713,7 +1713,7 @@ static int register_dev(struct rtl8139_state * nic_state) { } bars[0].type = PCI_BAR_IO; - bars[0].default_base_port = 0xc100; + bars[0].default_base_port = -1; bars[0].num_ports = 0x100; bars[0].io_read = rtl8139_ioport_read; @@ -1732,7 +1732,7 @@ static int register_dev(struct rtl8139_state * nic_state) { pci_dev = v3_pci_register_device(nic_state->pci_bus, PCI_STD_DEVICE, 0, -1, 0, "RTL8139", bars, - NULL, NULL, NULL, nic_state); + NULL, NULL, NULL, NULL, nic_state); if (pci_dev == NULL) { @@ -1806,6 +1806,12 @@ static int rtl8139_init(struct v3_vm_info * vm, v3_cfg_tree_t * cfg) { char * macstr = v3_cfg_val(cfg, "mac"); nic_state = (struct rtl8139_state *)V3_Malloc(sizeof(struct rtl8139_state)); + + if (!nic_state) { + PrintError("Cannot allocate in init\n"); + return -1; + } + memset(nic_state, 0, sizeof(struct rtl8139_state)); nic_state->pci_bus = pci_bus;