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

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

#include <linux/interrupt.h>
#include <linux/pci.h>
#include <net/page_pool/helpers.h>
#include <net/tso.h>
#include <linux/bitfield.h>

#include "otx2_reg.h"
#include "otx2_common.h"
#include "otx2_struct.h"
#include "cn10k.h"

static void otx2_nix_rq_op_stats(struct queue_stats *stats,
				 struct otx2_nic *pfvf, int qidx)
{}

static void otx2_nix_sq_op_stats(struct queue_stats *stats,
				 struct otx2_nic *pfvf, int qidx)
{}

void otx2_update_lmac_stats(struct otx2_nic *pfvf)
{}

void otx2_update_lmac_fec_stats(struct otx2_nic *pfvf)
{}

int otx2_update_rq_stats(struct otx2_nic *pfvf, int qidx)
{}

int otx2_update_sq_stats(struct otx2_nic *pfvf, int qidx)
{}

void otx2_get_dev_stats(struct otx2_nic *pfvf)
{}

void otx2_get_stats64(struct net_device *netdev,
		      struct rtnl_link_stats64 *stats)
{}
EXPORT_SYMBOL();

/* Sync MAC address with RVU AF */
static int otx2_hw_set_mac_addr(struct otx2_nic *pfvf, u8 *mac)
{}

static int otx2_hw_get_mac_addr(struct otx2_nic *pfvf,
				struct net_device *netdev)
{}

int otx2_set_mac_address(struct net_device *netdev, void *p)
{}
EXPORT_SYMBOL();

int otx2_hw_set_mtu(struct otx2_nic *pfvf, int mtu)
{}

int otx2_config_pause_frm(struct otx2_nic *pfvf)
{}
EXPORT_SYMBOL();

int otx2_set_flowkey_cfg(struct otx2_nic *pfvf)
{}

int otx2_set_rss_table(struct otx2_nic *pfvf, int ctx_id)
{}

void otx2_set_rss_key(struct otx2_nic *pfvf)
{}

int otx2_rss_init(struct otx2_nic *pfvf)
{}

/* Setup UDP segmentation algorithm in HW */
static void otx2_setup_udp_segmentation(struct nix_lso_format_cfg *lso, bool v4)
{}

/* Setup segmentation algorithms in HW and retrieve algorithm index */
void otx2_setup_segmentation(struct otx2_nic *pfvf)
{}

void otx2_config_irq_coalescing(struct otx2_nic *pfvf, int qidx)
{}

static int otx2_alloc_pool_buf(struct otx2_nic *pfvf, struct otx2_pool *pool,
			       dma_addr_t *dma)
{}

static int __otx2_alloc_rbuf(struct otx2_nic *pfvf, struct otx2_pool *pool,
			     dma_addr_t *dma)
{}

int otx2_alloc_rbuf(struct otx2_nic *pfvf, struct otx2_pool *pool,
		    dma_addr_t *dma)
{}

int otx2_alloc_buffer(struct otx2_nic *pfvf, struct otx2_cq_queue *cq,
		      dma_addr_t *dma)
{}

void otx2_tx_timeout(struct net_device *netdev, unsigned int txq)
{}
EXPORT_SYMBOL();

void otx2_get_mac_from_af(struct net_device *netdev)
{}
EXPORT_SYMBOL();

int otx2_txschq_config(struct otx2_nic *pfvf, int lvl, int prio, bool txschq_for_pfc)
{}
EXPORT_SYMBOL();

int otx2_smq_flush(struct otx2_nic *pfvf, int smq)
{}
EXPORT_SYMBOL();

int otx2_txsch_alloc(struct otx2_nic *pfvf)
{}

void otx2_txschq_free_one(struct otx2_nic *pfvf, u16 lvl, u16 schq)
{}
EXPORT_SYMBOL();

void otx2_txschq_stop(struct otx2_nic *pfvf)
{}

void otx2_sqb_flush(struct otx2_nic *pfvf)
{}

/* RED and drop levels of CQ on packet reception.
 * For CQ level is measure of emptiness ( 0x0 = full, 255 = empty).
 */
#define RQ_PASS_LVL_CQ(skid, qsize)
#define RQ_DROP_LVL_CQ(skid, qsize)

/* RED and drop levels of AURA for packet reception.
 * For AURA level is measure of fullness (0x0 = empty, 255 = full).
 * Eg: For RQ length 1K, for pass/drop level 204/230.
 * RED accepts pkts if free pointers > 102 & <= 205.
 * Drops pkts if free pointers < 102.
 */
#define RQ_BP_LVL_AURA
#define RQ_PASS_LVL_AURA
#define RQ_DROP_LVL_AURA

static int otx2_rq_init(struct otx2_nic *pfvf, u16 qidx, u16 lpb_aura)
{}

int otx2_sq_aq_init(void *dev, u16 qidx, u16 sqb_aura)
{}

int otx2_sq_init(struct otx2_nic *pfvf, u16 qidx, u16 sqb_aura)
{}

static int otx2_cq_init(struct otx2_nic *pfvf, u16 qidx)
{}

static void otx2_pool_refill_task(struct work_struct *work)
{}

int otx2_config_nix_queues(struct otx2_nic *pfvf)
{}

int otx2_config_nix(struct otx2_nic *pfvf)
{}

void otx2_sq_free_sqbs(struct otx2_nic *pfvf)
{}

void otx2_free_bufs(struct otx2_nic *pfvf, struct otx2_pool *pool,
		    u64 iova, int size)
{}

void otx2_free_aura_ptr(struct otx2_nic *pfvf, int type)
{}

void otx2_aura_pool_free(struct otx2_nic *pfvf)
{}

int otx2_aura_init(struct otx2_nic *pfvf, int aura_id,
		   int pool_id, int numptrs)
{}

int otx2_pool_init(struct otx2_nic *pfvf, u16 pool_id,
		   int stack_pages, int numptrs, int buf_size, int type)
{}

int otx2_sq_aura_pool_init(struct otx2_nic *pfvf)
{}

int otx2_rq_aura_pool_init(struct otx2_nic *pfvf)
{}

int otx2_config_npa(struct otx2_nic *pfvf)
{}

int otx2_detach_resources(struct mbox *mbox)
{}
EXPORT_SYMBOL();

int otx2_attach_npa_nix(struct otx2_nic *pfvf)
{}
EXPORT_SYMBOL();

void otx2_ctx_disable(struct mbox *mbox, int type, bool npa)
{}

int otx2_nix_config_bp(struct otx2_nic *pfvf, bool enable)
{}
EXPORT_SYMBOL();

/* Mbox message handlers */
void mbox_handler_cgx_stats(struct otx2_nic *pfvf,
			    struct cgx_stats_rsp *rsp)
{}

void mbox_handler_cgx_fec_stats(struct otx2_nic *pfvf,
				struct cgx_fec_stats_rsp *rsp)
{}

void mbox_handler_npa_lf_alloc(struct otx2_nic *pfvf,
			       struct npa_lf_alloc_rsp *rsp)
{}
EXPORT_SYMBOL();

void mbox_handler_nix_lf_alloc(struct otx2_nic *pfvf,
			       struct nix_lf_alloc_rsp *rsp)
{}
EXPORT_SYMBOL();

void mbox_handler_msix_offset(struct otx2_nic *pfvf,
			      struct msix_offset_rsp *rsp)
{}
EXPORT_SYMBOL();

void mbox_handler_nix_bp_enable(struct otx2_nic *pfvf,
				struct nix_bp_cfg_rsp *rsp)
{}
EXPORT_SYMBOL();

void otx2_free_cints(struct otx2_nic *pfvf, int n)
{}

void otx2_set_cints_affinity(struct otx2_nic *pfvf)
{}

static u32 get_dwrr_mtu(struct otx2_nic *pfvf, struct nix_hw_info *hw)
{}

u16 otx2_get_max_mtu(struct otx2_nic *pfvf)
{}
EXPORT_SYMBOL();

int otx2_handle_ntuple_tc_features(struct net_device *netdev, netdev_features_t features)
{}
EXPORT_SYMBOL();

#define M
MBOX_UP_CGX_MESSAGES
MBOX_UP_MCS_MESSAGES
#undef M