const struct rte_dpaa2_device *dev2)
{
/*not the same family device */
- if (dev->dev_type != DPAA2_MC_DPNI_DEVID ||
- dev->dev_type != DPAA2_MC_DPSECI_DEVID)
+ if (dev->dev_type != DPAA2_ETH ||
+ dev->dev_type != DPAA2_CRYPTO)
return -1;
if (dev->object_id == dev2->object_id)
/* store hw_id of dpni/dpseci device */
dev->object_id = object_id;
dev->dev_type = (strcmp(object_type, "dpseci")) ?
- DPAA2_MC_DPNI_DEVID : DPAA2_MC_DPSECI_DEVID;
+ DPAA2_ETH : DPAA2_CRYPTO;
sprintf(dev->name, "%s.%d", object_type, object_id);
dev->device.name = dev->name;
#include <rte_dev.h>
#include <rte_bus.h>
+#define FSLMC_OBJECT_MAX_LEN 32 /**< Length of each device on bus */
+
struct rte_dpaa2_driver;
/* DPAA2 Device and Driver lists for FSLMC bus */
extern struct rte_fslmc_bus rte_fslmc_bus;
+enum rte_dpaa2_dev_type {
+ /* Devices backed by DPDK driver */
+ DPAA2_ETH, /**< DPNI type device*/
+ DPAA2_CRYPTO, /**< DPSECI type device */
+ DPAA2_CON, /**< DPCONC type device */
+ /* Devices not backed by a DPDK driver: DPIO, DPBP, DPCI, DPMCP */
+ DPAA2_BPOOL, /**< DPBP type device */
+ DPAA2_IO, /**< DPIO type device */
+ DPAA2_CI, /**< DPCI type device */
+ DPAA2_MPORTAL, /**< DPMCP type device */
+ /* Unknown device placeholder */
+ DPAA2_UNKNOWN
+};
+
/**
* A structure describing a DPAA2 device.
*/
struct rte_eth_dev *eth_dev; /**< ethernet device */
struct rte_cryptodev *cryptodev; /**< Crypto Device */
};
- uint16_t dev_type; /**< Device Type */
- uint16_t object_id; /**< DPAA2 Object ID */
+ enum rte_dpaa2_dev_type dev_type; /**< Device Type */
+ uint16_t object_id; /**< DPAA2 Object ID */
struct rte_intr_handle intr_handle; /**< Interrupt handle */
struct rte_dpaa2_driver *driver; /**< Associated driver */
- char name[32]; /**< DPAA2 Object name*/
+ char name[FSLMC_OBJECT_MAX_LEN]; /**< DPAA2 Object name*/
};
typedef int (*rte_dpaa2_probe_t)(struct rte_dpaa2_driver *dpaa2_drv,
struct rte_driver driver; /**< Inherit core driver. */
struct rte_fslmc_bus *fslmc_bus; /**< FSLMC bus reference */
uint32_t drv_flags; /**< Flags for controlling device.*/
- uint16_t drv_type; /**< Driver Type */
+ enum rte_dpaa2_dev_type drv_type; /**< Driver Type */
rte_dpaa2_probe_t probe;
rte_dpaa2_remove_t remove;
};