1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(C) 2020 Broadcom.
6 #ifndef _BCMFS_DEVICE_H_
7 #define _BCMFS_DEVICE_H_
11 #include <rte_spinlock.h>
12 #include <rte_bus_vdev.h>
14 #include "bcmfs_logs.h"
17 /* max number of dev nodes */
18 #define BCMFS_MAX_NODES 4
19 #define BCMFS_MAX_PATH_LEN 512
20 #define BCMFS_DEV_NAME_LEN 64
22 /* Path for BCM-Platform device directory */
23 #define SYSFS_BCM_PLTFORM_DEVICES "/sys/bus/platform/devices"
25 #define BCMFS_SYM_FS4_VERSION 0x76303031
26 #define BCMFS_SYM_FS5_VERSION 0x76303032
28 /* Supported devices */
29 enum bcmfs_device_type {
35 /* A table to store registered queue pair operations */
36 struct bcmfs_hw_queue_pair_ops_table {
38 /* Number of used ops structs in the table. */
40 /* Storage for all possible ops structs. */
41 struct bcmfs_hw_queue_pair_ops qp_ops[BCMFS_MAX_NODES];
44 /* HW queue pair ops register function */
46 bcmfs_hw_queue_pair_register_ops(const struct bcmfs_hw_queue_pair_ops *qp_ops);
49 TAILQ_ENTRY(bcmfs_device) next;
50 /* Directory path for vfio */
51 char dirname[BCMFS_MAX_PATH_LEN];
52 /* BCMFS device name */
53 char name[BCMFS_DEV_NAME_LEN];
55 struct rte_vdev_device *vdev;
62 /* max number of h/w queue pairs detected */
64 /* current qpairs in use */
65 struct bcmfs_qp *qps_in_use[BCMFS_MAX_HW_QUEUES];
66 /* queue pair ops exported by symmetric crypto hw */
67 struct bcmfs_hw_queue_pair_ops *sym_hw_qp_ops;
68 /* a cryptodevice attached to bcmfs device */
69 struct rte_cryptodev *cdev;
70 /* a rte_device to register with cryptodev */
71 struct rte_device sym_rte_dev;
72 /* private info to keep with cryptodev */
73 struct bcmfs_sym_dev_private *sym_dev;
76 #endif /* _BCMFS_DEVICE_H_ */