From kevinl@bruce.cs.monash.edu.au Wed Mar 23 22:14:30 EST 1994
Article: 7022 of comp.os.linux.development
Path: bigblue.oit.unc.edu!concert!gatech!howland.reston.ans.net!vixen.cso.uiuc.edu!uchinews!msuinfo!harbinger.cc.monash.edu.au!bruce.cs.monash.edu.au!kevinl
From: kevinl@bruce.cs.monash.edu.au (Kevin Lentin)
Newsgroups: comp.os.linux.development
Subject: Patch for T130B with interupts
Date: 24 Mar 1994 02:50:25 GMT
Organization: Computer Science, Monash University, Australia
Lines: 133
Distribution: world
Message-ID: <2mqv5h$cl9@harbinger.cc.monash.edu.au>
NNTP-Posting-Host: molly.cs.monash.edu.au
X-Newsreader: TIN [version 1.2 021193BETA PL3]


OK, here is a tar.gz file containing 2 new files (g_C400.[ch]) and patches
to the NCR5380 scsi code and a few files up the source tree to config.in.
These patches will allow you to configure in an NCR53C400 generic scsi
driver which is (at the moment) just the same as the NCR5380 driver with
one extra write to turn on T130B interupts and a whole lot of other stuff
which will make the next stage (PSEUDO_DMA) easier.

Note that previously, you had to add 8 to your port address to get the
NCR5380 driver to work with a T130B. Now the 53C400 driver does this for
you so you should configure it in at the port address jumpered on the card.

The patches below include a patch to Makefile that sets an overide for the
default address of 0x350 which you're welcome to use, remove or change as
you require. The driver can be configured for mthe lilo prompt in the same
way as the ncr5380 driver, expcept you use ncr53c400=.... instead.
(Although if you have the override in the Makefile, you don't need this).

I'm hoping this patch is complete. I know that the patches in the NCR5380.*
files and the new g_C400.* files are but I have had to refix the files
further up (eg hosts.c and main.c and config.in) without access to a Linux
box (my modem link went down and I had forgotten to grab those files). I'm
almost certain I got everything, but let me know if you have troubles
compiling this.

The performance of this code is still poor, given that there is no DMA
happening but it is better than the generic 5380 driver with no interupts.
I'm working on the PSEUDO_DMA code at the moment but time is scarce.

Here comes the tar.gz file uuencoded. It contains g_C400.h and g_C400.c
which you should copy into /usr/src/linux/drivers/scsi and a patch file
which you can apply from /usr/src/linux using: patch -p1 < c400.patch

begin 644 c400.tar.gz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[AP*N=PO^=RN;1%V)*2\U;*+-[4+PBY,"9#-S<P>3+ /
M8 *Q8T*CJ1:P&=&3DCD_/C+I>T%H"2!?*1VF;\BSTJD&@Z5O,:[$GK#FDDCY
M%^O3;GYU;*XP0*TPMK-PI<Q-8XE)\R^ICG)^BVMI:^H2;:HM,7TK% /ZJ,^P
MFY'W+*.Z(V ,V@OQ>%2L;4N@+SP+.%.1R&\+C+4$;?S'1HO%+0[^_3D^%/@W
MA<AI^]YMH<#O!,@04F28)!?8$*:O5(4^%%66AE7X(/RC2-]X;K>ZHW*+OD?=
MWG0VODW--,TB9P^VQ5/S<$=/<8LV!>+G0LT6-T/X+N1G[!'N\ZX(E$S>606=
M\'SV%BAZ&D;R]&C&N4$$K_7_R^O_@]?K]7J]7J_7Z__R>JW_7^O_U_K__[?^
*_S=*!JCG $   &C&
 
end
-- 
[==================================================================]
[ Kevin Lentin                   |___/~\__/~\___/~~~~\__/~\__/~\_| ]
[ kevinl@bruce.cs.monash.edu.au  |___/~\/~\_____/~\______/~\/~\__| ]
[ Macintrash: 'Just say NO!'     |___/~\__/~\___/~~~~\____/~~\___| ]
[==================================================================]


