This source file includes following definitions.
- com20020_set_subaddress
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27 #ifndef __COM20020_H
28 #define __COM20020_H
29 #include <linux/leds.h>
30
31 int com20020_check(struct net_device *dev);
32 int com20020_found(struct net_device *dev, int shared);
33 extern const struct net_device_ops com20020_netdev_ops;
34
35
36 #define ARCNET_TOTAL_SIZE 8
37
38 #define PLX_PCI_MAX_CARDS 2
39
40 struct ledoffsets {
41 int green;
42 int red;
43 };
44
45 struct com20020_pci_channel_map {
46 u32 bar;
47 u32 offset;
48 u32 size;
49 };
50
51 struct com20020_pci_card_info {
52 const char *name;
53 int devcount;
54
55 struct com20020_pci_channel_map chan_map_tbl[PLX_PCI_MAX_CARDS];
56 struct com20020_pci_channel_map misc_map;
57
58 struct ledoffsets leds[PLX_PCI_MAX_CARDS];
59 int rotary;
60
61 unsigned int flags;
62 };
63
64 struct com20020_priv {
65 struct com20020_pci_card_info *ci;
66 struct list_head list_dev;
67 resource_size_t misc;
68 };
69
70 struct com20020_dev {
71 struct list_head list;
72 struct net_device *dev;
73
74 struct led_classdev tx_led;
75 struct led_classdev recon_led;
76
77 struct com20020_priv *pci_priv;
78 int index;
79 };
80
81 #define COM20020_REG_W_INTMASK 0
82 #define COM20020_REG_R_STATUS 0
83 #define COM20020_REG_W_COMMAND 1
84 #define COM20020_REG_R_DIAGSTAT 1
85 #define COM20020_REG_W_ADDR_HI 2
86 #define COM20020_REG_W_ADDR_LO 3
87 #define COM20020_REG_RW_MEMDATA 4
88 #define COM20020_REG_W_SUBADR 5
89 #define COM20020_REG_W_CONFIG 6
90 #define COM20020_REG_W_XREG 7
91
92
93
94
95 #define RDDATAflag 0x80
96
97
98 #define NEWNXTIDflag 0x02
99
100
101 #define RESETcfg 0x80
102 #define TXENcfg 0x20
103 #define XTOcfg(x) ((x) << 3)
104
105
106 #define PROMISCset 0x10
107 #define P1MODE 0x80
108 #define SLOWARB 0x01
109
110
111 #define SUB_TENTATIVE 0
112 #define SUB_NODE 1
113 #define SUB_SETUP1 2
114 #define SUB_TEST 3
115
116
117 #define SUB_SETUP2 4
118 #define SUB_BUSCTL 5
119 #define SUB_DMACOUNT 6
120
121 static inline void com20020_set_subaddress(struct arcnet_local *lp,
122 int ioaddr, int val)
123 {
124 if (val < 4) {
125 lp->config = (lp->config & ~0x03) | val;
126 arcnet_outb(lp->config, ioaddr, COM20020_REG_W_CONFIG);
127 } else {
128 arcnet_outb(val, ioaddr, COM20020_REG_W_SUBADR);
129 }
130 }
131
132 #endif