summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/wangxun/ngbe/ngbe.h
blob: af147ca8605c5e934efea16480ee2e07ed510e07 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/* SPDX-License-Identifier: GPL-2.0 */
/* Copyright (c) 2019 - 2022 Beijing WangXun Technology Co., Ltd. */

#ifndef _NGBE_H_
#define _NGBE_H_

#include "ngbe_type.h"

#define NGBE_MAX_FDIR_INDICES		7

#define NGBE_MAX_RX_QUEUES		(NGBE_MAX_FDIR_INDICES + 1)
#define NGBE_MAX_TX_QUEUES		(NGBE_MAX_FDIR_INDICES + 1)

#define NGBE_ETH_LENGTH_OF_ADDRESS	6
#define NGBE_MAX_MSIX_VECTORS		0x09
#define NGBE_RAR_ENTRIES		32

/* TX/RX descriptor defines */
#define NGBE_DEFAULT_TXD		512 /* default ring size */
#define NGBE_DEFAULT_TX_WORK		256
#define NGBE_MAX_TXD			8192
#define NGBE_MIN_TXD			128

#define NGBE_DEFAULT_RXD		512 /* default ring size */
#define NGBE_DEFAULT_RX_WORK		256
#define NGBE_MAX_RXD			8192
#define NGBE_MIN_RXD			128

#define NGBE_MAC_STATE_DEFAULT		0x1
#define NGBE_MAC_STATE_MODIFIED		0x2
#define NGBE_MAC_STATE_IN_USE		0x4

struct ngbe_mac_addr {
	u8 addr[ETH_ALEN];
	u16 state; /* bitmask */
	u64 pools;
};

/* board specific private data structure */
struct ngbe_adapter {
	u8 __iomem *io_addr;    /* Mainly for iounmap use */
	/* OS defined structs */
	struct net_device *netdev;
	struct pci_dev *pdev;

	/* structs defined in ngbe_hw.h */
	struct ngbe_hw hw;
	struct ngbe_mac_addr *mac_table;
	u16 msg_enable;

	/* Tx fast path data */
	int num_tx_queues;
	u16 tx_itr_setting;
	u16 tx_work_limit;

	/* Rx fast path data */
	int num_rx_queues;
	u16 rx_itr_setting;
	u16 rx_work_limit;

	int num_q_vectors;      /* current number of q_vectors for device */
	int max_q_vectors;      /* upper limit of q_vectors for device */

	u32 tx_ring_count;
	u32 rx_ring_count;

#define NGBE_MAX_RETA_ENTRIES 128
	u8 rss_indir_tbl[NGBE_MAX_RETA_ENTRIES];

#define NGBE_RSS_KEY_SIZE     40  /* size of RSS Hash Key in bytes */
	u32 *rss_key;
	u32 wol;

	u16 bd_number;
};

extern char ngbe_driver_name[];

#endif /* _NGBE_H_ */