1 /* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0)
2 * Copyright(c) 2018-2019 Pensando Systems, Inc. All rights reserved.
11 #include <rte_bus_pci.h>
13 #include "ionic_dev.h"
15 #include "ionic_osdep.h"
17 #define IONIC_DRV_NAME "ionic"
18 #define IONIC_DRV_DESCRIPTION "Pensando Ethernet NIC Driver"
19 #define IONIC_DRV_VERSION "0.11.0-49"
22 #define IONIC_PENSANDO_VENDOR_ID 0x1dd8
25 #define IONIC_DEV_ID_ETH_PF 0x1002
26 #define IONIC_DEV_ID_ETH_VF 0x1003
27 #define IONIC_DEV_ID_ETH_MGMT 0x1004
30 IONIC_MAC_UNKNOWN = 0,
35 struct ionic_mac_info {
36 enum ionic_mac_type type;
40 struct ionic_mac_info mac;
46 * Structure to store private data for each driver instance (for each adapter).
48 struct ionic_adapter {
50 struct ionic_dev idev;
51 struct ionic_dev_bar bars[IONIC_BARS_MAX];
52 struct ionic_identity ident;
53 struct ionic_lif *lifs[IONIC_LIFS_MAX];
56 uint32_t max_ntxqs_per_lif;
57 uint32_t max_nrxqs_per_lif;
58 uint32_t max_mac_addrs;
61 bool intrs[IONIC_INTR_CTRL_REGS_MAX];
64 char fw_version[IONIC_DEVINFO_FWVERS_BUFLEN];
65 struct rte_pci_device *pci_dev;
66 LIST_ENTRY(ionic_adapter) pci_adapters;
69 int ionic_adminq_check_err(struct ionic_admin_ctx *ctx, bool timeout);
70 int ionic_adminq_post_wait(struct ionic_lif *lif, struct ionic_admin_ctx *ctx);
71 int ionic_dev_cmd_wait_check(struct ionic_dev *idev, unsigned long max_wait);
72 int ionic_setup(struct ionic_adapter *adapter);
74 int ionic_identify(struct ionic_adapter *adapter);
75 int ionic_init(struct ionic_adapter *adapter);
76 int ionic_reset(struct ionic_adapter *adapter);
78 int ionic_port_identify(struct ionic_adapter *adapter);
79 int ionic_port_init(struct ionic_adapter *adapter);
80 int ionic_port_reset(struct ionic_adapter *adapter);
82 #endif /* _IONIC_H_ */