#include <linux/module.h>
#include <linux/interrupt.h>
#include <linux/pci.h>
#include <linux/etherdevice.h>
#include <linux/of.h>
#include <linux/if_vlan.h>
#include "nic_reg.h"
#include "nic.h"
#include "q_struct.h"
#include "thunder_bgx.h"
#define DRV_NAME …
#define DRV_VERSION …
#define NIC_VF_PER_MBX_REG …
struct hw_info { … };
struct nicpf { … };
static const struct pci_device_id nic_id_table[] = …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
MODULE_VERSION(…);
MODULE_DEVICE_TABLE(pci, nic_id_table);
static void nic_reg_write(struct nicpf *nic, u64 offset, u64 val)
{ … }
static u64 nic_reg_read(struct nicpf *nic, u64 offset)
{ … }
static void nic_enable_mbx_intr(struct nicpf *nic)
{ … }
static void nic_clear_mbx_intr(struct nicpf *nic, int vf, int mbx_reg)
{ … }
static u64 nic_get_mbx_addr(int vf)
{ … }
static void nic_send_msg_to_vf(struct nicpf *nic, int vf, union nic_mbx *mbx)
{ … }
static void nic_mbx_send_ready(struct nicpf *nic, int vf)
{ … }
static void nic_mbx_send_ack(struct nicpf *nic, int vf)
{ … }
static void nic_mbx_send_nack(struct nicpf *nic, int vf)
{ … }
static int nic_rcv_queue_sw_sync(struct nicpf *nic)
{ … }
static void nic_get_bgx_stats(struct nicpf *nic, struct bgx_stats_msg *bgx)
{ … }
static int nic_update_hw_frs(struct nicpf *nic, int new_frs, int vf)
{ … }
static void nic_set_tx_pkt_pad(struct nicpf *nic, int size)
{ … }
static void nic_set_lmac_vf_mapping(struct nicpf *nic)
{ … }
static void nic_get_hw_info(struct nicpf *nic)
{ … }
#define BGX0_BLOCK …
#define BGX1_BLOCK …
static void nic_init_hw(struct nicpf *nic)
{ … }
static void nic_config_cpi(struct nicpf *nic, struct cpi_cfg_msg *cfg)
{ … }
static void nic_send_rss_size(struct nicpf *nic, int vf)
{ … }
static void nic_config_rss(struct nicpf *nic, struct rss_cfg_msg *cfg)
{ … }
static void nic_tx_channel_cfg(struct nicpf *nic, u8 vnic,
struct sq_cfg_msg *sq)
{ … }
static void nic_send_pnicvf(struct nicpf *nic, int sqs)
{ … }
static void nic_send_snicvf(struct nicpf *nic, struct nicvf_ptr *nicvf)
{ … }
static int nic_nxt_avail_sqs(struct nicpf *nic)
{ … }
static void nic_alloc_sqs(struct nicpf *nic, struct sqs_alloc *sqs)
{ … }
static int nic_config_loopback(struct nicpf *nic, struct set_loopback *lbk)
{ … }
static int nic_reset_stat_counters(struct nicpf *nic,
int vf, struct reset_stat_cfg *cfg)
{ … }
static void nic_enable_tunnel_parsing(struct nicpf *nic, int vf)
{ … }
static void nic_enable_vf(struct nicpf *nic, int vf, bool enable)
{ … }
static void nic_pause_frame(struct nicpf *nic, int vf, struct pfc *cfg)
{ … }
static void nic_config_timestamp(struct nicpf *nic, int vf, struct set_ptp *ptp)
{ … }
static void nic_link_status_get(struct nicpf *nic, u8 vf)
{ … }
static void nic_handle_mbx_intr(struct nicpf *nic, int vf)
{ … }
static irqreturn_t nic_mbx_intr_handler(int irq, void *nic_irq)
{ … }
static void nic_free_all_interrupts(struct nicpf *nic)
{ … }
static int nic_register_interrupts(struct nicpf *nic)
{ … }
static void nic_unregister_interrupts(struct nicpf *nic)
{ … }
static int nic_num_sqs_en(struct nicpf *nic, int vf_en)
{ … }
static int nic_sriov_init(struct pci_dev *pdev, struct nicpf *nic)
{ … }
static int nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
{ … }
static void nic_remove(struct pci_dev *pdev)
{ … }
static struct pci_driver nic_driver = …;
static int __init nic_init_module(void)
{ … }
static void __exit nic_cleanup_module(void)
{ … }
module_init(…) …;
module_exit(nic_cleanup_module);