eal: remove useless PCI id header inclusions
[dpdk.git] / lib / librte_eal / bsdapp / eal / eal_pci.c
index 761c2f3..524c153 100644 (file)
@@ -67,7 +67,6 @@
 #include <rte_debug.h>
 #include <rte_devargs.h>
 
-#include "rte_pci_dev_ids.h"
 #include "eal_filesystem.h"
 #include "eal_private.h"
 
@@ -92,6 +91,45 @@ pci_unbind_kernel_driver(struct rte_pci_device *dev __rte_unused)
        return -ENOTSUP;
 }
 
+/* Map pci device */
+int
+pci_map_device(struct rte_pci_device *dev)
+{
+       int ret = -1;
+
+       /* try mapping the NIC resources */
+       switch (dev->kdrv) {
+       case RTE_KDRV_NIC_UIO:
+               /* map resources for devices that use uio */
+               ret = pci_uio_map_resource(dev);
+               break;
+       default:
+               RTE_LOG(DEBUG, EAL,
+                       "  Not managed by a supported kernel driver, skipped\n");
+               ret = 1;
+               break;
+       }
+
+       return ret;
+}
+
+/* Unmap pci device */
+void
+pci_unmap_device(struct rte_pci_device *dev)
+{
+       /* try unmapping the NIC resources */
+       switch (dev->kdrv) {
+       case RTE_KDRV_NIC_UIO:
+               /* unmap resources for devices that use uio */
+               pci_uio_unmap_resource(dev);
+               break;
+       default:
+               RTE_LOG(DEBUG, EAL,
+                       "  Not managed by a supported kernel driver, skipped\n");
+               break;
+       }
+}
+
 void
 pci_uio_free_resource(struct rte_pci_device *dev,
                struct mapped_pci_resource *uio_res)
@@ -312,8 +350,8 @@ skipdev:
  * Scan the content of the PCI bus, and add the devices in the devices
  * list. Call pci_scan_one() for each pci entry found.
  */
-static int
-pci_scan(void)
+int
+rte_eal_pci_scan(void)
 {
        int fd;
        unsigned dev_count = 0;
@@ -369,7 +407,7 @@ rte_eal_pci_init(void)
        if (internal_config.no_pci)
                return 0;
 
-       if (pci_scan() < 0) {
+       if (rte_eal_pci_scan() < 0) {
                RTE_LOG(ERR, EAL, "%s(): Cannot scan PCI bus\n", __func__);
                return -1;
        }