bfi_cna.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  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. /* Generic REQ type */
  36. struct bfi_port_generic_req {
  37. struct bfi_mhdr mh; /*!< msg header */
  38. u32 msgtag; /*!< msgtag for reply */
  39. u32 rsvd;
  40. };
  41. /* Generic RSP type */
  42. struct bfi_port_generic_rsp {
  43. struct bfi_mhdr mh; /*!< common msg header */
  44. u8 status; /*!< port enable status */
  45. u8 rsvd[3];
  46. u32 msgtag; /*!< msgtag for reply */
  47. };
  48. /* BFI_PORT_H2I_GET_STATS_REQ */
  49. struct bfi_port_get_stats_req {
  50. struct bfi_mhdr mh; /*!< common msg header */
  51. union bfi_addr_u dma_addr;
  52. };
  53. union bfi_port_h2i_msg_u {
  54. struct bfi_mhdr mh;
  55. struct bfi_port_generic_req enable_req;
  56. struct bfi_port_generic_req disable_req;
  57. struct bfi_port_get_stats_req getstats_req;
  58. struct bfi_port_generic_req clearstats_req;
  59. };
  60. union bfi_port_i2h_msg_u {
  61. struct bfi_mhdr mh;
  62. struct bfi_port_generic_rsp enable_rsp;
  63. struct bfi_port_generic_rsp disable_rsp;
  64. struct bfi_port_generic_rsp getstats_rsp;
  65. struct bfi_port_generic_rsp clearstats_rsp;
  66. };
  67. /* @brief Mailbox commands from host to (DCBX/LLDP) firmware */
  68. enum bfi_cee_h2i_msgs {
  69. BFI_CEE_H2I_GET_CFG_REQ = 1,
  70. BFI_CEE_H2I_RESET_STATS = 2,
  71. BFI_CEE_H2I_GET_STATS_REQ = 3,
  72. };
  73. /* @brief Mailbox reply and AEN messages from DCBX/LLDP firmware to host */
  74. enum bfi_cee_i2h_msgs {
  75. BFI_CEE_I2H_GET_CFG_RSP = BFA_I2HM(1),
  76. BFI_CEE_I2H_RESET_STATS_RSP = BFA_I2HM(2),
  77. BFI_CEE_I2H_GET_STATS_RSP = BFA_I2HM(3),
  78. };
  79. /* Data structures */
  80. /*
  81. * @brief H2I command structure for resetting the stats.
  82. * BFI_CEE_H2I_RESET_STATS
  83. */
  84. struct bfi_lldp_reset_stats {
  85. struct bfi_mhdr mh;
  86. };
  87. /*
  88. * @brief H2I command structure for resetting the stats.
  89. * BFI_CEE_H2I_RESET_STATS
  90. */
  91. struct bfi_cee_reset_stats {
  92. struct bfi_mhdr mh;
  93. };
  94. /*
  95. * @brief get configuration command from host
  96. * BFI_CEE_H2I_GET_CFG_REQ
  97. */
  98. struct bfi_cee_get_req {
  99. struct bfi_mhdr mh;
  100. union bfi_addr_u dma_addr;
  101. };
  102. /*
  103. * @brief reply message from firmware
  104. * BFI_CEE_I2H_GET_CFG_RSP
  105. */
  106. struct bfi_cee_get_rsp {
  107. struct bfi_mhdr mh;
  108. u8 cmd_status;
  109. u8 rsvd[3];
  110. };
  111. /*
  112. * @brief get configuration command from host
  113. * BFI_CEE_H2I_GET_STATS_REQ
  114. */
  115. struct bfi_cee_stats_req {
  116. struct bfi_mhdr mh;
  117. union bfi_addr_u dma_addr;
  118. };
  119. /*
  120. * @brief reply message from firmware
  121. * BFI_CEE_I2H_GET_STATS_RSP
  122. */
  123. struct bfi_cee_stats_rsp {
  124. struct bfi_mhdr mh;
  125. u8 cmd_status;
  126. u8 rsvd[3];
  127. };
  128. /* @brief mailbox command structures from host to firmware */
  129. union bfi_cee_h2i_msg_u {
  130. struct bfi_mhdr mh;
  131. struct bfi_cee_get_req get_req;
  132. struct bfi_cee_stats_req stats_req;
  133. };
  134. /* @brief mailbox message structures from firmware to host */
  135. union bfi_cee_i2h_msg_u {
  136. struct bfi_mhdr mh;
  137. struct bfi_cee_get_rsp get_rsp;
  138. struct bfi_cee_stats_rsp stats_rsp;
  139. };
  140. #pragma pack()
  141. #endif /* __BFI_CNA_H__ */