Linux Kernel
3.7.1
|
#include <linux/init.h>
#include <linux/module.h>
#include <linux/jiffies.h>
#include <linux/err.h>
#include <linux/slab.h>
#include <linux/string.h>
#include <linux/blkdev.h>
#include <linux/bsg.h>
#include <scsi/scsi.h>
#include <scsi/scsi_device.h>
#include <scsi/scsi_host.h>
#include <scsi/scsi_transport.h>
#include <scsi/scsi_transport_sas.h>
#include "scsi_sas_internal.h"
Go to the source code of this file.
Data Structures | |
struct | sas_host_attrs |
Variables | |
sas_protocol_names [] | |
sas_linkspeed_names [] | |
#define BUF_SIZE 64 |
Definition at line 1270 of file scsi_transport_sas.c.
#define sas_bitfield_name_match | ( | title, | |
table | |||
) |
Definition at line 65 of file scsi_transport_sas.c.
#define sas_bitfield_name_search | ( | title, | |
table | |||
) |
Definition at line 102 of file scsi_transport_sas.c.
#define sas_bitfield_name_set | ( | title, | |
table | |||
) |
Definition at line 84 of file scsi_transport_sas.c.
#define SAS_DEVICE_ATTR | ( | _prefix, | |
_name, | |||
_mode, | |||
_show, | |||
_store | |||
) |
Definition at line 56 of file scsi_transport_sas.c.
Definition at line 1310 of file scsi_transport_sas.c.
Definition at line 1321 of file scsi_transport_sas.c.
Definition at line 1339 of file scsi_transport_sas.c.
Definition at line 1350 of file scsi_transport_sas.c.
#define sas_phy_linkerror_attr | ( | field | ) |
Definition at line 542 of file scsi_transport_sas.c.
#define sas_phy_linkspeed_attr | ( | field | ) |
Definition at line 521 of file scsi_transport_sas.c.
#define sas_phy_linkspeed_rw_attr | ( | field | ) |
Definition at line 515 of file scsi_transport_sas.c.
Definition at line 478 of file scsi_transport_sas.c.
#define sas_phy_show_linkerror | ( | field | ) |
Definition at line 526 of file scsi_transport_sas.c.
#define sas_phy_show_linkspeed | ( | field | ) |
Definition at line 482 of file scsi_transport_sas.c.
Definition at line 466 of file scsi_transport_sas.c.
Definition at line 462 of file scsi_transport_sas.c.
#define sas_phy_store_linkspeed | ( | field | ) |
Definition at line 493 of file scsi_transport_sas.c.
Definition at line 829 of file scsi_transport_sas.c.
Definition at line 1193 of file scsi_transport_sas.c.
Definition at line 1181 of file scsi_transport_sas.c.
Definition at line 1166 of file scsi_transport_sas.c.
Definition at line 1176 of file scsi_transport_sas.c.
#define SETUP_END_DEV_ATTRIBUTE | ( | field | ) | SETUP_TEMPLATE(end_dev_attrs, field, S_IRUGO, 1) |
Definition at line 1782 of file scsi_transport_sas.c.
#define SETUP_EXPANDER_ATTRIBUTE | ( | field | ) | SETUP_TEMPLATE(expander_attrs, expander_##field, S_IRUGO, 1) |
Definition at line 1785 of file scsi_transport_sas.c.
#define SETUP_OPTIONAL_PHY_ATTRIBUTE | ( | field, | |
func | |||
) | SETUP_TEMPLATE(phy_attrs, field, S_IRUGO, i->f->func) |
Definition at line 1773 of file scsi_transport_sas.c.
Definition at line 1766 of file scsi_transport_sas.c.
#define SETUP_OPTIONAL_PHY_ATTRIBUTE_WRONLY | ( | field, | |
func | |||
) | SETUP_TEMPLATE(phy_attrs, field, S_IWUSR, i->f->func) |
Definition at line 1779 of file scsi_transport_sas.c.
#define SETUP_OPTIONAL_RPORT_ATTRIBUTE | ( | field, | |
func | |||
) | SETUP_TEMPLATE(rphy_attrs, field, S_IRUGO, i->f->func) |
Definition at line 1756 of file scsi_transport_sas.c.
#define SETUP_PHY_ATTRIBUTE | ( | field | ) | SETUP_TEMPLATE(phy_attrs, field, S_IRUGO, 1) |
Definition at line 1759 of file scsi_transport_sas.c.
#define SETUP_PHY_ATTRIBUTE_RW | ( | field | ) |
Definition at line 1762 of file scsi_transport_sas.c.
#define SETUP_PHY_ATTRIBUTE_WRONLY | ( | field | ) | SETUP_TEMPLATE(phy_attrs, field, S_IWUSR, 1) |
Definition at line 1776 of file scsi_transport_sas.c.
#define SETUP_PORT_ATTRIBUTE | ( | field | ) | SETUP_TEMPLATE(port_attrs, field, S_IRUGO, 1) |
Definition at line 1770 of file scsi_transport_sas.c.
#define SETUP_RPORT_ATTRIBUTE | ( | field | ) | SETUP_TEMPLATE(rphy_attrs, field, S_IRUGO, 1) |
Definition at line 1753 of file scsi_transport_sas.c.
Definition at line 1742 of file scsi_transport_sas.c.
#define to_sas_host_attrs | ( | host | ) | ((struct sas_host_attrs *)(host)->shost_data) |
Definition at line 50 of file scsi_transport_sas.c.
EXPORT_SYMBOL | ( | sas_remove_children | ) |
EXPORT_SYMBOL | ( | sas_remove_host | ) |
EXPORT_SYMBOL | ( | sas_phy_alloc | ) |
EXPORT_SYMBOL | ( | sas_phy_add | ) |
EXPORT_SYMBOL | ( | sas_phy_free | ) |
EXPORT_SYMBOL | ( | sas_phy_delete | ) |
EXPORT_SYMBOL | ( | scsi_is_sas_phy | ) |
EXPORT_SYMBOL | ( | sas_port_alloc | ) |
EXPORT_SYMBOL | ( | sas_port_alloc_num | ) |
EXPORT_SYMBOL | ( | sas_port_add | ) |
EXPORT_SYMBOL | ( | sas_port_free | ) |
EXPORT_SYMBOL | ( | sas_port_delete | ) |
EXPORT_SYMBOL | ( | scsi_is_sas_port | ) |
EXPORT_SYMBOL | ( | sas_port_get_phy | ) |
EXPORT_SYMBOL | ( | sas_port_add_phy | ) |
EXPORT_SYMBOL | ( | sas_port_delete_phy | ) |
EXPORT_SYMBOL | ( | sas_port_mark_backlink | ) |
EXPORT_SYMBOL | ( | sas_read_port_mode_page | ) |
EXPORT_SYMBOL | ( | sas_end_device_alloc | ) |
EXPORT_SYMBOL | ( | sas_expander_alloc | ) |
EXPORT_SYMBOL | ( | sas_rphy_add | ) |
EXPORT_SYMBOL | ( | sas_rphy_free | ) |
EXPORT_SYMBOL | ( | sas_rphy_delete | ) |
EXPORT_SYMBOL | ( | sas_rphy_unlink | ) |
EXPORT_SYMBOL | ( | sas_rphy_remove | ) |
EXPORT_SYMBOL | ( | scsi_is_sas_rphy | ) |
EXPORT_SYMBOL | ( | sas_attach_transport | ) |
EXPORT_SYMBOL | ( | sas_release_transport | ) |
EXPORT_SYMBOL_GPL | ( | sas_tlr_supported | ) |
EXPORT_SYMBOL_GPL | ( | sas_disable_tlr | ) |
EXPORT_SYMBOL_GPL | ( | sas_enable_tlr | ) |
EXPORT_SYMBOL_GPL | ( | sas_is_tlr_enabled | ) |
MODULE_AUTHOR | ( | "Christoph Hellwig" | ) |
MODULE_DESCRIPTION | ( | "SAS Transport Attributes" | ) |
module_exit | ( | sas_transport_exit | ) |
module_init | ( | sas_transport_init | ) |
MODULE_LICENSE | ( | "GPL" | ) |
|
read |
sas_attach_transport - instantiate SAS transport template : SAS transport class function template
Definition at line 1793 of file scsi_transport_sas.c.
sas_bitfield_name_match | ( | protocol | , |
sas_protocol_names | |||
) |
Definition at line 141 of file scsi_transport_sas.c.
sas_bitfield_name_search | ( | device_type | , |
sas_device_type_names | |||
) |
Definition at line 129 of file scsi_transport_sas.c.
sas_bitfield_name_search | ( | sas_bitfield_name_set( | linkspeed, |
sas_linkspeed_names | |||
) |
Definition at line 155 of file scsi_transport_sas.c.
void sas_disable_tlr | ( | struct scsi_device * | sdev | ) |
sas_disable_tlr - setting TLR flags : scsi device struct
Seting tlr_enabled flag to 0.
Definition at line 411 of file scsi_transport_sas.c.
void sas_enable_tlr | ( | struct scsi_device * | sdev | ) |
sas_enable_tlr - setting TLR flags : scsi device struct
Seting tlr_enabled flag 1.
Definition at line 426 of file scsi_transport_sas.c.
sas_end_dev_simple_attr | ( | ready_led_meaning | , |
ready_led_meaning | , | ||
"%d\n" | , | ||
int | |||
) |
sas_end_dev_simple_attr | ( | I_T_nexus_loss_timeout | , |
I_T_nexus_loss_timeout | , | ||
"%d\n" | , | ||
int | |||
) |
sas_end_dev_simple_attr | ( | initiator_response_timeout | , |
initiator_response_timeout | , | ||
"%d\n" | , | ||
int | |||
) |
sas_end_dev_simple_attr | ( | tlr_supported | , |
tlr_supported | , | ||
"%d\n" | , | ||
int | |||
) |
sas_end_dev_simple_attr | ( | tlr_enabled | , |
tlr_enabled | , | ||
"%d\n" | , | ||
int | |||
) |
sas_end_device_alloc - allocate an rphy for an end device : which port
Allocates an SAS remote PHY structure, connected to .
Returns: SAS PHY allocated or NULL if the allocation failed.
Definition at line 1479 of file scsi_transport_sas.c.
|
read |
sas_expander_alloc - allocate an rphy for an end device : which port : SAS_EDGE_EXPANDER_DEVICE or SAS_FANOUT_EXPANDER_DEVICE
Allocates an SAS remote PHY structure, connected to .
Returns: SAS PHY allocated or NULL if the allocation failed.
Definition at line 1518 of file scsi_transport_sas.c.
sas_expander_simple_attr | ( | product_id | , |
product_id | , | ||
"%s\n" | , | ||
char * | |||
) |
sas_expander_simple_attr | ( | product_rev | , |
product_rev | , | ||
"%s\n" | , | ||
char * | |||
) |
sas_expander_simple_attr | ( | component_vendor_id | , |
component_vendor_id | , | ||
"%s\n" | , | ||
char * | |||
) |
sas_expander_simple_attr | ( | component_id | , |
component_id | , | ||
"%u\n" | , | ||
unsigned | int | ||
) |
sas_expander_simple_attr | ( | component_revision_id | , |
component_revision_id | , | ||
"%u\n" | , | ||
unsigned | int | ||
) |
unsigned int sas_is_tlr_enabled | ( | struct scsi_device * | sdev | ) |
Definition at line 441 of file scsi_transport_sas.c.
sas_phy_alloc - allocates and initialize a SAS PHY structure : Parent device : Phy index
Allocates an SAS PHY structure. It will be added in the device tree below the device specified by , which has to be either a Scsi_Host or sas_rphy.
Returns: SAS PHY allocated or NULL if the allocation failed.
Definition at line 715 of file scsi_transport_sas.c.
sas_phy_free - free a SAS PHY : SAS PHY to free
Note: This function must only be called on a PHY that has not successfully been added using sas_phy_add().
Definition at line 774 of file scsi_transport_sas.c.
sas_phy_linkerror_attr | ( | invalid_dword_count | ) |
sas_phy_linkerror_attr | ( | running_disparity_error_count | ) |
sas_phy_linkerror_attr | ( | loss_of_dword_sync_count | ) |
sas_phy_linkerror_attr | ( | phy_reset_problem_count | ) |
sas_phy_linkspeed_attr | ( | negotiated_linkrate | ) |
sas_phy_linkspeed_attr | ( | minimum_linkrate_hw | ) |
sas_phy_linkspeed_attr | ( | maximum_linkrate_hw | ) |
sas_phy_linkspeed_rw_attr | ( | minimum_linkrate | ) |
sas_phy_linkspeed_rw_attr | ( | maximum_linkrate | ) |
sas_phy_protocol_attr | ( | identify. | initiator_port_protocols, |
initiator_port_protocols | |||
) |
sas_phy_protocol_attr | ( | identify. | target_port_protocols, |
target_port_protocols | |||
) |
sas_phy_simple_attr | ( | identify. | sas_address, |
sas_address | , | ||
"0x%016llx\n" | , | ||
unsigned long | long | ||
) |
sas_phy_simple_attr | ( | identify. | phy_identifier, |
phy_identifier | , | ||
"%d\n" | , | ||
u8 | |||
) |
sas_port_add - add a SAS port to the device hierarchy : port to be added
publishes a port to the rest of the system
Definition at line 975 of file scsi_transport_sas.c.
sas_port_add_phy - add another phy to a port to form a wide port : port to add the phy to : phy to add
When a port is initially created, it is empty (has no phys). All ports must have at least one phy to operated, and all wide ports must have at least two. The current code makes no difference between ports and wide ports, but the only object that can be connected to a remote device is a port, so ports must be formed on all devices with phys if they're connected to anything.
Definition at line 1098 of file scsi_transport_sas.c.
sas_port_alloc - allocate and initialize a SAS port structure
: parent device : port number
Allocates a SAS port structure. It will be added to the device tree below the device specified by which must be either a Scsi_Host or a sas_expander_device.
Returns NULL on error
Definition at line 904 of file scsi_transport_sas.c.
sas_port_alloc_num - allocate and initialize a SAS port structure
: parent device
Allocates a SAS port structure and a number to go with it. This interface is really for adapters where the port number has no meansing, so the sas class should manage them. It will be added to the device tree below the device specified by which must be either a Scsi_Host or a sas_expander_device.
Returns NULL on error
Definition at line 949 of file scsi_transport_sas.c.
sas_port_delete - remove SAS PORT : SAS PORT to remove
Removes the specified SAS PORT. If the SAS PORT has an associated phys, unlink them from the port as well.
Definition at line 1018 of file scsi_transport_sas.c.
sas_port_delete_phy - remove a phy from a port or wide port : port to remove the phy from : phy to remove
This operation is used for tearing down ports again. It must be done to every port or wide port before calling sas_port_delete.
Definition at line 1132 of file scsi_transport_sas.c.
sas_port_free - free a SAS PORT : SAS PORT to free
Frees the specified SAS PORT.
Note: This function must only be called on a PORT that has not successfully been added using sas_port_add().
Definition at line 1004 of file scsi_transport_sas.c.
sas_port_get_phy - try to take a reference on a port member : port to check
Definition at line 1067 of file scsi_transport_sas.c.
Definition at line 1142 of file scsi_transport_sas.c.
int sas_read_port_mode_page | ( | struct scsi_device * | sdev | ) |
Definition at line 1272 of file scsi_transport_sas.c.
void sas_release_transport | ( | struct scsi_transport_template * | t | ) |
sas_release_transport - release SAS transport template instance : transport template instance
Definition at line 1901 of file scsi_transport_sas.c.
sas_remove_children - tear down a devices SAS data structures : device belonging to the sas object
Removes all SAS PHYs and remote PHYs for a given object
Definition at line 348 of file scsi_transport_sas.c.
sas_remove_host - tear down a Scsi_Host's SAS data structures : Scsi Host that is torn down
Removes all SAS PHYs and remote PHYs for a given Scsi_Host. Must be called just before scsi_remove_host for SAS HBAs.
Definition at line 362 of file scsi_transport_sas.c.
sas_rphy_free - free a SAS remote PHY : SAS remote PHY to free
Frees the specified SAS remote PHY.
Note: This function must only be called on a remote PHY that has not successfully been added using sas_rphy_add() (or has been sas_rphy_remove()'d)
Definition at line 1613 of file scsi_transport_sas.c.
sas_rphy_protocol_attr | ( | identify. | initiator_port_protocols, |
initiator_port_protocols | |||
) |
sas_rphy_protocol_attr | ( | identify. | target_port_protocols, |
target_port_protocols | |||
) |
sas_rphy_remove - remove SAS remote PHY : SAS remote phy to remove
Removes the specified SAS remote PHY.
Definition at line 1666 of file scsi_transport_sas.c.
sas_rphy_simple_attr | ( | identify. | sas_address, |
sas_address | , | ||
"0x%016llx\n" | , | ||
unsigned long | long | ||
) |
sas_rphy_simple_attr | ( | identify. | phy_identifier, |
phy_identifier | , | ||
"%d\n" | , | ||
u8 | |||
) |
sas_rphy_unlink - unlink SAS remote PHY : SAS remote phy to unlink from its parent port
Removes port reference to an rphy
Definition at line 1651 of file scsi_transport_sas.c.
unsigned int sas_tlr_supported | ( | struct scsi_device * | sdev | ) |
sas_tlr_supported - checking TLR bit in vpd 0x90 : scsi device struct
Check Transport Layer Retries are supported or not. If vpd page 0x90 is present, TRL is supported.
Definition at line 377 of file scsi_transport_sas.c.
scsi_is_sas_phy - check if a struct device represents a SAS PHY : device to check
Returns: %1 if the device represents a SAS PHY, %0 else
Definition at line 810 of file scsi_transport_sas.c.
scsi_is_sas_port - check if a struct device represents a SAS port : device to check
Returns: %1 if the device represents a SAS Port, %0 else
Definition at line 1057 of file scsi_transport_sas.c.
scsi_is_sas_rphy - check if a struct device represents a SAS remote PHY : device to check
Returns: %1 if the device represents a SAS remote PHY, %0 else
Definition at line 1695 of file scsi_transport_sas.c.
char* name |
Definition at line 122 of file scsi_transport_sas.c.
sas_linkspeed_names[] |
Definition at line 146 of file scsi_transport_sas.c.
sas_protocol_names[] |
Definition at line 135 of file scsi_transport_sas.c.
u32 value |
Definition at line 121 of file scsi_transport_sas.c.