Changes in uspace/drv/nic/rtl8169/driver.c [d51838f:582a0b8] in mainline
- File:
-
- 1 edited
-
uspace/drv/nic/rtl8169/driver.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/nic/rtl8169/driver.c
rd51838f r582a0b8 31 31 #include <align.h> 32 32 #include <byteorder.h> 33 #include <irc.h> 33 34 #include <libarch/barrier.h> 34 35 … … 37 38 #include <ddf/log.h> 38 39 #include <ddf/interrupt.h> 39 #include <device/hw_res.h>40 #include <device/hw_res_parsed.h>41 40 #include <io/log.h> 42 41 #include <nic.h> 43 42 #include <pci_dev_iface.h> 44 43 44 #include <ipc/irc.h> 45 45 #include <sysinfo.h> 46 46 #include <ipc/ns.h> … … 371 371 rtl8169_irq_code.cmds[2].addr = rtl8169->regs + ISR; 372 372 rtl8169_irq_code.cmds[3].addr = rtl8169->regs + IMR; 373 int irq_cap= register_interrupt_handler(nic_get_ddf_dev(nic_data),373 int rc = register_interrupt_handler(nic_get_ddf_dev(nic_data), 374 374 rtl8169->irq, rtl8169_irq_handler, &rtl8169_irq_code); 375 375 376 return irq_cap;376 return rc; 377 377 } 378 378 … … 396 396 rtl8169_t *rtl8169 = nic_get_specific(nic_data); 397 397 398 rtl8169->dev = dev;399 rtl8169->parent_sess = ddf_dev_parent_sess_get(dev);400 if (rtl8169->parent_sess == NULL)401 return EIO;402 403 398 /* Get PCI VID & PID */ 404 rc = pci_config_space_read_16( rtl8169->parent_sess, PCI_VENDOR_ID,405 &rtl8169->pci_vid);399 rc = pci_config_space_read_16(ddf_dev_parent_sess_get(dev), 400 PCI_VENDOR_ID, &rtl8169->pci_vid); 406 401 if (rc != EOK) 407 402 return rc; 408 403 409 rc = pci_config_space_read_16( rtl8169->parent_sess, PCI_DEVICE_ID,410 &rtl8169->pci_pid);404 rc = pci_config_space_read_16(ddf_dev_parent_sess_get(dev), 405 PCI_DEVICE_ID, &rtl8169->pci_pid); 411 406 if (rc != EOK) 412 407 return rc; … … 431 426 goto err_pio; 432 427 433 int irq_cap = rtl8169_register_int_handler(nic_data); 434 if (irq_cap < 0) { 435 rc = irq_cap; 428 rc = rtl8169_register_int_handler(nic_data); 429 if (rc != EOK) { 436 430 ddf_msg(LVL_ERROR, "Failed to register IRQ handler (%d)", rc); 437 431 goto err_irq; 432 438 433 } 439 434 … … 474 469 err_srv: 475 470 /* XXX Disconnect from services */ 476 unregister_interrupt_handler(dev, irq_cap);477 471 err_irq: 472 //unregister_interrupt_handler(dev, rtl8169->irq); 478 473 err_pio: 479 474 err_destroy: … … 750 745 751 746 pio_write_16(rtl8169->regs + IMR, 0xffff); 752 /* XXX Check return value */ 753 hw_res_enable_interrupt(rtl8169->parent_sess, rtl8169->irq); 747 irc_enable_interrupt(rtl8169->irq); 754 748 755 749 return EOK;
Note:
See TracChangeset
for help on using the changeset viewer.
