2 * Linux ARCnet driver - COM20020 chipset support - function declarations
4 * Written 1997 by David Woodhouse.
5 * Written 1994-1999 by Avery Pennarun.
6 * Derived from skeleton.c by Donald Becker.
8 * Special thanks to Contemporary Controls, Inc. (www.ccontrols.com)
9 * for sponsoring the further development of this driver.
11 * **********************
13 * The original copyright of skeleton.c was as follows:
15 * skeleton.c Written 1993 by Donald Becker.
16 * Copyright 1993 United States Government as represented by the
17 * Director, National Security Agency. This software may only be used
18 * and distributed according to the terms of the GNU General Public License as
19 * modified by SRC, incorporated herein by reference.
21 * **********************
23 * For more details, see drivers/net/arcnet.c
25 * **********************
30 int com20020_check(struct net_device *dev);
31 int com20020_found(struct net_device *dev, int shared);
32 extern const struct net_device_ops com20020_netdev_ops;
34 /* The number of low I/O ports used by the card. */
35 #define ARCNET_TOTAL_SIZE 8
37 /* various register addresses */
38 #ifdef CONFIG_SA1100_CT6001
39 #define BUS_ALIGN 2 /* 8 bit device on a 16 bit bus - needs padding */
44 #define PLX_PCI_MAX_CARDS 2
46 struct com20020_pci_channel_map {
49 u32 size; /* 0x00 - auto, e.g. length of entire bar */
52 struct com20020_pci_card_info {
56 struct com20020_pci_channel_map chan_map_tbl[PLX_PCI_MAX_CARDS];
61 struct com20020_priv {
62 struct com20020_pci_card_info *ci;
63 struct list_head list_dev;
67 struct list_head list;
68 struct net_device *dev;
70 struct com20020_priv *pci_priv;
74 #define _INTMASK (ioaddr+BUS_ALIGN*0) /* writable */
75 #define _STATUS (ioaddr+BUS_ALIGN*0) /* readable */
76 #define _COMMAND (ioaddr+BUS_ALIGN*1) /* standard arcnet commands */
77 #define _DIAGSTAT (ioaddr+BUS_ALIGN*1) /* diagnostic status register */
78 #define _ADDR_HI (ioaddr+BUS_ALIGN*2) /* control registers for IO-mapped memory */
79 #define _ADDR_LO (ioaddr+BUS_ALIGN*3)
80 #define _MEMDATA (ioaddr+BUS_ALIGN*4) /* data port for IO-mapped memory */
81 #define _SUBADR (ioaddr+BUS_ALIGN*5) /* the extended port _XREG refers to */
82 #define _CONFIG (ioaddr+BUS_ALIGN*6) /* configuration register */
83 #define _XREG (ioaddr+BUS_ALIGN*7) /* extra registers (indexed by _CONFIG
86 /* in the ADDR_HI register */
87 #define RDDATAflag 0x80 /* next access is a read (not a write) */
89 /* in the DIAGSTAT register */
90 #define NEWNXTIDflag 0x02 /* ID to which token is passed has changed */
92 /* in the CONFIG register */
93 #define RESETcfg 0x80 /* put card in reset state */
94 #define TXENcfg 0x20 /* enable TX */
96 /* in SETUP register */
97 #define PROMISCset 0x10 /* enable RCV_ALL */
98 #define P1MODE 0x80 /* enable P1-MODE for Backplane */
99 #define SLOWARB 0x01 /* enable Slow Arbitration for >=5Mbps */
102 #define SUB_TENTATIVE 0 /* tentative node ID */
103 #define SUB_NODE 1 /* node ID */
104 #define SUB_SETUP1 2 /* various options */
105 #define SUB_TEST 3 /* test/diag register */
108 #define SUB_SETUP2 4 /* sundry options */
109 #define SUB_BUSCTL 5 /* bus control options */
110 #define SUB_DMACOUNT 6 /* DMA count options */
112 #define SET_SUBADR(x) do { \
115 lp->config = (lp->config & ~0x03) | (x); \
129 #define ARCRESET { outb(lp->config | 0x80, _CONFIG); \
131 outb(lp->config , _CONFIG); \
133 #define ARCRESET0 { outb(0x18 | 0x80, _CONFIG); \
135 outb(0x18 , _CONFIG); \
138 #define ASTATUS() inb(_STATUS)
139 #define ADIAGSTATUS() inb(_DIAGSTAT)
140 #define ACOMMAND(cmd) outb((cmd),_COMMAND)
141 #define AINTMASK(msk) outb((msk),_INTMASK)
143 #define SETCONF outb(lp->config, _CONFIG)
145 #endif /* __COM20020_H */