162306a36Sopenharmony_ci/* Broadcom NetXtreme-C/E network driver.
262306a36Sopenharmony_ci *
362306a36Sopenharmony_ci * Copyright (c) 2016-2017 Broadcom Limited
462306a36Sopenharmony_ci *
562306a36Sopenharmony_ci * This program is free software; you can redistribute it and/or modify
662306a36Sopenharmony_ci * it under the terms of the GNU General Public License as published by
762306a36Sopenharmony_ci * the Free Software Foundation.
862306a36Sopenharmony_ci */
962306a36Sopenharmony_ci
1062306a36Sopenharmony_ci#ifndef BNXT_XDP_H
1162306a36Sopenharmony_ci#define BNXT_XDP_H
1262306a36Sopenharmony_ci
1362306a36Sopenharmony_ciDECLARE_STATIC_KEY_FALSE(bnxt_xdp_locking_key);
1462306a36Sopenharmony_ci
1562306a36Sopenharmony_cistruct bnxt_sw_tx_bd *bnxt_xmit_bd(struct bnxt *bp,
1662306a36Sopenharmony_ci				   struct bnxt_tx_ring_info *txr,
1762306a36Sopenharmony_ci				   dma_addr_t mapping, u32 len,
1862306a36Sopenharmony_ci				   struct xdp_buff *xdp);
1962306a36Sopenharmony_civoid bnxt_tx_int_xdp(struct bnxt *bp, struct bnxt_napi *bnapi, int budget);
2062306a36Sopenharmony_cibool bnxt_rx_xdp(struct bnxt *bp, struct bnxt_rx_ring_info *rxr, u16 cons,
2162306a36Sopenharmony_ci		 struct xdp_buff xdp, struct page *page, u8 **data_ptr,
2262306a36Sopenharmony_ci		 unsigned int *len, u8 *event);
2362306a36Sopenharmony_ciint bnxt_xdp(struct net_device *dev, struct netdev_bpf *xdp);
2462306a36Sopenharmony_ciint bnxt_xdp_xmit(struct net_device *dev, int num_frames,
2562306a36Sopenharmony_ci		  struct xdp_frame **frames, u32 flags);
2662306a36Sopenharmony_ci
2762306a36Sopenharmony_cibool bnxt_xdp_attached(struct bnxt *bp, struct bnxt_rx_ring_info *rxr);
2862306a36Sopenharmony_ci
2962306a36Sopenharmony_civoid bnxt_xdp_buff_init(struct bnxt *bp, struct bnxt_rx_ring_info *rxr,
3062306a36Sopenharmony_ci			u16 cons, u8 *data_ptr, unsigned int len,
3162306a36Sopenharmony_ci			struct xdp_buff *xdp);
3262306a36Sopenharmony_civoid bnxt_xdp_buff_frags_free(struct bnxt_rx_ring_info *rxr,
3362306a36Sopenharmony_ci			      struct xdp_buff *xdp);
3462306a36Sopenharmony_cistruct sk_buff *bnxt_xdp_build_skb(struct bnxt *bp, struct sk_buff *skb,
3562306a36Sopenharmony_ci				   u8 num_frags, struct page_pool *pool,
3662306a36Sopenharmony_ci				   struct xdp_buff *xdp,
3762306a36Sopenharmony_ci				   struct rx_cmp_ext *rxcmp1);
3862306a36Sopenharmony_ci#endif
39