summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1999-06-17 13:25:08 +0000
committerRalf Baechle <ralf@linux-mips.org>1999-06-17 13:25:08 +0000
commit59223edaa18759982db0a8aced0e77457d10c68e (patch)
tree89354903b01fa0a447bffeefe00df3044495db2e /drivers/scsi/scsi.c
parentdb7d4daea91e105e3859cf461d7e53b9b77454b2 (diff)
Merge with Linux 2.3.6. Sorry, this isn't tested on silicon, I don't
have a MIPS box at hand.
Diffstat (limited to 'drivers/scsi/scsi.c')
-rw-r--r--drivers/scsi/scsi.c30
1 files changed, 23 insertions, 7 deletions
diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c
index 25490f2ad..28d204e30 100644
--- a/drivers/scsi/scsi.c
+++ b/drivers/scsi/scsi.c
@@ -109,6 +109,7 @@ static const char RCSid[] = "$Header: /vger/u4/cvs/linux/drivers/scsi/scsi.c,v 1
#define BLIST_SINGLELUN 0x10
#define BLIST_NOTQ 0x20
#define BLIST_SPARSELUN 0x40
+#define BLIST_MAX5LUN 0x80
/*
* Data declarations.
@@ -262,6 +263,7 @@ static struct dev_info device_list[] =
{"HP", "C1790A", "", BLIST_NOLUN}, /* scanjet iip */
{"HP", "C2500A", "", BLIST_NOLUN}, /* scanjet iicx */
{"YAMAHA", "CDR102", "1.00", BLIST_NOLUN}, /* extra reset */
+{"RELISYS", "Scorpio", "*", BLIST_NOLUN}, /* responds to all LUN */
/*
* Other types of devices that have special flags.
@@ -273,6 +275,7 @@ static struct dev_info device_list[] =
{"INSITE","I325VM","*", BLIST_KEY},
{"NRC","MBR-7","*", BLIST_FORCELUN | BLIST_SINGLELUN},
{"NRC","MBR-7.4","*", BLIST_FORCELUN | BLIST_SINGLELUN},
+{"REGAL","CDC-4X","*", BLIST_MAX5LUN | BLIST_SINGLELUN},
{"NAKAMICH","MJ-4.8S","*", BLIST_FORCELUN | BLIST_SINGLELUN},
{"NAKAMICH","MJ-5.16S","*", BLIST_FORCELUN | BLIST_SINGLELUN},
{"PIONEER","CD-ROM DRM-600","*", BLIST_FORCELUN | BLIST_SINGLELUN},
@@ -477,6 +480,8 @@ static void scan_scsis (struct Scsi_Host *shpnt,
SDpnt->host = shpnt;
SDpnt->online = TRUE;
+ init_waitqueue_head(&SDpnt->device_wait);
+
/*
* Next, hook the device to the host in question.
*/
@@ -664,13 +669,13 @@ int scan_scsis_single (int channel, int dev, int lun, int *max_dev_lun,
SCpnt->lun = SDpnt->lun;
SCpnt->channel = SDpnt->channel;
{
- struct semaphore sem = MUTEX_LOCKED;
+ DECLARE_MUTEX_LOCKED(sem);
SCpnt->request.sem = &sem;
SCpnt->request.rq_status = RQ_SCSI_BUSY;
spin_lock_irq(&io_request_lock);
scsi_do_cmd (SCpnt, (void *) scsi_cmd,
- (void *) scsi_result,
- 256, scan_scsis_done, SCSI_TIMEOUT + 4 * HZ, 5);
+ (void *) NULL,
+ 0, scan_scsis_done, SCSI_TIMEOUT + 4 * HZ, 5);
spin_unlock_irq(&io_request_lock);
down (&sem);
SCpnt->request.sem = NULL;
@@ -707,7 +712,7 @@ int scan_scsis_single (int channel, int dev, int lun, int *max_dev_lun,
scsi_cmd[5] = 0;
SCpnt->cmd_len = 0;
{
- struct semaphore sem = MUTEX_LOCKED;
+ DECLARE_MUTEX_LOCKED(sem);
SCpnt->request.sem = &sem;
SCpnt->request.rq_status = RQ_SCSI_BUSY;
spin_lock_irq(&io_request_lock);
@@ -853,7 +858,7 @@ int scan_scsis_single (int channel, int dev, int lun, int *max_dev_lun,
scsi_cmd[5] = 0;
SCpnt->cmd_len = 0;
{
- struct semaphore sem = MUTEX_LOCKED;
+ DECLARE_MUTEX_LOCKED(sem);
SCpnt->request.rq_status = RQ_SCSI_BUSY;
SCpnt->request.sem = &sem;
spin_lock_irq(&io_request_lock);
@@ -894,6 +899,8 @@ int scan_scsis_single (int channel, int dev, int lun, int *max_dev_lun,
SDpnt->device_queue = SCpnt;
SDpnt->online = TRUE;
+ init_waitqueue_head(&SDpnt->device_wait);
+
/*
* Since we just found one device, there had damn well better be one in the list
* already.
@@ -936,6 +943,15 @@ int scan_scsis_single (int channel, int dev, int lun, int *max_dev_lun,
*max_dev_lun = 8;
return 1;
}
+
+ /*
+ * REGAL CDC-4X: avoid hang after LUN 4
+ */
+ if (bflags & BLIST_MAX5LUN) {
+ *max_dev_lun = 5;
+ return 1;
+ }
+
/*
* We assume the device can't handle lun!=0 if: - it reports scsi-0 (ANSI
* SCSI Revision 0) (old drives like MAXTOR XT-3280) or - it reports scsi-1
@@ -2643,7 +2659,7 @@ static int scsi_register_host(Scsi_Host_Template * tpnt)
{
if( shpnt->hostt == tpnt && shpnt->hostt->use_new_eh_code )
{
- struct semaphore sem = MUTEX_LOCKED;
+ DECLARE_MUTEX_LOCKED(sem);
shpnt->eh_notify = &sem;
kernel_thread((int (*)(void *))scsi_error_handler,
@@ -2880,7 +2896,7 @@ static void scsi_unregister_host(Scsi_Host_Template * tpnt)
&& shpnt->hostt->use_new_eh_code
&& shpnt->ehandler != NULL )
{
- struct semaphore sem = MUTEX_LOCKED;
+ DECLARE_MUTEX_LOCKED(sem);
shpnt->eh_notify = &sem;
send_sig(SIGKILL, shpnt->ehandler, 1);