Lines Matching +full:opt +full:- +full:in
5 * SPDX-License-Identifier: Apache-2.0
38 /* functions documented in drivers/pcie/pcie.h */
108 * @param bar_index 0-based BAR index
201 &bar->phys_addr)) { in pcie_get_bar()
205 bar->phys_addr = PCIE_CONF_BAR_ADDR(phys_addr); in pcie_get_bar()
207 bar->size = size & ~(size-1); in pcie_get_bar()
222 * are order-preserving with respect to the endpoint BARs: e.g., index 0
223 * will return the lowest-numbered BAR on the endpoint.
226 * @param index (0-based) index
239 (index > 0) && (reg <= PCIE_CONF_BAR5); reg++, index--) { in pcie_probe_bar()
251 return pcie_get_bar(bdf, reg - PCIE_CONF_BAR0, bar, io); in pcie_probe_bar()
296 /* In some platforms, PCI interrupts are hardwired to specific interrupt inputs in pcie_alloc_irq()
371 static bool scan_flag(const struct pcie_scan_opt *opt, uint32_t flag) in scan_flag() argument
373 return ((opt->flags & flag) != 0U); in scan_flag()
377 static bool scan_bus(uint8_t bus, const struct pcie_scan_opt *opt);
379 static bool scan_dev(uint8_t bus, uint8_t dev, const struct pcie_scan_opt *opt) in scan_dev() argument
398 if (scan_flag(opt, PCIE_SCAN_RECURSIVE)) { in scan_dev()
405 do_cb = scan_flag(opt, PCIE_SCAN_CB_ALL); in scan_dev()
409 if (do_cb && !opt->cb(bdf, id, opt->cb_data)) { in scan_dev()
413 if (scan_flag(opt, PCIE_SCAN_RECURSIVE) && secondary != 0) { in scan_dev()
414 if (!scan_bus(secondary, opt)) { in scan_dev()
419 /* Only function 0 is valid for non-multifunction devices */ in scan_dev()
428 static bool scan_bus(uint8_t bus, const struct pcie_scan_opt *opt) in scan_bus() argument
431 if (!scan_dev(bus, dev, opt)) { in scan_bus()
439 int pcie_scan(const struct pcie_scan_opt *opt) in pcie_scan() argument
444 CHECKIF(opt->cb == NULL) { in pcie_scan()
445 return -EINVAL; in pcie_scan()
450 if (opt->bus == 0 && scan_flag(opt, PCIE_SCAN_RECURSIVE) && multi) { in pcie_scan()
459 if (!scan_bus(bus, opt)) { in pcie_scan()
465 scan_bus(opt->bus, opt); in pcie_scan()
481 if (dev->bdf != PCIE_BDF_NONE) { in pcie_dev_cb()
485 if (dev->id != id) { in pcie_dev_cb()
491 if (dev->class_rev == (class_rev & dev->class_rev_mask)) { in pcie_dev_cb()
492 dev->bdf = bdf; in pcie_dev_cb()
493 dev->class_rev = class_rev; in pcie_dev_cb()
494 data->found++; in pcie_dev_cb()
500 return (data->found != data->max_dev); in pcie_dev_cb()
506 struct pcie_scan_opt opt = { in pcie_init() local
524 __ASSERT(ret == -ENOENT, "Error retrieve interrupt routing table!"); in pcie_init()
536 pcie_scan(&opt); in pcie_init()