#include <linux/pci.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/rtnetlink.h>
#include <linux/jhash.h>
#include <net/pkt_cls.h>
#include "bnxt_hsi.h"
#include "bnxt.h"
#include "bnxt_hwrm.h"
#include "bnxt_vfr.h"
#include "bnxt_devlink.h"
#include "bnxt_tc.h"
#ifdef CONFIG_BNXT_SRIOV
#define CFA_HANDLE_INVALID …
#define VF_IDX_INVALID …
static int hwrm_cfa_vfr_alloc(struct bnxt *bp, u16 vf_idx,
u16 *tx_cfa_action, u16 *rx_cfa_code)
{ … }
static int hwrm_cfa_vfr_free(struct bnxt *bp, u16 vf_idx)
{ … }
static int bnxt_hwrm_vfr_qcfg(struct bnxt *bp, struct bnxt_vf_rep *vf_rep,
u16 *max_mtu)
{ … }
static int bnxt_vf_rep_open(struct net_device *dev)
{ … }
static int bnxt_vf_rep_close(struct net_device *dev)
{ … }
static netdev_tx_t bnxt_vf_rep_xmit(struct sk_buff *skb,
struct net_device *dev)
{ … }
static void
bnxt_vf_rep_get_stats64(struct net_device *dev,
struct rtnl_link_stats64 *stats)
{ … }
static int bnxt_vf_rep_setup_tc_block_cb(enum tc_setup_type type,
void *type_data,
void *cb_priv)
{ … }
static LIST_HEAD(bnxt_vf_block_cb_list);
static int bnxt_vf_rep_setup_tc(struct net_device *dev, enum tc_setup_type type,
void *type_data)
{ … }
struct net_device *bnxt_get_vf_rep(struct bnxt *bp, u16 cfa_code)
{ … }
void bnxt_vf_rep_rx(struct bnxt *bp, struct sk_buff *skb)
{ … }
static int bnxt_vf_rep_get_phys_port_name(struct net_device *dev, char *buf,
size_t len)
{ … }
static void bnxt_vf_rep_get_drvinfo(struct net_device *dev,
struct ethtool_drvinfo *info)
{ … }
static int bnxt_vf_rep_get_port_parent_id(struct net_device *dev,
struct netdev_phys_item_id *ppid)
{ … }
static const struct ethtool_ops bnxt_vf_rep_ethtool_ops = …;
static const struct net_device_ops bnxt_vf_rep_netdev_ops = …;
bool bnxt_dev_is_vf_rep(struct net_device *dev)
{ … }
void bnxt_vf_reps_close(struct bnxt *bp)
{ … }
void bnxt_vf_reps_open(struct bnxt *bp)
{ … }
static void __bnxt_free_one_vf_rep(struct bnxt *bp, struct bnxt_vf_rep *vf_rep)
{ … }
static void __bnxt_vf_reps_destroy(struct bnxt *bp)
{ … }
void bnxt_vf_reps_destroy(struct bnxt *bp)
{ … }
void bnxt_vf_reps_free(struct bnxt *bp)
{ … }
static int bnxt_alloc_vf_rep(struct bnxt *bp, struct bnxt_vf_rep *vf_rep,
u16 *cfa_code_map)
{ … }
int bnxt_vf_reps_alloc(struct bnxt *bp)
{ … }
static void bnxt_vf_rep_eth_addr_gen(u8 *src_mac, u16 vf_idx, u8 *mac)
{ … }
static void bnxt_vf_rep_netdev_init(struct bnxt *bp, struct bnxt_vf_rep *vf_rep,
struct net_device *dev)
{ … }
int bnxt_vf_reps_create(struct bnxt *bp)
{ … }
int bnxt_dl_eswitch_mode_get(struct devlink *devlink, u16 *mode)
{ … }
int bnxt_dl_eswitch_mode_set(struct devlink *devlink, u16 mode,
struct netlink_ext_ack *extack)
{ … }
#endif