.TITLE PPPD$ASN_JACKETS - jackets for routines called through a vector .IDENT 'X-4' ;* ;***************************************************************************** ;* ;* Copyright © 1996 Digital Equipment Corporation. ;* All rights reserved. ;* ;* Redistribution and use in source and binary forms are permitted ;* provided that the above copyright notice and this paragraph are ;* duplicated in all such forms and that any documentation, ;* advertising materials, and other materials related to such ;* distribution and use acknowledge that the software was developed ;* by Digital Equipment Corporation. The name of the ;* Corporation may not be used to endorse or promote products derived ;* from this software without specific prior written permission. ;* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR ;* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED ;* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. ;* ;***************************************************************************** ;++ ; FACILITY: ; ; ALPHA/OpenVMS Terminal Driver ; ; ; ABSTRACT: ; ; Setup up the class vector, the C language definiton of the vector is ; all messed up. So we will use the MACRO ones that are correct. Also build ; jackets for the port driver routines that need a JSR entry. The DECC folks ; failed to provide a way to define a jsr linkage to a vector of routine ; addresses what utter crap. ; ; AUTHOR: ; ; Forrest A. Kenney 20-December-1995 ; ; REVISION HISTORY: ; ; X-4 BWK002 Barry W. Kierstein 17-DEC-1996 ; Replaced the standard Digital copyright with ; one compatible with the CMU copyright. ; ; X-3 BWK001 Barry W. Kierstein 24-JUL-1996 ; Corrected copyright notice. ; ; X-2 FAK001 Forrest A. Kenney 23-April-1996 ; Add tty$class_disconnect, and tty$class_setupucb. These are ; needed to call directly into the terminal class driver. The ; routine class$setupucb, and class$disconnect call ASN driver ; emulation routines. ; ;-- ; .SBTTL Declarations ;******************************************************************* ; External definitions ;******************************************************************* $SSDEF ; DEFINE STATUS CODES $TTYDEF ; DEFINE TERMINAL DRIVER SYMBOLS $TTDEF ; DEFINE TERMINAL TYPES $TT2DEF ; DEFINE EXTENDED DEFINITIONS $UCBDEF ; DEFINE UCB $TTYUCBDEF ; DEFINE TTYUCB OFFSETS $VECDEF ; DEFINE VECTOR FOR CRB $TTYMACS ; DEFINE TERMINAL DRIVER MACROS $TTYDEFS ; DEFINE TERMINAL DRIVER SYMBOLS $TTYMODEM ; DEFINE MODEM DEFINITIONS $VCIBDEF ; VCI INTERFACE BLOCK DEFINITIONS ;******************************************************************* ; ; The assumption below is needed to make sure that an assumption ; in PPPD$ASNMISCDEF.SDL stays valid. If this assumption breaks then ; the location of UCB$L_TT_LOGUCB needs to be corrected to be in the ; correct location. ; ;******************************************************************* ASSUME UCB$L_TT_LOGUCB EQ UCB$l_TL_A_FI_UCB+20 .SBTTL Class Vector ;******************************************************************* ; Setup vector ;******************************************************************* .external class$getnext .external class$putnext .external class$setupucb .external class$data_set_trans .external driver$ddt .external class$read_error .external class$disconnect .external class$fork .external class$powerfail DRIVER_DATA $$$105_PROLOGUE ;+ ; Define the class vector ;- CLASS_VECTOR:: .ADDRESS class$getnext .ADDRESS class$putnext .ADDRESS class$setupucb .ADDRESS class$data_set_trans .ADDRESS driver$ddt .ADDRESS class$read_error .ADDRESS class$disconnect .ADDRESS class$fork .ADDRESS class$powerfail .LONG 0 ; Terminate the vector .LONG 0 ; .SBTTL Driver Code ;******************************************************************* ; Driver Code ;******************************************************************* DRIVER_CODE ;; ;;++ ;; port$startio - Start output on the line ;; ;; Functional description: ;; ;; This routine is called to start up output on a line that is currently ;; inactive. It will always be called with either a character or a burst of ;; data. The startio routine is not called unless the line is IDLE ;; (UCB$V_INT is clear in UCB$L_STS). The INT bit is used as an interlock to ;; signify that the port output logic is busy. INT is always set by the class ;; driver when PORT_STARTIO is called. If the port requests timers to be set ;; up (NOTIME clear in UCB$W_TT_PRTCTL word) then an output timer is computed ;; for the burst or character and the UCB$V_TIM bit is set. ;; ;; Calling convention: ;; ;; Input parameters: ;; ;; R3 Character to output ;; R5 UCB address ;; ;; Preserve: ;; ;; R1,R2,R4,R5 ;; ;; Scratch: ;; ;; R0 ;; ;; Implicit References: ;; ;; ;; UCB$L_STS Bits UCB$V_TIM, UCB$V_INT ;; UCB$W_TT_HOLD Holding cell for single character output type flags ;; UCB$B_TT_OUTPYE Type of output ;; UCB$W_TT_OUTLEN Number of characters output ;; UCB$L_TT_OUTADR Address of output buff if multiple characters ;; ;; Synchronization ;; ;; Called at device IPL holding the device spinlock. Exit at calling IPL ;; with locks still held ;; ;;-- ;; port$startio:: .JSB_ENTRY INPUT=, - PRESERVE=, - SCRATCH= MOVL UCB$L_TT_PORT(R5),R0 JSB @PORT_STARTIO(R0) RSB ;; ;;++ ;; port$disconnect - Called to notify port of last channel deassing ;; ;; Functional description: ;; ;; This routine notifies the port driver of last deassign on the UCB. A ;; call to this routine means that there are no longer channels associated with ;; the device. If the delete bit is set in the UCB$L_DEVSTS field in the UCB ;; then the UCB will be deleted by the system. Note: As long as the device name ;; is known to the system, broadcasts and assign channel requests may occur on ;; this device. (Broadcasts, however, will not occur if the DEV$V_NET bit is ;; set.) ;; ;; Input parameters: ;; ;; R0 If LBS then device was set to hang-up ;; R5 UCB address ;; ;; Preserve: ;; ;; R0 ;; ;; Scratch: ;; ;; R1 ;; ;; Implicit References: ;; ;; None ;; ;; Synchronization: ;; ;; Called at device IPL holding the device spinlock. Exit at calling IPL ;; with locks still held ;; ;;-- ;; port$disconnect:: .JSB_ENTRY INPUT=, - PRESERVE=, - SCRATCH= MOVL UCB$L_TT_PORT(R5),R1 JSB @PORT_DISCONNECT(R1) RSB ;; ;;++ ;; port$set_line - Set line characteristics ;; ;; Functional description: ;; ;; The set line routine changes the terminal line parameters. It is ;; called whenever any terminal characteristic in UCB$L_DEVDEPEND or ;; UCB$L_DEVDEPND2 is changed or when speed, parity, and the enabling or ;; disabling of DMA and automatic flow control are affected. ;; ;; This is the only port routine that is allowed to write the fields ;;UCB$L_DEVDEPEND and DEVDEPND2. ;; ;; Input parameters: ;; ;; R5 UCB address ;; ;; Preserve: ;; ;; R1,R2,R3,R5 ;; ;; Scratch: ;; ;; R0 ;; ;; Implicit References: ;; ;; UCB$B_TT_MAINT Maintenance parameters ;; UCB$B_TT_PARITY Parity, stop bits and frame size ;; UCB$W_TT_SPEED Low byte transmit speed High byte receive speed or 0 ;; UCB$W_TT_PRTCTL DMA and AUTOXOFF enable flags ;; UCB$L_DEVDEPEND First device dependent long word ;; UCB$L_DEVDEPND2 Second device dependent long word ;; ;; Synchronization: ;; ;; Called at device IPL holding the device spinlock. Exit at calling IPL ;; with locks still held ;; ;;-- ;; port$set_line:: .JSB_ENTRY INPUT=, - PRESERVE=, - SCRATCH= MOVL UCB$L_TT_PORT(R5),R0 JSB @PORT_SET_LINE(R0) RSB ;; ;;++ ;; port$ds_set - Set modem signals ;; ;; Functional description: ;; ;; The data set routine outputs modem signals to the specified ;; unit. Modem masks are defined in $TTDEF. ;; ;; Input parameters: ;; ;; R2 Low byte signals to activate. High byte signals to clear ;; TT$M_DS_CARRIER Carrier signal detected ;; TT$M_DS_CTS Clear to send ;; TT$M_DS_DSR Data set ready ;; TT$M_DS_DTR Data terminal ready ;; TT$M_DS_RING Ring indicator ;; TT$M_DS_RTS Request to send ;; TT$M_DS_SECREC Secondary receive ;; TT$M_DS_SECTX Secondary transmit ;; R5 UCB address ;; ;; Preserve: ;; ;; R4,R5 ;; ;; Scratch: ;; ;; R0,R1,R2,R3 ;; ;; Implicit References: ;; ;; UCB$B_TT_DS_TX Mask of modem bits currently set ;; ;; Synchronization: ;; ;; Called at device IPL holding the device spinlock. Exit at calling IPL ;; with locks still held ;; ;;-- ;; port$ds_set:: .JSB_ENTRY INPUT=, - PRESERVE=, - SCRATCH= MOVL UCB$L_TT_PORT(R5),R0 JSB @PORT_DS_SET(R0) RSB ;; ;;++ ;; port$xon - Tell port to send XON ;; ;; Functional description: ;; ;; The XON routine is called when the terminal driver has cleared ;; up its input path and is now ready to accept data. For character oriented ;; controllers the port should insert the flow control character in the output ;; data stream. ;; ;; Input parameters: ;; ;; R3 Flow control character to be inserted in the output stream ;; R5 UCB address ;; ;; Preserve: ;; ;; R4,R5 ;; ;; Scratch: ;; ;; R0,R1,R2,R3 ;; ;; Implicit References: ;; ;; UCB$L_STS UCB$V_INT and UCB$V_TIM may be referenced ;; ;; Synchronization: ;; ;; Called at device IPL holding the device spinlock. Exit at calling IPL ;; with locks still held ;; ;;-- ;; port$xon:: .JSB_ENTRY INPUT=, - PRESERVE=, - SCRATCH= MOVL UCB$L_TT_PORT(R5),R0 JSB @PORT_XON(R0) RSB ;; ;;++ ;; port$xoff - Tell other end to stop sending data ;; ;; Functional description: ;; ;; A call to XOFF signifies that the class driver is approaching ;; or has reached its input limit. The port should take steps to stop the ;; input data stream. For character oriented controllers the port is commanded ;; to insert the flow control character in the output data stream as soon as ;;possible. ;; ;; Input parameters: ;; ;; R3 Flow control character to be inserted in the output stream ;; R5 UCB address ;; ;; Preserve: ;; ;; R4,R5 ;; ;; Scratch: ;; ;; R0,R1,R2,R3 ;; ;; Implicit References: ;; ;; UCB$L_STS UCB$V_INT and UCB$V_TIM may be referenced ;; ;; Synchronization: ;; ;; Called at device IPL holding the device spinlock. Exit at calling IPL ;; with locks still held ;; ;;-- ;; port$xoff:: .JSB_ENTRY INPUT=, - PRESERVE=, - SCRATCH= MOVL UCB$L_TT_PORT(R5),R0 JSB @PORT_XOFF(R0) RSB ;; ;;++ ;; port$stop - Tell port driver to stop sending data ;; ;; Functional description: ;; ;; This routine is called when the terminal class driver wishes ;; to halt the output data stream. The data stream should be stopped as soon ;; as possible. STOP is normally called in response to output flow control. ;; ;; Input parameters: ;; ;; R5 UCB address ;; ;; Preserve: ;; ;; R1,R2,R3,R4,R5 ;; ;; Scratch: ;; ;; R0 ;; ;; Implicit References: ;; ;; UCB$L_STS UCB$V_INT and UCB$V_TIM may be referenced ;; ;; Synchronization: ;; ;; Called at device IPL holding the device spinlock. Exit at calling IPL ;; with locks still held ;; ;;-- ;; port$stop:: .JSB_ENTRY INPUT=, - PRESERVE=, - SCRATCH= MOVL UCB$L_TT_PORT(R5),R0 JSB @PORT_STOP(R0) RSB ;; ;;++ ;; port$abort - Tell port driver to flush current transmit ;; ;; Functional description: ;; ;; A call to this routine commands the port to abort any currently ;; active output activity. This usually means the last burst of output sent to ;; the port. This routine may be called at any time from the class driver and ;; will invalidate the contents of the data in UCB$L_TT_OUTADR. ;; ;; Input parameters: ;; ;; R5 UCB Address ;; ;; Preserve: ;; ;; R1,R2,R3,R4,R5 ;; ;; Scratch: ;; ;; R0 ;; ;; Implicit References: ;; ;; UCB$L_STS UCB$V_INT and UCB$V_TIM may be cleared ;; UCB$L_TT_OUTADR May be cleared ;; UCB$W_TT_HOLD May be cleared ;; ;; Synchronization: ;; ;; Called at device IPL holding the device spinlock. Exit at calling IPL ;; with locks still held ;; ;;-- ;; port$abort:: .JSB_ENTRY INPUT=, - PRESERVE=, - SCRATCH= MOVL UCB$L_TT_PORT(R5),R0 JSB @PORT_ABORT(R0) RSB ;; ;;++ ;; port$resume - Describe what the routine does ;; ;; Functional description: ;; ;; This routine informs the port to resume any previously stopped ;; output. The port must tolerate this routine being called at any time (even ;; if output is active or has previously been stopped). This routine should ;; always insure that the hardware is enabled for output. ;; ;; Input parameters: ;; ;; R5 UCB address ;; ;; Preserve: ;; ;; R1,R2,R3,R4,R5 ;; ;; Scratch: ;; ;; R0 ;; ;; Implicit References: ;; ;; UCB$L_STS UCB$V_INT and UCB$V_TIM may be changed ;; UCB$L_DUETIM May be changed ;; UCB$W_TT_PRTCTL Read to see if device has timers turned off ;; ;; Synchronization: ;; ;; Called at device IPL holding the device spinlock. Exit at calling IPL ;; with locks still held ;; ;;-- ;; port$resume:: .JSB_ENTRY INPUT=, - PRESERVE=, - SCRATCH= MOVL UCB$L_TT_PORT(R5),R0 JSB @PORT_RESUME(R0) RSB ;; ;;++ ;; port$set_modem - Describe what the routine does ;; ;; Functional description: ;; ;; A call to this routine informs the port that this line has been ;; enabled for modem signal input transitions. Ports implementing modem ;; functions must insure that the hardware is ready to detect changes in input ;; modem signals. This function is usually implemented by timer based polling ;; when the hardware does not provide this capability. ;; ;; Input parameters: ;; ;; R5 UCB Address ;; ;; Preserve: ;; ;; R1,R2,R3,R4,R5 ;; ;; Scratch: ;; ;; R0 ;; ;; Implicit References: ;; ;; None ;; ;; Synchronization: ;; ;; Called at device IPL holding the device spinlock. Exit at calling IPL ;; with locks still held ;; ;;-- ;; port$set_modem:: .JSB_ENTRY INPUT=, - PRESERVE=, - SCRATCH= MOVL UCB$L_TT_PORT(R5),R0 JSB @PORT_SET_MODEM(R0) RSB ;; ;;++ ;; port$forkret - Called at FORK IPL by class driver ;; ;; Functional description: ;; ;; This vector entry is provided as a return address to the port ;; driver when a fork is requested by the port. The fork returns no context ;; other than the UCB. ;; ;; Input parameters: ;; ;; R5 UCB ;; ;; Preserve: ;; ;; R1,R2,R3,R4,R5 ;; ;; Scratch: ;; ;; R0 ;; ;; Implicit References: ;; ;; Any field in the UCB the port driver needs to access. ;; ;; Synchronization: ;; ;; Called at frok IPL holding the fork lock. Exit at calling IPL ;; with locks still held ;; ;;-- ;; port$forkret:: .JSB_ENTRY INPUT=, - PRESERVE=, - SCRATCH= MOVL UCB$L_TT_PORT(R5),R0 JSB @PORT_FORKRET(R0) RSB ;; ;;++ ;; port$fdt - Call to port dirver to give it an IRP ;; ;; Functional description: ;; ;; When the QIO function code is IO$_TTY_PORT, the ASNDRIVER ;; passes control to the port$fdt routine. It is the responsibility of the ;; port to do whatever processing the class FDT routine would normally do. This ;; includes validating function modifiers, checking the P1 - P5 parameters, ;; verifying access to buffers, and terminating with a call to EXE$QIORETURN, ;; EXE$FINISHIO, or EXE$ABORTIO. ;; ;; This mechanism allows a port driver to implement function modifiers ;; that are device specific. The port driver is thus not dependent on extensions ;; to the port/class interface for new functionality. Note that if the port$fdt ;; request is not completed attempts to cancel the request will place the process ;; in RWAST state. ;; ;; If there is no PORT_FDT routine, control will pass to the port's NULL ;; routine, which will RSB to the class driver. PPPDRIVER will issue an illegal ;; I/O function error in that case. ;; ;; Input parameters: ;; ;; R3 IRP address ;; R4 PCB address ;; R5 UCB address ;; R6 CCB address ;; R7 ???? ;; ;; Preserve: ;; ;; R3,R4,R5 ;; ;; Scratch: ;; ;; R0 ;; ;; Implicit References: ;; ;; Any field in the IRP or UCB that the port driver needs. ;; ;; Synchronization: ;; ;; Called at IPL 2 this routine has to acquire any locks it needs ;; for processing. The code should exit at calling IPL. ;; ;;-- ;; port$fdt:: .JSB_ENTRY INPUT=, - PRESERVE=, - SCRATCH= MOVL UCB$L_TT_PORT(R5),R0 JSB @PORT_FDT(R0) RSB ;; ;;++ ;; port$cancel - Called to tell port driver to cancel and PROT FDT requests ;; ;; Functional description: ;; ;; The cancel routine is called when ever a $CANCEL, $DASSGN, or ;; a $DALLOC is requested on a PPP virtual unit. The routine cancels any ;; internally queued operations for the port. Most commonly, a call is issued ;; to this routine when a request to establish an outgoing connection has been ;; stalled because the port is busy. ;; ;; Input parameters: ;; ;; R2 Address of the UCB$L_TT_STATE1 quadword ;; R3 Address of IRP to cancel ;; R4 PCB address ;; R5 UCB address ;; R6 Channel number ;; R8 Reason for cancel ;; CAN$C_CANCEL Called by $CANCEL ;; CAN$C_DASSGN Called by $DASSGN or $DALLOC ;; R9 Address of LOGICAL UCB same as R5 ;; ;; Preserve: ;; ;; R1,R2,R3,R4,R5,R6,R8,R9 ;; ;; Scratch: ;; ;; R0 ;; ;; Implicit References: ;; ;; None ;; ;; Synchronization: ;; ;; Called at device IPL holding the device spinlock. Exit at calling IPL ;; with locks still held ;; ;;-- ;; port$cancel:: .JSB_ENTRY INPUT=, - PRESERVE= - SCRATCH= MOVL UCB$L_TT_PORT(R5),R0 JSB @PORT_CANCEL(R0) RSB .SBTTL Class driver routine jackets ;; ;;++ ;; tty$class_setupucb - Set UCB to known starting state ;; ;; Functional description: ;; ;; This is a simple jacket routine to do a jsb to the class drivers setup ;; UCB routine. This should not be necessary but the damn C compile won't ;; get the linkages correct. ;; ;; Calling convention: ;; ;; tty$class_setupucb(ucb) ;; ;; Input parameters: ;; ;; ucb - Address of UCB ;; ;; Output parameters: ;; ;; None ;; ;; Return value: ;; ;; None ;; ;; Environment: ;; ;; Kernel mode, system context, device IPL with device lock held. ;; ;;-- tty$class_setupucb:: .JSB_ENTRY INPUT=, - PRESERVE= MOVL UCB$L_TT_CLASS(R5),R0 ; Get class vector address JSB @CLASS_SETUP_UCB(R0) ; Call the class driver RSB ;; ;;++ ;; tty$class_disconnect - Port driver wants class driver to free up device ;; ;; Functional description: ;; ;; This is a simple jacket routine to do a jsb to the class drivers ;; disconnect This should not be necessary but the damn C compile won't ;; get the linkages correct. ;; ;; Calling convention: ;; ;; tty$class_disconnect(ucb) ;; ;; Input parameters: ;; ;; ucb - Address of UCB ;; ;; Output parameters: ;; ;; None ;; ;; Return value: ;; ;; None ;; ;; Environment: ;; ;; Kernel mode, system context, device IPL with device lock held. ;; ;;-- tty$class_disconnect:: .JSB_ENTRY INPUT=, - PRESERVE= MOVL UCB$L_TT_CLASS(R5),R0 ; Get class vector address JSB @CLASS_DISCONNECT(R0) ; Call the class driver RSB .SBTTL VCI routine jackets ;; ;;++ ;; VCIXXX_Transmit_Complete - Called to notify upper VCM transmit is done ;; ;; Functional description: ;; ;; This routine is called when a frame has been queued fro ;; transmission or the transmit has failed for some reason. The REQUEST_STATUS ;; field of the VCRP will contain the status of the transmit request. The ;; transmitted packet is returned in the data VCRP parameter of this call. ;; ;; Input parameters: ;; ;; R3 VCRP address ;; R4 VCIB address ;; ;; Preserve: ;; ;; None specifically called out ;; ;; Scratch: ;; ;; R0,R3,R4 ;; ;; Implicit References: ;; ;; Many fields in the VCRP and VCIB ;; ;; Synchronization: ;; ;; Called at fork IPL holding the forklock. Exit at calling IPL ;; with locks still held ;; ;;-- ;; VCI$XXX_Transmit_Complete:: .JSB_ENTRY INPUT=, - SCRATCH= JSB @VCIB$A_TRANSMIT_COMPLETE(R4) RSB ;; ;;++ ;; VCI$XXX_Receive_Complete - Notife upper VCM that a packet has been received ;; ;; Functional description: ;; ;; The ASN driver call the upper VMC's REceive_Complete service rotuine to ;; hand up a received frame. The user data of the packet is always embedded ;; within the VCRP. the Boff and BCNT fileds are initialized by the ASN driver ;; to point to the data embedded in the VCRP. The packet will have the flag, ;; FCS andpadding fields removed. Any quoting will also have been removed. ;; the upper VMC is responsible for deallocating the packet when it has ;; finished processing it. ;; ;; Inputs: ;; ;; R3 VCRP address ;; R4 VCIB address ;; ;; Preserve: ;; ;; None specifically called out ;; ;; Scratch: ;; ;; R0,R3,R4 ;; ;; Implicit References: ;; ;; Many fields in the VCRP and VCIB ;; ;; Synchronization: ;; ;; Called at fork IPL holding the forklock. Exit at calling IPL ;; with locks still held ;; ;;-- ;; VCI$XXX_Receive_Complete:: .JSB_ENTRY INPUT=, - SCRATCH= JSB @VCIB$A_RECEIVE_COMPLETE(R4) RSB ;; ;;++ ;; VCI$XXX_Report_Even - Notify upper VCM that a hangup has occured ;; ;; Functional description: ;; ;; The ASN driver will call this service routine when there is an ;; asynchronous event. There is only one event type supported and that is ;; notification that the line has hung up. ;; ;; Inputs: ;; ;; R4 VCIB address ;; ;; Preserve: ;; ;; None specifically called out ;; ;; Scratch: ;; ;; R0,R3,R4 ;; ;; Implicit References: ;; ;; Many fields in the VCIB ;; ;; Synchronization: ;; ;; Called at fork IPL holding the forklock. Exit at calling IPL ;; with locks still held ;; ;;-- ;; VCI$XXX_Report_Event:: .JSB_ENTRY INPUT=, - SCRATCH= JSB @VCIB$A_REPORT_EVENT(R4) RSB .end