1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2018-2021 Beijing WangXun Technology Co., Ltd.
3 * Copyright(c) 2010-2017 Intel Corporation
6 #ifndef _NGBE_ETHDEV_H_
7 #define _NGBE_ETHDEV_H_
9 /* need update link, bit flag */
10 #define NGBE_FLAG_NEED_LINK_UPDATE ((uint32_t)(1 << 0))
11 #define NGBE_FLAG_MAILBOX ((uint32_t)(1 << 1))
12 #define NGBE_FLAG_PHY_INTERRUPT ((uint32_t)(1 << 2))
13 #define NGBE_FLAG_MACSEC ((uint32_t)(1 << 3))
14 #define NGBE_FLAG_NEED_LINK_CONFIG ((uint32_t)(1 << 4))
16 #define NGBE_MISC_VEC_ID RTE_INTR_VEC_ZERO_OFFSET
18 /* structure for interrupt relative data */
19 struct ngbe_interrupt {
22 uint32_t mask_misc_orig; /* save mask during delayed handler */
24 uint64_t mask_orig; /* save mask during delayed handler */
28 * Structure to store private data for each driver instance (for each port).
32 struct ngbe_interrupt intr;
35 static inline struct ngbe_adapter *
36 ngbe_dev_adapter(struct rte_eth_dev *dev)
38 struct ngbe_adapter *ad = dev->data->dev_private;
43 static inline struct ngbe_hw *
44 ngbe_dev_hw(struct rte_eth_dev *dev)
46 struct ngbe_adapter *ad = ngbe_dev_adapter(dev);
47 struct ngbe_hw *hw = &ad->hw;
52 static inline struct ngbe_interrupt *
53 ngbe_dev_intr(struct rte_eth_dev *dev)
55 struct ngbe_adapter *ad = ngbe_dev_adapter(dev);
56 struct ngbe_interrupt *intr = &ad->intr;
62 ngbe_dev_link_update_share(struct rte_eth_dev *dev,
63 int wait_to_complete);
65 #define NGBE_LINK_DOWN_CHECK_TIMEOUT 4000 /* ms */
66 #define NGBE_LINK_UP_CHECK_TIMEOUT 1000 /* ms */
67 #define NGBE_VMDQ_NUM_UC_MAC 4096 /* Maximum nb. of UC MAC addr. */
69 #endif /* _NGBE_ETHDEV_H_ */