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 */
45 #define _INTMASK (ioaddr+BUS_ALIGN*0) /* writable */
46 #define _STATUS (ioaddr+BUS_ALIGN*0) /* readable */
47 #define _COMMAND (ioaddr+BUS_ALIGN*1) /* standard arcnet commands */
48 #define _DIAGSTAT (ioaddr+BUS_ALIGN*1) /* diagnostic status register */
49 #define _ADDR_HI (ioaddr+BUS_ALIGN*2) /* control registers for IO-mapped memory */
50 #define _ADDR_LO (ioaddr+BUS_ALIGN*3)
51 #define _MEMDATA (ioaddr+BUS_ALIGN*4) /* data port for IO-mapped memory */
52 #define _SUBADR (ioaddr+BUS_ALIGN*5) /* the extended port _XREG refers to */
53 #define _CONFIG (ioaddr+BUS_ALIGN*6) /* configuration register */
54 #define _XREG (ioaddr+BUS_ALIGN*7) /* extra registers (indexed by _CONFIG
57 /* in the ADDR_HI register */
58 #define RDDATAflag 0x80 /* next access is a read (not a write) */
60 /* in the DIAGSTAT register */
61 #define NEWNXTIDflag 0x02 /* ID to which token is passed has changed */
63 /* in the CONFIG register */
64 #define RESETcfg 0x80 /* put card in reset state */
65 #define TXENcfg 0x20 /* enable TX */
67 /* in SETUP register */
68 #define PROMISCset 0x10 /* enable RCV_ALL */
69 #define P1MODE 0x80 /* enable P1-MODE for Backplane */
70 #define SLOWARB 0x01 /* enable Slow Arbitration for >=5Mbps */
73 #define SUB_TENTATIVE 0 /* tentative node ID */
74 #define SUB_NODE 1 /* node ID */
75 #define SUB_SETUP1 2 /* various options */
76 #define SUB_TEST 3 /* test/diag register */
79 #define SUB_SETUP2 4 /* sundry options */
80 #define SUB_BUSCTL 5 /* bus control options */
81 #define SUB_DMACOUNT 6 /* DMA count options */
83 #define SET_SUBADR(x) do { \
86 lp->config = (lp->config & ~0x03) | (x); \
100 #define ARCRESET { outb(lp->config | 0x80, _CONFIG); \
102 outb(lp->config , _CONFIG); \
104 #define ARCRESET0 { outb(0x18 | 0x80, _CONFIG); \
106 outb(0x18 , _CONFIG); \
109 #define ASTATUS() inb(_STATUS)
110 #define ADIAGSTATUS() inb(_DIAGSTAT)
111 #define ACOMMAND(cmd) outb((cmd),_COMMAND)
112 #define AINTMASK(msk) outb((msk),_INTMASK)
114 #define SETCONF outb(lp->config, _CONFIG)
116 #endif /* __COM20020_H */