Merge branch 'x86-pti-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6-block.git] / drivers / net / ethernet / pensando / ionic / ionic.h
CommitLineData
df69ba43
SN
1/* SPDX-License-Identifier: GPL-2.0 */
2/* Copyright(c) 2017 - 2019 Pensando Systems, Inc */
3
4#ifndef _IONIC_H_
5#define _IONIC_H_
6
6461b446
SN
7struct ionic_lif;
8
fbfb8031
SN
9#include "ionic_if.h"
10#include "ionic_dev.h"
df69ba43
SN
11#include "ionic_devlink.h"
12
13#define IONIC_DRV_NAME "ionic"
14#define IONIC_DRV_DESCRIPTION "Pensando Ethernet NIC Driver"
63ad1cd6 15#define IONIC_DRV_VERSION "0.18.0-k"
df69ba43
SN
16
17#define PCI_VENDOR_ID_PENSANDO 0x1dd8
18
19#define PCI_DEVICE_ID_PENSANDO_IONIC_ETH_PF 0x1002
20#define PCI_DEVICE_ID_PENSANDO_IONIC_ETH_VF 0x1003
21
22#define IONIC_SUBDEV_ID_NAPLES_25 0x4000
23#define IONIC_SUBDEV_ID_NAPLES_100_4 0x4001
24#define IONIC_SUBDEV_ID_NAPLES_100_8 0x4002
25
fbfb8031
SN
26#define DEVCMD_TIMEOUT 10
27
df69ba43
SN
28struct ionic {
29 struct pci_dev *pdev;
30 struct device *dev;
beead698 31 struct devlink_port dl_port;
fbfb8031
SN
32 struct ionic_dev idev;
33 struct mutex dev_cmd_lock; /* lock for dev_cmd operations */
34 struct dentry *dentry;
35 struct ionic_dev_bar bars[IONIC_BARS_MAX];
36 unsigned int num_bars;
37 struct ionic_identity ident;
1a58e196 38 struct list_head lifs;
beead698 39 struct ionic_lif *master_lif;
1a58e196
SN
40 unsigned int nnqs_per_lif;
41 unsigned int neqs_per_lif;
42 unsigned int ntxqs_per_lif;
43 unsigned int nrxqs_per_lif;
44 DECLARE_BITMAP(lifbits, IONIC_LIFS_MAX);
45 unsigned int nintrs;
6461b446 46 DECLARE_BITMAP(intrs, IONIC_INTR_CTRL_REGS_MAX);
1a371ea1
SN
47 struct work_struct nb_work;
48 struct notifier_block nb;
089406bc
SN
49 struct timer_list watchdog_timer;
50 int watchdog_period;
df69ba43
SN
51};
52
938962d5
SN
53struct ionic_admin_ctx {
54 struct completion work;
55 union ionic_adminq_cmd cmd;
56 union ionic_adminq_comp comp;
57};
58
1d062b7b
SN
59int ionic_napi(struct napi_struct *napi, int budget, ionic_cq_cb cb,
60 ionic_cq_done_cb done_cb, void *done_arg);
61
938962d5 62int ionic_adminq_post_wait(struct ionic_lif *lif, struct ionic_admin_ctx *ctx);
fbfb8031
SN
63int ionic_dev_cmd_wait(struct ionic *ionic, unsigned long max_wait);
64int ionic_set_dma_mask(struct ionic *ionic);
65int ionic_setup(struct ionic *ionic);
66
67int ionic_identify(struct ionic *ionic);
68int ionic_init(struct ionic *ionic);
69int ionic_reset(struct ionic *ionic);
70
04436595
SN
71int ionic_port_identify(struct ionic *ionic);
72int ionic_port_init(struct ionic *ionic);
73int ionic_port_reset(struct ionic *ionic);
74
df69ba43 75#endif /* _IONIC_H_ */