0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027 #ifndef __COM20020_H
0028 #define __COM20020_H
0029 #include <linux/leds.h>
0030
0031 int com20020_check(struct net_device *dev);
0032 int com20020_found(struct net_device *dev, int shared);
0033 extern const struct net_device_ops com20020_netdev_ops;
0034
0035
0036 #define ARCNET_TOTAL_SIZE 8
0037
0038 #define PLX_PCI_MAX_CARDS 2
0039
0040 struct ledoffsets {
0041 int green;
0042 int red;
0043 };
0044
0045 struct com20020_pci_channel_map {
0046 u32 bar;
0047 u32 offset;
0048 u32 size;
0049 };
0050
0051 struct com20020_pci_card_info {
0052 const char *name;
0053 int devcount;
0054
0055 struct com20020_pci_channel_map chan_map_tbl[PLX_PCI_MAX_CARDS];
0056 struct com20020_pci_channel_map misc_map;
0057
0058 struct ledoffsets leds[PLX_PCI_MAX_CARDS];
0059 int rotary;
0060
0061 unsigned int flags;
0062 };
0063
0064 struct com20020_priv {
0065 struct com20020_pci_card_info *ci;
0066 struct list_head list_dev;
0067 resource_size_t misc;
0068 };
0069
0070 struct com20020_dev {
0071 struct list_head list;
0072 struct net_device *dev;
0073
0074 struct led_classdev tx_led;
0075 struct led_classdev recon_led;
0076
0077 struct com20020_priv *pci_priv;
0078 int index;
0079 };
0080
0081 #define COM20020_REG_W_INTMASK 0
0082 #define COM20020_REG_R_STATUS 0
0083 #define COM20020_REG_W_COMMAND 1
0084 #define COM20020_REG_R_DIAGSTAT 1
0085 #define COM20020_REG_W_ADDR_HI 2
0086 #define COM20020_REG_W_ADDR_LO 3
0087 #define COM20020_REG_RW_MEMDATA 4
0088 #define COM20020_REG_W_SUBADR 5
0089 #define COM20020_REG_W_CONFIG 6
0090 #define COM20020_REG_W_XREG 7
0091
0092
0093
0094
0095 #define RDDATAflag 0x80
0096
0097
0098 #define NEWNXTIDflag 0x02
0099
0100
0101 #define RESETcfg 0x80
0102 #define TXENcfg 0x20
0103 #define XTOcfg(x) ((x) << 3)
0104
0105
0106 #define PROMISCset 0x10
0107 #define P1MODE 0x80
0108 #define SLOWARB 0x01
0109
0110
0111 #define SUB_TENTATIVE 0
0112 #define SUB_NODE 1
0113 #define SUB_SETUP1 2
0114 #define SUB_TEST 3
0115
0116
0117 #define SUB_SETUP2 4
0118 #define SUB_BUSCTL 5
0119 #define SUB_DMACOUNT 6
0120
0121 static inline void com20020_set_subaddress(struct arcnet_local *lp,
0122 int ioaddr, int val)
0123 {
0124 if (val < 4) {
0125 lp->config = (lp->config & ~0x03) | val;
0126 arcnet_outb(lp->config, ioaddr, COM20020_REG_W_CONFIG);
0127 } else {
0128 arcnet_outb(val, ioaddr, COM20020_REG_W_SUBADR);
0129 }
0130 }
0131
0132 #endif