Hello Matthew,
On Thu, Mar 30, 2006 at 12:53:10PM +0200, Ingo Flaschberger wrote:
* 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>
+ *
*/
I think you can drop the changelog entry here -- it's not been updated
in many years. Plus, it's not really accurate.
OK.
{"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},
I wonder if you should just be adding BLIST_MAX_512K to the current
entry for LOGICAL VOLUME instead?
The "LOGICAL VOLUME" was there before and I think I will break the SCSI
Version.
* 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>
+ *
*/
Definitely don't start a changelog. That's what SCMs are for.
OK.
@@ -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;
+ }
+
Indent with tabs, not spaces. Also, sdev->max_512k is a bit ...
specific. How about adding an unsigned short to struct scsi_device
(right above queue_depth, so it fits in the padding) called something
like max_xfer_len? Then you can do something like:
sdev->max_xfer_len = 0xffff;
if (*bflags & BLIST_MAX_512K)
sdev->max_xfer_len = 0x200;
Ups.. standard problem..(
sdev->max_xfer_len is a good idea.
and later:
@@ -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;
simplifies to:
if (this_count > SCpnt->device->max_xfer_len)
this_count = SCpnt->device->max_xfer_len;
@@ -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;
That conditional makes my brain hurt. Can we split it up?
if ((bflags & BLIST_NOREPORTLUN)
return 1;
if ((starget->scsi_level < SCSI_2) &&
(starget->scsi_level != SCSI_UNKNOWN))
return 1;
if ((starget->scsi_level < SCSI_3) &&
((!(bflags & BLIST_REPORTLUN2) &&
(starget->scsi_level != SCSI_UNKNOWN) ||
shost->max_lun <= 8)))
return 1;
Shure.
I'm not sure that's what you meant to do, even. How about more simply:
/*
* Only support SCSI-3 and up devices if BLIST_NOREPORTLUN is not set.
* Also allow SCSI-2 and unknown devices if BLIST_REPORTLUN2 is set
* and host adapter supports more than 8 LUNs.
*/
if ((bflags & BLIST_NOREPORTLUN)
return 1;
if ((starget->scsi_level < SCSI_2) &&
(starget->scsi_level != SCSI_UNKNOWN))
return 1;
if ((starget->scsi_level < SCSI_3) &&
(!(bflags & BLIST_REPORTLUN2) || shost->max_lun <= 8))
return 1;
Attached,, new patch version 3....
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 17:29:26.000000000 +0200
@@ -567,7 +567,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 18:08:59.000000000 +0200
@@ -647,6 +647,7 @@
case TYPE_MEDIUM_CHANGER:
case TYPE_ENCLOSURE:
case TYPE_COMM:
+ case TYPE_RAID:
case TYPE_RBC:
sdev->writeable = 1;
break;
@@ -716,6 +717,15 @@
sdev->select_no_atn = 1;
/*
+ * Maximum 512K cdb transfer length
+ * broken RA4x00 Compaq Disk Array
+ */
+ sdev->max_xfer_len = 0xffff;
+ if (*bflags & BLIST_MAX_512K) {
+ sdev->max_xfer_len = 0x200;
+ }
+
+ /*
* Some devices may not want to have a start command automatically
* issued when a device is added.
*/
@@ -1088,10 +1098,15 @@
* Also allow SCSI-2 if BLIST_REPORTLUN2 is set and host adapter does
* 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)) )
+ if (bflags & BLIST_NOREPORTLUN)
+ return 1;
+ if ((starget->scsi_level < SCSI_2) &&
+ (starget->scsi_level != SCSI_UNKNOWN))
+ return 1;
+ if (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-30 18:10:12.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,8 @@
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 (this_count > SCpnt->device->max_xfer_len)
+ this_count = SCpnt->device->max_xfer_len;
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 17:52:44.000000000 +0200
@@ -89,6 +89,7 @@
* scsi_devinfo.[hc]. For now used only to
* pass settings from slave_alloc to scsi
* core. */
+ unsigned short max_xfer_len; /* Maximum xfer length in one cdb */
unsigned writeable:1;
unsigned removable:1;
unsigned changed:1; /* Data invalid due to media change */
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 18:11:20.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