1*52fa7bf9SThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-only */ 2f844a0eaSJeff Kirsher /* 32732ba56SRasesh Mody * Linux network driver for QLogic BR-series Converged Network Adapter. 4f844a0eaSJeff Kirsher */ 5f844a0eaSJeff Kirsher /* 62732ba56SRasesh Mody * Copyright (c) 2005-2014 Brocade Communications Systems, Inc. 72732ba56SRasesh Mody * Copyright (c) 2014-2015 QLogic Corporation 8f844a0eaSJeff Kirsher * All rights reserved 92732ba56SRasesh Mody * www.qlogic.com 10f844a0eaSJeff Kirsher */ 11f844a0eaSJeff Kirsher #ifndef __BFI_CNA_H__ 12f844a0eaSJeff Kirsher #define __BFI_CNA_H__ 13f844a0eaSJeff Kirsher 14f844a0eaSJeff Kirsher #include "bfi.h" 15f844a0eaSJeff Kirsher #include "bfa_defs_cna.h" 16f844a0eaSJeff Kirsher 17f844a0eaSJeff Kirsher enum bfi_port_h2i { 18f844a0eaSJeff Kirsher BFI_PORT_H2I_ENABLE_REQ = (1), 19f844a0eaSJeff Kirsher BFI_PORT_H2I_DISABLE_REQ = (2), 20f844a0eaSJeff Kirsher BFI_PORT_H2I_GET_STATS_REQ = (3), 21f844a0eaSJeff Kirsher BFI_PORT_H2I_CLEAR_STATS_REQ = (4), 22f844a0eaSJeff Kirsher }; 23f844a0eaSJeff Kirsher 24f844a0eaSJeff Kirsher enum bfi_port_i2h { 25f844a0eaSJeff Kirsher BFI_PORT_I2H_ENABLE_RSP = BFA_I2HM(1), 26f844a0eaSJeff Kirsher BFI_PORT_I2H_DISABLE_RSP = BFA_I2HM(2), 27f844a0eaSJeff Kirsher BFI_PORT_I2H_GET_STATS_RSP = BFA_I2HM(3), 28f844a0eaSJeff Kirsher BFI_PORT_I2H_CLEAR_STATS_RSP = BFA_I2HM(4), 29f844a0eaSJeff Kirsher }; 30f844a0eaSJeff Kirsher 311aa8b471SBen Hutchings /* Generic REQ type */ 32f844a0eaSJeff Kirsher struct bfi_port_generic_req { 33f844a0eaSJeff Kirsher struct bfi_mhdr mh; /*!< msg header */ 34f844a0eaSJeff Kirsher u32 msgtag; /*!< msgtag for reply */ 35f844a0eaSJeff Kirsher u32 rsvd; 36e423c856SIvan Vecera } __packed; 37f844a0eaSJeff Kirsher 381aa8b471SBen Hutchings /* Generic RSP type */ 39f844a0eaSJeff Kirsher struct bfi_port_generic_rsp { 40f844a0eaSJeff Kirsher struct bfi_mhdr mh; /*!< common msg header */ 41f844a0eaSJeff Kirsher u8 status; /*!< port enable status */ 42f844a0eaSJeff Kirsher u8 rsvd[3]; 43f844a0eaSJeff Kirsher u32 msgtag; /*!< msgtag for reply */ 44e423c856SIvan Vecera } __packed; 45f844a0eaSJeff Kirsher 461aa8b471SBen Hutchings /* BFI_PORT_H2I_GET_STATS_REQ */ 47f844a0eaSJeff Kirsher struct bfi_port_get_stats_req { 48f844a0eaSJeff Kirsher struct bfi_mhdr mh; /*!< common msg header */ 49f844a0eaSJeff Kirsher union bfi_addr_u dma_addr; 50e423c856SIvan Vecera } __packed; 51f844a0eaSJeff Kirsher 52f844a0eaSJeff Kirsher union bfi_port_h2i_msg_u { 53f844a0eaSJeff Kirsher struct bfi_mhdr mh; 54f844a0eaSJeff Kirsher struct bfi_port_generic_req enable_req; 55f844a0eaSJeff Kirsher struct bfi_port_generic_req disable_req; 56f844a0eaSJeff Kirsher struct bfi_port_get_stats_req getstats_req; 57f844a0eaSJeff Kirsher struct bfi_port_generic_req clearstats_req; 58e423c856SIvan Vecera } __packed; 59f844a0eaSJeff Kirsher 60f844a0eaSJeff Kirsher union bfi_port_i2h_msg_u { 61f844a0eaSJeff Kirsher struct bfi_mhdr mh; 62f844a0eaSJeff Kirsher struct bfi_port_generic_rsp enable_rsp; 63f844a0eaSJeff Kirsher struct bfi_port_generic_rsp disable_rsp; 64f844a0eaSJeff Kirsher struct bfi_port_generic_rsp getstats_rsp; 65f844a0eaSJeff Kirsher struct bfi_port_generic_rsp clearstats_rsp; 66e423c856SIvan Vecera } __packed; 67f844a0eaSJeff Kirsher 68f844a0eaSJeff Kirsher /* @brief Mailbox commands from host to (DCBX/LLDP) firmware */ 69f844a0eaSJeff Kirsher enum bfi_cee_h2i_msgs { 70f844a0eaSJeff Kirsher BFI_CEE_H2I_GET_CFG_REQ = 1, 71f844a0eaSJeff Kirsher BFI_CEE_H2I_RESET_STATS = 2, 72f844a0eaSJeff Kirsher BFI_CEE_H2I_GET_STATS_REQ = 3, 73f844a0eaSJeff Kirsher }; 74f844a0eaSJeff Kirsher 75f844a0eaSJeff Kirsher /* @brief Mailbox reply and AEN messages from DCBX/LLDP firmware to host */ 76f844a0eaSJeff Kirsher enum bfi_cee_i2h_msgs { 77f844a0eaSJeff Kirsher BFI_CEE_I2H_GET_CFG_RSP = BFA_I2HM(1), 78f844a0eaSJeff Kirsher BFI_CEE_I2H_RESET_STATS_RSP = BFA_I2HM(2), 79f844a0eaSJeff Kirsher BFI_CEE_I2H_GET_STATS_RSP = BFA_I2HM(3), 80f844a0eaSJeff Kirsher }; 81f844a0eaSJeff Kirsher 82f844a0eaSJeff Kirsher /* Data structures */ 83f844a0eaSJeff Kirsher 84f844a0eaSJeff Kirsher /* 85f844a0eaSJeff Kirsher * @brief H2I command structure for resetting the stats. 86f844a0eaSJeff Kirsher * BFI_CEE_H2I_RESET_STATS 87f844a0eaSJeff Kirsher */ 88f844a0eaSJeff Kirsher struct bfi_lldp_reset_stats { 89f844a0eaSJeff Kirsher struct bfi_mhdr mh; 90e423c856SIvan Vecera } __packed; 91f844a0eaSJeff Kirsher 92f844a0eaSJeff Kirsher /* 93f844a0eaSJeff Kirsher * @brief H2I command structure for resetting the stats. 94f844a0eaSJeff Kirsher * BFI_CEE_H2I_RESET_STATS 95f844a0eaSJeff Kirsher */ 96f844a0eaSJeff Kirsher struct bfi_cee_reset_stats { 97f844a0eaSJeff Kirsher struct bfi_mhdr mh; 98e423c856SIvan Vecera } __packed; 99f844a0eaSJeff Kirsher 100f844a0eaSJeff Kirsher /* 101f844a0eaSJeff Kirsher * @brief get configuration command from host 102f844a0eaSJeff Kirsher * BFI_CEE_H2I_GET_CFG_REQ 103f844a0eaSJeff Kirsher */ 104f844a0eaSJeff Kirsher struct bfi_cee_get_req { 105f844a0eaSJeff Kirsher struct bfi_mhdr mh; 106f844a0eaSJeff Kirsher union bfi_addr_u dma_addr; 107e423c856SIvan Vecera } __packed; 108f844a0eaSJeff Kirsher 109f844a0eaSJeff Kirsher /* 110f844a0eaSJeff Kirsher * @brief reply message from firmware 111f844a0eaSJeff Kirsher * BFI_CEE_I2H_GET_CFG_RSP 112f844a0eaSJeff Kirsher */ 113f844a0eaSJeff Kirsher struct bfi_cee_get_rsp { 114f844a0eaSJeff Kirsher struct bfi_mhdr mh; 115f844a0eaSJeff Kirsher u8 cmd_status; 116f844a0eaSJeff Kirsher u8 rsvd[3]; 117e423c856SIvan Vecera } __packed; 118f844a0eaSJeff Kirsher 119f844a0eaSJeff Kirsher /* 120f844a0eaSJeff Kirsher * @brief get configuration command from host 121f844a0eaSJeff Kirsher * BFI_CEE_H2I_GET_STATS_REQ 122f844a0eaSJeff Kirsher */ 123f844a0eaSJeff Kirsher struct bfi_cee_stats_req { 124f844a0eaSJeff Kirsher struct bfi_mhdr mh; 125f844a0eaSJeff Kirsher union bfi_addr_u dma_addr; 126e423c856SIvan Vecera } __packed; 127f844a0eaSJeff Kirsher 128f844a0eaSJeff Kirsher /* 129f844a0eaSJeff Kirsher * @brief reply message from firmware 130f844a0eaSJeff Kirsher * BFI_CEE_I2H_GET_STATS_RSP 131f844a0eaSJeff Kirsher */ 132f844a0eaSJeff Kirsher struct bfi_cee_stats_rsp { 133f844a0eaSJeff Kirsher struct bfi_mhdr mh; 134f844a0eaSJeff Kirsher u8 cmd_status; 135f844a0eaSJeff Kirsher u8 rsvd[3]; 136e423c856SIvan Vecera } __packed; 137f844a0eaSJeff Kirsher 138f844a0eaSJeff Kirsher /* @brief mailbox command structures from host to firmware */ 139f844a0eaSJeff Kirsher union bfi_cee_h2i_msg_u { 140f844a0eaSJeff Kirsher struct bfi_mhdr mh; 141f844a0eaSJeff Kirsher struct bfi_cee_get_req get_req; 142f844a0eaSJeff Kirsher struct bfi_cee_stats_req stats_req; 143e423c856SIvan Vecera } __packed; 144f844a0eaSJeff Kirsher 145f844a0eaSJeff Kirsher /* @brief mailbox message structures from firmware to host */ 146f844a0eaSJeff Kirsher union bfi_cee_i2h_msg_u { 147f844a0eaSJeff Kirsher struct bfi_mhdr mh; 148f844a0eaSJeff Kirsher struct bfi_cee_get_rsp get_rsp; 149f844a0eaSJeff Kirsher struct bfi_cee_stats_rsp stats_rsp; 150e423c856SIvan Vecera } __packed; 151f844a0eaSJeff Kirsher 152f844a0eaSJeff Kirsher #endif /* __BFI_CNA_H__ */ 153