Skip to contentSkip to conversation

qla2xxx - Use RIO mode 4 for ISP2100/ISP2200 operation. [3/3]

PATCH New Andrew Vasquez 1 participant 1 message Jan 27, 2004

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qla2xxx - Use RIO mode 4 for ISP2100/ISP2200 operation. [3/3]

James,

RIO mode 3 (originally used in the qla2xxx driver) will not work on big-endian platforms due to the firmware returning only the first-word of the dword command handle returned after SCSI completion. Use RIO mode 4 since full 32bit handle is returned during status.

I've recently added an IBM p630 machine (ppc64) to my test ring with a mix of 2200 and 2300 cards -- I feel fairly confident that most endian type issues are addressed.

Please apply.

Regards,
Andrew Vasquez

drivers/scsi/qla2xxx/qla_init.c renamed from drivers/scsi/qla2xxx-2200/qla_init.c +1 -1
diff -Nurd -X /root/praka/dontdiff linux-2.6/drivers/scsi/qla2xxx-2200/qla_init.c linux-2.6/drivers/scsi/qla2xxx/qla_init.c
@@ -1414,7 +1414,7 @@
 		icb->firmware_options[0] &= ~BIT_3;
 		icb->add_firmware_options[0] &=
 		    ~(BIT_3 | BIT_2 | BIT_1 | BIT_0);
-		icb->add_firmware_options[0] |= (BIT_1 | BIT_0);
+		icb->add_firmware_options[0] |= BIT_2;
 		icb->response_accumulation_timer = 3;
 		icb->interrupt_delay_timer = 5;
 
drivers/scsi/qla2xxx/qla_isr.c renamed from drivers/scsi/qla2xxx-2200/qla_isr.c +10 -5
diff -Nurd -X /root/praka/dontdiff linux-2.6/drivers/scsi/qla2xxx-2200/qla_isr.c linux-2.6/drivers/scsi/qla2xxx/qla_isr.c
@@ -289,10 +289,13 @@
 	switch (mb[0]) {
 	case MBA_SCSI_COMPLETION:
 		if (IS_QLA2100(ha) || IS_QLA2200(ha))
-			handles[0] = RD_MAILBOX_REG(ha, reg, 1);
+			handles[0] = le32_to_cpu(
+			    ((uint32_t)(RD_MAILBOX_REG(ha, reg, 2) << 16)) |
+			    RD_MAILBOX_REG(ha, reg, 1));
 		else
-			handles[0] = MSW(mbx);
-		handles[0] |= (uint32_t)(RD_MAILBOX_REG(ha, reg, 2) << 16);
+			handles[0] = le32_to_cpu(
+			    ((uint32_t)(RD_MAILBOX_REG(ha, reg, 2) << 16)) |
+			    MSW(mbx));
 		handle_cnt = 1;
 		break;
 	case MBA_CMPLT_1_16BIT:
@@ -334,9 +337,11 @@
 		mb[0] = MBA_SCSI_COMPLETION;
 		break;
 	case MBA_CMPLT_2_32BIT:
-		handles[0] = (uint32_t)((RD_MAILBOX_REG(ha, reg, 2) << 16) |
+		handles[0] = le32_to_cpu(
+		    ((uint32_t)(RD_MAILBOX_REG(ha, reg, 2) << 16)) |
 		    RD_MAILBOX_REG(ha, reg, 1));
-		handles[1] = (uint32_t)((RD_MAILBOX_REG(ha, reg, 7) << 16) |
+		handles[1] = le32_to_cpu(
+		    ((uint32_t)(RD_MAILBOX_REG(ha, reg, 7) << 16)) |
 		    RD_MAILBOX_REG(ha, reg, 6));
 		handle_cnt = 2;
 		mb[0] = MBA_SCSI_COMPLETION;