devargs: restore device type API
[dpdk.git] / lib / librte_eal / common / eal_common_devargs.c
index ff6c2a8..33e9f0a 100644 (file)
@@ -40,6 +40,7 @@
 #include <stdio.h>
 #include <string.h>
 
+#include <rte_dev.h>
 #include <rte_devargs.h>
 #include <rte_tailq.h>
 #include "eal_private.h"
@@ -167,18 +168,20 @@ rte_eal_devargs_add(enum rte_devtype devtype, const char *devargs_str)
                goto fail;
        devargs->type = devtype;
        bus = devargs->bus;
-       if (devargs->type == RTE_DEVTYPE_WHITELISTED) {
+       if (devargs->type == RTE_DEVTYPE_BLACKLISTED_PCI)
+               devargs->policy = RTE_DEV_BLACKLISTED;
+       if (devargs->policy == RTE_DEV_WHITELISTED) {
                if (bus->conf.scan_mode == RTE_BUS_SCAN_UNDEFINED) {
                        bus->conf.scan_mode = RTE_BUS_SCAN_WHITELIST;
                } else if (bus->conf.scan_mode == RTE_BUS_SCAN_BLACKLIST) {
-                       fprintf(stderr, "ERROR: incompatible device type and bus scan mode\n");
+                       fprintf(stderr, "ERROR: incompatible device policy and bus scan mode\n");
                        goto fail;
                }
-       } else if (devargs->type == RTE_DEVTYPE_BLACKLISTED) {
+       } else if (devargs->policy == RTE_DEV_BLACKLISTED) {
                if (bus->conf.scan_mode == RTE_BUS_SCAN_UNDEFINED) {
                        bus->conf.scan_mode = RTE_BUS_SCAN_BLACKLIST;
                } else if (bus->conf.scan_mode == RTE_BUS_SCAN_WHITELIST) {
-                       fprintf(stderr, "ERROR: incompatible device type and bus scan mode\n");
+                       fprintf(stderr, "ERROR: incompatible device policy and bus scan mode\n");
                        goto fail;
                }
        }