--- scsi.c.org Wed Jun 14 12:32:07 2000 +++ scsi.c Sat Jun 17 00:02:23 2000 @@ -114,6 +114,7 @@ #define BLIST_MAX5LUN 0x080 #define BLIST_ISDISK 0x100 #define BLIST_ISROM 0x200 +#define BLIST_GHOST 0x400 /* * Data declarations. @@ -308,6 +309,14 @@ {"iomega","jaz 1GB","J.86", BLIST_NOTQ | BLIST_NOLUN}, {"TOSHIBA","CDROM","*", BLIST_ISROM}, {"MegaRAID", "LD", "*", BLIST_FORCELUN}, + +{"CREATIVE","DVD-RAM RAM","*", BLIST_GHOST}, +{"MATSHITA","PD-2 LF-D100","*", BLIST_GHOST}, +{"AOpen","PD-2 DVD-520S","*", BLIST_GHOST}, +{"HITACHI","GF-1050","*", BLIST_GHOST}, /* Hitachi SCSI DVD-RAM */ +{"TOSHIBA","DVD-RAM SD-W1101","*", BLIST_GHOST}, +{"TOSHIBA","DVD-RAM SD-W1111","*", BLIST_GHOST}, +{"MATSHITA","DVD-RAM LF-D200","*", BLIST_GHOST}, + /* * Must be at end of list... */ @@ -670,6 +679,8 @@ struct Scsi_Device_Template *sdtpnt; Scsi_Device * SDtail, *SDpnt=*SDpnt2; int bflags, type=-1; + static int ghost_channel=-1, ghost_dev=-1; + int org_lun = lun; SDpnt->host = shpnt; SDpnt->id = dev; @@ -677,6 +688,12 @@ SDpnt->channel = channel; SDpnt->online = TRUE; + if ((channel == ghost_channel) && (dev == ghost_dev) && (lun == 1)) { + SDpnt->lun = lun = 0; + } else { + ghost_channel = ghost_dev = -1; + } + /* Some low level driver could use device->type (DB) */ SDpnt->type = -1; @@ -789,6 +806,17 @@ scsi_result[1] |= 0x80; /* removable */ } + if (bflags & BLIST_GHOST) { + if ((ghost_channel == channel) && (ghost_dev == dev) && (org_lun == 1)) { + lun=1; + } else { + ghost_channel = channel; + ghost_dev = dev; + scsi_result[0] = TYPE_MOD; + scsi_result[1] |= 0x80; /* removable */ + } + } + memcpy (SDpnt->vendor, scsi_result + 8, 8); memcpy (SDpnt->model, scsi_result + 16, 16); memcpy (SDpnt->rev, scsi_result + 32, 4); @@ -973,6 +1001,15 @@ */ if (bflags & BLIST_FORCELUN) { *max_dev_lun = 8; + return 1; + } + + /* + * If this device is Ghosted, scan upto two luns. (It physically only + * has one). -- REW + */ + if (bflags & BLIST_GHOST) { + *max_dev_lun = 2; return 1; }