diff options
Diffstat (limited to 'drivers/net/wan/lmc/lmc_var.h')
-rw-r--r-- | drivers/net/wan/lmc/lmc_var.h | 136 |
1 files changed, 18 insertions, 118 deletions
diff --git a/drivers/net/wan/lmc/lmc_var.h b/drivers/net/wan/lmc/lmc_var.h index 6d003a39bfad..52e044209d50 100644 --- a/drivers/net/wan/lmc/lmc_var.h +++ b/drivers/net/wan/lmc/lmc_var.h | |||
@@ -1,8 +1,6 @@ | |||
1 | #ifndef _LMC_VAR_H_ | 1 | #ifndef _LMC_VAR_H_ |
2 | #define _LMC_VAR_H_ | 2 | #define _LMC_VAR_H_ |
3 | 3 | ||
4 | /* $Id: lmc_var.h,v 1.17 2000/04/06 12:16:47 asj Exp $ */ | ||
5 | |||
6 | /* | 4 | /* |
7 | * Copyright (c) 1997-2000 LAN Media Corporation (LMC) | 5 | * Copyright (c) 1997-2000 LAN Media Corporation (LMC) |
8 | * All rights reserved. www.lanmedia.com | 6 | * All rights reserved. www.lanmedia.com |
@@ -19,23 +17,6 @@ | |||
19 | 17 | ||
20 | #include <linux/timer.h> | 18 | #include <linux/timer.h> |
21 | 19 | ||
22 | #ifndef __KERNEL__ | ||
23 | typedef signed char s8; | ||
24 | typedef unsigned char u8; | ||
25 | |||
26 | typedef signed short s16; | ||
27 | typedef unsigned short u16; | ||
28 | |||
29 | typedef signed int s32; | ||
30 | typedef unsigned int u32; | ||
31 | |||
32 | typedef signed long long s64; | ||
33 | typedef unsigned long long u64; | ||
34 | |||
35 | #define BITS_PER_LONG 32 | ||
36 | |||
37 | #endif | ||
38 | |||
39 | /* | 20 | /* |
40 | * basic definitions used in lmc include files | 21 | * basic definitions used in lmc include files |
41 | */ | 22 | */ |
@@ -45,9 +26,6 @@ typedef struct lmc___media lmc_media_t; | |||
45 | typedef struct lmc___ctl lmc_ctl_t; | 26 | typedef struct lmc___ctl lmc_ctl_t; |
46 | 27 | ||
47 | #define lmc_csrptr_t unsigned long | 28 | #define lmc_csrptr_t unsigned long |
48 | #define u_int16_t u16 | ||
49 | #define u_int8_t u8 | ||
50 | #define tulip_uint32_t u32 | ||
51 | 29 | ||
52 | #define LMC_REG_RANGE 0x80 | 30 | #define LMC_REG_RANGE 0x80 |
53 | 31 | ||
@@ -244,46 +222,8 @@ struct lmc___media { | |||
244 | 222 | ||
245 | #define STATCHECK 0xBEEFCAFE | 223 | #define STATCHECK 0xBEEFCAFE |
246 | 224 | ||
247 | /* Included in this structure are first | 225 | struct lmc_extra_statistics |
248 | * - standard net_device_stats | ||
249 | * - some other counters used for debug and driver performance | ||
250 | * evaluation -baz | ||
251 | */ | ||
252 | struct lmc_statistics | ||
253 | { | 226 | { |
254 | unsigned long rx_packets; /* total packets received */ | ||
255 | unsigned long tx_packets; /* total packets transmitted */ | ||
256 | unsigned long rx_bytes; | ||
257 | unsigned long tx_bytes; | ||
258 | |||
259 | unsigned long rx_errors; /* bad packets received */ | ||
260 | unsigned long tx_errors; /* packet transmit problems */ | ||
261 | unsigned long rx_dropped; /* no space in linux buffers */ | ||
262 | unsigned long tx_dropped; /* no space available in linux */ | ||
263 | unsigned long multicast; /* multicast packets received */ | ||
264 | unsigned long collisions; | ||
265 | |||
266 | /* detailed rx_errors: */ | ||
267 | unsigned long rx_length_errors; | ||
268 | unsigned long rx_over_errors; /* receiver ring buff overflow */ | ||
269 | unsigned long rx_crc_errors; /* recved pkt with crc error */ | ||
270 | unsigned long rx_frame_errors; /* recv'd frame alignment error */ | ||
271 | unsigned long rx_fifo_errors; /* recv'r fifo overrun */ | ||
272 | unsigned long rx_missed_errors; /* receiver missed packet */ | ||
273 | |||
274 | /* detailed tx_errors */ | ||
275 | unsigned long tx_aborted_errors; | ||
276 | unsigned long tx_carrier_errors; | ||
277 | unsigned long tx_fifo_errors; | ||
278 | unsigned long tx_heartbeat_errors; | ||
279 | unsigned long tx_window_errors; | ||
280 | |||
281 | /* for cslip etc */ | ||
282 | unsigned long rx_compressed; | ||
283 | unsigned long tx_compressed; | ||
284 | |||
285 | /* ------------------------------------- | ||
286 | * Custom stats & counters follow -baz */ | ||
287 | u_int32_t version_size; | 227 | u_int32_t version_size; |
288 | u_int32_t lmc_cardtype; | 228 | u_int32_t lmc_cardtype; |
289 | 229 | ||
@@ -325,27 +265,26 @@ struct lmc_statistics | |||
325 | u_int32_t check; | 265 | u_int32_t check; |
326 | }; | 266 | }; |
327 | 267 | ||
328 | |||
329 | typedef struct lmc_xinfo { | 268 | typedef struct lmc_xinfo { |
330 | u_int32_t Magic0; /* BEEFCAFE */ | 269 | u_int32_t Magic0; /* BEEFCAFE */ |
331 | 270 | ||
332 | u_int32_t PciCardType; | 271 | u_int32_t PciCardType; |
333 | u_int32_t PciSlotNumber; /* PCI slot number */ | 272 | u_int32_t PciSlotNumber; /* PCI slot number */ |
334 | 273 | ||
335 | u_int16_t DriverMajorVersion; | 274 | u16 DriverMajorVersion; |
336 | u_int16_t DriverMinorVersion; | 275 | u16 DriverMinorVersion; |
337 | u_int16_t DriverSubVersion; | 276 | u16 DriverSubVersion; |
338 | 277 | ||
339 | u_int16_t XilinxRevisionNumber; | 278 | u16 XilinxRevisionNumber; |
340 | u_int16_t MaxFrameSize; | 279 | u16 MaxFrameSize; |
341 | 280 | ||
342 | u_int16_t t1_alarm1_status; | 281 | u16 t1_alarm1_status; |
343 | u_int16_t t1_alarm2_status; | 282 | u16 t1_alarm2_status; |
344 | 283 | ||
345 | int link_status; | 284 | int link_status; |
346 | u_int32_t mii_reg16; | 285 | u_int32_t mii_reg16; |
347 | 286 | ||
348 | u_int32_t Magic1; /* DEADBEEF */ | 287 | u_int32_t Magic1; /* DEADBEEF */ |
349 | } LMC_XINFO; | 288 | } LMC_XINFO; |
350 | 289 | ||
351 | 290 | ||
@@ -353,11 +292,10 @@ typedef struct lmc_xinfo { | |||
353 | * forward decl | 292 | * forward decl |
354 | */ | 293 | */ |
355 | struct lmc___softc { | 294 | struct lmc___softc { |
356 | void *if_ptr; /* General purpose pointer (used by SPPP) */ | ||
357 | char *name; | 295 | char *name; |
358 | u8 board_idx; | 296 | u8 board_idx; |
359 | struct lmc_statistics stats; | 297 | struct lmc_extra_statistics extra_stats; |
360 | struct net_device *lmc_device; | 298 | struct net_device *lmc_device; |
361 | 299 | ||
362 | int hang, rxdesc, bad_packet, some_counter; | 300 | int hang, rxdesc, bad_packet, some_counter; |
363 | u_int32_t txgo; | 301 | u_int32_t txgo; |
@@ -381,7 +319,7 @@ struct lmc___softc { | |||
381 | unsigned int lmc_taint_tx, lmc_taint_rx; | 319 | unsigned int lmc_taint_tx, lmc_taint_rx; |
382 | int lmc_tx_start, lmc_txfull; | 320 | int lmc_tx_start, lmc_txfull; |
383 | int lmc_txbusy; | 321 | int lmc_txbusy; |
384 | u_int16_t lmc_miireg16; | 322 | u16 lmc_miireg16; |
385 | int lmc_ok; | 323 | int lmc_ok; |
386 | int last_link_status; | 324 | int last_link_status; |
387 | int lmc_cardtype; | 325 | int lmc_cardtype; |
@@ -408,8 +346,7 @@ struct lmc___softc { | |||
408 | u32 num_int; | 346 | u32 num_int; |
409 | 347 | ||
410 | spinlock_t lmc_lock; | 348 | spinlock_t lmc_lock; |
411 | u_int16_t if_type; /* PPP or NET */ | 349 | u16 if_type; /* HDLC/PPP or NET */ |
412 | struct ppp_device *pd; | ||
413 | 350 | ||
414 | /* Failure cases */ | 351 | /* Failure cases */ |
415 | u8 failed_ring; | 352 | u8 failed_ring; |
@@ -525,46 +462,9 @@ struct lmc___softc { | |||
525 | #define LMC_ADAP_SSI 4 | 462 | #define LMC_ADAP_SSI 4 |
526 | #define LMC_ADAP_T1 5 | 463 | #define LMC_ADAP_T1 5 |
527 | 464 | ||
528 | #define HDLC_HDR_LEN 4 | ||
529 | #define HDLC_ADDR_LEN 1 | ||
530 | #define HDLC_SLARP 0x8035 | ||
531 | #define LMC_MTU 1500 | 465 | #define LMC_MTU 1500 |
532 | #define SLARP_LINECHECK 2 | ||
533 | 466 | ||
534 | #define LMC_CRC_LEN_16 2 /* 16-bit CRC */ | 467 | #define LMC_CRC_LEN_16 2 /* 16-bit CRC */ |
535 | #define LMC_CRC_LEN_32 4 | 468 | #define LMC_CRC_LEN_32 4 |
536 | 469 | ||
537 | #ifdef LMC_HDLC | ||
538 | /* definition of an hdlc header. */ | ||
539 | struct hdlc_hdr | ||
540 | { | ||
541 | u8 address; | ||
542 | u8 control; | ||
543 | u16 type; | ||
544 | }; | ||
545 | |||
546 | /* definition of a slarp header. */ | ||
547 | struct slarp | ||
548 | { | ||
549 | long code; | ||
550 | union sl | ||
551 | { | ||
552 | struct | ||
553 | { | ||
554 | ulong address; | ||
555 | ulong mask; | ||
556 | ushort unused; | ||
557 | } add; | ||
558 | struct | ||
559 | { | ||
560 | ulong mysequence; | ||
561 | ulong yoursequence; | ||
562 | ushort reliability; | ||
563 | ulong time; | ||
564 | } chk; | ||
565 | } t; | ||
566 | }; | ||
567 | #endif /* LMC_HDLC */ | ||
568 | |||
569 | |||
570 | #endif /* _LMC_VAR_H_ */ | 470 | #endif /* _LMC_VAR_H_ */ |