2005-08-05 10:30:31 +08:00
|
|
|
/*
|
|
|
|
* iSCSI Initiator TCP Transport
|
|
|
|
* Copyright (C) 2004 Dmitry Yusupov
|
|
|
|
* Copyright (C) 2004 Alex Aizman
|
2006-04-07 10:26:46 +08:00
|
|
|
* Copyright (C) 2005 - 2006 Mike Christie
|
|
|
|
* Copyright (C) 2006 Red Hat, Inc. All rights reserved.
|
2005-08-05 10:30:31 +08: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 14:32:12 +08:00
|
|
|
#ifndef ISCSI_SW_TCP_H
|
|
|
|
#define ISCSI_SW_TCP_H
|
2005-08-05 10:30:31 +08:00
|
|
|
|
2006-04-07 10:26:46 +08:00
|
|
|
#include <scsi/libiscsi.h>
|
2008-12-02 14:32:12 +08:00
|
|
|
#include <scsi/libiscsi_tcp.h>
|
2005-08-05 10:30:31 +08:00
|
|
|
|
2006-04-07 10:26:46 +08:00
|
|
|
struct socket;
|
2007-12-14 02:43:21 +08:00
|
|
|
struct iscsi_tcp_conn;
|
|
|
|
|
|
|
|
/* Socket connection send helper */
|
2008-12-02 14:32:12 +08:00
|
|
|
struct iscsi_sw_tcp_send {
|
2007-12-14 02:43:21 +08:00
|
|
|
struct iscsi_hdr *hdr;
|
2007-12-14 02:43:35 +08:00
|
|
|
struct iscsi_segment segment;
|
|
|
|
struct iscsi_segment data_segment;
|
2005-08-05 10:30:31 +08:00
|
|
|
};
|
|
|
|
|
2008-12-02 14:32:12 +08:00
|
|
|
struct iscsi_sw_tcp_conn {
|
2006-04-07 10:26:46 +08:00
|
|
|
struct socket *sock;
|
2005-08-05 10:30:31 +08:00
|
|
|
|
2008-12-02 14:32:12 +08:00
|
|
|
struct iscsi_sw_tcp_send out;
|
2005-08-05 10:30:31 +08:00
|
|
|
/* old values for socket callbacks */
|
2014-04-12 04:15:36 +08:00
|
|
|
void (*old_data_ready)(struct sock *);
|
2005-08-05 10:30:31 +08:00
|
|
|
void (*old_state_change)(struct sock *);
|
|
|
|
void (*old_write_space)(struct sock *);
|
|
|
|
|
2006-09-01 06:09:28 +08:00
|
|
|
/* data and header digests */
|
2006-09-24 04:33:43 +08:00
|
|
|
struct hash_desc tx_hash; /* CRC32C (Tx) */
|
|
|
|
struct hash_desc rx_hash; /* CRC32C (Rx) */
|
2005-08-05 10:30:31 +08:00
|
|
|
|
2006-04-07 10:26:46 +08:00
|
|
|
/* MIB custom statistics */
|
2005-08-05 10:30:31 +08:00
|
|
|
uint32_t sendpage_failures_cnt;
|
|
|
|
uint32_t discontiguous_hdr_cnt;
|
2006-01-14 08:05:44 +08:00
|
|
|
|
2007-12-14 02:43:35 +08:00
|
|
|
ssize_t (*sendpage)(struct socket *, struct page *, int, size_t, int);
|
2005-08-05 10:30:31 +08:00
|
|
|
};
|
|
|
|
|
2011-02-17 05:04:36 +08:00
|
|
|
struct iscsi_sw_tcp_host {
|
|
|
|
struct iscsi_session *session;
|
|
|
|
};
|
|
|
|
|
2008-12-02 14:32:12 +08:00
|
|
|
struct iscsi_sw_tcp_hdrbuf {
|
|
|
|
struct iscsi_hdr hdrbuf;
|
|
|
|
char hdrextbuf[ISCSI_MAX_AHS_SIZE +
|
2007-12-14 02:43:23 +08:00
|
|
|
ISCSI_DIGEST_SIZE];
|
2005-08-05 10:30:31 +08:00
|
|
|
};
|
|
|
|
|
2008-12-02 14:32:12 +08:00
|
|
|
#endif /* ISCSI_SW_TCP_H */
|