home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0020 - 0029 / ibm0020-0029 / ibm0028.tar / ibm0028 / GRLF-C-1.ZIP / GCOMM / ASIDIAG.C < prev    next >
Encoding:
C/C++ Source or Header  |  1990-08-14  |  1.2 KB  |  48 lines

  1. /* asidiag.c
  2. *
  3. * The Greenleaf Comm Library
  4. *
  5. * Copyright (C) 1985-1990 Greenleaf Software Inc.  All Rights Reserved.
  6. *
  7. *  int asidiag(port, option)
  8. *  int port;            - Port 0..MAX_PORT-1
  9. *  int ctrl;            - ON (1) or OFF (0)
  10. *
  11. * DESCRIPTION
  12. *  set or clear internal diagnostic mode implemented by the 8250 uart.
  13. *  ctrl==ON enables diagnostic mode, ctrl==OFF disables diagnostic mode.
  14. *
  15. * SIDE EFFECTS
  16. *  none.
  17. *
  18. * RETURNS
  19. *
  20. *       Value           Meaning
  21. *     -------          --------
  22. *       ASSUCCESS       (no error)
  23. *       ASINVPORT       Requested port is out of range
  24. *       ASNOTSETUP      Requested port not setup with asifirst()
  25. *       ASINVPAR        Invalid parameter
  26. *
  27. * MODIFICATIONS
  28. *       2-20-86 Don Killen - Release 2.0
  29. */
  30. #include <stdio.h>
  31. #include "gf.h"
  32. #include "asiports.h"
  33.  
  34. int GF_CONV asidiag(port,ctrl)
  35. int port,ctrl;
  36. {
  37.         struct PORT_TABLE *p;
  38.  
  39.         if((p=_aschkcnl(port))==NULL)
  40.                 return(_aserror);
  41.         if(ctrl==OFF||ctrl==ON) {
  42.                 _asidiag(p->base_8250,ctrl);
  43.                 return(ASSUCCESS);
  44.         } else
  45.                 return(ASINVPAR);
  46. }
  47.  
  48.