linux/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c

// SPDX-License-Identifier: GPL-2.0
/* Marvell RVU Physical Function ethernet driver
 *
 * Copyright (C) 2020 Marvell.
 *
 */

#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 <linux/iommu.h>
#include <net/ip.h>
#include <linux/bpf.h>
#include <linux/bpf_trace.h>
#include <linux/bitfield.h>
#include <net/page_pool/types.h>

#include "otx2_reg.h"
#include "otx2_common.h"
#include "otx2_txrx.h"
#include "otx2_struct.h"
#include "otx2_ptp.h"
#include "cn10k.h"
#include "qos.h"
#include <rvu_trace.h>

#define DRV_NAME
#define DRV_STRING

/* Supported devices */
static const struct pci_device_id otx2_pf_id_table[] =;

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();
MODULE_DEVICE_TABLE(pci, otx2_pf_id_table);

static void otx2_vf_link_event_task(struct work_struct *work);

enum {};

static int otx2_config_hw_tx_tstamp(struct otx2_nic *pfvf, bool enable);
static int otx2_config_hw_rx_tstamp(struct otx2_nic *pfvf, bool enable);

static int otx2_change_mtu(struct net_device *netdev, int new_mtu)
{}

static void otx2_disable_flr_me_intr(struct otx2_nic *pf)
{}

static void otx2_flr_wq_destroy(struct otx2_nic *pf)
{}

static void otx2_flr_handler(struct work_struct *work)
{}

static irqreturn_t otx2_pf_flr_intr_handler(int irq, void *pf_irq)
{}

static irqreturn_t otx2_pf_me_intr_handler(int irq, void *pf_irq)
{}

static int otx2_register_flr_me_intr(struct otx2_nic *pf, int numvfs)
{}

static int otx2_pf_flr_init(struct otx2_nic *pf, int num_vfs)
{}

static void otx2_queue_vf_work(struct mbox *mw, struct workqueue_struct *mbox_wq,
			       int first, int mdevs, u64 intr)
{}

static void otx2_forward_msg_pfvf(struct otx2_mbox_dev *mdev,
				  struct otx2_mbox *pfvf_mbox, void *bbuf_base,
				  int devid)
{}

static int otx2_forward_vf_mbox_msgs(struct otx2_nic *pf,
				     struct otx2_mbox *src_mbox,
				     int dir, int vf, int num_msgs)
{}

static void otx2_pfvf_mbox_handler(struct work_struct *work)
{}

static void otx2_pfvf_mbox_up_handler(struct work_struct *work)
{}

static irqreturn_t otx2_pfvf_mbox_intr_handler(int irq, void *pf_irq)
{}

static int otx2_pfvf_mbox_init(struct otx2_nic *pf, int numvfs)
{}

static void otx2_pfvf_mbox_destroy(struct otx2_nic *pf)
{}

static void otx2_enable_pfvf_mbox_intr(struct otx2_nic *pf, int numvfs)
{}

static void otx2_disable_pfvf_mbox_intr(struct otx2_nic *pf, int numvfs)
{}

static int otx2_register_pfvf_mbox_intr(struct otx2_nic *pf, int numvfs)
{}

static void otx2_process_pfaf_mbox_msg(struct otx2_nic *pf,
				       struct mbox_msghdr *msg)
{}

static void otx2_pfaf_mbox_handler(struct work_struct *work)
{}

static void otx2_handle_link_event(struct otx2_nic *pf)
{}

int otx2_mbox_up_handler_mcs_intr_notify(struct otx2_nic *pf,
					 struct mcs_intr_info *event,
					 struct msg_rsp *rsp)
{}

int otx2_mbox_up_handler_cgx_link_event(struct otx2_nic *pf,
					struct cgx_link_info_msg *msg,
					struct msg_rsp *rsp)
{}

static int otx2_process_mbox_msg_up(struct otx2_nic *pf,
				    struct mbox_msghdr *req)
{}

static void otx2_pfaf_mbox_up_handler(struct work_struct *work)
{}

static irqreturn_t otx2_pfaf_mbox_intr_handler(int irq, void *pf_irq)
{}

static void otx2_disable_mbox_intr(struct otx2_nic *pf)
{}

static int otx2_register_mbox_intr(struct otx2_nic *pf, bool probe_af)
{}

static void otx2_pfaf_mbox_destroy(struct otx2_nic *pf)
{}

static int otx2_pfaf_mbox_init(struct otx2_nic *pf)
{}

static int otx2_cgx_config_linkevents(struct otx2_nic *pf, bool enable)
{}

int otx2_reset_mac_stats(struct otx2_nic *pfvf)
{}

static int otx2_cgx_config_loopback(struct otx2_nic *pf, bool enable)
{}

int otx2_set_real_num_queues(struct net_device *netdev,
			     int tx_queues, int rx_queues)
{}
EXPORT_SYMBOL();

static char *nix_sqoperr_e_str[NIX_SQOPERR_MAX] =;

static char *nix_mnqerr_e_str[NIX_MNQERR_MAX] =;

static char *nix_snd_status_e_str[NIX_SND_STATUS_MAX] =;

static irqreturn_t otx2_q_intr_handler(int irq, void *data)
{}

static irqreturn_t otx2_cq_intr_handler(int irq, void *cq_irq)
{}

static void otx2_disable_napi(struct otx2_nic *pf)
{}

static void otx2_free_cq_res(struct otx2_nic *pf)
{}

static void otx2_free_sq_res(struct otx2_nic *pf)
{}

static int otx2_get_rbuf_size(struct otx2_nic *pf, int mtu)
{}

static int otx2_init_hw_resources(struct otx2_nic *pf)
{}

static void otx2_free_hw_resources(struct otx2_nic *pf)
{}

static bool otx2_promisc_use_mce_list(struct otx2_nic *pfvf)
{}

static void otx2_do_set_rx_mode(struct otx2_nic *pf)
{}

static void otx2_set_irq_coalesce(struct otx2_nic *pfvf)
{}

static void otx2_dim_work(struct work_struct *w)
{}

int otx2_open(struct net_device *netdev)
{}
EXPORT_SYMBOL();

int otx2_stop(struct net_device *netdev)
{}
EXPORT_SYMBOL();

static netdev_tx_t otx2_xmit(struct sk_buff *skb, struct net_device *netdev)
{}

static int otx2_qos_select_htb_queue(struct otx2_nic *pf, struct sk_buff *skb,
				     u16 htb_maj_id)
{}

u16 otx2_select_queue(struct net_device *netdev, struct sk_buff *skb,
		      struct net_device *sb_dev)
{}
EXPORT_SYMBOL();

static netdev_features_t otx2_fix_features(struct net_device *dev,
					   netdev_features_t features)
{}

static void otx2_set_rx_mode(struct net_device *netdev)
{}

static void otx2_rx_mode_wrk_handler(struct work_struct *work)
{}

static int otx2_set_features(struct net_device *netdev,
			     netdev_features_t features)
{}

static void otx2_reset_task(struct work_struct *work)
{}

static int otx2_config_hw_rx_tstamp(struct otx2_nic *pfvf, bool enable)
{}

static int otx2_config_hw_tx_tstamp(struct otx2_nic *pfvf, bool enable)
{}

int otx2_config_hwtstamp(struct net_device *netdev, struct ifreq *ifr)
{}
EXPORT_SYMBOL();

int otx2_ioctl(struct net_device *netdev, struct ifreq *req, int cmd)
{}
EXPORT_SYMBOL();

static int otx2_do_set_vf_mac(struct otx2_nic *pf, int vf, const u8 *mac)
{}

static int otx2_set_vf_mac(struct net_device *netdev, int vf, u8 *mac)
{}

static int otx2_do_set_vf_vlan(struct otx2_nic *pf, int vf, u16 vlan, u8 qos,
			       __be16 proto)
{}

static int otx2_set_vf_vlan(struct net_device *netdev, int vf, u16 vlan, u8 qos,
			    __be16 proto)
{}

static int otx2_get_vf_config(struct net_device *netdev, int vf,
			      struct ifla_vf_info *ivi)
{}

static int otx2_xdp_xmit_tx(struct otx2_nic *pf, struct xdp_frame *xdpf,
			    int qidx)
{}

static int otx2_xdp_xmit(struct net_device *netdev, int n,
			 struct xdp_frame **frames, u32 flags)
{}

static int otx2_xdp_setup(struct otx2_nic *pf, struct bpf_prog *prog)
{}

static int otx2_xdp(struct net_device *netdev, struct netdev_bpf *xdp)
{}

static int otx2_set_vf_permissions(struct otx2_nic *pf, int vf,
				   int req_perm)
{}

static int otx2_ndo_set_vf_trust(struct net_device *netdev, int vf,
				 bool enable)
{}

static const struct net_device_ops otx2_netdev_ops =;

static int otx2_wq_init(struct otx2_nic *pf)
{}

static int otx2_check_pf_usable(struct otx2_nic *nic)
{}

static int otx2_realloc_msix_vectors(struct otx2_nic *pf)
{}

static int otx2_sriov_vfcfg_init(struct otx2_nic *pf)
{}

static void otx2_sriov_vfcfg_cleanup(struct otx2_nic *pf)
{}

static int otx2_probe(struct pci_dev *pdev, const struct pci_device_id *id)
{}

static void otx2_vf_link_event_task(struct work_struct *work)
{}

static int otx2_sriov_enable(struct pci_dev *pdev, int numvfs)
{}

static int otx2_sriov_disable(struct pci_dev *pdev)
{}

static int otx2_sriov_configure(struct pci_dev *pdev, int numvfs)
{}

static void otx2_ndc_sync(struct otx2_nic *pf)
{}

static void otx2_remove(struct pci_dev *pdev)
{}

static struct pci_driver otx2_pf_driver =;

static int __init otx2_rvupf_init_module(void)
{}

static void __exit otx2_rvupf_cleanup_module(void)
{}

module_init();
module_exit(otx2_rvupf_cleanup_module);