1: /*
   2:  * Copyright (c) 1986 Regents of the University of California.
   3:  * All rights reserved.  The Berkeley software License Agreement
   4:  * specifies the terms and conditions for redistribution.
   5:  *
   6:  *	@(#)tsauto.c	2.1 (2.11BSD) 12/30/92
   7:  */
   8: 
   9: #include "param.h"
  10: #include "../machine/autoconfig.h"
  11: #include "../machine/machparam.h"
  12: 
  13: #include "tsreg.h"
  14: 
  15: tsprobe(addr,vector)
  16:     register struct tsdevice *addr;
  17:     int vector;
  18: {
  19:     extern int errno;
  20: 
  21:     /*
  22: 	 * Unfortunately the TS and TM CSRs overlap.  So simply testing for
  23: 	 * presence of a TS register isn't good enough.  We borrow from
  24: 	 * the "universal" tape boot block by poking the controller and
  25: 	 * looking for the "need buffer address" bit from a TS.  If that
  26: 	 * bit fails to come on the device is not a TS.
  27: 	 */
  28:     errno = 0;
  29:     stuff(0, &addr->tssr);      /* poke the controller */
  30:     if (errno)          /* paranoia */
  31:         return(ACP_NXDEV);
  32:     DELAY(100L);            /* give TS time for diagnostics */
  33:     if (grab(&addr->tssr) & TS_NBA) /* need buffer address bit on? */
  34:         return(ACP_EXISTS); /* yes = return existence */
  35:     return(ACP_NXDEV);      /* not a TS */
  36: }

Defined functions

tsprobe defined in line 15; used 2 times
Last modified: 1992-12-31
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 2476
Valid CSS Valid XHTML 1.0 Strict