fnic_io.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. #define FNIC_DFLT_SG_DESC_CNT 32
  10. #define FNIC_MAX_SG_DESC_CNT 256 /* Maximum descriptors per sgl */
  11. #define FNIC_SG_DESC_ALIGN 16 /* Descriptor address alignment */
  12. struct host_sg_desc {
  13. __le64 addr;
  14. __le32 len;
  15. u32 _resvd;
  16. };
  17. struct fnic_dflt_sgl_list {
  18. struct host_sg_desc sg_desc[FNIC_DFLT_SG_DESC_CNT];
  19. };
  20. struct fnic_sgl_list {
  21. struct host_sg_desc sg_desc[FNIC_MAX_SG_DESC_CNT];
  22. };
  23. enum fnic_sgl_list_type {
  24. FNIC_SGL_CACHE_DFLT = 0, /* cache with default size sgl */
  25. FNIC_SGL_CACHE_MAX, /* cache with max size sgl */
  26. FNIC_SGL_NUM_CACHES /* number of sgl caches */
  27. };
  28. enum fnic_ioreq_state {
  29. FNIC_IOREQ_NOT_INITED = 0,
  30. FNIC_IOREQ_CMD_PENDING,
  31. FNIC_IOREQ_ABTS_PENDING,
  32. FNIC_IOREQ_ABTS_COMPLETE,
  33. FNIC_IOREQ_CMD_COMPLETE,
  34. };
  35. struct fnic_io_req {
  36. struct host_sg_desc *sgl_list; /* sgl list */
  37. void *sgl_list_alloc; /* sgl list address used for free */
  38. dma_addr_t sense_buf_pa; /* dma address for sense buffer*/
  39. dma_addr_t sgl_list_pa; /* dma address for sgl list */
  40. u16 sgl_cnt;
  41. u8 sgl_type; /* device DMA descriptor list type */
  42. u8 io_completed:1; /* set to 1 when fw completes IO */
  43. u32 port_id; /* remote port DID */
  44. unsigned long start_time; /* in jiffies */
  45. struct completion *abts_done; /* completion for abts */
  46. struct completion *dr_done; /* completion for device reset */
  47. };
  48. enum fnic_port_speeds {
  49. DCEM_PORTSPEED_NONE = 0,
  50. DCEM_PORTSPEED_1G = 1000,
  51. DCEM_PORTSPEED_10G = 10000,
  52. DCEM_PORTSPEED_20G = 20000,
  53. DCEM_PORTSPEED_25G = 25000,
  54. DCEM_PORTSPEED_40G = 40000,
  55. DCEM_PORTSPEED_4x10G = 41000,
  56. DCEM_PORTSPEED_100G = 100000,
  57. };
  58. #endif /* _FNIC_IO_H_ */