fnic_io.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright 2008 Cisco Systems, Inc. All rights reserved.
  4. * Copyright 2007 Nuova Systems, Inc. All rights reserved.
  5. */
  6. #ifndef _FNIC_IO_H_
  7. #define _FNIC_IO_H_
  8. #include <scsi/fc/fc_fcp.h>
  9. #include "fnic_fdls.h"
  10. #define FNIC_DFLT_SG_DESC_CNT 32
  11. #define FNIC_MAX_SG_DESC_CNT 256 /* Maximum descriptors per sgl */
  12. #define FNIC_SG_DESC_ALIGN 16 /* Descriptor address alignment */
  13. struct host_sg_desc {
  14. __le64 addr;
  15. __le32 len;
  16. u32 _resvd;
  17. };
  18. struct fnic_dflt_sgl_list {
  19. struct host_sg_desc sg_desc[FNIC_DFLT_SG_DESC_CNT];
  20. };
  21. struct fnic_sgl_list {
  22. struct host_sg_desc sg_desc[FNIC_MAX_SG_DESC_CNT];
  23. };
  24. enum fnic_sgl_list_type {
  25. FNIC_SGL_CACHE_DFLT = 0, /* cache with default size sgl */
  26. FNIC_SGL_CACHE_MAX, /* cache with max size sgl */
  27. FNIC_SGL_NUM_CACHES /* number of sgl caches */
  28. };
  29. enum fnic_ioreq_state {
  30. FNIC_IOREQ_NOT_INITED = 0,
  31. FNIC_IOREQ_CMD_PENDING,
  32. FNIC_IOREQ_ABTS_PENDING,
  33. FNIC_IOREQ_ABTS_COMPLETE,
  34. FNIC_IOREQ_CMD_COMPLETE,
  35. };
  36. struct fnic_io_req {
  37. struct fnic_iport_s *iport;
  38. struct fnic_tport_s *tport;
  39. struct host_sg_desc *sgl_list; /* sgl list */
  40. void *sgl_list_alloc; /* sgl list address used for free */
  41. dma_addr_t sense_buf_pa; /* dma address for sense buffer*/
  42. dma_addr_t sgl_list_pa; /* dma address for sgl list */
  43. u16 sgl_cnt;
  44. u8 sgl_type; /* device DMA descriptor list type */
  45. u8 io_completed:1; /* set to 1 when fw completes IO */
  46. u32 port_id; /* remote port DID */
  47. unsigned long start_time; /* in jiffies */
  48. struct completion *abts_done; /* completion for abts */
  49. struct completion *dr_done; /* completion for device reset */
  50. unsigned int tag;
  51. struct scsi_cmnd *sc; /* midlayer's cmd pointer */
  52. };
  53. #endif /* _FNIC_IO_H_ */