Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
fc_fcp.c File Reference
#include <linux/module.h>
#include <linux/delay.h>
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/spinlock.h>
#include <linux/scatterlist.h>
#include <linux/err.h>
#include <linux/crc32.h>
#include <linux/slab.h>
#include <scsi/scsi_tcq.h>
#include <scsi/scsi.h>
#include <scsi/scsi_host.h>
#include <scsi/scsi_device.h>
#include <scsi/scsi_cmnd.h>
#include <scsi/fc/fc_fc2.h>
#include <scsi/libfc.h>
#include <scsi/fc_encode.h>
#include "fc_libfc.h"

Go to the source code of this file.

Data Structures

struct  fc_fcp_internal
 

Macros

#define FC_SRB_FREE   0 /* cmd is free */
 
#define FC_SRB_CMD_SENT   (1 << 0) /* cmd has been sent */
 
#define FC_SRB_RCV_STATUS   (1 << 1) /* response has arrived */
 
#define FC_SRB_ABORT_PENDING   (1 << 2) /* cmd abort sent to device */
 
#define FC_SRB_ABORTED   (1 << 3) /* abort acknowledged */
 
#define FC_SRB_DISCONTIG   (1 << 4) /* non-sequential data recvd */
 
#define FC_SRB_COMPL   (1 << 5) /* fc_io_compl has been run */
 
#define FC_SRB_FCP_PROCESSING_TMO   (1 << 6) /* timer function processing */
 
#define FC_SRB_READ   (1 << 1)
 
#define FC_SRB_WRITE   (1 << 0)
 
#define CMD_SP(Cmnd)   ((struct fc_fcp_pkt *)(Cmnd)->SCp.ptr)
 
#define CMD_ENTRY_STATUS(Cmnd)   ((Cmnd)->SCp.have_data_in)
 
#define CMD_COMPL_STATUS(Cmnd)   ((Cmnd)->SCp.this_residual)
 
#define CMD_SCSI_STATUS(Cmnd)   ((Cmnd)->SCp.Status)
 
#define CMD_RESID_LEN(Cmnd)   ((Cmnd)->SCp.buffers_residual)
 
#define fc_get_scsi_internal(x)   ((struct fc_fcp_internal *)(x)->scsi_priv)
 
#define FC_COMPLETE   0
 
#define FC_CMD_ABORTED   1
 
#define FC_CMD_RESET   2
 
#define FC_CMD_PLOGO   3
 
#define FC_SNS_RCV   4
 
#define FC_TRANS_ERR   5
 
#define FC_DATA_OVRRUN   6
 
#define FC_DATA_UNDRUN   7
 
#define FC_ERROR   8
 
#define FC_HRD_ERROR   9
 
#define FC_CRC_ERROR   10
 
#define FC_TIMED_OUT   11
 
#define FC_SCSI_TM_TOV   (10 * HZ)
 
#define FC_HOST_RESET_TIMEOUT   (30 * HZ)
 
#define FC_CAN_QUEUE_PERIOD   (60 * HZ)
 
#define FC_MAX_ERROR_CNT   5
 
#define FC_MAX_RECOV_RETRY   3
 
#define FC_FCP_DFLT_QUEUE_DEPTH   32
 

Functions

void fc_fcp_ddp_setup (struct fc_fcp_pkt *fsp, u16 xid)
 
void fc_fcp_ddp_done (struct fc_fcp_pkt *fsp)
 
int fc_queuecommand (struct Scsi_Host *shost, struct scsi_cmnd *sc_cmd)
 
 EXPORT_SYMBOL (fc_queuecommand)
 
int fc_eh_abort (struct scsi_cmnd *sc_cmd)
 
 EXPORT_SYMBOL (fc_eh_abort)
 
int fc_eh_device_reset (struct scsi_cmnd *sc_cmd)
 
 EXPORT_SYMBOL (fc_eh_device_reset)
 
int fc_eh_host_reset (struct scsi_cmnd *sc_cmd)
 
 EXPORT_SYMBOL (fc_eh_host_reset)
 
int fc_slave_alloc (struct scsi_device *sdev)
 
 EXPORT_SYMBOL (fc_slave_alloc)
 
int fc_change_queue_depth (struct scsi_device *sdev, int qdepth, int reason)
 
 EXPORT_SYMBOL (fc_change_queue_depth)
 
int fc_change_queue_type (struct scsi_device *sdev, int tag_type)
 
 EXPORT_SYMBOL (fc_change_queue_type)
 
void fc_fcp_destroy (struct fc_lport *lport)
 
 EXPORT_SYMBOL (fc_fcp_destroy)
 
int fc_setup_fcp (void)
 
void fc_destroy_fcp (void)
 
int fc_fcp_init (struct fc_lport *lport)
 
 EXPORT_SYMBOL (fc_fcp_init)
 

Macro Definition Documentation

#define CMD_COMPL_STATUS (   Cmnd)    ((Cmnd)->SCp.this_residual)

Definition at line 65 of file fc_fcp.c.

#define CMD_ENTRY_STATUS (   Cmnd)    ((Cmnd)->SCp.have_data_in)

Definition at line 64 of file fc_fcp.c.

#define CMD_RESID_LEN (   Cmnd)    ((Cmnd)->SCp.buffers_residual)

Definition at line 67 of file fc_fcp.c.

#define CMD_SCSI_STATUS (   Cmnd)    ((Cmnd)->SCp.Status)

Definition at line 66 of file fc_fcp.c.

#define CMD_SP (   Cmnd)    ((struct fc_fcp_pkt *)(Cmnd)->SCp.ptr)

Definition at line 63 of file fc_fcp.c.

#define FC_CAN_QUEUE_PERIOD   (60 * HZ)

Definition at line 131 of file fc_fcp.c.

#define FC_CMD_ABORTED   1

Definition at line 114 of file fc_fcp.c.

#define FC_CMD_PLOGO   3

Definition at line 116 of file fc_fcp.c.

#define FC_CMD_RESET   2

Definition at line 115 of file fc_fcp.c.

#define FC_COMPLETE   0

Definition at line 113 of file fc_fcp.c.

#define FC_CRC_ERROR   10

Definition at line 123 of file fc_fcp.c.

#define FC_DATA_OVRRUN   6

Definition at line 119 of file fc_fcp.c.

#define FC_DATA_UNDRUN   7

Definition at line 120 of file fc_fcp.c.

#define FC_ERROR   8

Definition at line 121 of file fc_fcp.c.

#define FC_FCP_DFLT_QUEUE_DEPTH   32

Definition at line 136 of file fc_fcp.c.

#define fc_get_scsi_internal (   x)    ((struct fc_fcp_internal *)(x)->scsi_priv)

Definition at line 87 of file fc_fcp.c.

#define FC_HOST_RESET_TIMEOUT   (30 * HZ)

Definition at line 130 of file fc_fcp.c.

#define FC_HRD_ERROR   9

Definition at line 122 of file fc_fcp.c.

#define FC_MAX_ERROR_CNT   5

Definition at line 133 of file fc_fcp.c.

#define FC_MAX_RECOV_RETRY   3

Definition at line 134 of file fc_fcp.c.

#define FC_SCSI_TM_TOV   (10 * HZ)

Definition at line 129 of file fc_fcp.c.

#define FC_SNS_RCV   4

Definition at line 117 of file fc_fcp.c.

#define FC_SRB_ABORT_PENDING   (1 << 2) /* cmd abort sent to device */

Definition at line 51 of file fc_fcp.c.

#define FC_SRB_ABORTED   (1 << 3) /* abort acknowledged */

Definition at line 52 of file fc_fcp.c.

#define FC_SRB_CMD_SENT   (1 << 0) /* cmd has been sent */

Definition at line 49 of file fc_fcp.c.

#define FC_SRB_COMPL   (1 << 5) /* fc_io_compl has been run */

Definition at line 54 of file fc_fcp.c.

#define FC_SRB_DISCONTIG   (1 << 4) /* non-sequential data recvd */

Definition at line 53 of file fc_fcp.c.

#define FC_SRB_FCP_PROCESSING_TMO   (1 << 6) /* timer function processing */

Definition at line 55 of file fc_fcp.c.

#define FC_SRB_FREE   0 /* cmd is free */

Definition at line 48 of file fc_fcp.c.

#define FC_SRB_RCV_STATUS   (1 << 1) /* response has arrived */

Definition at line 50 of file fc_fcp.c.

#define FC_SRB_READ   (1 << 1)

Definition at line 57 of file fc_fcp.c.

#define FC_SRB_WRITE   (1 << 0)

Definition at line 58 of file fc_fcp.c.

#define FC_TIMED_OUT   11

Definition at line 124 of file fc_fcp.c.

#define FC_TRANS_ERR   5

Definition at line 118 of file fc_fcp.c.

Function Documentation

EXPORT_SYMBOL ( fc_queuecommand  )
EXPORT_SYMBOL ( fc_eh_abort  )
EXPORT_SYMBOL ( fc_eh_device_reset  )
EXPORT_SYMBOL ( fc_eh_host_reset  )
EXPORT_SYMBOL ( fc_slave_alloc  )
EXPORT_SYMBOL ( fc_change_queue_depth  )
EXPORT_SYMBOL ( fc_change_queue_type  )
EXPORT_SYMBOL ( fc_fcp_destroy  )
EXPORT_SYMBOL ( fc_fcp_init  )
int fc_change_queue_depth ( struct scsi_device sdev,
int  qdepth,
int  reason 
)

fc_change_queue_depth() - Change a device's queue depth : The SCSI device whose queue depth is to change : The new queue depth : The resason for the change

Definition at line 2179 of file fc_fcp.c.

int fc_change_queue_type ( struct scsi_device sdev,
int  tag_type 
)

fc_change_queue_type() - Change a device's queue type : The SCSI device whose queue depth is to change : Identifier for queue type

Definition at line 2203 of file fc_fcp.c.

void fc_destroy_fcp ( void  )

Definition at line 2252 of file fc_fcp.c.

int fc_eh_abort ( struct scsi_cmnd sc_cmd)

fc_eh_abort() - Abort a command : The SCSI command to abort

From SCSI host template. Send an ABTS to the target device and wait for the response.

Definition at line 2019 of file fc_fcp.c.

int fc_eh_device_reset ( struct scsi_cmnd sc_cmd)

fc_eh_device_reset() - Reset a single LUN : The SCSI command which identifies the device whose LUN is to be reset

Set from SCSI host template.

Definition at line 2072 of file fc_fcp.c.

int fc_eh_host_reset ( struct scsi_cmnd sc_cmd)

fc_eh_host_reset() - Reset a Scsi_Host. : The SCSI command that identifies the SCSI host to be reset

Definition at line 2120 of file fc_fcp.c.

void fc_fcp_ddp_done ( struct fc_fcp_pkt fsp)

fc_fcp_ddp_done() - Calls a LLD's ddp_done routine to release any DDP related resources for a fcp_pkt : The FCP packet that DDP had been used on

Definition at line 322 of file fc_fcp.c.

void fc_fcp_ddp_setup ( struct fc_fcp_pkt fsp,
u16  xid 
)

fc_fcp_ddp_setup() - Calls a LLD's ddp_setup routine to set up DDP context : The FCP packet that will manage the DDP frames : The XID that will be used for the DDP exchange

Definition at line 304 of file fc_fcp.c.

void fc_fcp_destroy ( struct fc_lport lport)

fc_fcp_destory() - Tear down the FCP layer for a given local port : The local port that no longer needs the FCP layer

Definition at line 2222 of file fc_fcp.c.

int fc_fcp_init ( struct fc_lport lport)

fc_fcp_init() - Initialize the FCP layer for a local port : The local port to initialize the exchange layer for

Definition at line 2262 of file fc_fcp.c.

int fc_queuecommand ( struct Scsi_Host shost,
struct scsi_cmnd sc_cmd 
)

fc_queuecommand() - The queuecommand function of the SCSI template : The Scsi_Host that the command was issued to : The scsi_cmnd to be executed

This is the i/o strategy routine, called by the SCSI layer.

Definition at line 1790 of file fc_fcp.c.

int fc_setup_fcp ( void  )

Definition at line 2236 of file fc_fcp.c.

int fc_slave_alloc ( struct scsi_device sdev)

fc_slave_alloc() - Configure the queue depth of a Scsi_Host : The SCSI device that identifies the SCSI host

Configures queue depth based on host's cmd_per_len. If not set then we use the libfc default.

Definition at line 2156 of file fc_fcp.c.