Changes in uspace/drv/bus/pci/pciintel/pci.c [6dbc500:e8d6ce2] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/pci/pciintel/pci.c
r6dbc500 re8d6ce2 57 57 #include <ops/hw_res.h> 58 58 #include <device/hw_res.h> 59 #include <ops/pio_window.h>60 #include <device/pio_window.h>61 59 #include <ddi.h> 62 60 #include <pci_dev_iface.h> … … 143 141 } 144 142 145 static pio_window_t *pciintel_get_pio_window(ddf_fun_t *fnode)146 {147 pci_fun_t *fun = pci_fun(fnode);148 149 if (fun == NULL)150 return NULL;151 return &fun->pio_window;152 }153 154 155 143 static int pci_config_space_write_32(ddf_fun_t *fun, uint32_t address, 156 144 uint32_t data) … … 210 198 .get_resource_list = &pciintel_get_resources, 211 199 .enable_interrupt = &pciintel_enable_interrupt, 212 };213 214 static pio_window_ops_t pciintel_pio_window_ops = {215 .get_pio_window = &pciintel_get_pio_window216 200 }; 217 201 … … 227 211 static ddf_dev_ops_t pci_fun_ops = { 228 212 .interfaces[HW_RES_DEV_IFACE] = &pciintel_hw_res_ops, 229 .interfaces[PIO_WINDOW_DEV_IFACE] = &pciintel_pio_window_ops,230 213 .interfaces[PCI_DEV_IFACE] = &pci_dev_ops 231 214 }; … … 569 552 { 570 553 uint8_t irq = pci_conf_read_8(fun, PCI_BRIDGE_INT_LINE); 571 uint8_t pin = pci_conf_read_8(fun, PCI_BRIDGE_INT_PIN); 572 573 if (pin != 0 && irq != 0xff) 554 if (irq != 0xff) 574 555 pci_add_interrupt(fun, irq); 575 556 } … … 634 615 pci_read_bars(fun); 635 616 pci_read_interrupt(fun); 636 637 /* Propagate the PIO window to the function. */638 fun->pio_window = bus->pio_win;639 617 640 618 ddf_fun_set_ops(fun->fnode, &pci_fun_ops); … … 667 645 static int pci_dev_add(ddf_dev_t *dnode) 668 646 { 669 hw_resource_list_t hw_resources;670 647 pci_bus_t *bus = NULL; 671 648 ddf_fun_t *ctl = NULL; … … 693 670 goto fail; 694 671 } 695 696 rc = pio_window_get(sess, &bus->pio_win); 697 if (rc != EOK) { 698 ddf_msg(LVL_ERROR, "pci_dev_add failed to get PIO window " 699 "for the device."); 700 goto fail; 701 } 672 673 hw_resource_list_t hw_resources; 702 674 703 675 rc = hw_res_get_resource_list(sess, &hw_resources); … … 789 761 { 790 762 ddf_log_init(NAME); 763 pci_fun_ops.interfaces[HW_RES_DEV_IFACE] = &pciintel_hw_res_ops; 764 pci_fun_ops.interfaces[PCI_DEV_IFACE] = &pci_dev_ops; 791 765 } 792 766
Note:
See TracChangeset
for help on using the changeset viewer.