linux/drivers/net/ethernet/sis/sis190.c

/*
   sis190.c: Silicon Integrated Systems SiS190 ethernet driver

   Copyright (c) 2003 K.M. Liu <[email protected]>
   Copyright (c) 2003, 2004 Jeff Garzik <[email protected]>
   Copyright (c) 2003, 2004, 2005 Francois Romieu <[email protected]>

   Based on r8169.c, tg3.c, 8139cp.c, skge.c, epic100.c and SiS 190/191
   genuine driver.

   This software may be used and distributed according to the terms of
   the GNU General Public License (GPL), incorporated herein by reference.
   Drivers based on or derived from this code fall under the GPL and must
   retain the authorship, copyright and license notice.  This file is not
   a complete program and may only be used when the entire operating
   system is licensed under the GPL.

   See the file COPYING in this distribution for more information.

*/

#define pr_fmt(fmt)

#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/netdevice.h>
#include <linux/rtnetlink.h>
#include <linux/etherdevice.h>
#include <linux/ethtool.h>
#include <linux/pci.h>
#include <linux/mii.h>
#include <linux/delay.h>
#include <linux/crc32.h>
#include <linux/dma-mapping.h>
#include <linux/slab.h>
#include <asm/irq.h>

#define PHY_MAX_ADDR
#define PHY_ID_ANY
#define MII_REG_ANY

#define DRV_VERSION
#define DRV_NAME
#define SIS190_DRIVER_NAME

#define sis190_rx_skb
#define sis190_rx_quota(count, quota)

#define NUM_TX_DESC
#define NUM_RX_DESC
#define TX_RING_BYTES
#define RX_RING_BYTES
#define RX_BUF_SIZE
#define RX_BUF_MASK

#define SIS190_REGS_SIZE
#define SIS190_TX_TIMEOUT
#define SIS190_PHY_TIMEOUT
#define SIS190_MSG_DEFAULT

/* Enhanced PHY access register bit definitions */
#define EhnMIIread
#define EhnMIIwrite
#define EhnMIIdataShift
#define EhnMIIpmdShift
#define EhnMIIregShift
#define EhnMIIreq
#define EhnMIInotDone

/* Write/read MMIO register */
#define SIS_W8(reg, val)
#define SIS_W16(reg, val)
#define SIS_W32(reg, val)
#define SIS_R8(reg)
#define SIS_R16(reg)
#define SIS_R32(reg)

#define SIS_PCI_COMMIT()

enum sis190_registers {};

enum sis190_register_content {};

struct TxDesc {};

struct RxDesc {};

enum _DescStatusBit {};

enum sis190_eeprom_access_register_bits {};

/* EEPROM Addresses */
enum sis190_eeprom_address {};

enum sis190_feature {};

struct sis190_private {};

struct sis190_phy {};

enum sis190_phy_type {};

static struct mii_chip_info {} mii_chip_table[] =;

static const struct {} sis_chip_info[] =;

static const struct pci_device_id sis190_pci_tbl[] =;

MODULE_DEVICE_TABLE(pci, sis190_pci_tbl);

static int rx_copybreak =;

static struct {} debug =;

MODULE_DESCRIPTION();
module_param(rx_copybreak, int, 0);
MODULE_PARM_DESC();
module_param_named(debug, debug.msg_enable, int, 0);
MODULE_PARM_DESC();
MODULE_AUTHOR();
MODULE_VERSION();
MODULE_LICENSE();

static const u32 sis190_intr_mask =;

/*
 * Maximum number of multicast addresses to filter (vs. Rx-all-multicast).
 * The chips use a 64 element hash table based on the Ethernet CRC.
 */
static const int multicast_filter_limit =;

static void __mdio_cmd(void __iomem *ioaddr, u32 ctl)
{}

static void mdio_write(void __iomem *ioaddr, int phy_id, int reg, int val)
{}

static int mdio_read(void __iomem *ioaddr, int phy_id, int reg)
{}

static void __mdio_write(struct net_device *dev, int phy_id, int reg, int val)
{}

static int __mdio_read(struct net_device *dev, int phy_id, int reg)
{}

static u16 mdio_read_latched(void __iomem *ioaddr, int phy_id, int reg)
{}

static u16 sis190_read_eeprom(void __iomem *ioaddr, u32 reg)
{}

static void sis190_irq_mask_and_ack(void __iomem *ioaddr)
{}

static void sis190_asic_down(void __iomem *ioaddr)
{}

static void sis190_mark_as_last_descriptor(struct RxDesc *desc)
{}

static inline void sis190_give_to_asic(struct RxDesc *desc, u32 rx_buf_sz)
{}

static inline void sis190_map_to_asic(struct RxDesc *desc, dma_addr_t mapping,
				      u32 rx_buf_sz)
{}

static inline void sis190_make_unusable_by_asic(struct RxDesc *desc)
{}

static struct sk_buff *sis190_alloc_rx_skb(struct sis190_private *tp,
					   struct RxDesc *desc)
{}

static u32 sis190_rx_fill(struct sis190_private *tp, struct net_device *dev,
			  u32 start, u32 end)
{}

static bool sis190_try_rx_copy(struct sis190_private *tp,
			       struct sk_buff **sk_buff, int pkt_size,
			       dma_addr_t addr)
{}

static inline int sis190_rx_pkt_err(u32 status, struct net_device_stats *stats)
{}

static int sis190_rx_interrupt(struct net_device *dev,
			       struct sis190_private *tp, void __iomem *ioaddr)
{}

static void sis190_unmap_tx_skb(struct pci_dev *pdev, struct sk_buff *skb,
				struct TxDesc *desc)
{}

static inline int sis190_tx_pkt_err(u32 status, struct net_device_stats *stats)
{}

static void sis190_tx_interrupt(struct net_device *dev,
				struct sis190_private *tp, void __iomem *ioaddr)
{}

/*
 * The interrupt handler does all of the Rx thread work and cleans up after
 * the Tx thread.
 */
static irqreturn_t sis190_irq(int irq, void *__dev)
{}

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

static void sis190_free_rx_skb(struct sis190_private *tp,
			       struct sk_buff **sk_buff, struct RxDesc *desc)
{}

static void sis190_rx_clear(struct sis190_private *tp)
{}

static void sis190_init_ring_indexes(struct sis190_private *tp)
{}

static int sis190_init_ring(struct net_device *dev)
{}

static void sis190_set_rx_mode(struct net_device *dev)
{}

static void sis190_soft_reset(void __iomem *ioaddr)
{}

static void sis190_hw_start(struct net_device *dev)
{}

static void sis190_phy_task(struct work_struct *work)
{}

static void sis190_phy_timer(struct timer_list *t)
{}

static inline void sis190_delete_timer(struct net_device *dev)
{}

static inline void sis190_request_timer(struct net_device *dev)
{}

static void sis190_set_rxbufsize(struct sis190_private *tp,
				 struct net_device *dev)
{}

static int sis190_open(struct net_device *dev)
{}

static void sis190_tx_clear(struct sis190_private *tp)
{}

static void sis190_down(struct net_device *dev)
{}

static int sis190_close(struct net_device *dev)
{}

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

static void sis190_free_phy(struct list_head *first_phy)
{}

/**
 *	sis190_default_phy - Select default PHY for sis190 mac.
 *	@dev: the net device to probe for
 *
 *	Select first detected PHY with link as default.
 *	If no one is link on, select PHY whose types is HOME as default.
 *	If HOME doesn't exist, select LAN.
 */
static u16 sis190_default_phy(struct net_device *dev)
{}

static void sis190_init_phy(struct net_device *dev, struct sis190_private *tp,
			    struct sis190_phy *phy, unsigned int phy_id,
			    u16 mii_status)
{}

static void sis190_mii_probe_88e1111_fixup(struct sis190_private *tp)
{}

/**
 *	sis190_mii_probe - Probe MII PHY for sis190
 *	@dev: the net device to probe for
 *
 *	Search for total of 32 possible mii phy addresses.
 *	Identify and set current phy if found one,
 *	return error if it failed to found.
 */
static int sis190_mii_probe(struct net_device *dev)
{}

static void sis190_mii_remove(struct net_device *dev)
{}

static void sis190_release_board(struct pci_dev *pdev)
{}

static struct net_device *sis190_init_board(struct pci_dev *pdev)
{}

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

static void sis190_set_rgmii(struct sis190_private *tp, u8 reg)
{}

static int sis190_get_mac_addr_from_eeprom(struct pci_dev *pdev,
					   struct net_device *dev)
{}

/**
 *	sis190_get_mac_addr_from_apc - Get MAC address for SiS96x model
 *	@pdev: PCI device
 *	@dev:  network device to get address for
 *
 *	SiS96x model, use APC CMOS RAM to store MAC address.
 *	APC CMOS RAM is accessed through ISA bridge.
 *	MAC address is read into @net_dev->dev_addr.
 */
static int sis190_get_mac_addr_from_apc(struct pci_dev *pdev,
					struct net_device *dev)
{}

/**
 *      sis190_init_rxfilter - Initialize the Rx filter
 *      @dev: network device to initialize
 *
 *      Set receive filter address to our MAC address
 *      and enable packet filtering.
 */
static inline void sis190_init_rxfilter(struct net_device *dev)
{}

static int sis190_get_mac_addr(struct pci_dev *pdev, struct net_device *dev)
{}

static void sis190_set_speed_auto(struct net_device *dev)
{}

static int sis190_get_link_ksettings(struct net_device *dev,
				     struct ethtool_link_ksettings *cmd)
{}

static int sis190_set_link_ksettings(struct net_device *dev,
				     const struct ethtool_link_ksettings *cmd)
{}

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

static int sis190_get_regs_len(struct net_device *dev)
{}

static void sis190_get_regs(struct net_device *dev, struct ethtool_regs *regs,
			    void *p)
{}

static int sis190_nway_reset(struct net_device *dev)
{}

static u32 sis190_get_msglevel(struct net_device *dev)
{}

static void sis190_set_msglevel(struct net_device *dev, u32 value)
{}

static const struct ethtool_ops sis190_ethtool_ops =;

static int sis190_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
{}

static int sis190_mac_addr(struct net_device  *dev, void *p)
{}

static const struct net_device_ops sis190_netdev_ops =;

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

static void sis190_remove_one(struct pci_dev *pdev)
{}

static struct pci_driver sis190_pci_driver =;

module_pci_driver();