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