123289Smckusick /* 223289Smckusick * Copyright (c) 1982 Regents of the University of California. 323289Smckusick * All rights reserved. The Berkeley software License Agreement 423289Smckusick * specifies the terms and conditions for redistribution. 523289Smckusick * 6*23841Ssklower * @(#)if_ecreg.h 6.3 (Berkeley) 07/02/85 723289Smckusick */ 86521Sfeldman 96521Sfeldman /* 106521Sfeldman * 3Com Ethernet controller registers. 116521Sfeldman */ 126521Sfeldman struct ecdevice { 136521Sfeldman short ec_rcr; /* Receive Control Register */ 146521Sfeldman short ec_xcr; /* Transmit Control Register */ 156521Sfeldman }; 166521Sfeldman 176521Sfeldman /* 186521Sfeldman * Control and status bits -- rcr 196521Sfeldman */ 206521Sfeldman #define EC_SPIE 0x8000 /* set parity interrupt enable */ 216521Sfeldman #define EC_ASTEP 0x4000 /* increment address counter */ 226521Sfeldman #define EC_AROM 0x2000 /* 1: Use address ROM, 0: use RAM */ 236521Sfeldman #define EC_PE 0x2000 /* Parity error */ 246521Sfeldman #define EC_AWCLK 0x1000 /* address write clock bit */ 256521Sfeldman #define EC_PIE 0x1000 /* Parity interrupt enable (read) */ 266521Sfeldman #define EC_ADATA 0x0f00 /* address/filtering */ 276521Sfeldman #define EC_RDONE 0x0080 /* receive done */ 287471Sfeldman #define EC_MDISAB 0x0080 /* memory disable */ 296521Sfeldman #define EC_RINTEN 0x0040 /* receive interrupt enable */ 306521Sfeldman #define EC_RCLR 0x0020 /* clear RDONE bit */ 316521Sfeldman #define EC_RWBN 0x0010 /* submit buffer for receive */ 326521Sfeldman #define EC_RBN 0x000f /* buffer number */ 336521Sfeldman 346521Sfeldman #define EC_RBITS "\10\16PE\15PIE\10RDONE\7RINTEN" 356521Sfeldman 366521Sfeldman /* 376521Sfeldman * Control and status bits -- xcr 386521Sfeldman */ 396521Sfeldman #define EC_JAM 0x8000 /* collision dectected */ 406521Sfeldman #define EC_JINTEN 0x4000 /* collision interrupt enable */ 416521Sfeldman #define EC_JCLR 0x2000 /* clear collision detect */ 426521Sfeldman #define EC_UECLR 0x0100 /* reset controller */ 436521Sfeldman #define EC_XDONE 0x0080 /* transmit done */ 446521Sfeldman #define EC_XINTEN 0x0040 /* transmit interrupt enable */ 456521Sfeldman #define EC_XCLR 0x0020 /* clear XDONE bit */ 466521Sfeldman #define EC_XWBN 0x0010 /* submit buffer for transmit */ 476521Sfeldman #define EC_XBN 0x000f /* buffer number */ 486521Sfeldman 496521Sfeldman #define EC_XBITS "\10\20JAM\17JINTEN\10XDONE\7XINTEN" 506521Sfeldman 516521Sfeldman /* 526521Sfeldman * Useful combinations 536521Sfeldman */ 54*23841Ssklower #define EC_READ (0x600|EC_RINTEN|EC_RWBN) 556521Sfeldman #define EC_WRITE (EC_JINTEN|EC_XINTEN|EC_XWBN) 567288Ssam #define EC_CLEAR (EC_JINTEN|EC_XINTEN|EC_JCLR) 576521Sfeldman 586521Sfeldman /* 596521Sfeldman * Buffer number definitions 606521Sfeldman */ 616521Sfeldman #define ECTBF 0 /* Buffer for transmit */ 626521Sfeldman #define ECRLBF 1 /* First buffer for receive */ 636521Sfeldman #define ECRHBF 15 /* Last buffer for receive */ 646521Sfeldman 656521Sfeldman #define ECRDOFF 528 /* Packet offset in read buffer */ 66