* added 0.99 linux version
[mascara-docs.git] / i386 / linux / linux-2.3.21 / drivers / ap1000 / apfddi.h
bloba77dd61602198a4a5fd3dcefef3d68d5dfe22221
1 /*
2 * Copyright 1996 The Australian National University.
3 * Copyright 1996 Fujitsu Laboratories Limited
4 *
5 * This software may be distributed under the terms of the Gnu
6 * Public License version 2 or later
7 */
8 #define BUFFER_MEM 0x40000
9 #define CSR0 0x60000
10 #define CSR1 0x60004
11 #define PLC 0x60080
12 #define FORMAC 0x60200
13 #define FIFO 0x68000
15 /* Size of buffer memory */
16 #define BUFFER_SIZE 32768 /* words; 128kB */
18 /* Bits in CSR0 */
19 #define CS0_INT_REQ 0x8000 /* board interrupt request asserted */
20 #define CS0_MAC_IRQ 0x4000 /* FORMAC is requesting interrupt */
21 #define CS0_PHY_IRQ 0x2000 /* PLC is requesting interrupt */
22 #define CS0_LED2 0x1000 /* turn on led 2 */
23 #define CS0_DO_IRQ 0x0200 /* request interrupt */
24 #define CS0_INT_ENABLE 0x0100 /* enable interrupt requests */
25 #define CS0_DMA_ENABLE 0x0080 /* enable DMA requests */
26 #define CS0_DMA_RECV 0x0040 /* DMA requests are in receive dirn. */
27 #define CS0_LED1 0x0010 /* turn on led 1 */
28 #define CS0_LED0 0x0008 /* turn on led 0 (red) */
29 #define CS0_HREQ 0x0007 /* host request to FORMAC */
30 #define CS0_HREQ_WSPEC 0x0002 /* write special frames */
31 #define CS0_HREQ_RECV 0x0003 /* read receive queue */
32 #define CS0_HREQ_WS 0x0004 /* write synchronous queue */
33 #define CS0_HREQ_WA0 0x0005 /* write async queue 0 */
34 #define CS0_HREQ_WA1 0x0006 /* write async queue 1 */
35 #define CS0_HREQ_WA2 0x0007 /* write async queue 2 */
37 /* Bits in CSR1 */
38 #define CS1_THIS_QAF 0x0800 /* this queue almost full */
39 #define CS1_FIFO_TAG 0x0400 /* tag of word at head of fifo */
40 #define CS1_BUF_RD_TAG 0x0200 /* tag of last word read from buffer */
41 #define CS1_BUF_WR_TAG 0x0100 /* tag to write to buffer */
42 #define CS1_TAGMODE 0x0080 /* enable tag mode */
43 #define CS1_RESET_MAC 0x0040 /* reset FORMAC and PLC */
44 #define CS1_RESET_FIFO 0x0020 /* reset FIFO */
45 #define CS1_CLEAR_QAF 0x0010 /* clear queue-almost-full bits */
46 #define CS1_FIFO_LEVEL 0x0007 /* # words in FIFO (0 - 4) */
49 * FDDI Frame Control values.
51 #define FDDI_SMT 0x41
52 #define FDDI_SMT_NSA 0x4f
53 #define FDDI_FC_LLC 0x50
54 #define FDDI_FC_LLC_MASK 0xf0
57 * Unnumbered LLC format commands
59 #define LLC_UI 0x3
60 #define LLC_UI_P 0x13
61 #define LLC_DISC 0x43
62 #define LLC_DISC_P 0x53
63 #define LLC_UA 0x63
64 #define LLC_UA_P 0x73
65 #define LLC_TEST 0xe3
66 #define LLC_TEST_P 0xf3
67 #define LLC_FRMR 0x87
68 #define LLC_FRMR_P 0x97
69 #define LLC_DM 0x0f
70 #define LLC_DM_P 0x1f
71 #define LLC_XID 0xaf
72 #define LLC_XID_P 0xbf
73 #define LLC_SABME 0x6f
74 #define LLC_SABME_P 0x7f
77 * Supervisory LLC commands
79 #define LLC_RR 0x01
80 #define LLC_RNR 0x05
81 #define LLC_REJ 0x09
84 * Info format - dummy only
86 #define LLC_INFO 0x00
89 * ISO PDTR 10178 contains among others
91 #define LLC_X25_LSAP 0x7e
92 #define LLC_SNAP_LSAP 0xaa
93 #define LLC_ISO_LSAP 0xfe
96 * Structure of the FDDI MAC header.
98 struct fddi_header {
99 u_char fddi_fc; /* frame control field */
100 u_char fddi_dhost[6]; /* destination address */
101 u_char fddi_shost[6]; /* source address */
105 * Structure of LLC/SNAP header.
107 struct llc_header {
108 u_char llc_dsap;
109 u_char llc_ssap;
110 u_char snap_control;
111 u_char snap_org_code[3];
112 u_short snap_ether_type;
115 #define FDDI_HDRLEN 13 /* sizeof(struct fddi_header) */
116 #define LLC_SNAPLEN 8 /* bytes for LLC/SNAP header */
117 #define FDDI_HARDHDR_LEN 28 /* Hard header size */
119 #define FDDIMTU 4352
122 /* Types of loopback we can do. */
123 typedef enum {
124 loop_none,
125 loop_formac,
126 loop_plc_lm,
127 loop_plc_eb,
128 loop_pdx
129 } LoopbackType;
131 /* Offset from fifo for writing word with tag. */
132 #define FIFO_TAG 0x80
134 #define MAX_FRAME_LEN 4500
136 void set_ring_op(int up);
137 void rmt_event(int st);
138 void set_cf_join(int on);
140 extern struct net_device *apfddi_device;
141 extern struct net_device_stats *apfddi_stats;