lmc_var.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570
  1. #ifndef _LMC_VAR_H_
  2. #define _LMC_VAR_H_
  3. /* $Id: lmc_var.h,v 1.17 2000/04/06 12:16:47 asj Exp $ */
  4. /*
  5. * Copyright (c) 1997-2000 LAN Media Corporation (LMC)
  6. * All rights reserved. www.lanmedia.com
  7. *
  8. * This code is written by:
  9. * Andrew Stanley-Jones (asj@cban.com)
  10. * Rob Braun (bbraun@vix.com),
  11. * Michael Graff (explorer@vix.com) and
  12. * Matt Thomas (matt@3am-software.com).
  13. *
  14. * This software may be used and distributed according to the terms
  15. * of the GNU General Public License version 2, incorporated herein by reference.
  16. */
  17. #include <linux/timer.h>
  18. #ifndef __KERNEL__
  19. typedef signed char s8;
  20. typedef unsigned char u8;
  21. typedef signed short s16;
  22. typedef unsigned short u16;
  23. typedef signed int s32;
  24. typedef unsigned int u32;
  25. typedef signed long long s64;
  26. typedef unsigned long long u64;
  27. #define BITS_PER_LONG 32
  28. #endif
  29. /*
  30. * basic definitions used in lmc include files
  31. */
  32. typedef struct lmc___softc lmc_softc_t;
  33. typedef struct lmc___media lmc_media_t;
  34. typedef struct lmc___ctl lmc_ctl_t;
  35. #define lmc_csrptr_t unsigned long
  36. #define u_int16_t u16
  37. #define u_int8_t u8
  38. #define tulip_uint32_t u32
  39. #define LMC_REG_RANGE 0x80
  40. #define LMC_PRINTF_FMT "%s"
  41. #define LMC_PRINTF_ARGS (sc->lmc_device->name)
  42. #define TX_TIMEOUT (2*HZ)
  43. #define LMC_TXDESCS 32
  44. #define LMC_RXDESCS 32
  45. #define LMC_LINK_UP 1
  46. #define LMC_LINK_DOWN 0
  47. /* These macros for generic read and write to and from the dec chip */
  48. #define LMC_CSR_READ(sc, csr) \
  49. inl((sc)->lmc_csrs.csr)
  50. #define LMC_CSR_WRITE(sc, reg, val) \
  51. outl((val), (sc)->lmc_csrs.reg)
  52. //#ifdef _LINUX_DELAY_H
  53. // #define SLOW_DOWN_IO udelay(2);
  54. // #undef __SLOW_DOWN_IO
  55. // #define __SLOW_DOWN_IO udelay(2);
  56. //#endif
  57. #define DELAY(n) SLOW_DOWN_IO
  58. #define lmc_delay() inl(sc->lmc_csrs.csr_9)
  59. /* This macro sync's up with the mii so that reads and writes can take place */
  60. #define LMC_MII_SYNC(sc) do {int n=32; while( n >= 0 ) { \
  61. LMC_CSR_WRITE((sc), csr_9, 0x20000); \
  62. lmc_delay(); \
  63. LMC_CSR_WRITE((sc), csr_9, 0x30000); \
  64. lmc_delay(); \
  65. n--; }} while(0)
  66. struct lmc_regfile_t {
  67. lmc_csrptr_t csr_busmode; /* CSR0 */
  68. lmc_csrptr_t csr_txpoll; /* CSR1 */
  69. lmc_csrptr_t csr_rxpoll; /* CSR2 */
  70. lmc_csrptr_t csr_rxlist; /* CSR3 */
  71. lmc_csrptr_t csr_txlist; /* CSR4 */
  72. lmc_csrptr_t csr_status; /* CSR5 */
  73. lmc_csrptr_t csr_command; /* CSR6 */
  74. lmc_csrptr_t csr_intr; /* CSR7 */
  75. lmc_csrptr_t csr_missed_frames; /* CSR8 */
  76. lmc_csrptr_t csr_9; /* CSR9 */
  77. lmc_csrptr_t csr_10; /* CSR10 */
  78. lmc_csrptr_t csr_11; /* CSR11 */
  79. lmc_csrptr_t csr_12; /* CSR12 */
  80. lmc_csrptr_t csr_13; /* CSR13 */
  81. lmc_csrptr_t csr_14; /* CSR14 */
  82. lmc_csrptr_t csr_15; /* CSR15 */
  83. };
  84. #define csr_enetrom csr_9 /* 21040 */
  85. #define csr_reserved csr_10 /* 21040 */
  86. #define csr_full_duplex csr_11 /* 21040 */
  87. #define csr_bootrom csr_10 /* 21041/21140A/?? */
  88. #define csr_gp csr_12 /* 21140* */
  89. #define csr_watchdog csr_15 /* 21140* */
  90. #define csr_gp_timer csr_11 /* 21041/21140* */
  91. #define csr_srom_mii csr_9 /* 21041/21140* */
  92. #define csr_sia_status csr_12 /* 2104x */
  93. #define csr_sia_connectivity csr_13 /* 2104x */
  94. #define csr_sia_tx_rx csr_14 /* 2104x */
  95. #define csr_sia_general csr_15 /* 2104x */
  96. /* tulip length/control transmit descriptor definitions
  97. * used to define bits in the second tulip_desc_t field (length)
  98. * for the transmit descriptor -baz */
  99. #define LMC_TDES_FIRST_BUFFER_SIZE ((u_int32_t)(0x000007FF))
  100. #define LMC_TDES_SECOND_BUFFER_SIZE ((u_int32_t)(0x003FF800))
  101. #define LMC_TDES_HASH_FILTERING ((u_int32_t)(0x00400000))
  102. #define LMC_TDES_DISABLE_PADDING ((u_int32_t)(0x00800000))
  103. #define LMC_TDES_SECOND_ADDR_CHAINED ((u_int32_t)(0x01000000))
  104. #define LMC_TDES_END_OF_RING ((u_int32_t)(0x02000000))
  105. #define LMC_TDES_ADD_CRC_DISABLE ((u_int32_t)(0x04000000))
  106. #define LMC_TDES_SETUP_PACKET ((u_int32_t)(0x08000000))
  107. #define LMC_TDES_INVERSE_FILTERING ((u_int32_t)(0x10000000))
  108. #define LMC_TDES_FIRST_SEGMENT ((u_int32_t)(0x20000000))
  109. #define LMC_TDES_LAST_SEGMENT ((u_int32_t)(0x40000000))
  110. #define LMC_TDES_INTERRUPT_ON_COMPLETION ((u_int32_t)(0x80000000))
  111. #define TDES_SECOND_BUFFER_SIZE_BIT_NUMBER 11
  112. #define TDES_COLLISION_COUNT_BIT_NUMBER 3
  113. /* Constants for the RCV descriptor RDES */
  114. #define LMC_RDES_OVERFLOW ((u_int32_t)(0x00000001))
  115. #define LMC_RDES_CRC_ERROR ((u_int32_t)(0x00000002))
  116. #define LMC_RDES_DRIBBLING_BIT ((u_int32_t)(0x00000004))
  117. #define LMC_RDES_REPORT_ON_MII_ERR ((u_int32_t)(0x00000008))
  118. #define LMC_RDES_RCV_WATCHDOG_TIMEOUT ((u_int32_t)(0x00000010))
  119. #define LMC_RDES_FRAME_TYPE ((u_int32_t)(0x00000020))
  120. #define LMC_RDES_COLLISION_SEEN ((u_int32_t)(0x00000040))
  121. #define LMC_RDES_FRAME_TOO_LONG ((u_int32_t)(0x00000080))
  122. #define LMC_RDES_LAST_DESCRIPTOR ((u_int32_t)(0x00000100))
  123. #define LMC_RDES_FIRST_DESCRIPTOR ((u_int32_t)(0x00000200))
  124. #define LMC_RDES_MULTICAST_FRAME ((u_int32_t)(0x00000400))
  125. #define LMC_RDES_RUNT_FRAME ((u_int32_t)(0x00000800))
  126. #define LMC_RDES_DATA_TYPE ((u_int32_t)(0x00003000))
  127. #define LMC_RDES_LENGTH_ERROR ((u_int32_t)(0x00004000))
  128. #define LMC_RDES_ERROR_SUMMARY ((u_int32_t)(0x00008000))
  129. #define LMC_RDES_FRAME_LENGTH ((u_int32_t)(0x3FFF0000))
  130. #define LMC_RDES_OWN_BIT ((u_int32_t)(0x80000000))
  131. #define RDES_FRAME_LENGTH_BIT_NUMBER 16
  132. #define LMC_RDES_ERROR_MASK ( (u_int32_t)( \
  133. LMC_RDES_OVERFLOW \
  134. | LMC_RDES_DRIBBLING_BIT \
  135. | LMC_RDES_REPORT_ON_MII_ERR \
  136. | LMC_RDES_COLLISION_SEEN ) )
  137. /*
  138. * Ioctl info
  139. */
  140. typedef struct {
  141. u_int32_t n;
  142. u_int32_t m;
  143. u_int32_t v;
  144. u_int32_t x;
  145. u_int32_t r;
  146. u_int32_t f;
  147. u_int32_t exact;
  148. } lmc_av9110_t;
  149. /*
  150. * Common structure passed to the ioctl code.
  151. */
  152. struct lmc___ctl {
  153. u_int32_t cardtype;
  154. u_int32_t clock_source; /* HSSI, T1 */
  155. u_int32_t clock_rate; /* T1 */
  156. u_int32_t crc_length;
  157. u_int32_t cable_length; /* DS3 */
  158. u_int32_t scrambler_onoff; /* DS3 */
  159. u_int32_t cable_type; /* T1 */
  160. u_int32_t keepalive_onoff; /* protocol */
  161. u_int32_t ticks; /* ticks/sec */
  162. union {
  163. lmc_av9110_t ssi;
  164. } cardspec;
  165. u_int32_t circuit_type; /* T1 or E1 */
  166. };
  167. /*
  168. * Carefull, look at the data sheet, there's more to this
  169. * structure than meets the eye. It should probably be:
  170. *
  171. * struct tulip_desc_t {
  172. * u8 own:1;
  173. * u32 status:31;
  174. * u32 control:10;
  175. * u32 buffer1;
  176. * u32 buffer2;
  177. * };
  178. * You could also expand status control to provide more bit information
  179. */
  180. struct tulip_desc_t {
  181. s32 status;
  182. s32 length;
  183. u32 buffer1;
  184. u32 buffer2;
  185. };
  186. /*
  187. * media independent methods to check on media status, link, light LEDs,
  188. * etc.
  189. */
  190. struct lmc___media {
  191. void (* init)(lmc_softc_t * const);
  192. void (* defaults)(lmc_softc_t * const);
  193. void (* set_status)(lmc_softc_t * const, lmc_ctl_t *);
  194. void (* set_clock_source)(lmc_softc_t * const, int);
  195. void (* set_speed)(lmc_softc_t * const, lmc_ctl_t *);
  196. void (* set_cable_length)(lmc_softc_t * const, int);
  197. void (* set_scrambler)(lmc_softc_t * const, int);
  198. int (* get_link_status)(lmc_softc_t * const);
  199. void (* set_link_status)(lmc_softc_t * const, int);
  200. void (* set_crc_length)(lmc_softc_t * const, int);
  201. void (* set_circuit_type)(lmc_softc_t * const, int);
  202. void (* watchdog)(lmc_softc_t * const);
  203. };
  204. #define STATCHECK 0xBEEFCAFE
  205. /* Included in this structure are first
  206. * - standard net_device_stats
  207. * - some other counters used for debug and driver performance
  208. * evaluation -baz
  209. */
  210. struct lmc_statistics
  211. {
  212. unsigned long rx_packets; /* total packets received */
  213. unsigned long tx_packets; /* total packets transmitted */
  214. unsigned long rx_bytes;
  215. unsigned long tx_bytes;
  216. unsigned long rx_errors; /* bad packets received */
  217. unsigned long tx_errors; /* packet transmit problems */
  218. unsigned long rx_dropped; /* no space in linux buffers */
  219. unsigned long tx_dropped; /* no space available in linux */
  220. unsigned long multicast; /* multicast packets received */
  221. unsigned long collisions;
  222. /* detailed rx_errors: */
  223. unsigned long rx_length_errors;
  224. unsigned long rx_over_errors; /* receiver ring buff overflow */
  225. unsigned long rx_crc_errors; /* recved pkt with crc error */
  226. unsigned long rx_frame_errors; /* recv'd frame alignment error */
  227. unsigned long rx_fifo_errors; /* recv'r fifo overrun */
  228. unsigned long rx_missed_errors; /* receiver missed packet */
  229. /* detailed tx_errors */
  230. unsigned long tx_aborted_errors;
  231. unsigned long tx_carrier_errors;
  232. unsigned long tx_fifo_errors;
  233. unsigned long tx_heartbeat_errors;
  234. unsigned long tx_window_errors;
  235. /* for cslip etc */
  236. unsigned long rx_compressed;
  237. unsigned long tx_compressed;
  238. /* -------------------------------------
  239. * Custom stats & counters follow -baz */
  240. u_int32_t version_size;
  241. u_int32_t lmc_cardtype;
  242. u_int32_t tx_ProcTimeout;
  243. u_int32_t tx_IntTimeout;
  244. u_int32_t tx_NoCompleteCnt;
  245. u_int32_t tx_MaxXmtsB4Int;
  246. u_int32_t tx_TimeoutCnt;
  247. u_int32_t tx_OutOfSyncPtr;
  248. u_int32_t tx_tbusy0;
  249. u_int32_t tx_tbusy1;
  250. u_int32_t tx_tbusy_calls;
  251. u_int32_t resetCount;
  252. u_int32_t lmc_txfull;
  253. u_int32_t tbusy;
  254. u_int32_t dirtyTx;
  255. u_int32_t lmc_next_tx;
  256. u_int32_t otherTypeCnt;
  257. u_int32_t lastType;
  258. u_int32_t lastTypeOK;
  259. u_int32_t txLoopCnt;
  260. u_int32_t usedXmtDescripCnt;
  261. u_int32_t txIndexCnt;
  262. u_int32_t rxIntLoopCnt;
  263. u_int32_t rx_SmallPktCnt;
  264. u_int32_t rx_BadPktSurgeCnt;
  265. u_int32_t rx_BuffAllocErr;
  266. u_int32_t tx_lossOfClockCnt;
  267. /* T1 error counters */
  268. u_int32_t framingBitErrorCount;
  269. u_int32_t lineCodeViolationCount;
  270. u_int32_t lossOfFrameCount;
  271. u_int32_t changeOfFrameAlignmentCount;
  272. u_int32_t severelyErroredFrameCount;
  273. u_int32_t check;
  274. };
  275. typedef struct lmc_xinfo {
  276. u_int32_t Magic0; /* BEEFCAFE */
  277. u_int32_t PciCardType;
  278. u_int32_t PciSlotNumber; /* PCI slot number */
  279. u_int16_t DriverMajorVersion;
  280. u_int16_t DriverMinorVersion;
  281. u_int16_t DriverSubVersion;
  282. u_int16_t XilinxRevisionNumber;
  283. u_int16_t MaxFrameSize;
  284. u_int16_t t1_alarm1_status;
  285. u_int16_t t1_alarm2_status;
  286. int link_status;
  287. u_int32_t mii_reg16;
  288. u_int32_t Magic1; /* DEADBEEF */
  289. } LMC_XINFO;
  290. /*
  291. * forward decl
  292. */
  293. struct lmc___softc {
  294. void *if_ptr; /* General purpose pointer (used by SPPP) */
  295. char *name;
  296. u8 board_idx;
  297. struct lmc_statistics stats;
  298. struct net_device *lmc_device;
  299. int hang, rxdesc, bad_packet, some_counter;
  300. u_int32_t txgo;
  301. struct lmc_regfile_t lmc_csrs;
  302. volatile u_int32_t lmc_txtick;
  303. volatile u_int32_t lmc_rxtick;
  304. u_int32_t lmc_flags;
  305. u_int32_t lmc_intrmask; /* our copy of csr_intr */
  306. u_int32_t lmc_cmdmode; /* our copy of csr_cmdmode */
  307. u_int32_t lmc_busmode; /* our copy of csr_busmode */
  308. u_int32_t lmc_gpio_io; /* state of in/out settings */
  309. u_int32_t lmc_gpio; /* state of outputs */
  310. struct sk_buff* lmc_txq[LMC_TXDESCS];
  311. struct sk_buff* lmc_rxq[LMC_RXDESCS];
  312. volatile
  313. struct tulip_desc_t lmc_rxring[LMC_RXDESCS];
  314. volatile
  315. struct tulip_desc_t lmc_txring[LMC_TXDESCS];
  316. unsigned int lmc_next_rx, lmc_next_tx;
  317. volatile
  318. unsigned int lmc_taint_tx, lmc_taint_rx;
  319. int lmc_tx_start, lmc_txfull;
  320. int lmc_txbusy;
  321. u_int16_t lmc_miireg16;
  322. int lmc_ok;
  323. int last_link_status;
  324. int lmc_cardtype;
  325. u_int32_t last_frameerr;
  326. lmc_media_t *lmc_media;
  327. struct timer_list timer;
  328. lmc_ctl_t ictl;
  329. u_int32_t TxDescriptControlInit;
  330. int tx_TimeoutInd; /* additional driver state */
  331. int tx_TimeoutDisplay;
  332. unsigned int lastlmc_taint_tx;
  333. int lasttx_packets;
  334. u_int32_t tx_clockState;
  335. u_int32_t lmc_crcSize;
  336. LMC_XINFO lmc_xinfo;
  337. char lmc_yel, lmc_blue, lmc_red; /* for T1 and DS3 */
  338. char lmc_timing; /* for HSSI and SSI */
  339. int got_irq;
  340. char last_led_err[4];
  341. u32 last_int;
  342. u32 num_int;
  343. spinlock_t lmc_lock;
  344. u_int16_t if_type; /* PPP or NET */
  345. struct ppp_device *pd;
  346. /* Failure cases */
  347. u8 failed_ring;
  348. u8 failed_recv_alloc;
  349. /* Structure check */
  350. u32 check;
  351. };
  352. #define LMC_PCI_TIME 1
  353. #define LMC_EXT_TIME 0
  354. #define PKT_BUF_SZ 1542 /* was 1536 */
  355. /* CSR5 settings */
  356. #define TIMER_INT 0x00000800
  357. #define TP_LINK_FAIL 0x00001000
  358. #define TP_LINK_PASS 0x00000010
  359. #define NORMAL_INT 0x00010000
  360. #define ABNORMAL_INT 0x00008000
  361. #define RX_JABBER_INT 0x00000200
  362. #define RX_DIED 0x00000100
  363. #define RX_NOBUFF 0x00000080
  364. #define RX_INT 0x00000040
  365. #define TX_FIFO_UNDER 0x00000020
  366. #define TX_JABBER 0x00000008
  367. #define TX_NOBUFF 0x00000004
  368. #define TX_DIED 0x00000002
  369. #define TX_INT 0x00000001
  370. /* CSR6 settings */
  371. #define OPERATION_MODE 0x00000200 /* Full Duplex */
  372. #define PROMISC_MODE 0x00000040 /* Promiscuous Mode */
  373. #define RECIEVE_ALL 0x40000000 /* Recieve All */
  374. #define PASS_BAD_FRAMES 0x00000008 /* Pass Bad Frames */
  375. /* Dec control registers CSR6 as well */
  376. #define LMC_DEC_ST 0x00002000
  377. #define LMC_DEC_SR 0x00000002
  378. /* CSR15 settings */
  379. #define RECV_WATCHDOG_DISABLE 0x00000010
  380. #define JABBER_DISABLE 0x00000001
  381. /* More settings */
  382. /*
  383. * aSR6 -- Command (Operation Mode) Register
  384. */
  385. #define TULIP_CMD_RECEIVEALL 0x40000000L /* (RW) Receivel all frames? */
  386. #define TULIP_CMD_MUSTBEONE 0x02000000L /* (RW) Must Be One (21140) */
  387. #define TULIP_CMD_TXTHRSHLDCTL 0x00400000L /* (RW) Transmit Threshold Mode (21140) */
  388. #define TULIP_CMD_STOREFWD 0x00200000L /* (RW) Store and Foward (21140) */
  389. #define TULIP_CMD_NOHEARTBEAT 0x00080000L /* (RW) No Heartbeat (21140) */
  390. #define TULIP_CMD_PORTSELECT 0x00040000L /* (RW) Post Select (100Mb) (21140) */
  391. #define TULIP_CMD_FULLDUPLEX 0x00000200L /* (RW) Full Duplex Mode */
  392. #define TULIP_CMD_OPERMODE 0x00000C00L /* (RW) Operating Mode */
  393. #define TULIP_CMD_PROMISCUOUS 0x00000041L /* (RW) Promiscuous Mode */
  394. #define TULIP_CMD_PASSBADPKT 0x00000008L /* (RW) Pass Bad Frames */
  395. #define TULIP_CMD_THRESHOLDCTL 0x0000C000L /* (RW) Threshold Control */
  396. #define TULIP_GP_PINSET 0x00000100L
  397. #define TULIP_BUSMODE_SWRESET 0x00000001L
  398. #define TULIP_WATCHDOG_TXDISABLE 0x00000001L
  399. #define TULIP_WATCHDOG_RXDISABLE 0x00000010L
  400. #define TULIP_STS_NORMALINTR 0x00010000L /* (RW) Normal Interrupt */
  401. #define TULIP_STS_ABNRMLINTR 0x00008000L /* (RW) Abnormal Interrupt */
  402. #define TULIP_STS_ERI 0x00004000L /* (RW) Early Receive Interrupt */
  403. #define TULIP_STS_SYSERROR 0x00002000L /* (RW) System Error */
  404. #define TULIP_STS_GTE 0x00000800L /* (RW) General Pupose Timer Exp */
  405. #define TULIP_STS_ETI 0x00000400L /* (RW) Early Transmit Interrupt */
  406. #define TULIP_STS_RXWT 0x00000200L /* (RW) Receiver Watchdog Timeout */
  407. #define TULIP_STS_RXSTOPPED 0x00000100L /* (RW) Receiver Process Stopped */
  408. #define TULIP_STS_RXNOBUF 0x00000080L /* (RW) Receive Buf Unavail */
  409. #define TULIP_STS_RXINTR 0x00000040L /* (RW) Receive Interrupt */
  410. #define TULIP_STS_TXUNDERFLOW 0x00000020L /* (RW) Transmit Underflow */
  411. #define TULIP_STS_TXJABER 0x00000008L /* (RW) Jabber timeout */
  412. #define TULIP_STS_TXNOBUF 0x00000004L
  413. #define TULIP_STS_TXSTOPPED 0x00000002L /* (RW) Transmit Process Stopped */
  414. #define TULIP_STS_TXINTR 0x00000001L /* (RW) Transmit Interrupt */
  415. #define TULIP_STS_RXS_STOPPED 0x00000000L /* 000 - Stopped */
  416. #define TULIP_STS_RXSTOPPED 0x00000100L /* (RW) Receive Process Stopped */
  417. #define TULIP_STS_RXNOBUF 0x00000080L
  418. #define TULIP_CMD_TXRUN 0x00002000L /* (RW) Start/Stop Transmitter */
  419. #define TULIP_CMD_RXRUN 0x00000002L /* (RW) Start/Stop Receive Filtering */
  420. #define TULIP_DSTS_TxDEFERRED 0x00000001 /* Initially Deferred */
  421. #define TULIP_DSTS_OWNER 0x80000000 /* Owner (1 = 21040) */
  422. #define TULIP_DSTS_RxMIIERR 0x00000008
  423. #define LMC_DSTS_ERRSUM (TULIP_DSTS_RxMIIERR)
  424. #define TULIP_DEFAULT_INTR_MASK (TULIP_STS_NORMALINTR \
  425. | TULIP_STS_RXINTR \
  426. | TULIP_STS_TXINTR \
  427. | TULIP_STS_ABNRMLINTR \
  428. | TULIP_STS_SYSERROR \
  429. | TULIP_STS_TXSTOPPED \
  430. | TULIP_STS_TXUNDERFLOW\
  431. | TULIP_STS_RXSTOPPED )
  432. #define DESC_OWNED_BY_SYSTEM ((u_int32_t)(0x00000000))
  433. #define DESC_OWNED_BY_DC21X4 ((u_int32_t)(0x80000000))
  434. #ifndef TULIP_CMD_RECEIVEALL
  435. #define TULIP_CMD_RECEIVEALL 0x40000000L
  436. #endif
  437. /* Adapter module number */
  438. #define LMC_ADAP_HSSI 2
  439. #define LMC_ADAP_DS3 3
  440. #define LMC_ADAP_SSI 4
  441. #define LMC_ADAP_T1 5
  442. #define HDLC_HDR_LEN 4
  443. #define HDLC_ADDR_LEN 1
  444. #define HDLC_SLARP 0x8035
  445. #define LMC_MTU 1500
  446. #define SLARP_LINECHECK 2
  447. #define LMC_CRC_LEN_16 2 /* 16-bit CRC */
  448. #define LMC_CRC_LEN_32 4
  449. #ifdef LMC_HDLC
  450. /* definition of an hdlc header. */
  451. struct hdlc_hdr
  452. {
  453. u8 address;
  454. u8 control;
  455. u16 type;
  456. };
  457. /* definition of a slarp header. */
  458. struct slarp
  459. {
  460. long code;
  461. union sl
  462. {
  463. struct
  464. {
  465. ulong address;
  466. ulong mask;
  467. ushort unused;
  468. } add;
  469. struct
  470. {
  471. ulong mysequence;
  472. ulong yoursequence;
  473. ushort reliability;
  474. ulong time;
  475. } chk;
  476. } t;
  477. };
  478. #endif /* LMC_HDLC */
  479. #endif /* _LMC_VAR_H_ */