#include <linux/pci.h>
#include <linux/if_vlan.h>
#include <linux/interrupt.h>
#include <linux/etherdevice.h>
#include <linux/netdevice.h>
#include <linux/module.h>
#include "hinic_hw_dev.h"
#include "hinic_dev.h"
#include "hinic_hw_mbox.h"
#include "hinic_hw_cmdq.h"
#include "hinic_port.h"
#include "hinic_sriov.h"
static unsigned char set_vf_link_state;
module_param(set_vf_link_state, byte, 0444);
MODULE_PARM_DESC(…) …;
#define HINIC_VLAN_PRIORITY_SHIFT …
#define HINIC_ADD_VLAN_IN_MAC …
#define HINIC_TX_RATE_TABLE_FULL …
#define HINIC_MAX_QOS …
static int hinic_set_mac(struct hinic_hwdev *hwdev, const u8 *mac_addr,
u16 vlan_id, u16 func_id)
{ … }
static void hinic_notify_vf_link_status(struct hinic_hwdev *hwdev, u16 vf_id,
u8 link_status)
{ … }
void hinic_notify_all_vfs_link_changed(struct hinic_hwdev *hwdev,
u8 link_status)
{ … }
static u16 hinic_vf_info_vlanprio(struct hinic_hwdev *hwdev, int vf_id)
{ … }
static int hinic_set_vf_vlan(struct hinic_hwdev *hwdev, bool add, u16 vid,
u8 qos, int vf_id)
{ … }
static int hinic_set_vf_tx_rate_max_min(struct hinic_hwdev *hwdev, u16 vf_id,
u32 max_rate, u32 min_rate)
{ … }
static int hinic_set_vf_rate_limit(struct hinic_hwdev *hwdev, u16 vf_id,
u32 tx_rate)
{ … }
static int hinic_set_vf_tx_rate(struct hinic_hwdev *hwdev, u16 vf_id,
u32 max_rate, u32 min_rate)
{ … }
static int hinic_init_vf_config(struct hinic_hwdev *hwdev, u16 vf_id)
{ … }
static int hinic_register_vf_msg_handler(void *hwdev, u16 vf_id,
void *buf_in, u16 in_size,
void *buf_out, u16 *out_size)
{ … }
static int hinic_unregister_vf_msg_handler(void *hwdev, u16 vf_id,
void *buf_in, u16 in_size,
void *buf_out, u16 *out_size)
{ … }
static int hinic_change_vf_mtu_msg_handler(void *hwdev, u16 vf_id,
void *buf_in, u16 in_size,
void *buf_out, u16 *out_size)
{ … }
static int hinic_get_vf_mac_msg_handler(void *hwdev, u16 vf_id,
void *buf_in, u16 in_size,
void *buf_out, u16 *out_size)
{ … }
static int hinic_set_vf_mac_msg_handler(void *hwdev, u16 vf_id,
void *buf_in, u16 in_size,
void *buf_out, u16 *out_size)
{ … }
static int hinic_del_vf_mac_msg_handler(void *hwdev, u16 vf_id,
void *buf_in, u16 in_size,
void *buf_out, u16 *out_size)
{ … }
static int hinic_get_vf_link_status_msg_handler(void *hwdev, u16 vf_id,
void *buf_in, u16 in_size,
void *buf_out, u16 *out_size)
{ … }
static bool check_func_table(struct hinic_hwdev *hwdev, u16 func_idx,
void *buf_in, u16 in_size)
{ … }
static struct vf_cmd_msg_handle nic_vf_cmd_msg_handler[] = …;
static struct vf_cmd_check_handle nic_cmd_support_vf[] = …;
#define CHECK_IPSU_15BIT …
static
struct hinic_sriov_info *hinic_get_sriov_info_by_pcidev(struct pci_dev *pdev)
{ … }
static int hinic_check_mac_info(u8 status, u16 vlan_id)
{ … }
#define HINIC_VLAN_ID_MASK …
static int hinic_update_mac(struct hinic_hwdev *hwdev, u8 *old_mac,
u8 *new_mac, u16 vlan_id, u16 func_id)
{ … }
static void hinic_get_vf_config(struct hinic_hwdev *hwdev, u16 vf_id,
struct ifla_vf_info *ivi)
{ … }
int hinic_ndo_get_vf_config(struct net_device *netdev,
int vf, struct ifla_vf_info *ivi)
{ … }
static int hinic_set_vf_mac(struct hinic_hwdev *hwdev, int vf,
unsigned char *mac_addr)
{ … }
int hinic_ndo_set_vf_mac(struct net_device *netdev, int vf, u8 *mac)
{ … }
static int hinic_add_vf_vlan(struct hinic_hwdev *hwdev, int vf_id,
u16 vlan, u8 qos)
{ … }
static int hinic_kill_vf_vlan(struct hinic_hwdev *hwdev, int vf_id)
{ … }
static int hinic_update_mac_vlan(struct hinic_dev *nic_dev, u16 old_vlan,
u16 new_vlan, int vf_id)
{ … }
static int set_hw_vf_vlan(struct hinic_dev *nic_dev,
u16 cur_vlanprio, int vf, u16 vlan, u8 qos)
{ … }
int hinic_ndo_set_vf_vlan(struct net_device *netdev, int vf, u16 vlan, u8 qos,
__be16 vlan_proto)
{ … }
static int hinic_set_vf_trust(struct hinic_hwdev *hwdev, u16 vf_id,
bool trust)
{ … }
int hinic_ndo_set_vf_trust(struct net_device *netdev, int vf, bool setting)
{ … }
int hinic_ndo_set_vf_bw(struct net_device *netdev,
int vf, int min_tx_rate, int max_tx_rate)
{ … }
static int hinic_set_vf_spoofchk(struct hinic_hwdev *hwdev, u16 vf_id,
bool spoofchk)
{ … }
int hinic_ndo_set_vf_spoofchk(struct net_device *netdev, int vf, bool setting)
{ … }
static int hinic_set_vf_link_state(struct hinic_hwdev *hwdev, u16 vf_id,
int link)
{ … }
int hinic_ndo_set_vf_link_state(struct net_device *netdev, int vf_id, int link)
{ … }
static int nic_pf_mbox_handler(void *hwdev, u16 vf_id, u8 cmd, void *buf_in,
u16 in_size, void *buf_out, u16 *out_size)
{ … }
static int cfg_mbx_pf_proc_vf_msg(void *hwdev, u16 vf_id, u8 cmd, void *buf_in,
u16 in_size, void *buf_out, u16 *out_size)
{ … }
static int hinic_init_vf_infos(struct hinic_func_to_io *nic_io, u16 vf_id)
{ … }
static void hinic_clear_vf_infos(struct hinic_dev *nic_dev, u16 vf_id)
{ … }
static void hinic_deinit_vf_hw(struct hinic_sriov_info *sriov_info,
u16 start_vf_id, u16 end_vf_id)
{ … }
int hinic_vf_func_init(struct hinic_hwdev *hwdev)
{ … }
void hinic_vf_func_free(struct hinic_hwdev *hwdev)
{ … }
static int hinic_init_vf_hw(struct hinic_hwdev *hwdev, u16 start_vf_id,
u16 end_vf_id)
{ … }
int hinic_pci_sriov_disable(struct pci_dev *pdev)
{ … }
static int hinic_pci_sriov_enable(struct pci_dev *pdev, int num_vfs)
{ … }
int hinic_pci_sriov_configure(struct pci_dev *dev, int num_vfs)
{ … }