xref: /dpdk/drivers/common/ionic/ionic_common.h (revision 4610ac932fcbcc6279095e927390bdf877f728ab)
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright 2018-2024 Advanced Micro Devices, Inc.
3  */
4 
5 #ifndef _IONIC_COMMON_H_
6 #define _IONIC_COMMON_H_
7 
8 #include <stdint.h>
9 #include <assert.h>
10 
11 #include <rte_common.h>
12 #include <rte_memory.h>
13 #include <rte_eal_paging.h>
14 
15 #include "ionic_osdep.h"
16 
17 #define IONIC_DEVCMD_TIMEOUT		5	/* devcmd_timeout */
18 #define IONIC_DEVCMD_CHECK_PERIOD_US	10	/* devcmd status chk period */
19 #define IONIC_DEVCMD_RETRY_WAIT_US	20000
20 
21 #define IONIC_Q_WDOG_MS			10	/* 10ms */
22 #define IONIC_Q_WDOG_MAX_MS		5000	/* 5s */
23 #define IONIC_ADMINQ_WDOG_MS		500	/* 500ms */
24 
25 #define IONIC_ALIGN			4096
26 
27 struct ionic_dev_bar {
28 	void __iomem *vaddr;
29 	rte_iova_t bus_addr;
30 	unsigned long len;
31 };
32 
33 __rte_internal
34 void ionic_uio_scan_mnet_devices(void);
35 __rte_internal
36 void ionic_uio_scan_mcrypt_devices(void);
37 
38 __rte_internal
39 void ionic_uio_get_rsrc(const char *name, int idx, struct ionic_dev_bar *bar);
40 __rte_internal
41 void ionic_uio_rel_rsrc(const char *name, int idx, struct ionic_dev_bar *bar);
42 
43 #endif /* _IONIC_COMMON_H_ */
44