bfa_defs_cee.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  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. #define BFA_CEE_LLDP_SYS_CAP_OTHER 0x0001
  28. #define BFA_CEE_LLDP_SYS_CAP_REPEATER 0x0002
  29. #define BFA_CEE_LLDP_SYS_CAP_MAC_BRIDGE 0x0004
  30. #define BFA_CEE_LLDP_SYS_CAP_WLAN_AP 0x0008
  31. #define BFA_CEE_LLDP_SYS_CAP_ROUTER 0x0010
  32. #define BFA_CEE_LLDP_SYS_CAP_TELEPHONE 0x0020
  33. #define BFA_CEE_LLDP_SYS_CAP_DOCSIS_CD 0x0040
  34. #define BFA_CEE_LLDP_SYS_CAP_STATION 0x0080
  35. #define BFA_CEE_LLDP_SYS_CAP_CVLAN 0x0100
  36. #define BFA_CEE_LLDP_SYS_CAP_SVLAN 0x0200
  37. #define BFA_CEE_LLDP_SYS_CAP_TPMR 0x0400
  38. /* LLDP string type */
  39. struct bfa_cee_lldp_str_s {
  40. u8 sub_type;
  41. u8 len;
  42. u8 rsvd[2];
  43. u8 value[BFA_CEE_LLDP_MAX_STRING_LEN];
  44. };
  45. /* LLDP parameters */
  46. struct bfa_cee_lldp_cfg_s {
  47. struct bfa_cee_lldp_str_s chassis_id;
  48. struct bfa_cee_lldp_str_s port_id;
  49. struct bfa_cee_lldp_str_s port_desc;
  50. struct bfa_cee_lldp_str_s sys_name;
  51. struct bfa_cee_lldp_str_s sys_desc;
  52. struct bfa_cee_lldp_str_s mgmt_addr;
  53. u16 time_to_interval;
  54. u16 enabled_system_cap;
  55. };
  56. enum bfa_cee_dcbx_version_e {
  57. DCBX_PROTOCOL_PRECEE = 1,
  58. DCBX_PROTOCOL_CEE = 2,
  59. };
  60. enum bfa_cee_lls_e {
  61. CEE_LLS_DOWN_NO_TLV = 0, /* LLS is down because the TLV not sent by
  62. * the peer */
  63. CEE_LLS_DOWN = 1, /* LLS is down as advertised by the peer */
  64. CEE_LLS_UP = 2,
  65. };
  66. /* CEE/DCBX parameters */
  67. struct bfa_cee_dcbx_cfg_s {
  68. u8 pgid[8];
  69. u8 pg_percentage[8];
  70. u8 pfc_enabled; /* bitmap of priorties with PFC enabled */
  71. u8 fcoe_user_priority; /* bitmap of priorities used for FcoE
  72. * traffic */
  73. u8 dcbx_version; /* operating version:CEE or preCEE */
  74. u8 lls_fcoe; /* FCoE Logical Link Status */
  75. u8 lls_lan; /* LAN Logical Link Status */
  76. u8 rsvd[3];
  77. };
  78. /* CEE status */
  79. /* Making this to tri-state for the benefit of port list command */
  80. enum bfa_cee_status_e {
  81. CEE_UP = 0,
  82. CEE_PHY_UP = 1,
  83. CEE_LOOPBACK = 2,
  84. CEE_PHY_DOWN = 3,
  85. };
  86. /* CEE Query */
  87. struct bfa_cee_attr_s {
  88. u8 cee_status;
  89. u8 error_reason;
  90. struct bfa_cee_lldp_cfg_s lldp_remote;
  91. struct bfa_cee_dcbx_cfg_s dcbx_remote;
  92. mac_t src_mac;
  93. u8 link_speed;
  94. u8 nw_priority;
  95. u8 filler[2];
  96. };
  97. /* LLDP/DCBX/CEE Statistics */
  98. struct bfa_cee_lldp_stats_s {
  99. u32 frames_transmitted;
  100. u32 frames_aged_out;
  101. u32 frames_discarded;
  102. u32 frames_in_error;
  103. u32 frames_rcvd;
  104. u32 tlvs_discarded;
  105. u32 tlvs_unrecognized;
  106. };
  107. struct bfa_cee_dcbx_stats_s {
  108. u32 subtlvs_unrecognized;
  109. u32 negotiation_failed;
  110. u32 remote_cfg_changed;
  111. u32 tlvs_received;
  112. u32 tlvs_invalid;
  113. u32 seqno;
  114. u32 ackno;
  115. u32 recvd_seqno;
  116. u32 recvd_ackno;
  117. };
  118. struct bfa_cee_cfg_stats_s {
  119. u32 cee_status_down;
  120. u32 cee_status_up;
  121. u32 cee_hw_cfg_changed;
  122. u32 recvd_invalid_cfg;
  123. };
  124. struct bfa_cee_stats_s {
  125. struct bfa_cee_lldp_stats_s lldp_stats;
  126. struct bfa_cee_dcbx_stats_s dcbx_stats;
  127. struct bfa_cee_cfg_stats_s cfg_stats;
  128. };
  129. #pragma pack()
  130. #endif /* __BFA_DEFS_CEE_H__ */