Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
host.c File Reference
#include <linux/circ_buf.h>
#include <linux/device.h>
#include <scsi/sas.h>
#include "host.h"
#include "isci.h"
#include "port.h"
#include "probe_roms.h"
#include "remote_device.h"
#include "request.h"
#include "scu_completion_codes.h"
#include "scu_event_codes.h"
#include "registers.h"
#include "scu_remote_node_context.h"
#include "scu_task_context.h"

Go to the source code of this file.

Macros

#define SCU_CONTEXT_RAM_INIT_STALL_TIME   200
 
#define smu_max_ports(dcc_value)
 
#define smu_max_task_contexts(dcc_value)
 
#define smu_max_rncs(dcc_value)
 
#define SCIC_SDS_CONTROLLER_PHY_START_TIMEOUT   100
 
#define SCIC_SDS_CONTROLLER_POWER_CONTROL_INTERVAL   500
 
#define NORMALIZE_PUT_POINTER(x)   ((x) & SMU_COMPLETION_QUEUE_PUT_POINTER_MASK)
 
#define NORMALIZE_EVENT_POINTER(x)
 
#define NORMALIZE_GET_POINTER(x)   ((x) & SMU_COMPLETION_QUEUE_GET_POINTER_MASK)
 
#define NORMALIZE_GET_POINTER_CYCLE_BIT(x)   ((SMU_CQGR_CYCLE_BIT & (x)) << (31 - SMU_COMPLETION_QUEUE_GET_CYCLE_BIT_SHIFT))
 
#define COMPLETION_QUEUE_CYCLE_BIT(x)   ((x) & 0x80000000)
 
#define INTERRUPT_COALESCE_TIMEOUT_BASE_RANGE_LOWER_BOUND_NS   853
 
#define INTERRUPT_COALESCE_TIMEOUT_BASE_RANGE_UPPER_BOUND_NS   1280
 
#define INTERRUPT_COALESCE_TIMEOUT_MAX_US   2700000
 
#define INTERRUPT_COALESCE_NUMBER_MAX   256
 
#define INTERRUPT_COALESCE_TIMEOUT_ENCODE_MIN   7
 
#define INTERRUPT_COALESCE_TIMEOUT_ENCODE_MAX   28
 
#define AFE_REGISTER_WRITE_DELAY   10
 

Functions

void sci_init_sm (struct sci_base_state_machine *sm, const struct sci_base_state *state_table, u32 initial_state)
 
void sci_change_state (struct sci_base_state_machine *sm, u32 next_state)
 
irqreturn_t isci_msix_isr (int vec, void *data)
 
irqreturn_t isci_intx_isr (int vec, void *data)
 
irqreturn_t isci_error_isr (int vec, void *data)
 
int isci_host_scan_finished (struct Scsi_Host *shost, unsigned long time)
 
void sci_controller_disable_interrupts (struct isci_host *ihost)
 
void sci_controller_transition_to_ready (struct isci_host *ihost, enum sci_status status)
 
bool is_controller_start_complete (struct isci_host *ihost)
 
void isci_host_start (struct Scsi_Host *shost)
 
void ireq_done (struct isci_host *ihost, struct isci_request *ireq, struct sas_task *task)
 
void isci_host_completion_routine (unsigned long data)
 
void isci_host_deinit (struct isci_host *ihost)
 
int sci_oem_parameters_validate (struct sci_oem_params *oem, u8 version)
 
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)
 
enum cable_selections decode_cable_selection (struct isci_host *ihost, int phy)
 
charlookup_cable_names (enum cable_selections selection)
 
int isci_host_init (struct isci_host *ihost)
 
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)
 
bool sci_controller_has_remote_devices_stopping (struct isci_host *ihost)
 
void sci_controller_remote_device_stopped (struct isci_host *ihost, struct isci_remote_device *idev)
 
void sci_controller_post_request (struct isci_host *ihost, u32 request)
 
struct isci_requestsci_request_by_tag (struct isci_host *ihost, u16 io_tag)
 
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)
 
void sci_controller_copy_sata_response (void *response_buffer, void *frame_header, void *frame_buffer)
 
void sci_controller_release_frame (struct isci_host *ihost, u32 frame_index)
 
void isci_tci_free (struct isci_host *ihost, u16 tci)
 
u16 isci_alloc_tag (struct isci_host *ihost)
 
enum sci_status isci_free_tag (struct isci_host *ihost, u16 io_tag)
 
enum sci_status sci_controller_start_io (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)
 
enum sci_status sci_controller_continue_io (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)
 
int isci_gpio_write (struct sas_ha_struct *sas_ha, u8 reg_type, u8 reg_index, u8 reg_count, u8 *write_data)
 

Macro Definition Documentation

#define AFE_REGISTER_WRITE_DELAY   10

Definition at line 1921 of file host.c.

#define COMPLETION_QUEUE_CYCLE_BIT (   x)    ((x) & 0x80000000)

COMPLETION_QUEUE_CYCLE_BIT() -

This macro will return the cycle bit of the completion queue entry

Definition at line 146 of file host.c.

#define INTERRUPT_COALESCE_NUMBER_MAX   256

Definition at line 1327 of file host.c.

#define INTERRUPT_COALESCE_TIMEOUT_BASE_RANGE_LOWER_BOUND_NS   853

Definition at line 1324 of file host.c.

#define INTERRUPT_COALESCE_TIMEOUT_BASE_RANGE_UPPER_BOUND_NS   1280

Definition at line 1325 of file host.c.

#define INTERRUPT_COALESCE_TIMEOUT_ENCODE_MAX   28

Definition at line 1329 of file host.c.

#define INTERRUPT_COALESCE_TIMEOUT_ENCODE_MIN   7

Definition at line 1328 of file host.c.

#define INTERRUPT_COALESCE_TIMEOUT_MAX_US   2700000

Definition at line 1326 of file host.c.

#define NORMALIZE_EVENT_POINTER (   x)
Value:

NORMALIZE_EVENT_POINTER() -

This macro will normalize the completion queue event entry so its value can be used as an index.

Definition at line 117 of file host.c.

#define NORMALIZE_GET_POINTER (   x)    ((x) & SMU_COMPLETION_QUEUE_GET_POINTER_MASK)

NORMALIZE_GET_POINTER() -

This macro will normalize the completion queue get pointer so its value can be used as an index into an array

Definition at line 129 of file host.c.

#define NORMALIZE_GET_POINTER_CYCLE_BIT (   x)    ((SMU_CQGR_CYCLE_BIT & (x)) << (31 - SMU_COMPLETION_QUEUE_GET_CYCLE_BIT_SHIFT))

NORMALIZE_GET_POINTER_CYCLE_BIT() -

This macro will normalize the completion queue cycle pointer so it matches the completion queue cycle bit

Definition at line 138 of file host.c.

#define NORMALIZE_PUT_POINTER (   x)    ((x) & SMU_COMPLETION_QUEUE_PUT_POINTER_MASK)

NORMALIZE_PUT_POINTER() -

This macro will normalize the completion queue put pointer so its value can be used as an array inde

Definition at line 107 of file host.c.

#define SCIC_SDS_CONTROLLER_PHY_START_TIMEOUT   100

Definition at line 90 of file host.c.

#define SCIC_SDS_CONTROLLER_POWER_CONTROL_INTERVAL   500

The number of milliseconds to wait while a given phy is consuming power before allowing another set of phys to consume power. Ultimately, this will be specified by OEM parameter.

Definition at line 99 of file host.c.

#define SCU_CONTEXT_RAM_INIT_STALL_TIME   200

Definition at line 70 of file host.c.

#define smu_max_ports (   dcc_value)
Value:

Definition at line 72 of file host.c.

#define smu_max_rncs (   dcc_value)
Value:

Definition at line 84 of file host.c.

#define smu_max_task_contexts (   dcc_value)
Value:

Definition at line 78 of file host.c.

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.

u16 isci_alloc_tag ( struct isci_host ihost)

Definition at line 2573 of file host.c.

irqreturn_t isci_error_isr ( int  vec,
void data 
)

Definition at line 627 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 sas_ha,
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 shost,
unsigned long  time 
)

Definition at line 654 of file host.c.

void isci_host_start ( struct Scsi_Host shost)

Definition at line 1047 of file host.c.

irqreturn_t isci_intx_isr ( int  vec,
void data 
)

Definition at line 608 of file host.c.

irqreturn_t isci_msix_isr ( int  vec,
void data 
)

Definition at line 220 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  selection)

Definition at line 1909 of file host.c.

void sci_change_state ( struct sci_base_state_machine sm,
u32  next_state 
)

Definition at line 165 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_init_sm ( struct sci_base_state_machine sm,
const struct sci_base_state state_table,
u32  initial_state 
)

Definition at line 149 of file host.c.

int sci_oem_parameters_validate ( struct sci_oem_params oem,
u8  version 
)

Definition at line 1654 of file host.c.

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

Definition at line 2460 of file host.c.