bfa_defs_cee.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. /*
  2. * Copyright (c) 2005-2009 Brocade Communications Systems, Inc.
  3. * All rights reserved
  4. * www.brocade.com
  5. *
  6. * bfa_defs_cee.h Interface declarations between host based
  7. * BFAL and DCBX/LLDP module in Firmware
  8. *
  9. * Linux driver for Brocade Fibre Channel Host Bus Adapter.
  10. *
  11. * This program is free software; you can redistribute it and/or modify it
  12. * under the terms of the GNU General Public License (GPL) Version 2 as
  13. * published by the Free Software Foundation
  14. *
  15. * This program is distributed in the hope that it will be useful, but
  16. * WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  18. * General Public License for more details.
  19. */
  20. #ifndef __BFA_DEFS_CEE_H__
  21. #define __BFA_DEFS_CEE_H__
  22. #include <defs/bfa_defs_types.h>
  23. #include <defs/bfa_defs_pport.h>
  24. #include <protocol/types.h>
  25. #pragma pack(1)
  26. #define BFA_CEE_LLDP_MAX_STRING_LEN (128)
  27. /* FIXME: this is coming from the protocol spec. Can the host & apps share the
  28. protocol .h files ?
  29. */
  30. #define BFA_CEE_LLDP_SYS_CAP_OTHER 0x0001
  31. #define BFA_CEE_LLDP_SYS_CAP_REPEATER 0x0002
  32. #define BFA_CEE_LLDP_SYS_CAP_MAC_BRIDGE 0x0004
  33. #define BFA_CEE_LLDP_SYS_CAP_WLAN_AP 0x0008
  34. #define BFA_CEE_LLDP_SYS_CAP_ROUTER 0x0010
  35. #define BFA_CEE_LLDP_SYS_CAP_TELEPHONE 0x0020
  36. #define BFA_CEE_LLDP_SYS_CAP_DOCSIS_CD 0x0040
  37. #define BFA_CEE_LLDP_SYS_CAP_STATION 0x0080
  38. #define BFA_CEE_LLDP_SYS_CAP_CVLAN 0x0100
  39. #define BFA_CEE_LLDP_SYS_CAP_SVLAN 0x0200
  40. #define BFA_CEE_LLDP_SYS_CAP_TPMR 0x0400
  41. /* LLDP string type */
  42. struct bfa_cee_lldp_str_s {
  43. u8 sub_type;
  44. u8 len;
  45. u8 rsvd[2];
  46. u8 value[BFA_CEE_LLDP_MAX_STRING_LEN];
  47. };
  48. /* LLDP paramters */
  49. struct bfa_cee_lldp_cfg_s {
  50. struct bfa_cee_lldp_str_s chassis_id;
  51. struct bfa_cee_lldp_str_s port_id;
  52. struct bfa_cee_lldp_str_s port_desc;
  53. struct bfa_cee_lldp_str_s sys_name;
  54. struct bfa_cee_lldp_str_s sys_desc;
  55. struct bfa_cee_lldp_str_s mgmt_addr;
  56. u16 time_to_interval;
  57. u16 enabled_system_cap;
  58. };
  59. enum bfa_cee_dcbx_version_e {
  60. DCBX_PROTOCOL_PRECEE = 1,
  61. DCBX_PROTOCOL_CEE = 2,
  62. };
  63. enum bfa_cee_lls_e {
  64. CEE_LLS_DOWN_NO_TLV = 0, /* LLS is down because the TLV not sent by
  65. * the peer */
  66. CEE_LLS_DOWN = 1, /* LLS is down as advertised by the peer */
  67. CEE_LLS_UP = 2,
  68. };
  69. /* CEE/DCBX parameters */
  70. struct bfa_cee_dcbx_cfg_s {
  71. u8 pgid[8];
  72. u8 pg_percentage[8];
  73. u8 pfc_enabled; /* bitmap of priorties with PFC enabled */
  74. u8 fcoe_user_priority; /* bitmap of priorities used for FcoE
  75. * traffic */
  76. u8 dcbx_version; /* operating version:CEE or preCEE */
  77. u8 lls_fcoe; /* FCoE Logical Link Status */
  78. u8 lls_lan; /* LAN Logical Link Status */
  79. u8 rsvd[3];
  80. };
  81. /* CEE status */
  82. /* Making this to tri-state for the benefit of port list command */
  83. enum bfa_cee_status_e {
  84. CEE_PHY_DOWN = 0,
  85. CEE_PHY_UP = 1,
  86. CEE_UP = 2,
  87. };
  88. /* CEE Query */
  89. struct bfa_cee_attr_s {
  90. u8 cee_status;
  91. u8 error_reason;
  92. struct bfa_cee_lldp_cfg_s lldp_remote;
  93. struct bfa_cee_dcbx_cfg_s dcbx_remote;
  94. mac_t src_mac;
  95. u8 link_speed;
  96. u8 filler[3];
  97. };
  98. /* LLDP/DCBX/CEE Statistics */
  99. struct bfa_cee_lldp_stats_s {
  100. u32 frames_transmitted;
  101. u32 frames_aged_out;
  102. u32 frames_discarded;
  103. u32 frames_in_error;
  104. u32 frames_rcvd;
  105. u32 tlvs_discarded;
  106. u32 tlvs_unrecognized;
  107. };
  108. struct bfa_cee_dcbx_stats_s {
  109. u32 subtlvs_unrecognized;
  110. u32 negotiation_failed;
  111. u32 remote_cfg_changed;
  112. u32 tlvs_received;
  113. u32 tlvs_invalid;
  114. u32 seqno;
  115. u32 ackno;
  116. u32 recvd_seqno;
  117. u32 recvd_ackno;
  118. };
  119. struct bfa_cee_cfg_stats_s {
  120. u32 cee_status_down;
  121. u32 cee_status_up;
  122. u32 cee_hw_cfg_changed;
  123. u32 recvd_invalid_cfg;
  124. };
  125. struct bfa_cee_stats_s {
  126. struct bfa_cee_lldp_stats_s lldp_stats;
  127. struct bfa_cee_dcbx_stats_s dcbx_stats;
  128. struct bfa_cee_cfg_stats_s cfg_stats;
  129. };
  130. #pragma pack()
  131. #endif /* __BFA_DEFS_CEE_H__ */