home *** CD-ROM | disk | FTP | other *** search
- /* asidiag.c
- *
- * The Greenleaf Comm Library
- *
- * Copyright (C) 1985-1990 Greenleaf Software Inc. All Rights Reserved.
- *
- * int asidiag(port, option)
- * int port; - Port 0..MAX_PORT-1
- * int ctrl; - ON (1) or OFF (0)
- *
- * DESCRIPTION
- * set or clear internal diagnostic mode implemented by the 8250 uart.
- * ctrl==ON enables diagnostic mode, ctrl==OFF disables diagnostic mode.
- *
- * SIDE EFFECTS
- * none.
- *
- * RETURNS
- *
- * Value Meaning
- * ------- --------
- * ASSUCCESS (no error)
- * ASINVPORT Requested port is out of range
- * ASNOTSETUP Requested port not setup with asifirst()
- * ASINVPAR Invalid parameter
- *
- * MODIFICATIONS
- * 2-20-86 Don Killen - Release 2.0
- */
- #include <stdio.h>
- #include "gf.h"
- #include "asiports.h"
-
- int GF_CONV asidiag(port,ctrl)
- int port,ctrl;
- {
- struct PORT_TABLE *p;
-
- if((p=_aschkcnl(port))==NULL)
- return(_aserror);
- if(ctrl==OFF||ctrl==ON) {
- _asidiag(p->base_8250,ctrl);
- return(ASSUCCESS);
- } else
- return(ASINVPAR);
- }
-
-