/****************************************************************/
/* errtab.c:  Error reporting library                           */
/****************************************************************/
/*																*/
/*                 Confidential Information                     */
/*      Limited Distribution to Authorized Persons Only         */
/*     Created 1987 and Protected as an Unpublished Work        */
/*          Under the U.S. Copyright Act of 1976.               */
/*         Copyright (c) 1987,'88, Systech Corporation          */
/*                  All Rights Reserved                         */
/*																*/
/*	THIS SOFTWARE IS LICENSED BY AND IS THE	CONFIDENTIAL AND 	*/
/*	PROPRIETARY PROPERTY OF SYSTECH COMPUTER CORPORATION AND 	*/
/*	MAY NOT, WITHOUT THE PRIOR WRITTEN CONSENT OF SYSTECH 		*/
/*	COMPUTER CORPORATION, BE REPRODUCED, USED OR DISCLOSED 		*/
/*	EXCEPT IN ACCORDANCE WITH A SYSTECH COMPUTER CORPORATION 	*/
/*	SOFTWARE LICENSE AGREEMENT.									*/
/****************************************************************/
/*																*/
/*	This routine provides a convenient mechanism for reporting	*/
/*	iocb errors in the mail field.								*/
/*																*/
/*	Parameters: iocb.hdr.mail.hdr_addr >> 16					*/
/*	            name of calling program							*/
/*																*/
/*****************************************************************/
#include <stdio.h>
#include "hps.types.h"
#include "hps.iocb.h"

errtab (msg, pname)
bit32 msg;
char *pname;
{
	/* display error encountered from hps  */

#	ifdef DEBUG
		fprintf(stderr, "msg = %s cmd = %s \n", msg, cmd);
#	endif

	switch (msg)
	{
		case (E_NODEV):
			fprintf(stderr,"%s: Error attempting to access non-existent channel/port.\n", pname);
			break;

		case (E_NOFUNC):
			fprintf(stderr,"%s: Requested function in minor device field doesn't exist.\n", pname);
			break;

		case (E_NOCOMMAND):
			fprintf(stderr,"%s: Command not recognized by device.\n", pname);
			break;

		/* Took out E_REMOTE case since it will never be returned */

		case (E_NOCONFIRM):
			fprintf(stderr,"%s: Confirmation not received from cluster.\n", pname);
			break;

		case (E_OVERFLOW):
			fprintf(stderr,"%s: Cluster sent more data than was requested.\n", pname);
			break;

		/* Took out E_NOSTATION because this is never used */

		case (E_XACKTO):
			fprintf(stderr,"%s: XACK timeout during DMA.\n", pname);
			break;

		case (E_BUSTO):
			fprintf(stderr,"%s: Bus grant timeout during DMA.\n", pname);
			break;

		case (E_BUSY):
			fprintf(stderr,"%s: Requested resource is busy.\n", pname);
			break;

		case (E_NOMEM):
			fprintf(stderr,"%s: Controller out of memory.\n", pname);
			break;

		case (E_CLOSED):
			fprintf(stderr,"%s: Requested resource is not open.\n", pname);
			break;

		case (E_OFFLINE):
			fprintf(stderr,"%s: No response from network.\n", pname);
			break;

		case (E_NORESP):
			fprintf(stderr,"%s: No response from cluster.\n", pname);
			break;

		case (E_BADRESP):
			fprintf(stderr,"%s: Bad response (NAK) from cluster.\n", pname);
			break;

		case (E_FULL):
			fprintf(stderr,"%s: Output buffer is full.\n", pname);
			break;

		case (E_NETBUSY):
			fprintf(stderr,"%s: Network is busy.\n", pname);
			break;

		case (E_CONNECT):
			fprintf(stderr,"%s: No clusters connected for download.\n", pname);
			break;

		case (E_CHKSUM):
			fprintf(stderr,"%s: Checksum error during cluster download.\n", pname);
			break;

		case (E_PANIC):
			fprintf(stderr,"%s: Panic condition on host adapter.\n", pname);
			break;

		default:
			fprintf(stderr,"%s: Received unknown error message %d.\n",pname,msg);
	}
}
