1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(C) 2021 HiSilicon Limited
5 #ifndef _HNS3_COMMON_H_
6 #define _HNS3_COMMON_H_
10 #include "hns3_ethdev.h"
12 #define HNS3_CONVERT_TO_DECIMAL 10
13 #define HNS3_CONVERT_TO_HEXADECIMAL 16
16 HNS3_IO_FUNC_HINT_NONE = 0,
17 HNS3_IO_FUNC_HINT_VEC,
18 HNS3_IO_FUNC_HINT_SVE,
19 HNS3_IO_FUNC_HINT_SIMPLE,
20 HNS3_IO_FUNC_HINT_COMMON
23 #define HNS3_DEVARG_RX_FUNC_HINT "rx_func_hint"
24 #define HNS3_DEVARG_TX_FUNC_HINT "tx_func_hint"
26 #define HNS3_DEVARG_DEV_CAPS_MASK "dev_caps_mask"
28 #define HNS3_DEVARG_MBX_TIME_LIMIT_MS "mbx_time_limit_ms"
30 #define MSEC_PER_SEC 1000L
31 #define USEC_PER_MSEC 1000L
33 int hns3_fw_version_get(struct rte_eth_dev *eth_dev, char *fw_version,
35 int hns3_dev_infos_get(struct rte_eth_dev *eth_dev,
36 struct rte_eth_dev_info *info);
38 void hns3_clock_gettime(struct timeval *tv);
39 uint64_t hns3_clock_calctime_ms(struct timeval *tv);
40 uint64_t hns3_clock_gettime_ms(void);
42 void hns3_parse_devargs(struct rte_eth_dev *dev);
44 int hns3_configure_all_mc_mac_addr(struct hns3_adapter *hns, bool del);
45 int hns3_configure_all_mac_addr(struct hns3_adapter *hns, bool del);
46 int hns3_add_mac_addr(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr,
47 __rte_unused uint32_t idx, __rte_unused uint32_t pool);
49 void hns3_remove_mac_addr(struct rte_eth_dev *dev, uint32_t idx);
50 int hns3_set_mc_mac_addr_list(struct rte_eth_dev *dev,
51 struct rte_ether_addr *mc_addr_set,
53 void hns3_ether_format_addr(char *buf, uint16_t size,
54 const struct rte_ether_addr *ether_addr);
55 int hns3_init_mac_addrs(struct rte_eth_dev *dev);
57 int hns3_init_ring_with_vector(struct hns3_hw *hw);
58 int hns3_map_rx_interrupt(struct rte_eth_dev *dev);
59 void hns3_unmap_rx_interrupt(struct rte_eth_dev *dev);
60 int hns3_restore_rx_interrupt(struct hns3_hw *hw);
62 #endif /* _HNS3_COMMON_H_ */