revert between 56095 -> 55830 in arch
[AROS.git] / compiler / include / devices / sana2.h
blob7cea36da5d33a79f4de595240c34f38d5dbca896
1 #ifndef DEVICES_SANA2_H
2 #define DEVICES_SANA2_H
4 /*
5 Copyright (C) 2005 Neil Cafferkey
6 $Id$
8 Desc: Definitions for SANA-II devices
9 Lang: english
12 #include <exec/types.h>
13 #include <exec/io.h>
14 #include <devices/timer.h>
17 /* Constants */
18 /* ========= */
20 #define SANA2_MAX_ADDR_BITS 128
21 #define SANA2_MAX_ADDR_BYTES (SANA2_MAX_ADDR_BITS / 8)
23 #define SANA2IOB_RAW 7
24 #define SANA2IOB_BCAST 6
25 #define SANA2IOB_MCAST 5
27 #define SANA2IOF_RAW (1 << SANA2IOB_RAW)
28 #define SANA2IOF_BCAST (1 << SANA2IOB_BCAST)
29 #define SANA2IOF_MCAST (1 << SANA2IOB_MCAST)
31 #define SANA2OPB_PROM 1
32 #define SANA2OPB_MINE 0
34 #define SANA2OPF_PROM (1 << SANA2OPB_PROM)
35 #define SANA2OPF_MINE (1 << SANA2OPB_MINE)
37 #define S2_Dummy (TAG_USER + 0xb0000)
38 #define S2_CopyToBuff (S2_Dummy + 1)
39 #define S2_CopyFromBuff (S2_Dummy + 2)
40 #define S2_PacketFilter (S2_Dummy + 3)
41 #define S2_CopyToBuff16 (S2_Dummy + 4)
42 #define S2_CopyFromBuff16 (S2_Dummy + 5)
43 #define S2_CopyToBuff32 (S2_Dummy + 6)
44 #define S2_CopyFromBuff32 (S2_Dummy + 7)
45 #define S2_DMACopyToBuff32 (S2_Dummy + 8)
46 #define S2_DMACopyFromBuff32 (S2_Dummy + 9)
48 #define S2WireType_Ethernet 1
49 #define S2WireType_Arcnet 7
50 #define S2WireType_LocalTalk 11
51 #define S2WireType_DyLAN 12
52 #define S2WireType_AmokNet 200
53 #define S2WireType_Liana 202
54 #define S2WireType_PPP 253
55 #define S2WireType_SLIP 254
56 #define S2WireType_CSLIP 255
57 #define S2WireType_PLIP 420
59 #define S2_DEVICEQUERY (CMD_NONSTD + 0)
60 #define S2_GETSTATIONADDRESS (CMD_NONSTD + 1)
61 #define S2_CONFIGINTERFACE (CMD_NONSTD + 2)
62 #define S2_ADDMULTICASTADDRESS (CMD_NONSTD + 5)
63 #define S2_DELMULTICASTADDRESS (CMD_NONSTD + 6)
64 #define S2_MULTICAST (CMD_NONSTD + 7)
65 #define S2_BROADCAST (CMD_NONSTD + 8)
66 #define S2_TRACKTYPE (CMD_NONSTD + 9)
67 #define S2_UNTRACKTYPE (CMD_NONSTD + 10)
68 #define S2_GETTYPESTATS (CMD_NONSTD + 11)
69 #define S2_GETSPECIALSTATS (CMD_NONSTD + 12)
70 #define S2_GETGLOBALSTATS (CMD_NONSTD + 13)
71 #define S2_ONEVENT (CMD_NONSTD + 14)
72 #define S2_READORPHAN (CMD_NONSTD + 15)
73 #define S2_ONLINE (CMD_NONSTD + 16)
74 #define S2_OFFLINE (CMD_NONSTD + 17)
75 #define S2_ADDMULTICASTADDRESSES (CMD_NONSTD + 0xc000)
76 #define S2_DELMULTICASTADDRESSES (CMD_NONSTD + 0xc001)
78 #define S2ERR_NO_ERROR 0
79 #define S2ERR_NO_RESOURCES 1
80 #define S2ERR_BAD_ARGUMENT 3
81 #define S2ERR_BAD_STATE 4
82 #define S2ERR_BAD_ADDRESS 5
83 #define S2ERR_MTU_EXCEEDED 6
84 #define S2ERR_NOT_SUPPORTED 8
85 #define S2ERR_SOFTWARE 9
86 #define S2ERR_OUTOFSERVICE 10
87 #define S2ERR_TX_FAILURE 11
89 #define S2WERR_GENERIC_ERROR 0
90 #define S2WERR_NOT_CONFIGURED 1
91 #define S2WERR_UNIT_ONLINE 2
92 #define S2WERR_UNIT_OFFLINE 3
93 #define S2WERR_ALREADY_TRACKED 4
94 #define S2WERR_NOT_TRACKED 5
95 #define S2WERR_BUFF_ERROR 6
96 #define S2WERR_SRC_ADDRESS 7
97 #define S2WERR_DST_ADDRESS 8
98 #define S2WERR_BAD_BROADCAST 9
99 #define S2WERR_BAD_MULTICAST 10
100 #define S2WERR_MULTICAST_FULL 11
101 #define S2WERR_BAD_EVENT 12
102 #define S2WERR_BAD_STATDATA 13
103 #define S2WERR_IS_CONFIGURED 15
104 #define S2WERR_NULL_POINTER 16
105 #define S2WERR_TOO_MANY_RETRIES 17
106 #define S2WERR_RCVRBLE_HDW_ERR 18
108 #define S2EVENT_ERROR (1 << 0)
109 #define S2EVENT_TX (1 << 1)
110 #define S2EVENT_RX (1 << 2)
111 #define S2EVENT_ONLINE (1 << 3)
112 #define S2EVENT_OFFLINE (1 << 4)
113 #define S2EVENT_BUFF (1 << 5)
114 #define S2EVENT_HARDWARE (1 << 6)
115 #define S2EVENT_SOFTWARE (1 << 7)
116 #define S2EVENT_CONNECT (1 << 9)
117 #define S2EVENT_DISCONNECT (1 << 10)
120 /* Structures */
121 /* ========== */
123 struct IOSana2Req
125 struct IORequest ios2_Req;
126 ULONG ios2_WireError;
127 ULONG ios2_PacketType;
128 UBYTE ios2_SrcAddr[SANA2_MAX_ADDR_BYTES];
129 UBYTE ios2_DstAddr[SANA2_MAX_ADDR_BYTES];
130 ULONG ios2_DataLength;
131 VOID *ios2_Data;
132 VOID *ios2_StatData;
133 VOID *ios2_BufferManagement;
136 #define ios2_Command ios2_Req.io_Command
137 #define ios2_Flags ios2_Req.io_Flags
138 #define ios2_Error ios2_Req.io_Error
140 struct Sana2DeviceQuery
142 ULONG SizeAvailable;
143 ULONG SizeSupplied;
144 ULONG DevQueryFormat;
145 ULONG DeviceLevel;
146 UWORD AddrFieldSize;
147 ULONG MTU;
148 ULONG BPS;
149 ULONG HardwareType;
152 struct Sana2PacketTypeStats
154 ULONG PacketsSent;
155 ULONG PacketsReceived;
156 ULONG BytesSent;
157 ULONG BytesReceived;
158 ULONG PacketsDropped;
161 struct Sana2SpecialStatRecord
163 ULONG Type;
164 ULONG Count;
165 const TEXT *String;
168 struct Sana2SpecialStatHeader
170 ULONG RecordCountMax;
171 ULONG RecordCountSupplied;
174 struct Sana2DeviceStats
176 ULONG PacketsReceived;
177 ULONG PacketsSent;
178 ULONG BadData;
179 ULONG Overruns;
180 ULONG Unused;
181 ULONG UnknownTypesReceived;
182 ULONG Reconfigurations;
183 struct timeval LastStart;
187 /* Obsolete definitions */
188 /* ==================== */
190 #define SANA2IOB_QUICK IOB_QUICK
192 #define S2WERR_TOO_MANY_RETIRES S2WERR_TOO_MANY_RETRIES
193 #define S2WERR_RCVREL_HDW_ERR S2WERR_RCVRBLE_HDW_ERR
195 #define S2WireType_IEEE802 6
197 #define S2_START CMD_NONSTD
198 #define S2_END (CMD_NONSTD + 18)
200 #endif