2005-08-05 06:30:31 +04:00
|
|
|
/*
|
|
|
|
* iSCSI Initiator TCP Transport
|
|
|
|
* Copyright (C) 2004 Dmitry Yusupov
|
|
|
|
* Copyright (C) 2004 Alex Aizman
|
2006-04-07 06:26:46 +04:00
|
|
|
* Copyright (C) 2005 - 2006 Mike Christie
|
|
|
|
* Copyright (C) 2006 Red Hat, Inc. All rights reserved.
|
2005-08-05 06:30:31 +04:00
|
|
|
* maintained by open-iscsi@googlegroups.com
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published
|
|
|
|
* by the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* General Public License for more details.
|
|
|
|
*
|
|
|
|
* See the file COPYING included with this distribution for more details.
|
|
|
|
*/
|
|
|
|
|
2008-12-02 09:32:12 +03:00
|
|
|
#ifndef ISCSI_SW_TCP_H
|
|
|
|
#define ISCSI_SW_TCP_H
|
2005-08-05 06:30:31 +04:00
|
|
|
|
2006-04-07 06:26:46 +04:00
|
|
|
#include <scsi/libiscsi.h>
|
2008-12-02 09:32:12 +03:00
|
|
|
#include <scsi/libiscsi_tcp.h>
|
2005-08-05 06:30:31 +04:00
|
|
|
|
2006-04-07 06:26:46 +04:00
|
|
|
struct socket;
|
2007-12-13 21:43:21 +03:00
|
|
|
struct iscsi_tcp_conn;
|
|
|
|
|
|
|
|
/* Socket connection send helper */
|
2008-12-02 09:32:12 +03:00
|
|
|
struct iscsi_sw_tcp_send {
|
2007-12-13 21:43:21 +03:00
|
|
|
struct iscsi_hdr *hdr;
|
2007-12-13 21:43:35 +03:00
|
|
|
struct iscsi_segment segment;
|
|
|
|
struct iscsi_segment data_segment;
|
2005-08-05 06:30:31 +04:00
|
|
|
};
|
|
|
|
|
2008-12-02 09:32:12 +03:00
|
|
|
struct iscsi_sw_tcp_conn {
|
2006-04-07 06:26:46 +04:00
|
|
|
struct socket *sock;
|
2005-08-05 06:30:31 +04:00
|
|
|
|
2008-12-02 09:32:12 +03:00
|
|
|
struct iscsi_sw_tcp_send out;
|
2005-08-05 06:30:31 +04:00
|
|
|
/* old values for socket callbacks */
|
2014-04-12 00:15:36 +04:00
|
|
|
void (*old_data_ready)(struct sock *);
|
2005-08-05 06:30:31 +04:00
|
|
|
void (*old_state_change)(struct sock *);
|
|
|
|
void (*old_write_space)(struct sock *);
|
|
|
|
|
2006-09-01 02:09:28 +04:00
|
|
|
/* data and header digests */
|
2016-01-24 16:19:41 +03:00
|
|
|
struct ahash_request *tx_hash; /* CRC32C (Tx) */
|
|
|
|
struct ahash_request *rx_hash; /* CRC32C (Rx) */
|
2005-08-05 06:30:31 +04:00
|
|
|
|
2006-04-07 06:26:46 +04:00
|
|
|
/* MIB custom statistics */
|
2005-08-05 06:30:31 +04:00
|
|
|
uint32_t sendpage_failures_cnt;
|
|
|
|
uint32_t discontiguous_hdr_cnt;
|
2006-01-14 03:05:44 +03:00
|
|
|
|
2007-12-13 21:43:35 +03:00
|
|
|
ssize_t (*sendpage)(struct socket *, struct page *, int, size_t, int);
|
2005-08-05 06:30:31 +04:00
|
|
|
};
|
|
|
|
|
2011-02-17 00:04:36 +03:00
|
|
|
struct iscsi_sw_tcp_host {
|
|
|
|
struct iscsi_session *session;
|
|
|
|
};
|
|
|
|
|
2008-12-02 09:32:12 +03:00
|
|
|
struct iscsi_sw_tcp_hdrbuf {
|
|
|
|
struct iscsi_hdr hdrbuf;
|
|
|
|
char hdrextbuf[ISCSI_MAX_AHS_SIZE +
|
2007-12-13 21:43:23 +03:00
|
|
|
ISCSI_DIGEST_SIZE];
|
2005-08-05 06:30:31 +04:00
|
|
|
};
|
|
|
|
|
2008-12-02 09:32:12 +03:00
|
|
|
#endif /* ISCSI_SW_TCP_H */
|