Proposed patch for Linux-2.1.81 GDT scsi driver

Adam J. Richter (adam@yggdrasil.com)
Sun, 25 Jan 1998 02:07:22 -0800


It looks like the GDT scsi driver was trying to do something
that used the now deleted SCSI kernel timer number. It looks like
there is an identical (?) function that has been updated in
scsi-obselete.c, so I deleted the function from the GDT driver and
called the one in scsi-obselete.c. You should probably look at
this patch before deciding to integrate it. I am not absolutely
positive in my assumption that these two routines were functionally
identical. Also, the symbol update_timeout probably needs to be
exported in order for the module to load. Anyhow, I have appended
the patch below.

Adam J. Richter __ ______________ 4880 Stevens Creek Blvd, Suite 205
adam@yggdrasil.com \ / San Jose, California 95129-1034
+1 408 261-6630 | g g d r a s i l United States of America
fax +1 408 261-6631 "Free Software For The Rest Of Us."
-----------------------CUT HERE---------------------------------------

diff -c2 -r /tmp/linux-2.1.81.orig/drivers/scsi/gdth_proc.c linux/drivers/scsi/gdth_proc.c
*** /tmp/linux-2.1.81.orig/drivers/scsi/gdth_proc.c Tue Nov 4 09:17:30 1997
--- linux/drivers/scsi/gdth_proc.c Sun Jan 25 01:41:07 1998
***************
*** 5,8 ****
--- 5,10 ----
#include "gdth_ioctl.h"

+ extern int update_timeout(Scsi_Cmnd * SCset, int timeout);
+
int gdth_proc_info(char *buffer,char **start,off_t offset,int length,
int hostno,int inout)
***************
*** 579,583 ****
{
TRACE2(("gdth_stop_timeout(): update_timeout()\n"));
! scp->SCp.buffers_residual = gdth_update_timeout(scp, 0);
}
}
--- 581,585 ----
{
TRACE2(("gdth_stop_timeout(): update_timeout()\n"));
! scp->SCp.buffers_residual = update_timeout(scp, 0);
}
}
***************
*** 604,635 ****
{
TRACE2(("gdth_start_timeout(): update_timeout()\n"));
! gdth_update_timeout(scp, scp->SCp.buffers_residual);
! }
! }
! restore_flags(flags);
! }
!
! static int gdth_update_timeout(Scsi_Cmnd *scp, int timeout)
! {
! ulong flags;
! int oldto;
!
! save_flags(flags);
! cli();
!
! oldto = scp->timeout;
! scp->timeout = timeout;
! if (timeout > 0) {
! if (timer_table[SCSI_TIMER].expires == 0) {
! timer_table[SCSI_TIMER].expires = jiffies + timeout;
! timer_active |= 1 << SCSI_TIMER;
! } else {
! if (jiffies + timeout < timer_table[SCSI_TIMER].expires)
! timer_table[SCSI_TIMER].expires = jiffies + timeout;
}
}
-
restore_flags(flags);
- return oldto;
}

--- 606,613 ----
{
TRACE2(("gdth_start_timeout(): update_timeout()\n"));
! update_timeout(scp, scp->SCp.buffers_residual);
}
}
restore_flags(flags);
}

diff -c2 -r /tmp/linux-2.1.81.orig/drivers/scsi/gdth_proc.h linux/drivers/scsi/gdth_proc.h
*** /tmp/linux-2.1.81.orig/drivers/scsi/gdth_proc.h Tue Nov 4 09:17:30 1997
--- linux/drivers/scsi/gdth_proc.h Sun Jan 25 01:41:07 1998
***************
*** 17,21 ****
static void gdth_stop_timeout(int hanum, int busnum, int id);
static void gdth_start_timeout(int hanum, int busnum, int id);
- static int gdth_update_timeout(Scsi_Cmnd *scp, int timeout);

void gdth_scsi_done(Scsi_Cmnd *scp);
--- 17,20 ----
diff -c2 -r /tmp/linux-2.1.81.orig/drivers/scsi/scsi_obsolete.c linux/drivers/scsi/scsi_obsolete.c
*** /tmp/linux-2.1.81.orig/drivers/scsi/scsi_obsolete.c Thu Jan 8 20:35:43 1998
--- linux/drivers/scsi/scsi_obsolete.c Sun Jan 25 01:41:11 1998
***************
*** 1081,1085 ****
*/

! static int update_timeout(Scsi_Cmnd * SCset, int timeout)
{
int rtn;
--- 1081,1085 ----
*/

! int update_timeout(Scsi_Cmnd * SCset, int timeout)
{
int rtn;