xref: /linux/drivers/net/ethernet/pensando/ionic/ionic.h (revision 6461b446f2a0f40c038f1d09c69d1e5565a84a43)
1df69ba43SShannon Nelson /* SPDX-License-Identifier: GPL-2.0 */
2df69ba43SShannon Nelson /* Copyright(c) 2017 - 2019 Pensando Systems, Inc */
3df69ba43SShannon Nelson 
4df69ba43SShannon Nelson #ifndef _IONIC_H_
5df69ba43SShannon Nelson #define _IONIC_H_
6df69ba43SShannon Nelson 
7*6461b446SShannon Nelson struct ionic_lif;
8*6461b446SShannon Nelson 
9fbfb8031SShannon Nelson #include "ionic_if.h"
10fbfb8031SShannon Nelson #include "ionic_dev.h"
11df69ba43SShannon Nelson #include "ionic_devlink.h"
12df69ba43SShannon Nelson 
13df69ba43SShannon Nelson #define IONIC_DRV_NAME		"ionic"
14df69ba43SShannon Nelson #define IONIC_DRV_DESCRIPTION	"Pensando Ethernet NIC Driver"
15df69ba43SShannon Nelson #define IONIC_DRV_VERSION	"0.15.0-k"
16df69ba43SShannon Nelson 
17df69ba43SShannon Nelson #define PCI_VENDOR_ID_PENSANDO			0x1dd8
18df69ba43SShannon Nelson 
19df69ba43SShannon Nelson #define PCI_DEVICE_ID_PENSANDO_IONIC_ETH_PF	0x1002
20df69ba43SShannon Nelson #define PCI_DEVICE_ID_PENSANDO_IONIC_ETH_VF	0x1003
21df69ba43SShannon Nelson 
22df69ba43SShannon Nelson #define IONIC_SUBDEV_ID_NAPLES_25	0x4000
23df69ba43SShannon Nelson #define IONIC_SUBDEV_ID_NAPLES_100_4	0x4001
24df69ba43SShannon Nelson #define IONIC_SUBDEV_ID_NAPLES_100_8	0x4002
25df69ba43SShannon Nelson 
26fbfb8031SShannon Nelson #define DEVCMD_TIMEOUT  10
27fbfb8031SShannon Nelson 
28df69ba43SShannon Nelson struct ionic {
29df69ba43SShannon Nelson 	struct pci_dev *pdev;
30df69ba43SShannon Nelson 	struct device *dev;
31fbfb8031SShannon Nelson 	struct ionic_dev idev;
32fbfb8031SShannon Nelson 	struct mutex dev_cmd_lock;	/* lock for dev_cmd operations */
33fbfb8031SShannon Nelson 	struct dentry *dentry;
34fbfb8031SShannon Nelson 	struct ionic_dev_bar bars[IONIC_BARS_MAX];
35fbfb8031SShannon Nelson 	unsigned int num_bars;
36fbfb8031SShannon Nelson 	struct ionic_identity ident;
371a58e196SShannon Nelson 	struct list_head lifs;
381a58e196SShannon Nelson 	unsigned int nnqs_per_lif;
391a58e196SShannon Nelson 	unsigned int neqs_per_lif;
401a58e196SShannon Nelson 	unsigned int ntxqs_per_lif;
411a58e196SShannon Nelson 	unsigned int nrxqs_per_lif;
421a58e196SShannon Nelson 	DECLARE_BITMAP(lifbits, IONIC_LIFS_MAX);
431a58e196SShannon Nelson 	unsigned int nintrs;
44*6461b446SShannon Nelson 	DECLARE_BITMAP(intrs, IONIC_INTR_CTRL_REGS_MAX);
45df69ba43SShannon Nelson };
46df69ba43SShannon Nelson 
47fbfb8031SShannon Nelson int ionic_dev_cmd_wait(struct ionic *ionic, unsigned long max_wait);
48fbfb8031SShannon Nelson int ionic_set_dma_mask(struct ionic *ionic);
49fbfb8031SShannon Nelson int ionic_setup(struct ionic *ionic);
50fbfb8031SShannon Nelson 
51fbfb8031SShannon Nelson int ionic_identify(struct ionic *ionic);
52fbfb8031SShannon Nelson int ionic_init(struct ionic *ionic);
53fbfb8031SShannon Nelson int ionic_reset(struct ionic *ionic);
54fbfb8031SShannon Nelson 
5504436595SShannon Nelson int ionic_port_identify(struct ionic *ionic);
5604436595SShannon Nelson int ionic_port_init(struct ionic *ionic);
5704436595SShannon Nelson int ionic_port_reset(struct ionic *ionic);
5804436595SShannon Nelson 
59df69ba43SShannon Nelson #endif /* _IONIC_H_ */
60