Re: Compaq Fiber Channel Array RM4000 / 2.6.16 kernel patch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

Attached is the patch for the 2.6.16 kernel to get the RA4x00 running.

Kind regards,
	ingo flaschberger

geschaeftsleitung
crossip communications gmbH
------------------------------------------------------------------_------------
sebastian kneipp gasse 1          _____ _____ ____   _____ _____ (_)____
a-1020 wien                      / ___// ___// __ \ / ___// ___// // __ \
fix: +43-1-726 15 22-217        / /__ / /   / /_/ /(__  )(__  )/ // /_/ /
fax: +43-1-726 15 22-111        \___//_/    \____//____//____//_// .___/
mob: +43-699-105 86 719                                 _______ / /
www.xip.at                      communications gmbh    /______//_/
-------------------------------------------------------------------------------
diff -r -u linux-2.6.16_org/Documentation/scsi/RA4x00.txt linux-2.6.16/Documentation/scsi/RA4x00.txt
--- linux-2.6.16_org/Documentation/scsi/RA4x00.txt	2006-03-29 20:40:18.000000000 +0200
+++ linux-2.6.16/Documentation/scsi/RA4x00.txt	2006-03-29 20:35:17.000000000 +0200
@@ -0,0 +1,20 @@
+Compaq RA4x00 Fiber Channel Array support	if@xxxxxx 29.03.2006
+						crossip communications gmbh
+
+In 2.4.x linux kernels the cpqfc driver supported the Compaq RA4x00 Fiber 
+Channel Array. Limitation in 2.4.x kernels was that the RA4x00 only worked with
+a cpqfc supported fiber channel adapter (Tachyon chipset).
+
+In 2.6.x linux kernels the support for the cpqfc has been dropped because of
+very awful code and resulting porting problems from 2.4.x to 2.6.x.
+
+Support for the RA4x00 is now directly in the linux kernel but need some
+special configuration:
+*) Use a already supported fiber channel cards
+*) Update the RA4x00 to firmware version 2.60
+*) Load the scsi_mod modules with option: max_luns=4294967295
+
+
+More information about the RA4x00 could be found:
+http://hp.com
+http://ra4x00.xip.at
diff -r -u linux-2.6.16_org/drivers/scsi/scsi.c linux-2.6.16/drivers/scsi/scsi.c
--- linux-2.6.16_org/drivers/scsi/scsi.c	2006-03-20 06:53:29.000000000 +0100
+++ linux-2.6.16/drivers/scsi/scsi.c	2006-03-29 20:02:53.000000000 +0200
@@ -35,6 +35,10 @@
  *  Jiffies wrap fixes (host->resetting), 3 Dec 1998 Andrea Arcangeli
  *
  *  out_of_space hacks, D. Gilbert (dpg) 990608
+ *
+ *  Added Compaq RA4x00 Fiber Channel Array support, 29.03.2006
+ *	crossip communications gmbh - Ingo Flaschberger <if@xxxxxx>
+ *
  */
 
 #include <linux/module.h>
@@ -567,7 +571,7 @@
 	/* 
 	 * If SCSI-2 or lower, store the LUN value in cmnd.
 	 */
-	if (cmd->device->scsi_level <= SCSI_2) {
+	if ((cmd->device->scsi_level <= SCSI_2) && (!cmd->device->nolun_in_cdb)) {
 		cmd->cmnd[1] = (cmd->cmnd[1] & 0x1f) |
 			       (cmd->device->lun << 5 & 0xe0);
 	}
diff -r -u linux-2.6.16_org/drivers/scsi/scsi_devinfo.c linux-2.6.16/drivers/scsi/scsi_devinfo.c
--- linux-2.6.16_org/drivers/scsi/scsi_devinfo.c	2006-03-20 06:53:29.000000000 +0100
+++ linux-2.6.16/drivers/scsi/scsi_devinfo.c	2006-03-29 19:34:25.000000000 +0200
@@ -132,6 +132,10 @@
 	{"CMD", "CRA-7280", NULL, BLIST_SPARSELUN},	/* CMD RAID Controller */
 	{"CNSI", "G7324", NULL, BLIST_SPARSELUN},	/* Chaparral G7324 RAID */
 	{"CNSi", "G8324", NULL, BLIST_SPARSELUN},	/* Chaparral G8324 RAID */
+	{"COMPAQ", "ARRAY CONTROLLER", "2.60", BLIST_SPARSELUN | BLIST_REPORTLUN2 | 
+		BLIST_LARGELUN | BLIST_FORCE_SCSI2 | BLIST_MAX_512K}, /* Compaq RA4x00 */
+	{"COMPAQ", "LOGICAL VOLUME", "2.60", BLIST_FORCE_SCSI2 | BLIST_NOLUN_IN_CDB |
+		BLIST_MAX_512K},	/* Compaq RA4x00 */
 	{"COMPAQ", "LOGICAL VOLUME", NULL, BLIST_FORCELUN},
 	{"COMPAQ", "CR3500", NULL, BLIST_FORCELUN},
 	{"COMPAQ", "MSA1000", NULL, BLIST_SPARSELUN | BLIST_NOSTARTONADD},
diff -r -u linux-2.6.16_org/drivers/scsi/scsi_scan.c linux-2.6.16/drivers/scsi/scsi_scan.c
--- linux-2.6.16_org/drivers/scsi/scsi_scan.c	2006-03-20 06:53:29.000000000 +0100
+++ linux-2.6.16/drivers/scsi/scsi_scan.c	2006-03-29 20:03:01.000000000 +0200
@@ -23,6 +23,11 @@
  * 		all of the LUNs returned by the REPORT LUN; else,
  * 		sequentially scan LUNs up until some maximum is reached,
  * 		or a LUN is seen that cannot have a device attached to it.
+ * 
+ * Modification history:
+ * 	- Added Compaq RA4x00 Fiber Channel Array support, 29.03.2006
+ *		crossip communications gmbh - Ingo Flaschberger <if@xxxxxx>
+ *
  */
 
 #include <linux/config.h>
@@ -577,7 +582,13 @@
 	 * device is attached at LUN 0 (SCSI_SCAN_TARGET_PRESENT) so
 	 * non-zero LUNs can be scanned.
 	 */
-	sdev->scsi_level = inq_result[2] & 0x07;
+	
+	if (BLIST_FORCE_SCSI2 & *bflags) {	/* force SCSI2 for RA4x00 */
+		sdev->scsi_level = 2;
+	} else {
+		sdev->scsi_level = inq_result[2] & 0x07;
+	}
+	
 	if (sdev->scsi_level >= 2 ||
 	    (sdev->scsi_level == 1 && (inq_result[3] & 0x0f) == 1))
 		sdev->scsi_level++;
@@ -636,6 +647,10 @@
 		inq_result[1] |= 0x80;	/* removable */
 	} else if (*bflags & BLIST_NO_ULD_ATTACH)
 		sdev->no_uld_attach = 1;
+		
+	if (*bflags & BLIST_FORCE_SCSI2) {	/* force SCSI2 for RA4x00 */
+		inq_result[2] = inq_result[2] | 0x2;
+	}
 
 	switch (sdev->type = (inq_result[0] & 0x1f)) {
 	case TYPE_TAPE:
@@ -647,6 +662,7 @@
 	case TYPE_MEDIUM_CHANGER:
 	case TYPE_ENCLOSURE:
 	case TYPE_COMM:
+	case TYPE_RAID:
 	case TYPE_RBC:
 		sdev->writeable = 1;
 		break;
@@ -715,6 +731,22 @@
 	if (*bflags & BLIST_SELECT_NO_ATN)
 		sdev->select_no_atn = 1;
 
+        /*
+        * Maximum 512K cdb transfer length
+        * broken RA4x00 Compaq Disk Array
+        */
+        if (*bflags & BLIST_MAX_512K) {
+                sdev->max_512k = 1;
+        }
+
+        /*
+        * Do not send LUN in SCSI2 cdb
+        * broken RA4x00 Compaq Disk Array
+        */
+	if (*bflags & BLIST_NOLUN_IN_CDB) {
+        	sdev->nolun_in_cdb = 1;
+	}
+
 	/*
 	 * Some devices may not want to have a start command automatically
 	 * issued when a device is added.
diff -r -u linux-2.6.16_org/drivers/scsi/sd.c linux-2.6.16/drivers/scsi/sd.c
--- linux-2.6.16_org/drivers/scsi/sd.c	2006-03-20 06:53:29.000000000 +0100
+++ linux-2.6.16/drivers/scsi/sd.c	2006-03-29 20:03:17.000000000 +0200
@@ -22,6 +22,8 @@
  *	 - Badari Pulavarty <pbadari@xxxxxxxxxx>, Matthew Wilcox 
  *	   <willy@xxxxxxxxxx>, Kurt Garloff <garloff@xxxxxxx>: 
  *	   Support 32k/1M disks.
+ *       - Added Compaq RA4x00 Fiber Channel Array support, 29.03.2006
+ *         crossip communications gmbh - Ingo Flaschberger <if@xxxxxx>
  *
  *	Logging policy (needs CONFIG_SCSI_LOGGING defined):
  *	 - setting up transfer: SCSI_LOG_HLQUEUE levels 1 and 2
@@ -344,8 +346,14 @@
 		SCpnt->cmnd[14] = SCpnt->cmnd[15] = 0;
 	} else if ((this_count > 0xff) || (block > 0x1fffff) ||
 		   SCpnt->device->use_10_for_rw) {
-		if (this_count > 0xffff)
-			this_count = 0xffff;
+		if (SCpnt->device->max_512k) {
+			if (this_count > 0x200) {
+				this_count = 0x200;
+			}
+		} else {
+			if (this_count > 0xffff)
+				this_count = 0xffff;
+		}
 
 		SCpnt->cmnd[0] += READ_10 - READ_6;
 		SCpnt->cmnd[1] |= blk_fua_rq(rq) ? 0x8 : 0;
diff -r -u linux-2.6.16_org/include/scsi/scsi_device.h linux-2.6.16/include/scsi/scsi_device.h
--- linux-2.6.16_org/include/scsi/scsi_device.h	2006-03-20 06:53:29.000000000 +0100
+++ linux-2.6.16/include/scsi/scsi_device.h	2006-03-29 19:30:26.000000000 +0200
@@ -112,6 +112,8 @@
 				 * this device */
 	unsigned expecting_cc_ua:1; /* Expecting a CHECK_CONDITION/UNIT_ATTN
 				     * because we did a bus reset. */
+	unsigned max_512k:1;	/* maximum 512K cdb transfer length */
+	unsigned nolun_in_cdb:1; /* do not send LUN number in cdb */
 	unsigned use_10_for_rw:1; /* first try 10-byte read / write */
 	unsigned use_10_for_ms:1; /* first try 10-byte mode sense/select */
 	unsigned skip_ms_page_8:1;	/* do not use MODE SENSE page 0x08 */
diff -r -u linux-2.6.16_org/include/scsi/scsi_devinfo.h linux-2.6.16/include/scsi/scsi_devinfo.h
--- linux-2.6.16_org/include/scsi/scsi_devinfo.h	2006-03-20 06:53:29.000000000 +0100
+++ linux-2.6.16/include/scsi/scsi_devinfo.h	2006-03-29 19:29:10.000000000 +0200
@@ -28,4 +28,7 @@
 #define BLIST_NO_ULD_ATTACH	0x100000 /* device is actually for RAID config */
 #define BLIST_SELECT_NO_ATN	0x200000 /* select without ATN */
 #define BLIST_RETRY_HWERROR	0x400000 /* retry HARDWARE_ERROR */
+#define BLIST_FORCE_SCSI2	0x800000 /* force SCSI version 2 */
+#define BLIST_MAX_512K          0x1000000 /* maximum 512K cdb transfer length */
+#define BLIST_NOLUN_IN_CDB	0x2000000 /* do not send LUN number in cdb */
 #endif

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux