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

⟦5238806ae⟧ TextFile

    Length: 5270 (0x1496)
    Types: TextFile
    Notes: UNIX file
    Names: »lph.h«

Derivation

└─⟦aca99617e⟧ Bits:30004042/update3.imd SW95705I 386/ix Multi-user Release 1.2
└─⟦aca99617e⟧ UNIX Filesystem
    └─⟦this⟧ »U3/new/usr/include/sys/lph.h« 

TextFile

/* lph.h 
 * Started 880309 HCA
 *
 * Based on mux.h
 *
 */

typedef unsigned short lph_t;		/*addresses within shared memory*/
typedef struct cmd_descr *  cmd_t;   /* usefull type  */

#define FUNIT		 1  /* First unit/board number in lph_cfg */

#define LPHS		32	/* Max printers pr board */
#define	TTOPRI		29
#define	TTIPRI		28

#define NAMSI		12	/* Size for configured names */

#define NUMBOARDS     1
#define LPHCHANS	    (NUMBOARDS * LPHS) /* Total num of Mux Lan Printers
											* supported						*/
#define CONFDEV		(LPHCHANS + 2)

#define OB_SIZE		256 /* Size of output buffer						*/

/*bits in lph_status*/
#define LPH_MISSING	0x0001	/* lphgate1 i.e. 1. intr. not rec. yet	 	*/
#define LPH_ERROR	0x0002	/* some fatal error occurred				*/
#define LPH_FATAL   (LPH_ERROR | LPH_MISSING)
#define LPH_OK		0x0010	/* board downloaded without error			*/

/*bits in chan_status*/
#define C_DISCON	0x0001  /* Channel disconnected 					*/
#define C_CONNECT	0x0002  /* Channel connected						*/
#define C_OK	    0x0004  /* Channel connected && ! C_PFAULT          */
#define	C_CLOSED	0x0010	/* Channel Closed  (Good!)					*/
#define	C_ISOPEN	0x0020	/* Channel is open (Could be serious!)		*/
#define	C_ISCLOS	0x0040	/* Channel is closing - reason signal       */
#define	C_WRITING	0x0080	/* Channel is writing - used in close       */
#define	C_SLPCL		0x0100	/* Sleep in close/regret . (Recommendable)	*/
#define C_SLPWR		0x0200  /* Sleep in write							*/
#define C_SLPST		0x0400  /* Sleep in open - wakeup on status        	*/
/* Secondary printer statuses               */
#define C_PPAPER    0x1000  /* Paperout		*/
#define C_PDESEL    0x2000  /* Deselected   */
#define C_PFAULT    0x4000  /* Printer faulted */
#define C_POK       0x8000  /* Printer OK   */

/* Various combinations of above flags					*/

#define C_INIT		(C_DISCON|C_CLOSED|C_PFAULT)	/* Initial flags */
#define C_OPENOK	(C_OK|C_CLOSED) /* Ok to open   */
#define C_WRITEOK   (C_OK|C_ISOPEN) /* Ok to write  */
#define C_PFLAGS    (C_PPAPER|C_PDESEL|C_POK|C_PFAULT)
#define C_CONNS     (C_DISCON|C_CONNECT|C_OK)
#define C_CLOP      (C_ISOPEN|C_CLOSED|C_ISCLOS)
#define C_SLEEPS    (C_SLPCL|C_SLPWR|C_SLPST)
#define C_POKOK		(C_OK|C_POK)

#define set_pflag(X) tp->chan_status = (tp->chan_status & ~C_PFLAGS) | X
#define set_conn(X)  tp->chan_status = (tp->chan_status & ~C_CONNS)  | X
#define set_clop(X)  tp->chan_status = (tp->chan_status & ~C_CLOP)  | X
#define rm_status(X) tp->chan_status &= ~X
#define CHAN_OK		 ((tp->chan_status & C_POKOK) == C_POKOK)
/*operation codes*/

#define	O_STATUS    1	/* Channel status  - asyncron ping pong command */
#define O_CLOSE 	2	/* Syncron to get last write buffer back		*/
#define O_WRITE 	3	/* Write command								*/

/*possible responses  == lphh.h */

#define R_ERROR   	0x80  /* - Protocol PCI error.		*/ 
#define R_DISCON	0x40  /* Disconnected   */
#define R_PSTAT   	0x20  /* - Printer secondary status. */ 
#define R_UNKNOWN	0x10  /* Printer name unknown in configuration */
#define R_WOK		0x00  /* Write or close ok */

#define R_SOK		0x00  /* Printer ok 	*/
#define R_SPAPER	0x01  /* Paperout 		*/
#define R_SDESEL	0x02  /* Deselected 	*/
#define R_SFAULT	0x04  /* Printer faulted*/
#define R_SOME      (R_SPAPER|R_SDESEL|R_SFAULT)

#define R_ILLCMD	0x81  /* Invalid operation */
#define R_ILLCHAN	0x82  /* Illegal channel   */

struct lph_chan {		/* per-channel structure						*/
	int   chan_status;	/* Various flags, See above.					*/
	struct  lph_board * board_p;/* Points to board for this channel		*/
	short   chan_no;	/* Channel no. on board							*/
	cmd_t cmd_status;	/* address in common mem. for status command    */
	cmd_t cmd_close;	/* address in common mem. for close  command    */
	struct cmd_write * cmd_write;	/* address in common mem. for write */
	caddr_t bufadr;     /* address in common men. for data in write     */
};

struct lph_cfg {		/* struct from which lph is configured	*/
	short c_boardno;	/* asl board number						*/
	short c_fchan;		/* first channel no. on board			*/
	short c_lchan;		/* last+1 channel no. on board			*/
};


struct lph_board {
	struct x_buf xb;
	struct mslbuf msl;

	short	fchan;		/* First channel no. on board					*/
	short	lchan;		/* Last + 1 channel no. on board				*/
	char	board_no;	/* Board number for this structure				*/
	caddr_t	lph_window;	/* address of common memory						*/
	lph_t	mem_avail; 	/* Common data memory available					*/
	short	lph_status;	/* board status									*/
	cmd_t  chainend;   /* -> to last cmd delivered to asl  */
};

struct cmd_descr {
	lph_t next;		/* link field       */
	char  operation;/* opcode			*/
	char  channel;	/* channel number	*/
	char  result;	/* lph's response 	*/
	char  align;	/* */
};

struct cmd_write {
	lph_t next;		/* link field       */
	char  operation;/* opcode			*/
	char  channel;	/* channel number	*/
	char  result;	/* lph's response 	*/
	char  align;	/* Status result	*/
	lph_t cd_towr;			/*  Chars to write 						*/
	char  cd_buf[OB_SIZE];  /* Char buffer to write					*/
};

struct memdescr {
	lph_t	m_paroff;	/* Offset to param area in lph window	*/
	lph_t	m_prioff;	/* Offset to private mem in lph window	*/
	lph_t	m_size;		/* Size of private mem in lph window	*/
	lph_t   m_boff;		/* Physical address of window (64K)		*/
};