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 / ASIRESET.C < prev    next >
Encoding:
C/C++ Source or Header  |  1990-08-14  |  1.2 KB  |  47 lines

  1. /* asireset.c
  2. *
  3. * The Greenleaf Comm Library
  4. *
  5. * Copyright (C) 1985-1990 Greenleaf Software Inc.  All Rights Reserved.
  6. *
  7. *  int asireset(port)
  8. *  int port;    - Port 0..MAX_PORT
  9. *
  10. * DESCRIPTION
  11. *  This function resets the port's 8250 to it's "pre - asifirst()"
  12. *  condition.  This only applies to the 8250's baud rate registers and modem &
  13. *  line control register (parity, word length etc.).  Executing this
  14. *  function will not disable interrupts in the 8250 if they were
  15. *  running.
  16. *
  17. * SIDE EFFECTS
  18. *  none
  19. *
  20. * RETURNS
  21. *       Value           Meaning
  22. *     -------          --------
  23. *       ASSUCCESS       Successful!
  24. *       ASINVPORT       Requested port is out of range
  25. *       ASNOTSETUP      Requested port not setup with asifirst()
  26. *
  27. * MODIFICATIONS
  28. *  11-02-85     ""
  29. *               Modified for release 2.0
  30. */
  31. #include <stdio.h>
  32. #include "gf.h"
  33. #include "asiports.h"
  34.  
  35. int GF_CONV asireset(port)
  36. int port;
  37. {
  38.         struct PORT_TABLE *p;
  39.  
  40.         if((p=_aschkcnl(port))==NULL)
  41.                 return(_aserror);
  42.         _asireset(p->base_8250,p->p_8250[0],p->p_8250[3],p->p_8250[4],
  43.                 p->p_8250[1]);
  44.         return(ASSUCCESS);
  45. }
  46.  
  47.