Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
scsi_transport_sas.h File Reference
#include <linux/transport_class.h>
#include <linux/types.h>
#include <linux/mutex.h>
#include <scsi/sas.h>

Go to the source code of this file.

Data Structures

struct  sas_identify
 
struct  sas_phy
 
struct  sas_rphy
 
struct  sas_end_device
 
struct  sas_expander_device
 
struct  sas_port
 
struct  sas_phy_linkrates
 
struct  sas_function_template
 

Macros

#define dev_to_phy(d)   container_of((d), struct sas_phy, dev)
 
#define transport_class_to_phy(dev)   dev_to_phy((dev)->parent)
 
#define phy_to_shost(phy)   dev_to_shost((phy)->dev.parent)
 
#define dev_to_rphy(d)   container_of((d), struct sas_rphy, dev)
 
#define transport_class_to_rphy(dev)   dev_to_rphy((dev)->parent)
 
#define rphy_to_shost(rphy)   dev_to_shost((rphy)->dev.parent)
 
#define target_to_rphy(targ)   dev_to_rphy((targ)->dev.parent)
 
#define rphy_to_end_device(r)   container_of((r), struct sas_end_device, rphy)
 
#define SAS_EXPANDER_VENDOR_ID_LEN   8
 
#define SAS_EXPANDER_PRODUCT_ID_LEN   16
 
#define SAS_EXPANDER_PRODUCT_REV_LEN   4
 
#define SAS_EXPANDER_COMPONENT_VENDOR_ID_LEN   8
 
#define rphy_to_expander_device(r)   container_of((r), struct sas_expander_device, rphy)
 
#define dev_to_sas_port(d)   container_of((d), struct sas_port, dev)
 
#define transport_class_to_sas_port(dev)   dev_to_sas_port((dev)->parent)
 
#define scsi_is_sas_phy_local(phy)   scsi_is_host_device((phy)->dev.parent)
 

Enumerations

enum  sas_device_type { SAS_PHY_UNUSED = 0, SAS_END_DEVICE = 1, SAS_EDGE_EXPANDER_DEVICE = 2, SAS_FANOUT_EXPANDER_DEVICE = 3 }
 
enum  sas_linkrate {
  SAS_LINK_RATE_UNKNOWN = 0, SAS_PHY_DISABLED = 1, SAS_PHY_RESET_PROBLEM = 2, SAS_SATA_SPINUP_HOLD = 3,
  SAS_SATA_PORT_SELECTOR = 4, SAS_PHY_RESET_IN_PROGRESS = 5, SAS_LINK_RATE_1_5_GBPS = 8, SAS_LINK_RATE_G1 = SAS_LINK_RATE_1_5_GBPS,
  SAS_LINK_RATE_3_0_GBPS = 9, SAS_LINK_RATE_G2 = SAS_LINK_RATE_3_0_GBPS, SAS_LINK_RATE_6_0_GBPS = 10, SAS_LINK_RATE_FAILED = 0x10,
  SAS_PHY_VIRTUAL = 0x11
}
 

Functions

void sas_remove_children (struct device *)
 
void sas_remove_host (struct Scsi_Host *)
 
struct sas_physas_phy_alloc (struct device *, int)
 
void sas_phy_free (struct sas_phy *)
 
int sas_phy_add (struct sas_phy *)
 
void sas_phy_delete (struct sas_phy *)
 
int scsi_is_sas_phy (const struct device *)
 
unsigned int sas_tlr_supported (struct scsi_device *)
 
unsigned int sas_is_tlr_enabled (struct scsi_device *)
 
void sas_disable_tlr (struct scsi_device *)
 
void sas_enable_tlr (struct scsi_device *)
 
struct sas_rphysas_end_device_alloc (struct sas_port *)
 
struct sas_rphysas_expander_alloc (struct sas_port *, enum sas_device_type)
 
void sas_rphy_free (struct sas_rphy *)
 
int sas_rphy_add (struct sas_rphy *)
 
void sas_rphy_remove (struct sas_rphy *)
 
void sas_rphy_delete (struct sas_rphy *)
 
void sas_rphy_unlink (struct sas_rphy *)
 
int scsi_is_sas_rphy (const struct device *)
 
struct sas_portsas_port_alloc (struct device *, int)
 
struct sas_portsas_port_alloc_num (struct device *)
 
int sas_port_add (struct sas_port *)
 
void sas_port_free (struct sas_port *)
 
void sas_port_delete (struct sas_port *)
 
void sas_port_add_phy (struct sas_port *, struct sas_phy *)
 
void sas_port_delete_phy (struct sas_port *, struct sas_phy *)
 
void sas_port_mark_backlink (struct sas_port *)
 
int scsi_is_sas_port (const struct device *)
 
struct sas_physas_port_get_phy (struct sas_port *port)
 
struct scsi_transport_templatesas_attach_transport (struct sas_function_template *)
 
void sas_release_transport (struct scsi_transport_template *)
 
int sas_read_port_mode_page (struct scsi_device *)
 

Macro Definition Documentation

#define dev_to_phy (   d)    container_of((d), struct sas_phy, dev)

Definition at line 82 of file scsi_transport_sas.h.

#define dev_to_rphy (   d)    container_of((d), struct sas_rphy, dev)

Definition at line 98 of file scsi_transport_sas.h.

#define dev_to_sas_port (   d)    container_of((d), struct sas_port, dev)

Definition at line 156 of file scsi_transport_sas.h.

#define phy_to_shost (   phy)    dev_to_shost((phy)->dev.parent)

Definition at line 86 of file scsi_transport_sas.h.

#define rphy_to_end_device (   r)    container_of((r), struct sas_end_device, rphy)

Definition at line 117 of file scsi_transport_sas.h.

#define rphy_to_expander_device (   r)    container_of((r), struct sas_expander_device, rphy)

Definition at line 138 of file scsi_transport_sas.h.

#define rphy_to_shost (   rphy)    dev_to_shost((rphy)->dev.parent)

Definition at line 102 of file scsi_transport_sas.h.

#define SAS_EXPANDER_COMPONENT_VENDOR_ID_LEN   8

Definition at line 130 of file scsi_transport_sas.h.

#define SAS_EXPANDER_PRODUCT_ID_LEN   16

Definition at line 126 of file scsi_transport_sas.h.

#define SAS_EXPANDER_PRODUCT_REV_LEN   4

Definition at line 128 of file scsi_transport_sas.h.

#define SAS_EXPANDER_VENDOR_ID_LEN   8

Definition at line 124 of file scsi_transport_sas.h.

#define scsi_is_sas_phy_local (   phy)    scsi_is_host_device((phy)->dev.parent)

Definition at line 235 of file scsi_transport_sas.h.

#define target_to_rphy (   targ)    dev_to_rphy((targ)->dev.parent)

Definition at line 104 of file scsi_transport_sas.h.

#define transport_class_to_phy (   dev)    dev_to_phy((dev)->parent)

Definition at line 84 of file scsi_transport_sas.h.

#define transport_class_to_rphy (   dev)    dev_to_rphy((dev)->parent)

Definition at line 100 of file scsi_transport_sas.h.

#define transport_class_to_sas_port (   dev)    dev_to_sas_port((dev)->parent)

Definition at line 158 of file scsi_transport_sas.h.

Enumeration Type Documentation

Enumerator:
SAS_PHY_UNUSED 
SAS_END_DEVICE 
SAS_EDGE_EXPANDER_DEVICE 
SAS_FANOUT_EXPANDER_DEVICE 

Definition at line 13 of file scsi_transport_sas.h.

Enumerator:
SAS_LINK_RATE_UNKNOWN 
SAS_PHY_DISABLED 
SAS_PHY_RESET_PROBLEM 
SAS_SATA_SPINUP_HOLD 
SAS_SATA_PORT_SELECTOR 
SAS_PHY_RESET_IN_PROGRESS 
SAS_LINK_RATE_1_5_GBPS 
SAS_LINK_RATE_G1 
SAS_LINK_RATE_3_0_GBPS 
SAS_LINK_RATE_G2 
SAS_LINK_RATE_6_0_GBPS 
SAS_LINK_RATE_FAILED 
SAS_PHY_VIRTUAL 

Definition at line 26 of file scsi_transport_sas.h.

Function Documentation

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.

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.

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.

unsigned int sas_is_tlr_enabled ( struct scsi_device )

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.

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 )

Definition at line 1142 of file scsi_transport_sas.c.

int sas_read_port_mode_page ( struct scsi_device )

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.

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.

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.