MCPcopy Create free account
hub / github.com/coreboot/coreboot / scan_bus

Function scan_bus

src/device/device.c:377–408  ·  view source on GitHub ↗

* Scan for devices on a bus. * * If there are bridges on the bus, recursively scan the buses behind the * bridges. If the setting up and tuning of the bus causes a reset to be * required, reset the bus and scan it again. * * @param busdev Pointer to the bus device. */

Source from the content-addressed store, hash-verified

375 * @param busdev Pointer to the bus device.
376 */
377static void scan_bus(struct device *busdev)
378{
379 int do_scan_bus;
380 struct stopwatch sw;
381 long scan_time;
382
383 if (!busdev->enabled)
384 return;
385
386 printk(BIOS_DEBUG, "%s scanning...\n", dev_path(busdev));
387
388 post_log_path(busdev);
389
390 stopwatch_init(&sw);
391
392 do_scan_bus = 1;
393 while (do_scan_bus) {
394 struct bus *link = busdev->downstream;
395 busdev->ops->scan_bus(busdev);
396 do_scan_bus = 0;
397 if (!link || !link->reset_needed)
398 continue;
399 if (reset_bus(link))
400 do_scan_bus = 1;
401 else
402 busdev->upstream->reset_needed = 1;
403 }
404
405 scan_time = stopwatch_duration_msecs(&sw);
406 printk(BIOS_DEBUG, "%s: bus %s finished in %ld msecs\n", __func__,
407 dev_path(busdev), scan_time);
408}
409
410void scan_bridges(struct bus *bus)
411{

Callers 2

scan_bridgesFunction · 0.85
dev_enumerateFunction · 0.85

Calls 6

dev_pathFunction · 0.85
post_log_pathFunction · 0.85
stopwatch_initFunction · 0.85
reset_busFunction · 0.85
stopwatch_duration_msecsFunction · 0.85
printkFunction · 0.50

Tested by

no test coverage detected