Linux megaraid 1.05 driver patch for doing pass-through ioctl's

ard@wau.mis.ah.nl
Fri, 3 Dec 1999 17:07:26 +0100


Hi,
While trying to do some pass through commands using the megaraid 466 card,
I got some bizarre error conditions.
The problem was that the megaraid driver just returned the status without
massageing it into linux-friendly values.
Resulting of course in scsi_obsolete errors and requeueing the command.
This patch fixes this by ALWAYS returning DID_BAD_DRIVE on any status
condition for ioctl's on the megaraid host-adapter.
This patch will not influence normal behavior, but it might however have
influence on the megamgr program (which I am not using anyway), that does
do ioctl's on the host-adapter.

Anyway, the patch:

--- old/drivers/scsi/megaraid.c Fri Dec 3 11:13:15 1999
+++ linux/drivers/scsi/megaraid.c Fri Dec 3 11:12:31 1999
@@ -618,14 +618,17 @@
SCpnt->result = 0;

if ((SCpnt->cmnd[0] & 0x80) ) {/* i.e. ioctl cmd such as 0x80, 0x81 of megamgr*/
- switch (status) {
- case 0xF0:
- case 0xF4:
- SCpnt->result=(DID_BAD_TARGET<<16)|status;
- break;
- default:
- SCpnt->result|=status;
- }/*end of switch*/
+ /*
+ * At this point I see no other solution than return
+ * DID_BAD_TARGET. This will prevent the scsi-obsolete
+ * code from retrying our precious ioctls...
+ * Now we need a mapping between the status byte and
+ * the 0x1f masked shifted left 1 statys byte in the
+ * linux kernel.
+ */
+ if(status) {
+ SCpnt->result=(DID_BAD_TARGET<<16)|status;
+ }
}
else{
/* Convert MegaRAID status to Linux error code */

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/