* [PATCH 2.6] ips 2/2: minor fixes
@ 2004-01-15 17:41 David Jeffery
2004-01-15 17:50 ` James Bottomley
0 siblings, 1 reply; 3+ messages in thread
From: David Jeffery @ 2004-01-15 17:41 UTC (permalink / raw)
To: linux-scsi@vger.kernel.org
[-- Attachment #1: Type: text/plain, Size: 217 bytes --]
This patch fixes two minor bugs. It allows zero length write commands
through to devices. It also prevents the writing of any '\0'
characters at the end of version numbers to ips's /proc/scsi files.
David Jeffery
[-- Attachment #2: ips.patch2 --]
[-- Type: text/x-patch, Size: 4522 bytes --]
diff -ur linux-2.6.1_p1/drivers/scsi/ips.c linux-2.6.1_p2/drivers/scsi/ips.c
--- linux-2.6.1_p1/drivers/scsi/ips.c 2004-01-13 14:10:51.000000000 -0500
+++ linux-2.6.1_p2/drivers/scsi/ips.c 2004-01-13 14:10:57.000000000 -0500
@@ -2160,27 +2160,60 @@
copy_info(&info, "\tIRQ number : %d\n", ha->irq);
- if (le32_to_cpu(ha->nvram->signature) == IPS_NVRAM_P5_SIG)
- copy_info(&info,
- "\tBIOS Version : %c%c%c%c%c%c%c%c\n",
- ha->nvram->bios_high[0], ha->nvram->bios_high[1],
- ha->nvram->bios_high[2], ha->nvram->bios_high[3],
- ha->nvram->bios_low[0], ha->nvram->bios_low[1],
- ha->nvram->bios_low[2], ha->nvram->bios_low[3]);
-
- copy_info(&info,
- "\tFirmware Version : %c%c%c%c%c%c%c%c\n",
- ha->enq->CodeBlkVersion[0], ha->enq->CodeBlkVersion[1],
- ha->enq->CodeBlkVersion[2], ha->enq->CodeBlkVersion[3],
- ha->enq->CodeBlkVersion[4], ha->enq->CodeBlkVersion[5],
- ha->enq->CodeBlkVersion[6], ha->enq->CodeBlkVersion[7]);
-
- copy_info(&info,
- "\tBoot Block Version : %c%c%c%c%c%c%c%c\n",
- ha->enq->BootBlkVersion[0], ha->enq->BootBlkVersion[1],
- ha->enq->BootBlkVersion[2], ha->enq->BootBlkVersion[3],
- ha->enq->BootBlkVersion[4], ha->enq->BootBlkVersion[5],
- ha->enq->BootBlkVersion[6], ha->enq->BootBlkVersion[7]);
+ /* For the Next 3 lines Check for Binary 0 at the end and don't include it if it's there. */
+ /* That keeps everything happy for "text" operations on the proc file. */
+
+ if (le32_to_cpu(ha->nvram->signature) == IPS_NVRAM_P5_SIG) {
+ if (ha->nvram->bios_low[3] == 0) {
+ copy_info(&info,
+ "\tBIOS Version : %c%c%c%c%c%c%c\n",
+ ha->nvram->bios_high[0], ha->nvram->bios_high[1],
+ ha->nvram->bios_high[2], ha->nvram->bios_high[3],
+ ha->nvram->bios_low[0], ha->nvram->bios_low[1],
+ ha->nvram->bios_low[2]);
+
+ } else {
+ copy_info(&info,
+ "\tBIOS Version : %c%c%c%c%c%c%c%c\n",
+ ha->nvram->bios_high[0], ha->nvram->bios_high[1],
+ ha->nvram->bios_high[2], ha->nvram->bios_high[3],
+ ha->nvram->bios_low[0], ha->nvram->bios_low[1],
+ ha->nvram->bios_low[2], ha->nvram->bios_low[3]);
+ }
+
+ }
+
+ if (ha->enq->CodeBlkVersion[7] == 0) {
+ copy_info(&info,
+ "\tFirmware Version : %c%c%c%c%c%c%c\n",
+ ha->enq->CodeBlkVersion[0], ha->enq->CodeBlkVersion[1],
+ ha->enq->CodeBlkVersion[2], ha->enq->CodeBlkVersion[3],
+ ha->enq->CodeBlkVersion[4], ha->enq->CodeBlkVersion[5],
+ ha->enq->CodeBlkVersion[6]);
+ } else {
+ copy_info(&info,
+ "\tFirmware Version : %c%c%c%c%c%c%c%c\n",
+ ha->enq->CodeBlkVersion[0], ha->enq->CodeBlkVersion[1],
+ ha->enq->CodeBlkVersion[2], ha->enq->CodeBlkVersion[3],
+ ha->enq->CodeBlkVersion[4], ha->enq->CodeBlkVersion[5],
+ ha->enq->CodeBlkVersion[6], ha->enq->CodeBlkVersion[7]);
+ }
+
+ if (ha->enq->BootBlkVersion[7] == 0) {
+ copy_info(&info,
+ "\tBoot Block Version : %c%c%c%c%c%c%c\n",
+ ha->enq->BootBlkVersion[0], ha->enq->BootBlkVersion[1],
+ ha->enq->BootBlkVersion[2], ha->enq->BootBlkVersion[3],
+ ha->enq->BootBlkVersion[4], ha->enq->BootBlkVersion[5],
+ ha->enq->BootBlkVersion[6]);
+ } else {
+ copy_info(&info,
+ "\tBoot Block Version : %c%c%c%c%c%c%c%c\n",
+ ha->enq->BootBlkVersion[0], ha->enq->BootBlkVersion[1],
+ ha->enq->BootBlkVersion[2], ha->enq->BootBlkVersion[3],
+ ha->enq->BootBlkVersion[4], ha->enq->BootBlkVersion[5],
+ ha->enq->BootBlkVersion[6], ha->enq->BootBlkVersion[7]);
+ }
copy_info(&info, "\tDriver Version : %s%s\n",
IPS_VERSION_HIGH, IPS_VERSION_LOW);
@@ -2842,6 +2875,11 @@
scb->dcdb.cmd_attribute =
ips_command_direction[scb->scsi_cmd->cmnd[0]];
+ /* Allow a WRITE BUFFER Command to Have no Data */
+ /* This is Used by Tape Flash Utilites */
+ if ((scb->scsi_cmd->cmnd[0] == WRITE_BUFFER) && (scb->data_len == 0))
+ scb->dcdb.cmd_attribute = 0;
+
if (!(scb->dcdb.cmd_attribute & 0x3))
scb->dcdb.transfer_length = 0;
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH 2.6] ips 2/2: minor fixes
2004-01-15 17:41 [PATCH 2.6] ips 2/2: minor fixes David Jeffery
@ 2004-01-15 17:50 ` James Bottomley
2004-01-15 19:13 ` David Jeffery
0 siblings, 1 reply; 3+ messages in thread
From: James Bottomley @ 2004-01-15 17:50 UTC (permalink / raw)
To: David Jeffery; +Cc: linux-scsi@vger.kernel.org
On Thu, 2004-01-15 at 12:41, David Jeffery wrote:
> This patch fixes two minor bugs. It allows zero length write commands
> through to devices. It also prevents the writing of any '\0'
> characters at the end of version numbers to ips's /proc/scsi files.
I'll take this, but you are thinking about converting the driver away
from /proc to sysfs, aren't you?
James
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 2.6] ips 2/2: minor fixes
2004-01-15 17:50 ` James Bottomley
@ 2004-01-15 19:13 ` David Jeffery
0 siblings, 0 replies; 3+ messages in thread
From: David Jeffery @ 2004-01-15 19:13 UTC (permalink / raw)
To: James Bottomley; +Cc: linux-scsi@vger.kernel.org
On Thu, 2004-01-15 at 12:50, James Bottomley wrote:
> I'll take this, but you are thinking about converting the driver away
> from /proc to sysfs, aren't you?
>
> James
Yes, long term I do. But not in the short term.
Going forward, this driver is intended to cover 2.6 and become the
source for future 2.4 driver updates. As support for 2.4 fades, at some
point the 2.4 driver will split off and become critical fixes only.
Until then, since sysfs doesn't exist in 2.4 I currently plan to keep
using proc with a unified driver instead of having to go ahead and split
2.4 and 2.6 and perform dual maintenance.
And I don't think anyone wants to add the sysfs code to a unified driver
and then #ifdef in the proc code for 2.4 and #ifdef in the sysfs code
for 2.6. That would be the ugliest solution.
In summary, the current plan is to keep using the proc file for the next
few releases. Once the 2.4 support goes into hard maintenance mode like
the rest of the 2.4 kernel, the plan is to replace the proc code with
sysfs.
David Jeffery
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2004-01-15 19:09 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-01-15 17:41 [PATCH 2.6] ips 2/2: minor fixes David Jeffery
2004-01-15 17:50 ` James Bottomley
2004-01-15 19:13 ` David Jeffery
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox