Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
aic94xx_tmf.c File Reference
#include <linux/spinlock.h>
#include <linux/gfp.h>
#include "aic94xx.h"
#include "aic94xx_sas.h"
#include "aic94xx_hwi.h"

Go to the source code of this file.

Data Structures

struct  tasklet_completion_status
 

Macros

#define DECLARE_TCS(tcs)
 
#define CLEAR_NEXUS_PRE
 
#define CLEAR_NEXUS_POST
 

Enumerations

enum  clear_nexus_phase { NEXUS_PHASE_PRE, NEXUS_PHASE_POST, NEXUS_PHASE_RESUME }
 

Functions

int asd_clear_nexus_ha (struct sas_ha_struct *sas_ha)
 
int asd_clear_nexus_port (struct asd_sas_port *port)
 
int asd_I_T_nexus_reset (struct domain_device *dev)
 
int asd_abort_task (struct sas_task *task)
 
int asd_abort_task_set (struct domain_device *dev, u8 *lun)
 
int asd_clear_aca (struct domain_device *dev, u8 *lun)
 
int asd_clear_task_set (struct domain_device *dev, u8 *lun)
 
int asd_lu_reset (struct domain_device *dev, u8 *lun)
 
int asd_query_task (struct sas_task *task)
 

Variables

struct tasklet_completion_status __attribute__
 

Macro Definition Documentation

#define CLEAR_NEXUS_POST
Value:
ASD_DPRINTK("%s: POST\n", __func__); \
res = asd_enqueue_internal(ascb, asd_clear_nexus_tasklet_complete, \
asd_clear_nexus_timedout); \
if (res) \
goto out_err; \
ASD_DPRINTK("%s: clear nexus posted, waiting...\n", __func__); \
wait_for_completion(&completion); \
res = tcs.dl_opcode; \
if (res == TC_NO_ERROR) \
return res; \
out_err: \
asd_ascb_free(ascb); \
return res

Definition at line 118 of file aic94xx_tmf.c.

#define CLEAR_NEXUS_PRE
Value:
struct asd_ascb *ascb; \
int res; \
DECLARE_COMPLETION_ONSTACK(completion); \
DECLARE_TCS(tcs); \
ASD_DPRINTK("%s: PRE\n", __func__); \
res = 1; \
ascb = asd_ascb_alloc_list(asd_ha, &res, GFP_KERNEL); \
if (!ascb) \
return -ENOMEM; \
\
ascb->completion = &completion; \
ascb->uldd_task = &tcs; \
scb = ascb->scb; \

Definition at line 100 of file aic94xx_tmf.c.

#define DECLARE_TCS (   tcs)
Value:
struct tasklet_completion_status tcs = { \
.dl_opcode = 0, \
.tmf_state = 0, \
.tag_valid = 0, \
.tag = 0, \
}

Definition at line 66 of file aic94xx_tmf.c.

Enumeration Type Documentation

Enumerator:
NEXUS_PHASE_PRE 
NEXUS_PHASE_POST 
NEXUS_PHASE_RESUME 

Definition at line 153 of file aic94xx_tmf.c.

Function Documentation

int asd_abort_task ( struct sas_task task)

asd_abort_task – ABORT TASK TMF : the task to be aborted

Before calling ABORT TASK the task state flags should be ORed with SAS_TASK_STATE_ABORTED (unless SAS_TASK_STATE_DONE is set) under the task_state_lock IRQ spinlock, then ABORT TASK must be called.

Implements the ABORT TASK TMF, I_T_L_Q nexus. Returns: SAS TMF responses (see sas_task.h), -ENOMEM, -SAS_QUEUE_FULL.

When ABORT TASK returns, the caller of ABORT TASK checks first the task->task_state_flags, and then the return value of ABORT TASK.

If the task has task state bit SAS_TASK_STATE_DONE set, then the task was completed successfully prior to it being aborted. The caller of ABORT TASK has responsibility to call task->task_done() xor free the task, depending on their framework. The return code is TMF_RESP_FUNC_FAILED in this case.

Else the SAS_TASK_STATE_DONE bit is not set, If the return code is TMF_RESP_FUNC_COMPLETE, then the task was aborted successfully. The caller of ABORT TASK has responsibility to call task->task_done() to finish the task, xor free the task depending on their framework. else the ABORT TASK returned some kind of error. The task was not cancelled. Nothing can be assumed. The caller of ABORT TASK may wish to retry.

Definition at line 405 of file aic94xx_tmf.c.

int asd_abort_task_set ( struct domain_device dev,
u8 lun 
)

Definition at line 657 of file aic94xx_tmf.c.

int asd_clear_aca ( struct domain_device dev,
u8 lun 
)

Definition at line 666 of file aic94xx_tmf.c.

int asd_clear_nexus_ha ( struct sas_ha_struct sas_ha)

Definition at line 134 of file aic94xx_tmf.c.

int asd_clear_nexus_port ( struct asd_sas_port port)

Definition at line 143 of file aic94xx_tmf.c.

int asd_clear_task_set ( struct domain_device dev,
u8 lun 
)

Definition at line 675 of file aic94xx_tmf.c.

int asd_I_T_nexus_reset ( struct domain_device dev)

Definition at line 181 of file aic94xx_tmf.c.

int asd_lu_reset ( struct domain_device dev,
u8 lun 
)

Definition at line 684 of file aic94xx_tmf.c.

int asd_query_task ( struct sas_task task)

asd_query_task – send a QUERY TASK TMF to an I_T_L_Q nexus task: pointer to sas_task struct of interest

Returns: TMF_RESP_FUNC_COMPLETE if the task is not in the task set, or TMF_RESP_FUNC_SUCC if the task is in the task set.

Normally the management layer sets the task to aborted state, and then calls query task and then abort task.

Definition at line 703 of file aic94xx_tmf.c.

Variable Documentation