aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/dgrs_ether.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /drivers/net/dgrs_ether.h
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'drivers/net/dgrs_ether.h')
-rw-r--r--drivers/net/dgrs_ether.h135
1 files changed, 135 insertions, 0 deletions
diff --git a/drivers/net/dgrs_ether.h b/drivers/net/dgrs_ether.h
new file mode 100644
index 000000000000..51596ce6cf84
--- /dev/null
+++ b/drivers/net/dgrs_ether.h
@@ -0,0 +1,135 @@
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 */
5typedef int (FILTER_FUNC)(uchar *pktp, int pktlen, ulong *scratch, int port);
6#define NFILTERS 2
7
8/*
9 * The per port structure
10 */
11typedef struct
12{
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 */
18
19 uchar ethaddr[6]; /* Ethernet address of this port */
20 int is_promisc; /* Port is promiscuous */
21
22 int debug; /* Debugging turned on */
23
24 I596_ISCP *iscpp; /* Uncached ISCP pointer */
25 I596_SCP *scpp; /* Uncached SCP pointer */
26 I596_SCB *scbp; /* Uncached SCB pointer */
27
28 I596_ISCP iscp;
29 I596_SCB scb;
30
31 /* Command Queue */
32 I596_CB *cb0;
33 I596_CB *cbN;
34 I596_CB *cb_head;
35 I596_CB *cb_tail;
36
37 /* Receive Queue */
38 I596_RFD *rfd0;
39 I596_RFD *rfdN;
40 I596_RFD *rfd_head;
41 I596_RFD *rfd_tail;
42
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 */
50
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 */
58
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 */
64
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;
72
73 /* Special stuff for host */
74# define rfd_freed cnt_rx_cnt
75 ulong rbd_freed;
76 int host_timer;
77
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 */
87
88 ulong cnt_rx_mcast; /* Multicast pkts received */
89 ulong cnt_tx_mcast; /* Multicast pkts transmitted */
90 ulong cnt_tx_bytes; /* Bytes transmitted */
91
92 /*
93 * Packet filtering
94 * Filter 0: input filter
95 * Filter 1: output filter
96 */
97
98 ulong *filter_space[NFILTERS];
99 FILTER_FUNC *filter_func[NFILTERS];
100 ulong filter_cnt[NFILTERS];
101 ulong filter_len[NFILTERS];
102
103 ulong pad[ (512-300) / 4];
104} PORT;
105
106/*
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
112 */
113extern PORT Port[1+SE_NPORTS+1];
114
115extern int Nports; /* Number of genuine ethernet controllers */
116extern int Nchan; /* ... plus one for host interface */
117
118extern int FirstChan; /* 0 or 1, depedning on whether host is used */
119extern int NumChan; /* 4 or 5 */
120
121/*
122 * A few globals
123 */
124extern int IsPromisc;
125extern int MultiNicMode;
126
127/*
128 * Functions
129 */
130extern void eth_xmit_spew_on(PORT *p, int cnt);
131extern void eth_xmit_spew_off(PORT *p);
132
133extern I596_RBD *alloc_rbds(PORT *p, int num);
134
135extern I596_CB * eth_cb_alloc(PORT *p);