1 /* 2 * PCI bus operation test 3 * 4 * Copyright (C) 2016, Red Hat Inc, Alexander Gordeev <agordeev@redhat.com> 5 * 6 * This work is licensed under the terms of the GNU LGPL, version 2. 7 */ 8 #include <libcflat.h> 9 #include <pci.h> 10 11 #define NR_TESTS (PCI_TESTDEV_NUM_BARS * PCI_TESTDEV_NUM_TESTS) 12 13 int main(void) 14 { 15 int ret; 16 17 if (!pci_probe()) { 18 printf("PCI bus probing failed, skipping tests...\n"); 19 return report_summary(); 20 } 21 22 pci_print(); 23 24 ret = pci_testdev(); 25 if (ret == -1) 26 report_skip("No PCI test device"); 27 else 28 report("PCI test device passed %d/%d tests", 29 ret >= NR_TESTS, ret > 0 ? ret : 0, NR_TESTS); 30 31 return report_summary(); 32 } 33