a75e420c64bcfd850c8798bc637703ffdc1ac885
[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         char name[IONIC_LIF_NAME_MAX_SZ];
28         uint32_t info_sz;
29         struct ionic_lif_info *info;
30         rte_iova_t info_pa;
31         const struct rte_memzone *info_z;
32 };
33
34 int ionic_lif_identify(struct ionic_adapter *adapter);
35 int ionic_lifs_size(struct ionic_adapter *ionic);
36
37 int ionic_lif_alloc(struct ionic_lif *lif);
38 void ionic_lif_free(struct ionic_lif *lif);
39
40 int ionic_lif_init(struct ionic_lif *lif);
41 void ionic_lif_deinit(struct ionic_lif *lif);
42
43 int ionic_lif_start(struct ionic_lif *lif);
44
45 int ionic_lif_configure(struct ionic_lif *lif);
46 void ionic_lif_reset(struct ionic_lif *lif);
47
48 #endif /* _IONIC_LIF_H_ */