linux/drivers/net/ethernet/dec/tulip/tulip.h

/*
	drivers/net/ethernet/dec/tulip/tulip.h

	Copyright 2000,2001  The Linux Kernel Team
	Written/copyright 1994-2001 by Donald Becker.

	This software may be used and distributed according to the terms
	of the GNU General Public License, incorporated herein by reference.

	Please submit bugs to http://bugzilla.kernel.org/ .
*/

#ifndef __NET_TULIP_H__
#define __NET_TULIP_H__

#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/spinlock.h>
#include <linux/netdevice.h>
#include <linux/ethtool.h>
#include <linux/timer.h>
#include <linux/delay.h>
#include <linux/pci.h>
#include <asm/io.h>
#include <asm/irq.h>
#include <asm/unaligned.h>



/* undefine, or define to various debugging levels (>4 == obscene levels) */
#define TULIP_DEBUG

#ifdef CONFIG_TULIP_MMIO
#define TULIP_BAR
#else
#define TULIP_BAR
#endif



struct tulip_chip_table {};


enum tbl_flag {};


/* chip types.  careful!  order is VERY IMPORTANT here, as these
 * are used throughout the driver as indices into arrays */
/* Note 21142 == 21143. */
enum chips {};


enum MediaIs {};


/* Offsets to the Command and Status Registers, "CSRs".  All accesses
   must be longword instructions and quadword aligned. */
enum tulip_offsets {};

/* register offset and bits for CFDD PCI config reg */
enum pci_cfg_driver_reg {};

#define RxPollInt

/* The bits in the CSR5 status registers, mostly interrupt sources. */
enum status_bits {};

/* bit mask for CSR5 TX/RX process state */
#define CSR5_TS
#define CSR5_RS

enum tulip_mode_bits {};


enum tulip_busconfig_bits {};


/* The Tulip Rx and Tx buffer descriptors. */
struct tulip_rx_desc {};


struct tulip_tx_desc {};


enum desc_status_bits {};


enum t21143_csr6_bits {};

enum tulip_comet_csr13_bits {};

enum tulip_comet_csr18_bits {};

enum tulip_comet_csr20_bits {};

/* Keep the ring sizes a power of two for efficiency.
   Making the Tx ring too large decreases the effectiveness of channel
   bonding and packet priority.
   There are no ill effects from too-large receive rings. */

#define TX_RING_SIZE
#define RX_RING_SIZE
#define MEDIA_MASK

/* The receiver on the DC21143 rev 65 can fail to close the last
 * receive descriptor in certain circumstances (see errata) when
 * using MWI. This can only occur if the receive buffer ends on
 * a cache line boundary, so the "+ 4" below ensures it doesn't.
 */
#define PKT_BUF_SZ

#define TULIP_MIN_CACHE_LINE

#if defined(__sparc__) || defined(__hppa__)
/* The UltraSparc PCI controllers will disconnect at every 64-byte
 * crossing anyways so it makes no sense to tell Tulip to burst
 * any more than that.
 */
#define TULIP_MAX_CACHE_LINE
#else
#define TULIP_MAX_CACHE_LINE
#endif


/* Ring-wrap flag in length field, use for last ring entry.
	0x01000000 means chain on buffer2 address,
	0x02000000 means use the ring start address in CSR2/3.
   Note: Some work-alike chips do not function correctly in chained mode.
   The ASIX chip works only in chained mode.
   Thus we indicates ring mode, but always write the 'next' field for
   chained mode as well.
*/
#define DESC_RING_WRAP


#define EEPROM_SIZE


#define RUN_AT(x)

#define get_u16(ptr)

struct medialeaf {};


struct mediatable {};


struct mediainfo {};

struct ring_info {};


struct tulip_private {};


struct eeprom_fixup {};


/* 21142.c */
extern u16 t21142_csr14[];
void t21142_media_task(struct work_struct *work);
void t21142_start_nway(struct net_device *dev);
void t21142_lnk_change(struct net_device *dev, int csr5);


/* PNIC2.c */
void pnic2_lnk_change(struct net_device *dev, int csr5);
void pnic2_timer(struct timer_list *t);
void pnic2_start_nway(struct net_device *dev);

/* eeprom.c */
void tulip_parse_eeprom(struct net_device *dev);
int tulip_read_eeprom(struct net_device *dev, int location, int addr_len);

/* interrupt.c */
extern unsigned int tulip_max_interrupt_work;
extern int tulip_rx_copybreak;
irqreturn_t tulip_interrupt(int irq, void *dev_instance);
int tulip_refill_rx(struct net_device *dev);
#ifdef CONFIG_TULIP_NAPI
int tulip_poll(struct napi_struct *napi, int budget);
#endif


/* media.c */
int tulip_mdio_read(struct net_device *dev, int phy_id, int location);
void tulip_mdio_write(struct net_device *dev, int phy_id, int location, int value);
void tulip_select_media(struct net_device *dev, int startup);
int tulip_check_duplex(struct net_device *dev);
void tulip_find_mii (struct net_device *dev, int board_idx);

/* pnic.c */
void pnic_do_nway(struct net_device *dev);
void pnic_lnk_change(struct net_device *dev, int csr5);
void pnic_timer(struct timer_list *t);

/* timer.c */
void tulip_media_task(struct work_struct *work);
void mxic_timer(struct timer_list *t);
void comet_timer(struct timer_list *t);

/* tulip_core.c */
extern int tulip_debug;
extern const char * const medianame[];
extern const char tulip_media_cap[];
extern const struct tulip_chip_table tulip_tbl[];
void oom_timer(struct timer_list *t);
extern u8 t21040_csr13[];

static inline void tulip_start_rxtx(struct tulip_private *tp)
{}

static inline void tulip_stop_rxtx(struct tulip_private *tp)
{}

static inline void tulip_restart_rxtx(struct tulip_private *tp)
{}

static inline void tulip_tx_timeout_complete(struct tulip_private *tp, void __iomem *ioaddr)
{}

#endif /* __NET_TULIP_H__ */