bfi_cna.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. /*
  2. * Linux network driver for Brocade Converged Network Adapter.
  3. *
  4. * This program is free software; you can redistribute it and/or modify it
  5. * under the terms of the GNU General Public License (GPL) Version 2 as
  6. * published by the Free Software Foundation
  7. *
  8. * This program is distributed in the hope that it will be useful, but
  9. * WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. * General Public License for more details.
  12. */
  13. /*
  14. * Copyright (c) 2005-2010 Brocade Communications Systems, Inc.
  15. * All rights reserved
  16. * www.brocade.com
  17. */
  18. #ifndef __BFI_CNA_H__
  19. #define __BFI_CNA_H__
  20. #include "bfi.h"
  21. #include "bfa_defs_cna.h"
  22. #pragma pack(1)
  23. enum bfi_port_h2i {
  24. BFI_PORT_H2I_ENABLE_REQ = (1),
  25. BFI_PORT_H2I_DISABLE_REQ = (2),
  26. BFI_PORT_H2I_GET_STATS_REQ = (3),
  27. BFI_PORT_H2I_CLEAR_STATS_REQ = (4),
  28. };
  29. enum bfi_port_i2h {
  30. BFI_PORT_I2H_ENABLE_RSP = BFA_I2HM(1),
  31. BFI_PORT_I2H_DISABLE_RSP = BFA_I2HM(2),
  32. BFI_PORT_I2H_GET_STATS_RSP = BFA_I2HM(3),
  33. BFI_PORT_I2H_CLEAR_STATS_RSP = BFA_I2HM(4),
  34. };
  35. /**
  36. * Generic REQ type
  37. */
  38. struct bfi_port_generic_req {
  39. struct bfi_mhdr mh; /*!< msg header */
  40. u32 msgtag; /*!< msgtag for reply */
  41. u32 rsvd;
  42. };
  43. /**
  44. * Generic RSP type
  45. */
  46. struct bfi_port_generic_rsp {
  47. struct bfi_mhdr mh; /*!< common msg header */
  48. u8 status; /*!< port enable status */
  49. u8 rsvd[3];
  50. u32 msgtag; /*!< msgtag for reply */
  51. };
  52. /**
  53. * @todo
  54. * BFI_PORT_H2I_ENABLE_REQ
  55. */
  56. /**
  57. * @todo
  58. * BFI_PORT_I2H_ENABLE_RSP
  59. */
  60. /**
  61. * BFI_PORT_H2I_DISABLE_REQ
  62. */
  63. /**
  64. * BFI_PORT_I2H_DISABLE_RSP
  65. */
  66. /**
  67. * BFI_PORT_H2I_GET_STATS_REQ
  68. */
  69. struct bfi_port_get_stats_req {
  70. struct bfi_mhdr mh; /*!< common msg header */
  71. union bfi_addr_u dma_addr;
  72. };
  73. /**
  74. * BFI_PORT_I2H_GET_STATS_RSP
  75. */
  76. /**
  77. * BFI_PORT_H2I_CLEAR_STATS_REQ
  78. */
  79. /**
  80. * BFI_PORT_I2H_CLEAR_STATS_RSP
  81. */
  82. union bfi_port_h2i_msg_u {
  83. struct bfi_mhdr mh;
  84. struct bfi_port_generic_req enable_req;
  85. struct bfi_port_generic_req disable_req;
  86. struct bfi_port_get_stats_req getstats_req;
  87. struct bfi_port_generic_req clearstats_req;
  88. };
  89. union bfi_port_i2h_msg_u {
  90. struct bfi_mhdr mh;
  91. struct bfi_port_generic_rsp enable_rsp;
  92. struct bfi_port_generic_rsp disable_rsp;
  93. struct bfi_port_generic_rsp getstats_rsp;
  94. struct bfi_port_generic_rsp clearstats_rsp;
  95. };
  96. /* @brief Mailbox commands from host to (DCBX/LLDP) firmware */
  97. enum bfi_cee_h2i_msgs {
  98. BFI_CEE_H2I_GET_CFG_REQ = 1,
  99. BFI_CEE_H2I_RESET_STATS = 2,
  100. BFI_CEE_H2I_GET_STATS_REQ = 3,
  101. };
  102. /* @brief Mailbox reply and AEN messages from DCBX/LLDP firmware to host */
  103. enum bfi_cee_i2h_msgs {
  104. BFI_CEE_I2H_GET_CFG_RSP = BFA_I2HM(1),
  105. BFI_CEE_I2H_RESET_STATS_RSP = BFA_I2HM(2),
  106. BFI_CEE_I2H_GET_STATS_RSP = BFA_I2HM(3),
  107. };
  108. /* Data structures */
  109. /*
  110. * @brief H2I command structure for resetting the stats.
  111. * BFI_CEE_H2I_RESET_STATS
  112. */
  113. struct bfi_lldp_reset_stats {
  114. struct bfi_mhdr mh;
  115. };
  116. /*
  117. * @brief H2I command structure for resetting the stats.
  118. * BFI_CEE_H2I_RESET_STATS
  119. */
  120. struct bfi_cee_reset_stats {
  121. struct bfi_mhdr mh;
  122. };
  123. /*
  124. * @brief get configuration command from host
  125. * BFI_CEE_H2I_GET_CFG_REQ
  126. */
  127. struct bfi_cee_get_req {
  128. struct bfi_mhdr mh;
  129. union bfi_addr_u dma_addr;
  130. };
  131. /*
  132. * @brief reply message from firmware
  133. * BFI_CEE_I2H_GET_CFG_RSP
  134. */
  135. struct bfi_cee_get_rsp {
  136. struct bfi_mhdr mh;
  137. u8 cmd_status;
  138. u8 rsvd[3];
  139. };
  140. /*
  141. * @brief get configuration command from host
  142. * BFI_CEE_H2I_GET_STATS_REQ
  143. */
  144. struct bfi_cee_stats_req {
  145. struct bfi_mhdr mh;
  146. union bfi_addr_u dma_addr;
  147. };
  148. /*
  149. * @brief reply message from firmware
  150. * BFI_CEE_I2H_GET_STATS_RSP
  151. */
  152. struct bfi_cee_stats_rsp {
  153. struct bfi_mhdr mh;
  154. u8 cmd_status;
  155. u8 rsvd[3];
  156. };
  157. /* @brief mailbox command structures from host to firmware */
  158. union bfi_cee_h2i_msg_u {
  159. struct bfi_mhdr mh;
  160. struct bfi_cee_get_req get_req;
  161. struct bfi_cee_stats_req stats_req;
  162. };
  163. /* @brief mailbox message structures from firmware to host */
  164. union bfi_cee_i2h_msg_u {
  165. struct bfi_mhdr mh;
  166. struct bfi_cee_get_rsp get_rsp;
  167. struct bfi_cee_stats_rsp stats_rsp;
  168. };
  169. #pragma pack()
  170. #endif /* __BFI_CNA_H__ */