DataMuseum.dk

Presents historical artifacts from the history of:

Regnecentalen RC-900

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Regnecentalen RC-900

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download

⟦fa7f8c6af⟧ TextFile

    Length: 5344 (0x14e0)
    Types: TextFile
    Notes: UNIX file
    Names: »ub.h«

Derivation

└─⟦8c4f54e61⟧ Bits:30004068/disk2.imd Interactive TCP/IP v.1.2
└─⟦8c4f54e61⟧ UNIX Filesystem
    └─⟦this⟧ »hb/new/usr/include/sys/ub.h« 

TextFile

/*
 *	definitions and declarations for the U-B PC-NIC ethernet driver
 *
 *	Copyrighted as an unpublished work.
 *	(c) Copyright 1988 INTERACTIVE Systems Corporation
 *	All rights reserved.
 *
 *	RESTRICTED RIGHTS:
 *
 *	These programs are supplied under a license.  They may be used,
 *	disclosed, and/or copied only as permitted under such license
 *	agreement.  Any copy must contain the above copyright notice and
 *	this restricted rights notice.  Use, copying, and/or disclosure
 *	of the programs is strictly prohibited unless otherwise provided
 *	in the license agreement.
 */

#ident "@(#)ub.h	1.4 - 89/01/13"

/*
 * U-B board specific parameters for space.c
 */

#define UB_PADDR_0	0x00
#define UB_PADDR_1	0x01

/*
 * definitions of all U-B PC-NIC registers and internal data structures.  
 */

struct ubmemmap {

#define EPROM_SIZE	0x2000
#define PHYSADDR_OFFSET	0x10
   unsigned char eprom[EPROM_SIZE];

   unsigned char control[0x80];	/* unused front of control */
#define CONTROL_REGISTER_BASE_OFFSET 0x2080

				/* U/B control registers */
   unsigned char txinit;
   unsigned char clrpav;
   unsigned char intstat;
   unsigned char inten;

				/* map read/write pairs, etc. */
#define	tsamsb txinit
#define tsalsb clrpav
#define intctl intstat
#define epp inten
#define pav inten
#define fpp inten

#define RECV_PAGE_OFFSET	0x2100
#define RECV_PAGE_FILLER	0x7C
   unsigned char receive_page_filler[RECV_PAGE_FILLER]; /* unused portion */
				/* receive page index */
#define INDEX_SIZE		96
   unsigned char index[INDEX_SIZE];
#define EOPKT			0x80
#define PAGE_MASK		0x7f

#define EDLC_BASE_OFFSET	0x2180
#define EDLC_FILLER		0x20
   unsigned char edlc_filler[EDLC_FILLER];
				/* EDLC registers */
   unsigned char xmit_status;
   unsigned char xmit_mask;
   unsigned char recv_status;
   unsigned char recv_mask;
   unsigned char xmit_mode;
   unsigned char recv_mode;
   unsigned char edlc_reset;
   unsigned char xmit_data_count_low;
   unsigned char node_id[LLC_ADDR_LEN];
   unsigned char reserved;
   unsigned char xmit_data_count_high;

#define RECV_PAGE_BUFFER	0x4000
#define RECV_BUFF_FILLER	0x1E70
   unsigned char receive_buff_filler[RECV_BUFF_FILLER];

#define RECV_PAGE_SIZE	128
#define RECV_PAGES		 96
#define RECV_BUFF_SIZE	(RECV_PAGE_SIZE*RECV_PAGES)
   struct receive_page {
      unsigned char data[RECV_PAGE_SIZE];
   }		recv_page[RECV_PAGES];

#define XMIT_BUFFER_OFFSET	0x7000
#define XMIT_BUFFER_SIZE	2048
#define XMIT_BUFFERS		2
   struct transmit_buffer {
      unsigned char data[XMIT_BUFFER_SIZE];
   } xmit_buffer[XMIT_BUFFERS];
};

/* misc. constants for EDLC and board parameters */

#define EDLC_RESET		0x80 /* put board into reset */
#define EDLC_LOOPBACK		0x00 /* appropriate bits to go into loopback */
#define EDLC_CLEAR		0x00 /* general clear */
#define EDLC_SETCLEAR		0xff /* clear by setting all bits */

#define PAV_MASK		0x7f /* mask for clearing PAV bit */
#define PAV_SET			0x80 /* PAV bit testing */
#define INTEN_MASK		0x7f /* mask for clearin INTEN bit */
#define INTEN_ENABLE		0x80 /* INTEN bit */
#define XMIT_DONE		0x01 /* transmit is done if set */
#define XMIT_OK			0x02 /* transmit is done without error */
#define XMIT_ENABLE		0x0a /* enable board for transmit */
#define XMIT_CLEAR		0x0f /* clear xmit status bits */
#define XMIT_STAT_MASK		(XMIT_DONE|XMIT_OK)
#define RECV_OFF		0x00 /* receiver off */
#define RECV_PROMISCUOUS	0x03 /* enable promiscuous mode */
#define RECV_LIMITED		0x01 /* limited multicast, broadcast, mine */
#define RECV_NORMAL		0x02 /* all multicast, broadcast, mine */
#define RECV_MODE		RECV_NORMAL
#define XMIT_MODE		XMIT_ENABLE /*  for now */

/*swapped for now in order to test */
#define INTR_XMIT		0x80 /* interrupt on xmit complete */
#define INTR_RECV		0x40 /* interrupt on packet received */
#define INTR_SOFT		0x20 /* interrupt on software */
#define INTR_TIMER		0x10 /* interrupt on timer expire */

#define INTR_DEFAULT		(INTR_RECV) /* none for now */
#define INTR_ENABLE		0x00
#define INTR_CLEAR		0

#define XMIT_MASK_PARITY	0x01
#define XMIT_MASK_EXCOLL	0x02
#define XMIT_MASK_COLL		0x04
#define XMIT_MASK_UNDERFLOW	0x08
#define XMIT_MASK_SHORTED	0x10

/*
 * operational statistics		
 */

#define UB_NSTATS	16

struct ubstats {

       /* non-hardware */
   struct llcstats ubs_llcs;	/* 0-3 */

       /* transmit */
   ulong	ubs_xpkts;	/* 4 */
   ulong	ubs_xbytes;	/* 5 */
   ulong	ubs_excoll;	/* 6 */
   ulong	ubs_coll;	/* 7 */
   ulong	ubs_under;	/* 8 */
   ulong	ubs_carrier;	/* 9 */

       /* receive */
   ulong	ubs_rpkts;	/* 10 */
   ulong	ubs_rbytes;	/* 11 */
   ulong	ubs_fcs;	/* 12 */
   ulong	ubs_align;	/* 13 */
   ulong	ubs_overflow;	/* 14 */
   ulong	ubs_short;	/* 15 */
};

/* misc operational parameters */

#define UBHIWAT		(32*1024)
#define UBLOWAT		(8*1024)
#define UBMAXPKT	1500
#define UBMAXPKTLLC	1497

/* additional variables needed for board operation */
/* in a struct in order to simplify multiboard support later */
struct ubvars {
   int	fpp;			/* local copy of fpp */
   int  buffer_avail;
   int	buffer_full;		/* buffer contains valid packet */
   int	buffer_last;		/* last buffer xmitted from */
   int  buffer_len[2];
   int  xmitter_busy;
};
#define UBDEBUG 0xffff
#define UBERRS	0x0001
#define UBTRACE 0x0002
#define UBFLOW  0x0004
#define UBSCHED 0x0008
#define UBRECV  0x0010
#define UBXMIT  0x0020