Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 /*
0003  * iSCSI Initiator TCP Transport
0004  * Copyright (C) 2004 Dmitry Yusupov
0005  * Copyright (C) 2004 Alex Aizman
0006  * Copyright (C) 2005 - 2006 Mike Christie
0007  * Copyright (C) 2006 Red Hat, Inc.  All rights reserved.
0008  * maintained by open-iscsi@googlegroups.com
0009  *
0010  * See the file COPYING included with this distribution for more details.
0011  */
0012 
0013 #ifndef ISCSI_SW_TCP_H
0014 #define ISCSI_SW_TCP_H
0015 
0016 #include <scsi/libiscsi.h>
0017 #include <scsi/libiscsi_tcp.h>
0018 
0019 struct socket;
0020 struct iscsi_tcp_conn;
0021 
0022 /* Socket connection send helper */
0023 struct iscsi_sw_tcp_send {
0024     struct iscsi_hdr    *hdr;
0025     struct iscsi_segment    segment;
0026     struct iscsi_segment    data_segment;
0027 };
0028 
0029 struct iscsi_sw_tcp_conn {
0030     struct socket       *sock;
0031     struct work_struct  recvwork;
0032     bool            queue_recv;
0033 
0034     struct iscsi_sw_tcp_send out;
0035     /* old values for socket callbacks */
0036     void            (*old_data_ready)(struct sock *);
0037     void            (*old_state_change)(struct sock *);
0038     void            (*old_write_space)(struct sock *);
0039 
0040     /* data and header digests */
0041     struct ahash_request    *tx_hash;   /* CRC32C (Tx) */
0042     struct ahash_request    *rx_hash;   /* CRC32C (Rx) */
0043 
0044     /* MIB custom statistics */
0045     uint32_t        sendpage_failures_cnt;
0046     uint32_t        discontiguous_hdr_cnt;
0047 
0048     ssize_t (*sendpage)(struct socket *, struct page *, int, size_t, int);
0049 };
0050 
0051 struct iscsi_sw_tcp_host {
0052     struct iscsi_session    *session;
0053 };
0054 
0055 struct iscsi_sw_tcp_hdrbuf {
0056     struct iscsi_hdr    hdrbuf;
0057     char            hdrextbuf[ISCSI_MAX_AHS_SIZE +
0058                                           ISCSI_DIGEST_SIZE];
0059 };
0060 
0061 #endif /* ISCSI_SW_TCP_H */