Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures
scsi_transport_iscsi.h File Reference
#include <linux/device.h>
#include <linux/list.h>
#include <linux/mutex.h>
#include <scsi/iscsi_if.h>

Go to the source code of this file.

Data Structures

struct  iscsi_transport
 
struct  iscsi_cls_conn
 
struct  iscsi_cls_session
 
struct  iscsi_cls_host
 
struct  iscsi_endpoint
 
struct  iscsi_iface
 

: transport name

struct iscsi_transport - iSCSI Transport template

: iSCSI Data-Path capabilities : create new iSCSI session object : destroy existing iSCSI session object : create new iSCSI connection : associate this connection with existing iSCSI session and specified transport descriptor : destroy inactive iSCSI connection : set iSCSI parameter. Return 0 on success, -ENODATA when param is not supported, and a -Exx value on other error. get iSCSI parameter. Must return number of bytes copied to buffer on success, -ENODATA when param is not supported, and a -Exx value on other error : set connection to be operational : suspend/recover/terminate connection : send iSCSI PDU, Login, Logout, NOP-Out, Reject, Text. : notify LLD a block during recovery timed out : Initialize a iscsi_task and any internal structs. When offloading the data path, this is called from queuecommand with the session lock, or from the iscsi_conn_send_pdu context with the session lock. When not offloading the data path, this is called from the scsi work queue without the session lock. Requests LLD to transfer cmd task. Returns 0 or the the number of bytes transferred on success, and -Exyz value on error. When offloading the data path, this is called from queuecommand with the session lock, or from the iscsi_conn_send_pdu context with the session lock. When not offloading the data path, this is called from the scsi work queue without the session lock. : requests LLD to fail task. Called with session lock and after the connection has been suspended and terminated during recovery. If called from abort task then connection is not suspended or terminated but sk_callback_lock is held

Template API provided by iSCSI Transport

#define iscsi_dev_to_conn(_dev)   container_of(_dev, struct iscsi_cls_conn, dev)
 
#define transport_class_to_conn(_cdev)   iscsi_dev_to_conn(_cdev->parent)
 
#define iscsi_conn_to_session(_conn)   iscsi_dev_to_session(_conn->dev.parent)
 
#define ISCSI_MAX_TARGET   -1
 
#define iscsi_dev_to_session(_dev)   container_of(_dev, struct iscsi_cls_session, dev)
 
#define transport_class_to_session(_cdev)   iscsi_dev_to_session(_cdev->parent)
 
#define iscsi_session_to_shost(_session)   dev_to_shost(_session->dev.parent)
 
#define starget_to_session(_stgt)   iscsi_dev_to_session(_stgt->dev.parent)
 
#define iscsi_job_to_shost(_job)   dev_to_shost(_job->dev)
 
#define iscsi_dev_to_iface(_dev)   container_of(_dev, struct iscsi_iface, dev)
 
#define iscsi_iface_to_shost(_iface)   dev_to_shost(_iface->dev.parent)
 
#define iscsi_cls_session_printk(prefix, _cls_session, fmt, a...)   dev_printk(prefix, &(_cls_session)->dev, fmt, ##a)
 
#define iscsi_cls_conn_printk(prefix, _cls_conn, fmt, a...)   dev_printk(prefix, &(_cls_conn)->dev, fmt, ##a)
 
enum  { ISCSI_SESSION_LOGGED_IN, ISCSI_SESSION_FAILED, ISCSI_SESSION_FREE }
 
struct scsi_transport_templateiscsi_register_transport (struct iscsi_transport *tt)
 
int iscsi_unregister_transport (struct iscsi_transport *tt)
 
void iscsi_conn_error_event (struct iscsi_cls_conn *conn, enum iscsi_err error)
 
void iscsi_conn_login_event (struct iscsi_cls_conn *conn, enum iscsi_conn_state state)
 
int iscsi_recv_pdu (struct iscsi_cls_conn *conn, struct iscsi_hdr *hdr, char *data, uint32_t data_size)
 
int iscsi_offload_mesg (struct Scsi_Host *shost, struct iscsi_transport *transport, uint32_t type, char *data, uint16_t data_size)
 
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)
 
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)
 
void iscsi_host_for_each_session (struct Scsi_Host *shost, void(*fn)(struct iscsi_cls_session *))
 
int iscsi_session_chkready (struct iscsi_cls_session *session)
 
int iscsi_is_session_online (struct iscsi_cls_session *session)
 
struct iscsi_cls_sessioniscsi_alloc_session (struct Scsi_Host *shost, struct iscsi_transport *transport, int dd_size)
 
int iscsi_add_session (struct iscsi_cls_session *session, unsigned int target_id)
 
int iscsi_session_event (struct iscsi_cls_session *session, enum iscsi_uevent_e event)
 
struct iscsi_cls_sessioniscsi_create_session (struct Scsi_Host *shost, struct iscsi_transport *t, int dd_size, unsigned int target_id)
 
void iscsi_remove_session (struct iscsi_cls_session *session)
 
void iscsi_free_session (struct iscsi_cls_session *session)
 
int iscsi_destroy_session (struct iscsi_cls_session *session)
 
struct iscsi_cls_conniscsi_create_conn (struct iscsi_cls_session *sess, int dd_size, uint32_t cid)
 
int iscsi_destroy_conn (struct iscsi_cls_conn *conn)
 
void iscsi_unblock_session (struct iscsi_cls_session *session)
 
void iscsi_block_session (struct iscsi_cls_session *session)
 
int iscsi_scan_finished (struct Scsi_Host *shost, unsigned long time)
 
struct iscsi_endpointiscsi_create_endpoint (int dd_size)
 
void iscsi_destroy_endpoint (struct iscsi_endpoint *ep)
 
struct iscsi_endpointiscsi_lookup_endpoint (u64 handle)
 
int iscsi_block_scsi_eh (struct scsi_cmnd *cmd)
 
struct iscsi_ifaceiscsi_create_iface (struct Scsi_Host *shost, struct iscsi_transport *t, uint32_t iface_type, uint32_t iface_num, int dd_size)
 
void iscsi_destroy_iface (struct iscsi_iface *iface)
 
struct iscsi_ifaceiscsi_lookup_iface (int handle)
 
chariscsi_get_port_speed_name (struct Scsi_Host *shost)
 
chariscsi_get_port_state_name (struct Scsi_Host *shost)
 
int iscsi_is_session_dev (const struct device *dev)
 

Macro Definition Documentation

#define iscsi_cls_conn_printk (   prefix,
  _cls_conn,
  fmt,
  a... 
)    dev_printk(prefix, &(_cls_conn)->dev, fmt, ##a)

Definition at line 295 of file scsi_transport_iscsi.h.

#define iscsi_cls_session_printk (   prefix,
  _cls_session,
  fmt,
  a... 
)    dev_printk(prefix, &(_cls_session)->dev, fmt, ##a)

Definition at line 292 of file scsi_transport_iscsi.h.

#define iscsi_conn_to_session (   _conn)    iscsi_dev_to_session(_conn->dev.parent)

Definition at line 203 of file scsi_transport_iscsi.h.

#define iscsi_dev_to_conn (   _dev)    container_of(_dev, struct iscsi_cls_conn, dev)

Definition at line 197 of file scsi_transport_iscsi.h.

#define iscsi_dev_to_iface (   _dev)    container_of(_dev, struct iscsi_iface, dev)

Definition at line 283 of file scsi_transport_iscsi.h.

#define iscsi_dev_to_session (   _dev)    container_of(_dev, struct iscsi_cls_session, dev)

Definition at line 242 of file scsi_transport_iscsi.h.

#define iscsi_iface_to_shost (   _iface)    dev_to_shost(_iface->dev.parent)

Definition at line 286 of file scsi_transport_iscsi.h.

#define iscsi_job_to_shost (   _job)    dev_to_shost(_job->dev)

Definition at line 262 of file scsi_transport_iscsi.h.

#define ISCSI_MAX_TARGET   -1

Definition at line 213 of file scsi_transport_iscsi.h.

#define iscsi_session_to_shost (   _session)    dev_to_shost(_session->dev.parent)

Definition at line 248 of file scsi_transport_iscsi.h.

#define starget_to_session (   _stgt)    iscsi_dev_to_session(_stgt->dev.parent)

Definition at line 251 of file scsi_transport_iscsi.h.

#define transport_class_to_conn (   _cdev)    iscsi_dev_to_conn(_cdev->parent)

Definition at line 200 of file scsi_transport_iscsi.h.

#define transport_class_to_session (   _cdev)    iscsi_dev_to_session(_cdev->parent)

Definition at line 245 of file scsi_transport_iscsi.h.

Enumeration Type Documentation

anonymous enum
Enumerator:
ISCSI_SESSION_LOGGED_IN 
ISCSI_SESSION_FAILED 
ISCSI_SESSION_FREE 

Definition at line 207 of file scsi_transport_iscsi.h.

Function Documentation

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.

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 t,
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.

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.

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.

struct iscsi_iface* iscsi_lookup_iface ( int  handle)
read
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.

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.

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.