ibcac.c 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /***************************************************************************
  2. sys/ibcac.c
  3. -------------------
  4. copyright : (C) 2001, 2002 by Frank Mori Hess
  5. email : fmhess@users.sourceforge.net
  6. ***************************************************************************/
  7. /***************************************************************************
  8. * *
  9. * This program is free software; you can redistribute it and/or modify *
  10. * it under the terms of the GNU General Public License as published by *
  11. * the Free Software Foundation; either version 2 of the License, or *
  12. * (at your option) any later version. *
  13. * *
  14. ***************************************************************************/
  15. #include "gpibP.h"
  16. /*
  17. * IBCAC
  18. * Return to the controller active state from the
  19. * controller standby state, i.e., turn ATN on. Note
  20. * that in order to enter the controller active state
  21. * from the controller idle state, ibsic must be called.
  22. * If v is non-zero, take control synchronously, if
  23. * possible. Otherwise, take control asynchronously.
  24. */
  25. int ibcac( gpib_board_t *board, int sync )
  26. {
  27. int status = ibstatus( board );
  28. int retval;
  29. if( ( status & CIC ) == 0 )
  30. {
  31. printk("gpib: not CIC during ibcac()\n");
  32. return -1;
  33. }
  34. retval = board->interface->take_control( board, sync );
  35. if( retval < 0 )
  36. printk("gpib: error while becoming active controller\n");
  37. board->interface->update_status( board, 0 );
  38. return retval;
  39. }