#ifndef __HNAE_H
#define __HNAE_H
#include <linux/acpi.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/module.h>
#include <linux/netdevice.h>
#include <linux/notifier.h>
#include <linux/phy.h>
#include <linux/types.h>
#define HNAE_DRIVER_VERSION …
#define HNAE_DRIVER_NAME …
#define HNAE_COPYRIGHT …
#define HNAE_DRIVER_STRING …
#define HNAE_DEFAULT_DEVICE_DESCR …
#ifdef DEBUG
#ifndef assert
#define assert …
#endif
#else
#ifndef assert
#define assert(expr) …
#endif
#endif
#define AE_VERSION_1 …
#define AE_VERSION_2 …
#define AE_IS_VER1(ver) …
#define AE_NAME_SIZE …
#define BD_SIZE_2048_MAX_MTU …
#define RCB_REG_BASEADDR_L …
#define RCB_REG_BASEADDR_H …
#define RCB_REG_BD_NUM …
#define RCB_REG_BD_LEN …
#define RCB_REG_PKTLINE …
#define RCB_REG_TAIL …
#define RCB_REG_HEAD …
#define RCB_REG_FBDNUM …
#define RCB_REG_OFFSET …
#define RCB_REG_PKTNUM_RECORD …
#define HNS_RX_HEAD_SIZE …
#define HNAE_AE_REGISTER …
#define RCB_RING_NAME_LEN …
#define HNAE_LOWEST_LATENCY_COAL_PARAM …
#define HNAE_LOW_LATENCY_COAL_PARAM …
#define HNAE_BULK_LATENCY_COAL_PARAM …
enum hnae_led_state { … };
#define HNS_RX_FLAG_VLAN_PRESENT …
#define HNS_RX_FLAG_L3ID_IPV4 …
#define HNS_RX_FLAG_L3ID_IPV6 …
#define HNS_RX_FLAG_L4ID_UDP …
#define HNS_RX_FLAG_L4ID_TCP …
#define HNS_RX_FLAG_L4ID_SCTP …
#define HNS_TXD_ASID_S …
#define HNS_TXD_ASID_M …
#define HNS_TXD_BUFNUM_S …
#define HNS_TXD_BUFNUM_M …
#define HNS_TXD_PORTID_S …
#define HNS_TXD_PORTID_M …
#define HNS_TXD_RA_B …
#define HNS_TXD_RI_B …
#define HNS_TXD_L4CS_B …
#define HNS_TXD_L3CS_B …
#define HNS_TXD_FE_B …
#define HNS_TXD_VLD_B …
#define HNS_TXD_IPOFFSET_S …
#define HNS_TXD_IPOFFSET_M …
#define HNS_RXD_IPOFFSET_S …
#define HNS_RXD_IPOFFSET_M …
#define HNS_RXD_BUFNUM_S …
#define HNS_RXD_BUFNUM_M …
#define HNS_RXD_PORTID_S …
#define HNS_RXD_PORTID_M …
#define HNS_RXD_DMAC_S …
#define HNS_RXD_DMAC_M …
#define HNS_RXD_VLAN_S …
#define HNS_RXD_VLAN_M …
#define HNS_RXD_L3ID_S …
#define HNS_RXD_L3ID_M …
#define HNS_RXD_L4ID_S …
#define HNS_RXD_L4ID_M …
#define HNS_RXD_FE_B …
#define HNS_RXD_FRAG_B …
#define HNS_RXD_VLD_B …
#define HNS_RXD_L2E_B …
#define HNS_RXD_L3E_B …
#define HNS_RXD_L4E_B …
#define HNS_RXD_DROP_B …
#define HNS_RXD_VLANID_S …
#define HNS_RXD_VLANID_M …
#define HNS_RXD_CFI_B …
#define HNS_RXD_PRI_S …
#define HNS_RXD_PRI_M …
#define HNS_RXD_ASID_S …
#define HNS_RXD_ASID_M …
#define HNSV2_TXD_BUFNUM_S …
#define HNSV2_TXD_BUFNUM_M …
#define HNSV2_TXD_PORTID_S …
#define HNSV2_TXD_PORTID_M …
#define HNSV2_TXD_RI_B …
#define HNSV2_TXD_L4CS_B …
#define HNSV2_TXD_L3CS_B …
#define HNSV2_TXD_FE_B …
#define HNSV2_TXD_VLD_B …
#define HNSV2_TXD_TSE_B …
#define HNSV2_TXD_VLAN_EN_B …
#define HNSV2_TXD_SNAP_B …
#define HNSV2_TXD_IPV6_B …
#define HNSV2_TXD_SCTP_B …
struct __packed hnae_desc { … };
struct hnae_desc_cb { … };
#define setflags(flags, bits) …
#define unsetflags(flags, bits) …
#define RINGF_DIR …
#define is_tx_ring(ring) …
#define is_rx_ring(ring) …
#define ring_to_dma_dir(ring) …
struct ring_stats { … };
struct hnae_queue;
struct hnae_ring { … };
#define ring_ptr_move_fw(ring, p) …
#define ring_ptr_move_bw(ring, p) …
enum hns_desc_type { … };
#define assert_is_ring_idx(ring, idx) …
static inline int ring_dist(struct hnae_ring *ring, int begin, int end)
{ … }
static inline int ring_space(struct hnae_ring *ring)
{ … }
static inline int is_ring_empty(struct hnae_ring *ring)
{ … }
#define hnae_buf_size(_ring) …
#define hnae_page_order(_ring) …
#define hnae_page_size(_ring) …
struct hnae_handle;
struct hnae_buf_ops { … };
struct hnae_queue { … };
enum hnae_loop { … };
enum hnae_port_type { … };
enum hnae_media_type { … };
struct hnae_ae_ops { … };
struct hnae_ae_dev { … };
struct hnae_handle { … };
#define ring_to_dev(ring) …
struct hnae_handle *hnae_get_handle(struct device *owner_dev,
const struct fwnode_handle *fwnode,
u32 port_id,
struct hnae_buf_ops *bops);
void hnae_put_handle(struct hnae_handle *handle);
int hnae_ae_register(struct hnae_ae_dev *dev, struct module *owner);
void hnae_ae_unregister(struct hnae_ae_dev *dev);
int hnae_register_notifier(struct notifier_block *nb);
void hnae_unregister_notifier(struct notifier_block *nb);
int hnae_reinit_handle(struct hnae_handle *handle);
#define hnae_queue_xmit(q, buf_num) …
#ifndef assert
#define assert …
#endif
static inline int hnae_reserve_buffer_map(struct hnae_ring *ring,
struct hnae_desc_cb *cb)
{ … }
static inline int hnae_alloc_buffer_attach(struct hnae_ring *ring, int i)
{ … }
static inline void hnae_buffer_detach(struct hnae_ring *ring, int i)
{ … }
static inline void hnae_free_buffer_detach(struct hnae_ring *ring, int i)
{ … }
static inline void hnae_replace_buffer(struct hnae_ring *ring, int i,
struct hnae_desc_cb *res_cb)
{ … }
static inline void hnae_reuse_buffer(struct hnae_ring *ring, int i)
{ … }
static inline void hnae_reinit_all_ring_desc(struct hnae_handle *h)
{ … }
static inline void hnae_reinit_all_ring_page_off(struct hnae_handle *h)
{ … }
#define hnae_set_field(origin, mask, shift, val) …
#define hnae_set_bit(origin, shift, val) …
#define hnae_get_field(origin, mask, shift) …
#define hnae_get_bit(origin, shift) …
#endif