/*
* scsi_scan.c
*
* Copyright (C) 2000 Eric Youngdale,
* Copyright (C) 2002 Patrick Mansfield
*
* The general scanning/probing algorithm is as follows, exceptions are
* made to it depending on device specific flags, compilation options, and
* global variable (boot or module load time) settings.
*
* A specific LUN is scanned via an INQUIRY command; if the LUN has a
* device attached, a scsi_device is allocated and setup for it.
*
* For every id of every channel on the given host:
*
* Scan LUN 0; if the target responds to LUN 0 (even if there is no
* device or storage attached to LUN 0):
*
* If LUN 0 has a device attached, allocate and setup a
* scsi_device for it.
*
* If target is SCSI-3 or up, issue a REPORT LUN, and scan
* all of the LUNs returned by the REPORT LUN; else,
* sequentially scan LUNs up until some maximum is reached,
* or a LUN is seen that cannot have a device attached to it.
*/
#include <linux/config.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/init.h>
#include <linux/blkdev.h>
#include <asm/semaphore.h>
#include <scsi/scsi.h>
#include <scsi/scsi_device.h>
#include <scsi/scsi_driver.h>
#include <scsi/scsi_devinfo.h>
#include <scsi/scsi_host.h>
#include <scsi/scsi_request.h>
#include <scsi/scsi_transport.h>
#include <scsi/scsi_eh.h>
#include "scsi_priv.h"
#include "scsi_logging.h"
#define ALLOC_FAILURE_MSG KERN_ERR "%s: Allocation failure during" \
" SCSI scanning, some SCSI devices