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