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