Linux Kernel
3.7.1
|
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/init.h>
#include <linux/blkdev.h>
#include <linux/delay.h>
#include <linux/kthread.h>
#include <linux/spinlock.h>
#include <linux/async.h>
#include <linux/slab.h>
#include <scsi/scsi.h>
#include <scsi/scsi_cmnd.h>
#include <scsi/scsi_device.h>
#include <scsi/scsi_driver.h>
#include <scsi/scsi_devinfo.h>
#include <scsi/scsi_host.h>
#include <scsi/scsi_transport.h>
#include <scsi/scsi_eh.h>
#include "scsi_priv.h"
#include "scsi_logging.h"
Go to the source code of this file.
Data Structures | |
struct | async_scan_data |
Macros | |
#define | ALLOC_FAILURE_MSG |
#define | SCSI_TIMEOUT (2*HZ) |
#define | SCSI_UID_SER_NUM 'S' |
#define | SCSI_UID_UNKNOWN 'Z' |
#define | SCSI_SCAN_NO_RESPONSE 0 |
#define | SCSI_SCAN_TARGET_PRESENT 1 |
#define | SCSI_SCAN_LUN_PRESENT 2 |
#define | MAX_SCSI_LUNS 512 |
#define | SCSI_SCAN_TYPE_DEFAULT "sync" |
#define ALLOC_FAILURE_MSG |
Definition at line 50 of file scsi_scan.c.
#define MAX_SCSI_LUNS 512 |
Definition at line 82 of file scsi_scan.c.
#define SCSI_SCAN_LUN_PRESENT 2 |
Definition at line 78 of file scsi_scan.c.
#define SCSI_SCAN_NO_RESPONSE 0 |
Definition at line 76 of file scsi_scan.c.
#define SCSI_SCAN_TARGET_PRESENT 1 |
Definition at line 77 of file scsi_scan.c.
#define SCSI_SCAN_TYPE_DEFAULT "sync" |
Definition at line 97 of file scsi_scan.c.
#define SCSI_TIMEOUT (2*HZ) |
Definition at line 56 of file scsi_scan.c.
#define SCSI_UID_SER_NUM 'S' |
Definition at line 61 of file scsi_scan.c.
#define SCSI_UID_UNKNOWN 'Z' |
Definition at line 62 of file scsi_scan.c.
|
read |
Definition at line 1505 of file scsi_scan.c.
EXPORT_SYMBOL | ( | scsi_is_target_device | ) |
EXPORT_SYMBOL | ( | scsilun_to_int | ) |
EXPORT_SYMBOL | ( | int_to_scsilun | ) |
EXPORT_SYMBOL | ( | __scsi_add_device | ) |
EXPORT_SYMBOL | ( | scsi_add_device | ) |
EXPORT_SYMBOL | ( | scsi_rescan_device | ) |
EXPORT_SYMBOL | ( | scsi_scan_target | ) |
EXPORT_SYMBOL | ( | scsi_scan_host | ) |
EXPORT_SYMBOL | ( | scsi_get_host_dev | ) |
EXPORT_SYMBOL | ( | scsi_free_host_dev | ) |
int_to_scsilun - reverts an int into a scsi_lun : integer to be reverted : struct scsi_lun to be set.
Description: Reverts the functionality of the scsilun_to_int, which packed an 8-byte lun value into an int. This routine unpacks the int back into the lun value. Note: the scsilun_to_int() routine does not truly handle all 8bytes of the lun value. This functions restores only as much as was set by the routine.
Notes: Given an integer : 0x0b030a04, this function returns a scsi_lun of : struct scsi_lun of: 0a 04 0b 03 00 00 00 00
Definition at line 1271 of file scsi_scan.c.
MODULE_PARM_DESC | ( | max_report_luns | , |
"REPORT LUNS maximum number of LUNS received (should be"" between 1 and 16384)" | |||
) |
MODULE_PARM_DESC | ( | inq_timeout | , |
"Timeout (in seconds) waiting for devices to answer INQUIRY."" Default is 20. Some devices may need more; most need less." | |||
) |
Definition at line 1537 of file scsi_scan.c.
scsi_complete_async_scans - Wait for asynchronous scans to complete
When this function returns, any host which started scanning before this function was called will have finished its scan. Hosts which started scanning after this function was called may or may not have finished.
Definition at line 144 of file scsi_scan.c.
Definition at line 1884 of file scsi_scan.c.
void scsi_free_host_dev | ( | struct scsi_device * | sdev | ) |
scsi_free_host_dev - Free a scsi_device that points to the host adapter itself : Host device to be freed
Lock status: None assumed.
Returns: Nothing
Definition at line 1950 of file scsi_scan.c.
|
read |
scsi_get_host_dev - Create a scsi_device that points to the host adapter itself : Host that needs a scsi_device
Lock status: None assumed.
Returns: The scsi_device or NULL
Notes: Attach a single scsi_device to the Scsi_Host - this should be made to look like a "pseudo-device" that points to the HA itself.
Note - this device is not accessible from any high-level drivers (including generics), which is probably not optimal. We can add hooks later to attach.
Definition at line 1918 of file scsi_scan.c.
Definition at line 1550 of file scsi_scan.c.
scsi_scan_host - scan the given adapter : adapter to scan
Definition at line 1859 of file scsi_scan.c.
int scsi_scan_host_selected | ( | struct Scsi_Host * | shost, |
unsigned int | channel, | ||
unsigned int | id, | ||
unsigned int | lun, | ||
int | rescan | ||
) |
Definition at line 1683 of file scsi_scan.c.
void scsi_scan_target | ( | struct device * | parent, |
unsigned int | channel, | ||
unsigned int | id, | ||
unsigned int | lun, | ||
int | rescan | ||
) |
scsi_scan_target - scan a target id, possibly including all LUNs on the target. : host to scan : channel to scan : target id to scan : Specific LUN to scan or SCAN_WILD_CARD : passed to LUN scanning routines
Description: Scan the target id on , , and . Scan at least LUN 0, and possibly all LUNs on the target id.
First try a REPORT LUN scan, if that does not scan the target, do a sequential scan of LUNs on the target id.
Definition at line 1632 of file scsi_scan.c.
void scsi_target_reap | ( | struct scsi_target * | starget | ) |
scsi_target_reap - check to see if target is in use and destroy if not : target to be checked
This is used after removing a LUN or doing a last put of the target it checks atomically that nothing is using the target and removes it if so.
Definition at line 475 of file scsi_scan.c.
scsilun_to_int - convert a scsi_lun to an int : struct scsi_lun to be converted.
Description: Convert from a struct scsi_lun to a four byte host byte-ordered integer, and return the result. The caller must check for truncation before using this function.
Notes: The struct scsi_lun is assumed to be four levels, with each level effectively containing a SCSI byte-ordered (big endian) short; the addressing bits of each level are ignored (the highest two bits). For a description of the LUN format, post SCSI-3 see the SCSI Architecture Model, for SCSI-3 see the SCSI Controller Commands.
Given a struct scsi_lun of: 0a 04 0b 03 00 00 00 00, this function returns the integer: 0x0b030a04
Definition at line 1240 of file scsi_scan.c.