2 * Copyright (c) 1999-2001, Ivan Sharov, Vitaly Belekhov.
3 * Copyright (c) 2004 Stanislav Svirid.
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
15 * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * $RISS: if_arl/dev/arl/if_arlreg.h,v 1.4 2004/03/16 04:43:27 count Exp $
34 #define ARL_BASE_START 0xC0000
35 #define ARL_BASE_END 0xDE000
36 #define ARL_BASE_STEP 0x2000
38 #define ARLAN_NAME_SIZE 16
39 #define ARLAN_NAME "ArLan655-SCT"
45 u_int32_t numDatagramsTransmitted;
46 u_int32_t numReTransmissions;
47 u_int32_t numFramesDiscarded;
48 u_int32_t numDatagramsReceived;
49 u_int32_t numDuplicateReceivedFrames;
50 u_int32_t numDatagramsDiscarded;
51 u_int16_t maxNumReTransmitDatagram;
52 u_int16_t maxNumReTransmitFrames;
53 u_int16_t maxNumConsecutiveDuplicateFrames;
54 u_int32_t numBytesTransmitted;
55 u_int32_t numBytesReceived;
56 u_int32_t numCRCErrors;
57 u_int32_t numLengthErrors;
58 u_int32_t numAbortErrors;
59 u_int32_t numTXUnderruns;
60 u_int32_t numRXOverruns;
61 u_int32_t numHoldOffs;
62 u_int32_t numFramesTransmitted;
63 u_int32_t numFramesReceived;
64 u_int32_t numReceiveFramesLost;
65 u_int32_t numRXBufferOverflows;
66 u_int32_t numFramesDiscardedAddrMismatch;
67 u_int32_t numFramesDiscardedSIDMismatch;
68 u_int32_t numPollsTransmistted;
69 u_int32_t numPollAcknowledges;
70 u_int32_t numStatusVectorTimeouts;
71 u_int32_t numNACKReceived;
72 } __attribute__((packed));
75 * Arlan private structure in memomory
78 /* Header Signature */
81 u_int8_t diagnosticInfo;
82 u_int16_t diagnosticOffset;
84 u_int8_t lanCardNodeId[6];
85 u_int8_t broadcastAddress[6];
86 u_int8_t hardwareType;
87 u_int8_t majorHardwareVersion;
88 u_int8_t minorHardwareVersion;
90 u_int8_t defaultChannelSet;
93 /* Control/Status Block - 0x0080 */
94 u_int8_t interruptInProgress;
95 u_int8_t cntrlRegImage;
98 u_int8_t commandParameter[15];
100 /* Receive Status - 0x00a0 */
101 u_int8_t rxStatusVector;
106 u_int8_t rxBroadcastFlag;
111 /* Transmit Status - 0x00b0 */
112 u_int8_t txStatusVector;
113 u_int8_t txAckQuality;
116 u_int8_t registeredRouter[6];
117 u_int8_t backboneRouter[6];
118 u_int8_t registrationStatus;
119 u_int8_t configuredStatusFlag;
121 u_int8_t ultimateDestAddress[6];
122 u_int8_t immedDestAddress[6];
123 u_int8_t immedSrcAddress[6];
124 u_int16_t rxSequenceNumber;
125 u_int8_t assignedLocaltalkAddress;
128 /* System Parameter Block */
130 /* - Driver Parameters (Novell Specific) */
133 u_int16_t transportTime;
136 /* - Configuration Parameters */
138 u_int8_t spreadingCode;
140 u_int8_t channelNumber;
141 u_int16_t radioNodeId;
143 u_int8_t scramblingDisable;
147 u_int8_t txAttenuation;
148 u_int8_t systemId[4]; /* on an odd address for a long !!! */
149 u_int16_t globalChecksum;
151 u_int16_t maxDatagramSize;
152 u_int16_t maxFrameSize;
154 u_int8_t receiveMode;
156 u_int8_t rootOrRepeater;
157 u_int8_t specifiedRouter[6];
158 u_int16_t fastPollPeriod;
160 u_int8_t fastPollDelay[2];
161 u_int8_t arlThreshold;
164 u_int16_t specRouterTimeout;
169 u_int8_t encryptionKey[12];
171 u_int8_t waitTime[2];
172 u_int8_t lParameter[2];
174 u_int16_t headerSize;
175 u_int16_t sectionChecksum;
177 u_int8_t registrationMode;
178 u_int8_t registrationFill;
179 u_int16_t pollPeriod;
180 u_int16_t refreshPeriod;
181 u_int8_t name[ARLAN_NAME_SIZE];
183 u_int8_t localTalkAddress;
189 /* Statistics Block - 0x0300 */
190 u_int8_t hostcpuLock;
192 u_int8_t resetTime[18];
194 struct arl_stats stat;
198 u_int8_t txBuffer[0x800];
199 u_int8_t rxBuffer[0x800];
201 u_int8_t _18[0x0bfd];
204 u_int8_t controlRegister;
210 struct arl_tx_param {
220 #define ARL_HARDWARE_RESET 0x01
221 #define ARL_CHANNEL_ATTENTION 0x02
222 #define ARL_INTERRUPT_ENABLE 0x04
223 #define ARL_CLEAR_INTERRUPT 0x08
225 /* additions for sys/sockio.h ( socket ioctl parameters for arlan card ) */
227 #define SIOCGARLQLT _IOWR('i', 70, struct ifreq) /* get QUALITY */
228 #define SIOCGARLALL _IOWR('i', 71, struct ifreq) /* get ALL */
229 #define SIOCSARLALL _IOWR('i', 72, struct ifreq) /* set paramter (who_set) */
230 #define SIOCGARLSTB _IOWR('i', 73, struct ifreq) /* get statistic block */
233 * Arlan request struct via ioctl
235 struct arl_cfg_param {
236 u_char name[ARLAN_NAME_SIZE];
239 u_int8_t channelNumber;
240 u_int8_t spreadingCode;
241 u_int8_t registrationMode;
242 u_int8_t lanCardNodeId[6];
243 u_int8_t specifiedRouter[6];
244 u_int8_t hardwareType;
245 u_int8_t majorHardwareVersion;
246 u_int8_t minorHardwareVersion;
247 u_int8_t radioModule;
249 u_int8_t receiveMode;
255 struct arl_cfg_param cfg;
259 #define MAXARLCACHE 16
260 #define ARLCACHE_RX 0
261 #define ARLCACHE_TX 1
263 struct arl_sigcache {
264 u_int8_t macsrc[6]; /* unique MAC address for entry */
270 #define ARLAN_SET_name 0x0001
271 #define ARLAN_SET_sid 0x0002
272 #define ARLAN_SET_channelSet 0x0004
273 #define ARLAN_SET_channelNumber 0x0008
274 #define ARLAN_SET_spreadingCode 0x0010
275 #define ARLAN_SET_registrationMode 0x0020
276 #define ARLAN_SET_lanCardNodeId 0x0040
277 #define ARLAN_SET_specifiedRouter 0x0080
278 #define ARLAN_SET_priority 0x0100
279 #define ARLAN_SET_receiveMode 0x0200
280 #define ARLAN_SET_txRetry 0x0400
284 struct ifnet *arl_ifp;
287 struct arl_private * arl_mem; /* arlan data */
289 struct arl_cfg_param arl_cfg; /* arlan vars in our mem */
292 int mem_rid; /* resource id for mem */
293 struct resource* mem_res; /* resource for mem */
294 int irq_rid; /* resource id for irq */
295 struct resource* irq_res; /* resource for irq */
296 void* irq_handle; /* handle for irq handler */
304 struct arl_sigcache arl_sigcache[MAXARLCACHE];
306 struct ifmedia arl_ifmedia;
310 #define ARLAN_SIGN "TELESYSTEM"
311 #define ARLAN_HEADER_SIZE 0x0C
313 #define ar sc->arl_mem
314 #define arcfg sc->arl_cfg
316 #define ARDELAY 10000
317 #define ARDELAY1 50000
319 #define WAIT_RESET(cnt, delay) \
322 for (i = cnt; i && ar->resetFlag; i--) { \
328 void arl_release_resources (device_t);
329 int arl_alloc_memory (device_t, int, int);
330 int arl_alloc_irq (device_t, int, int);
331 int arl_attach (device_t);
332 int arl_wait_reset (struct arl_softc *, int, int);
333 void arl_stop (struct arl_softc *);
335 driver_intr_t arl_intr;
338 #endif /* _IF_ARLREG_H */