;;; -*- Mode:Lisp; Readtable:ZL; Package:USER; Base:8; Patch-File:T -*- ;;; Patch file for System version 121.9 ;;; Reason: ;;; fix to chaos:reset for explorer. ;;; Written 21-Jan-87 12:52:15 by rg (Richard Greenblatt) at site LMI Cambridge ;;; while running on Guinea Pig from band 2 ;;; with Experimental System 121.3, Experimental Lambda-Diag 15.0, Experimental ZMail 70.0, Experimental KERMIT 32.0, Experimental Unix-Interface 10.0, Experimental Local-File 72.0, Experimental FILE-Server 21.0, Experimental Tape 13.0, microcode 1730, SDU Boot Tape 3.12, SDU ROM 102. ; From file DJ: L.NETWORK.CHAOS; CHSNCP.LISP#371 at 21-Jan-87 12:52:16 #8R CHAOS#: (COMPILER-LET ((*PACKAGE* (PKG-FIND-PACKAGE "CHAOS"))) (COMPILER::PATCH-SOURCE-FILE "SYS: NETWORK; CHAOS; CHSNCP  " (DEFUN RESET (&OPTIONAL ENABLE-P &key (microcode t)) "Turn off and reinitialize the chaosnet software. This may unwedge it if it is not working properly. This will cause all of your currently open connections to lose. You must call CHAOS:ENABLE to turn the chaosnet ncp on again before you can use the chaosnet; but many user-level functions that use the net will do that for you. Calling this function with ENABLE-P of T will have the same effect." (setq *use-ucode-on-lambda-if-possible* microcode) (DISABLE) (WITHOUT-INTERRUPTS (select-processor (:cadr (fset 'transmit-int-pkt 'cadr-transmit-int-pkt)) (:lambda (cond ((and *use-ucode-on-lambda-if-possible*) (fset 'transmit-int-pkt 'lambda-transmit-int-pkt) (disable-lambda-ucode) (ethernet:lambda-3com-reset) ) (t (fset 'transmit-int-pkt 'old-lambda-transmit-int-pkt) (disable-lambda-ucode) (ethernet:lambda-3com-reset)) )) (:explorer (fset 'transmit-int-pkt 'lambda-transmit-int-pkt) (si:nubus-ethernet-reset) ) ) (SETQ BACKGROUND-REQUESTS NIL) ;Get rid of requests for connections flushing (SETQ RETRANSMISSION-NEEDED T) (DO ((CL CONN-LIST (CDR CL))) ((NULL CL)) (FREE-ALL-READ-PKTS (CAR CL)) (FREE-ALL-RECEIVED-PKTS (CAR CL)) (FREE-ALL-SEND-PKTS (CAR CL)) (SETF (STATE (CAR CL)) 'INACTIVE-STATE)) (setq last-unknown-int-pkt nil) ;this should be looked at!! (DO ((I 1 (1+ I))) ((= I MAXIMUM-INDEX)) (ASET NIL INDEX-CONN I)) (SETQ DISTINGUISHED-PORT-CONN-TABLE NIL) (SETQ CONN-LIST NIL) (OR (AND (FIXP INDEX-CONN-FREE-POINTER) (> MAXIMUM-INDEX INDEX-CONN-FREE-POINTER -1)) (SETQ INDEX-CONN-FREE-POINTER 1)) ;; The initialization is needed because if the LISP Machine has an open connection, ;; it gets reloaded, and the connection is established on the same index before the ;; other end has gone into INCXMT state, then the RFC will look like a duplicate. ;; Though this may sound like a rare event, it is exactly what happens with the ;; file job connection!! (DO ((INDEX 0 (1+ INDEX))) ((>= INDEX MAXIMUM-INDEX)) (ASET (+ (TIME) INDEX) UNIQUIZER-TABLE INDEX)) ;; Should actually try and free up these (SETQ PENDING-LISTENS NIL) (SETQ PENDING-RFC-PKTS NIL) (SETQ FAKE-RECEIVE-LIST NIL) (SETQ *BRD-PKTS-IN* 0 *BRD-PKTS-OUT* 0 *BRD-HISTORY* NIL *BRD-REPLIES-IN* 0 *RECEIVE-BROADCAST-PACKETS-P* NIL) ;; This is a pretty arbitrary number, but it used to be MAXIMUM-INDEX which ;; grew like mad causing an absurd number of pages to get wired. This is undoubtedly ;; enough for average use. (loop for i from 0 below (array-length ethernet:free-addr-pkts) do (setf (aref ethernet:free-addr-pkts i) nil)) (CREATE-CHAOSNET-BUFFERS 40.) ) (IF ENABLE-P (PROGN (ENABLE) "Reset and enabled") "Reset and disabled")) (defun explorer-hack-wait-function () (or (si:NEC-Pkt-Available) ;(si:mini-pkt-available) fake-receive-list)) (defun transmit-int-pkt-on-ethernet (int-pkt dest-ether-adr ether-type &optional nwords) (declare (special si::my-ethernet-address)) (select-processor (:lambda (lambda-transmit-int-pkt-via-ucode int-pkt dest-ether-adr ether-type)) (:explorer (si:nubus-transmit-ethernet-16b-array si:my-ethernet-address dest-ether-adr int-pkt (max (or nwords (pkt-nwords int-pkt)) 64.) ether-type) (free-int-pkt int-pkt)) (:cadr))) ))