bfi_iocfc.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. /*
  2. * Copyright (c) 2005-2009 Brocade Communications Systems, Inc.
  3. * All rights reserved
  4. * www.brocade.com
  5. *
  6. * Linux driver for Brocade Fibre Channel Host Bus Adapter.
  7. *
  8. * This program is free software; you can redistribute it and/or modify it
  9. * under the terms of the GNU General Public License (GPL) Version 2 as
  10. * published by the Free Software Foundation
  11. *
  12. * This program is distributed in the hope that it will be useful, but
  13. * WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * General Public License for more details.
  16. */
  17. #ifndef __BFI_IOCFC_H__
  18. #define __BFI_IOCFC_H__
  19. #include "bfi.h"
  20. #include <defs/bfa_defs_ioc.h>
  21. #include <defs/bfa_defs_iocfc.h>
  22. #include <defs/bfa_defs_boot.h>
  23. #pragma pack(1)
  24. enum bfi_iocfc_h2i_msgs {
  25. BFI_IOCFC_H2I_CFG_REQ = 1,
  26. BFI_IOCFC_H2I_GET_STATS_REQ = 2,
  27. BFI_IOCFC_H2I_CLEAR_STATS_REQ = 3,
  28. BFI_IOCFC_H2I_SET_INTR_REQ = 4,
  29. BFI_IOCFC_H2I_UPDATEQ_REQ = 5,
  30. };
  31. enum bfi_iocfc_i2h_msgs {
  32. BFI_IOCFC_I2H_CFG_REPLY = BFA_I2HM(1),
  33. BFI_IOCFC_I2H_GET_STATS_RSP = BFA_I2HM(2),
  34. BFI_IOCFC_I2H_CLEAR_STATS_RSP = BFA_I2HM(3),
  35. BFI_IOCFC_I2H_UPDATEQ_RSP = BFA_I2HM(5),
  36. };
  37. struct bfi_iocfc_cfg_s {
  38. u8 num_cqs; /* Number of CQs to be used */
  39. u8 sense_buf_len; /* SCSI sense length */
  40. u8 trunk_enabled; /* port trunking enabled */
  41. u8 trunk_ports; /* trunk ports bit map */
  42. u32 endian_sig; /* endian signature of host */
  43. /**
  44. * Request and response circular queue base addresses, size and
  45. * shadow index pointers.
  46. */
  47. union bfi_addr_u req_cq_ba[BFI_IOC_MAX_CQS];
  48. union bfi_addr_u req_shadow_ci[BFI_IOC_MAX_CQS];
  49. u16 req_cq_elems[BFI_IOC_MAX_CQS];
  50. union bfi_addr_u rsp_cq_ba[BFI_IOC_MAX_CQS];
  51. union bfi_addr_u rsp_shadow_pi[BFI_IOC_MAX_CQS];
  52. u16 rsp_cq_elems[BFI_IOC_MAX_CQS];
  53. union bfi_addr_u stats_addr; /* DMA-able address for stats */
  54. union bfi_addr_u cfgrsp_addr; /* config response dma address */
  55. union bfi_addr_u ioim_snsbase; /* IO sense buffer base address */
  56. struct bfa_iocfc_intr_attr_s intr_attr; /* IOC interrupt attributes */
  57. };
  58. /**
  59. * Boot target wwn information for this port. This contains either the stored
  60. * or discovered boot target port wwns for the port.
  61. */
  62. struct bfi_iocfc_bootwwns {
  63. wwn_t wwn[BFA_BOOT_BOOTLUN_MAX];
  64. u8 nwwns;
  65. u8 rsvd[7];
  66. };
  67. struct bfi_iocfc_cfgrsp_s {
  68. struct bfa_iocfc_fwcfg_s fwcfg;
  69. struct bfa_iocfc_intr_attr_s intr_attr;
  70. struct bfi_iocfc_bootwwns bootwwns;
  71. };
  72. /**
  73. * BFI_IOCFC_H2I_CFG_REQ message
  74. */
  75. struct bfi_iocfc_cfg_req_s {
  76. struct bfi_mhdr_s mh;
  77. union bfi_addr_u ioc_cfg_dma_addr;
  78. };
  79. /**
  80. * BFI_IOCFC_I2H_CFG_REPLY message
  81. */
  82. struct bfi_iocfc_cfg_reply_s {
  83. struct bfi_mhdr_s mh; /* Common msg header */
  84. u8 cfg_success; /* cfg reply status */
  85. u8 lpu_bm; /* LPUs assigned for this IOC */
  86. u8 rsvd[2];
  87. };
  88. /**
  89. * BFI_IOCFC_H2I_GET_STATS_REQ & BFI_IOCFC_H2I_CLEAR_STATS_REQ messages
  90. */
  91. struct bfi_iocfc_stats_req_s {
  92. struct bfi_mhdr_s mh; /* msg header */
  93. u32 msgtag; /* msgtag for reply */
  94. };
  95. /**
  96. * BFI_IOCFC_I2H_GET_STATS_RSP & BFI_IOCFC_I2H_CLEAR_STATS_RSP messages
  97. */
  98. struct bfi_iocfc_stats_rsp_s {
  99. struct bfi_mhdr_s mh; /* common msg header */
  100. u8 status; /* reply status */
  101. u8 rsvd[3];
  102. u32 msgtag; /* msgtag for reply */
  103. };
  104. /**
  105. * BFI_IOCFC_H2I_SET_INTR_REQ message
  106. */
  107. struct bfi_iocfc_set_intr_req_s {
  108. struct bfi_mhdr_s mh; /* common msg header */
  109. u8 coalesce; /* enable intr coalescing*/
  110. u8 rsvd[3];
  111. u16 delay; /* delay timer 0..1125us */
  112. u16 latency; /* latency timer 0..225us */
  113. };
  114. /**
  115. * BFI_IOCFC_H2I_UPDATEQ_REQ message
  116. */
  117. struct bfi_iocfc_updateq_req_s {
  118. struct bfi_mhdr_s mh; /* common msg header */
  119. u32 reqq_ba; /* reqq base addr */
  120. u32 rspq_ba; /* rspq base addr */
  121. u32 reqq_sci; /* reqq shadow ci */
  122. u32 rspq_spi; /* rspq shadow pi */
  123. };
  124. /**
  125. * BFI_IOCFC_I2H_UPDATEQ_RSP message
  126. */
  127. struct bfi_iocfc_updateq_rsp_s {
  128. struct bfi_mhdr_s mh; /* common msg header */
  129. u8 status; /* updateq status */
  130. u8 rsvd[3];
  131. };
  132. /**
  133. * H2I Messages
  134. */
  135. union bfi_iocfc_h2i_msg_u {
  136. struct bfi_mhdr_s mh;
  137. struct bfi_iocfc_cfg_req_s cfg_req;
  138. struct bfi_iocfc_stats_req_s stats_get;
  139. struct bfi_iocfc_stats_req_s stats_clr;
  140. struct bfi_iocfc_updateq_req_s updateq_req;
  141. u32 mboxmsg[BFI_IOC_MSGSZ];
  142. };
  143. /**
  144. * I2H Messages
  145. */
  146. union bfi_iocfc_i2h_msg_u {
  147. struct bfi_mhdr_s mh;
  148. struct bfi_iocfc_cfg_reply_s cfg_reply;
  149. struct bfi_iocfc_stats_rsp_s stats_get_rsp;
  150. struct bfi_iocfc_stats_rsp_s stats_clr_rsp;
  151. struct bfi_iocfc_updateq_rsp_s updateq_rsp;
  152. u32 mboxmsg[BFI_IOC_MSGSZ];
  153. };
  154. #pragma pack()
  155. #endif /* __BFI_IOCFC_H__ */