linux/drivers/net/ethernet/ec_bhf.c

// SPDX-License-Identifier: GPL-2.0-only
 /*
 * drivers/net/ethernet/ec_bhf.c
 *
 * Copyright (C) 2014 Darek Marcinkiewicz <[email protected]>
 */

/* This is a driver for EtherCAT master module present on CCAT FPGA.
 * Those can be found on Bechhoff CX50xx industrial PCs.
 */

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/pci.h>
#include <linux/init.h>

#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/ip.h>
#include <linux/skbuff.h>
#include <linux/hrtimer.h>
#include <linux/interrupt.h>
#include <linux/stat.h>

#define TIMER_INTERVAL_NSEC

#define INFO_BLOCK_SIZE
#define INFO_BLOCK_TYPE
#define INFO_BLOCK_REV
#define INFO_BLOCK_BLK_CNT
#define INFO_BLOCK_TX_CHAN
#define INFO_BLOCK_RX_CHAN
#define INFO_BLOCK_OFFSET

#define EC_MII_OFFSET
#define EC_FIFO_OFFSET
#define EC_MAC_OFFSET

#define MAC_FRAME_ERR_CNT
#define MAC_RX_ERR_CNT
#define MAC_CRC_ERR_CNT
#define MAC_LNK_LST_ERR_CNT
#define MAC_TX_FRAME_CNT
#define MAC_RX_FRAME_CNT
#define MAC_TX_FIFO_LVL
#define MAC_DROPPED_FRMS
#define MAC_CONNECTED_CCAT_FLAG

#define MII_MAC_ADDR
#define MII_MAC_FILT_FLAG
#define MII_LINK_STATUS

#define FIFO_TX_REG
#define FIFO_TX_RESET
#define FIFO_RX_REG
#define FIFO_RX_ADDR_VALID
#define FIFO_RX_RESET

#define DMA_CHAN_OFFSET
#define DMA_CHAN_SIZE

#define DMA_WINDOW_SIZE_MASK

#define ETHERCAT_MASTER_ID

static const struct pci_device_id ids[] =;
MODULE_DEVICE_TABLE(pci, ids);

struct rx_header {} __packed;

#define PKT_PAYLOAD_SIZE
struct rx_desc {} __packed;

struct tx_header {} __packed;

struct tx_desc {} __packed;

#define FIFO_SIZE

static long polling_frequency =;

struct bhf_dma {};

struct ec_bhf_priv {};

#define PRIV_TO_DEV(priv)

static void ec_bhf_reset(struct ec_bhf_priv *priv)
{}

static void ec_bhf_send_packet(struct ec_bhf_priv *priv, struct tx_desc *desc)
{}

static int ec_bhf_desc_sent(struct tx_desc *desc)
{}

static void ec_bhf_process_tx(struct ec_bhf_priv *priv)
{}

static int ec_bhf_pkt_received(struct rx_desc *desc)
{}

static void ec_bhf_add_rx_desc(struct ec_bhf_priv *priv, struct rx_desc *desc)
{}

static void ec_bhf_process_rx(struct ec_bhf_priv *priv)
{}

static enum hrtimer_restart ec_bhf_timer_fun(struct hrtimer *timer)
{}

static int ec_bhf_setup_offsets(struct ec_bhf_priv *priv)
{}

static netdev_tx_t ec_bhf_start_xmit(struct sk_buff *skb,
				     struct net_device *net_dev)
{}

static int ec_bhf_alloc_dma_mem(struct ec_bhf_priv *priv,
				struct bhf_dma *buf,
				int channel,
				int size)
{}

static void ec_bhf_setup_tx_descs(struct ec_bhf_priv *priv)
{}

static void ec_bhf_setup_rx_descs(struct ec_bhf_priv *priv)
{}

static int ec_bhf_open(struct net_device *net_dev)
{}

static int ec_bhf_stop(struct net_device *net_dev)
{}

static void
ec_bhf_get_stats(struct net_device *net_dev,
		 struct rtnl_link_stats64 *stats)
{}

static const struct net_device_ops ec_bhf_netdev_ops =;

static int ec_bhf_probe(struct pci_dev *dev, const struct pci_device_id *id)
{}

static void ec_bhf_remove(struct pci_dev *dev)
{}

static struct pci_driver pci_driver =;
module_pci_driver();

module_param(polling_frequency, long, 0444);
MODULE_PARM_DESC();

MODULE_DESCRIPTION();
MODULE_LICENSE();
MODULE_AUTHOR();