#include <linux/module.h>
#include <linux/slab.h>
#include <linux/init.h>
#include <linux/blkdev.h>
#include <linux/device.h>
#include <linux/pm_runtime.h>
#include <scsi/scsi.h>
#include <scsi/scsi_device.h>
#include <scsi/scsi_host.h>
#include <scsi/scsi_tcq.h>
#include <scsi/scsi_transport.h>
#include <scsi/scsi_driver.h>
#include "scsi_priv.h"
#include "scsi_logging.h"
Go to the source code of this file.
|
#define | shost_show_function(name, field, format_string) |
|
#define | shost_rd_attr2(name, field, format_string) |
|
#define | shost_rd_attr(field, format_string) shost_rd_attr2(field, field, format_string) |
|
#define | sdev_show_function(field, format_string) |
|
#define | sdev_rd_attr(field, format_string) |
|
#define | sdev_rw_attr(field, format_string) |
|
#define | show_sdev_iostat(field) |
|
#define | DECLARE_EVT_SHOW(name, Cap_name) |
|
#define | DECLARE_EVT_STORE(name, Cap_name) |
|
#define | DECLARE_EVT(name, Cap_name) |
|
#define | REF_EVT(name) &dev_attr_evt_##name.attr |
|
|
const char * | scsi_device_state_name (enum scsi_device_state state) |
|
const char * | scsi_host_state_name (enum scsi_host_state state) |
|
| shost_rd_attr (unique_id,"%u\n") |
|
| shost_rd_attr (host_busy,"%hu\n") |
|
| shost_rd_attr (cmd_per_lun,"%hd\n") |
|
| shost_rd_attr (can_queue,"%hd\n") |
|
| shost_rd_attr (sg_tablesize,"%hu\n") |
|
| shost_rd_attr (sg_prot_tablesize,"%hu\n") |
|
| shost_rd_attr (unchecked_isa_dma,"%d\n") |
|
| shost_rd_attr (prot_capabilities,"%u\n") |
|
| shost_rd_attr (prot_guard_type,"%hd\n") |
|
| shost_rd_attr2 (proc_name, hostt->proc_name,"%s\n") |
|
| EXPORT_SYMBOL_GPL (scsi_bus_type) |
|
int | scsi_sysfs_register (void) |
|
void | scsi_sysfs_unregister (void) |
|
| sdev_rd_attr (device_blocked,"%d\n") |
|
| sdev_rd_attr (queue_depth,"%d\n") |
|
| sdev_rd_attr (type,"%d\n") |
|
| sdev_rd_attr (scsi_level,"%d\n") |
|
| sdev_rd_attr (vendor,"%.8s\n") |
|
| sdev_rd_attr (model,"%.16s\n") |
|
| sdev_rd_attr (rev,"%.4s\n") |
|
| show_sdev_iostat (iorequest_cnt) |
|
| show_sdev_iostat (iodone_cnt) |
|
| show_sdev_iostat (ioerr_cnt) |
|
int | scsi_sysfs_add_sdev (struct scsi_device *sdev) |
|
void | __scsi_remove_device (struct scsi_device *sdev) |
|
void | scsi_remove_device (struct scsi_device *sdev) |
|
| EXPORT_SYMBOL (scsi_remove_device) |
|
void | scsi_remove_target (struct device *dev) |
|
| EXPORT_SYMBOL (scsi_remove_target) |
|
int | scsi_register_driver (struct device_driver *drv) |
|
| EXPORT_SYMBOL (scsi_register_driver) |
|
int | scsi_register_interface (struct class_interface *intf) |
|
| EXPORT_SYMBOL (scsi_register_interface) |
|
int | scsi_sysfs_add_host (struct Scsi_Host *shost) |
|
void | scsi_sysfs_device_initialize (struct scsi_device *sdev) |
|
int | scsi_is_sdev_device (const struct device *dev) |
|
| EXPORT_SYMBOL (scsi_is_sdev_device) |
|
#define DECLARE_EVT |
( |
|
name, |
|
|
|
Cap_name |
|
) |
| |
Value:
DECLARE_EVT_STORE(
name, Cap_name) \
sdev_store_evt_##name);
Definition at line 708 of file scsi_sysfs.c.
#define DECLARE_EVT_SHOW |
( |
|
name, |
|
|
|
Cap_name |
|
) |
| |
Value:static ssize_t \
int
val =
test_bit(SDEV_EVT_##Cap_name, sdev->supported_events);\
}
Definition at line 682 of file scsi_sysfs.c.
#define DECLARE_EVT_STORE |
( |
|
name, |
|
|
|
Cap_name |
|
) |
| |
Value:static ssize_t \
if (val == 0) \
clear_bit(SDEV_EVT_##Cap_name, sdev->supported_events); \
else if (val == 1) \
set_bit(SDEV_EVT_##Cap_name, sdev->supported_events); \
else \
}
Definition at line 692 of file scsi_sysfs.c.
#define sdev_rd_attr |
( |
|
field, |
|
|
|
format_string |
|
) |
| |
#define sdev_rw_attr |
( |
|
field, |
|
|
|
format_string |
|
) |
| |
Value:
\
static ssize_t \
sscanf (
buf, format_string, &sdev->field); \
} \
Definition at line 473 of file scsi_sysfs.c.
#define sdev_show_function |
( |
|
field, |
|
|
|
format_string |
|
) |
| |
#define shost_rd_attr2 |
( |
|
name, |
|
|
|
field, |
|
|
|
format_string |
|
) |
| |
#define shost_show_function |
( |
|
name, |
|
|
|
field, |
|
|
|
format_string |
|
) |
| |
#define show_sdev_iostat |
( |
|
field | ) |
|
scsi_remove_target - try to remove a target and all its devices : generic starget or parent of generic stargets to be removed
Note: This is slightly racy. It is possible that if the user requests the addition of another device then the target won't be removed.
Definition at line 1031 of file scsi_sysfs.c.
scsi_sysfs_add_host - add scsi host to subsystem : scsi host struct to add to subsystem
Definition at line 1082 of file scsi_sysfs.c.
scsi_sysfs_add_sdev - add scsi device to sysfs : scsi_device to add
Return value: 0 on Success / non-zero on Failure
Definition at line 870 of file scsi_sysfs.c.
sdev_rd_attr |
( |
type |
, |
|
|
"%d\n" |
|
|
) |
| |
sdev_rd_attr |
( |
vendor |
, |
|
|
"%.8s\n" |
|
|
) |
| |
sdev_rd_attr |
( |
model |
, |
|
|
"%.16s\n" |
|
|
) |
| |
sdev_rd_attr |
( |
rev |
, |
|
|
"%.4s\n" |
|
|
) |
| |
shost_rd_attr |
( |
host_busy |
, |
|
|
"%hu\n" |
|
|
) |
| |
shost_rd_attr |
( |
cmd_per_lun |
, |
|
|
"%hd\n" |
|
|
) |
| |
shost_rd_attr |
( |
sg_tablesize |
, |
|
|
"%hu\n" |
|
|
) |
| |
shost_rd_attr |
( |
sg_prot_tablesize |
, |
|
|
"%hu\n" |
|
|
) |
| |
shost_rd_attr |
( |
unchecked_isa_dma |
, |
|
|
"%d\n" |
|
|
) |
| |
shost_rd_attr |
( |
prot_capabilities |
, |
|
|
"%u\n" |
|
|
) |
| |
shost_rd_attr |
( |
prot_guard_type |
, |
|
|
"%hd\n" |
|
|
) |
| |
shost_rd_attr2 |
( |
proc_name |
, |
|
|
hostt-> |
proc_name, |
|
|
"%s\n" |
|
|
) |
| |
Initial value:= {
.name = "scsi",
.match = scsi_bus_match,
.uevent = scsi_bus_uevent,
}
Definition at line 416 of file scsi_sysfs.c.
Initial value:= {
.attrs = scsi_sysfs_shost_attrs,
}
Definition at line 317 of file scsi_sysfs.c.