Re: Compaq Fiber Channel Array RM4000 / 2.6.16 kernel patch VER6

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

 



Hello Matthew,

I meant to do something like:

-	{"COMPAQ", "LOGICAL VOLUME", NULL, BLIST_FORCELUN},
+	{"COMPAQ", "LOGICAL VOLUME", NULL, BLIST_FORCELUN | BLIST_MAX_512K},

already changed in version 5

 	 * 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)) {

Oh, could you break the line so it doesn't go over 80 columns?

fixed.


 		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;
+	}

Do we need the comment?  We don't need the braces.

also already fixed in version 5

+	if (starget->scsi_level < SCSI_3 &&
+			((!(bflags & BLIST_REPORTLUN2) &&
+			(starget->scsi_level != SCSI_UNKNOWN)) ||
+			shost->max_lun <= 8))

Why do we need the SCSI_UNKNOWN check here?

You had an very old version....

  *	   Support 32k/1M disks.
+ *	 - Added Compaq RA4x00 Fiber Channel Array support, 29.03.2006
+ *	   crossip communications gmbh - Ingo Flaschberger <if@xxxxxx>
  *

This doesn't really describe what you've done to this file.  It's more
- Limit maximum transfers to new field in scsi_device
... or something

ok.

@@ -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 */

I think you missed my point about where to place it -- due to padding
rules, you've grown the structure by 4 bytes.  If you put it between
current_cmnd and queue_depth, you won't grow the struct at all.

Never stop learning :)
fixed.

Version 6 now.

bye,
	Ingo
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 20:28:02.000000000 +0200
@@ -567,7 +567,8 @@
 	/* 
 	 * 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-30 19:15:30.000000000 +0200
+++ linux-2.6.16/drivers/scsi/scsi_devinfo.c	2006-03-30 20:16:47.000000000 +0200
@@ -132,7 +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", "LOGICAL VOLUME", NULL, BLIST_FORCELUN},
+	{"COMPAQ", "ARRAY CONTROLLER", NULL, BLIST_SPARSELUN | BLIST_LARGELUN |
+		BLIST_MAX_512K | BLIST_REPORTLUN}, /* Compaq RA4x00 */
+	{"COMPAQ", "LOGICAL VOLUME", NULL, BLIST_FORCELUN | BLIST_MAX_512K}, /* Compaq RA4x00 */
 	{"COMPAQ", "CR3500", NULL, BLIST_FORCELUN},
 	{"COMPAQ", "MSA1000", NULL, BLIST_SPARSELUN | BLIST_NOSTARTONADD},
 	{"COMPAQ", "MSA1000 VOLUME", 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-30 19:29:12.000000000 +0200
+++ linux-2.6.16/drivers/scsi/scsi_scan.c	2006-03-30 20:17:09.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,14 @@
 		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 +1097,13 @@
 	 * Also allow SCSI-2 and SCSI-UNKNOWN if BLIST_REPORTLUN 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_REPORTLUN) || 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_REPORTLUN) || 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 20:29:44.000000000 +0200
@@ -22,6 +22,8 @@
  *	 - Badari Pulavarty <pbadari@xxxxxxxxxx>, Matthew Wilcox 
  *	   <willy@xxxxxxxxxx>, Kurt Garloff <garloff@xxxxxxx>: 
  *	   Support 32k/1M disks.
+ *	 - Limit maximum transfers via new field in scsi_device
+ *	   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 20:31:26.000000000 +0200
@@ -59,6 +59,7 @@
 	struct list_head cmd_list;	/* queue of in use SCSI Command structures */
 	struct list_head starved_entry;
 	struct scsi_cmnd *current_cmnd;	/* currently active command */
+	unsigned short max_xfer_len;	/* Maximum xfer length in one cdb */ 
 	unsigned short queue_depth;	/* How deep of a queue we want */
 	unsigned short last_queue_full_depth; /* These two are used by */
 	unsigned short last_queue_full_count; /* scsi_track_queue_full() */
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-30 19:37:56.000000000 +0200
+++ linux-2.6.16/include/scsi/scsi_devinfo.h	2006-03-30 19:47:20.000000000 +0200
@@ -29,4 +29,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
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 19:15:30.000000000 +0200
@@ -121,7 +121,7 @@
 	 * Other types of devices that have special flags.
 	 * Note that all USB devices should have the BLIST_INQUIRY_36 flag.
 	 */
-	{"3PARdata", "VV", NULL, BLIST_REPORTLUN2},
+	{"3PARdata", "VV", NULL, BLIST_REPORTLUN},
 	{"ADAPTEC", "AACRAID", NULL, BLIST_FORCELUN},
 	{"ADAPTEC", "Adaptec 5400S", NULL, BLIST_FORCELUN},
 	{"AFT PRO", "-IX CF", "0.0>", BLIST_FORCELUN},
@@ -136,9 +136,9 @@
 	{"COMPAQ", "CR3500", NULL, BLIST_FORCELUN},
 	{"COMPAQ", "MSA1000", NULL, BLIST_SPARSELUN | BLIST_NOSTARTONADD},
 	{"COMPAQ", "MSA1000 VOLUME", NULL, BLIST_SPARSELUN | BLIST_NOSTARTONADD},
-	{"COMPAQ", "HSV110", NULL, BLIST_REPORTLUN2 | BLIST_NOSTARTONADD},
+	{"COMPAQ", "HSV110", NULL, BLIST_REPORTLUN | BLIST_NOSTARTONADD},
 	{"DDN", "SAN DataDirector", "*", BLIST_SPARSELUN},
-	{"DEC", "HSG80", NULL, BLIST_REPORTLUN2 | BLIST_NOSTARTONADD},
+	{"DEC", "HSG80", NULL, BLIST_REPORTLUN | BLIST_NOSTARTONADD},
 	{"DELL", "PV660F", NULL, BLIST_SPARSELUN},
 	{"DELL", "PV660F   PSEUDO", NULL, BLIST_SPARSELUN},
 	{"DELL", "PSEUDO DEVICE .", NULL, BLIST_SPARSELUN},	/* Dell PV 530F */
@@ -158,7 +158,7 @@
 	{"HP", "A6189A", NULL, BLIST_SPARSELUN | BLIST_LARGELUN},	/* HP VA7400 */
 	{"HP", "OPEN-", "*", BLIST_SPARSELUN | BLIST_LARGELUN}, /* HP XP Arrays */
 	{"HP", "NetRAID-4M", NULL, BLIST_FORCELUN},
-	{"HP", "HSV100", NULL, BLIST_REPORTLUN2 | BLIST_NOSTARTONADD},
+	{"HP", "HSV100", NULL, BLIST_REPORTLUN | BLIST_NOSTARTONADD},
 	{"HP", "C1557A", NULL, BLIST_FORCELUN},
 	{"HP", "C3323-300", "4269", BLIST_NOTQ},
 	{"IBM", "AuSaV1S2", NULL, BLIST_FORCELUN},
@@ -176,7 +176,7 @@
 	{"Medion", "Flash XL  MMC/SD", "2.6D", BLIST_FORCELUN},
 	{"MegaRAID", "LD", NULL, BLIST_FORCELUN},
 	{"MICROP", "4110", NULL, BLIST_NOTQ},
-	{"MYLEX", "DACARMRB", "*", BLIST_REPORTLUN2},
+	{"MYLEX", "DACARMRB", "*", BLIST_REPORTLUN},
 	{"nCipher", "Fastness Crypto", NULL, BLIST_FORCELUN},
 	{"NAKAMICH", "MJ-4.8S", NULL, BLIST_FORCELUN | BLIST_SINGLELUN},
 	{"NAKAMICH", "MJ-5.16S", NULL, BLIST_FORCELUN | BLIST_SINGLELUN},
@@ -193,7 +193,7 @@
 	{"SEAGATE", "ST3390N", "9546", BLIST_NOTQ},
 	{"SGI", "RAID3", "*", BLIST_SPARSELUN},
 	{"SGI", "RAID5", "*", BLIST_SPARSELUN},
-	{"SGI", "TP9100", "*", BLIST_REPORTLUN2},
+	{"SGI", "TP9100", "*", BLIST_REPORTLUN},
 	{"SGI", "Universal Xport", "*", BLIST_NO_ULD_ATTACH},
 	{"IBM", "Universal Xport", "*", BLIST_NO_ULD_ATTACH},
 	{"SMSC", "USB 2 HS-CF", NULL, BLIST_SPARSELUN | BLIST_INQUIRY_36},
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 19:29:12.000000000 +0200
@@ -1085,13 +1085,13 @@
 
 	/*
 	 * Only support SCSI-3 and up devices if BLIST_NOREPORTLUN is not set.
-	 * Also allow SCSI-2 if BLIST_REPORTLUN2 is set and host adapter does
-	 * support more than 8 LUNs.
+	 * Also allow SCSI-2 and SCSI-UNKNOWN if BLIST_REPORTLUN 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)) )
+	     (!(bflags & BLIST_REPORTLUN) || shost->max_lun <= 8)) )
 		return 1;
 	if (bflags & BLIST_NOLUN)
 		return 0;
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 19:37:56.000000000 +0200
@@ -21,8 +21,9 @@
 #define BLIST_MS_SKIP_PAGE_3F	0x4000	/* do not send ms page 0x3f */
 #define BLIST_USE_10_BYTE_MS	0x8000	/* use 10 byte ms before 6 byte ms */
 #define BLIST_MS_192_BYTES_FOR_3F	0x10000	/*  192 byte ms page 0x3f request */
-#define BLIST_REPORTLUN2	0x20000	/* try REPORT_LUNS even for SCSI-2 devs
- 					   (if HBA supports more than 8 LUNs) */
+#define BLIST_REPORTLUN		0x20000	/* try REPORT_LUNS even for SCSI-2 and
+					SCSI-UNKNOWN devs
+					(if HBA supports more than 8 LUNs) */
 #define BLIST_NOREPORTLUN	0x40000	/* don't try REPORT_LUNS scan (SCSI-3 devs) */
 #define BLIST_NOT_LOCKABLE	0x80000	/* don't use PREVENT-ALLOW commands */
 #define BLIST_NO_ULD_ATTACH	0x100000 /* device is actually for RAID config */

[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