Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Enumerations | Functions
zfcp_erp.c File Reference
#include <linux/kthread.h>
#include "zfcp_ext.h"
#include "zfcp_reqlist.h"

Go to the source code of this file.

Macros

#define KMSG_COMPONENT   "zfcp"
 
#define pr_fmt(fmt)   KMSG_COMPONENT ": " fmt
 
#define ZFCP_MAX_ERPS   3
 

Enumerations

enum  zfcp_erp_act_flags {
  ZFCP_STATUS_ERP_TIMEDOUT = 0x10000000, ZFCP_STATUS_ERP_CLOSE_ONLY = 0x01000000, ZFCP_STATUS_ERP_DISMISSING = 0x00100000, ZFCP_STATUS_ERP_DISMISSED = 0x00200000,
  ZFCP_STATUS_ERP_LOWMEM = 0x00400000, ZFCP_STATUS_ERP_NO_REF = 0x00800000
}
 
enum  zfcp_erp_steps {
  ZFCP_ERP_STEP_UNINITIALIZED = 0x0000, ZFCP_ERP_STEP_FSF_XCONFIG = 0x0001, ZFCP_ERP_STEP_PHYS_PORT_CLOSING = 0x0010, ZFCP_ERP_STEP_PORT_CLOSING = 0x0100,
  ZFCP_ERP_STEP_PORT_OPENING = 0x0800, ZFCP_ERP_STEP_LUN_CLOSING = 0x1000, ZFCP_ERP_STEP_LUN_OPENING = 0x2000
}
 
enum  zfcp_erp_act_type { ZFCP_ERP_ACTION_REOPEN_LUN = 1, ZFCP_ERP_ACTION_REOPEN_PORT = 2, ZFCP_ERP_ACTION_REOPEN_PORT_FORCED = 3, ZFCP_ERP_ACTION_REOPEN_ADAPTER = 4 }
 
enum  zfcp_erp_act_state { ZFCP_ERP_ACTION_RUNNING = 1, ZFCP_ERP_ACTION_READY = 2 }
 
enum  zfcp_erp_act_result {
  ZFCP_ERP_SUCCEEDED = 0, ZFCP_ERP_FAILED = 1, ZFCP_ERP_CONTINUES = 2, ZFCP_ERP_EXIT = 3,
  ZFCP_ERP_DISMISSED = 4, ZFCP_ERP_NOMEM = 5
}
 

Functions

void zfcp_erp_adapter_reopen (struct zfcp_adapter *adapter, int clear, char *id)
 
void zfcp_erp_adapter_shutdown (struct zfcp_adapter *adapter, int clear, char *id)
 
void zfcp_erp_port_shutdown (struct zfcp_port *port, int clear, char *id)
 
void zfcp_erp_port_forced_reopen (struct zfcp_port *port, int clear, char *id)
 
int zfcp_erp_port_reopen (struct zfcp_port *port, int clear, char *id)
 
void zfcp_erp_lun_reopen (struct scsi_device *sdev, int clear, char *id)
 
void zfcp_erp_lun_shutdown (struct scsi_device *sdev, int clear, char *id)
 
void zfcp_erp_lun_shutdown_wait (struct scsi_device *sdev, char *id)
 
void zfcp_erp_notify (struct zfcp_erp_action *erp_action, unsigned long set_mask)
 
void zfcp_erp_timeout_handler (unsigned long data)
 
int zfcp_erp_thread_setup (struct zfcp_adapter *adapter)
 
void zfcp_erp_thread_kill (struct zfcp_adapter *adapter)
 
void zfcp_erp_wait (struct zfcp_adapter *adapter)
 
void zfcp_erp_set_adapter_status (struct zfcp_adapter *adapter, u32 mask)
 
void zfcp_erp_clear_adapter_status (struct zfcp_adapter *adapter, u32 mask)
 
void zfcp_erp_set_port_status (struct zfcp_port *port, u32 mask)
 
void zfcp_erp_clear_port_status (struct zfcp_port *port, u32 mask)
 
void zfcp_erp_set_lun_status (struct scsi_device *sdev, u32 mask)
 
void zfcp_erp_clear_lun_status (struct scsi_device *sdev, u32 mask)
 

Macro Definition Documentation

#define KMSG_COMPONENT   "zfcp"

Definition at line 9 of file zfcp_erp.c.

#define pr_fmt (   fmt)    KMSG_COMPONENT ": " fmt

Definition at line 10 of file zfcp_erp.c.

#define ZFCP_MAX_ERPS   3

Definition at line 16 of file zfcp_erp.c.

Enumeration Type Documentation

Enumerator:
ZFCP_STATUS_ERP_TIMEDOUT 
ZFCP_STATUS_ERP_CLOSE_ONLY 
ZFCP_STATUS_ERP_DISMISSING 
ZFCP_STATUS_ERP_DISMISSED 
ZFCP_STATUS_ERP_LOWMEM 
ZFCP_STATUS_ERP_NO_REF 

Definition at line 18 of file zfcp_erp.c.

Enumerator:
ZFCP_ERP_SUCCEEDED 
ZFCP_ERP_FAILED 
ZFCP_ERP_CONTINUES 
ZFCP_ERP_EXIT 
ZFCP_ERP_DISMISSED 
ZFCP_ERP_NOMEM 

Definition at line 49 of file zfcp_erp.c.

Enumerator:
ZFCP_ERP_ACTION_RUNNING 
ZFCP_ERP_ACTION_READY 

Definition at line 44 of file zfcp_erp.c.

Enumerator:
ZFCP_ERP_ACTION_REOPEN_LUN 
ZFCP_ERP_ACTION_REOPEN_PORT 
ZFCP_ERP_ACTION_REOPEN_PORT_FORCED 
ZFCP_ERP_ACTION_REOPEN_ADAPTER 

Definition at line 37 of file zfcp_erp.c.

Enumerator:
ZFCP_ERP_STEP_UNINITIALIZED 
ZFCP_ERP_STEP_FSF_XCONFIG 
ZFCP_ERP_STEP_PHYS_PORT_CLOSING 
ZFCP_ERP_STEP_PORT_CLOSING 
ZFCP_ERP_STEP_PORT_OPENING 
ZFCP_ERP_STEP_LUN_CLOSING 
ZFCP_ERP_STEP_LUN_OPENING 

Definition at line 27 of file zfcp_erp.c.

Function Documentation

void zfcp_erp_adapter_reopen ( struct zfcp_adapter adapter,
int  clear,
char id 
)

zfcp_erp_adapter_reopen - Reopen adapter. : Adapter to reopen. : Status flags to clear. : Id for debug trace event.

Definition at line 286 of file zfcp_erp.c.

void zfcp_erp_adapter_shutdown ( struct zfcp_adapter adapter,
int  clear,
char id 
)

zfcp_erp_adapter_shutdown - Shutdown adapter. : Adapter to shut down. : Status flags to clear. : Id for debug trace event.

Definition at line 309 of file zfcp_erp.c.

void zfcp_erp_clear_adapter_status ( struct zfcp_adapter adapter,
u32  mask 
)

zfcp_erp_clear_adapter_status - clear adapter status bits : adapter to change the status : status bits to change

Changes in common status bits are propagated to attached ports and LUNs.

Definition at line 1449 of file zfcp_erp.c.

void zfcp_erp_clear_lun_status ( struct scsi_device sdev,
u32  mask 
)

zfcp_erp_clear_lun_status - clear lun status bits : SCSi device / lun to clear the status bits : status bits to change

Definition at line 1550 of file zfcp_erp.c.

void zfcp_erp_clear_port_status ( struct zfcp_port port,
u32  mask 
)

zfcp_erp_clear_port_status - clear port status bits : adapter to change the status : status bits to change

Changes in common status bits are propagated to attached LUNs.

Definition at line 1510 of file zfcp_erp.c.

void zfcp_erp_lun_reopen ( struct scsi_device sdev,
int  clear,
char id 
)

zfcp_erp_lun_reopen - initiate reopen of a LUN : SCSI device / LUN to be reopened : specifies flags in LUN status to be cleared : Id for debug trace event.

Return: 0 on success, < 0 on error

Definition at line 428 of file zfcp_erp.c.

void zfcp_erp_lun_shutdown ( struct scsi_device sdev,
int  clear,
char id 
)

zfcp_erp_lun_shutdown - Shutdown LUN : SCSI device / LUN to shut down. : Status flags to clear. : Id for debug trace event.

Definition at line 446 of file zfcp_erp.c.

void zfcp_erp_lun_shutdown_wait ( struct scsi_device sdev,
char id 
)

zfcp_erp_lun_shutdown_wait - Shutdown LUN and wait for erp completion : SCSI device / LUN to shut down. : Id for debug trace event.

Do not acquire a reference for the LUN when creating the ERP action. It is safe, because this function waits for the ERP to complete first. This allows to shutdown the LUN, even when the SCSI device is in the state SDEV_DEL when scsi_device_get will fail.

Definition at line 462 of file zfcp_erp.c.

void zfcp_erp_notify ( struct zfcp_erp_action erp_action,
unsigned long  set_mask 
)

zfcp_erp_notify - Trigger ERP action. : ERP action to continue. : ERP action status flags to set.

Definition at line 542 of file zfcp_erp.c.

void zfcp_erp_port_forced_reopen ( struct zfcp_port port,
int  clear,
char id 
)

zfcp_erp_port_forced_reopen - Forced close of port and open again : Port to force close and to reopen. : Status flags to clear. : Id for debug trace event.

Definition at line 353 of file zfcp_erp.c.

int zfcp_erp_port_reopen ( struct zfcp_port port,
int  clear,
char id 
)

zfcp_erp_port_reopen - trigger remote port recovery : port to recover : flags in port status to be cleared : Id for debug trace event.

Returns 0 if recovery has been triggered, < 0 if not.

Definition at line 386 of file zfcp_erp.c.

void zfcp_erp_port_shutdown ( struct zfcp_port port,
int  clear,
char id 
)

zfcp_erp_port_shutdown - Shutdown port : Port to shut down. : Status flags to clear. : Id for debug trace event.

Definition at line 322 of file zfcp_erp.c.

void zfcp_erp_set_adapter_status ( struct zfcp_adapter adapter,
u32  mask 
)

zfcp_erp_set_adapter_status - set adapter status bits : adapter to change the status : status bits to change

Changes in common status bits are propagated to attached ports and LUNs.

Definition at line 1421 of file zfcp_erp.c.

void zfcp_erp_set_lun_status ( struct scsi_device sdev,
u32  mask 
)

zfcp_erp_set_lun_status - set lun status bits : SCSI device / lun to set the status bits : status bits to change

Definition at line 1538 of file zfcp_erp.c.

void zfcp_erp_set_port_status ( struct zfcp_port port,
u32  mask 
)

zfcp_erp_set_port_status - set port status bits : port to change the status : status bits to change

Changes in common status bits are propagated to attached LUNs.

Definition at line 1487 of file zfcp_erp.c.

void zfcp_erp_thread_kill ( struct zfcp_adapter adapter)

zfcp_erp_thread_kill - Stop ERP thread. : Adapter where the ERP thread should be stopped.

The caller of this routine ensures that the specified adapter has been shut down and that this operation has been completed. Thus, there are no pending erp_actions which would need to be handled here.

Definition at line 1395 of file zfcp_erp.c.

int zfcp_erp_thread_setup ( struct zfcp_adapter adapter)

zfcp_erp_thread_setup - Start ERP thread for adapter : Adapter to start the ERP thread for

Returns 0 on success or error code from kernel_thread()

Definition at line 1370 of file zfcp_erp.c.

void zfcp_erp_timeout_handler ( unsigned long  data)

zfcp_erp_timeout_handler - Trigger ERP action from timed out ERP request : ERP action (from timer data)

Definition at line 559 of file zfcp_erp.c.

void zfcp_erp_wait ( struct zfcp_adapter adapter)

zfcp_erp_wait - wait for completion of error recovery on an adapter : adapter for which to wait for completion of its error recovery

Definition at line 1407 of file zfcp_erp.c.