linux/drivers/net/ethernet/8390/ax88796.c

// SPDX-License-Identifier: GPL-2.0-only
/* drivers/net/ethernet/8390/ax88796.c
 *
 * Copyright 2005,2007 Simtec Electronics
 *	Ben Dooks <[email protected]>
 *
 * Asix AX88796 10/100 Ethernet controller support
 *	Based on ne.c, by Donald Becker, et-al.
 */

#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/isapnp.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/platform_device.h>
#include <linux/delay.h>
#include <linux/timer.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/ethtool.h>
#include <linux/mdio-bitbang.h>
#include <linux/phy.h>
#include <linux/eeprom_93cx6.h>
#include <linux/slab.h>

#include <net/ax88796.h>


/* Rename the lib8390.c functions to show that they are in this driver */
#define __ei_open
#define __ei_close
#define __ei_poll
#define __ei_start_xmit
#define __ei_tx_timeout
#define __ei_get_stats
#define __ei_set_multicast_list
#define __ei_interrupt
#define ____alloc_ei_netdev
#define __NS8390_init

/* force unsigned long back to 'void __iomem *' */
#define ax_convert_addr(_a)

#define ei_inb(_a)
#define ei_outb(_v, _a)

#define ei_inb_p(_a)
#define ei_outb_p(_v, _a)

/* define EI_SHIFT() to take into account our register offsets */
#define EI_SHIFT(x)

/* Ensure we have our RCR base value */
#define AX88796_PLATFORM

static unsigned char version[] =;

#include "lib8390.c"

#define DRV_NAME
#define DRV_VERSION

/* from ne.c */
#define NE_CMD
#define NE_RESET
#define NE_DATAPORT

#define NE1SM_START_PG
#define NE1SM_STOP_PG
#define NESM_START_PG
#define NESM_STOP_PG

#define AX_GPOC_PPDSET

/* device private data */

struct ax_device {};

static inline struct ax_device *to_ax_dev(struct net_device *dev)
{}

void ax_NS8390_reinit(struct net_device *dev)
{}

EXPORT_SYMBOL_GPL();

/*
 * ax_initial_check
 *
 * do an initial probe for the card to check whether it exists
 * and is functional
 */
static int ax_initial_check(struct net_device *dev)
{}

/*
 * Hard reset the card. This used to pause for the same period that a
 * 8390 reset command required, but that shouldn't be necessary.
 */
static void ax_reset_8390(struct net_device *dev)
{}

/* Wrapper for __ei_interrupt for platforms that have a platform-specific
 * way to find out whether the interrupt request might be caused by
 * the ax88796 chip.
 */
static irqreturn_t ax_ei_interrupt_filtered(int irq, void *dev_id)
{}

static void ax_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *hdr,
			    int ring_page)
{}


/*
 * Block input and output, similar to the Crynwr packet driver. If
 * you are porting to a new ethercard, look at the packet driver
 * source for hints. The NEx000 doesn't share the on-board packet
 * memory -- you have to put the packet out through the "remote DMA"
 * dataport using ei_outb.
 */
static void ax_block_input(struct net_device *dev, int count,
			   struct sk_buff *skb, int ring_offset)
{}

static void ax_block_output(struct net_device *dev, int count,
			    const unsigned char *buf, const int start_page)
{}

/* definitions for accessing MII/EEPROM interface */

#define AX_MEMR
#define AX_MEMR_MDC
#define AX_MEMR_MDIR
#define AX_MEMR_MDI
#define AX_MEMR_MDO
#define AX_MEMR_EECS
#define AX_MEMR_EEI
#define AX_MEMR_EEO
#define AX_MEMR_EECLK

static void ax_handle_link_change(struct net_device *dev)
{}

static int ax_mii_probe(struct net_device *dev)
{}

static void ax_phy_switch(struct net_device *dev, int on)
{}

static void ax_bb_mdc(struct mdiobb_ctrl *ctrl, int level)
{}

static void ax_bb_dir(struct mdiobb_ctrl *ctrl, int output)
{}

static void ax_bb_set_data(struct mdiobb_ctrl *ctrl, int value)
{}

static int ax_bb_get_data(struct mdiobb_ctrl *ctrl)
{}

static const struct mdiobb_ops bb_ops =;

static int ax_mii_init(struct net_device *dev)
{}

static int ax_open(struct net_device *dev)
{}

static int ax_close(struct net_device *dev)
{}

static int ax_ioctl(struct net_device *dev, struct ifreq *req, int cmd)
{}

/* ethtool ops */

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

static u32 ax_get_msglevel(struct net_device *dev)
{}

static void ax_set_msglevel(struct net_device *dev, u32 v)
{}

static const struct ethtool_ops ax_ethtool_ops =;

#ifdef CONFIG_AX88796_93CX6
static void ax_eeprom_register_read(struct eeprom_93cx6 *eeprom)
{}

static void ax_eeprom_register_write(struct eeprom_93cx6 *eeprom)
{}
#endif

static const struct net_device_ops ax_netdev_ops =;

/* setup code */

static void ax_initial_setup(struct net_device *dev, struct ei_device *ei_local)
{}

/*
 * ax_init_dev
 *
 * initialise the specified device, taking care to note the MAC
 * address it may already have (if configured), ensure
 * the device is ready to be used by lib8390.c and registerd with
 * the network layer.
 */
static int ax_init_dev(struct net_device *dev)
{}

static void ax_remove(struct platform_device *pdev)
{}

/*
 * ax_probe
 *
 * This is the entry point when the platform device system uses to
 * notify us of a new device to attach to. Allocate memory, find the
 * resources and information passed, and map the necessary registers.
 */
static int ax_probe(struct platform_device *pdev)
{}

/* suspend and resume */

#ifdef CONFIG_PM
static int ax_suspend(struct platform_device *dev, pm_message_t state)
{}

static int ax_resume(struct platform_device *pdev)
{}

#else
#define ax_suspend
#define ax_resume
#endif

static struct platform_driver axdrv =;

module_platform_driver();

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