1 /* SPDX-License-Identifier: GPL-2.0 */
2 /* Copyright(c) 2017 - 2019 Pensando Systems, Inc */
10 #include "ionic_dev.h"
11 #include "ionic_devlink.h"
13 #define IONIC_DRV_NAME "ionic"
14 #define IONIC_DRV_DESCRIPTION "Pensando Ethernet NIC Driver"
15 #define IONIC_DRV_VERSION "0.20.0-k"
17 #define PCI_VENDOR_ID_PENSANDO 0x1dd8
19 #define PCI_DEVICE_ID_PENSANDO_IONIC_ETH_PF 0x1002
20 #define PCI_DEVICE_ID_PENSANDO_IONIC_ETH_VF 0x1003
22 #define DEVCMD_TIMEOUT 10
33 struct ionic_lif_stats stats;
39 struct devlink_port dl_port;
40 struct ionic_dev idev;
41 struct mutex dev_cmd_lock; /* lock for dev_cmd operations */
42 struct dentry *dentry;
43 struct ionic_dev_bar bars[IONIC_BARS_MAX];
44 unsigned int num_bars;
45 struct ionic_identity ident;
46 struct list_head lifs;
47 struct ionic_lif *master_lif;
48 unsigned int nnqs_per_lif;
49 unsigned int neqs_per_lif;
50 unsigned int ntxqs_per_lif;
51 unsigned int nrxqs_per_lif;
52 DECLARE_BITMAP(lifbits, IONIC_LIFS_MAX);
54 DECLARE_BITMAP(intrs, IONIC_INTR_CTRL_REGS_MAX);
55 struct work_struct nb_work;
56 struct notifier_block nb;
57 struct rw_semaphore vf_op_lock; /* lock for VF operations */
60 struct timer_list watchdog_timer;
64 struct ionic_admin_ctx {
65 struct completion work;
66 union ionic_adminq_cmd cmd;
67 union ionic_adminq_comp comp;
70 int ionic_napi(struct napi_struct *napi, int budget, ionic_cq_cb cb,
71 ionic_cq_done_cb done_cb, void *done_arg);
73 int ionic_adminq_post_wait(struct ionic_lif *lif, struct ionic_admin_ctx *ctx);
74 int ionic_dev_cmd_wait(struct ionic *ionic, unsigned long max_wait);
75 int ionic_set_dma_mask(struct ionic *ionic);
76 int ionic_setup(struct ionic *ionic);
78 int ionic_identify(struct ionic *ionic);
79 int ionic_init(struct ionic *ionic);
80 int ionic_reset(struct ionic *ionic);
82 int ionic_port_identify(struct ionic *ionic);
83 int ionic_port_init(struct ionic *ionic);
84 int ionic_port_reset(struct ionic *ionic);
86 #endif /* _IONIC_H_ */