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;
52 struct ionic_dev_bar bars[IONIC_BARS_MAX];
53 struct ionic_identity ident;
54 struct ionic_lif *lif;
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];
63 char fw_version[IONIC_DEVINFO_FWVERS_BUFLEN];
64 struct rte_pci_device *pci_dev;
65 LIST_ENTRY(ionic_adapter) pci_adapters;
68 /** ionic_admin_ctx - Admin command context.
69 * @pending_work: Flag that indicates a completion.
70 * @cmd: Admin command (64B) to be copied to the queue.
71 * @comp: Admin completion (16B) copied from the queue.
73 struct ionic_admin_ctx {
75 union ionic_adminq_cmd cmd;
76 union ionic_adminq_comp comp;
79 int ionic_adminq_post_wait(struct ionic_lif *lif, struct ionic_admin_ctx *ctx);
81 int ionic_dev_cmd_wait_check(struct ionic_dev *idev, unsigned long max_wait);
82 int ionic_setup(struct ionic_adapter *adapter);
84 int ionic_identify(struct ionic_adapter *adapter);
85 int ionic_init(struct ionic_adapter *adapter);
86 int ionic_reset(struct ionic_adapter *adapter);
88 int ionic_port_identify(struct ionic_adapter *adapter);
89 int ionic_port_init(struct ionic_adapter *adapter);
90 int ionic_port_reset(struct ionic_adapter *adapter);
92 #endif /* _IONIC_H_ */