iscsi_tcp.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * iSCSI Initiator TCP Transport
  4. * Copyright (C) 2004 Dmitry Yusupov
  5. * Copyright (C) 2004 Alex Aizman
  6. * Copyright (C) 2005 - 2006 Mike Christie
  7. * Copyright (C) 2006 Red Hat, Inc. All rights reserved.
  8. * maintained by open-iscsi@googlegroups.com
  9. *
  10. * See the file COPYING included with this distribution for more details.
  11. */
  12. #ifndef ISCSI_SW_TCP_H
  13. #define ISCSI_SW_TCP_H
  14. #include <scsi/libiscsi.h>
  15. #include <scsi/libiscsi_tcp.h>
  16. struct socket;
  17. struct iscsi_tcp_conn;
  18. /* Socket connection send helper */
  19. struct iscsi_sw_tcp_send {
  20. struct iscsi_hdr *hdr;
  21. struct iscsi_segment segment;
  22. struct iscsi_segment data_segment;
  23. };
  24. struct iscsi_sw_tcp_conn {
  25. struct socket *sock;
  26. struct iscsi_sw_tcp_send out;
  27. /* old values for socket callbacks */
  28. void (*old_data_ready)(struct sock *);
  29. void (*old_state_change)(struct sock *);
  30. void (*old_write_space)(struct sock *);
  31. /* data and header digests */
  32. struct ahash_request *tx_hash; /* CRC32C (Tx) */
  33. struct ahash_request *rx_hash; /* CRC32C (Rx) */
  34. /* MIB custom statistics */
  35. uint32_t sendpage_failures_cnt;
  36. uint32_t discontiguous_hdr_cnt;
  37. ssize_t (*sendpage)(struct socket *, struct page *, int, size_t, int);
  38. };
  39. struct iscsi_sw_tcp_host {
  40. struct iscsi_session *session;
  41. };
  42. struct iscsi_sw_tcp_hdrbuf {
  43. struct iscsi_hdr hdrbuf;
  44. char hdrextbuf[ISCSI_MAX_AHS_SIZE +
  45. ISCSI_DIGEST_SIZE];
  46. };
  47. #endif /* ISCSI_SW_TCP_H */