Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Enumerations | Functions
libiscsi.c File Reference
#include <linux/types.h>
#include <linux/kfifo.h>
#include <linux/delay.h>
#include <linux/log2.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <asm/unaligned.h>
#include <net/tcp.h>
#include <scsi/scsi_cmnd.h>
#include <scsi/scsi_device.h>
#include <scsi/scsi_eh.h>
#include <scsi/scsi_tcq.h>
#include <scsi/scsi_host.h>
#include <scsi/scsi.h>
#include <scsi/iscsi_proto.h>
#include <scsi/scsi_transport.h>
#include <scsi/scsi_transport_iscsi.h>
#include <scsi/libiscsi.h>

Go to the source code of this file.

Macros

#define ISCSI_DBG_CONN(_conn, dbg_fmt, arg...)
 
#define ISCSI_DBG_SESSION(_session, dbg_fmt, arg...)
 
#define ISCSI_DBG_EH(_session, dbg_fmt, arg...)
 

Enumerations

enum  {
  FAILURE_BAD_HOST = 1, FAILURE_SESSION_FAILED, FAILURE_SESSION_FREED, FAILURE_WINDOW_CLOSED,
  FAILURE_OOM, FAILURE_SESSION_TERMINATE, FAILURE_SESSION_IN_RECOVERY, FAILURE_SESSION_RECOVERY_TIMEOUT,
  FAILURE_SESSION_LOGGING_OUT, FAILURE_SESSION_NOT_READY
}
 

Functions

 module_param_named (debug_libiscsi_conn, iscsi_dbg_lib_conn, int, S_IRUGO|S_IWUSR)
 
 MODULE_PARM_DESC (debug_libiscsi_conn,"Turn on debugging for connections in libiscsi module. ""Set to 1 to turn on, and zero to turn off. Default is off.")
 
 module_param_named (debug_libiscsi_session, iscsi_dbg_lib_session, int, S_IRUGO|S_IWUSR)
 
 MODULE_PARM_DESC (debug_libiscsi_session,"Turn on debugging for sessions in libiscsi module. ""Set to 1 to turn on, and zero to turn off. Default is off.")
 
 module_param_named (debug_libiscsi_eh, iscsi_dbg_lib_eh, int, S_IRUGO|S_IWUSR)
 
 MODULE_PARM_DESC (debug_libiscsi_eh,"Turn on debugging for error handling in libiscsi module. ""Set to 1 to turn on, and zero to turn off. Default is off.")
 
void iscsi_conn_queue_work (struct iscsi_conn *conn)
 
 EXPORT_SYMBOL_GPL (iscsi_conn_queue_work)
 
void iscsi_update_cmdsn (struct iscsi_session *session, struct iscsi_nopin *hdr)
 
 EXPORT_SYMBOL_GPL (iscsi_update_cmdsn)
 
void iscsi_prep_data_out_pdu (struct iscsi_task *task, struct iscsi_r2t_info *r2t, struct iscsi_data *hdr)
 
 EXPORT_SYMBOL_GPL (iscsi_prep_data_out_pdu)
 
void __iscsi_get_task (struct iscsi_task *task)
 
 EXPORT_SYMBOL_GPL (__iscsi_get_task)
 
void __iscsi_put_task (struct iscsi_task *task)
 
 EXPORT_SYMBOL_GPL (__iscsi_put_task)
 
void iscsi_put_task (struct iscsi_task *task)
 
 EXPORT_SYMBOL_GPL (iscsi_put_task)
 
void iscsi_complete_scsi_task (struct iscsi_task *task, uint32_t exp_cmdsn, uint32_t max_cmdsn)
 
 EXPORT_SYMBOL_GPL (iscsi_complete_scsi_task)
 
int iscsi_conn_send_pdu (struct iscsi_cls_conn *cls_conn, struct iscsi_hdr *hdr, char *data, uint32_t data_size)
 
 EXPORT_SYMBOL_GPL (iscsi_conn_send_pdu)
 
struct iscsi_taskiscsi_itt_to_task (struct iscsi_conn *conn, itt_t itt)
 
 EXPORT_SYMBOL_GPL (iscsi_itt_to_task)
 
int __iscsi_complete_pdu (struct iscsi_conn *conn, struct iscsi_hdr *hdr, char *data, int datalen)
 
 EXPORT_SYMBOL_GPL (__iscsi_complete_pdu)
 
int iscsi_complete_pdu (struct iscsi_conn *conn, struct iscsi_hdr *hdr, char *data, int datalen)
 
 EXPORT_SYMBOL_GPL (iscsi_complete_pdu)
 
int iscsi_verify_itt (struct iscsi_conn *conn, itt_t itt)
 
 EXPORT_SYMBOL_GPL (iscsi_verify_itt)
 
struct iscsi_taskiscsi_itt_to_ctask (struct iscsi_conn *conn, itt_t itt)
 
 EXPORT_SYMBOL_GPL (iscsi_itt_to_ctask)
 
void iscsi_session_failure (struct iscsi_session *session, enum iscsi_err err)
 
 EXPORT_SYMBOL_GPL (iscsi_session_failure)
 
void iscsi_conn_failure (struct iscsi_conn *conn, enum iscsi_err err)
 
 EXPORT_SYMBOL_GPL (iscsi_conn_failure)
 
void iscsi_requeue_task (struct iscsi_task *task)
 
 EXPORT_SYMBOL_GPL (iscsi_requeue_task)
 
int iscsi_queuecommand (struct Scsi_Host *host, struct scsi_cmnd *sc)
 
 EXPORT_SYMBOL_GPL (iscsi_queuecommand)
 
int iscsi_change_queue_depth (struct scsi_device *sdev, int depth, int reason)
 
 EXPORT_SYMBOL_GPL (iscsi_change_queue_depth)
 
int iscsi_target_alloc (struct scsi_target *starget)
 
 EXPORT_SYMBOL_GPL (iscsi_target_alloc)
 
void iscsi_suspend_queue (struct iscsi_conn *conn)
 
 EXPORT_SYMBOL_GPL (iscsi_suspend_queue)
 
void iscsi_suspend_tx (struct iscsi_conn *conn)
 
 EXPORT_SYMBOL_GPL (iscsi_suspend_tx)
 
int iscsi_eh_abort (struct scsi_cmnd *sc)
 
 EXPORT_SYMBOL_GPL (iscsi_eh_abort)
 
int iscsi_eh_device_reset (struct scsi_cmnd *sc)
 
 EXPORT_SYMBOL_GPL (iscsi_eh_device_reset)
 
void iscsi_session_recovery_timedout (struct iscsi_cls_session *cls_session)
 
 EXPORT_SYMBOL_GPL (iscsi_session_recovery_timedout)
 
int iscsi_eh_session_reset (struct scsi_cmnd *sc)
 
 EXPORT_SYMBOL_GPL (iscsi_eh_session_reset)
 
int iscsi_eh_target_reset (struct scsi_cmnd *sc)
 
 EXPORT_SYMBOL_GPL (iscsi_eh_target_reset)
 
int iscsi_eh_recover_target (struct scsi_cmnd *sc)
 
 EXPORT_SYMBOL_GPL (iscsi_eh_recover_target)
 
int iscsi_pool_init (struct iscsi_pool *q, int max, void ***items, int item_size)
 
 EXPORT_SYMBOL_GPL (iscsi_pool_init)
 
void iscsi_pool_free (struct iscsi_pool *q)
 
 EXPORT_SYMBOL_GPL (iscsi_pool_free)
 
int iscsi_host_add (struct Scsi_Host *shost, struct device *pdev)
 
 EXPORT_SYMBOL_GPL (iscsi_host_add)
 
struct Scsi_Hostiscsi_host_alloc (struct scsi_host_template *sht, int dd_data_size, bool xmit_can_sleep)
 
 EXPORT_SYMBOL_GPL (iscsi_host_alloc)
 
void iscsi_host_remove (struct Scsi_Host *shost)
 
 EXPORT_SYMBOL_GPL (iscsi_host_remove)
 
void iscsi_host_free (struct Scsi_Host *shost)
 
 EXPORT_SYMBOL_GPL (iscsi_host_free)
 
struct iscsi_cls_sessioniscsi_session_setup (struct iscsi_transport *iscsit, struct Scsi_Host *shost, uint16_t cmds_max, int dd_size, int cmd_task_size, uint32_t initial_cmdsn, unsigned int id)
 
 EXPORT_SYMBOL_GPL (iscsi_session_setup)
 
void iscsi_session_teardown (struct iscsi_cls_session *cls_session)
 
 EXPORT_SYMBOL_GPL (iscsi_session_teardown)
 
struct iscsi_cls_conniscsi_conn_setup (struct iscsi_cls_session *cls_session, int dd_size, uint32_t conn_idx)
 
 EXPORT_SYMBOL_GPL (iscsi_conn_setup)
 
void iscsi_conn_teardown (struct iscsi_cls_conn *cls_conn)
 
 EXPORT_SYMBOL_GPL (iscsi_conn_teardown)
 
int iscsi_conn_start (struct iscsi_cls_conn *cls_conn)
 
 EXPORT_SYMBOL_GPL (iscsi_conn_start)
 
void iscsi_conn_stop (struct iscsi_cls_conn *cls_conn, int flag)
 
 EXPORT_SYMBOL_GPL (iscsi_conn_stop)
 
int iscsi_conn_bind (struct iscsi_cls_session *cls_session, struct iscsi_cls_conn *cls_conn, int is_leading)
 
 EXPORT_SYMBOL_GPL (iscsi_conn_bind)
 
int iscsi_set_param (struct iscsi_cls_conn *cls_conn, enum iscsi_param param, char *buf, int buflen)
 
 EXPORT_SYMBOL_GPL (iscsi_set_param)
 
int iscsi_session_get_param (struct iscsi_cls_session *cls_session, enum iscsi_param param, char *buf)
 
 EXPORT_SYMBOL_GPL (iscsi_session_get_param)
 
int iscsi_conn_get_addr_param (struct sockaddr_storage *addr, enum iscsi_param param, char *buf)
 
 EXPORT_SYMBOL_GPL (iscsi_conn_get_addr_param)
 
int iscsi_conn_get_param (struct iscsi_cls_conn *cls_conn, enum iscsi_param param, char *buf)
 
 EXPORT_SYMBOL_GPL (iscsi_conn_get_param)
 
int iscsi_host_get_param (struct Scsi_Host *shost, enum iscsi_host_param param, char *buf)
 
 EXPORT_SYMBOL_GPL (iscsi_host_get_param)
 
int iscsi_host_set_param (struct Scsi_Host *shost, enum iscsi_host_param param, char *buf, int buflen)
 
 EXPORT_SYMBOL_GPL (iscsi_host_set_param)
 
 MODULE_AUTHOR ("Mike Christie")
 
 MODULE_DESCRIPTION ("iSCSI library functions")
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define ISCSI_DBG_CONN (   _conn,
  dbg_fmt,
  arg... 
)
Value:
do { \
if (iscsi_dbg_lib_conn) \
iscsi_conn_printk(KERN_INFO, _conn, \
"%s " dbg_fmt, \
__func__, ##arg); \
} while (0);

Definition at line 64 of file libiscsi.c.

#define ISCSI_DBG_EH (   _session,
  dbg_fmt,
  arg... 
)
Value:
do { \
if (iscsi_dbg_lib_eh) \
iscsi_session_printk(KERN_INFO, _session, \
"%s " dbg_fmt, \
__func__, ##arg); \
} while (0);

Definition at line 80 of file libiscsi.c.

#define ISCSI_DBG_SESSION (   _session,
  dbg_fmt,
  arg... 
)
Value:
do { \
if (iscsi_dbg_lib_session) \
iscsi_session_printk(KERN_INFO, _session, \
"%s " dbg_fmt, \
__func__, ##arg); \
} while (0);

Definition at line 72 of file libiscsi.c.

Enumeration Type Documentation

anonymous enum
Enumerator:
FAILURE_BAD_HOST 
FAILURE_SESSION_FAILED 
FAILURE_SESSION_FREED 
FAILURE_WINDOW_CLOSED 
FAILURE_OOM 
FAILURE_SESSION_TERMINATE 
FAILURE_SESSION_IN_RECOVERY 
FAILURE_SESSION_RECOVERY_TIMEOUT 
FAILURE_SESSION_LOGGING_OUT 
FAILURE_SESSION_NOT_READY 

Definition at line 1575 of file libiscsi.c.

Function Documentation

int __iscsi_complete_pdu ( struct iscsi_conn conn,
struct iscsi_hdr hdr,
char data,
int  datalen 
)

__iscsi_complete_pdu - complete pdu : iscsi conn : iscsi header : data buffer : len of data buffer

Completes pdu processing by freeing any resources allocated at queuecommand or send generic. session lock must be held and verify itt must have been called.

Definition at line 1110 of file libiscsi.c.

void __iscsi_get_task ( struct iscsi_task task)

Definition at line 522 of file libiscsi.c.

void __iscsi_put_task ( struct iscsi_task task)

Definition at line 528 of file libiscsi.c.

EXPORT_SYMBOL_GPL ( iscsi_conn_queue_work  )
EXPORT_SYMBOL_GPL ( iscsi_update_cmdsn  )
EXPORT_SYMBOL_GPL ( iscsi_prep_data_out_pdu  )
EXPORT_SYMBOL_GPL ( __iscsi_get_task  )
EXPORT_SYMBOL_GPL ( __iscsi_put_task  )
EXPORT_SYMBOL_GPL ( iscsi_put_task  )
EXPORT_SYMBOL_GPL ( iscsi_complete_scsi_task  )
EXPORT_SYMBOL_GPL ( iscsi_conn_send_pdu  )
EXPORT_SYMBOL_GPL ( iscsi_itt_to_task  )
EXPORT_SYMBOL_GPL ( __iscsi_complete_pdu  )
EXPORT_SYMBOL_GPL ( iscsi_complete_pdu  )
EXPORT_SYMBOL_GPL ( iscsi_verify_itt  )
EXPORT_SYMBOL_GPL ( iscsi_itt_to_ctask  )
EXPORT_SYMBOL_GPL ( iscsi_session_failure  )
EXPORT_SYMBOL_GPL ( iscsi_conn_failure  )
EXPORT_SYMBOL_GPL ( iscsi_requeue_task  )
EXPORT_SYMBOL_GPL ( iscsi_queuecommand  )
EXPORT_SYMBOL_GPL ( iscsi_change_queue_depth  )
EXPORT_SYMBOL_GPL ( iscsi_target_alloc  )
EXPORT_SYMBOL_GPL ( iscsi_suspend_queue  )
EXPORT_SYMBOL_GPL ( iscsi_suspend_tx  )
EXPORT_SYMBOL_GPL ( iscsi_eh_abort  )
EXPORT_SYMBOL_GPL ( iscsi_eh_device_reset  )
EXPORT_SYMBOL_GPL ( iscsi_session_recovery_timedout  )
EXPORT_SYMBOL_GPL ( iscsi_eh_session_reset  )
EXPORT_SYMBOL_GPL ( iscsi_eh_target_reset  )
EXPORT_SYMBOL_GPL ( iscsi_eh_recover_target  )
EXPORT_SYMBOL_GPL ( iscsi_pool_init  )
EXPORT_SYMBOL_GPL ( iscsi_pool_free  )
EXPORT_SYMBOL_GPL ( iscsi_host_add  )
EXPORT_SYMBOL_GPL ( iscsi_host_alloc  )
EXPORT_SYMBOL_GPL ( iscsi_host_remove  )
EXPORT_SYMBOL_GPL ( iscsi_host_free  )
EXPORT_SYMBOL_GPL ( iscsi_session_setup  )
EXPORT_SYMBOL_GPL ( iscsi_session_teardown  )
EXPORT_SYMBOL_GPL ( iscsi_conn_setup  )
EXPORT_SYMBOL_GPL ( iscsi_conn_teardown  )
EXPORT_SYMBOL_GPL ( iscsi_conn_start  )
EXPORT_SYMBOL_GPL ( iscsi_conn_stop  )
EXPORT_SYMBOL_GPL ( iscsi_conn_bind  )
EXPORT_SYMBOL_GPL ( iscsi_set_param  )
EXPORT_SYMBOL_GPL ( iscsi_session_get_param  )
EXPORT_SYMBOL_GPL ( iscsi_conn_get_addr_param  )
EXPORT_SYMBOL_GPL ( iscsi_conn_get_param  )
EXPORT_SYMBOL_GPL ( iscsi_host_get_param  )
EXPORT_SYMBOL_GPL ( iscsi_host_set_param  )
int iscsi_change_queue_depth ( struct scsi_device sdev,
int  depth,
int  reason 
)

Definition at line 1718 of file libiscsi.c.

int iscsi_complete_pdu ( struct iscsi_conn conn,
struct iscsi_hdr hdr,
char data,
int  datalen 
)

Definition at line 1246 of file libiscsi.c.

void iscsi_complete_scsi_task ( struct iscsi_task task,
uint32_t  exp_cmdsn,
uint32_t  max_cmdsn 
)

iscsi_complete_scsi_task - finish scsi task normally : iscsi task for scsi cmd : expected cmd sn in cpu format : max cmd sn in cpu format

This is used when drivers do not need or cannot perform lower level pdu processing.

Called with session lock

Definition at line 591 of file libiscsi.c.

int iscsi_conn_bind ( struct iscsi_cls_session cls_session,
struct iscsi_cls_conn cls_conn,
int  is_leading 
)

Definition at line 3125 of file libiscsi.c.

void iscsi_conn_failure ( struct iscsi_conn conn,
enum iscsi_err  err 
)

Definition at line 1351 of file libiscsi.c.

int iscsi_conn_get_addr_param ( struct sockaddr_storage addr,
enum iscsi_param  param,
char buf 
)

Definition at line 3337 of file libiscsi.c.

int iscsi_conn_get_param ( struct iscsi_cls_conn cls_conn,
enum iscsi_param  param,
char buf 
)

Definition at line 3378 of file libiscsi.c.

void iscsi_conn_queue_work ( struct iscsi_conn conn)
inline

Definition at line 88 of file libiscsi.c.

int iscsi_conn_send_pdu ( struct iscsi_cls_conn cls_conn,
struct iscsi_hdr hdr,
char data,
uint32_t  data_size 
)

Definition at line 788 of file libiscsi.c.

struct iscsi_cls_conn* iscsi_conn_setup ( struct iscsi_cls_session cls_session,
int  dd_size,
uint32_t  conn_idx 
)
read

iscsi_conn_setup - create iscsi_cls_conn and iscsi_conn : iscsi_cls_session : private driver data size : cid

Definition at line 2827 of file libiscsi.c.

int iscsi_conn_start ( struct iscsi_cls_conn cls_conn)

Definition at line 2954 of file libiscsi.c.

void iscsi_conn_stop ( struct iscsi_cls_conn cls_conn,
int  flag 
)

Definition at line 3108 of file libiscsi.c.

void iscsi_conn_teardown ( struct iscsi_cls_conn cls_conn)

iscsi_conn_teardown - teardown iscsi connection cls_conn: iscsi class connection

TODO: we may need to make this into a two step process like scsi-mls remove + put host

Definition at line 2896 of file libiscsi.c.

int iscsi_eh_abort ( struct scsi_cmnd sc)

Definition at line 2085 of file libiscsi.c.

int iscsi_eh_device_reset ( struct scsi_cmnd sc)

Definition at line 2225 of file libiscsi.c.

int iscsi_eh_recover_target ( struct scsi_cmnd sc)

iscsi_eh_recover_target - reset target and possibly the session : scsi command

This will attempt to send a warm target reset. If that fails, we will escalate to ERL0 session recovery.

Definition at line 2468 of file libiscsi.c.

int iscsi_eh_session_reset ( struct scsi_cmnd sc)

iscsi_eh_session_reset - drop session and attempt relogin : scsi command

This function will wait for a relogin, session termination from userspace, or a recovery/replacement timeout.

Definition at line 2319 of file libiscsi.c.

int iscsi_eh_target_reset ( struct scsi_cmnd sc)

iscsi_eh_target_reset - reset target : scsi command

This will attempt to send a warm target reset.

Definition at line 2387 of file libiscsi.c.

int iscsi_host_add ( struct Scsi_Host shost,
struct device pdev 
)

iscsi_host_add - add host to system : scsi host : parent device

This should be called by partial offload and software iscsi drivers to add a host to the system.

Definition at line 2544 of file libiscsi.c.

struct Scsi_Host* iscsi_host_alloc ( struct scsi_host_template sht,
int  dd_data_size,
bool  xmit_can_sleep 
)
read

iscsi_host_alloc - allocate a host and driver data : scsi host template : driver host data size : bool indicating if LLD will queue IO from a work queue

This should be called by partial offload and software iscsi drivers. To access the driver specific memory use the iscsi_host_priv() macro.

Definition at line 2567 of file libiscsi.c.

void iscsi_host_free ( struct Scsi_Host shost)

Definition at line 2631 of file libiscsi.c.

int iscsi_host_get_param ( struct Scsi_Host shost,
enum iscsi_host_param  param,
char buf 
)

Definition at line 3426 of file libiscsi.c.

void iscsi_host_remove ( struct Scsi_Host shost)

iscsi_host_remove - remove host and sessions : scsi host

If there are any sessions left, this will initiate the removal and wait for the completion.

Definition at line 2610 of file libiscsi.c.

int iscsi_host_set_param ( struct Scsi_Host shost,
enum iscsi_host_param  param,
char buf,
int  buflen 
)

Definition at line 3450 of file libiscsi.c.

struct iscsi_task* iscsi_itt_to_ctask ( struct iscsi_conn conn,
itt_t  itt 
)
read

iscsi_itt_to_ctask - look up ctask by itt : iscsi connection : itt

This should be used for cmd tasks.

The session lock must be held.

Definition at line 1299 of file libiscsi.c.

struct iscsi_task* iscsi_itt_to_task ( struct iscsi_conn conn,
itt_t  itt 
)
read

iscsi_itt_to_task - look up task by itt : iscsi connection : itt

This should be used for mgmt tasks like login and nops, or if the LDD's itt space does not include the session age.

The session lock must be held.

Definition at line 1080 of file libiscsi.c.

void iscsi_pool_free ( struct iscsi_pool q)

Definition at line 2526 of file libiscsi.c.

int iscsi_pool_init ( struct iscsi_pool q,
int  max,
void ***  items,
int  item_size 
)

Definition at line 2486 of file libiscsi.c.

void iscsi_prep_data_out_pdu ( struct iscsi_task task,
struct iscsi_r2t_info r2t,
struct iscsi_data hdr 
)

iscsi_prep_data_out_pdu - initialize Data-Out : scsi command task : R2T info : iscsi data in pdu

Notes: Initialize Data-Out within this R2T sequence and finds proper data_offset within this SCSI command.

This function is called with connection lock taken.

Definition at line 144 of file libiscsi.c.

void iscsi_put_task ( struct iscsi_task task)

Definition at line 535 of file libiscsi.c.

int iscsi_queuecommand ( struct Scsi_Host host,
struct scsi_cmnd sc 
)

Definition at line 1588 of file libiscsi.c.

void iscsi_requeue_task ( struct iscsi_task task)

iscsi_requeue_task - requeue task to run from session workqueue : task to requeue

LLDs that need to run a task from the session workqueue should call this. The session lock must be held. This should only be called by software drivers.

Definition at line 1417 of file libiscsi.c.

void iscsi_session_failure ( struct iscsi_session session,
enum iscsi_err  err 
)

Definition at line 1321 of file libiscsi.c.

int iscsi_session_get_param ( struct iscsi_cls_session cls_session,
enum iscsi_param  param,
char buf 
)

Definition at line 3259 of file libiscsi.c.

void iscsi_session_recovery_timedout ( struct iscsi_cls_session cls_session)

Definition at line 2298 of file libiscsi.c.

struct iscsi_cls_session* iscsi_session_setup ( struct iscsi_transport iscsit,
struct Scsi_Host shost,
uint16_t  cmds_max,
int  dd_size,
int  cmd_task_size,
uint32_t  initial_cmdsn,
unsigned int  id 
)
read

iscsi_session_setup - create iscsi cls session and host and session : iscsi transport template : scsi host : session can queue : LLD task private data size : initial CmdSN

This can be used by software iscsi_transports that allocate a session per scsi host.

Callers should set cmds_max to the largest total numer (mgmt + scsi) of tasks they support. The iscsi layer reserves ISCSI_MGMT_CMDS_MAX tasks for nop handling and login/logout requests.

Definition at line 2679 of file libiscsi.c.

void iscsi_session_teardown ( struct iscsi_cls_session cls_session)

iscsi_session_teardown - destroy session, host, and cls_session : iscsi session

The driver must have called iscsi_remove_session before calling this.

Definition at line 2797 of file libiscsi.c.

int iscsi_set_param ( struct iscsi_cls_conn cls_conn,
enum iscsi_param  param,
char buf,
int  buflen 
)

Definition at line 3163 of file libiscsi.c.

void iscsi_suspend_queue ( struct iscsi_conn conn)

iscsi_suspend_queue - suspend iscsi_queuecommand : iscsi conn to stop queueing IO on

This grabs the session lock to make sure no one is in xmit_task/queuecommand, and then sets suspend to prevent new commands from being queued. This only needs to be called by offload drivers that need to sync a path like ep disconnect with the iscsi_queuecommand/xmit_task. To start IO again libiscsi will call iscsi_start_tx and iscsi_unblock_session when in FFP.

Definition at line 1848 of file libiscsi.c.

void iscsi_suspend_tx ( struct iscsi_conn conn)

iscsi_suspend_tx - suspend iscsi_data_xmit : iscsi conn tp stop processing IO on.

This function sets the suspend bit to prevent iscsi_data_xmit from sending new IO, and if work is queued on the xmit thread it will wait for it to be completed.

Definition at line 1864 of file libiscsi.c.

int iscsi_target_alloc ( struct scsi_target starget)

Definition at line 1737 of file libiscsi.c.

void iscsi_update_cmdsn ( struct iscsi_session session,
struct iscsi_nopin hdr 
)

Definition at line 125 of file libiscsi.c.

int iscsi_verify_itt ( struct iscsi_conn conn,
itt_t  itt 
)

Definition at line 1258 of file libiscsi.c.

MODULE_AUTHOR ( "Mike Christie"  )
MODULE_DESCRIPTION ( "iSCSI library functions"  )
MODULE_LICENSE ( "GPL"  )
module_param_named ( debug_libiscsi_conn  ,
iscsi_dbg_lib_conn  ,
int  ,
S_IRUGO S_IWUSR 
)
module_param_named ( debug_libiscsi_session  ,
iscsi_dbg_lib_session  ,
int  ,
S_IRUGO S_IWUSR 
)
module_param_named ( debug_libiscsi_eh  ,
iscsi_dbg_lib_eh  ,
int  ,
S_IRUGO S_IWUSR 
)
MODULE_PARM_DESC ( debug_libiscsi_conn  ,
"Turn on debugging for connections in libiscsi module. ""Set to 1 to turn  on,
and zero to turn off.Default is off."   
)
MODULE_PARM_DESC ( debug_libiscsi_session  ,
"Turn on debugging for sessions in libiscsi module. ""Set to 1 to turn  on,
and zero to turn off.Default is off."   
)
MODULE_PARM_DESC ( debug_libiscsi_eh  ,
"Turn on debugging for error handling in libiscsi module. ""Set to 1 to turn  on,
and zero to turn off.Default is off."   
)