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 7fbfb8031SShannon Nelson #include "ionic_if.h" 8fbfb8031SShannon Nelson #include "ionic_dev.h" 9df69ba43SShannon Nelson #include "ionic_devlink.h" 10df69ba43SShannon Nelson 11df69ba43SShannon Nelson #define IONIC_DRV_NAME "ionic" 12df69ba43SShannon Nelson #define IONIC_DRV_DESCRIPTION "Pensando Ethernet NIC Driver" 13df69ba43SShannon Nelson #define IONIC_DRV_VERSION "0.15.0-k" 14df69ba43SShannon Nelson 15df69ba43SShannon Nelson #define PCI_VENDOR_ID_PENSANDO 0x1dd8 16df69ba43SShannon Nelson 17df69ba43SShannon Nelson #define PCI_DEVICE_ID_PENSANDO_IONIC_ETH_PF 0x1002 18df69ba43SShannon Nelson #define PCI_DEVICE_ID_PENSANDO_IONIC_ETH_VF 0x1003 19df69ba43SShannon Nelson 20df69ba43SShannon Nelson #define IONIC_SUBDEV_ID_NAPLES_25 0x4000 21df69ba43SShannon Nelson #define IONIC_SUBDEV_ID_NAPLES_100_4 0x4001 22df69ba43SShannon Nelson #define IONIC_SUBDEV_ID_NAPLES_100_8 0x4002 23df69ba43SShannon Nelson 24fbfb8031SShannon Nelson #define DEVCMD_TIMEOUT 10 25fbfb8031SShannon Nelson 26df69ba43SShannon Nelson struct ionic { 27df69ba43SShannon Nelson struct pci_dev *pdev; 28df69ba43SShannon Nelson struct device *dev; 29fbfb8031SShannon Nelson struct ionic_dev idev; 30fbfb8031SShannon Nelson struct mutex dev_cmd_lock; /* lock for dev_cmd operations */ 31fbfb8031SShannon Nelson struct dentry *dentry; 32fbfb8031SShannon Nelson struct ionic_dev_bar bars[IONIC_BARS_MAX]; 33fbfb8031SShannon Nelson unsigned int num_bars; 34fbfb8031SShannon Nelson struct ionic_identity ident; 35*1a58e196SShannon Nelson struct list_head lifs; 36*1a58e196SShannon Nelson unsigned int nnqs_per_lif; 37*1a58e196SShannon Nelson unsigned int neqs_per_lif; 38*1a58e196SShannon Nelson unsigned int ntxqs_per_lif; 39*1a58e196SShannon Nelson unsigned int nrxqs_per_lif; 40*1a58e196SShannon Nelson DECLARE_BITMAP(lifbits, IONIC_LIFS_MAX); 41*1a58e196SShannon Nelson unsigned int nintrs; 42df69ba43SShannon Nelson }; 43df69ba43SShannon Nelson 44fbfb8031SShannon Nelson int ionic_dev_cmd_wait(struct ionic *ionic, unsigned long max_wait); 45fbfb8031SShannon Nelson int ionic_set_dma_mask(struct ionic *ionic); 46fbfb8031SShannon Nelson int ionic_setup(struct ionic *ionic); 47fbfb8031SShannon Nelson 48fbfb8031SShannon Nelson int ionic_identify(struct ionic *ionic); 49fbfb8031SShannon Nelson int ionic_init(struct ionic *ionic); 50fbfb8031SShannon Nelson int ionic_reset(struct ionic *ionic); 51fbfb8031SShannon Nelson 5204436595SShannon Nelson int ionic_port_identify(struct ionic *ionic); 5304436595SShannon Nelson int ionic_port_init(struct ionic *ionic); 5404436595SShannon Nelson int ionic_port_reset(struct ionic *ionic); 5504436595SShannon Nelson 56df69ba43SShannon Nelson #endif /* _IONIC_H_ */ 57