1 #ifndef DEVICES_SANA2_H
2 #define DEVICES_SANA2_H
5 Copyright (C) 2005 Neil Cafferkey
8 Desc: Definitions for SANA-II devices
12 #include <exec/types.h>
14 #include <devices/timer.h>
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)
123 struct IORequest ios2_Req
;
124 ULONG ios2_WireError
;
125 ULONG ios2_PacketType
;
126 UBYTE ios2_SrcAddr
[SANA2_MAX_ADDR_BYTES
];
127 UBYTE ios2_DstAddr
[SANA2_MAX_ADDR_BYTES
];
128 ULONG ios2_DataLength
;
131 VOID
*ios2_BufferManagement
;
134 struct Sana2DeviceQuery
138 ULONG DevQueryFormat
;
146 struct Sana2PacketTypeStats
149 ULONG PacketsReceived
;
152 ULONG PacketsDropped
;
155 struct Sana2SpecialStatRecord
162 struct Sana2SpecialStatHeader
164 ULONG RecordCountMax
;
165 ULONG RecordCountSupplied
;
168 struct Sana2DeviceStats
170 ULONG PacketsReceived
;
175 ULONG UnknownTypesReceived
;
176 ULONG Reconfigurations
;
177 struct timeval LastStart
;
181 /* Obsolete definitions */
182 /* ==================== */
184 #define SANA2IOB_QUICK IOB_QUICK
186 #define S2WERR_TOO_MANY_RETIRES S2WERR_TOO_MANY_RETRIES
187 #define S2WERR_RCVREL_HDW_ERR S2WERR_RCVRBLE_HDW_ERR
189 #define S2WireType_IEEE802 6
191 #define S2_START CMD_NONSTD
192 #define S2_END (CMD_NONSTD + 18)