Changes in uspace/drv/bus/pci/pciintel/pci.c [92d5279:d51838f] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/pci/pciintel/pci.c
r92d5279 rd51838f 99 99 } 100 100 101 static bool pciintel_enable_interrupt(ddf_fun_t *fnode) 102 { 103 /* This is an old ugly way */ 104 assert(fnode); 105 pci_fun_t *dev_data = pci_fun(fnode); 106 107 size_t i = 0; 108 hw_resource_list_t *res = &dev_data->hw_resources; 109 for (; i < res->count; i++) { 110 if (res->resources[i].type == INTERRUPT) { 111 int rc = irc_enable_interrupt( 112 res->resources[i].res.interrupt.irq); 113 114 if (rc != EOK) 115 return false; 101 static int pciintel_fun_owns_interrupt(pci_fun_t *fun, int irq) 102 { 103 size_t i; 104 hw_resource_list_t *res = &fun->hw_resources; 105 106 for (i = 0; i < res->count; i++) { 107 if (res->resources[i].type == INTERRUPT && 108 res->resources[i].res.interrupt.irq == irq) { 109 return true; 116 110 } 117 111 } 118 112 119 return true; 113 return false; 114 } 115 116 static int pciintel_enable_interrupt(ddf_fun_t *fnode, int irq) 117 { 118 pci_fun_t *fun = pci_fun(fnode); 119 120 if (!pciintel_fun_owns_interrupt(fun, irq)) 121 return EINVAL; 122 123 return irc_enable_interrupt(irq); 124 } 125 126 static int pciintel_disable_interrupt(ddf_fun_t *fnode, int irq) 127 { 128 pci_fun_t *fun = pci_fun(fnode); 129 130 if (!pciintel_fun_owns_interrupt(fun, irq)) 131 return EINVAL; 132 133 return irc_disable_interrupt(irq); 134 } 135 136 static int pciintel_clear_interrupt(ddf_fun_t *fnode, int irq) 137 { 138 pci_fun_t *fun = pci_fun(fnode); 139 140 if (!pciintel_fun_owns_interrupt(fun, irq)) 141 return EINVAL; 142 143 return irc_clear_interrupt(irq); 120 144 } 121 145 … … 187 211 .get_resource_list = &pciintel_get_resources, 188 212 .enable_interrupt = &pciintel_enable_interrupt, 213 .disable_interrupt = &pciintel_disable_interrupt, 214 .clear_interrupt = &pciintel_clear_interrupt, 189 215 }; 190 216 … … 683 709 bus->dnode = dnode; 684 710 685 sess = ddf_dev_parent_sess_ create(dnode);711 sess = ddf_dev_parent_sess_get(dnode); 686 712 if (sess == NULL) { 687 713 ddf_msg(LVL_ERROR, "pci_dev_add failed to connect to the "
Note:
See TracChangeset
for help on using the changeset viewer.