Commit 9c9e47a5 authored by Stephen Cameron's avatar Stephen Cameron Committed by Linus Torvalds

[PATCH] cpqfc, 2.5.30, lun fix

This is basically a port of a patch to 2.4 kernels to fix
the ioctls to pay attention to the lun field.  For 2.5.30,
the passthrough ioctl is pretty broken, and this patch does not
fix that.  (The patch I'm sending after this one does.)

-- steve
parent cd03e0b9
...@@ -7,11 +7,16 @@ Tested in single and dual HBA configuration, 32 and 64bit busses, ...@@ -7,11 +7,16 @@ Tested in single and dual HBA configuration, 32 and 64bit busses,
SEST size 512 Exchanges (simultaneous I/Os) limited by module kmalloc() SEST size 512 Exchanges (simultaneous I/Os) limited by module kmalloc()
max of 128k bytes contiguous. max of 128k bytes contiguous.
Ver 2.5.1 Jul 30, 2002
* fix ioctl to pay attention to the specified LUN.
Ver 2.5.0 Nov 29, 2001 Ver 2.5.0 Nov 29, 2001
* eliminated io_request_lock. This change makes the driver specific * eliminated io_request_lock. This change makes the driver specific
to the 2.5.x kernels. to the 2.5.x kernels.
* silenced excessively noisy printks. * silenced excessively noisy printks.
Ver 2.1.2 July 23, 2002
* initialize DumCmnd->lun in cpqfcTS_ioctl (used in fcFindLoggedInPorts as LUN index)
Ver 2.1.1 Oct 18, 2001 Ver 2.1.1 Oct 18, 2001
* reinitialize Cmnd->SCp.sent_command (used to identify commands as * reinitialize Cmnd->SCp.sent_command (used to identify commands as
passthrus) on calling scsi_done, since the scsi mid layer does not passthrus) on calling scsi_done, since the scsi mid layer does not
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
/* Embedded module documentation macros - see module.h */ /* Embedded module documentation macros - see module.h */
MODULE_AUTHOR("Compaq Computer Corporation"); MODULE_AUTHOR("Compaq Computer Corporation");
MODULE_DESCRIPTION("Driver for Compaq 64-bit/66Mhz PCI Fibre Channel HBA v. 2.1.1"); MODULE_DESCRIPTION("Driver for Compaq 64-bit/66Mhz PCI Fibre Channel HBA v. 2.5.2");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
int cpqfcTS_TargetDeviceReset( Scsi_Device *ScsiDev, unsigned int reset_flags); int cpqfcTS_TargetDeviceReset( Scsi_Device *ScsiDev, unsigned int reset_flags);
...@@ -503,6 +503,7 @@ int cpqfcTS_ioctl( Scsi_Device *ScsiDev, int Cmnd, void *arg) ...@@ -503,6 +503,7 @@ int cpqfcTS_ioctl( Scsi_Device *ScsiDev, int Cmnd, void *arg)
// can we find an FC device mapping to this SCSI target? // can we find an FC device mapping to this SCSI target?
DumCmnd.channel = ScsiDev->channel; // For searching DumCmnd.channel = ScsiDev->channel; // For searching
DumCmnd.target = ScsiDev->id; DumCmnd.target = ScsiDev->id;
DumCmnd.lun = ScsiDev->lun;
pLoggedInPort = fcFindLoggedInPort( fcChip, pLoggedInPort = fcFindLoggedInPort( fcChip,
&DumCmnd, // search Scsi Nexus &DumCmnd, // search Scsi Nexus
0, // DON'T search linked list for FC port id 0, // DON'T search linked list for FC port id
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
// don't forget to also change MODULE_DESCRIPTION in cpqfcTSinit.c // don't forget to also change MODULE_DESCRIPTION in cpqfcTSinit.c
#define VER_MAJOR 2 #define VER_MAJOR 2
#define VER_MINOR 5 #define VER_MINOR 5
#define VER_SUBMINOR 0 #define VER_SUBMINOR 2
// Macros for kernel (esp. SMP) tracing using a PCI analyzer // Macros for kernel (esp. SMP) tracing using a PCI analyzer
// (e.g. x86). // (e.g. x86).
......
...@@ -3380,6 +3380,8 @@ PFC_LOGGEDIN_PORT fcFindLoggedInPort( ...@@ -3380,6 +3380,8 @@ PFC_LOGGEDIN_PORT fcFindLoggedInPort(
// Report Luns command // Report Luns command
if( pLoggedInPort->ScsiNexus.LunMasking == 1) if( pLoggedInPort->ScsiNexus.LunMasking == 1)
{ {
if (Cmnd->lun > sizeof(pLoggedInPort->ScsiNexus.lun))
return NULL;
// we KNOW all the valid LUNs... 0xFF is invalid! // we KNOW all the valid LUNs... 0xFF is invalid!
Cmnd->SCp.have_data_in = pLoggedInPort->ScsiNexus.lun[Cmnd->lun]; Cmnd->SCp.have_data_in = pLoggedInPort->ScsiNexus.lun[Cmnd->lun];
if (pLoggedInPort->ScsiNexus.lun[Cmnd->lun] == 0xFF) if (pLoggedInPort->ScsiNexus.lun[Cmnd->lun] == 0xFF)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment