net/ionic: add doorbells
[dpdk.git] / drivers / net / ionic / ionic_lif.h
1 /* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0)
2  * Copyright(c) 2018-2019 Pensando Systems, Inc. All rights reserved.
3  */
4
5 #ifndef _IONIC_LIF_H_
6 #define _IONIC_LIF_H_
7
8 #include <inttypes.h>
9
10 #include <rte_ethdev.h>
11 #include <rte_ether.h>
12
13 #include "ionic_osdep.h"
14 #include "ionic_dev.h"
15
16 #define IONIC_LIF_F_INITED              BIT(0)
17
18 #define IONIC_LIF_NAME_MAX_SZ           (32)
19
20 struct ionic_lif {
21         struct ionic_adapter *adapter;
22         struct rte_eth_dev *eth_dev;
23         uint16_t port_id;  /**< Device port identifier */
24         uint32_t index;
25         uint32_t hw_index;
26         uint32_t state;
27         uint32_t kern_pid;
28         struct ionic_doorbell __iomem *kern_dbpage;
29         char name[IONIC_LIF_NAME_MAX_SZ];
30         uint32_t info_sz;
31         struct ionic_lif_info *info;
32         rte_iova_t info_pa;
33         const struct rte_memzone *info_z;
34 };
35
36 int ionic_lif_identify(struct ionic_adapter *adapter);
37 int ionic_lifs_size(struct ionic_adapter *ionic);
38
39 int ionic_lif_alloc(struct ionic_lif *lif);
40 void ionic_lif_free(struct ionic_lif *lif);
41
42 int ionic_lif_init(struct ionic_lif *lif);
43 void ionic_lif_deinit(struct ionic_lif *lif);
44
45 int ionic_lif_start(struct ionic_lif *lif);
46
47 int ionic_lif_configure(struct ionic_lif *lif);
48 void ionic_lif_reset(struct ionic_lif *lif);
49
50 #endif /* _IONIC_LIF_H_ */