bfi_iocfc.h 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  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 <bfi/bfi_pbc.h>
  21. #include <defs/bfa_defs_ioc.h>
  22. #include <defs/bfa_defs_iocfc.h>
  23. #include <defs/bfa_defs_boot.h>
  24. #pragma pack(1)
  25. enum bfi_iocfc_h2i_msgs {
  26. BFI_IOCFC_H2I_CFG_REQ = 1,
  27. BFI_IOCFC_H2I_GET_STATS_REQ = 2,
  28. BFI_IOCFC_H2I_CLEAR_STATS_REQ = 3,
  29. BFI_IOCFC_H2I_SET_INTR_REQ = 4,
  30. BFI_IOCFC_H2I_UPDATEQ_REQ = 5,
  31. };
  32. enum bfi_iocfc_i2h_msgs {
  33. BFI_IOCFC_I2H_CFG_REPLY = BFA_I2HM(1),
  34. BFI_IOCFC_I2H_GET_STATS_RSP = BFA_I2HM(2),
  35. BFI_IOCFC_I2H_CLEAR_STATS_RSP = BFA_I2HM(3),
  36. BFI_IOCFC_I2H_UPDATEQ_RSP = BFA_I2HM(5),
  37. };
  38. struct bfi_iocfc_cfg_s {
  39. u8 num_cqs; /* Number of CQs to be used */
  40. u8 sense_buf_len; /* SCSI sense length */
  41. u8 trunk_enabled; /* port trunking enabled */
  42. u8 trunk_ports; /* trunk ports bit map */
  43. u32 endian_sig; /* endian signature of host */
  44. /**
  45. * Request and response circular queue base addresses, size and
  46. * shadow index pointers.
  47. */
  48. union bfi_addr_u req_cq_ba[BFI_IOC_MAX_CQS];
  49. union bfi_addr_u req_shadow_ci[BFI_IOC_MAX_CQS];
  50. u16 req_cq_elems[BFI_IOC_MAX_CQS];
  51. union bfi_addr_u rsp_cq_ba[BFI_IOC_MAX_CQS];
  52. union bfi_addr_u rsp_shadow_pi[BFI_IOC_MAX_CQS];
  53. u16 rsp_cq_elems[BFI_IOC_MAX_CQS];
  54. union bfi_addr_u stats_addr; /* DMA-able address for stats */
  55. union bfi_addr_u cfgrsp_addr; /* config response dma address */
  56. union bfi_addr_u ioim_snsbase; /* IO sense buffer base address */
  57. struct bfa_iocfc_intr_attr_s intr_attr; /* IOC interrupt attributes */
  58. };
  59. /**
  60. * Boot target wwn information for this port. This contains either the stored
  61. * or discovered boot target port wwns for the port.
  62. */
  63. struct bfi_iocfc_bootwwns {
  64. wwn_t wwn[BFA_BOOT_BOOTLUN_MAX];
  65. u8 nwwns;
  66. u8 rsvd[7];
  67. };
  68. struct bfi_iocfc_cfgrsp_s {
  69. struct bfa_iocfc_fwcfg_s fwcfg;
  70. struct bfa_iocfc_intr_attr_s intr_attr;
  71. struct bfi_iocfc_bootwwns bootwwns;
  72. struct bfi_pbc_s pbc_cfg;
  73. };
  74. /**
  75. * BFI_IOCFC_H2I_CFG_REQ message
  76. */
  77. struct bfi_iocfc_cfg_req_s {
  78. struct bfi_mhdr_s mh;
  79. union bfi_addr_u ioc_cfg_dma_addr;
  80. };
  81. /**
  82. * BFI_IOCFC_I2H_CFG_REPLY message
  83. */
  84. struct bfi_iocfc_cfg_reply_s {
  85. struct bfi_mhdr_s mh; /* Common msg header */
  86. u8 cfg_success; /* cfg reply status */
  87. u8 lpu_bm; /* LPUs assigned for this IOC */
  88. u8 rsvd[2];
  89. };
  90. /**
  91. * BFI_IOCFC_H2I_GET_STATS_REQ & BFI_IOCFC_H2I_CLEAR_STATS_REQ messages
  92. */
  93. struct bfi_iocfc_stats_req_s {
  94. struct bfi_mhdr_s mh; /* msg header */
  95. u32 msgtag; /* msgtag for reply */
  96. };
  97. /**
  98. * BFI_IOCFC_I2H_GET_STATS_RSP & BFI_IOCFC_I2H_CLEAR_STATS_RSP messages
  99. */
  100. struct bfi_iocfc_stats_rsp_s {
  101. struct bfi_mhdr_s mh; /* common msg header */
  102. u8 status; /* reply status */
  103. u8 rsvd[3];
  104. u32 msgtag; /* msgtag for reply */
  105. };
  106. /**
  107. * BFI_IOCFC_H2I_SET_INTR_REQ message
  108. */
  109. struct bfi_iocfc_set_intr_req_s {
  110. struct bfi_mhdr_s mh; /* common msg header */
  111. u8 coalesce; /* enable intr coalescing*/
  112. u8 rsvd[3];
  113. u16 delay; /* delay timer 0..1125us */
  114. u16 latency; /* latency timer 0..225us */
  115. };
  116. /**
  117. * BFI_IOCFC_H2I_UPDATEQ_REQ message
  118. */
  119. struct bfi_iocfc_updateq_req_s {
  120. struct bfi_mhdr_s mh; /* common msg header */
  121. u32 reqq_ba; /* reqq base addr */
  122. u32 rspq_ba; /* rspq base addr */
  123. u32 reqq_sci; /* reqq shadow ci */
  124. u32 rspq_spi; /* rspq shadow pi */
  125. };
  126. /**
  127. * BFI_IOCFC_I2H_UPDATEQ_RSP message
  128. */
  129. struct bfi_iocfc_updateq_rsp_s {
  130. struct bfi_mhdr_s mh; /* common msg header */
  131. u8 status; /* updateq status */
  132. u8 rsvd[3];
  133. };
  134. /**
  135. * H2I Messages
  136. */
  137. union bfi_iocfc_h2i_msg_u {
  138. struct bfi_mhdr_s mh;
  139. struct bfi_iocfc_cfg_req_s cfg_req;
  140. struct bfi_iocfc_stats_req_s stats_get;
  141. struct bfi_iocfc_stats_req_s stats_clr;
  142. struct bfi_iocfc_updateq_req_s updateq_req;
  143. u32 mboxmsg[BFI_IOC_MSGSZ];
  144. };
  145. /**
  146. * I2H Messages
  147. */
  148. union bfi_iocfc_i2h_msg_u {
  149. struct bfi_mhdr_s mh;
  150. struct bfi_iocfc_cfg_reply_s cfg_reply;
  151. struct bfi_iocfc_stats_rsp_s stats_get_rsp;
  152. struct bfi_iocfc_stats_rsp_s stats_clr_rsp;
  153. struct bfi_iocfc_updateq_rsp_s updateq_rsp;
  154. u32 mboxmsg[BFI_IOC_MSGSZ];
  155. };
  156. #pragma pack()
  157. #endif /* __BFI_IOCFC_H__ */