Linux Kernel
3.7.1
|
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/kernel.h>
#include <linux/timer.h>
#include <linux/string.h>
#include <linux/slab.h>
#include <linux/blkdev.h>
#include <linux/delay.h>
#include <linux/init.h>
#include <linux/completion.h>
#include <linux/unistd.h>
#include <linux/spinlock.h>
#include <linux/kmod.h>
#include <linux/interrupt.h>
#include <linux/notifier.h>
#include <linux/cpu.h>
#include <linux/mutex.h>
#include <linux/async.h>
#include <asm/unaligned.h>
#include <scsi/scsi.h>
#include <scsi/scsi_cmnd.h>
#include <scsi/scsi_dbg.h>
#include <scsi/scsi_device.h>
#include <scsi/scsi_driver.h>
#include <scsi/scsi_eh.h>
#include <scsi/scsi_host.h>
#include <scsi/scsi_tcq.h>
#include "scsi_priv.h"
#include "scsi_logging.h"
#include <trace/events/scsi.h>
Go to the source code of this file.
Data Structures | |
struct | scsi_host_cmd_pool |
Macros | |
#define | CREATE_TRACE_POINTS |
#define | MIN_RESET_DELAY (2*HZ) |
#define | MIN_RESET_PERIOD (15*HZ) |
Variables | |
unsigned int | scsi_logging_level |
|
read |
__scsi_device_lookup - find a device given the host (UNLOCKED) : SCSI host pointer : SCSI channel (zero if only one channel) : SCSI target number (physical unit number) : SCSI Logical Unit Number
Description: Looks up the scsi_device with the specified , , for a given host. The returned scsi_device does not have an additional reference. You must hold the host's host_lock over this call and any access to the returned scsi_device.
Note: The only reason why drivers would want to use this is because they need to access the device list in irq context. Otherwise you really want to use scsi_device_lookup instead.
|
read |
__scsi_device_lookup_by_target - find a device given the target (UNLOCKED) : SCSI target pointer : SCSI Logical Unit Number
Description: Looks up the scsi_device with the specified for a given . The returned scsi_device does not have an additional reference. You must hold the host's host_lock over this call and any access to the returned scsi_device. A scsi_device in state SDEV_DEL is skipped.
Note: The only reason why drivers should use this is because they need to access the device list in irq context. Otherwise you really want to use scsi_device_lookup_by_target instead.
|
read |
void __starget_for_each_device | ( | struct scsi_target * | starget, |
void * | data, | ||
void(*)(struct scsi_device *, void *) | fn | ||
) |
ASYNC_DOMAIN | ( | scsi_sd_probe_domain | ) |
EXPORT_SYMBOL | ( | scsi_sd_probe_domain | ) |
EXPORT_SYMBOL | ( | scsi_device_type | ) |
EXPORT_SYMBOL | ( | scsi_get_command | ) |
EXPORT_SYMBOL | ( | __scsi_put_command | ) |
EXPORT_SYMBOL | ( | scsi_put_command | ) |
EXPORT_SYMBOL | ( | scsi_allocate_command | ) |
EXPORT_SYMBOL | ( | scsi_free_command | ) |
EXPORT_SYMBOL | ( | scsi_cmd_get_serial | ) |
EXPORT_SYMBOL | ( | scsi_finish_command | ) |
EXPORT_SYMBOL | ( | scsi_adjust_queue_depth | ) |
EXPORT_SYMBOL | ( | scsi_track_queue_full | ) |
EXPORT_SYMBOL | ( | scsi_report_opcode | ) |
EXPORT_SYMBOL | ( | scsi_device_get | ) |
EXPORT_SYMBOL | ( | scsi_device_put | ) |
EXPORT_SYMBOL | ( | __scsi_iterate_devices | ) |
EXPORT_SYMBOL | ( | starget_for_each_device | ) |
EXPORT_SYMBOL | ( | __starget_for_each_device | ) |
EXPORT_SYMBOL | ( | __scsi_device_lookup_by_target | ) |
EXPORT_SYMBOL | ( | scsi_device_lookup_by_target | ) |
EXPORT_SYMBOL | ( | __scsi_device_lookup | ) |
EXPORT_SYMBOL | ( | scsi_device_lookup | ) |
EXPORT_SYMBOL_GPL | ( | __scsi_get_command | ) |
EXPORT_SYMBOL_GPL | ( | scsi_get_vpd_page | ) |
MODULE_DESCRIPTION | ( | "SCSI core" | ) |
module_exit | ( | exit_scsi | ) |
MODULE_LICENSE | ( | "GPL" | ) |
module_param | ( | scsi_logging_level | , |
int | , | ||
S_IRUGO| | S_IWUSR | ||
) |
MODULE_PARM_DESC | ( | scsi_logging_level | , |
"a bit mask of logging levels" | |||
) |
void scsi_adjust_queue_depth | ( | struct scsi_device * | sdev, |
int | tagged, | ||
int | tags | ||
) |
scsi_adjust_queue_depth - Let low level drivers change a device's queue depth : SCSI Device in question : Do we use tagged queueing (non-0) or do we treat this device as an untagged device (0) : Number of tags allowed if tagged queueing enabled, or number of commands the low level driver can queue up in non-tagged mode (as per cmd_per_lun).
Returns: Nothing
Lock Status: None held on entry
Notes: Low level drivers may call this at any time and we will do the right thing depending on whether or not the device is currently active and whether or not it even has the command blocks built yet.
scsi_allocate_command - get a fully allocated SCSI command : allocation mask
This function is for use outside of the normal host based pools. It allocates the relevant command and takes an additional reference on the pool it used. This function must be paired with scsi_free_command which also has the identical mask, otherwise the free pool counts will eventually go wrong and you'll trigger a bug.
This function should only be used by drivers that need a static command allocation at start of day for internal functions.
int scsi_device_get | ( | struct scsi_device * | sdev | ) |
scsi_device_get - get an additional reference to a scsi_device : device to get a reference to
Description: Gets a reference to the scsi_device and increments the use count of the underlying LLDD module. You must hold host_lock of the parent Scsi_Host or already have a reference when calling this.
|
read |
scsi_device_lookup - find a device given the host : SCSI host pointer : SCSI channel (zero if only one channel) : SCSI target number (physical unit number) : SCSI Logical Unit Number
Description: Looks up the scsi_device with the specified , , for a given host. The returned scsi_device has an additional reference that needs to be released with scsi_device_put once you're done with it.
|
read |
scsi_device_lookup_by_target - find a device given the target : SCSI target pointer : SCSI Logical Unit Number
Description: Looks up the scsi_device with the specified for a given . The returned scsi_device has an additional reference that needs to be released with scsi_device_put once you're done with it.
void scsi_device_put | ( | struct scsi_device * | sdev | ) |
scsi_device_put - release a reference to a scsi_device : device to release a reference on.
Description: Release a reference to the scsi_device and decrements the use count of the underlying LLDD module. The device is freed once the last user vanishes.
scsi_free_command - free a command allocated by scsi_allocate_command : mask used in the original allocation : command to free
Note: using the original allocation mask is vital because that's what determines which command pool we use to free the command. Any mismatch will cause the system to BUG eventually.
|
read |
int scsi_report_opcode | ( | struct scsi_device * | sdev, |
unsigned char * | buffer, | ||
unsigned int | len, | ||
unsigned char | opcode | ||
) |
scsi_report_opcode - Find out if a given command opcode is supported : scsi device to query : scratch buffer (must be at least 20 bytes long) : length of buffer : opcode for command to look up
Uses the REPORT SUPPORTED OPERATION CODES to look up the given opcode. Returns 0 if RSOC fails or if the command opcode is unsupported. Returns 1 if the device claims to support the command.
scsi_setup_command_freelist - Setup the command freelist for a scsi host. : host to allocate the freelist for.
Description: The command freelist protects against system-wide out of memory deadlock by preallocating one SCSI command structure for each host, so the system can always write to a swap file on a device associated with that host.
Returns: Nothing.
int scsi_track_queue_full | ( | struct scsi_device * | sdev, |
int | depth | ||
) |
scsi_track_queue_full - track QUEUE_FULL events to adjust queue depth : SCSI Device in question : Current number of outstanding SCSI commands on this device, not counting the one returned as QUEUE_FULL.
Description: This function will track successive QUEUE_FULL events on a specific SCSI device to determine if and when there is a need to adjust the queue depth on the device.
Returns: 0 - No change needed, >0 - Adjust queue depth to this new depth, -1 - Drop back to untagged operation using host->cmd_per_lun as the untagged command depth
Lock Status: None held on entry
Notes: Low level drivers may call this at any time and we will do "The Right Thing." We are interrupt context safe.
void starget_for_each_device | ( | struct scsi_target * | starget, |
void * | data, | ||
void(*)(struct scsi_device *, void *) | fn | ||
) |
subsys_initcall | ( | init_scsi | ) |