Changeset 95c675b in mainline for uspace/drv/nic/rtl8169/driver.c
- Timestamp:
- 2017-10-17T13:11:35Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 60af4cdb
- Parents:
- dbf32b1 (diff), a416d070 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - File:
-
- 1 edited
-
uspace/drv/nic/rtl8169/driver.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/nic/rtl8169/driver.c
rdbf32b1 r95c675b 31 31 #include <align.h> 32 32 #include <byteorder.h> 33 #include <irc.h>34 33 #include <libarch/barrier.h> 35 34 … … 38 37 #include <ddf/log.h> 39 38 #include <ddf/interrupt.h> 39 #include <device/hw_res.h> 40 #include <device/hw_res_parsed.h> 40 41 #include <io/log.h> 41 42 #include <nic.h> 42 43 #include <pci_dev_iface.h> 43 44 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 rc= register_interrupt_handler(nic_get_ddf_dev(nic_data),373 int irq_cap = register_interrupt_handler(nic_get_ddf_dev(nic_data), 374 374 rtl8169->irq, rtl8169_irq_handler, &rtl8169_irq_code); 375 375 376 return rc;376 return irq_cap; 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 398 403 /* Get PCI VID & PID */ 399 rc = pci_config_space_read_16( ddf_dev_parent_sess_get(dev),400 PCI_VENDOR_ID,&rtl8169->pci_vid);404 rc = pci_config_space_read_16(rtl8169->parent_sess, PCI_VENDOR_ID, 405 &rtl8169->pci_vid); 401 406 if (rc != EOK) 402 407 return rc; 403 408 404 rc = pci_config_space_read_16( ddf_dev_parent_sess_get(dev),405 PCI_DEVICE_ID,&rtl8169->pci_pid);409 rc = pci_config_space_read_16(rtl8169->parent_sess, PCI_DEVICE_ID, 410 &rtl8169->pci_pid); 406 411 if (rc != EOK) 407 412 return rc; … … 426 431 goto err_pio; 427 432 428 rc = rtl8169_register_int_handler(nic_data); 429 if (rc != EOK) { 433 int irq_cap = rtl8169_register_int_handler(nic_data); 434 if (irq_cap < 0) { 435 rc = irq_cap; 430 436 ddf_msg(LVL_ERROR, "Failed to register IRQ handler (%d)", rc); 431 437 goto err_irq; 432 433 438 } 434 439 … … 469 474 err_srv: 470 475 /* XXX Disconnect from services */ 476 unregister_interrupt_handler(dev, irq_cap); 471 477 err_irq: 472 //unregister_interrupt_handler(dev, rtl8169->irq);473 478 err_pio: 474 479 err_destroy: … … 745 750 746 751 pio_write_16(rtl8169->regs + IMR, 0xffff); 747 irc_enable_interrupt(rtl8169->irq); 752 /* XXX Check return value */ 753 hw_res_enable_interrupt(rtl8169->parent_sess, rtl8169->irq); 748 754 749 755 return EOK;
Note:
See TracChangeset
for help on using the changeset viewer.
