summaryrefslogtreecommitdiff
path: root/drivers/common/ionic/ionic_common.h
blob: c4a15fdf2b19e6a2cd7748efd4537afe69d316a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/* SPDX-License-Identifier: BSD-3-Clause
 * Copyright 2018-2024 Advanced Micro Devices, Inc.
 */

#ifndef _IONIC_COMMON_H_
#define _IONIC_COMMON_H_

#include <stdint.h>
#include <assert.h>

#include <rte_common.h>
#include <rte_memory.h>
#include <rte_eal_paging.h>

#include "ionic_osdep.h"

#define IONIC_DEVCMD_TIMEOUT		5	/* devcmd_timeout */
#define IONIC_DEVCMD_CHECK_PERIOD_US	10	/* devcmd status chk period */
#define IONIC_DEVCMD_RETRY_WAIT_US	20000

#define IONIC_Q_WDOG_MS			10	/* 10ms */
#define IONIC_Q_WDOG_MAX_MS		5000	/* 5s */
#define IONIC_ADMINQ_WDOG_MS		500	/* 500ms */

#define IONIC_ALIGN			4096

struct ionic_dev_bar {
	void __iomem *vaddr;
	rte_iova_t bus_addr;
	unsigned long len;
};

__rte_internal
void ionic_uio_scan_mnet_devices(void);
__rte_internal
void ionic_uio_scan_mcrypt_devices(void);

__rte_internal
void ionic_uio_get_rsrc(const char *name, int idx, struct ionic_dev_bar *bar);
__rte_internal
void ionic_uio_rel_rsrc(const char *name, int idx, struct ionic_dev_bar *bar);

#endif /* _IONIC_COMMON_H_ */