linux/drivers/net/hippi/rrunner.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * rrunner.c: Linux driver for the Essential RoadRunner HIPPI board.
 *
 * Copyright (C) 1998-2002 by Jes Sorensen, <[email protected]>.
 *
 * Thanks to Essential Communication for providing us with hardware
 * and very comprehensive documentation without which I would not have
 * been able to write this driver. A special thank you to John Gibbon
 * for sorting out the legal issues, with the NDA, allowing the code to
 * be released under the GPL.
 *
 * Thanks to Jayaram Bhat from ODS/Essential for fixing some of the
 * stupid bugs in my code.
 *
 * Softnet support and various other patches from Val Henson of
 * ODS/Essential.
 *
 * PCI DMA mapping code partly based on work by Francois Romieu.
 */


#define DEBUG
#define RX_DMA_SKBUFF
#define PKT_COPY_THRESHOLD

#include <linux/module.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/ioport.h>
#include <linux/pci.h>
#include <linux/kernel.h>
#include <linux/netdevice.h>
#include <linux/hippidevice.h>
#include <linux/skbuff.h>
#include <linux/delay.h>
#include <linux/mm.h>
#include <linux/slab.h>
#include <net/sock.h>

#include <asm/cache.h>
#include <asm/byteorder.h>
#include <asm/io.h>
#include <asm/irq.h>
#include <linux/uaccess.h>

#define rr_if_busy(dev)
#define rr_if_running(dev)

#include "rrunner.h"

#define RUN_AT(x)


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

static const char version[] =;


static const struct net_device_ops rr_netdev_ops =;

/*
 * Implementation notes:
 *
 * The DMA engine only allows for DMA within physical 64KB chunks of
 * memory. The current approach of the driver (and stack) is to use
 * linear blocks of memory for the skbuffs. However, as the data block
 * is always the first part of the skb and skbs are 2^n aligned so we
 * are guarantted to get the whole block within one 64KB align 64KB
 * chunk.
 *
 * On the long term, relying on being able to allocate 64KB linear
 * chunks of memory is not feasible and the skb handling code and the
 * stack will need to know about I/O vectors or something similar.
 */

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

static void rr_remove_one(struct pci_dev *pdev)
{}


/*
 * Commands are considered to be slow, thus there is no reason to
 * inline this.
 */
static void rr_issue_cmd(struct rr_private *rrpriv, struct cmd *cmd)
{}


/*
 * Reset the board in a sensible manner. The NIC is already halted
 * when we get here and a spin-lock is held.
 */
static int rr_reset(struct net_device *dev)
{}


/*
 * Read a string from the EEPROM.
 */
static unsigned int rr_read_eeprom(struct rr_private *rrpriv,
				unsigned long offset,
				unsigned char *buf,
				unsigned long length)
{}


/*
 * Shortcut to read one word (4 bytes) out of the EEPROM and convert
 * it to our CPU byte-order.
 */
static u32 rr_read_eeprom_word(struct rr_private *rrpriv,
			    size_t offset)
{}


/*
 * Write a string to the EEPROM.
 *
 * This is only called when the firmware is not running.
 */
static unsigned int write_eeprom(struct rr_private *rrpriv,
				 unsigned long offset,
				 unsigned char *buf,
				 unsigned long length)
{}


static int rr_init(struct net_device *dev)
{}


static int rr_init1(struct net_device *dev)
{}


/*
 * All events are considered to be slow (RX/TX ints do not generate
 * events) and are handled here, outside the main interrupt handler,
 * to reduce the size of the handler.
 */
static u32 rr_handle_event(struct net_device *dev, u32 prodidx, u32 eidx)
{}


static void rx_int(struct net_device *dev, u32 rxlimit, u32 index)
{}


static irqreturn_t rr_interrupt(int irq, void *dev_id)
{}

static inline void rr_raz_tx(struct rr_private *rrpriv,
			     struct net_device *dev)
{}


static inline void rr_raz_rx(struct rr_private *rrpriv,
			     struct net_device *dev)
{}

static void rr_timer(struct timer_list *t)
{}


static int rr_open(struct net_device *dev)
{}


static void rr_dump(struct net_device *dev)
{}


static int rr_close(struct net_device *dev)
{}


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


/*
 * Read the firmware out of the EEPROM and put it into the SRAM
 * (or from user space - later)
 *
 * This operation requires the NIC to be halted and is performed with
 * interrupts disabled and with the spinlock hold.
 */
static int rr_load_firmware(struct net_device *dev)
{}


static int rr_siocdevprivate(struct net_device *dev, struct ifreq *rq,
			     void __user *data, int cmd)
{}

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

static struct pci_driver rr_driver =;

module_pci_driver();