Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
libsas.h File Reference
#include <linux/timer.h>
#include <linux/pci.h>
#include <scsi/sas.h>
#include <linux/libata.h>
#include <linux/list.h>
#include <scsi/scsi_device.h>
#include <scsi/scsi_cmnd.h>
#include <scsi/scsi_transport_sas.h>
#include <linux/scatterlist.h>
#include <linux/slab.h>

Go to the source code of this file.

Data Structures

struct  ex_phy
 
struct  expander_device
 
struct  sata_device
 
struct  ssp_device
 
struct  domain_device
 
struct  sas_work
 
struct  sas_discovery_event
 
struct  sas_discovery
 
struct  asd_sas_port
 
struct  asd_sas_event
 
struct  asd_sas_phy
 
struct  scsi_core
 
struct  sas_ha_event
 
struct  sas_ha_struct
 
struct  ata_task_resp
 
struct  task_status_struct
 
struct  sas_ata_task
 
struct  sas_smp_task
 
struct  sas_ssp_task
 
struct  sas_task
 
struct  sas_task_slow
 
struct  sas_domain_function_template
 

Macros

#define to_dom_device(_obj)   container_of(_obj, struct domain_device, dev_obj)
 
#define to_dev_attr(_attr)
 
#define ATA_RESP_FIS_SIZE   24
 
#define SHOST_TO_SAS_HA(_shost)   (*(struct sas_ha_struct **)(_shost)->hostdata)
 
#define SAS_STATUS_BUF_SIZE   96
 
#define SAS_TASK_STATE_PENDING   1
 
#define SAS_TASK_STATE_DONE   2
 
#define SAS_TASK_STATE_ABORTED   4
 
#define SAS_TASK_NEED_DEV_RESET   8
 
#define SAS_TASK_AT_INITIATOR   16
 

Enumerations

enum  sas_class { SAS, EXPANDER }
 
enum  sas_phy_role { PHY_ROLE_NONE = 0, PHY_ROLE_TARGET = 0x40, PHY_ROLE_INITIATOR = 0x80 }
 
enum  sas_phy_type { PHY_TYPE_PHYSICAL, PHY_TYPE_VIRTUAL }
 
enum  ha_event { HAE_RESET = 0U, HA_NUM_EVENTS = 1 }
 
enum  port_event {
  PORTE_BYTES_DMAED = 0U, PORTE_BROADCAST_RCVD = 1, PORTE_LINK_RESET_ERR = 2, PORTE_TIMER_EVENT = 3,
  PORTE_HARD_RESET = 4, PORT_NUM_EVENTS = 5
}
 
enum  phy_event {
  PHYE_LOSS_OF_SIGNAL = 0U, PHYE_OOB_DONE = 1, PHYE_OOB_ERROR = 2, PHYE_SPINUP_HOLD = 3,
  PHYE_RESUME_TIMEOUT = 4, PHY_NUM_EVENTS = 5
}
 
enum  discover_event {
  DISCE_DISCOVER_DOMAIN = 0U, DISCE_REVALIDATE_DOMAIN = 1, DISCE_PORT_GONE = 2, DISCE_PROBE = 3,
  DISCE_SUSPEND = 4, DISCE_RESUME = 5, DISCE_DESTRUCT = 6, DISC_NUM_EVENTS = 7
}
 
enum  routing_attribute { DIRECT_ROUTING, SUBTRACTIVE_ROUTING, TABLE_ROUTING }
 
enum  ex_phy_state { PHY_EMPTY, PHY_VACANT, PHY_NOT_PRESENT, PHY_DEVICE_DISCOVERED }
 
enum  ata_command_set { ATA_COMMAND_SET = 0, ATAPI_COMMAND_SET = 1 }
 
enum  {
  SAS_DEV_GONE, SAS_DEV_FOUND, SAS_DEV_DESTROY, SAS_DEV_EH_PENDING,
  SAS_DEV_LU_RESET, SAS_DEV_RESET
}
 
enum  sas_ha_state { SAS_HA_REGISTERED, SAS_HA_DRAINING, SAS_HA_ATA_EH_ACTIVE, SAS_HA_FROZEN }
 
enum  service_response { SAS_TASK_COMPLETE, SAS_TASK_UNDELIVERED = -1 }
 
enum  exec_status {
  __SAM_STAT_CHECK_CONDITION = SAM_STAT_CHECK_CONDITION, SAS_DEV_NO_RESPONSE = 0x80, SAS_DATA_UNDERRUN, SAS_DATA_OVERRUN,
  SAS_INTERRUPTED, SAS_QUEUE_FULL, SAS_DEVICE_UNKNOWN, SAS_SG_ERR,
  SAS_OPEN_REJECT, SAS_OPEN_TO, SAS_PROTO_RESPONSE, SAS_PHY_DOWN,
  SAS_NAK_R_ERR, SAS_PENDING, SAS_ABORTED_TASK
}
 
enum  task_attribute { TASK_ATTR_SIMPLE = 0, TASK_ATTR_HOQ = 1, TASK_ATTR_ORDERED = 2, TASK_ATTR_ACA = 4 }
 

Functions

void sas_hash_addr (u8 *hashed, const u8 *sas_addr)
 
struct sas_tasksas_alloc_task (gfp_t flags)
 
struct sas_tasksas_alloc_slow_task (gfp_t flags)
 
void sas_free_task (struct sas_task *task)
 
int sas_register_ha (struct sas_ha_struct *)
 
int sas_unregister_ha (struct sas_ha_struct *)
 
void sas_prep_resume_ha (struct sas_ha_struct *sas_ha)
 
void sas_resume_ha (struct sas_ha_struct *sas_ha)
 
void sas_suspend_ha (struct sas_ha_struct *sas_ha)
 
int sas_set_phy_speed (struct sas_phy *phy, struct sas_phy_linkrates *rates)
 
int sas_phy_reset (struct sas_phy *phy, int hard_reset)
 
int sas_queue_up (struct sas_task *task)
 
int sas_queuecommand (struct Scsi_Host *, struct scsi_cmnd *)
 
int sas_target_alloc (struct scsi_target *)
 
int sas_slave_configure (struct scsi_device *)
 
int sas_change_queue_depth (struct scsi_device *, int new_depth, int reason)
 
int sas_change_queue_type (struct scsi_device *, int qt)
 
int sas_bios_param (struct scsi_device *, struct block_device *, sector_t capacity, int *hsc)
 
struct scsi_transport_templatesas_domain_attach_transport (struct sas_domain_function_template *)
 
void sas_domain_release_transport (struct scsi_transport_template *)
 
int sas_discover_root_expander (struct domain_device *)
 
void sas_init_ex_attr (void)
 
int sas_ex_revalidate_domain (struct domain_device *)
 
void sas_unregister_domain_devices (struct asd_sas_port *port, int gone)
 
void sas_init_disc (struct sas_discovery *disc, struct asd_sas_port *)
 
int sas_discover_event (struct asd_sas_port *, enum discover_event ev)
 
int sas_discover_sata (struct domain_device *)
 
int sas_discover_end_dev (struct domain_device *)
 
void sas_unregister_dev (struct asd_sas_port *port, struct domain_device *)
 
void sas_init_dev (struct domain_device *)
 
void sas_task_abort (struct sas_task *)
 
int sas_eh_abort_handler (struct scsi_cmnd *cmd)
 
int sas_eh_device_reset_handler (struct scsi_cmnd *cmd)
 
int sas_eh_bus_reset_handler (struct scsi_cmnd *cmd)
 
void sas_target_destroy (struct scsi_target *)
 
int sas_slave_alloc (struct scsi_device *)
 
int sas_ioctl (struct scsi_device *sdev, int cmd, void __user *arg)
 
int sas_drain_work (struct sas_ha_struct *ha)
 
int sas_smp_handler (struct Scsi_Host *shost, struct sas_rphy *rphy, struct request *req)
 
void sas_ssp_task_response (struct device *dev, struct sas_task *task, struct ssp_response_iu *iu)
 
struct sas_physas_get_local_phy (struct domain_device *dev)
 
int sas_request_addr (struct Scsi_Host *shost, u8 *addr)
 

Macro Definition Documentation

#define ATA_RESP_FIS_SIZE   24

Definition at line 169 of file libsas.h.

#define SAS_STATUS_BUF_SIZE   96

Definition at line 563 of file libsas.h.

#define SAS_TASK_AT_INITIATOR   16

Definition at line 654 of file libsas.h.

#define SAS_TASK_NEED_DEV_RESET   8

Definition at line 653 of file libsas.h.

#define SAS_TASK_STATE_ABORTED   4

Definition at line 652 of file libsas.h.

#define SAS_TASK_STATE_DONE   2

Definition at line 651 of file libsas.h.

#define SAS_TASK_STATE_PENDING   1

Definition at line 650 of file libsas.h.

#define SHOST_TO_SAS_HA (   _shost)    (*(struct sas_ha_struct **)(_shost)->hostdata)

Definition at line 443 of file libsas.h.

#define to_dev_attr (   _attr)
Value:
container_of(_attr, struct domain_dev_attribute,\

Definition at line 100 of file libsas.h.

#define to_dom_device (   _obj)    container_of(_obj, struct domain_device, dev_obj)

Definition at line 99 of file libsas.h.

Enumeration Type Documentation

anonymous enum
Enumerator:
SAS_DEV_GONE 
SAS_DEV_FOUND 
SAS_DEV_DESTROY 
SAS_DEV_EH_PENDING 
SAS_DEV_LU_RESET 
SAS_DEV_RESET 

Definition at line 187 of file libsas.h.

Enumerator:
ATA_COMMAND_SET 
ATAPI_COMMAND_SET 

Definition at line 164 of file libsas.h.

Enumerator:
DISCE_DISCOVER_DOMAIN 
DISCE_REVALIDATE_DOMAIN 
DISCE_PORT_GONE 
DISCE_PROBE 
DISCE_SUSPEND 
DISCE_RESUME 
DISCE_DESTRUCT 
DISC_NUM_EVENTS 

Definition at line 86 of file libsas.h.

Enumerator:
PHY_EMPTY 
PHY_VACANT 
PHY_NOT_PRESENT 
PHY_DEVICE_DISCOVERED 

Definition at line 109 of file libsas.h.

Enumerator:
__SAM_STAT_CHECK_CONDITION 
SAS_DEV_NO_RESPONSE 
SAS_DATA_UNDERRUN 
SAS_DATA_OVERRUN 
SAS_INTERRUPTED 
SAS_QUEUE_FULL 
SAS_DEVICE_UNKNOWN 
SAS_SG_ERR 
SAS_OPEN_REJECT 
SAS_OPEN_TO 
SAS_PROTO_RESPONSE 
SAS_PHY_DOWN 
SAS_NAK_R_ERR 
SAS_PENDING 
SAS_ABORTED_TASK 

Definition at line 517 of file libsas.h.

enum ha_event
Enumerator:
HAE_RESET 
HA_NUM_EVENTS 

Definition at line 63 of file libsas.h.

enum phy_event
Enumerator:
PHYE_LOSS_OF_SIGNAL 
PHYE_OOB_DONE 
PHYE_OOB_ERROR 
PHYE_SPINUP_HOLD 
PHYE_RESUME_TIMEOUT 
PHY_NUM_EVENTS 

Definition at line 77 of file libsas.h.

enum port_event
Enumerator:
PORTE_BYTES_DMAED 
PORTE_BROADCAST_RCVD 
PORTE_LINK_RESET_ERR 
PORTE_TIMER_EVENT 
PORTE_HARD_RESET 
PORT_NUM_EVENTS 

Definition at line 68 of file libsas.h.

Enumerator:
DIRECT_ROUTING 
SUBTRACTIVE_ROUTING 
TABLE_ROUTING 

Definition at line 103 of file libsas.h.

enum sas_class
Enumerator:
SAS 
EXPANDER 

Definition at line 43 of file libsas.h.

Enumerator:
SAS_HA_REGISTERED 
SAS_HA_DRAINING 
SAS_HA_ATA_EH_ACTIVE 
SAS_HA_FROZEN 

Definition at line 389 of file libsas.h.

Enumerator:
PHY_ROLE_NONE 
PHY_ROLE_TARGET 
PHY_ROLE_INITIATOR 

Definition at line 48 of file libsas.h.

Enumerator:
PHY_TYPE_PHYSICAL 
PHY_TYPE_VIRTUAL 

Definition at line 54 of file libsas.h.

Enumerator:
SAS_TASK_COMPLETE 
SAS_TASK_UNDELIVERED 

Definition at line 512 of file libsas.h.

Enumerator:
TASK_ATTR_SIMPLE 
TASK_ATTR_HOQ 
TASK_ATTR_ORDERED 
TASK_ATTR_ACA 

Definition at line 597 of file libsas.h.

Function Documentation

struct sas_task* sas_alloc_slow_task ( gfp_t  flags)
read

Definition at line 57 of file sas_init.c.

struct sas_task* sas_alloc_task ( gfp_t  flags)
read

Definition at line 43 of file sas_init.c.

int sas_bios_param ( struct scsi_device ,
struct block_device ,
sector_t  capacity,
int hsc 
)

Definition at line 1000 of file sas_scsi_host.c.

int sas_change_queue_depth ( struct scsi_device ,
int  new_depth,
int  reason 
)

Definition at line 957 of file sas_scsi_host.c.

int sas_change_queue_type ( struct scsi_device ,
int  qt 
)

Definition at line 982 of file sas_scsi_host.c.

int sas_discover_end_dev ( struct domain_device dev)

sas_discover_end_dev – discover an end device (SSP, etc) : pointer to domain device of interest

See comment in sas_discover_sata().

Definition at line 290 of file sas_discover.c.

int sas_discover_event ( struct asd_sas_port ,
enum discover_event  ev 
)

Definition at line 551 of file sas_discover.c.

int sas_discover_root_expander ( struct domain_device )

Definition at line 1640 of file sas_expander.c.

int sas_discover_sata ( struct domain_device dev)

sas_discover_sata – discover an STP/SATA domain device : pointer to struct domain_device of interest

Devices directly attached to a HA port, have no parents. All other devices do, and should have their "parent" pointer set appropriately before calling this function.

Definition at line 796 of file sas_ata.c.

struct scsi_transport_template* sas_domain_attach_transport ( struct sas_domain_function_template )
read

Definition at line 573 of file sas_init.c.

void sas_domain_release_transport ( struct scsi_transport_template )

Definition at line 592 of file sas_init.c.

int sas_drain_work ( struct sas_ha_struct ha)

Definition at line 78 of file sas_event.c.

int sas_eh_abort_handler ( struct scsi_cmnd cmd)

Definition at line 534 of file sas_scsi_host.c.

int sas_eh_bus_reset_handler ( struct scsi_cmnd cmd)

Definition at line 579 of file sas_scsi_host.c.

int sas_eh_device_reset_handler ( struct scsi_cmnd cmd)

Definition at line 556 of file sas_scsi_host.c.

int sas_ex_revalidate_domain ( struct domain_device port_dev)

sas_revalidate_domain – revalidate the domain : port to the domain of interest

NOTE: this process must quit (return) as soon as any connection errors are encountered. Connection recovery is done elsewhere. Discover process only interrogates devices in order to discover the domain.

Definition at line 2096 of file sas_expander.c.

void sas_free_task ( struct sas_task task)

Definition at line 77 of file sas_init.c.

struct sas_phy* sas_get_local_phy ( struct domain_device dev)
read

Definition at line 443 of file sas_scsi_host.c.

void sas_hash_addr ( u8 hashed,
const u8 sas_addr 
)

Definition at line 88 of file sas_init.c.

void sas_init_dev ( struct domain_device )

Definition at line 39 of file sas_discover.c.

void sas_init_disc ( struct sas_discovery disc,
struct asd_sas_port port 
)

sas_init_disc – initialize the discovery struct in the port : pointer to struct port

Called when the ports are being initialized.

Definition at line 572 of file sas_discover.c.

void sas_init_ex_attr ( void  )
int sas_ioctl ( struct scsi_device sdev,
int  cmd,
void __user arg 
)

Definition at line 870 of file sas_scsi_host.c.

int sas_phy_reset ( struct sas_phy phy,
int  hard_reset 
)

Definition at line 320 of file sas_init.c.

void sas_prep_resume_ha ( struct sas_ha_struct sas_ha)

Definition at line 388 of file sas_init.c.

int sas_queue_up ( struct sas_task task)

Definition at line 182 of file sas_scsi_host.c.

int sas_queuecommand ( struct Scsi_Host ,
struct scsi_cmnd  
)

Definition at line 202 of file sas_scsi_host.c.

int sas_register_ha ( struct sas_ha_struct )

Definition at line 122 of file sas_init.c.

int sas_request_addr ( struct Scsi_Host shost,
u8 addr 
)

Definition at line 1187 of file sas_scsi_host.c.

void sas_resume_ha ( struct sas_ha_struct sas_ha)

Definition at line 420 of file sas_init.c.

int sas_set_phy_speed ( struct sas_phy phy,
struct sas_phy_linkrates rates 
)

Definition at line 349 of file sas_init.c.

int sas_slave_alloc ( struct scsi_device )
int sas_slave_configure ( struct scsi_device )

Definition at line 924 of file sas_scsi_host.c.

int sas_smp_handler ( struct Scsi_Host shost,
struct sas_rphy rphy,
struct request req 
)

Definition at line 2121 of file sas_expander.c.

void sas_ssp_task_response ( struct device dev,
struct sas_task task,
struct ssp_response_iu *  iu 
)

Definition at line 7 of file sas_task.c.

void sas_suspend_ha ( struct sas_ha_struct sas_ha)

Definition at line 453 of file sas_init.c.

int sas_target_alloc ( struct scsi_target )

Definition at line 909 of file sas_scsi_host.c.

void sas_target_destroy ( struct scsi_target )

Definition at line 1159 of file sas_scsi_host.c.

void sas_task_abort ( struct sas_task )

Definition at line 1131 of file sas_scsi_host.c.

void sas_unregister_dev ( struct asd_sas_port port,
struct domain_device  
)

Definition at line 373 of file sas_discover.c.

void sas_unregister_domain_devices ( struct asd_sas_port port,
int  gone 
)

Definition at line 391 of file sas_discover.c.

int sas_unregister_ha ( struct sas_ha_struct )

Definition at line 194 of file sas_init.c.