linux/drivers/net/ethernet/rdc/r6040.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * RDC R6040 Fast Ethernet MAC support
 *
 * Copyright (C) 2004 Sten Wang <[email protected]>
 * Copyright (C) 2007
 *	Daniel Gimpelevich <[email protected]>
 * Copyright (C) 2007-2012 Florian Fainelli <[email protected]>
*/

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/string.h>
#include <linux/timer.h>
#include <linux/errno.h>
#include <linux/ioport.h>
#include <linux/interrupt.h>
#include <linux/pci.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
#include <linux/delay.h>
#include <linux/mii.h>
#include <linux/ethtool.h>
#include <linux/crc32.h>
#include <linux/spinlock.h>
#include <linux/bitops.h>
#include <linux/io.h>
#include <linux/irq.h>
#include <linux/uaccess.h>
#include <linux/phy.h>

#include <asm/processor.h>

#define DRV_NAME
#define DRV_VERSION
#define DRV_RELDATE

/* Time in jiffies before concluding the transmitter is hung. */
#define TX_TIMEOUT

/* RDC MAC I/O Size */
#define R6040_IO_SIZE

/* MAX RDC MAC */
#define MAX_MAC

/* MAC registers */
#define MCR0
#define MCR0_RCVEN
#define MCR0_PROMISC
#define MCR0_HASH_EN
#define MCR0_XMTEN
#define MCR0_FD
#define MCR1
#define MAC_RST
#define MBCR
#define MT_ICR
#define MR_ICR
#define MTPR
#define TM2TX
#define MR_BSR
#define MR_DCR
#define MLSR
#define TX_FIFO_UNDR
#define TX_EXCEEDC
#define TX_LATEC
#define MMDIO
#define MDIO_WRITE
#define MDIO_READ
#define MMRD
#define MMWD
#define MTD_SA0
#define MTD_SA1
#define MRD_SA0
#define MRD_SA1
#define MISR
#define MIER
#define MSK_INT
#define RX_FINISH
#define RX_NO_DESC
#define RX_FIFO_FULL
#define RX_EARLY
#define TX_FINISH
#define TX_EARLY
#define EVENT_OVRFL
#define LINK_CHANGED
#define ME_CISR
#define ME_CIER
#define MR_CNT
#define ME_CNT0
#define ME_CNT1
#define ME_CNT2
#define ME_CNT3
#define MT_CNT
#define ME_CNT4
#define MP_CNT
#define MAR0
#define MAR1
#define MAR2
#define MAR3
#define MID_0L
#define MID_0M
#define MID_0H
#define MID_1L
#define MID_1M
#define MID_1H
#define MID_2L
#define MID_2M
#define MID_2H
#define MID_3L
#define MID_3M
#define MID_3H
#define PHY_CC
#define SCEN
#define PHYAD_SHIFT
#define TMRDIV_SHIFT
#define PHY_ST
#define MAC_SM
#define MAC_SM_RST
#define MD_CSC
#define MD_CSC_DEFAULT
#define MAC_ID

#define TX_DCNT
#define RX_DCNT
#define MAX_BUF_SIZE
#define RX_DESC_SIZE
#define TX_DESC_SIZE
#define MBCR_DEFAULT
#define MCAST_MAX

#define MAC_DEF_TIMEOUT

/* Descriptor status */
#define DSC_OWNER_MAC
#define DSC_RX_OK
#define DSC_RX_ERR
#define DSC_RX_ERR_DRI
#define DSC_RX_ERR_BUF
#define DSC_RX_ERR_LONG
#define DSC_RX_ERR_RUNT
#define DSC_RX_ERR_CRC
#define DSC_RX_BCAST
#define DSC_RX_MCAST
#define DSC_RX_MCH_HIT
#define DSC_RX_MIDH_HIT
#define DSC_RX_IDX_MID_MASK

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

/* RX and TX interrupts that we handle */
#define RX_INTS
#define TX_INTS
#define INT_MASK

struct r6040_descriptor {} __aligned();

struct r6040_private {};

static char version[] =;

/* Read a word data from PHY Chip */
static int r6040_phy_read(void __iomem *ioaddr, int phy_addr, int reg)
{}

/* Write a word data from PHY Chip */
static int r6040_phy_write(void __iomem *ioaddr,
					int phy_addr, int reg, u16 val)
{}

static int r6040_mdiobus_read(struct mii_bus *bus, int phy_addr, int reg)
{}

static int r6040_mdiobus_write(struct mii_bus *bus, int phy_addr,
						int reg, u16 value)
{}

static void r6040_free_txbufs(struct net_device *dev)
{}

static void r6040_free_rxbufs(struct net_device *dev)
{}

static void r6040_init_ring_desc(struct r6040_descriptor *desc_ring,
				 dma_addr_t desc_dma, int size)
{}

static void r6040_init_txbufs(struct net_device *dev)
{}

static int r6040_alloc_rxbufs(struct net_device *dev)
{}

static void r6040_reset_mac(struct r6040_private *lp)
{}

static void r6040_init_mac_regs(struct net_device *dev)
{}

static void r6040_tx_timeout(struct net_device *dev, unsigned int txqueue)
{}

static struct net_device_stats *r6040_get_stats(struct net_device *dev)
{}

/* Stop RDC MAC and Free the allocated resource */
static void r6040_down(struct net_device *dev)
{}

static int r6040_close(struct net_device *dev)
{}

static int r6040_rx(struct net_device *dev, int limit)
{}

static void r6040_tx(struct net_device *dev)
{}

static int r6040_poll(struct napi_struct *napi, int budget)
{}

/* The RDC interrupt handler. */
static irqreturn_t r6040_interrupt(int irq, void *dev_id)
{}

#ifdef CONFIG_NET_POLL_CONTROLLER
static void r6040_poll_controller(struct net_device *dev)
{}
#endif

/* Init RDC MAC */
static int r6040_up(struct net_device *dev)
{}


/* Read/set MAC address routines */
static void r6040_mac_address(struct net_device *dev)
{}

static int r6040_open(struct net_device *dev)
{}

static netdev_tx_t r6040_start_xmit(struct sk_buff *skb,
				    struct net_device *dev)
{}

static void r6040_multicast_list(struct net_device *dev)
{}

static void netdev_get_drvinfo(struct net_device *dev,
			struct ethtool_drvinfo *info)
{}

static const struct ethtool_ops netdev_ethtool_ops =;

static const struct net_device_ops r6040_netdev_ops =;

static void r6040_adjust_link(struct net_device *dev)
{}

static int r6040_mii_probe(struct net_device *dev)
{}

static int r6040_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
{}

static void r6040_remove_one(struct pci_dev *pdev)
{}


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

static struct pci_driver r6040_driver =;

module_pci_driver();