(FILECREATED "11-Jul-88 23:16:44" {PHYLUM}<LISP>KOTO>PATCHES>QUEUE-IOCB-PATCH.;1 5160   

      changes to:  (VARS QUEUE-IOCB-PATCHCOMS) (FNS \QUEUE.INPUT.IOCB)

      previous date: "11-Jul-88 23:14:35" {PHYLUM}<LISP>LYRIC>PATCHES>QUEUE-IOCB-PATCH.;1)


(* "
Copyright (c) 1988 by Xerox Corporation.  All rights reserved.
")

(PRETTYCOMPRINT QUEUE-IOCB-PATCHCOMS)

(RPAQQ QUEUE-IOCB-PATCHCOMS ((DECLARE: EVAL@COMPILE EVAL@LOAD DONTCOPY (FILES SYSEDIT (LOADCOMP) 10MBDRIVER)) (FNS \QUEUE.OUTPUT.IOCB \QUEUE.INPUT.IOCB)))
(DECLARE: EVAL@COMPILE EVAL@LOAD DONTCOPY 

(FILESLOAD SYSEDIT (LOADCOMP) 10MBDRIVER)
)
(DEFINEQ

(\QUEUE.OUTPUT.IOCB
(LAMBDA (NDB IOCB BUFFER LENGTH) (* ; "Edited 11-Jul-88 22:55 by Burwell") (* ;; "Queue up IOCB for transmission.  LENGTH is length of BUFFER in words") (PROG ((CSB (fetch NDBCSB of NDB))) (SELECTC \MACHINETYPE (\DANDELION (replace DLFOROUTPUTUSE of IOCB with 1) (* ; "So that \10MB.GETPACKETSTATUS can tell which way packet is going") (* ;; "the DLion IOCB Length is interpreted as the offset of the last word, not the number of words.") (replace DLIOCBLENGTH of IOCB with (SUB1 LENGTH)) (replace DLNEXTIOCB of IOCB with 0) (replace DLRETRANSMISSIONMASK of IOCB with 0) (replace DLIOCBSTATUS of IOCB with \ES.PENDING) (replace DLIOCBBUFFER of IOCB with BUFFER) (COND ((NEQ (fetch DLFIRSTOCB of CSB) 0) (* ; "Hardware active, add to end of chain") (replace DLNEXTIOCB of (OR (EMPOINTER (fetch DLLASTOCB of CSB)) (RAID "Garbage Last OCB")) with (\LOLOC IOCB)))) (COND ((AND (EQ (fetch DLFIRSTOCB of CSB) 0) (EQ (fetch DLIOCBSTATUS of IOCB) \ES.PENDING)) (* ; "Separate check, as the hardware could have just gone idle since we last checked") (replace DLFIRSTOCB of CSB with (\LOLOC IOCB)) (\DEVICE.OUTPUT \DL.ENABLE.OUTPUT \DL.ETHEROUTPUTREG))) (replace DLLASTOCB of CSB with (\LOLOC IOCB))) (\DAYBREAK (\DoveEther.QueueOutput IOCB BUFFER LENGTH)) (\DOLPHIN (replace D0IOCBLENGTH of IOCB with (UNFOLD LENGTH BYTESPERWORD)) (replace D0NEXTIOCB of IOCB with 0) (replace D0RETRANSMISSIONMASK of IOCB with 0) (replace D0IOCBSTATUS of IOCB with \ES.PENDING) (replace D0IOCBBUFFER of IOCB with BUFFER) (COND ((NEQ (fetch D0FIRSTOCB of CSB) 0) (* ; "Hardware active, add to end of chain") (replace D0NEXTIOCB of (OR (EMPOINTER (fetch D0LASTOCB of CSB)) (RAID "Garbage Last OCB")) with (\LOLOC IOCB)))) (COND ((AND (EQ (fetch D0FIRSTOCB of CSB) 0) (EQ (fetch D0IOCBSTATUS of IOCB) \ES.PENDING)) (* ; "Separate check, as the hardware could have just gone idle since we last checked") (replace D0FIRSTOCB of CSB with (\LOLOC IOCB)) (\DEVICE.OUTPUT \D0.ENABLE.10MBOUTPUT (\D0.CONTROLLERBITS NDB \D0.OUTPUTSTATE)))) (replace D0LASTOCB of CSB with (\LOLOC IOCB))) (\NOMACHINETYPE))))
)

(\QUEUE.INPUT.IOCB
(LAMBDA (NDB IOCB BUFFER LENGTH) (* ; "Edited 11-Jul-88 23:09 by Burwell") (* ;; "Add IOCB to the end of the microcode input queue, with BUFFER of LENGTH words as its buffer.  I.e., this is a buffer that packets will be read into") (PROG ((CSB (fetch NDBCSB of NDB))) (SELECTC \MACHINETYPE (\DANDELION (replace DLFOROUTPUTUSE of IOCB with 0) (* ; "So that \10MB.GETPACKETSTATUS can tell which way packet is going") (replace DLNEXTIOCB of IOCB with 0) (replace DLRETRANSMISSIONMASK of IOCB with 0) (replace DLIOCBSTATUS of IOCB with \ES.PENDING) (* ;; "DLion ucode interprets the length field as the offset of the last word not the number of words") (replace DLIOCBLENGTH of IOCB with (SUB1 LENGTH)) (replace DLIOCBBUFFER of IOCB with BUFFER) (COND ((NEQ (fetch DLFIRSTICB of CSB) 0) (* ; "There are some packets there, so add this to end") (replace DLNEXTIOCB of (OR (EMPOINTER (fetch DLLASTICB of CSB)) (RAID "Garbage last ICB")) with (\LOLOC IOCB)))) (COND ((AND (EQ (fetch DLFIRSTICB of CSB) 0) (EQ (fetch DLIOCBSTATUS of IOCB) \ES.PENDING)) (* ;; "No buffers left, so queue this as the only one.  While we were in the last clause, microcode could have eaten up its last buffer, which is why we test twice") (replace DLFIRSTICB of CSB with (\LOLOC IOCB)) (\DEVICE.OUTPUT \DL.ENABLE.INPUT \DL.ETHERINPUTREG))) (replace DLLASTICB of CSB with (\LOLOC IOCB))) (\DAYBREAK (\DoveEther.QueueInput IOCB BUFFER LENGTH)) (\DOLPHIN (replace D0NEXTIOCB of IOCB with 0) (replace D0RETRANSMISSIONMASK of IOCB with 0) (replace D0IOCBSTATUS of IOCB with \ES.PENDING) (replace D0IOCBLENGTH of IOCB with (UNFOLD LENGTH BYTESPERWORD)) (replace D0IOCBBUFFER of IOCB with BUFFER) (COND ((NEQ (fetch D0FIRSTICB of CSB) 0) (* ; "There are some packets there, so add this to end") (replace D0NEXTIOCB of (OR (EMPOINTER (fetch D0LASTICB of CSB)) (RAID "Garbage last ICB")) with (\LOLOC IOCB)))) (COND ((AND (EQ (fetch D0FIRSTICB of CSB) 0) (EQ (fetch D0IOCBSTATUS of IOCB) \ES.PENDING)) (* ;; "No buffers left, so queue this as the only one.  While we were in the last clause, microcode could have eaten up its last buffer, which is why we test twice") (replace D0FIRSTICB of CSB with (\LOLOC IOCB)) (\DEVICE.OUTPUT \D0.ENABLE.10MBINPUT (\D0.CONTROLLERBITS NDB \D0.INPUTSTATE)))) (replace D0LASTICB of CSB with (\LOLOC IOCB))) (\NOMACHINETYPE))))
)
)
(PUTPROPS QUEUE-IOCB-PATCH COPYRIGHT ("Xerox Corporation" 1988))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (615 5073 (\QUEUE.OUTPUT.IOCB 625 . 2720) (\QUEUE.INPUT.IOCB 2722 . 5071)))))
STOP