MOXA linux-2.6.x / linux-2.6.9-uc0 from sdlinux-moxaart.tgz
[linux-2.6.9-moxart.git] / drivers / net / dgrs_ether.h
blob51596ce6cf84f63e20f7af0bd61c152103c2495d
1 /*
2 * A filtering function. There are two filters/port. Filter "0"
3 * is the input filter, and filter "1" is the output filter.
4 */
5 typedef int (FILTER_FUNC)(uchar *pktp, int pktlen, ulong *scratch, int port);
6 #define NFILTERS 2
8 /*
9 * The per port structure
11 typedef struct
13 int chan; /* Channel number (0-3) */
14 ulong portaddr; /* address of 596 port register */
15 volatile ulong *ca; /* address of 596 chan attention */
16 ulong intmask; /* Interrupt mask for this port */
17 ulong intack; /* Ack bit for this port */
19 uchar ethaddr[6]; /* Ethernet address of this port */
20 int is_promisc; /* Port is promiscuous */
22 int debug; /* Debugging turned on */
24 I596_ISCP *iscpp; /* Uncached ISCP pointer */
25 I596_SCP *scpp; /* Uncached SCP pointer */
26 I596_SCB *scbp; /* Uncached SCB pointer */
28 I596_ISCP iscp;
29 I596_SCB scb;
31 /* Command Queue */
32 I596_CB *cb0;
33 I596_CB *cbN;
34 I596_CB *cb_head;
35 I596_CB *cb_tail;
37 /* Receive Queue */
38 I596_RFD *rfd0;
39 I596_RFD *rfdN;
40 I596_RFD *rfd_head;
41 I596_RFD *rfd_tail;
43 /* Receive Buffers */
44 I596_RBD *rbd0;
45 I596_RBD *rbdN;
46 I596_RBD *rbd_head;
47 I596_RBD *rbd_tail;
48 int buf_size; /* Size of an RBD buffer */
49 int buf_cnt; /* Total RBD's allocated */
51 /* Rx Statistics */
52 ulong cnt_rx_cnt; /* Total packets rcvd, good and bad */
53 ulong cnt_rx_good; /* Total good packets rcvd */
54 ulong cnt_rx_bad; /* Total of all bad packets rcvd */
55 /* Subtotals can be gotten from SCB */
56 ulong cnt_rx_nores; /* No resources */
57 ulong cnt_rx_bytes; /* Total bytes rcvd */
59 /* Tx Statistics */
60 ulong cnt_tx_queued;
61 ulong cnt_tx_done;
62 ulong cnt_tx_freed;
63 ulong cnt_tx_nores; /* No resources */
65 ulong cnt_tx_bad;
66 ulong cnt_tx_err_late;
67 ulong cnt_tx_err_nocrs;
68 ulong cnt_tx_err_nocts;
69 ulong cnt_tx_err_under;
70 ulong cnt_tx_err_maxcol;
71 ulong cnt_tx_collisions;
73 /* Special stuff for host */
74 # define rfd_freed cnt_rx_cnt
75 ulong rbd_freed;
76 int host_timer;
78 /* Added after first beta */
79 ulong cnt_tx_races; /* Counts race conditions */
80 int spanstate;
81 ulong cnt_st_tx; /* send span tree pkts */
82 ulong cnt_st_fail_tx; /* Failures to send span tree pkts */
83 ulong cnt_st_fail_rbd;/* Failures to send span tree pkts */
84 ulong cnt_st_rx; /* rcv span tree pkts */
85 ulong cnt_st_rx_bad; /* bogus st packets rcvd */
86 ulong cnt_rx_fwd; /* Rcvd packets that were forwarded */
88 ulong cnt_rx_mcast; /* Multicast pkts received */
89 ulong cnt_tx_mcast; /* Multicast pkts transmitted */
90 ulong cnt_tx_bytes; /* Bytes transmitted */
93 * Packet filtering
94 * Filter 0: input filter
95 * Filter 1: output filter
98 ulong *filter_space[NFILTERS];
99 FILTER_FUNC *filter_func[NFILTERS];
100 ulong filter_cnt[NFILTERS];
101 ulong filter_len[NFILTERS];
103 ulong pad[ (512-300) / 4];
104 } PORT;
107 * Port[0] is host interface
108 * Port[1..SE_NPORTS] are external 10 Base T ports. Fewer may be in
109 * use, depending on whether this is an SE-4 or
110 * an SE-6.
111 * Port[SE_NPORTS] Pseudo-port for Spanning tree and SNMP
113 extern PORT Port[1+SE_NPORTS+1];
115 extern int Nports; /* Number of genuine ethernet controllers */
116 extern int Nchan; /* ... plus one for host interface */
118 extern int FirstChan; /* 0 or 1, depedning on whether host is used */
119 extern int NumChan; /* 4 or 5 */
122 * A few globals
124 extern int IsPromisc;
125 extern int MultiNicMode;
128 * Functions
130 extern void eth_xmit_spew_on(PORT *p, int cnt);
131 extern void eth_xmit_spew_off(PORT *p);
133 extern I596_RBD *alloc_rbds(PORT *p, int num);
135 extern I596_CB * eth_cb_alloc(PORT *p);