Re: Compaq Fiber Channel Array RM4000 / 2.6.16 kernel patch

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

 



Hello James,

On Wed, 2006-03-29 at 22:23 +0200, Ingo Flaschberger wrote:
When you mean:
if ((bflags & BLIST_NOREPORTLUN) ||
              starget->scsi_level < SCSI_2 ||
             ((starget->scsi_level < SCSI_3 ||
              starget->scsi_level == SCSI_UNKNOWN) &&
              (!(bflags & BLIST_REPORTLUN2) || shost->max_lun <= 8)) )
 		return 1;
That also hits return.

Then invert the SCSI2 test

And need to do some checks in SCSI-3 also.
See the attached patch version 2.

Bye,
	Ingo
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-30 00:19:32.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-30 14:46:52.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->scsi_level != SCSI_UNKNOWN)) {
 		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-30 14:33:54.000000000 +0200
@@ -132,6 +132,9 @@
 	{"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_LARGELUN |
+		BLIST_MAX_512K}, /* Compaq RA4x00 */
+	{"COMPAQ", "LOGICAL VOLUME", "2.60", 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-30 14:42:28.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>
@@ -647,6 +652,7 @@
 	case TYPE_MEDIUM_CHANGER:
 	case TYPE_ENCLOSURE:
 	case TYPE_COMM:
+	case TYPE_RAID:
 	case TYPE_RBC:
 		sdev->writeable = 1;
 		break;
@@ -715,6 +721,14 @@
 	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;
+        }
+
 	/*
 	 * Some devices may not want to have a start command automatically
 	 * issued when a device is added.
@@ -1089,9 +1103,12 @@
 	 * support more than 8 LUNs.
 	 */
 	if ((bflags & BLIST_NOREPORTLUN) || 
-	     starget->scsi_level < SCSI_2 ||
-	    (starget->scsi_level < SCSI_3 && 
-	     (!(bflags & BLIST_REPORTLUN2) || shost->max_lun <= 8)) )
+            ((starget->scsi_level < SCSI_2) &&
+            (starget->scsi_level != SCSI_UNKNOWN)) ||
+            (starget->scsi_level < SCSI_3 &&
+            ((!(bflags & BLIST_REPORTLUN2) && 
+	    (starget->scsi_level != SCSI_UNKNOWN)) || 
+	    shost->max_lun <= 8)) )
 		return 1;
 	if (bflags & BLIST_NOLUN)
 		return 0;
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-30 14:29:45.000000000 +0200
@@ -112,6 +112,7 @@
 				 * 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 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-30 14:29:19.000000000 +0200
@@ -28,4 +28,5 @@
 #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_MAX_512K          0x1000000 /* maximum 512K cdb transfer length */
 #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