BSD 4_4_Lite1 release
[unix-history] / usr / src / sys / hp300 / dev / fhpib.c
index 405e714..b679abd 100644 (file)
@@ -1,10 +1,36 @@
 /*
 /*
- * Copyright (c) 1982, 1990 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1982, 1990, 1993
+ *     The Regents of the University of California.  All rights reserved.
  *
  *
- * %sccs.include.redist.c%
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *     This product includes software developed by the University of
+ *     California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
  *
  *
- *     @(#)fhpib.c     7.4 (Berkeley) %G%
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ *     @(#)fhpib.c     8.2 (Berkeley) 1/12/94
  */
 
 /*
  */
 
 /*
 #include "hpib.h"
 #if NHPIB > 0
 
 #include "hpib.h"
 #if NHPIB > 0
 
-#include "sys/param.h"
-#include "sys/systm.h"
-#include "sys/buf.h"
-#include "hp/dev/device.h"
-#include "fhpibreg.h"
-#include "hpibvar.h"
-#include "dmavar.h"
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/buf.h>
+
+#include <hp/dev/device.h>
+
+#include <hp300/dev/fhpibreg.h>
+#include <hp300/dev/hpibvar.h>
+#include <hp300/dev/dmavar.h>
 
 /*
  * Inline version of fhpibwait to be used in places where
 
 /*
  * Inline version of fhpibwait to be used in places where
@@ -64,6 +92,7 @@ fhpibtype(hc)
 }
 
 fhpibreset(unit)
 }
 
 fhpibreset(unit)
+       int unit;
 {
        register struct hpib_softc *hs = &hpib_softc[unit];
        register struct fhpibdevice *hd;
 {
        register struct hpib_softc *hs = &hpib_softc[unit];
        register struct fhpibdevice *hd;
@@ -105,6 +134,7 @@ fhpibifc(hd)
 }
 
 fhpibsend(unit, slave, sec, addr, origcnt)
 }
 
 fhpibsend(unit, slave, sec, addr, origcnt)
+       int unit, slave, sec, origcnt;
        register char *addr;
 {
        register struct hpib_softc *hs = &hpib_softc[unit];
        register char *addr;
 {
        register struct hpib_softc *hs = &hpib_softc[unit];
@@ -162,6 +192,7 @@ senderr:
 }
 
 fhpibrecv(unit, slave, sec, addr, origcnt)
 }
 
 fhpibrecv(unit, slave, sec, addr, origcnt)
+       int unit, slave, sec, origcnt;
        register char *addr;
 {
        register struct hpib_softc *hs = &hpib_softc[unit];
        register char *addr;
 {
        register struct hpib_softc *hs = &hpib_softc[unit];
@@ -218,6 +249,7 @@ recvbyteserror:
 
 fhpibgo(unit, slave, sec, addr, count, rw)
        register int unit;
 
 fhpibgo(unit, slave, sec, addr, count, rw)
        register int unit;
+       int slave, sec, count, rw;
        char *addr;
 {
        register struct hpib_softc *hs = &hpib_softc[unit];
        char *addr;
 {
        register struct hpib_softc *hs = &hpib_softc[unit];
@@ -303,6 +335,7 @@ fhpibgo(unit, slave, sec, addr, count, rw)
 }
 
 fhpibdone(unit)
 }
 
 fhpibdone(unit)
+       int unit;
 {
        register struct hpib_softc *hs = &hpib_softc[unit];
        register struct fhpibdevice *hd;
 {
        register struct hpib_softc *hs = &hpib_softc[unit];
        register struct fhpibdevice *hd;
@@ -416,6 +449,7 @@ fhpibintr(unit)
 }
 
 fhpibppoll(unit)
 }
 
 fhpibppoll(unit)
+       int unit;
 {
        register struct fhpibdevice *hd;
        register int ppoll;
 {
        register struct fhpibdevice *hd;
        register int ppoll;
@@ -438,6 +472,7 @@ fhpibppoll(unit)
 
 fhpibwait(hd, x)
        register struct fhpibdevice *hd;
 
 fhpibwait(hd, x)
        register struct fhpibdevice *hd;
+       int x;
 {
        register int timo = hpibtimeout;
 
 {
        register int timo = hpibtimeout;
 
@@ -454,15 +489,20 @@ fhpibwait(hd, x)
 }
 
 /*
 }
 
 /*
- * XXX: this will have to change if we every allow more than one
+ * XXX: this will have to change if we ever allow more than one
  * pending operation per HP-IB.
  */
  * pending operation per HP-IB.
  */
-fhpibppwatch(unit)
+void
+fhpibppwatch(arg)
+       void *arg;
 {
 {
-       register struct hpib_softc *hs = &hpib_softc[unit];
+       register int unit;
+       register struct hpib_softc *hs;
        register struct fhpibdevice *hd;
        register int slave;
 
        register struct fhpibdevice *hd;
        register int slave;
 
+       unit = (int)arg;
+       hs = &hpib_softc[unit];
        if ((hs->sc_flags & HPIBF_PPOLL) == 0)
                return;
        hd = (struct fhpibdevice *)hs->sc_hc->hp_addr;
        if ((hs->sc_flags & HPIBF_PPOLL) == 0)
                return;
        hd = (struct fhpibdevice *)hs->sc_hc->hp_addr;
@@ -473,7 +513,7 @@ fhpibppwatch(unit)
                        hd->hpib_stat = ST_IENAB;
                        hd->hpib_imask = IM_IDLE | IM_ROOM;
                } else
                        hd->hpib_stat = ST_IENAB;
                        hd->hpib_imask = IM_IDLE | IM_ROOM;
                } else
-                       timeout(fhpibppwatch, unit, 1);
+                       timeout(fhpibppwatch, (void *)unit, 1);
                return;
        }
        if ((fhpibdebug & FDB_PPOLL) && unit == fhpibdebugunit)
                return;
        }
        if ((fhpibdebug & FDB_PPOLL) && unit == fhpibdebugunit)