#include <linux/module.h>
#include <net/ip6_checksum.h>
#include "vmxnet3_int.h"
#include "vmxnet3_xdp.h"
char vmxnet3_driver_name[] = …;
#define VMXNET3_DRIVER_DESC …
static const struct pci_device_id vmxnet3_pciid_table[] = …;
MODULE_DEVICE_TABLE(pci, vmxnet3_pciid_table);
static int enable_mq = …;
static void
vmxnet3_write_mac_addr(struct vmxnet3_adapter *adapter, const u8 *mac);
static void
vmxnet3_enable_intr(struct vmxnet3_adapter *adapter, unsigned intr_idx)
{ … }
static void
vmxnet3_disable_intr(struct vmxnet3_adapter *adapter, unsigned intr_idx)
{ … }
static void
vmxnet3_enable_all_intrs(struct vmxnet3_adapter *adapter)
{ … }
static void
vmxnet3_disable_all_intrs(struct vmxnet3_adapter *adapter)
{ … }
static void
vmxnet3_ack_events(struct vmxnet3_adapter *adapter, u32 events)
{ … }
static bool
vmxnet3_tq_stopped(struct vmxnet3_tx_queue *tq, struct vmxnet3_adapter *adapter)
{ … }
static void
vmxnet3_tq_start(struct vmxnet3_tx_queue *tq, struct vmxnet3_adapter *adapter)
{ … }
static void
vmxnet3_tq_wake(struct vmxnet3_tx_queue *tq, struct vmxnet3_adapter *adapter)
{ … }
static void
vmxnet3_tq_stop(struct vmxnet3_tx_queue *tq, struct vmxnet3_adapter *adapter)
{ … }
static u64
vmxnet3_get_cycles(int pmc)
{ … }
static bool
vmxnet3_apply_timestamp(struct vmxnet3_tx_queue *tq, u16 rate)
{ … }
bool
vmxnet3_check_ptcapability(u32 cap_supported, u32 cap)
{ … }
static void
vmxnet3_check_link(struct vmxnet3_adapter *adapter, bool affectTxQueue)
{ … }
static void
vmxnet3_process_events(struct vmxnet3_adapter *adapter)
{ … }
#ifdef __BIG_ENDIAN_BITFIELD
static void vmxnet3_RxDescToCPU(const struct Vmxnet3_RxDesc *srcDesc,
struct Vmxnet3_RxDesc *dstDesc)
{
u32 *src = (u32 *)srcDesc + 2;
u32 *dst = (u32 *)dstDesc + 2;
dstDesc->addr = le64_to_cpu(srcDesc->addr);
*dst = le32_to_cpu(*src);
dstDesc->ext1 = le32_to_cpu(srcDesc->ext1);
}
static void vmxnet3_TxDescToLe(const struct Vmxnet3_TxDesc *srcDesc,
struct Vmxnet3_TxDesc *dstDesc)
{
int i;
u32 *src = (u32 *)(srcDesc + 1);
u32 *dst = (u32 *)(dstDesc + 1);
for (i = 2; i > 0; i--) {
src--;
dst--;
*dst = cpu_to_le32(*src);
}
}
static void vmxnet3_RxCompToCPU(const struct Vmxnet3_RxCompDesc *srcDesc,
struct Vmxnet3_RxCompDesc *dstDesc)
{
int i = 0;
u32 *src = (u32 *)srcDesc;
u32 *dst = (u32 *)dstDesc;
for (i = 0; i < sizeof(struct Vmxnet3_RxCompDesc) / sizeof(u32); i++) {
*dst = le32_to_cpu(*src);
src++;
dst++;
}
}
static u32 get_bitfield32(const __le32 *bitfield, u32 pos, u32 size)
{
u32 temp = le32_to_cpu(*bitfield);
u32 mask = ((1 << size) - 1) << pos;
temp &= mask;
temp >>= pos;
return temp;
}
#endif
#ifdef __BIG_ENDIAN_BITFIELD
#define VMXNET3_TXDESC_GET_GEN …
#define VMXNET3_TXDESC_GET_EOP …
#define VMXNET3_TCD_GET_GEN …
#define VMXNET3_TCD_GET_TXIDX …
#define vmxnet3_getRxComp …
#define vmxnet3_getRxDesc …
#else
#define VMXNET3_TXDESC_GET_GEN(txdesc) …
#define VMXNET3_TXDESC_GET_EOP(txdesc) …
#define VMXNET3_TCD_GET_GEN(tcd) …
#define VMXNET3_TCD_GET_TXIDX(tcd) …
#define vmxnet3_getRxComp(dstrcd, rcd, tmp) …
#define vmxnet3_getRxDesc(dstrxd, rxd, tmp) …
#endif
static void
vmxnet3_unmap_tx_buf(struct vmxnet3_tx_buf_info *tbi,
struct pci_dev *pdev)
{ … }
static int
vmxnet3_unmap_pkt(u32 eop_idx, struct vmxnet3_tx_queue *tq,
struct pci_dev *pdev, struct vmxnet3_adapter *adapter,
struct xdp_frame_bulk *bq)
{ … }
static int
vmxnet3_tq_tx_complete(struct vmxnet3_tx_queue *tq,
struct vmxnet3_adapter *adapter)
{ … }
static void
vmxnet3_tq_cleanup(struct vmxnet3_tx_queue *tq,
struct vmxnet3_adapter *adapter)
{ … }
static void
vmxnet3_tq_destroy(struct vmxnet3_tx_queue *tq,
struct vmxnet3_adapter *adapter)
{ … }
void
vmxnet3_tq_destroy_all(struct vmxnet3_adapter *adapter)
{ … }
static void
vmxnet3_tq_init(struct vmxnet3_tx_queue *tq,
struct vmxnet3_adapter *adapter)
{ … }
static int
vmxnet3_tq_create(struct vmxnet3_tx_queue *tq,
struct vmxnet3_adapter *adapter)
{ … }
static void
vmxnet3_tq_cleanup_all(struct vmxnet3_adapter *adapter)
{ … }
static int
vmxnet3_rq_alloc_rx_buf(struct vmxnet3_rx_queue *rq, u32 ring_idx,
int num_to_alloc, struct vmxnet3_adapter *adapter)
{ … }
static void
vmxnet3_append_frag(struct sk_buff *skb, struct Vmxnet3_RxCompDesc *rcd,
struct vmxnet3_rx_buf_info *rbi)
{ … }
static int
vmxnet3_map_pkt(struct sk_buff *skb, struct vmxnet3_tx_ctx *ctx,
struct vmxnet3_tx_queue *tq, struct pci_dev *pdev,
struct vmxnet3_adapter *adapter)
{ … }
static void
vmxnet3_tq_init_all(struct vmxnet3_adapter *adapter)
{ … }
static int
vmxnet3_parse_hdr(struct sk_buff *skb, struct vmxnet3_tx_queue *tq,
struct vmxnet3_tx_ctx *ctx,
struct vmxnet3_adapter *adapter)
{ … }
static void
vmxnet3_copy_hdr(struct sk_buff *skb, struct vmxnet3_tx_queue *tq,
struct vmxnet3_tx_ctx *ctx,
struct vmxnet3_adapter *adapter)
{ … }
static void
vmxnet3_prepare_inner_tso(struct sk_buff *skb,
struct vmxnet3_tx_ctx *ctx)
{ … }
static void
vmxnet3_prepare_tso(struct sk_buff *skb,
struct vmxnet3_tx_ctx *ctx)
{ … }
static int txd_estimate(const struct sk_buff *skb)
{ … }
static int
vmxnet3_tq_xmit(struct sk_buff *skb, struct vmxnet3_tx_queue *tq,
struct vmxnet3_adapter *adapter, struct net_device *netdev)
{ … }
static int
vmxnet3_create_pp(struct vmxnet3_adapter *adapter,
struct vmxnet3_rx_queue *rq, int size)
{ … }
void *
vmxnet3_pp_get_buff(struct page_pool *pp, dma_addr_t *dma_addr,
gfp_t gfp_mask)
{ … }
static netdev_tx_t
vmxnet3_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
{ … }
static void
vmxnet3_rx_csum(struct vmxnet3_adapter *adapter,
struct sk_buff *skb,
union Vmxnet3_GenericDesc *gdesc)
{ … }
static void
vmxnet3_rx_error(struct vmxnet3_rx_queue *rq, struct Vmxnet3_RxCompDesc *rcd,
struct vmxnet3_rx_ctx *ctx, struct vmxnet3_adapter *adapter)
{ … }
static u32
vmxnet3_get_hdr_len(struct vmxnet3_adapter *adapter, struct sk_buff *skb,
union Vmxnet3_GenericDesc *gdesc)
{ … }
static int
vmxnet3_rq_rx_complete(struct vmxnet3_rx_queue *rq,
struct vmxnet3_adapter *adapter, int quota)
{ … }
static void
vmxnet3_rq_cleanup(struct vmxnet3_rx_queue *rq,
struct vmxnet3_adapter *adapter)
{ … }
static void
vmxnet3_rq_cleanup_all(struct vmxnet3_adapter *adapter)
{ … }
static void vmxnet3_rq_destroy(struct vmxnet3_rx_queue *rq,
struct vmxnet3_adapter *adapter)
{ … }
static void
vmxnet3_rq_destroy_all_rxdataring(struct vmxnet3_adapter *adapter)
{ … }
static int
vmxnet3_rq_init(struct vmxnet3_rx_queue *rq,
struct vmxnet3_adapter *adapter)
{ … }
static int
vmxnet3_rq_init_all(struct vmxnet3_adapter *adapter)
{ … }
static int
vmxnet3_rq_create(struct vmxnet3_rx_queue *rq, struct vmxnet3_adapter *adapter)
{ … }
int
vmxnet3_rq_create_all(struct vmxnet3_adapter *adapter)
{ … }
static int
vmxnet3_do_poll(struct vmxnet3_adapter *adapter, int budget)
{ … }
static int
vmxnet3_poll(struct napi_struct *napi, int budget)
{ … }
static int
vmxnet3_poll_rx_only(struct napi_struct *napi, int budget)
{ … }
#ifdef CONFIG_PCI_MSI
static irqreturn_t
vmxnet3_msix_tx(int irq, void *data)
{ … }
static irqreturn_t
vmxnet3_msix_rx(int irq, void *data)
{ … }
static irqreturn_t
vmxnet3_msix_event(int irq, void *data)
{ … }
#endif
static irqreturn_t
vmxnet3_intr(int irq, void *dev_id)
{ … }
#ifdef CONFIG_NET_POLL_CONTROLLER
static void
vmxnet3_netpoll(struct net_device *netdev)
{ … }
#endif
static int
vmxnet3_request_irqs(struct vmxnet3_adapter *adapter)
{ … }
static void
vmxnet3_free_irqs(struct vmxnet3_adapter *adapter)
{ … }
static void
vmxnet3_restore_vlan(struct vmxnet3_adapter *adapter)
{ … }
static int
vmxnet3_vlan_rx_add_vid(struct net_device *netdev, __be16 proto, u16 vid)
{ … }
static int
vmxnet3_vlan_rx_kill_vid(struct net_device *netdev, __be16 proto, u16 vid)
{ … }
static u8 *
vmxnet3_copy_mc(struct net_device *netdev)
{ … }
static void
vmxnet3_set_mc(struct net_device *netdev)
{ … }
void
vmxnet3_rq_destroy_all(struct vmxnet3_adapter *adapter)
{ … }
static void
vmxnet3_setup_driver_shared(struct vmxnet3_adapter *adapter)
{ … }
static void
vmxnet3_init_bufsize(struct vmxnet3_adapter *adapter)
{ … }
static void
vmxnet3_init_coalesce(struct vmxnet3_adapter *adapter)
{ … }
static void
vmxnet3_init_rssfields(struct vmxnet3_adapter *adapter)
{ … }
int
vmxnet3_activate_dev(struct vmxnet3_adapter *adapter)
{ … }
void
vmxnet3_reset_dev(struct vmxnet3_adapter *adapter)
{ … }
int
vmxnet3_quiesce_dev(struct vmxnet3_adapter *adapter)
{ … }
static void
vmxnet3_write_mac_addr(struct vmxnet3_adapter *adapter, const u8 *mac)
{ … }
static int
vmxnet3_set_mac_addr(struct net_device *netdev, void *p)
{ … }
static int
vmxnet3_alloc_pci_resources(struct vmxnet3_adapter *adapter)
{ … }
static void
vmxnet3_free_pci_resources(struct vmxnet3_adapter *adapter)
{ … }
void
vmxnet3_adjust_rx_ring_size(struct vmxnet3_adapter *adapter)
{ … }
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)
{ … }
static int
vmxnet3_open(struct net_device *netdev)
{ … }
static int
vmxnet3_close(struct net_device *netdev)
{ … }
void
vmxnet3_force_close(struct vmxnet3_adapter *adapter)
{ … }
static int
vmxnet3_change_mtu(struct net_device *netdev, int new_mtu)
{ … }
static void
vmxnet3_declare_features(struct vmxnet3_adapter *adapter)
{ … }
static void
vmxnet3_read_mac_addr(struct vmxnet3_adapter *adapter, u8 *mac)
{ … }
#ifdef CONFIG_PCI_MSI
static int
vmxnet3_acquire_msix_vectors(struct vmxnet3_adapter *adapter, int nvec)
{ … }
#endif
static void
vmxnet3_alloc_intr_resources(struct vmxnet3_adapter *adapter)
{ … }
static void
vmxnet3_free_intr_resources(struct vmxnet3_adapter *adapter)
{ … }
static void
vmxnet3_tx_timeout(struct net_device *netdev, unsigned int txqueue)
{ … }
static void
vmxnet3_reset_work(struct work_struct *data)
{ … }
static int
vmxnet3_probe_device(struct pci_dev *pdev,
const struct pci_device_id *id)
{ … }
static void
vmxnet3_remove_device(struct pci_dev *pdev)
{ … }
static void vmxnet3_shutdown_device(struct pci_dev *pdev)
{ … }
#ifdef CONFIG_PM
static int
vmxnet3_suspend(struct device *device)
{ … }
static int
vmxnet3_resume(struct device *device)
{ … }
static const struct dev_pm_ops vmxnet3_pm_ops = …;
#endif
static struct pci_driver vmxnet3_driver = …;
static int __init
vmxnet3_init_module(void)
{ … }
module_init(…) …;
static void
vmxnet3_exit_module(void)
{ … }
module_exit(vmxnet3_exit_module);
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…);
MODULE_LICENSE(…) …;
MODULE_VERSION(…);