[comp.sys.ibm.pc.rt] Fix for 6152 token-ring DOS Lan Support

mlewis@dolphin.tcspa.ibm.com (Mark S. Lewis) (11/16/89)

Subject: Fix for 6152 token-ring DOS Lan Support (part 1) IBM/4.3
Index: sys/ca_atr/if_lan.c IBM/4.3

Description:	
         After using the DOS Lan facilities, the token-ring adapter
         is not closed.  When Unix boots, it gets interrupts prior
         to completing the token-ring probe, attach, and open
         sequence.  This results in Unix hanging during boot, which
         persists until the power is cycled.

         After suspending Unix and using the DOS Lan, the token-ring
         adapter is not reset properly during restart.  This results
         in a failure of the open routine and leaves the network
         unreachable.  This persists until Unix is rebooted.
 
         part 1   patch to the file /sys/ca_atr/if_lan.c
         part 2   uuencoded DOS executable shutlan.exe
         part 3   shar file containing read.me, and shutlan sources

Fix:	
         This patch fixes the restart problem.

         Apply patch V1.18, if you have not already done so.  Then
         apply the following patch to the Unix token-ring driver.
 
         Proceed to the next part of the kit.

*** if_lan.c	Tue Nov 14 16:18:22 1989
--- if_lan.c.fix	Wed Nov 15 09:45:28 1989
***************
*** 318,323 ****
--- 318,327 ----
  	register struct tr_softc *trs = &tr_softc[unit];
  	register struct ifnet *ifp = &trs->trs_if;
  
+ 	/* get pointer to device I/O space */
+ 	register struct trdevice *addr = (struct trdevice *)((unsigned int)iod->
+ 					 iod_addr & 0xffffff);
+ 
  	if (how == SUSPEND_START) {
  		trs->trs_flags = ifp->if_flags;	/* save flag state */
  		if (ifp->if_flags & IFF_RUNNING)
***************
*** 331,336 ****
--- 335,341 ----
  		if (trs->trs_flags & IFF_RUNNING) {
  			MM_OUT(&trs->aca->set.isrp_h, INT_ENABLE); /*allow pc ints. */
  			ifp->if_flags &= ~IFF_RUNNING;	/* pretend not running */
+ 			trprobe(addr);	/* hard reset */
  			trinit(unit);
  		restore_window(old_window);
  		}


=====-----     Mark S. Lewis, IBM AWD Palo Alto    -----======
inet: mlewis%ibmsupt@uunet.uu.net		(415) 855-4486
uucp: uunet!ibmsupt!mlewis              IBM Tie Line: 465-4486

mlewis@dolphin.tcspa.ibm.com (Mark S. Lewis) (11/16/89)

Subject: Fix for 6152 token-ring DOS Lan Support (part 2) IBM/4.3
Index: shutlan.exe (DOS executable)

Description:	
         After using the DOS Lan facilities, the token-ring adapter
         is not closed.  When Unix boots, it gets interrupts prior
         to completing the token-ring probe, attach, and open
         sequence.  This results in Unix hanging during boot, which
         persists until the power is cycled.

         After suspending Unix and using the DOS Lan, the token-ring
         adapter is not reset properly during restart.  This results
         in a failure of the open routine and leaves the network
         unreachable.  This persists until Unix is rebooted.
 
         part 1   patch to the file /sys/ca_atr/if_lan.c
         part 2   uuencoded DOS executable shutlan.exe
         part 3   shar file containing read.me, and shutlan sources

Fix:	
         shutlan.exe closes the token-ring adapter from DOS.

         Apply the prior (part 1) patch to the Unix token-ring driver.
 
         uudecode and install in the DOS serch patch, the included
         uuencoded DOS executable.  If you have opened the DOS Lan
         during the DOS session, you must run shutlan.exe to close it
         before starting or restarting Unix.

         Proceed to the next part of the kit.

begin 755 shutlan.exe
M35J)`0X`!@`@`,,`___;`0`(%W?L````'@````$`,@```,8```!6`&0!]P``
M`.H`9`$"`P``````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````58OLN`8`Z%D%5L=&
M_@``_W;^N$L`4.B'!8/$!/]V_IK`````@\0"B4;\"\!T"U"X;0!0Z&H%@\0$
MBU[^T>.+MX@`*\!0C40!4.@\`8/$!+@R`%#H*`"#Q`(KP%"-1`)0Z"4!@\0$
MN'X`4.@S!8/$`O]&_H-^_@)\EEZ+Y5W#58OLN`0`Z-L$QT;\(`/K$\=&_@``
MZP20_T;^BT;\.4;^?/6+1@3_3@0+P'7CB^5=PY!5B^Q75KA>`8[`BT8&)J(.
M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T">LT"\!T&EF+U^O%48O/
M*\K-(9P#\)US!+0)ZQH+P'46]H<.`4!T"XM>!H`_&G4#^.L$^;@`'%ER`HO&
M7E_I1P"+3@@+R74%B\'I.P"+5@:T0,TA<P2T">OD"\!UX/:'#@%`=`J+VH`_
M&G4#^.O/^;@`'.O)<A,SP(OE7<-S^%#H&`!8B^5=PW,'Z`X`N/__F8OE7<,R
MY.@!`,.B"@$*Y'4C@#X'`0-R#3PB<PT\('(%L`7K!Y`\$W8"L!.[C`+7F*/_
M`,.*Q.OW``3_``````````````````````````````!-4R!2=6XM5&EM92!,
M:6)R87)Y("T@0V]P>7)I9VAT("AC*2`Q.3@W+"!-:6-R;W-O9G0@0V]R<!X`
M)$AE861E<B0`0VQO<VEN9R!T;VME;B!R:6YG(&%D87!T97(@)60@+BXN`"!#
M0T(Q(&5R<F]R/3!X)7@`(&1O;F4N"@!"`"`*)`H```````!X`@``8`$`````
M````````````````````````````````````````````````````````````
M````````````````````````````````````E``[0U]&24Q%7TE.1D\`````
M`````````````````````````````!0`@8&!`0$`````````````````````
M```````L`6`!0P````````"P""AN=6QL*0`H;G5L;"D`*RT@(P``J@6J!:H%
MJ@6J!0`````````````````````````````````@``"P!0``L`4!````````
M``(!````````!@(```````"$`P````````($````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M`````````````````0```@``````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````"`(-
M"@`6`@(8#0D,#`P'"!86_Q(-$@+_``````````````````"Y$3P\3DU31SX^
M``!2-C`P,`T*+2!S=&%C:R!O=F5R9FQO=PT*``,`4C8P,#,-"BT@:6YT96=E
M<B!D:79I9&4@8GD@,`T*``D`4C8P,#D-"BT@;F]T(&5N;W5G:"!S<&%C92!F
M;W(@96YV:7)O;FUE;G0-"@#\``T*`/\`<G5N+71I;64@97)R;W(@``$`4C8P
M,#$-"BT@;G5L;"!P;VEN=&5R(&%S<VEG;FUE;G0-"@`"`%(V,#`R#0HM(&9L
=;V%T:6YG('!O:6YT(&YO="!L;V%D960-"@#___\-
`
end


=====-----     Mark S. Lewis, IBM AWD Palo Alto    -----======
inet: mlewis%ibmsupt@uunet.uu.net		(415) 855-4486
uucp: uunet!ibmsupt!mlewis              IBM Tie Line: 465-4486

mlewis@dolphin.tcspa.ibm.com (Mark S. Lewis) (11/16/89)

Subject: Fix for 6152 token-ring DOS Lan Support (part 3) IBM/4.3
Index: read.me, makefile, shutlan.c, tokclose.asm (DOS source files)

Description:	
         After using the DOS Lan facilities, the token-ring adapter
         is not closed.  When Unix boots, it gets interrupts prior
         to completing the token-ring probe, attach, and open
         sequence.  This results in Unix hanging during boot, which
         persists until the power is cycled.

         After suspending Unix and using the DOS Lan, the token-ring
         adapter is not reset properly during restart.  This results
         in a failure of the open routine and leaves the network
         unreachable.  This persists until Unix is rebooted.
 
         part 1   patch to the file /sys/ca_atr/if_lan.c
         part 2   uuencoded DOS executable shutlan.exe
         part 3   shar file containing read.me, and shutlan sources

Fix:	
         Unpack the following shar file.  Make shutlan.exe and
         install it as described in part 2 of this kit.

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
#
#	read.me
#	makefile
#	shutlan.c
#	tokclose.asm
#
echo x - read.me
sed 's/^X//' >read.me << 'END-of-read.me'
X
X---------------------------------------------------------
X       Make/Installation Instructions - Shutlan.exe
X                     November 14, 1989
X---------------------------------------------------------
X
X
XIncluded are the files to make the DOS executable program
Xshutlan.exe.  These are:
X
X   read.me       This file
X   makefile      DOS makefile
X   shutlan.c     Main C routine
X   tokclose.asm  Assembly routine to close adapter
X
XThe tools used to produce shutlan.exe are:
X
X   IBM C/2 version 1.0
X   IBM Macro Assembler/2 version 1.0
X
XWith the make utility included in C/2 1.0, you may build
Xshutlan.exe with the following command:
X
X   make makefile
X
XInstall shutlan.exe somewhere in your DOS search path.
X
XIt is suggested that you modify all batch files that start
Xor restart Unix.  In each case, you should execute shutlan
Xbefore Unix.  In other words, add the line shutlan before
Xthe Unix line in all such batch files.
X
XNote:  If you are not using the DOS Lan Support, you do
X       not need to use shutlan.
X
END-of-read.me
echo x - makefile
sed 's/^X//' >makefile << 'END-of-makefile'
X#
X# (C) COPYRIGHT IBM CORPORATION 1989
X# LICENSED MATERIALS - PROPERTY OF IBM
X# REFER TO COPYRIGHT INSTRUCTIONS FROM NUMBER G120-2083
X#
X# if using codeview uncomment the following:
X#CCOPTS=/Zi/Od
X#LKOPTS=/CO
X
Xshutlan.obj: shutlan.c
X	cc shutlan/AS$(CCOPTS);
X
Xtokclose.obj: tokclose.asm
X	masm tokclose;
X
Xshutlan.exe: shutlan.obj tokclose.obj
X	link shutlan$(LKOPTS)+tokclose$(LKOPTS),shutlan,,slibc3;
END-of-makefile
echo x - shutlan.c
sed 's/^X//' >shutlan.c << 'END-of-shutlan.c'
X/*
X *  (C) COPYRIGHT IBM CORPORATION 1989
X *  LICENSED MATERIALS - PROPERTY OF IBM
X *  REFER TO COPYRIGHT INSTRUCTIONS FORM NUMBER G120-2083
X *
X *  shutlan - shut down token ring adapters for call to Unix
X *  Note:  shuts both adapters located at the normal places.
X */
X
X/* $Header: shutlan.c,v 1.2 89/11/14 15:52:08 mlewis Exp $ */
Xstatic char *rcsid = "$Header: shutlan.c,v 1.2 89/11/14 15:52:08 mlewis
Exp $";
X
X#include <stdio.h>
X
Xextern far tokclose();
X
Xchar *trstd[] = { (char *) 0x00000a20, (char *) 0x00000a24, 0};
X 
Xstruct trdevice {
X	unsigned char   switch_read;	/* ROM/MMIO domain switches */
X	unsigned char   reset;	/* write causes adapter reset */
X	unsigned char   release_reset;	/* write releases adapter reset */
X	unsigned char   clear_interrupt;	/* write clears adapter
X						 * interrupt */
X};
X
Xmain(argc,argv)
X	int	argc;
X	char	**argv;
X{
X	register struct trdevice *addr;
X	int error, i;
X
X	for (i=0;i<2;i++)
X	{
X		printf("Closing token ring adapter %d ...",i);
X		if (error = tokclose(i))	/* Close adapter i */
X			printf (" CCB1 error=0x%x",error);
X		addr = (struct trdevice *) (0xffff & (unsigned int) trstd[i]);
X		/* Generate interrupt */
X		outp(&addr->reset, 0);	/* latch adapter reset */
X		delay(50);		/* delay 50ms */
X		/* turn off adapter reset, generate interrupt */
X		outp(&addr->release_reset, 0);
X		printf(" done.\n");
X	}
X}
X
Xdelay(n)
X	int n;
X{
X	int i;
X	int dcount = 800;
X
X	while ( n-- )
X		for (i = 0; i < dcount; i++)
X			{ };
X}
END-of-shutlan.c
echo x - tokclose.asm
sed 's/^X//' >tokclose.asm << 'END-of-tokclose.asm'
X;
X; (C) COPYRIGHT IBM CORPORATION 1989
X; LICENSED MATERIALS - PROPERTY OF IBM
X; REFER TO COPYRIGHT INSTRUCTIONS FORM G120-2803
X;
X; TOKCLOSE - CLOSE TOKEN RING ADAPTER
X;             PARAMETER: ADAPTER NUMBER (0|1)
X;
X; $Header: tokclose.asm,v 1.2 89/11/14 16:07:50 mlewis Exp $
X;
XPUBLIC	_TOKCLOSE
X
XEXTRA	SEGMENT	WORD PUBLIC 'DATA'
XADAPTER	DB	0	;ADAPTER NUMBER
XCOMMAND	DB	04H	;COMMAND FIELD (DIR.CLOSE.ADAPTER)
XRETCODE	DB	0FFH	;RETURN CODE
XWORK	DB	0	;WORK AREA
XPOINTER	DD	0	;POINTER WORK AREA
XCMD_CMPL	DD	0	;COMMAND COMPLETION APPENDAGE
XPARM_TAB	DD	0	;PARM/POINTER TO CCB TABLE
XEXTRA	ENDS
X
X_TEXT	SEGMENT	WORD PUBLIC 'CODE'
X	ASSUME	CS:_TEXT,ES:EXTRA
X_TOKCLOSE	PROC	FAR
X	PUSH	BP
X	MOV	BP,SP
X	PUSH	DI
X	PUSH	SI
X	MOV	AX,EXTRA	;SETUP ES
X	MOV	ES,AX
X	MOV	AX,[BP+6]	;GET ADAPTER NUMBER
X	MOV	ADAPTER,AL
X	MOV	BX,OFFSET EXTRA:ADAPTER	;SETUP BX
X	INT	5CH	;DIRECT/NETBIOS INTERRUPT
X	MOV	AH,0FFH
XLP:	CMP	RETCODE,AH	;WAIT FOR VALID RETCODE
X	JE	LP
X	MOV	AH,0
X	MOV	AL,RETCODE	;SAVE IT FOR RETURN
X	POP	SI
X	POP	DI
X	MOV	SP,BP
X	POP	BP
X	RET
X_TOKCLOSE	ENDP
X_TEXT	ENDS
X	END
END-of-tokclose.asm
exit


=====-----     Mark S. Lewis, IBM AWD Palo Alto    -----======
inet: mlewis%ibmsupt@uunet.uu.net		(415) 855-4486
uucp: uunet!ibmsupt!mlewis              IBM Tie Line: 465-4486