#include <linux/ethtool.h>
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/netdevice.h>
#include <linux/if_vlan.h>
#include <linux/interrupt.h>
#include <linux/etherdevice.h>
#include <net/dcbnl.h>
#include "bnxt_hsi.h"
#include "bnxt.h"
#include "bnxt_hwrm.h"
#include "bnxt_ulp.h"
#include "bnxt_sriov.h"
#include "bnxt_vfr.h"
#include "bnxt_ethtool.h"
#ifdef CONFIG_BNXT_SRIOV
static int bnxt_hwrm_fwd_async_event_cmpl(struct bnxt *bp,
struct bnxt_vf_info *vf, u16 event_id)
{ … }
static int bnxt_vf_ndo_prep(struct bnxt *bp, int vf_id)
{ … }
int bnxt_set_vf_spoofchk(struct net_device *dev, int vf_id, bool setting)
{ … }
static int bnxt_hwrm_func_qcfg_flags(struct bnxt *bp, struct bnxt_vf_info *vf)
{ … }
bool bnxt_is_trusted_vf(struct bnxt *bp, struct bnxt_vf_info *vf)
{ … }
static int bnxt_hwrm_set_trusted_vf(struct bnxt *bp, struct bnxt_vf_info *vf)
{ … }
int bnxt_set_vf_trust(struct net_device *dev, int vf_id, bool trusted)
{ … }
int bnxt_get_vf_config(struct net_device *dev, int vf_id,
struct ifla_vf_info *ivi)
{ … }
int bnxt_set_vf_mac(struct net_device *dev, int vf_id, u8 *mac)
{ … }
int bnxt_set_vf_vlan(struct net_device *dev, int vf_id, u16 vlan_id, u8 qos,
__be16 vlan_proto)
{ … }
int bnxt_set_vf_bw(struct net_device *dev, int vf_id, int min_tx_rate,
int max_tx_rate)
{ … }
int bnxt_set_vf_link_state(struct net_device *dev, int vf_id, int link)
{ … }
static int bnxt_set_vf_attr(struct bnxt *bp, int num_vfs)
{ … }
static int bnxt_hwrm_func_vf_resource_free(struct bnxt *bp, int num_vfs)
{ … }
static void bnxt_free_vf_resources(struct bnxt *bp)
{ … }
static int bnxt_alloc_vf_resources(struct bnxt *bp, int num_vfs)
{ … }
static int bnxt_hwrm_func_buf_rgtr(struct bnxt *bp)
{ … }
static int __bnxt_set_vf_params(struct bnxt *bp, int vf_id)
{ … }
static int bnxt_hwrm_func_vf_resc_cfg(struct bnxt *bp, int num_vfs, bool reset)
{ … }
static int bnxt_hwrm_func_cfg(struct bnxt *bp, int num_vfs)
{ … }
static int bnxt_func_cfg(struct bnxt *bp, int num_vfs, bool reset)
{ … }
int bnxt_cfg_hw_sriov(struct bnxt *bp, int *num_vfs, bool reset)
{ … }
static int bnxt_sriov_enable(struct bnxt *bp, int *num_vfs)
{ … }
void bnxt_sriov_disable(struct bnxt *bp)
{ … }
int bnxt_sriov_configure(struct pci_dev *pdev, int num_vfs)
{ … }
static int bnxt_hwrm_fwd_resp(struct bnxt *bp, struct bnxt_vf_info *vf,
void *encap_resp, __le64 encap_resp_addr,
__le16 encap_resp_cpr, u32 msg_size)
{ … }
static int bnxt_hwrm_fwd_err_resp(struct bnxt *bp, struct bnxt_vf_info *vf,
u32 msg_size)
{ … }
static int bnxt_hwrm_exec_fwd_resp(struct bnxt *bp, struct bnxt_vf_info *vf,
u32 msg_size)
{ … }
static int bnxt_vf_configure_mac(struct bnxt *bp, struct bnxt_vf_info *vf)
{ … }
static int bnxt_vf_validate_set_mac(struct bnxt *bp, struct bnxt_vf_info *vf)
{ … }
static int bnxt_vf_set_link(struct bnxt *bp, struct bnxt_vf_info *vf)
{ … }
static int bnxt_vf_req_validate_snd(struct bnxt *bp, struct bnxt_vf_info *vf)
{ … }
void bnxt_hwrm_exec_fwd_req(struct bnxt *bp)
{ … }
int bnxt_approve_mac(struct bnxt *bp, const u8 *mac, bool strict)
{ … }
void bnxt_update_vf_mac(struct bnxt *bp)
{ … }
#else
int bnxt_cfg_hw_sriov(struct bnxt *bp, int *num_vfs, bool reset)
{
if (*num_vfs)
return -EOPNOTSUPP;
return 0;
}
void bnxt_sriov_disable(struct bnxt *bp)
{
}
void bnxt_hwrm_exec_fwd_req(struct bnxt *bp)
{
netdev_err(bp->dev, "Invalid VF message received when SRIOV is not enable\n");
}
void bnxt_update_vf_mac(struct bnxt *bp)
{
}
int bnxt_approve_mac(struct bnxt *bp, const u8 *mac, bool strict)
{
return 0;
}
#endif