[PATCH] Re: [OOPS] Linux 2.5 and Parallel Port Zip 100

Rich Baum
2002-02-15T10:40:52Z

[-- Attachment #1: Type: text/plain, Size: 206 bytes --]

The following patch allows parallel port zip drives to work with 2.5 kernels.
This patch has been tested with both imm and ppa drives. Thanks to John
Weber for testing the ppa part of this patch.

Rich

[-- Attachment #2: rb2.diff --]
[-- Type: text/x-diff, Size: 1701 bytes --]

diff -urN -X dontdiff linux/drivers/scsi/imm.c linux-rb/drivers/scsi/imm.c
--- linux/drivers/scsi/imm.c Sun Feb 10 16:04:43 2002
+++ linux-rb/drivers/scsi/imm.c Thu Feb 7 22:22:38 2002
@@ -1007,7 +1007,7 @@
cmd->SCp.this_residual = cmd->request_bufflen;
cmd->SCp.ptr = cmd->request_buffer;
}
- cmd->SCp.buffers_residual = cmd->use_sg;
+ cmd->SCp.buffers_residual = cmd->use_sg - 1;
cmd->SCp.phase++;
if (cmd->SCp.this_residual & 0x01)
cmd->SCp.this_residual++;
diff -urN -X dontdiff linux/drivers/scsi/ppa.c linux-rb/drivers/scsi/ppa.c
--- linux/drivers/scsi/ppa.c Sun Feb 10 16:04:44 2002
+++ linux-rb/drivers/scsi/ppa.c Sun Feb 10 22:36:20 2002
@@ -738,7 +738,7 @@
if (cmd->SCp.buffers_residual--) {
cmd->SCp.buffer++;
cmd->SCp.this_residual = cmd->SCp.buffer->length;
- cmd->SCp.ptr = cmd->SCp.buffer->address;
+ cmd->SCp.ptr = page_address(cmd->SCp.buffer->page) + cmd->SCp.buffer->offset;
}
}
/* Now check to see if the drive is ready to comunicate */
@@ -923,14 +923,14 @@
/* if many buffers are available, start filling the first */
cmd->SCp.buffer = (struct scatterlist *) cmd->request_buffer;
cmd->SCp.this_residual = cmd->SCp.buffer->length;
- cmd->SCp.ptr = cmd->SCp.buffer->address;
+ cmd->SCp.ptr = page_address(cmd->SCp.buffer->page) + cmd->SCp.buffer->offset;
} else {
/* else fill the only available buffer */
cmd->SCp.buffer = NULL;
cmd->SCp.this_residual = cmd->request_bufflen;
cmd->SCp.ptr = cmd->request_buffer;
}
- cmd->SCp.buffers_residual = cmd->use_sg;
+ cmd->SCp.buffers_residual = cmd->use_sg - 1;
cmd->SCp.phase++;

case 5: /* Phase 5 - Data transfer stage */