1
2
3
4 typedef int (FILTER_FUNC)(uchar *pktp, int pktlen, ulong *scratch);
5 #define NFILTERS 2
6
7
8
9
10 typedef struct
11 {
12 int chan;
13 ulong portaddr;
14 volatile ulong *ca;
15 ulong intmask;
16 ulong intack;
17
18 uchar ethaddr[6];
19 int is_promisc;
20
21 int debug;
22
23 I596_ISCP *iscpp;
24 I596_SCP *scpp;
25 I596_SCB *scbp;
26
27 I596_ISCP iscp;
28 I596_SCB scb;
29
30
31 I596_CB *cb0;
32 I596_CB *cbN;
33 I596_CB *cb_head;
34 I596_CB *cb_tail;
35
36
37 I596_RFD *rfd0;
38 I596_RFD *rfdN;
39 I596_RFD *rfd_head;
40 I596_RFD *rfd_tail;
41
42
43 I596_RBD *rbd0;
44 I596_RBD *rbdN;
45 I596_RBD *rbd_head;
46 I596_RBD *rbd_tail;
47 int buf_size;
48 int buf_cnt;
49
50
51 ulong cnt_rx_cnt;
52 ulong cnt_rx_good;
53 ulong cnt_rx_bad;
54
55 ulong cnt_rx_nores;
56 ulong cnt_rx_bytes;
57
58
59 ulong cnt_tx_queued;
60 ulong cnt_tx_done;
61 ulong cnt_tx_freed;
62 ulong cnt_tx_nores;
63
64 ulong cnt_tx_bad;
65 ulong cnt_tx_err_late;
66 ulong cnt_tx_err_nocrs;
67 ulong cnt_tx_err_nocts;
68 ulong cnt_tx_err_under;
69 ulong cnt_tx_err_maxcol;
70 ulong cnt_tx_collisions;
71
72
73 # define rfd_freed cnt_rx_cnt
74 ulong rbd_freed;
75 int host_timer;
76
77
78 ulong cnt_tx_races;
79 int spanstate;
80 ulong cnt_st_tx;
81 ulong cnt_st_fail_tx;
82 ulong cnt_st_fail_rbd;
83 ulong cnt_st_rx;
84 ulong cnt_st_rx_bad;
85 ulong cnt_rx_fwd;
86
87 ulong cnt_rx_mcast;
88 ulong cnt_tx_mcast;
89 ulong cnt_tx_bytes;
90
91
92
93
94
95
96
97 ulong *filter_space[NFILTERS];
98 FILTER_FUNC *filter_func[NFILTERS];
99 ulong filter_cnt[NFILTERS];
100 ulong filter_len[NFILTERS];
101
102 ulong pad[ (512-300) / 4];
103 } PORT;
104
105
106
107
108
109
110
111
112 extern PORT Port[1+SE_NPORTS+1];
113
114 extern int Nports;
115 extern int Nchan;
116
117 extern int FirstChan;
118 extern int NumChan;
119
120
121
122
123 extern void eth_xmit_spew_on(PORT *p, int cnt);
124 extern void eth_xmit_spew_off(PORT *p);
125
126 extern I596_RBD *alloc_rbds(PORT *p, int num);
127
128 extern I596_CB * eth_cb_alloc(PORT *p);