Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
scsi_transport_sas.c File Reference
#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
 

Macros

#define to_sas_host_attrs(host)   ((struct sas_host_attrs *)(host)->shost_data)
 
#define SAS_DEVICE_ATTR(_prefix, _name, _mode, _show, _store)
 
#define sas_bitfield_name_match(title, table)
 
#define sas_bitfield_name_set(title, table)
 
#define sas_bitfield_name_search(title, table)
 
#define sas_phy_show_simple(field, name, format_string, cast)
 
#define sas_phy_simple_attr(field, name, format_string, type)
 
#define sas_phy_show_protocol(field, name)
 
#define sas_phy_protocol_attr(field, name)
 
#define sas_phy_show_linkspeed(field)
 
#define sas_phy_store_linkspeed(field)
 
#define sas_phy_linkspeed_rw_attr(field)
 
#define sas_phy_linkspeed_attr(field)
 
#define sas_phy_show_linkerror(field)
 
#define sas_phy_linkerror_attr(field)
 
#define sas_port_show_simple(field, name, format_string, cast)
 
#define sas_port_simple_attr(field, name, format_string, type)
 
#define sas_rphy_show_simple(field, name, format_string, cast)
 
#define sas_rphy_simple_attr(field, name, format_string, type)
 
#define sas_rphy_show_protocol(field, name)
 
#define sas_rphy_protocol_attr(field, name)
 
#define BUF_SIZE   64
 
#define sas_end_dev_show_simple(field, name, format_string, cast)
 
#define sas_end_dev_simple_attr(field, name, format_string, type)
 
#define sas_expander_show_simple(field, name, format_string, cast)
 
#define sas_expander_simple_attr(field, name, format_string, type)
 
#define SETUP_TEMPLATE(attrb, field, perm, test)
 
#define SETUP_TEMPLATE_RW(attrb, field, perm, test, ro_test, ro_perm)
 
#define SETUP_RPORT_ATTRIBUTE(field)   SETUP_TEMPLATE(rphy_attrs, field, S_IRUGO, 1)
 
#define SETUP_OPTIONAL_RPORT_ATTRIBUTE(field, func)   SETUP_TEMPLATE(rphy_attrs, field, S_IRUGO, i->f->func)
 
#define SETUP_PHY_ATTRIBUTE(field)   SETUP_TEMPLATE(phy_attrs, field, S_IRUGO, 1)
 
#define SETUP_PHY_ATTRIBUTE_RW(field)
 
#define SETUP_OPTIONAL_PHY_ATTRIBUTE_RW(field, func)
 
#define SETUP_PORT_ATTRIBUTE(field)   SETUP_TEMPLATE(port_attrs, field, S_IRUGO, 1)
 
#define SETUP_OPTIONAL_PHY_ATTRIBUTE(field, func)   SETUP_TEMPLATE(phy_attrs, field, S_IRUGO, i->f->func)
 
#define SETUP_PHY_ATTRIBUTE_WRONLY(field)   SETUP_TEMPLATE(phy_attrs, field, S_IWUSR, 1)
 
#define SETUP_OPTIONAL_PHY_ATTRIBUTE_WRONLY(field, func)   SETUP_TEMPLATE(phy_attrs, field, S_IWUSR, i->f->func)
 
#define SETUP_END_DEV_ATTRIBUTE(field)   SETUP_TEMPLATE(end_dev_attrs, field, S_IRUGO, 1)
 
#define SETUP_EXPANDER_ATTRIBUTE(field)   SETUP_TEMPLATE(expander_attrs, expander_##field, S_IRUGO, 1)
 

Functions

 sas_bitfield_name_search (device_type, sas_device_type_names)
 
 sas_bitfield_name_match (protocol, sas_protocol_names)
 
 sas_bitfield_name_search (sas_bitfield_name_set(linkspeed, sas_linkspeed_names)
 
void sas_remove_children (struct device *dev)
 
 EXPORT_SYMBOL (sas_remove_children)
 
void sas_remove_host (struct Scsi_Host *shost)
 
 EXPORT_SYMBOL (sas_remove_host)
 
unsigned int sas_tlr_supported (struct scsi_device *sdev)
 
 EXPORT_SYMBOL_GPL (sas_tlr_supported)
 
void sas_disable_tlr (struct scsi_device *sdev)
 
 EXPORT_SYMBOL_GPL (sas_disable_tlr)
 
void sas_enable_tlr (struct scsi_device *sdev)
 
 EXPORT_SYMBOL_GPL (sas_enable_tlr)
 
unsigned int sas_is_tlr_enabled (struct scsi_device *sdev)
 
 EXPORT_SYMBOL_GPL (sas_is_tlr_enabled)
 
 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_phy_linkspeed_attr (negotiated_linkrate)
 
 sas_phy_linkspeed_attr (minimum_linkrate_hw)
 
 sas_phy_linkspeed_rw_attr (minimum_linkrate)
 
 sas_phy_linkspeed_attr (maximum_linkrate_hw)
 
 sas_phy_linkspeed_rw_attr (maximum_linkrate)
 
 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)
 
struct sas_physas_phy_alloc (struct device *parent, int number)
 
 EXPORT_SYMBOL (sas_phy_alloc)
 
int sas_phy_add (struct sas_phy *phy)
 
 EXPORT_SYMBOL (sas_phy_add)
 
void sas_phy_free (struct sas_phy *phy)
 
 EXPORT_SYMBOL (sas_phy_free)
 
void sas_phy_delete (struct sas_phy *phy)
 
 EXPORT_SYMBOL (sas_phy_delete)
 
int scsi_is_sas_phy (const struct device *dev)
 
 EXPORT_SYMBOL (scsi_is_sas_phy)
 
 sas_port_simple_attr (num_phys, num_phys,"%d\n", int)
 
struct sas_portsas_port_alloc (struct device *parent, int port_id)
 
 EXPORT_SYMBOL (sas_port_alloc)
 
struct sas_portsas_port_alloc_num (struct device *parent)
 
 EXPORT_SYMBOL (sas_port_alloc_num)
 
int sas_port_add (struct sas_port *port)
 
 EXPORT_SYMBOL (sas_port_add)
 
void sas_port_free (struct sas_port *port)
 
 EXPORT_SYMBOL (sas_port_free)
 
void sas_port_delete (struct sas_port *port)
 
 EXPORT_SYMBOL (sas_port_delete)
 
int scsi_is_sas_port (const struct device *dev)
 
 EXPORT_SYMBOL (scsi_is_sas_port)
 
struct sas_physas_port_get_phy (struct sas_port *port)
 
 EXPORT_SYMBOL (sas_port_get_phy)
 
void sas_port_add_phy (struct sas_port *port, struct sas_phy *phy)
 
 EXPORT_SYMBOL (sas_port_add_phy)
 
void sas_port_delete_phy (struct sas_port *port, struct sas_phy *phy)
 
 EXPORT_SYMBOL (sas_port_delete_phy)
 
void sas_port_mark_backlink (struct sas_port *port)
 
 EXPORT_SYMBOL (sas_port_mark_backlink)
 
 sas_rphy_protocol_attr (identify.initiator_port_protocols, initiator_port_protocols)
 
 sas_rphy_protocol_attr (identify.target_port_protocols, target_port_protocols)
 
 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)
 
int sas_read_port_mode_page (struct scsi_device *sdev)
 
 EXPORT_SYMBOL (sas_read_port_mode_page)
 
 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_expander_simple_attr (vendor_id, vendor_id,"%s\n", char *)
 
 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)
 
 sas_expander_simple_attr (level, level,"%d\n", int)
 
struct sas_rphysas_end_device_alloc (struct sas_port *parent)
 
 EXPORT_SYMBOL (sas_end_device_alloc)
 
struct sas_rphysas_expander_alloc (struct sas_port *parent, enum sas_device_type type)
 
 EXPORT_SYMBOL (sas_expander_alloc)
 
int sas_rphy_add (struct sas_rphy *rphy)
 
 EXPORT_SYMBOL (sas_rphy_add)
 
void sas_rphy_free (struct sas_rphy *rphy)
 
 EXPORT_SYMBOL (sas_rphy_free)
 
void sas_rphy_delete (struct sas_rphy *rphy)
 
 EXPORT_SYMBOL (sas_rphy_delete)
 
void sas_rphy_unlink (struct sas_rphy *rphy)
 
 EXPORT_SYMBOL (sas_rphy_unlink)
 
void sas_rphy_remove (struct sas_rphy *rphy)
 
 EXPORT_SYMBOL (sas_rphy_remove)
 
int scsi_is_sas_rphy (const struct device *dev)
 
 EXPORT_SYMBOL (scsi_is_sas_rphy)
 
struct scsi_transport_templatesas_attach_transport (struct sas_function_template *ft)
 
 EXPORT_SYMBOL (sas_attach_transport)
 
void sas_release_transport (struct scsi_transport_template *t)
 
 EXPORT_SYMBOL (sas_release_transport)
 
 MODULE_AUTHOR ("Christoph Hellwig")
 
 MODULE_DESCRIPTION ("SAS Transport Attributes")
 
 MODULE_LICENSE ("GPL")
 
 module_init (sas_transport_init)
 
 module_exit (sas_transport_exit)
 

Variables

 sas_protocol_names []
 
 sas_linkspeed_names []
 

Macro Definition Documentation

#define BUF_SIZE   64

Definition at line 1270 of file scsi_transport_sas.c.

#define sas_bitfield_name_match (   title,
  table 
)
Value:
static ssize_t \
get_sas_##title##_names(u32 table_key, char *buf) \
{ \
char *prefix = ""; \
ssize_t len = 0; \
int i; \
for (i = 0; i < ARRAY_SIZE(table); i++) { \
if (table[i].value & table_key) { \
len += sprintf(buf + len, "%s%s", \
prefix, table[i].name); \
prefix = ", "; \
} \
} \
len += sprintf(buf + len, "\n"); \
return len; \
}

Definition at line 65 of file scsi_transport_sas.c.

#define sas_bitfield_name_search (   title,
  table 
)
Value:
static ssize_t \
get_sas_##title##_names(u32 table_key, char *buf) \
{ \
ssize_t len = 0; \
int i; \
for (i = 0; i < ARRAY_SIZE(table); i++) { \
if (table[i].value == table_key) { \
len += sprintf(buf + len, "%s", \
table[i].name); \
break; \
} \
} \
len += sprintf(buf + len, "\n"); \
return len; \
}

Definition at line 102 of file scsi_transport_sas.c.

#define sas_bitfield_name_set (   title,
  table 
)
Value:
static ssize_t \
set_sas_##title##_names(u32 *table_key, const char *buf) \
{ \
ssize_t len = 0; \
int i; \
for (i = 0; i < ARRAY_SIZE(table); i++) { \
len = strlen(table[i].name); \
if (strncmp(buf, table[i].name, len) == 0 && \
(buf[len] == '\n' || buf[len] == '\0')) { \
*table_key = table[i].value; \
return 0; \
} \
} \
return -EINVAL; \
}

Definition at line 84 of file scsi_transport_sas.c.

#define SAS_DEVICE_ATTR (   _prefix,
  _name,
  _mode,
  _show,
  _store 
)
Value:
struct device_attribute dev_attr_##_prefix##_##_name = \
__ATTR(_name,_mode,_show,_store)

Definition at line 56 of file scsi_transport_sas.c.

#define sas_end_dev_show_simple (   field,
  name,
  format_string,
  cast 
)
Value:
static ssize_t \
show_sas_end_dev_##name(struct device *dev, \
struct device_attribute *attr, char *buf) \
{ \
\
return snprintf(buf, 20, format_string, cast rdev->field); \
}

Definition at line 1310 of file scsi_transport_sas.c.

#define sas_end_dev_simple_attr (   field,
  name,
  format_string,
  type 
)
Value:
sas_end_dev_show_simple(field, name, format_string, (type)) \
static SAS_DEVICE_ATTR(end_dev, name, S_IRUGO, \
show_sas_end_dev_##name, NULL)

Definition at line 1321 of file scsi_transport_sas.c.

#define sas_expander_show_simple (   field,
  name,
  format_string,
  cast 
)
Value:
static ssize_t \
show_sas_expander_##name(struct device *dev, \
struct device_attribute *attr, char *buf) \
{ \
\
return snprintf(buf, 20, format_string, cast edev->field); \
}

Definition at line 1339 of file scsi_transport_sas.c.

#define sas_expander_simple_attr (   field,
  name,
  format_string,
  type 
)
Value:
sas_expander_show_simple(field, name, format_string, (type)) \
static SAS_DEVICE_ATTR(expander, name, S_IRUGO, \
show_sas_expander_##name, NULL)

Definition at line 1350 of file scsi_transport_sas.c.

#define sas_phy_linkerror_attr (   field)
Value:

Definition at line 542 of file scsi_transport_sas.c.

#define sas_phy_linkspeed_attr (   field)
Value:

Definition at line 521 of file scsi_transport_sas.c.

#define sas_phy_linkspeed_rw_attr (   field)
Value:
sas_phy_store_linkspeed(field) \
static DEVICE_ATTR(field, S_IRUGO, show_sas_phy_##field, \
store_sas_phy_##field)

Definition at line 515 of file scsi_transport_sas.c.

#define sas_phy_protocol_attr (   field,
  name 
)
Value:

Definition at line 478 of file scsi_transport_sas.c.

#define sas_phy_show_linkerror (   field)
Value:
static ssize_t \
show_sas_phy_##field(struct device *dev, \
struct device_attribute *attr, char *buf) \
{ \
struct Scsi_Host *shost = dev_to_shost(phy->dev.parent); \
struct sas_internal *i = to_sas_internal(shost->transportt); \
int error; \
\
error = i->f->get_linkerrors ? i->f->get_linkerrors(phy) : 0; \
if (error) \
return error; \
return snprintf(buf, 20, "%u\n", phy->field); \
}

Definition at line 526 of file scsi_transport_sas.c.

#define sas_phy_show_linkspeed (   field)
Value:
static ssize_t \
show_sas_phy_##field(struct device *dev, \
struct device_attribute *attr, char *buf) \
{ \
\
return get_sas_linkspeed_names(phy->field, buf); \
}

Definition at line 482 of file scsi_transport_sas.c.

#define sas_phy_show_protocol (   field,
  name 
)
Value:
static ssize_t \
show_sas_phy_##name(struct device *dev, \
struct device_attribute *attr, char *buf) \
{ \
if (!phy->field) \
return snprintf(buf, 20, "none\n"); \
return get_sas_protocol_names(phy->field, buf); \
}

Definition at line 466 of file scsi_transport_sas.c.

#define sas_phy_show_simple (   field,
  name,
  format_string,
  cast 
)
Value:
static ssize_t \
show_sas_phy_##name(struct device *dev, \
struct device_attribute *attr, char *buf) \
{ \
\
return snprintf(buf, 20, format_string, cast phy->field); \
}

Definition at line 452 of file scsi_transport_sas.c.

#define sas_phy_simple_attr (   field,
  name,
  format_string,
  type 
)
Value:
sas_phy_show_simple(field, name, format_string, (type)) \
static DEVICE_ATTR(name, S_IRUGO, show_sas_phy_##name, NULL)

Definition at line 462 of file scsi_transport_sas.c.

#define sas_phy_store_linkspeed (   field)
Value:
static ssize_t \
store_sas_phy_##field(struct device *dev, \
const char *buf, size_t count) \
{ \
struct Scsi_Host *shost = dev_to_shost(phy->dev.parent); \
struct sas_internal *i = to_sas_internal(shost->transportt); \
struct sas_phy_linkrates rates = {0}; \
int error; \
\
error = set_sas_linkspeed_names(&value, buf); \
if (error) \
return error; \
rates.field = value; \
error = i->f->set_phy_speed(phy, &rates); \
\
return error ? error : count; \
}

Definition at line 493 of file scsi_transport_sas.c.

#define sas_port_show_simple (   field,
  name,
  format_string,
  cast 
)
Value:
static ssize_t \
show_sas_port_##name(struct device *dev, \
struct device_attribute *attr, char *buf) \
{ \
\
return snprintf(buf, 20, format_string, cast port->field); \
}

Definition at line 819 of file scsi_transport_sas.c.

#define sas_port_simple_attr (   field,
  name,
  format_string,
  type 
)
Value:
sas_port_show_simple(field, name, format_string, (type)) \
static DEVICE_ATTR(name, S_IRUGO, show_sas_port_##name, NULL)

Definition at line 829 of file scsi_transport_sas.c.

#define sas_rphy_protocol_attr (   field,
  name 
)
Value:
static SAS_DEVICE_ATTR(rphy, name, S_IRUGO, \
show_sas_rphy_##name, NULL)

Definition at line 1193 of file scsi_transport_sas.c.

#define sas_rphy_show_protocol (   field,
  name 
)
Value:
static ssize_t \
show_sas_rphy_##name(struct device *dev, \
struct device_attribute *attr, char *buf) \
{ \
if (!rphy->field) \
return snprintf(buf, 20, "none\n"); \
return get_sas_protocol_names(rphy->field, buf); \
}

Definition at line 1181 of file scsi_transport_sas.c.

#define sas_rphy_show_simple (   field,
  name,
  format_string,
  cast 
)
Value:
static ssize_t \
show_sas_rphy_##name(struct device *dev, \
struct device_attribute *attr, char *buf) \
{ \
\
return snprintf(buf, 20, format_string, cast rphy->field); \
}

Definition at line 1166 of file scsi_transport_sas.c.

#define sas_rphy_simple_attr (   field,
  name,
  format_string,
  type 
)
Value:
sas_rphy_show_simple(field, name, format_string, (type)) \
static SAS_DEVICE_ATTR(rphy, name, S_IRUGO, \
show_sas_rphy_##name, NULL)

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.

#define SETUP_OPTIONAL_PHY_ATTRIBUTE_RW (   field,
  func 
)
Value:
!i->f->func, S_IRUGO)

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)
Value:
!i->f->set_phy_speed, S_IRUGO)

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.

#define SETUP_TEMPLATE (   attrb,
  field,
  perm,
  test 
)
Value:
i->private_##attrb[count] = dev_attr_##field; \
i->private_##attrb[count].attr.mode = perm; \
i->attrb[count] = &i->private_##attrb[count]; \
if (test) \
count++

Definition at line 1735 of file scsi_transport_sas.c.

#define SETUP_TEMPLATE_RW (   attrb,
  field,
  perm,
  test,
  ro_test,
  ro_perm 
)
Value:
i->private_##attrb[count] = dev_attr_##field; \
i->private_##attrb[count].attr.mode = perm; \
if (ro_test) { \
i->private_##attrb[count].attr.mode = ro_perm; \
i->private_##attrb[count].store = NULL; \
} \
i->attrb[count] = &i->private_##attrb[count]; \
if (test) \
count++

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.

Function Documentation

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"  )
struct scsi_transport_template* sas_attach_transport ( struct sas_function_template ft)
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   
)
struct sas_rphy* sas_end_device_alloc ( struct sas_port parent)
read

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.

struct sas_rphy* sas_expander_alloc ( struct sas_port parent,
enum sas_device_type  type 
)
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 ( vendor_id  ,
vendor_id  ,
"%s\n"  ,
char  
)
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 
)
sas_expander_simple_attr ( level  ,
level  ,
"%d\n"  ,
int   
)
unsigned int sas_is_tlr_enabled ( struct scsi_device sdev)

Definition at line 441 of file scsi_transport_sas.c.

int sas_phy_add ( struct sas_phy phy)

sas_phy_add - add a SAS PHY to the device hierarchy : The PHY to be added

Publishes a SAS PHY to the rest of the system.

Definition at line 750 of file scsi_transport_sas.c.

struct sas_phy* sas_phy_alloc ( struct device parent,
int  number 
)
read

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.

void sas_phy_delete ( struct sas_phy phy)

sas_phy_delete - remove SAS PHY : SAS PHY to remove

Removes the specified SAS PHY. If the SAS PHY has an associated remote PHY it is removed before.

Definition at line 789 of file scsi_transport_sas.c.

void sas_phy_free ( struct sas_phy phy)

sas_phy_free - free a SAS PHY : SAS PHY to free

Frees the specified SAS PHY.

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   
)
int sas_port_add ( struct sas_port port)

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.

void sas_port_add_phy ( struct sas_port port,
struct sas_phy phy 
)

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.

struct sas_port* sas_port_alloc ( struct device parent,
int  port_id 
)
read

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.

struct sas_port* sas_port_alloc_num ( struct device parent)
read

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.

void sas_port_delete ( struct sas_port port)

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.

void sas_port_delete_phy ( struct sas_port port,
struct sas_phy phy 
)

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.

void sas_port_free ( struct sas_port port)

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.

struct sas_phy* sas_port_get_phy ( struct sas_port port)
read

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.

void sas_port_mark_backlink ( struct sas_port port)

Definition at line 1142 of file scsi_transport_sas.c.

sas_port_simple_attr ( num_phys  ,
num_phys  ,
"%d\n"  ,
int   
)
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.

void sas_remove_children ( struct device dev)

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.

void sas_remove_host ( struct Scsi_Host shost)

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.

int sas_rphy_add ( struct sas_rphy rphy)

sas_rphy_add - add a SAS remote PHY to the device hierarchy : The remote PHY to be added

Publishes a SAS remote PHY to the rest of the system.

Definition at line 1555 of file scsi_transport_sas.c.

void sas_rphy_delete ( struct sas_rphy rphy)

sas_rphy_delete - remove and free SAS remote PHY : SAS remote PHY to remove and free

Removes the specified SAS remote PHY and frees it.

Definition at line 1638 of file scsi_transport_sas.c.

void sas_rphy_free ( struct sas_rphy rphy)

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   
)
void sas_rphy_remove ( struct sas_rphy rphy)

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   
)
void sas_rphy_unlink ( struct sas_rphy rphy)

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.

int scsi_is_sas_phy ( const struct device dev)

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.

int scsi_is_sas_port ( const struct device dev)

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.

int scsi_is_sas_rphy ( const struct device dev)

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.

Variable Documentation

char* name

Definition at line 122 of file scsi_transport_sas.c.

sas_linkspeed_names[]
Initial value:
= {
{ SAS_LINK_RATE_UNKNOWN, "Unknown" },
{ SAS_PHY_DISABLED, "Phy disabled" },
{ SAS_LINK_RATE_FAILED, "Link Rate failed" },
{ SAS_SATA_SPINUP_HOLD, "Spin-up hold" },
{ SAS_LINK_RATE_1_5_GBPS, "1.5 Gbit" },
{ SAS_LINK_RATE_3_0_GBPS, "3.0 Gbit" },
{ SAS_LINK_RATE_6_0_GBPS, "6.0 Gbit" },
}

Definition at line 146 of file scsi_transport_sas.c.

sas_protocol_names[]
Initial value:
= {
{ SAS_PROTOCOL_SATA, "sata" },
{ SAS_PROTOCOL_SMP, "smp" },
{ SAS_PROTOCOL_STP, "stp" },
{ SAS_PROTOCOL_SSP, "ssp" },
}

Definition at line 135 of file scsi_transport_sas.c.

u32 value

Definition at line 121 of file scsi_transport_sas.c.