BSD 4_3_Net_2 release
[unix-history] / usr / src / sys / vax / uba / np.c
index e9233ee..3ed1211 100644 (file)
@@ -1,10 +1,40 @@
-/*
+/*-
  * Copyright (c) 1986 MICOM-Interlan, Inc., Boxborough Mass
  * Copyright (c) 1986 MICOM-Interlan, Inc., Boxborough Mass
- * All rights reserved.  The Berkeley software License Agreement
- * specifies the terms and conditions for redistribution.
+ * Copyright (c) 1991 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * 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.
  *
  *
- *     @(#)np.c        7.6 (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.
  *
  *
+ *     @(#)np.c        7.10 (Berkeley) 5/9/91
+ */
+
+/*
  * From:
  *     np.c version 1.5
  *
  * From:
  *     np.c version 1.5
  *
 
 #include "np.h"
 #if NNP > 0
 
 #include "np.h"
 #if NNP > 0
-#include "param.h"
-#include "buf.h"
-#include "ubavar.h"
-#include "signal.h"
-#include "systm.h"
-#include "user.h"
-#include "proc.h"
-#include "uio.h"
-#include "errno.h"
-
-#include "../vaxuba/npreg.h"
+#include "sys/param.h"
+#include "sys/buf.h"
+#include "sys/conf.h"
+#include "sys/ubavar.h"
+#include "sys/signal.h"
+#include "sys/systm.h"
+#include "sys/user.h"
+#include "sys/proc.h"
+#include "sys/uio.h"
+#include "sys/errno.h"
+#include "sys/ioctl.h"
+
+#include "../uba/npreg.h"
 
 #define b_uio b_forw
 #define b_rp  av_back
 
 #define b_uio b_forw
 #define b_rp  av_back
@@ -971,21 +1003,6 @@ int unit;
                }
 
 
                }
 
 
-#ifdef mc500
-       if(setjmp(u.u_tsav) == 0) {
-               u.u_nofault = TRUE;
-               status = RCSR1(mp->iobase);
-               u.u_nofault = FALSE;
-       }
-       else {
-               np__addr[unit] = 0;
-               mp->flags |= BADBOARD;
-               u.u_error = ENXIO;
-               printf("\nNP100 Unit %x not here!\n",unit);
-               return(0);
-       }
-#endif
-
        if(NpDebug & DEBENTRY)
                printf("Resetting the NP100 Board at %x\n",mp->iobase);
 
        if(NpDebug & DEBENTRY)
                printf("Resetting the NP100 Board at %x\n",mp->iobase);
 
@@ -1022,7 +1039,6 @@ int unit;
 
        if(!(RCSR1(mp->iobase) & NPHOK)) {
                mp->flags |= BADBOARD;
 
        if(!(RCSR1(mp->iobase) & NPHOK)) {
                mp->flags |= BADBOARD;
-               u.u_error = EIO;
                printf("NP100 Unit %d Failed diagnostics!\n",unit);
                printf("Status from CSR0: %x.\n",status);
                return(EIO);
                printf("NP100 Unit %d Failed diagnostics!\n",unit);
                printf("Status from CSR0: %x.\n",status);
                return(EIO);
@@ -1100,11 +1116,9 @@ int unit;
 
        if(!(mp->flags & AVAILABLE)) {
 
 
        if(!(mp->flags & AVAILABLE)) {
 
-               if((mp->shmemp->statblock.sb_dpm) && (!(mp->flags & BRDRESET))){
+               if((mp->shmemp->statblock.sb_dpm) && (!(mp->flags & BRDRESET)))
 
                        mp->flags = AVAILABLE;
 
                        mp->flags = AVAILABLE;
-                       printf("\nNP100 unit #%d available!\n",mp->unit);
-               }
        }
 
        /* Honor service requests from the device */
        }
 
        /* Honor service requests from the device */
@@ -1427,7 +1441,6 @@ struct npmaster *mp;
        if(*temp) {                     /* Should never happen */
 
                printf("No more room on Command Queue!\n");
        if(*temp) {                     /* Should never happen */
 
                printf("No more room on Command Queue!\n");
-               u.u_error = EIO;
                return;
        }
        else *temp = cqe_offset;        /* Enter this request's offset */
                return;
        }
        else *temp = cqe_offset;        /* Enter this request's offset */