File:  [Power 6/32 Unix Tahoe 4.2BSD] / cci / d / ether / veiu.h
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Sun Jul 28 12:24:19 2019 UTC (6 years, 11 months ago) by root
Branches: bsd, MAIN
CVS tags: v12b, v121, HEAD
Power 6/32 Unix version 1.2b

/*								*/
/*	ACC ethernet controller definitions, VERSAbus version	*/
/*	product name V/EIU, unix name ACE			*/
/*								*/

/*								*/
/*	register definitions					*/
/*								*/
struct acedevice{
	struct rx_addr_ram  {         /* receive address match ram.     */
	  short	station_addr[6];     /* Ethernet Station Addr  */
	  short	broadcast_en[2];     /* Broadcast Reception OK */
	  short	mcast_hash_code[8];  /* Multicast Hash Code    */
	}	rar;      
	short	csr;		/* hardwired control and status register */
	short	tseg;		/* active transmit segment #             */
	short	rseg;		/* active receive  segment #             */
	short	segb;		/* segment boundary register             */
	short	lrf;		/* lost receive frame counter            */
	short	ivct;		/* interrupt vector register.            */
	short	nada0;		/*  -- reserved for future use --        */
	short	fcoll;		/* force collision register.             */
};

/*
The following two structure define the format of "transmit and receive
segments" in the V/EIU's Dual-Ported Memory.  Each segment is 2KBytes
long and buffers either an outgoing (transmit segment) or incoming 
(receive segment) Ethernet Frame.
*/

struct tx_segment {
          short        tx_csr;         /* control and status register */
          char         tx_data[2014];  /* frame buffer area           */
          short        tx_backoff[16]; /* control and status register */
          };

struct rx_segment {
          short        rx_csr;         /* control and status register */
          char         rx_data[2046];  /* frame buffer area           */
          };

/*
The following two structures define the descriptors used to represent a logical
queue of Ethernet frames.  The structure supports a FIFO queue mechanism.
For each queue there is a general control structure that tracks the location
of the first and last elements of the queue.  Each element contains infromation
relating to the location of the Ethernet frame & the # of bytes it contains,
and the location of the next element in the queue.
*/

struct ace_element {
	struct	ace_element *pNext;  /* ptr to the next element of the queue  */
	char	*pFrame; 	/* ptr to Ethernet frame assoc w/ elem.  */
     };


struct ace_queue {
     struct ace_element* phead;       /* ptr to first element of queue */
     struct ace_element* ptail;       /* ptr to last element of queue  */
     };

/*
The following structure defines the format of Ethernet Station Address and
the format of the Hash Code used by the V/EIU do filter receipt of multicast
datagram incoming from the Ethernet.
*/ 

struct station_addr {
            char           esa[6];          /* 6 byte field in address */
       };

struct hash_code    {
            char           mhc[8];          /* 8 byte field in hash code */
       };


 /*
V/EIU CONTROL/STATUS REGISTER BIT DEFINITIONS
=============================================

The following defines the bits in the V/EIU's "Control/Status Register".
Each bit definition is followed by a brief description which includes 
a reference to its read/write capabilities as well as it's active state
if appropriate.  "r/w" := read/write, "r" := read only, and "w" := write 
only.  "aL" := active LOW and "aH" := active high".  The first three letters 
of the bits' names, "CSR", indicate definition for the "CSR register" only.
*/

#define  CSR_UNUSED      0xFD00 /* unused bits                       "??_??" */
#define  CSR_ENXMITODD   0x0200 /* Enable Odd # byte transmission    "rw_aH" */
#define  CSR_ACTIVE      0x0080 /* V/EIU is active & running         "r _aH" */
#define  CSR_RESET       0x0040 /* V/EIU reset control line          " w_aH" */
#define  CSR_PROMISCUOUS 0x0020 /* Enable "promiscous mode" operation"rw_aH" */
#define  CSR_NOXMITCRC   0x0010 /* Disable CRC generation & checking "rw_aH" */
#define  CSR_LOOP3       0x0008 /* Enable MODE 3 LOOPBACK mode       "rw_aH" */
#define  CSR_LOOP2       0x0004 /* Enable MODE 2 LOOPBACK mode       "rw_aH" */
#define  CSR_ENINT       0x0002 /* Enable Interrupts to VERSAbus     "rw_aH" */
#define  CSR_GO          0x0001 /* Enable V/EIU operations           " w_aH" */

/*
V/EIU VALID BIT MASKS
=====================

The following defines the valid bits of "short" fields contained in
the V/EIU's "Receive Address Match Ram".  The first three letters
of the masks' names indicate definition for the following:
   RAR ==> Receive Address Ram          IVC ==> Interrupt Vector Register
   LRF ==> Lost Receive Frame Counter   FCL ==> Force Collision Register
*/

#define  RAR_VALID       0x00FF /* Valid bits in Receive Address Ram fields  */
#define  LRF_VALID       0x000F /* Valid bits in Lost Receive Frame register */
#define  IVC_VALID       0x00F8 /* Valid bits in Interrupt Vector register   */
#define  FCL_VALID       0xFFFF /* Valid bits in Force Collision register    */

/*
V/EIU TRANSMIT SEGMENT CONTROL/STATUS BIT DEFINITIONS
=====================================================

The following defines the bit-fields in the "Control/Status Field" of a 
Transmit Segment in the V/EIU's Dual-Ported Memory.  There are two 
types of bit-fields it this field, those that produce a response by the 
V/EIU ("command") and those that indicate the response ("status")
The first three letters of the bits' names, "TCS", indicate definition 
for the "Tx segment CSr" only.
*/

/* commands */
#define  TCS_TBFULL   	 (short)0x8000 /*   Tx Bfr Full so send it           */
#define  TCS_TBC         (short)0x07FF /*   Tx Byte Count                    */
/* status */
#define  TCS_TBMT        (short)0x8000 /*   Tx Buffer Empty   (avail for Tx) */
#define  TCS_RTFAIL      (short)0x4000 /*   Tx Retries Failed (frame dropped)*/
#define  TCS_RTC         (short)0x000F /*   Tx # Retries which collided      */

/*
V/EIU RECEIVE SEGMENT CONTROL/STATUS BIT DEFINITIONS
====================================================

The following defines the bit-fields in the "Control/Status Field" of a 
Receive Segment in the V/EIU's Dual-Ported Memory.  There are two 
types of bit-fields it this field, those that produce a response by the 
V/EIU ("command") and those that indicate the response ("status")
The first three letters of the bits' names, "RCS", indicate definition 
for the "Rx segment CSr" only.
*/

#define  RCS_RBMT        0x8000 /* command:  Rx Bfr Empty      (avail for Rx) */
#define  RCS_RBFULL      0x8000 /* status :  Rx Bfr Full       (frame Rx'd)   */
#define  RCS_ROVRN       0x4000 /*        :  Rx Bfr Overrun Error (too long)  */
#define  RCS_RCRC        0x2000 /*        :  Rx Bfr CRC Error  (bad data)     */
#define  RCS_RODD        0x1000 /*        :  Rx Bfr Alignment Error (odd cnt) */
#define  RCS_RBC         0x07FF /*        :  Rx Bfr Byte Count                */

/*
V/EIU SPECIAL FUNCTION CODE DEFINITIONS
=======================================

The following define the valid functions codes available for use with
the "spfun ()" entry point into this driver.
*/

#define  ACE_INIT      0x0001     /* V/EIU Initialize command        */
#define  ACE_RESP      0x0002     /* V/EIU Initialize response       */
#define  ACE_STATS     0x0003     /* V/EIU Statistics query          */
#define  ACE_ECMAP     0x0004     /* V/EIU Event counter map request */
#define  ACE_IOPORTS   0x0005     /* V/EIU I/O Ports Dump            */
#define  ACE_UCBSTATS  0x0006     /* V/EIU UCB contents Dump         */

/*
V/EIU RETURNED ERROR CODES
==========================

The following define the range of error codes which may be returned by
this driver to calling user processes.  The first letter of the error code's 
names, "E", indicates definition for "returned error codes" only.
*/

#define  E_BADDEV        (-100)    /* illegal minor device                   */
#define  E_OFFLINE       (-101)    /* requested unit is not on-line          */
#define  E_LOSTSYNC      (-102)    /* driver syncronization lost w/ hardware */
#define  E_SIGNALED      (-103)    /* I/O request terminated due to signal() */
#define  E_2BIG          (-104)    /* transmit request for oversize frame    */
#define  E_2SMALL        (-105)    /* receive request for undersize frame    */
#define  E_BADCALL       (-106)    /* illegal "spfun()" call                 */
#define  E_RESET         (-107)    /* unit reset while waiting for i/o to end*/

/*
V/EIU MISCELLANEOUS DEFINTIIONS
===============================

The following are miscellaneous constant definitions and come from
a number of places for a number of different reasons.
*/

#define  ACE_OFFLINE   0         /* off-line unit status                   */
#define  ACE_ONLINE    0         /* on-line unit status                    */
#define  CRC_SIZE        4         /* number of bytes in a rx seg's CRC      */
#define  RCW_SIZE        2         /* number of bytes in a rx seg's csr      */
#define  M_READ          "read"    /* read diagnostic string                 */
#define  M_WRITE         "write"   /* write diagnostic string                */
#define  SEG_MAX         15        /* largest valid V/EIU segment number     */
#define  MXRXPKTSZ       1516      /* max. size of allowed rx/tx frames +RCW */
#define  ET_MINLEN       64        /* min. size of allowed rx/tx frames      */
#define  ET_MAXLEN       1514      /* max. size of rx/tx frames w/o CRC & RCW*/
#define  EC_ARRIVED      42        /* EC mapping number for "rx_arrived EC   */
#define  EC_PROCESSED    43        /* EC mapping number for "rx_processed EC */
#define  RX_ARVD_EC      42        /* Select code for rx_arrived EC mapping  */
#define  RX_PRCD_EC      43        /* Select code for rx_processed EC mapping*/


unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.