Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
scsi_transport_iscsi.c File Reference
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/slab.h>
#include <linux/bsg-lib.h>
#include <linux/idr.h>
#include <net/tcp.h>
#include <scsi/scsi.h>
#include <scsi/scsi_host.h>
#include <scsi/scsi_device.h>
#include <scsi/scsi_transport.h>
#include <scsi/scsi_transport_iscsi.h>
#include <scsi/iscsi_if.h>
#include <scsi/scsi_cmnd.h>
#include <scsi/scsi_bsg_iscsi.h>

Go to the source code of this file.

Data Structures

struct  iscsi_internal
 
struct  iscsi_scan_data
 

Macros

#define ISCSI_TRANSPORT_VERSION   "2.0-870"
 
#define ISCSI_DBG_TRANS_SESSION(_session, dbg_fmt, arg...)
 
#define ISCSI_DBG_TRANS_CONN(_conn, dbg_fmt, arg...)
 
#define to_iscsi_internal(tmpl)   container_of(tmpl, struct iscsi_internal, t)
 
#define dev_to_iscsi_internal(_dev)   container_of(_dev, struct iscsi_internal, dev)
 
#define show_transport_attr(name, format)
 
#define iscsi_dev_to_endpoint(_dev)   container_of(_dev, struct iscsi_endpoint, dev)
 
#define ISCSI_ATTR(_prefix, _name, _mode, _show, _store)
 
#define ISCSI_MAX_EPID   -1
 
#define ISCSI_IFACE_ATTR(_prefix, _name, _mode, _show, _store)
 
#define iscsi_iface_attr_show(type, name, param_type, param)
 
#define iscsi_iface_net_attr(type, name, param)
 
#define ISCSI_CLASS_ATTR(_prefix, _name, _mode, _show, _store)
 
#define iscsi_conn_attr_show(param)
 
#define iscsi_conn_attr(field, param)
 
#define iscsi_conn_ep_attr_show(param)
 
#define iscsi_conn_ep_attr(field, param)
 
#define iscsi_session_attr_show(param, perm)
 
#define iscsi_session_attr(field, param, perm)
 
#define iscsi_priv_session_attr_show(field, format)
 
#define iscsi_priv_session_attr_store(field)
 
#define iscsi_priv_session_rw_attr(field, format)
 
#define iscsi_host_attr_show(param)
 
#define iscsi_host_attr(field, param)
 

Functions

 module_param_named (debug_session, dbg_session, int, S_IRUGO|S_IWUSR)
 
 MODULE_PARM_DESC (debug_session,"Turn on debugging for sessions in scsi_transport_iscsi ""module. Set to 1 to turn on, and zero to turn off. Default ""is off.")
 
 module_param_named (debug_conn, dbg_conn, int, S_IRUGO|S_IWUSR)
 
 MODULE_PARM_DESC (debug_conn,"Turn on debugging for connections in scsi_transport_iscsi ""module. Set to 1 to turn on, and zero to turn off. Default ""is off.")
 
 show_transport_attr (caps,"0x%x")
 
struct iscsi_endpointiscsi_create_endpoint (int dd_size)
 
 EXPORT_SYMBOL_GPL (iscsi_create_endpoint)
 
void iscsi_destroy_endpoint (struct iscsi_endpoint *ep)
 
 EXPORT_SYMBOL_GPL (iscsi_destroy_endpoint)
 
struct iscsi_endpointiscsi_lookup_endpoint (u64 handle)
 
 EXPORT_SYMBOL_GPL (iscsi_lookup_endpoint)
 
 iscsi_iface_net_attr (ipv4_iface, ipaddress, ISCSI_NET_PARAM_IPV4_ADDR)
 
 iscsi_iface_net_attr (ipv4_iface, gateway, ISCSI_NET_PARAM_IPV4_GW)
 
 iscsi_iface_net_attr (ipv4_iface, subnet, ISCSI_NET_PARAM_IPV4_SUBNET)
 
 iscsi_iface_net_attr (ipv4_iface, bootproto, ISCSI_NET_PARAM_IPV4_BOOTPROTO)
 
 iscsi_iface_net_attr (ipv6_iface, ipaddress, ISCSI_NET_PARAM_IPV6_ADDR)
 
 iscsi_iface_net_attr (ipv6_iface, link_local_addr, ISCSI_NET_PARAM_IPV6_LINKLOCAL)
 
 iscsi_iface_net_attr (ipv6_iface, router_addr, ISCSI_NET_PARAM_IPV6_ROUTER)
 
 iscsi_iface_net_attr (ipv6_iface, ipaddr_autocfg, ISCSI_NET_PARAM_IPV6_ADDR_AUTOCFG)
 
 iscsi_iface_net_attr (ipv6_iface, link_local_autocfg, ISCSI_NET_PARAM_IPV6_LINKLOCAL_AUTOCFG)
 
 iscsi_iface_net_attr (iface, enabled, ISCSI_NET_PARAM_IFACE_ENABLE)
 
 iscsi_iface_net_attr (iface, vlan_id, ISCSI_NET_PARAM_VLAN_ID)
 
 iscsi_iface_net_attr (iface, vlan_priority, ISCSI_NET_PARAM_VLAN_PRIORITY)
 
 iscsi_iface_net_attr (iface, vlan_enabled, ISCSI_NET_PARAM_VLAN_ENABLED)
 
 iscsi_iface_net_attr (iface, mtu, ISCSI_NET_PARAM_MTU)
 
 iscsi_iface_net_attr (iface, port, ISCSI_NET_PARAM_PORT)
 
struct iscsi_ifaceiscsi_create_iface (struct Scsi_Host *shost, struct iscsi_transport *transport, uint32_t iface_type, uint32_t iface_num, int dd_size)
 
 EXPORT_SYMBOL_GPL (iscsi_create_iface)
 
void iscsi_destroy_iface (struct iscsi_iface *iface)
 
 EXPORT_SYMBOL_GPL (iscsi_destroy_iface)
 
int iscsi_session_chkready (struct iscsi_cls_session *session)
 
 EXPORT_SYMBOL_GPL (iscsi_session_chkready)
 
int iscsi_is_session_online (struct iscsi_cls_session *session)
 
 EXPORT_SYMBOL_GPL (iscsi_is_session_online)
 
int iscsi_is_session_dev (const struct device *dev)
 
 EXPORT_SYMBOL_GPL (iscsi_is_session_dev)
 
void iscsi_host_for_each_session (struct Scsi_Host *shost, void(*fn)(struct iscsi_cls_session *))
 
 EXPORT_SYMBOL_GPL (iscsi_host_for_each_session)
 
int iscsi_scan_finished (struct Scsi_Host *shost, unsigned long time)
 
 EXPORT_SYMBOL_GPL (iscsi_scan_finished)
 
int iscsi_block_scsi_eh (struct scsi_cmnd *cmd)
 
 EXPORT_SYMBOL_GPL (iscsi_block_scsi_eh)
 
void iscsi_unblock_session (struct iscsi_cls_session *session)
 
 EXPORT_SYMBOL_GPL (iscsi_unblock_session)
 
void iscsi_block_session (struct iscsi_cls_session *session)
 
 EXPORT_SYMBOL_GPL (iscsi_block_session)
 
struct iscsi_cls_sessioniscsi_alloc_session (struct Scsi_Host *shost, struct iscsi_transport *transport, int dd_size)
 
 EXPORT_SYMBOL_GPL (iscsi_alloc_session)
 
int iscsi_add_session (struct iscsi_cls_session *session, unsigned int target_id)
 
 EXPORT_SYMBOL_GPL (iscsi_add_session)
 
struct iscsi_cls_sessioniscsi_create_session (struct Scsi_Host *shost, struct iscsi_transport *transport, int dd_size, unsigned int target_id)
 
 EXPORT_SYMBOL_GPL (iscsi_create_session)
 
void iscsi_remove_session (struct iscsi_cls_session *session)
 
 EXPORT_SYMBOL_GPL (iscsi_remove_session)
 
void iscsi_free_session (struct iscsi_cls_session *session)
 
 EXPORT_SYMBOL_GPL (iscsi_free_session)
 
int iscsi_destroy_session (struct iscsi_cls_session *session)
 
 EXPORT_SYMBOL_GPL (iscsi_destroy_session)
 
struct iscsi_cls_conniscsi_create_conn (struct iscsi_cls_session *session, int dd_size, uint32_t cid)
 
 EXPORT_SYMBOL_GPL (iscsi_create_conn)
 
int iscsi_destroy_conn (struct iscsi_cls_conn *conn)
 
 EXPORT_SYMBOL_GPL (iscsi_destroy_conn)
 
int iscsi_recv_pdu (struct iscsi_cls_conn *conn, struct iscsi_hdr *hdr, char *data, uint32_t data_size)
 
 EXPORT_SYMBOL_GPL (iscsi_recv_pdu)
 
int iscsi_offload_mesg (struct Scsi_Host *shost, struct iscsi_transport *transport, uint32_t type, char *data, uint16_t data_size)
 
 EXPORT_SYMBOL_GPL (iscsi_offload_mesg)
 
void iscsi_conn_error_event (struct iscsi_cls_conn *conn, enum iscsi_err error)
 
 EXPORT_SYMBOL_GPL (iscsi_conn_error_event)
 
void iscsi_conn_login_event (struct iscsi_cls_conn *conn, enum iscsi_conn_state state)
 
 EXPORT_SYMBOL_GPL (iscsi_conn_login_event)
 
void iscsi_post_host_event (uint32_t host_no, struct iscsi_transport *transport, enum iscsi_host_event_code code, uint32_t data_size, uint8_t *data)
 
 EXPORT_SYMBOL_GPL (iscsi_post_host_event)
 
void iscsi_ping_comp_event (uint32_t host_no, struct iscsi_transport *transport, uint32_t status, uint32_t pid, uint32_t data_size, uint8_t *data)
 
 EXPORT_SYMBOL_GPL (iscsi_ping_comp_event)
 
int iscsi_session_event (struct iscsi_cls_session *session, enum iscsi_uevent_e event)
 
 EXPORT_SYMBOL_GPL (iscsi_session_event)
 
 iscsi_conn_attr (max_recv_dlength, ISCSI_PARAM_MAX_RECV_DLENGTH)
 
 iscsi_conn_attr (max_xmit_dlength, ISCSI_PARAM_MAX_XMIT_DLENGTH)
 
 iscsi_conn_attr (header_digest, ISCSI_PARAM_HDRDGST_EN)
 
 iscsi_conn_attr (data_digest, ISCSI_PARAM_DATADGST_EN)
 
 iscsi_conn_attr (ifmarker, ISCSI_PARAM_IFMARKER_EN)
 
 iscsi_conn_attr (ofmarker, ISCSI_PARAM_OFMARKER_EN)
 
 iscsi_conn_attr (persistent_port, ISCSI_PARAM_PERSISTENT_PORT)
 
 iscsi_conn_attr (exp_statsn, ISCSI_PARAM_EXP_STATSN)
 
 iscsi_conn_attr (persistent_address, ISCSI_PARAM_PERSISTENT_ADDRESS)
 
 iscsi_conn_attr (ping_tmo, ISCSI_PARAM_PING_TMO)
 
 iscsi_conn_attr (recv_tmo, ISCSI_PARAM_RECV_TMO)
 
 iscsi_conn_ep_attr (address, ISCSI_PARAM_CONN_ADDRESS)
 
 iscsi_conn_ep_attr (port, ISCSI_PARAM_CONN_PORT)
 
 iscsi_session_attr (targetname, ISCSI_PARAM_TARGET_NAME, 0)
 
 iscsi_session_attr (initial_r2t, ISCSI_PARAM_INITIAL_R2T_EN, 0)
 
 iscsi_session_attr (max_outstanding_r2t, ISCSI_PARAM_MAX_R2T, 0)
 
 iscsi_session_attr (immediate_data, ISCSI_PARAM_IMM_DATA_EN, 0)
 
 iscsi_session_attr (first_burst_len, ISCSI_PARAM_FIRST_BURST, 0)
 
 iscsi_session_attr (max_burst_len, ISCSI_PARAM_MAX_BURST, 0)
 
 iscsi_session_attr (data_pdu_in_order, ISCSI_PARAM_PDU_INORDER_EN, 0)
 
 iscsi_session_attr (data_seq_in_order, ISCSI_PARAM_DATASEQ_INORDER_EN, 0)
 
 iscsi_session_attr (erl, ISCSI_PARAM_ERL, 0)
 
 iscsi_session_attr (tpgt, ISCSI_PARAM_TPGT, 0)
 
 iscsi_session_attr (username, ISCSI_PARAM_USERNAME, 1)
 
 iscsi_session_attr (username_in, ISCSI_PARAM_USERNAME_IN, 1)
 
 iscsi_session_attr (password, ISCSI_PARAM_PASSWORD, 1)
 
 iscsi_session_attr (password_in, ISCSI_PARAM_PASSWORD_IN, 1)
 
 iscsi_session_attr (chap_out_idx, ISCSI_PARAM_CHAP_OUT_IDX, 1)
 
 iscsi_session_attr (chap_in_idx, ISCSI_PARAM_CHAP_IN_IDX, 1)
 
 iscsi_session_attr (fast_abort, ISCSI_PARAM_FAST_ABORT, 0)
 
 iscsi_session_attr (abort_tmo, ISCSI_PARAM_ABORT_TMO, 0)
 
 iscsi_session_attr (lu_reset_tmo, ISCSI_PARAM_LU_RESET_TMO, 0)
 
 iscsi_session_attr (tgt_reset_tmo, ISCSI_PARAM_TGT_RESET_TMO, 0)
 
 iscsi_session_attr (ifacename, ISCSI_PARAM_IFACE_NAME, 0)
 
 iscsi_session_attr (initiatorname, ISCSI_PARAM_INITIATOR_NAME, 0)
 
 iscsi_session_attr (targetalias, ISCSI_PARAM_TARGET_ALIAS, 0)
 
 iscsi_priv_session_rw_attr (recovery_tmo,"%d")
 
 iscsi_host_attr (netdev, ISCSI_HOST_PARAM_NETDEV_NAME)
 
 iscsi_host_attr (hwaddress, ISCSI_HOST_PARAM_HWADDRESS)
 
 iscsi_host_attr (ipaddress, ISCSI_HOST_PARAM_IPADDRESS)
 
 iscsi_host_attr (initiatorname, ISCSI_HOST_PARAM_INITIATOR_NAME)
 
 iscsi_host_attr (port_state, ISCSI_HOST_PARAM_PORT_STATE)
 
 iscsi_host_attr (port_speed, ISCSI_HOST_PARAM_PORT_SPEED)
 
chariscsi_get_port_speed_name (struct Scsi_Host *shost)
 
 EXPORT_SYMBOL_GPL (iscsi_get_port_speed_name)
 
chariscsi_get_port_state_name (struct Scsi_Host *shost)
 
 EXPORT_SYMBOL_GPL (iscsi_get_port_state_name)
 
struct scsi_transport_templateiscsi_register_transport (struct iscsi_transport *tt)
 
 EXPORT_SYMBOL_GPL (iscsi_register_transport)
 
int iscsi_unregister_transport (struct iscsi_transport *tt)
 
 EXPORT_SYMBOL_GPL (iscsi_unregister_transport)
 
 module_init (iscsi_transport_init)
 
 module_exit (iscsi_transport_exit)
 
 MODULE_AUTHOR ("Mike Christie <[email protected]>, ""Dmitry Yusupov <[email protected]>, ""Alex Aizman <[email protected]>")
 
 MODULE_DESCRIPTION ("iSCSI Transport Interface")
 
 MODULE_LICENSE ("GPL")
 
 MODULE_VERSION (ISCSI_TRANSPORT_VERSION)
 
 MODULE_ALIAS_NET_PF_PROTO (PF_NETLINK, NETLINK_ISCSI)
 

Macro Definition Documentation

#define dev_to_iscsi_internal (   _dev)    container_of(_dev, struct iscsi_internal, dev)

Definition at line 97 of file scsi_transport_iscsi.c.

#define ISCSI_ATTR (   _prefix,
  _name,
  _mode,
  _show,
  _store 
)
Value:
struct device_attribute dev_attr_##_prefix##_##_name = \
__ATTR(_name,_mode,_show,_store)

Definition at line 152 of file scsi_transport_iscsi.c.

#define ISCSI_CLASS_ATTR (   _prefix,
  _name,
  _mode,
  _show,
  _store 
)
Value:
struct device_attribute dev_attr_##_prefix##_##_name = \
__ATTR(_name,_mode,_show,_store)

Definition at line 2308 of file scsi_transport_iscsi.c.

#define iscsi_conn_attr (   field,
  param 
)
Value:
static ISCSI_CLASS_ATTR(conn, field, S_IRUGO, show_conn_param_##param, \
NULL);

Definition at line 2325 of file scsi_transport_iscsi.c.

#define iscsi_conn_attr_show (   param)
Value:
static ssize_t \
show_conn_param_##param(struct device *dev, \
struct device_attribute *attr, char *buf) \
{ \
struct iscsi_transport *t = conn->transport; \
return t->get_conn_param(conn, param, buf); \
}

Definition at line 2315 of file scsi_transport_iscsi.c.

#define iscsi_conn_ep_attr (   field,
  param 
)
Value:
static ISCSI_CLASS_ATTR(conn, field, S_IRUGO, \
show_conn_ep_param_##param, NULL);

Definition at line 2368 of file scsi_transport_iscsi.c.

#define iscsi_conn_ep_attr_show (   param)
Value:
static ssize_t show_conn_ep_param_##param(struct device *dev, \
char *buf) \
{ \
struct iscsi_transport *t = conn->transport; \
\
/* \
* Need to make sure ep_disconnect does not free the LLD's \
* interconnect resources while we are trying to read them. \
*/ \
mutex_lock(&conn->ep_mutex); \
ep = conn->ep; \
if (!ep && t->ep_connect) { \
mutex_unlock(&conn->ep_mutex); \
return -ENOTCONN; \
} \
if (ep) \
rc = t->get_ep_param(ep, param, buf); \
else \
rc = t->get_conn_param(conn, param, buf); \
mutex_unlock(&conn->ep_mutex); \
return rc; \
}

Definition at line 2342 of file scsi_transport_iscsi.c.

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

Definition at line 64 of file scsi_transport_iscsi.c.

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

Definition at line 56 of file scsi_transport_iscsi.c.

#define iscsi_dev_to_endpoint (   _dev)    container_of(_dev, struct iscsi_endpoint, dev)

Definition at line 149 of file scsi_transport_iscsi.c.

#define iscsi_host_attr (   field,
  param 
)
Value:
static ISCSI_CLASS_ATTR(host, field, S_IRUGO, show_host_param_##param, \
NULL);

Definition at line 2664 of file scsi_transport_iscsi.c.

#define iscsi_host_attr_show (   param)
Value:
static ssize_t \
show_host_param_##param(struct device *dev, \
struct device_attribute *attr, char *buf) \
{ \
struct iscsi_internal *priv = to_iscsi_internal(shost->transportt); \
return priv->iscsi_transport->get_host_param(shost, param, buf); \
}

Definition at line 2654 of file scsi_transport_iscsi.c.

#define ISCSI_IFACE_ATTR (   _prefix,
  _name,
  _mode,
  _show,
  _store 
)
Value:
struct device_attribute dev_attr_##_prefix##_##_name = \
__ATTR(_name, _mode, _show, _store)

Definition at line 289 of file scsi_transport_iscsi.c.

#define iscsi_iface_attr_show (   type,
  name,
  param_type,
  param 
)
Value:
static ssize_t \
show_##type##_##name(struct device *dev, struct device_attribute *attr, \
char *buf) \
{ \
struct iscsi_transport *t = iface->transport; \
return t->get_iface_param(iface, param_type, param, buf); \
} \

Definition at line 294 of file scsi_transport_iscsi.c.

#define iscsi_iface_net_attr (   type,
  name,
  param 
)
#define ISCSI_MAX_EPID   -1

Definition at line 184 of file scsi_transport_iscsi.c.

#define iscsi_priv_session_attr_show (   field,
  format 
)
Value:
static ssize_t \
show_priv_session_##field(struct device *dev, \
struct device_attribute *attr, char *buf) \
{ \
iscsi_dev_to_session(dev->parent); \
if (session->field == -1) \
return sprintf(buf, "off\n"); \
return sprintf(buf, format"\n", session->field); \
}

Definition at line 2504 of file scsi_transport_iscsi.c.

#define iscsi_priv_session_attr_store (   field)
Value:
static ssize_t \
store_priv_session_##field(struct device *dev, \
const char *buf, size_t count) \
{ \
int val; \
char *cp; \
iscsi_dev_to_session(dev->parent); \
if ((session->state == ISCSI_SESSION_FREE) || \
(session->state == ISCSI_SESSION_FAILED)) \
return -EBUSY; \
if (strncmp(buf, "off", 3) == 0) \
session->field = -1; \
else { \
val = simple_strtoul(buf, &cp, 0); \
if (*cp != '\0' && *cp != '\n') \
return -EINVAL; \
session->field = val; \
} \
return count; \
}

Definition at line 2516 of file scsi_transport_iscsi.c.

#define iscsi_priv_session_rw_attr (   field,
  format 
)
Value:
iscsi_priv_session_attr_store(field) \
static ISCSI_CLASS_ATTR(priv_sess, field, S_IRUGO | S_IWUSR, \
show_priv_session_##field, \
store_priv_session_##field)

Definition at line 2540 of file scsi_transport_iscsi.c.

#define iscsi_session_attr (   field,
  param,
  perm 
)
Value:
static ISCSI_CLASS_ATTR(sess, field, S_IRUGO, show_session_param_##param, \
NULL);

Definition at line 2457 of file scsi_transport_iscsi.c.

#define iscsi_session_attr_show (   param,
  perm 
)
Value:
static ssize_t \
show_session_param_##param(struct device *dev, \
struct device_attribute *attr, char *buf) \
{ \
iscsi_dev_to_session(dev->parent); \
struct iscsi_transport *t = session->transport; \
return -EACCES; \
return t->get_session_param(session, param, buf); \
}

Definition at line 2443 of file scsi_transport_iscsi.c.

#define ISCSI_TRANSPORT_VERSION   "2.0-870"

Definition at line 38 of file scsi_transport_iscsi.c.

#define show_transport_attr (   name,
  format 
)
Value:
static ssize_t \
show_transport_##name(struct device *dev, \
struct device_attribute *attr,char *buf) \
{ \
return sprintf(buf, format"\n", priv->iscsi_transport->name); \
} \
static DEVICE_ATTR(name, S_IRUGO, show_transport_##name, NULL);

Definition at line 124 of file scsi_transport_iscsi.c.

#define to_iscsi_internal (   tmpl)    container_of(tmpl, struct iscsi_internal, t)

Definition at line 94 of file scsi_transport_iscsi.c.

Function Documentation

EXPORT_SYMBOL_GPL ( iscsi_create_endpoint  )
EXPORT_SYMBOL_GPL ( iscsi_destroy_endpoint  )
EXPORT_SYMBOL_GPL ( iscsi_lookup_endpoint  )
EXPORT_SYMBOL_GPL ( iscsi_create_iface  )
EXPORT_SYMBOL_GPL ( iscsi_destroy_iface  )
EXPORT_SYMBOL_GPL ( iscsi_session_chkready  )
EXPORT_SYMBOL_GPL ( iscsi_is_session_online  )
EXPORT_SYMBOL_GPL ( iscsi_is_session_dev  )
EXPORT_SYMBOL_GPL ( iscsi_host_for_each_session  )
EXPORT_SYMBOL_GPL ( iscsi_scan_finished  )
EXPORT_SYMBOL_GPL ( iscsi_block_scsi_eh  )
EXPORT_SYMBOL_GPL ( iscsi_unblock_session  )
EXPORT_SYMBOL_GPL ( iscsi_block_session  )
EXPORT_SYMBOL_GPL ( iscsi_alloc_session  )
EXPORT_SYMBOL_GPL ( iscsi_add_session  )
EXPORT_SYMBOL_GPL ( iscsi_create_session  )
EXPORT_SYMBOL_GPL ( iscsi_remove_session  )
EXPORT_SYMBOL_GPL ( iscsi_free_session  )
EXPORT_SYMBOL_GPL ( iscsi_destroy_session  )
EXPORT_SYMBOL_GPL ( iscsi_create_conn  )
EXPORT_SYMBOL_GPL ( iscsi_destroy_conn  )
EXPORT_SYMBOL_GPL ( iscsi_recv_pdu  )
EXPORT_SYMBOL_GPL ( iscsi_offload_mesg  )
EXPORT_SYMBOL_GPL ( iscsi_conn_error_event  )
EXPORT_SYMBOL_GPL ( iscsi_conn_login_event  )
EXPORT_SYMBOL_GPL ( iscsi_post_host_event  )
EXPORT_SYMBOL_GPL ( iscsi_ping_comp_event  )
EXPORT_SYMBOL_GPL ( iscsi_session_event  )
EXPORT_SYMBOL_GPL ( iscsi_get_port_speed_name  )
EXPORT_SYMBOL_GPL ( iscsi_get_port_state_name  )
EXPORT_SYMBOL_GPL ( iscsi_register_transport  )
EXPORT_SYMBOL_GPL ( iscsi_unregister_transport  )
int iscsi_add_session ( struct iscsi_cls_session session,
unsigned int  target_id 
)

Definition at line 1058 of file scsi_transport_iscsi.c.

struct iscsi_cls_session* iscsi_alloc_session ( struct Scsi_Host shost,
struct iscsi_transport transport,
int  dd_size 
)
read

Definition at line 1023 of file scsi_transport_iscsi.c.

int iscsi_block_scsi_eh ( struct scsi_cmnd cmd)

iscsi_block_scsi_eh - block scsi eh until session state has transistioned : scsi cmd passed to scsi eh handler

If the session is down this function will wait for the recovery timer to fire or for the session to be logged back in. If the recovery timer fires then FAST_IO_FAIL is returned. The caller should pass this error value to the scsi eh.

Definition at line 860 of file scsi_transport_iscsi.c.

void iscsi_block_session ( struct iscsi_cls_session session)

Definition at line 982 of file scsi_transport_iscsi.c.

iscsi_conn_attr ( max_recv_dlength  ,
ISCSI_PARAM_MAX_RECV_DLENGTH   
)
iscsi_conn_attr ( max_xmit_dlength  ,
ISCSI_PARAM_MAX_XMIT_DLENGTH   
)
iscsi_conn_attr ( header_digest  ,
ISCSI_PARAM_HDRDGST_EN   
)
iscsi_conn_attr ( data_digest  ,
ISCSI_PARAM_DATADGST_EN   
)
iscsi_conn_attr ( ifmarker  ,
ISCSI_PARAM_IFMARKER_EN   
)
iscsi_conn_attr ( ofmarker  ,
ISCSI_PARAM_OFMARKER_EN   
)
iscsi_conn_attr ( persistent_port  ,
ISCSI_PARAM_PERSISTENT_PORT   
)
iscsi_conn_attr ( exp_statsn  ,
ISCSI_PARAM_EXP_STATSN   
)
iscsi_conn_attr ( persistent_address  ,
ISCSI_PARAM_PERSISTENT_ADDRESS   
)
iscsi_conn_attr ( ping_tmo  ,
ISCSI_PARAM_PING_TMO   
)
iscsi_conn_attr ( recv_tmo  ,
ISCSI_PARAM_RECV_TMO   
)
iscsi_conn_ep_attr ( address  ,
ISCSI_PARAM_CONN_ADDRESS   
)
iscsi_conn_ep_attr ( port  ,
ISCSI_PARAM_CONN_PORT   
)
void iscsi_conn_error_event ( struct iscsi_cls_conn conn,
enum iscsi_err  error 
)

Definition at line 1412 of file scsi_transport_iscsi.c.

void iscsi_conn_login_event ( struct iscsi_cls_conn conn,
enum iscsi_conn_state  state 
)

Definition at line 1446 of file scsi_transport_iscsi.c.

struct iscsi_cls_conn* iscsi_create_conn ( struct iscsi_cls_session session,
int  dd_size,
uint32_t  cid 
)
read

iscsi_create_conn - create iscsi class connection : iscsi cls session : private driver data size : connection id

This can be called from a LLD or iscsi_transport. The connection is child of the session so cid must be unique for all connections on the session.

Since we do not support MCS, cid will normally be zero. In some cases for software iscsi we could be trying to preallocate a connection struct in which case there could be two connection structs and cid would be non-zero.

Definition at line 1243 of file scsi_transport_iscsi.c.

struct iscsi_endpoint* iscsi_create_endpoint ( int  dd_size)
read

Definition at line 195 of file scsi_transport_iscsi.c.

struct iscsi_iface* iscsi_create_iface ( struct Scsi_Host shost,
struct iscsi_transport transport,
uint32_t  iface_type,
uint32_t  iface_num,
int  dd_size 
)
read

Definition at line 408 of file scsi_transport_iscsi.c.

struct iscsi_cls_session* iscsi_create_session ( struct Scsi_Host shost,
struct iscsi_transport transport,
int  dd_size,
unsigned int  target_id 
)
read

iscsi_create_session - create iscsi class session : scsi host : iscsi transport : private driver data size : which target

This can be called from a LLD or iscsi_transport.

Definition at line 1117 of file scsi_transport_iscsi.c.

int iscsi_destroy_conn ( struct iscsi_cls_conn conn)

iscsi_destroy_conn - destroy iscsi class connection : iscsi cls session

This can be called from a LLD or iscsi_transport.

Definition at line 1298 of file scsi_transport_iscsi.c.

void iscsi_destroy_endpoint ( struct iscsi_endpoint ep)

Definition at line 243 of file scsi_transport_iscsi.c.

void iscsi_destroy_iface ( struct iscsi_iface iface)

Definition at line 455 of file scsi_transport_iscsi.c.

int iscsi_destroy_session ( struct iscsi_cls_session session)

iscsi_destroy_session - destroy iscsi session : iscsi_session

Can be called by a LLD or iscsi_transport. There must not be any running connections.

Definition at line 1218 of file scsi_transport_iscsi.c.

void iscsi_free_session ( struct iscsi_cls_session session)

Definition at line 1203 of file scsi_transport_iscsi.c.

char* iscsi_get_port_speed_name ( struct Scsi_Host shost)

Definition at line 2731 of file scsi_transport_iscsi.c.

char* iscsi_get_port_state_name ( struct Scsi_Host shost)

Definition at line 2757 of file scsi_transport_iscsi.c.

iscsi_host_attr ( netdev  ,
ISCSI_HOST_PARAM_NETDEV_NAME   
)
iscsi_host_attr ( hwaddress  ,
ISCSI_HOST_PARAM_HWADDRESS   
)
iscsi_host_attr ( ipaddress  ,
ISCSI_HOST_PARAM_IPADDRESS   
)
iscsi_host_attr ( initiatorname  ,
ISCSI_HOST_PARAM_INITIATOR_NAME   
)
iscsi_host_attr ( port_state  ,
ISCSI_HOST_PARAM_PORT_STATE   
)
iscsi_host_attr ( port_speed  ,
ISCSI_HOST_PARAM_PORT_SPEED   
)
void iscsi_host_for_each_session ( struct Scsi_Host shost,
void(*)(struct iscsi_cls_session *)  fn 
)

Definition at line 746 of file scsi_transport_iscsi.c.

iscsi_iface_net_attr ( ipv4_iface  ,
ipaddress  ,
ISCSI_NET_PARAM_IPV4_ADDR   
)
iscsi_iface_net_attr ( ipv4_iface  ,
gateway  ,
ISCSI_NET_PARAM_IPV4_GW   
)
iscsi_iface_net_attr ( ipv4_iface  ,
subnet  ,
ISCSI_NET_PARAM_IPV4_SUBNET   
)
iscsi_iface_net_attr ( ipv4_iface  ,
bootproto  ,
ISCSI_NET_PARAM_IPV4_BOOTPROTO   
)
iscsi_iface_net_attr ( ipv6_iface  ,
ipaddress  ,
ISCSI_NET_PARAM_IPV6_ADDR   
)
iscsi_iface_net_attr ( ipv6_iface  ,
link_local_addr  ,
ISCSI_NET_PARAM_IPV6_LINKLOCAL   
)
iscsi_iface_net_attr ( ipv6_iface  ,
router_addr  ,
ISCSI_NET_PARAM_IPV6_ROUTER   
)
iscsi_iface_net_attr ( ipv6_iface  ,
ipaddr_autocfg  ,
ISCSI_NET_PARAM_IPV6_ADDR_AUTOCFG   
)
iscsi_iface_net_attr ( ipv6_iface  ,
link_local_autocfg  ,
ISCSI_NET_PARAM_IPV6_LINKLOCAL_AUTOCFG   
)
iscsi_iface_net_attr ( iface  ,
enabled  ,
ISCSI_NET_PARAM_IFACE_ENABLE   
)
iscsi_iface_net_attr ( iface  ,
vlan_id  ,
ISCSI_NET_PARAM_VLAN_ID   
)
iscsi_iface_net_attr ( iface  ,
vlan_priority  ,
ISCSI_NET_PARAM_VLAN_PRIORITY   
)
iscsi_iface_net_attr ( iface  ,
vlan_enabled  ,
ISCSI_NET_PARAM_VLAN_ENABLED   
)
iscsi_iface_net_attr ( iface  ,
mtu  ,
ISCSI_NET_PARAM_MTU   
)
iscsi_iface_net_attr ( iface  ,
port  ,
ISCSI_NET_PARAM_PORT   
)
int iscsi_is_session_dev ( const struct device dev)

Definition at line 730 of file scsi_transport_iscsi.c.

int iscsi_is_session_online ( struct iscsi_cls_session session)

Definition at line 706 of file scsi_transport_iscsi.c.

struct iscsi_endpoint* iscsi_lookup_endpoint ( u64  handle)
read

Definition at line 250 of file scsi_transport_iscsi.c.

int iscsi_offload_mesg ( struct Scsi_Host shost,
struct iscsi_transport transport,
uint32_t  type,
char data,
uint16_t  data_size 
)

Definition at line 1377 of file scsi_transport_iscsi.c.

void iscsi_ping_comp_event ( uint32_t  host_no,
struct iscsi_transport transport,
uint32_t  status,
uint32_t  pid,
uint32_t  data_size,
uint8_t data 
)

Definition at line 1511 of file scsi_transport_iscsi.c.

void iscsi_post_host_event ( uint32_t  host_no,
struct iscsi_transport transport,
enum iscsi_host_event_code  code,
uint32_t  data_size,
uint8_t data 
)

Definition at line 1480 of file scsi_transport_iscsi.c.

iscsi_priv_session_rw_attr ( recovery_tmo  ,
"%d"   
)
int iscsi_recv_pdu ( struct iscsi_cls_conn conn,
struct iscsi_hdr hdr,
char data,
uint32_t  data_size 
)

Definition at line 1339 of file scsi_transport_iscsi.c.

struct scsi_transport_template* iscsi_register_transport ( struct iscsi_transport tt)
read

Definition at line 2840 of file scsi_transport_iscsi.c.

void iscsi_remove_session ( struct iscsi_cls_session session)

Definition at line 1156 of file scsi_transport_iscsi.c.

int iscsi_scan_finished ( struct Scsi_Host shost,
unsigned long  time 
)

iscsi_scan_finished - helper to report when running scans are done : scsi host : scan run time

This function can be used by drives like qla4xxx to report to the scsi layer when the scans it kicked off at module load time are done.

Definition at line 762 of file scsi_transport_iscsi.c.

iscsi_session_attr ( targetname  ,
ISCSI_PARAM_TARGET_NAME  ,
 
)
iscsi_session_attr ( initial_r2t  ,
ISCSI_PARAM_INITIAL_R2T_EN  ,
 
)
iscsi_session_attr ( max_outstanding_r2t  ,
ISCSI_PARAM_MAX_R2T  ,
 
)
iscsi_session_attr ( immediate_data  ,
ISCSI_PARAM_IMM_DATA_EN  ,
 
)
iscsi_session_attr ( first_burst_len  ,
ISCSI_PARAM_FIRST_BURST  ,
 
)
iscsi_session_attr ( max_burst_len  ,
ISCSI_PARAM_MAX_BURST  ,
 
)
iscsi_session_attr ( data_pdu_in_order  ,
ISCSI_PARAM_PDU_INORDER_EN  ,
 
)
iscsi_session_attr ( data_seq_in_order  ,
ISCSI_PARAM_DATASEQ_INORDER_EN  ,
 
)
iscsi_session_attr ( erl  ,
ISCSI_PARAM_ERL  ,
 
)
iscsi_session_attr ( tpgt  ,
ISCSI_PARAM_TPGT  ,
 
)
iscsi_session_attr ( username  ,
ISCSI_PARAM_USERNAME  ,
 
)
iscsi_session_attr ( username_in  ,
ISCSI_PARAM_USERNAME_IN  ,
 
)
iscsi_session_attr ( password  ,
ISCSI_PARAM_PASSWORD  ,
 
)
iscsi_session_attr ( password_in  ,
ISCSI_PARAM_PASSWORD_IN  ,
 
)
iscsi_session_attr ( chap_out_idx  ,
ISCSI_PARAM_CHAP_OUT_IDX  ,
 
)
iscsi_session_attr ( chap_in_idx  ,
ISCSI_PARAM_CHAP_IN_IDX  ,
 
)
iscsi_session_attr ( fast_abort  ,
ISCSI_PARAM_FAST_ABORT  ,
 
)
iscsi_session_attr ( abort_tmo  ,
ISCSI_PARAM_ABORT_TMO  ,
 
)
iscsi_session_attr ( lu_reset_tmo  ,
ISCSI_PARAM_LU_RESET_TMO  ,
 
)
iscsi_session_attr ( tgt_reset_tmo  ,
ISCSI_PARAM_TGT_RESET_TMO  ,
 
)
iscsi_session_attr ( ifacename  ,
ISCSI_PARAM_IFACE_NAME  ,
 
)
iscsi_session_attr ( initiatorname  ,
ISCSI_PARAM_INITIATOR_NAME  ,
 
)
iscsi_session_attr ( targetalias  ,
ISCSI_PARAM_TARGET_ALIAS  ,
 
)
int iscsi_session_chkready ( struct iscsi_cls_session session)

Definition at line 681 of file scsi_transport_iscsi.c.

int iscsi_session_event ( struct iscsi_cls_session session,
enum iscsi_uevent_e  event 
)

iscsi_session_event - send session destr. completion event : iscsi class session : type of event

Definition at line 1632 of file scsi_transport_iscsi.c.

void iscsi_unblock_session ( struct iscsi_cls_session session)

iscsi_unblock_session - set a session as logged in and start IO. : iscsi session

Mark a session as ready to accept IO.

Definition at line 952 of file scsi_transport_iscsi.c.

int iscsi_unregister_transport ( struct iscsi_transport tt)

Definition at line 2905 of file scsi_transport_iscsi.c.

MODULE_ALIAS_NET_PF_PROTO ( PF_NETLINK  ,
NETLINK_ISCSI   
)
MODULE_AUTHOR ( "Mike Christie <[email protected] ,
""Dmitry Yusupov< dmitry_yus @yahoo.com >  ,
""Alex Aizman< itn780 @yahoo.com >"   
)
MODULE_DESCRIPTION ( "iSCSI Transport Interface )
module_exit ( iscsi_transport_exit  )
module_init ( iscsi_transport_init  )
MODULE_LICENSE ( "GPL"  )
module_param_named ( debug_session  ,
dbg_session  ,
int  ,
S_IRUGO S_IWUSR 
)
module_param_named ( debug_conn  ,
dbg_conn  ,
int  ,
S_IRUGO S_IWUSR 
)
MODULE_PARM_DESC ( debug_session  ,
"Turn on debugging for sessions in scsi_transport_iscsi ""module. Set to 1 to turn  on,
and zero to turn off.Default""is off."   
)
MODULE_PARM_DESC ( debug_conn  ,
"Turn on debugging for connections in scsi_transport_iscsi ""module. Set to 1 to turn  on,
and zero to turn off.Default""is off."   
)
MODULE_VERSION ( ISCSI_TRANSPORT_VERSION  )
show_transport_attr ( caps  ,
"0x%x"   
)

Variable Documentation

char* name

Definition at line 660 of file scsi_transport_iscsi.c.

enum iscsi_port_state value

Definition at line 659 of file scsi_transport_iscsi.c.