diff -uNr linux-2.4.19.S1.sdm6.sgm4/drivers/scsi/scsi_scan.c linux-2.4.19.S1.sdm6.sgm4.largelun/drivers/scsi/scsi_scan.c --- linux-2.4.19.S1.sdm6.sgm4/drivers/scsi/scsi_scan.c Wed Aug 7 01:16:34 2002 +++ linux-2.4.19.S1.sdm6.sgm4.largelun/drivers/scsi/scsi_scan.c Tue Aug 13 11:57:28 2002 @@ -196,11 +196,39 @@ static unsigned int max_scsi_luns = 1; #endif +#define MAX_LLUN_BLKLEN 8 +static int llun_blklst[3*MAX_LLUN_BLKLEN] = { + -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1 }; + +static inline int is_on_llun_blklst (int hostno, int channel, int target) +{ + int i; + for (i = 0; i < MAX_LLUN_BLKLEN; ++i) { + if (llun_blklst[i*3] == -1) + break; + if (llun_blklst[i*3+0] == hostno && + llun_blklst[i*3+1] == channel && + llun_blklst[i*3+2] == target) { + printk (KERN_DEBUG "Found c%ib%it%i on llun_blklst\n", + hostno, channel, target); + return 1; + } + } + return 0; +} + + #ifdef MODULE MODULE_PARM(max_scsi_luns, "i"); MODULE_PARM_DESC(max_scsi_luns, "last scsi LUN (should be between 1 and 2^32-1)"); +MODULE_PARM(llun_blklst, "3-24i"); +MODULE_PARM_DESC(llun_blklst, "SCSI-2 devs (C,B,T) that need large luns support"); + #else static int __init scsi_luns_setup(char *str) @@ -219,6 +247,30 @@ __setup("max_scsi_luns=", scsi_luns_setup); +static int __init llun_blklst_setup(char *str) +{ + unsigned int tmp; + int i = 0; + do { + int rc; + if (get_option(&str, &tmp) == 2) + llun_blklst[i++] = tmp; + else + break; + if (get_option(&str, &tmp) == 2) + llun_blklst[i++] = tmp; + else + break; + if ((rc = get_option(&str, &tmp)) >= 1) + llun_blklst[i++] = tmp; + if (rc != 2) + break; + } while (1); + return i; +} + +__setup("llun_blklst=", llun_blklst_setup); + #endif static void print_inquiry(unsigned char *data) @@ -453,7 +505,8 @@ break; /* break means don't probe further for luns!=0 */ if (SDpnt && (0 == lun)) { int bflags = get_device_flags (scsi_result); - if (bflags & BLIST_LARGELUN) + if (bflags & BLIST_LARGELUN || + is_on_llun_blklst (shpnt->host_no, channel, order_dev)) lun0_sl = SCSI_3; /* treat as SCSI 3 */ else lun0_sl = SDpnt->scsi_level; @@ -609,7 +662,8 @@ */ bflags = get_device_flags (scsi_result); - if (bflags & BLIST_SPARSELUN) { + if (bflags & BLIST_SPARSELUN || + is_on_llun_blklst (shpnt->host_no, channel, dev)) { *sparse_lun = 1; } /* @@ -828,7 +882,8 @@ * If this device is known to support sparse multiple units, override the * other settings, and scan all of them. */ - if (bflags & BLIST_SPARSELUN) { + if (bflags & BLIST_SPARSELUN || + is_on_llun_blklst (shpnt->host_no, channel, dev)) { *max_dev_lun = shpnt->max_lun; *sparse_lun = 1; return 1;