Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Enumerations | Functions
host.h File Reference
#include <scsi/sas_ata.h>
#include "remote_device.h"
#include "phy.h"
#include "isci.h"
#include "remote_node_table.h"
#include "registers.h"
#include "unsolicited_frame_control.h"
#include "probe_roms.h"

Go to the source code of this file.

Data Structures

struct  sci_power_control
 
struct  sci_port_configuration_agent
 
struct  isci_host
 
struct  isci_pci_info
 

Macros

#define IHOST_START_PENDING   0
 
#define IHOST_STOP_PENDING   1
 
#define IHOST_IRQ_ENABLED   2
 
#define SCI_MAX_MSIX_INT   (SCI_NUM_MSI_X_INT*SCI_MAX_CONTROLLERS)
 
#define for_each_isci_host(id, ihost, pdev)
 
#define ISCI_PEG   0
 
#define ISCI_TAG(seq, tci)   (((u16) (seq)) << 12 | tci)
 
#define ISCI_TAG_SEQ(tag)   (((tag) >> 12) & (SCI_MAX_SEQ-1))
 
#define ISCI_TAG_TCI(tag)   ((tag) & (SCI_MAX_IO_REQUESTS-1))
 
#define ISCI_COALESCE_BASE   9
 
#define sci_controller_clear_invalid_phy(controller, phy)   ((controller)->invalid_phy_mask &= ~(1 << (phy)->phy_index))
 
#define CABLE_OVERRIDE_DISABLED   (0x10000)
 
#define SGPIO_HW_CONTROL   0x00000443
 

Typedefs

typedef void(* port_config_fn )(struct isci_host *, struct sci_port_configuration_agent *, struct isci_port *, struct isci_phy *)
 

Enumerations

enum  sci_controller_states {
  SCIC_INITIAL = 0, SCIC_RESET, SCIC_INITIALIZING, SCIC_INITIALIZED,
  SCIC_STARTING, SCIC_READY, SCIC_RESETTING, SCIC_STOPPING,
  SCIC_FAILED
}
 
enum  cable_selections { short_cable = 0, long_cable = 1, medium_cable = 2, undefined_cable = 3 }
 

Functions

bool is_port_config_apc (struct isci_host *ihost)
 
bool is_controller_start_complete (struct isci_host *ihost)
 
enum cable_selections decode_cable_selection (struct isci_host *ihost, int phy)
 
void validate_cable_selections (struct isci_host *ihost)
 
charlookup_cable_names (enum cable_selections)
 
void sci_controller_post_request (struct isci_host *ihost, u32 request)
 
void sci_controller_release_frame (struct isci_host *ihost, u32 frame_index)
 
void sci_controller_copy_sata_response (void *response_buffer, void *frame_header, void *frame_buffer)
 
enum sci_status sci_controller_allocate_remote_node_context (struct isci_host *ihost, struct isci_remote_device *idev, u16 *node_id)
 
void sci_controller_free_remote_node_context (struct isci_host *ihost, struct isci_remote_device *idev, u16 node_id)
 
struct isci_requestsci_request_by_tag (struct isci_host *ihost, u16 io_tag)
 
void sci_controller_power_control_queue_insert (struct isci_host *ihost, struct isci_phy *iphy)
 
void sci_controller_power_control_queue_remove (struct isci_host *ihost, struct isci_phy *iphy)
 
void sci_controller_link_up (struct isci_host *ihost, struct isci_port *iport, struct isci_phy *iphy)
 
void sci_controller_link_down (struct isci_host *ihost, struct isci_port *iport, struct isci_phy *iphy)
 
void sci_controller_remote_device_stopped (struct isci_host *ihost, struct isci_remote_device *idev)
 
enum sci_status sci_controller_continue_io (struct isci_request *ireq)
 
int isci_host_scan_finished (struct Scsi_Host *, unsigned long)
 
void isci_host_start (struct Scsi_Host *)
 
u16 isci_alloc_tag (struct isci_host *ihost)
 
enum sci_status isci_free_tag (struct isci_host *ihost, u16 io_tag)
 
void isci_tci_free (struct isci_host *ihost, u16 tci)
 
void ireq_done (struct isci_host *ihost, struct isci_request *ireq, struct sas_task *task)
 
int isci_host_init (struct isci_host *)
 
void isci_host_completion_routine (unsigned long data)
 
void isci_host_deinit (struct isci_host *)
 
void sci_controller_disable_interrupts (struct isci_host *ihost)
 
bool sci_controller_has_remote_devices_stopping (struct isci_host *ihost)
 
void sci_controller_transition_to_ready (struct isci_host *ihost, enum sci_status status)
 
enum sci_status sci_controller_start_io (struct isci_host *ihost, struct isci_remote_device *idev, struct isci_request *ireq)
 
enum sci_task_status sci_controller_start_task (struct isci_host *ihost, struct isci_remote_device *idev, struct isci_request *ireq)
 
enum sci_status sci_controller_terminate_request (struct isci_host *ihost, struct isci_remote_device *idev, struct isci_request *ireq)
 
enum sci_status sci_controller_complete_io (struct isci_host *ihost, struct isci_remote_device *idev, struct isci_request *ireq)
 
void sci_port_configuration_agent_construct (struct sci_port_configuration_agent *port_agent)
 
enum sci_status sci_port_configuration_agent_initialize (struct isci_host *ihost, struct sci_port_configuration_agent *port_agent)
 
int isci_gpio_write (struct sas_ha_struct *, u8 reg_type, u8 reg_index, u8 reg_count, u8 *write_data)
 

Macro Definition Documentation

#define CABLE_OVERRIDE_DISABLED   (0x10000)

Definition at line 424 of file host.h.

#define for_each_isci_host (   id,
  ihost,
  pdev 
)
Value:
for (id = 0, ihost = to_pci_info(pdev)->hosts[id]; \
id < ARRAY_SIZE(to_pci_info(pdev)->hosts) && ihost; \
ihost = to_pci_info(pdev)->hosts[++id])

Definition at line 313 of file host.h.

#define IHOST_IRQ_ENABLED   2

Definition at line 203 of file host.h.

#define IHOST_START_PENDING   0

Definition at line 201 of file host.h.

#define IHOST_STOP_PENDING   1

Definition at line 202 of file host.h.

#define ISCI_COALESCE_BASE   9

Definition at line 359 of file host.h.

#define ISCI_PEG   0

Definition at line 349 of file host.h.

#define ISCI_TAG (   seq,
  tci 
)    (((u16) (seq)) << 12 | tci)

Definition at line 352 of file host.h.

#define ISCI_TAG_SEQ (   tag)    (((tag) >> 12) & (SCI_MAX_SEQ-1))

Definition at line 355 of file host.h.

#define ISCI_TAG_TCI (   tag)    ((tag) & (SCI_MAX_IO_REQUESTS-1))

Definition at line 356 of file host.h.

#define sci_controller_clear_invalid_phy (   controller,
  phy 
)    ((controller)->invalid_phy_mask &= ~(1 << (phy)->phy_index))

sci_controller_clear_invalid_phy() -

This macro will clear the bit in the invalid phy mask for this controller object. This is used to control messages reported for invalid link up notifications.

Definition at line 378 of file host.h.

#define SCI_MAX_MSIX_INT   (SCI_NUM_MSI_X_INT*SCI_MAX_CONTROLLERS)

struct isci_pci_info - This class represents the pci function containing the controllers. Depending on PCI SKU, there could be up to 2 controllers in the PCI function.

Definition at line 295 of file host.h.

#define SGPIO_HW_CONTROL   0x00000443

Definition at line 440 of file host.h.

Typedef Documentation

Definition at line 109 of file host.h.

Enumeration Type Documentation

Enumerator:
short_cable 
long_cable 
medium_cable 
undefined_cable 

Definition at line 417 of file host.h.

enum sci_controller_states - This enumeration depicts all the states for the common controller state machine.

Enumerator:
SCIC_INITIAL 

Simply the initial state for the base controller state machine.

SCIC_RESET 

This state indicates that the controller is reset. The memory for the controller is in it's initial state, but the controller requires initialization. This state is entered from the INITIAL state. This state is entered from the RESETTING state.

SCIC_INITIALIZING 

This state is typically an action state that indicates the controller is in the process of initialization. In this state no new IO operations are permitted. This state is entered from the RESET state.

SCIC_INITIALIZED 

This state indicates that the controller has been successfully initialized. In this state no new IO operations are permitted. This state is entered from the INITIALIZING state.

SCIC_STARTING 

This state indicates the the controller is in the process of becoming ready (i.e. starting). In this state no new IO operations are permitted. This state is entered from the INITIALIZED state.

SCIC_READY 

This state indicates the controller is now ready. Thus, the user is able to perform IO operations on the controller. This state is entered from the STARTING state.

SCIC_RESETTING 

This state is typically an action state that indicates the controller is in the process of resetting. Thus, the user is unable to perform IO operations on the controller. A reset is considered destructive in most cases. This state is entered from the READY state. This state is entered from the FAILED state. This state is entered from the STOPPED state.

SCIC_STOPPING 

This state indicates that the controller is in the process of stopping. In this state no new IO operations are permitted, but existing IO operations are allowed to complete. This state is entered from the READY state.

SCIC_FAILED 

This state indicates that the controller could not successfully be initialized. In this state no new IO operations are permitted. This state is entered from the INITIALIZING state. This state is entered from the STARTING state. This state is entered from the STOPPING state. This state is entered from the RESETTING state.

Definition at line 216 of file host.h.

Function Documentation

enum cable_selections decode_cable_selection ( struct isci_host ihost,
int  phy 
)

Definition at line 1904 of file host.c.

void ireq_done ( struct isci_host ihost,
struct isci_request ireq,
struct sas_task task 
)

Definition at line 1080 of file host.c.

bool is_controller_start_complete ( struct isci_host ihost)

Definition at line 861 of file host.c.

bool is_port_config_apc ( struct isci_host ihost)

Definition at line 734 of file port_config.c.

u16 isci_alloc_tag ( struct isci_host ihost)

Definition at line 2573 of file host.c.

enum sci_status isci_free_tag ( struct isci_host ihost,
u16  io_tag 
)

Definition at line 2585 of file host.c.

int isci_gpio_write ( struct sas_ha_struct ,
u8  reg_type,
u8  reg_index,
u8  reg_count,
u8 write_data 
)

Definition at line 2792 of file host.c.

void isci_host_completion_routine ( unsigned long  data)

isci_host_completion_routine() - This function is the delayed service routine that calls the sci core library's completion handler. It's scheduled as a tasklet from the interrupt service routine when interrupts in use, or set as the timeout function in polled mode. : This parameter specifies the ISCI host object

Definition at line 1116 of file host.c.

void isci_host_deinit ( struct isci_host ihost)

isci_host_deinit - shutdown frame reception and dma : host to take down

This is called in either the driver shutdown or the suspend path. In the shutdown case libsas went through port teardown and normal device removal (i.e. physical links stayed up to service scsi_device removal commands). In the suspend case we disable the hardware without notifying libsas of the link down events since we want libsas to remember the domain across the suspend/resume cycle

Definition at line 1241 of file host.c.

int isci_host_init ( struct isci_host ihost)

isci_host_init - (re-)initialize hardware and internal (private) state : host to init

Any public facing objects (like asd_sas_port, and asd_sas_phys), or one-time initialization objects like locks and waitqueues, are not touched (they are initialized in isci_host_alloc)

Definition at line 2341 of file host.c.

int isci_host_scan_finished ( struct Scsi_Host ,
unsigned  long 
)

Definition at line 654 of file host.c.

void isci_host_start ( struct Scsi_Host )

Definition at line 1047 of file host.c.

void isci_tci_free ( struct isci_host ihost,
u16  tci 
)

Definition at line 2551 of file host.c.

char* lookup_cable_names ( enum  cable_selections)

Definition at line 1909 of file host.c.

enum sci_status sci_controller_allocate_remote_node_context ( struct isci_host ihost,
struct isci_remote_device idev,
u16 node_id 
)

This method allocates remote node index and the reserves the remote node context space for use. This method can fail if there are no more remote node index available. : This is the controller object which contains the set of free remote node ids : This is the device object which is requesting the a remote node id : This is the remote node id that is assinged to the device if one is available

enum sci_status SCI_FAILURE_OUT_OF_RESOURCES if there are no available remote node index available.

Definition at line 2495 of file host.c.

enum sci_status sci_controller_complete_io ( struct isci_host ihost,
struct isci_remote_device idev,
struct isci_request ireq 
)

sci_controller_complete_io() - This method will perform core specific completion operations for an IO request. After this method is invoked, the user should consider the IO request as invalid until it is properly reused (i.e. re-constructed). : The handle to the controller object for which to complete the IO request. : The handle to the remote device object for which to complete the IO request. : the handle to the io request object to complete.

Definition at line 2669 of file host.c.

enum sci_status sci_controller_continue_io ( struct isci_request ireq)

Definition at line 2696 of file host.c.

void sci_controller_copy_sata_response ( void response_buffer,
void frame_header,
void frame_buffer 
)

Definition at line 2532 of file host.c.

void sci_controller_disable_interrupts ( struct isci_host ihost)

Definition at line 710 of file host.c.

void sci_controller_free_remote_node_context ( struct isci_host ihost,
struct isci_remote_device idev,
u16  node_id 
)

Definition at line 2517 of file host.c.

bool sci_controller_has_remote_devices_stopping ( struct isci_host ihost)

Definition at line 2423 of file host.c.

void sci_controller_link_down ( struct isci_host ihost,
struct isci_port iport,
struct isci_phy iphy 
)

Definition at line 2404 of file host.c.

void sci_controller_link_up ( struct isci_host ihost,
struct isci_port iport,
struct isci_phy iphy 
)

Definition at line 2381 of file host.c.

void sci_controller_post_request ( struct isci_host ihost,
u32  request 
)

Definition at line 2452 of file host.c.

void sci_controller_power_control_queue_insert ( struct isci_host ihost,
struct isci_phy iphy 
)

Definition at line 1814 of file host.c.

void sci_controller_power_control_queue_remove ( struct isci_host ihost,
struct isci_phy iphy 
)

Definition at line 1866 of file host.c.

void sci_controller_release_frame ( struct isci_host ihost,
u32  frame_index 
)

Definition at line 2544 of file host.c.

void sci_controller_remote_device_stopped ( struct isci_host ihost,
struct isci_remote_device idev 
)

Definition at line 2436 of file host.c.

enum sci_status sci_controller_start_io ( struct isci_host ihost,
struct isci_remote_device idev,
struct isci_request ireq 
)

Definition at line 2604 of file host.c.

enum sci_task_status sci_controller_start_task ( struct isci_host ihost,
struct isci_remote_device idev,
struct isci_request ireq 
)

sci_controller_start_task() - This method is called by the SCIC user to send/start a framework task management request. : the handle to the controller object for which to start the task management request. : the handle to the remote device object for which to start the task management request. : the handle to the task request object to start.

Definition at line 2720 of file host.c.

enum sci_status sci_controller_terminate_request ( struct isci_host ihost,
struct isci_remote_device idev,
struct isci_request ireq 
)

Definition at line 2625 of file host.c.

void sci_controller_transition_to_ready ( struct isci_host ihost,
enum sci_status  status 
)

Definition at line 825 of file host.c.

void sci_port_configuration_agent_construct ( struct sci_port_configuration_agent port_agent)

This method will construct the port configuration agent for operation. This call is universal for both manual port configuration and automatic port configuration modes.

Definition at line 715 of file port_config.c.

enum sci_status sci_port_configuration_agent_initialize ( struct isci_host ihost,
struct sci_port_configuration_agent port_agent 
)

Definition at line 739 of file port_config.c.

struct isci_request* sci_request_by_tag ( struct isci_host ihost,
u16  io_tag 
)
read

Definition at line 2460 of file host.c.

void validate_cable_selections ( struct isci_host ihost)