linux/drivers/net/vmxnet3/vmxnet3_int.h

/*
 * Linux driver for VMware's vmxnet3 ethernet NIC.
 *
 * Copyright (C) 2008-2024, VMware, Inc. All Rights Reserved.
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the
 * Free Software Foundation; version 2 of the License and no later version.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
 * NON INFRINGEMENT.  See the GNU General Public License for more
 * details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 * The full GNU General Public License is included in this distribution in
 * the file called "COPYING".
 *
 * Maintained by: [email protected]
 *
 */

#ifndef _VMXNET3_INT_H
#define _VMXNET3_INT_H

#include <linux/bitops.h>
#include <linux/ethtool.h>
#include <linux/delay.h>
#include <linux/netdevice.h>
#include <linux/pci.h>
#include <linux/compiler.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
#include <linux/ioport.h>
#include <linux/highmem.h>
#include <linux/timer.h>
#include <linux/skbuff.h>
#include <linux/interrupt.h>
#include <linux/workqueue.h>
#include <linux/uaccess.h>
#include <asm/dma.h>
#include <asm/page.h>

#include <linux/tcp.h>
#include <linux/udp.h>
#include <linux/ip.h>
#include <linux/ipv6.h>
#include <linux/in.h>
#include <linux/etherdevice.h>
#include <asm/checksum.h>
#include <linux/if_vlan.h>
#include <linux/if_arp.h>
#include <linux/inetdevice.h>
#include <linux/log2.h>
#include <linux/bpf.h>
#include <net/page_pool/helpers.h>
#include <net/xdp.h>

#include "vmxnet3_defs.h"

#ifdef DEBUG
#define VMXNET3_DRIVER_VERSION_REPORT
#else
#define VMXNET3_DRIVER_VERSION_REPORT
#endif


/*
 * Version numbers
 */
#define VMXNET3_DRIVER_VERSION_STRING

/* Each byte of this 32-bit integer encodes a version number in
 * VMXNET3_DRIVER_VERSION_STRING.
 */
#define VMXNET3_DRIVER_VERSION_NUM

#if defined(CONFIG_PCI_MSI)
	/* RSS only makes sense if MSI-X is supported. */
	#define VMXNET3_RSS
#endif

#define VMXNET3_REV_9
#define VMXNET3_REV_8
#define VMXNET3_REV_7
#define VMXNET3_REV_6
#define VMXNET3_REV_5
#define VMXNET3_REV_4
#define VMXNET3_REV_3
#define VMXNET3_REV_2
#define VMXNET3_REV_1

/*
 * Capabilities
 */

enum {};

/*
 * Maximum devices supported.
 */
#define MAX_ETHERNET_CARDS
#define MAX_PCI_PASSTHRU_DEVICE

struct vmxnet3_cmd_ring {};

static inline void
vmxnet3_cmd_ring_adv_next2fill(struct vmxnet3_cmd_ring *ring)
{}

static inline void
vmxnet3_cmd_ring_adv_next2comp(struct vmxnet3_cmd_ring *ring)
{}

static inline int
vmxnet3_cmd_ring_desc_avail(struct vmxnet3_cmd_ring *ring)
{}

struct vmxnet3_comp_ring {};

static inline void
vmxnet3_comp_ring_adv_next2proc(struct vmxnet3_comp_ring *ring)
{}

struct vmxnet3_tx_data_ring {};

struct vmxnet3_tx_ts_ring {};

#define VMXNET3_MAP_NONE
#define VMXNET3_MAP_SINGLE
#define VMXNET3_MAP_PAGE
#define VMXNET3_MAP_XDP

struct vmxnet3_tx_buf_info {};

struct vmxnet3_tq_driver_stats {};

struct vmxnet3_tx_ctx {};

struct vmxnet3_tx_queue {} ____cacheline_aligned;

enum vmxnet3_rx_buf_type {};

#define VMXNET3_RXD_COMP_PENDING
#define VMXNET3_RXD_COMP_DONE

struct vmxnet3_rx_buf_info {};

struct vmxnet3_rx_ctx {};

struct vmxnet3_rq_driver_stats {};

struct vmxnet3_rx_data_ring {};

struct vmxnet3_rx_ts_ring {};

struct vmxnet3_rx_queue {} ____cacheline_aligned;

#define VMXNET3_DEVICE_MAX_TX_QUEUES
#define VMXNET3_DEVICE_MAX_RX_QUEUES

#define VMXNET3_DEVICE_DEFAULT_TX_QUEUES
#define VMXNET3_DEVICE_DEFAULT_RX_QUEUES

/* Should be less than UPT1_RSS_MAX_IND_TABLE_SIZE */
#define VMXNET3_RSS_IND_TABLE_SIZE

#define VMXNET3_LINUX_MAX_MSIX_VECT
#define VMXNET3_LINUX_MIN_MSIX_VECT


struct vmxnet3_intr {};

/* Interrupt sharing schemes, share_intr */
#define VMXNET3_INTR_BUDDYSHARE
#define VMXNET3_INTR_TXSHARE
#define VMXNET3_INTR_DONTSHARE


#define VMXNET3_STATE_BIT_RESETTING
#define VMXNET3_STATE_BIT_QUIESCED
struct vmxnet3_adapter {};

#define VMXNET3_WRITE_BAR0_REG(adapter, reg, val)
#define VMXNET3_READ_BAR0_REG(adapter, reg)

#define VMXNET3_WRITE_BAR1_REG(adapter, reg, val)
#define VMXNET3_READ_BAR1_REG(adapter, reg)

#define VMXNET3_WAKE_QUEUE_THRESHOLD(tq)
#define VMXNET3_RX_ALLOC_THRESHOLD(rq, ring_idx, adapter)

#define VMXNET3_GET_ADDR_LO(dma)
#define VMXNET3_GET_ADDR_HI(dma)

#define VMXNET3_VERSION_GE_2(adapter)
#define VMXNET3_VERSION_GE_3(adapter)
#define VMXNET3_VERSION_GE_4(adapter)
#define VMXNET3_VERSION_GE_5(adapter)
#define VMXNET3_VERSION_GE_6(adapter)
#define VMXNET3_VERSION_GE_7(adapter)
#define VMXNET3_VERSION_GE_8(adapter)
#define VMXNET3_VERSION_GE_9(adapter)

/* must be a multiple of VMXNET3_RING_SIZE_ALIGN */
#define VMXNET3_DEF_TX_RING_SIZE
#define VMXNET3_DEF_RX_RING_SIZE
#define VMXNET3_DEF_RX_RING2_SIZE

#define VMXNET3_DEF_RXDATA_DESC_SIZE

#define VMXNET3_MAX_ETH_HDR_SIZE
#define VMXNET3_MAX_SKB_BUF_SIZE

#define VMXNET3_GET_RING_IDX(adapter, rqID)	\

#define VMXNET3_RX_DATA_RING(adapter, rqID)		\

#define VMXNET3_COAL_STATIC_DEFAULT_DEPTH

#define VMXNET3_COAL_RBC_RATE(usecs)
#define VMXNET3_COAL_RBC_USECS(rbc_rate)
#define VMXNET3_RSS_FIELDS_DEFAULT

int
vmxnet3_quiesce_dev(struct vmxnet3_adapter *adapter);

int
vmxnet3_activate_dev(struct vmxnet3_adapter *adapter);

void
vmxnet3_force_close(struct vmxnet3_adapter *adapter);

void
vmxnet3_reset_dev(struct vmxnet3_adapter *adapter);

void
vmxnet3_tq_destroy_all(struct vmxnet3_adapter *adapter);

void
vmxnet3_rq_destroy_all(struct vmxnet3_adapter *adapter);

int
vmxnet3_rq_create_all(struct vmxnet3_adapter *adapter);

void
vmxnet3_adjust_rx_ring_size(struct vmxnet3_adapter *adapter);

netdev_features_t
vmxnet3_fix_features(struct net_device *netdev, netdev_features_t features);

netdev_features_t
vmxnet3_features_check(struct sk_buff *skb,
		       struct net_device *netdev, netdev_features_t features);

int
vmxnet3_set_features(struct net_device *netdev, netdev_features_t features);

int
vmxnet3_create_queues(struct vmxnet3_adapter *adapter,
		      u32 tx_ring_size, u32 rx_ring_size, u32 rx_ring2_size,
		      u16 txdata_desc_size, u16 rxdata_desc_size);

void vmxnet3_set_ethtool_ops(struct net_device *netdev);

void vmxnet3_get_stats64(struct net_device *dev,
			 struct rtnl_link_stats64 *stats);
bool vmxnet3_check_ptcapability(u32 cap_supported, u32 cap);

extern char vmxnet3_driver_name[];
#endif