Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Typedefs | Enumerations | Functions
libiscsi_tcp.h File Reference
#include <scsi/libiscsi.h>

Go to the source code of this file.

Data Structures

struct  iscsi_segment
 
struct  iscsi_tcp_recv
 
struct  iscsi_tcp_conn
 
struct  iscsi_tcp_task
 

Typedefs

typedef int iscsi_segment_done_fn_t (struct iscsi_tcp_conn *, struct iscsi_segment *)
 

Enumerations

enum  { ISCSI_TCP_SEGMENT_DONE, ISCSI_TCP_SKB_DONE, ISCSI_TCP_CONN_ERR, ISCSI_TCP_SUSPENDED }
 

Functions

void iscsi_tcp_hdr_recv_prep (struct iscsi_tcp_conn *tcp_conn)
 
int iscsi_tcp_recv_skb (struct iscsi_conn *conn, struct sk_buff *skb, unsigned int offset, bool offloaded, int *status)
 
void iscsi_tcp_cleanup_task (struct iscsi_task *task)
 
int iscsi_tcp_task_init (struct iscsi_task *task)
 
int iscsi_tcp_task_xmit (struct iscsi_task *task)
 
int iscsi_tcp_recv_segment_is_hdr (struct iscsi_tcp_conn *tcp_conn)
 
int iscsi_tcp_segment_done (struct iscsi_tcp_conn *tcp_conn, struct iscsi_segment *segment, int recv, unsigned copied)
 
void iscsi_tcp_segment_unmap (struct iscsi_segment *segment)
 
void iscsi_segment_init_linear (struct iscsi_segment *segment, void *data, size_t size, iscsi_segment_done_fn_t *done, struct hash_desc *hash)
 
int iscsi_segment_seek_sg (struct iscsi_segment *segment, struct scatterlist *sg_list, unsigned int sg_count, unsigned int offset, size_t size, iscsi_segment_done_fn_t *done, struct hash_desc *hash)
 
void iscsi_tcp_dgst_header (struct hash_desc *hash, const void *hdr, size_t hdrlen, unsigned char digest[ISCSI_DIGEST_SIZE])
 
struct iscsi_cls_conniscsi_tcp_conn_setup (struct iscsi_cls_session *cls_session, int dd_data_size, uint32_t conn_idx)
 
void iscsi_tcp_conn_teardown (struct iscsi_cls_conn *cls_conn)
 
int iscsi_tcp_r2tpool_alloc (struct iscsi_session *session)
 
void iscsi_tcp_r2tpool_free (struct iscsi_session *session)
 
int iscsi_tcp_set_max_r2t (struct iscsi_conn *conn, char *buf)
 
void iscsi_tcp_conn_get_stats (struct iscsi_cls_conn *cls_conn, struct iscsi_stats *stats)
 

Typedef Documentation

typedef int iscsi_segment_done_fn_t(struct iscsi_tcp_conn *, struct iscsi_segment *)

Definition at line 31 of file libiscsi_tcp.h.

Enumeration Type Documentation

anonymous enum
Enumerator:
ISCSI_TCP_SEGMENT_DONE 
ISCSI_TCP_SKB_DONE 
ISCSI_TCP_CONN_ERR 
ISCSI_TCP_SUSPENDED 

Definition at line 88 of file libiscsi_tcp.h.

Function Documentation

void iscsi_segment_init_linear ( struct iscsi_segment segment,
void data,
size_t  size,
iscsi_segment_done_fn_t done,
struct hash_desc hash 
)
inline

Definition at line 357 of file libiscsi_tcp.c.

int iscsi_segment_seek_sg ( struct iscsi_segment segment,
struct scatterlist sg_list,
unsigned int  sg_count,
unsigned int  offset,
size_t  size,
iscsi_segment_done_fn_t done,
struct hash_desc hash 
)
inline

Definition at line 368 of file libiscsi_tcp.c.

void iscsi_tcp_cleanup_task ( struct iscsi_task task)

iscsi_tcp_cleanup_task - free tcp_task resources : iscsi task

must be called with session lock

Definition at line 451 of file libiscsi_tcp.c.

void iscsi_tcp_conn_get_stats ( struct iscsi_cls_conn cls_conn,
struct iscsi_stats stats 
)

Definition at line 1191 of file libiscsi_tcp.c.

struct iscsi_cls_conn* iscsi_tcp_conn_setup ( struct iscsi_cls_session cls_session,
int  dd_data_size,
uint32_t  conn_idx 
)
read

Definition at line 1080 of file libiscsi_tcp.c.

void iscsi_tcp_conn_teardown ( struct iscsi_cls_conn cls_conn)

Definition at line 1106 of file libiscsi_tcp.c.

void iscsi_tcp_dgst_header ( struct hash_desc hash,
const void hdr,
size_t  hdrlen,
unsigned char  digest[ISCSI_DIGEST_SIZE] 
)
inline

Definition at line 313 of file libiscsi_tcp.c.

void iscsi_tcp_hdr_recv_prep ( struct iscsi_tcp_conn tcp_conn)

iscsi_tcp_hdr_recv_prep - prep segment for hdr reception : iscsi connection to prep for

This function always passes NULL for the hash argument, because when this function is called we do not yet know the final size of the header and want to delay the digest processing until we know that.

Definition at line 397 of file libiscsi_tcp.c.

int iscsi_tcp_r2tpool_alloc ( struct iscsi_session session)

Definition at line 1112 of file libiscsi_tcp.c.

void iscsi_tcp_r2tpool_free ( struct iscsi_session session)

Definition at line 1159 of file libiscsi_tcp.c.

int iscsi_tcp_recv_segment_is_hdr ( struct iscsi_tcp_conn tcp_conn)
inline

iscsi_tcp_recv_segment_is_hdr - tests if we are reading in a header : iscsi tcp conn

returns non zero if we are currently processing or setup to process a header.

Definition at line 855 of file libiscsi_tcp.c.

int iscsi_tcp_recv_skb ( struct iscsi_conn conn,
struct sk_buff skb,
unsigned int  offset,
bool  offloaded,
int status 
)

iscsi_tcp_recv_skb - Process skb : iscsi connection : network buffer with header and/or data segment : offset in skb : bool indicating if transfer was offloaded

Will return status of transfer in status. And will return number of bytes copied.

Definition at line 871 of file libiscsi_tcp.c.

int iscsi_tcp_segment_done ( struct iscsi_tcp_conn tcp_conn,
struct iscsi_segment segment,
int  recv,
unsigned  copied 
)

iscsi_tcp_segment_done - check whether the segment is complete : iscsi tcp connection : iscsi segment to check : set to one of this is called from the recv path : number of bytes copied

Check if we're done receiving this segment. If the receive buffer is full but we expect more data, move on to the next entry in the scatterlist.

If the amount of data we received isn't a multiple of 4, we will transparently receive the pad bytes, too.

This function must be re-entrant.

Definition at line 192 of file libiscsi_tcp.c.

void iscsi_tcp_segment_unmap ( struct iscsi_segment segment)

Definition at line 148 of file libiscsi_tcp.c.

int iscsi_tcp_set_max_r2t ( struct iscsi_conn conn,
char buf 
)

Definition at line 1173 of file libiscsi_tcp.c.

int iscsi_tcp_task_init ( struct iscsi_task task)

iscsi_tcp_task_init - Initialize iSCSI SCSI_READ or SCSI_WRITE commands : iscsi connection : scsi command task : scsi command

Definition at line 950 of file libiscsi_tcp.c.

int iscsi_tcp_task_xmit ( struct iscsi_task task)

iscsi_tcp_task_xmit - xmit normal PDU task : iscsi command task

We're expected to return 0 when everything was transmitted successfully, -EAGAIN if there's still data in the queue, or != 0 for any other kind of error.

Definition at line 1027 of file libiscsi_tcp.c.