iscsi_tcp.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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 [email protected]
  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. /* Taken when accessing the sock from the netlink/sysfs interface */
  27. struct mutex sock_lock;
  28. struct work_struct recvwork;
  29. bool queue_recv;
  30. struct iscsi_sw_tcp_send out;
  31. /* old values for socket callbacks */
  32. void (*old_data_ready)(struct sock *);
  33. void (*old_state_change)(struct sock *);
  34. void (*old_write_space)(struct sock *);
  35. /* data and header digests */
  36. struct ahash_request *tx_hash; /* CRC32C (Tx) */
  37. struct ahash_request *rx_hash; /* CRC32C (Rx) */
  38. /* MIB custom statistics */
  39. uint32_t sendpage_failures_cnt;
  40. uint32_t discontiguous_hdr_cnt;
  41. ssize_t (*sendpage)(struct socket *, struct page *, int, size_t, int);
  42. };
  43. struct iscsi_sw_tcp_host {
  44. struct iscsi_session *session;
  45. };
  46. struct iscsi_sw_tcp_hdrbuf {
  47. struct iscsi_hdr hdrbuf;
  48. char hdrextbuf[ISCSI_MAX_AHS_SIZE +
  49. ISCSI_DIGEST_SIZE];
  50. };
  51. #endif /* ISCSI_SW_TCP_H */