2019-05-27 13:55:06 +07:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
2005-08-05 09:30:31 +07:00
|
|
|
/*
|
|
|
|
* iSCSI Initiator TCP Transport
|
|
|
|
* Copyright (C) 2004 Dmitry Yusupov
|
|
|
|
* Copyright (C) 2004 Alex Aizman
|
2006-04-07 09:26:46 +07:00
|
|
|
* Copyright (C) 2005 - 2006 Mike Christie
|
|
|
|
* Copyright (C) 2006 Red Hat, Inc. All rights reserved.
|
2005-08-05 09:30:31 +07:00
|
|
|
* maintained by open-iscsi@googlegroups.com
|
|
|
|
*
|
|
|
|
* See the file COPYING included with this distribution for more details.
|
|
|
|
*/
|
|
|
|
|
2008-12-02 13:32:12 +07:00
|
|
|
#ifndef ISCSI_SW_TCP_H
|
|
|
|
#define ISCSI_SW_TCP_H
|
2005-08-05 09:30:31 +07:00
|
|
|
|
2006-04-07 09:26:46 +07:00
|
|
|
#include <scsi/libiscsi.h>
|
2008-12-02 13:32:12 +07:00
|
|
|
#include <scsi/libiscsi_tcp.h>
|
2005-08-05 09:30:31 +07:00
|
|
|
|
2006-04-07 09:26:46 +07:00
|
|
|
struct socket;
|
2007-12-14 01:43:21 +07:00
|
|
|
struct iscsi_tcp_conn;
|
|
|
|
|
|
|
|
/* Socket connection send helper */
|
2008-12-02 13:32:12 +07:00
|
|
|
struct iscsi_sw_tcp_send {
|
2007-12-14 01:43:21 +07:00
|
|
|
struct iscsi_hdr *hdr;
|
2007-12-14 01:43:35 +07:00
|
|
|
struct iscsi_segment segment;
|
|
|
|
struct iscsi_segment data_segment;
|
2005-08-05 09:30:31 +07:00
|
|
|
};
|
|
|
|
|
2008-12-02 13:32:12 +07:00
|
|
|
struct iscsi_sw_tcp_conn {
|
2006-04-07 09:26:46 +07:00
|
|
|
struct socket *sock;
|
2005-08-05 09:30:31 +07:00
|
|
|
|
2008-12-02 13:32:12 +07:00
|
|
|
struct iscsi_sw_tcp_send out;
|
2005-08-05 09:30:31 +07:00
|
|
|
/* old values for socket callbacks */
|
2014-04-12 03:15:36 +07:00
|
|
|
void (*old_data_ready)(struct sock *);
|
2005-08-05 09:30:31 +07:00
|
|
|
void (*old_state_change)(struct sock *);
|
|
|
|
void (*old_write_space)(struct sock *);
|
|
|
|
|
2006-09-01 05:09:28 +07:00
|
|
|
/* data and header digests */
|
2016-01-24 20:19:41 +07:00
|
|
|
struct ahash_request *tx_hash; /* CRC32C (Tx) */
|
|
|
|
struct ahash_request *rx_hash; /* CRC32C (Rx) */
|
2005-08-05 09:30:31 +07:00
|
|
|
|
2006-04-07 09:26:46 +07:00
|
|
|
/* MIB custom statistics */
|
2005-08-05 09:30:31 +07:00
|
|
|
uint32_t sendpage_failures_cnt;
|
|
|
|
uint32_t discontiguous_hdr_cnt;
|
2006-01-14 07:05:44 +07:00
|
|
|
|
2007-12-14 01:43:35 +07:00
|
|
|
ssize_t (*sendpage)(struct socket *, struct page *, int, size_t, int);
|
2005-08-05 09:30:31 +07:00
|
|
|
};
|
|
|
|
|
2011-02-17 04:04:36 +07:00
|
|
|
struct iscsi_sw_tcp_host {
|
|
|
|
struct iscsi_session *session;
|
|
|
|
};
|
|
|
|
|
2008-12-02 13:32:12 +07:00
|
|
|
struct iscsi_sw_tcp_hdrbuf {
|
|
|
|
struct iscsi_hdr hdrbuf;
|
|
|
|
char hdrextbuf[ISCSI_MAX_AHS_SIZE +
|
2007-12-14 01:43:23 +07:00
|
|
|
ISCSI_DIGEST_SIZE];
|
2005-08-05 09:30:31 +07:00
|
|
|
};
|
|
|
|
|
2008-12-02 13:32:12 +07:00
|
|
|
#endif /* ISCSI_SW_TCP_H */
|