1 /* QLogic qede NIC Driver
2 * Copyright (c) 2015 QLogic Corporation
4 * This software is available under the terms of the GNU General Public License
5 * (GPL) Version 2, available from the file COPYING in the main directory of
11 #include <linux/compiler.h>
12 #include <linux/version.h>
13 #include <linux/workqueue.h>
14 #include <linux/netdevice.h>
15 #include <linux/interrupt.h>
16 #include <linux/bitmap.h>
17 #include <linux/kernel.h>
18 #include <linux/mutex.h>
20 #include <linux/qed/common_hsi.h>
21 #include <linux/qed/eth_common.h>
22 #include <linux/qed/qed_if.h>
23 #include <linux/qed/qed_chain.h>
24 #include <linux/qed/qed_eth_if.h>
26 #define QEDE_MAJOR_VERSION 8
27 #define QEDE_MINOR_VERSION 4
28 #define QEDE_REVISION_VERSION 0
29 #define QEDE_ENGINEERING_VERSION 0
30 #define DRV_MODULE_VERSION __stringify(QEDE_MAJOR_VERSION) "." \
31 __stringify(QEDE_MINOR_VERSION) "." \
32 __stringify(QEDE_REVISION_VERSION) "." \
33 __stringify(QEDE_ENGINEERING_VERSION)
35 #define QEDE_ETH_INTERFACE_VERSION 300
37 #define DRV_MODULE_SYM qede
41 struct net_device *ndev;
47 const struct qed_eth_ops *ops;
49 struct qed_dev_eth_info dev_info;
50 #define QEDE_MAX_RSS_CNT(edev) ((edev)->dev_info.num_queues)
51 #define QEDE_MAX_TSS_CNT(edev) ((edev)->dev_info.num_queues * \
52 (edev)->dev_info.num_tc)
56 #define QEDE_RSS_CNT(edev) ((edev)->num_rss)
57 #define QEDE_TSS_CNT(edev) ((edev)->num_rss * \
59 #define QEDE_TSS_IDX(edev, txqidx) ((txqidx) % (edev)->num_rss)
60 #define QEDE_TC_IDX(edev, txqidx) ((txqidx) / (edev)->num_rss)
62 struct qed_int_info int_info;
63 unsigned char primary_mac[ETH_ALEN];
65 /* Smaller private varaiant of the RTNL lock */
66 struct mutex qede_lock;
67 u32 state; /* Protected by qede_lock */
70 /* Debug print definitions */
71 #define DP_NAME(edev) ((edev)->ndev->name)