components/open-fabrics/libsif/include/psifapi/psif_hw_data.h
changeset 7120 b01185225eaa
parent 5564 e533d5840fdd
equal deleted inserted replaced
7119:2f82d964b8be 7120:b01185225eaa
     1 /*
     1 /*
     2  * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
     3  */
     3  */
     4 
     4 
     5 /*
     5 /*
     6  * Redistribution and use in source and binary forms, with or without modification,
     6  * Redistribution and use in source and binary forms, with or without
     7  * are permitted provided that the following conditions are met:
     7  *  modification, are permitted provided that the following conditions are met:
     8  *
     8  *
     9  * 1. Redistributions of source code must retain the above copyright notice,
     9  * 1. Redistributions of source code must retain the above copyright notice,
    10  *    this list of conditions and the following disclaimer.
    10  *    this list of conditions and the following disclaimer.
    11  *
    11  *
    12  * 2. Redistributions in binary form must reproduce the above copyright notice,
    12  * 2. Redistributions in binary form must reproduce the above copyright notice,
    13  *    this list of conditions and the following disclaimer in the documentation
    13  *    this list of conditions and the following disclaimer in the documentation
    14  *    and/or other materials provided with the distribution.
    14  *    and/or other materials provided with the distribution.
    15  *
    15  *
    16  * 3. Neither the name of the copyright holder nor the names of its contributors
    16  * 3. Neither the name of the copyright holder nor the names of its contributors
    17  *    may be used to endorse or promote products derived from this software without
    17  *    may be used to endorse or promote products derived from this software
    18  *    specific prior written permission.
    18  *    without specific prior written permission.
    19  *
    19  *
    20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
    20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
    21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
    21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    22  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
    22  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
    23  * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
    23  * ARE DISCLAIMED.
    24  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
    24  * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
    25  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    25  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
    26  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
    26  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
    27  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
    27  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    28  * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
    28  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    29  * OF THE POSSIBILITY OF SUCH DAMAGE.
    29  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
       
    30  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    30  */
    31  */
    31 
    32 
    32 #ifndef	_PSIF_HW_DATA_H
    33 #ifndef	_PSIF_HW_DATA_H
    33 #define	_PSIF_HW_DATA_H
    34 #define	_PSIF_HW_DATA_H
    34 
    35 
    45 #include "os_header.h"
    46 #include "os_header.h"
    46 #endif
    47 #endif
    47 
    48 
    48 /* Extent of all psif enums */
    49 /* Extent of all psif enums */
    49 enum psif_enum_extent {
    50 enum psif_enum_extent {
    50 	PSIF_MMU_TRANSLATION_EXTENT	 = 0x8,
    51 	PSIF_PORT_SPEED_EXTENT	 = 0x21u,
    51 	PSIF_PAGE_SIZE_EXTENT	 = 0xf,
    52 	PSIF_EPSC_DEGRADE_CAUSE_EXTENT	 = 0x7u,
    52 	PSIF_WR_TYPE_EXTENT	 = 0x8f,
    53 	PSIF_MMU_TRANSLATION_EXTENT	 = 0x8u,
    53 	PSIF_PORT_EXTENT	 = 0x2,
    54 	PSIF_PAGE_SIZE_EXTENT	 = 0xfu,
    54 	PSIF_USE_AH_EXTENT	 = 0x2,
    55 	PSIF_WR_TYPE_EXTENT	 = 0x8fu,
    55 	PSIF_TSU_QOS_EXTENT	 = 0x2,
    56 	PSIF_PORT_EXTENT	 = 0x2u,
    56 	PSIF_WC_OPCODE_EXTENT	 = 0x83,
    57 	PSIF_USE_AH_EXTENT	 = 0x2u,
    57 	PSIF_WC_STATUS_EXTENT	 = 0x16,
    58 	PSIF_TSU_QOS_EXTENT	 = 0x2u,
    58 	PSIF_TSL_QP_WR_EXTENT	 = 0x10,
    59 	PSIF_WC_OPCODE_EXTENT	 = 0x83u,
    59 	PSIF_TABLE_LEVEL_EXTENT	 = 0x6,
    60 	PSIF_WC_STATUS_EXTENT	 = 0x16u,
    60 	IB_OPCODE_EXTENT	 = 0xca,
    61 	PSIF_TSL_QP_WR_EXTENT	 = 0x10u,
    61 	PSIF_RB_TYPE_EXTENT	 = 0x7,
    62 	PSIF_TABLE_LEVEL_EXTENT	 = 0x6u,
    62 	PSIF_EPS_A_CORE_EXTENT	 = 0x4,
    63 	IB_OPCODE_EXTENT	 = 0xcau,
    63 	PSIF_QP_STATE_EXTENT	 = 0x8,
    64 	PSIF_RB_TYPE_EXTENT	 = 0x7u,
    64 	PSIF_CMPL_OUTSTANDING_ERROR_EXTENT	 = 0xa,
    65 	PSIF_EPS_A_CORE_EXTENT	 = 0x4u,
    65 	PSIF_EXPECTED_OP_EXTENT	 = 0x4,
    66 	PSIF_QP_STATE_EXTENT	 = 0x8u,
    66 	PSIF_MIGRATION_EXTENT	 = 0x4,
    67 	PSIF_CMPL_OUTSTANDING_ERROR_EXTENT	 = 0xau,
    67 	PSIF_QP_TRANS_EXTENT	 = 0x8,
    68 	PSIF_EXPECTED_OP_EXTENT	 = 0x4u,
    68 	PSIF_BOOL_EXTENT	 = 0x2,
    69 	PSIF_MIGRATION_EXTENT	 = 0x4u,
    69 	PSIF_EOIB_TYPE_EXTENT	 = 0x4,
    70 	PSIF_QP_TRANS_EXTENT	 = 0x8u,
    70 	PSIF_COMM_LIVE_EXTENT	 = 0x2,
    71 	PSIF_BOOL_EXTENT	 = 0x2u,
    71 	PSIF_PATH_MTU_EXTENT	 = 0x8,
    72 	PSIF_EOIB_TYPE_EXTENT	 = 0x4u,
    72 	PSIF_USE_GRH_EXTENT	 = 0x2,
    73 	PSIF_COMM_LIVE_EXTENT	 = 0x2u,
    73 	PSIF_LOOPBACK_EXTENT	 = 0x2,
    74 	PSIF_PATH_MTU_EXTENT	 = 0x8u,
    74 	PSIF_PORT_SPEED_EXTENT	 = 0x21,
    75 	PSIF_USE_GRH_EXTENT	 = 0x2u,
    75 	PSIF_PCIE_WR_OFFS_EXTENT	 = 0x1000,
    76 	PSIF_LOOPBACK_EXTENT	 = 0x2u,
    76 	PSIF_QP_COMMAND_EXTENT	 = 0x4,
    77 	PSIF_PCIE_WR_OFFS_EXTENT	 = 0x1000u,
    77 	PSIF_SIBS_MBOX_TYPE_EXTENT	 = 0x2,
    78 	PSIF_QP_COMMAND_EXTENT	 = 0x4u,
    78 	PSIF_MBOX_TYPE_EXTENT	 = 0x6,
    79 	PSIF_SIBS_MBOX_TYPE_EXTENT	 = 0x2u,
    79 	PSIF_DMA_VT_KEY_STATES_EXTENT	 = 0x4,
    80 	PSIF_MBOX_TYPE_EXTENT	 = 0x6u,
    80 	PSIF_FLASH_IMAGE_TYPE_EXTENT	 = 0x5,
    81 	PSIF_DMA_VT_KEY_STATES_EXTENT	 = 0x4u,
    81 	PSIF_EVENT_EXTENT	 = 0x11,
    82 	PSIF_FLASH_IMAGE_TYPE_EXTENT	 = 0x5u,
    82 	PSIF_TSU_ERROR_TYPES_EXTENT	 = 0x8c,
    83 	PSIF_EVENT_EXTENT	 = 0x13u,
    83 	PSIF_EPS_CORE_ID_EXTENT	 = 0x5,
    84 	PSIF_TSU_ERROR_TYPES_EXTENT	 = 0x8cu,
    84 	PSIF_EPSC_LOG_MODE_EXTENT	 = 0x11,
    85 	PSIF_EPS_CORE_ID_EXTENT	 = 0x5u,
    85 	PSIF_EPSC_LOG_LEVEL_EXTENT	 = 0x8,
    86 	PSIF_EPSC_QUERY_PERSISTENT_EXTENT	 = 0x3u,
    86 	PSIF_EPSC_PORT_STATE_EXTENT	 = 0x6,
    87 	PSIF_EPSC_QUERY_NUM_VFS_MODE_EXTENT	 = 0x3u,
    87 	PSIF_EPSC_PATH_MTU_EXTENT	 = 0x8,
    88 	PSIF_EPSC_PORT_STATE_EXTENT	 = 0x6u,
    88 	PSIF_EPSC_MONITOR_EXTENT	 = 0x5,
    89 	PSIF_EPSC_PATH_MTU_EXTENT	 = 0x8u,
    89 	PSIF_EPSC_INTERRUPT_SOURCE_EXTENT	 = 0x15,
    90 	PSIF_EPSC_MONITOR_EXTENT	 = 0x5u,
    90 	PSIF_EPSC_INTERRUPT_PRI_EXTENT	 = 0x4,
    91 	PSIF_EPSC_LOG_MODE_EXTENT	 = 0x11u,
    91 	PSIF_EPSC_ATOMIC_CAP_EXTENT	 = 0x3,
    92 	PSIF_EPSC_LOG_LEVEL_EXTENT	 = 0x8u,
    92 	PSIF_EPSC_CSR_STATUS_EXTENT	 = 0x100,
    93 	PSIF_EPSC_INTERRUPT_SOURCE_EXTENT	 = 0x15u,
    93 	PSIF_EPSC_CSR_OPCODE_EXTENT	 = 0x4f,
    94 	PSIF_EPSC_INTERRUPT_PRI_EXTENT	 = 0x4u,
    94 	PSIF_EPSC_CSR_FLAGS_EXTENT	 = 0x5,
    95 	PSIF_EPSC_ATOMIC_CAP_EXTENT	 = 0x3u,
    95 	PSIF_VLINK_STATE_EXTENT	 = 0x11,
    96 	PSIF_EPSC_CSR_STATUS_EXTENT	 = 0x100u,
    96 	PSIF_EPSC_CSR_MODIFY_DEVICE_FLAGS_EXTENT	 = 0x3,
    97 	PSIF_EPSC_CSR_OPCODE_EXTENT	 = 0x50u,
    97 	PSIF_EPSC_CSR_MODIFY_PORT_FLAGS_EXTENT	 = 0x11,
    98 	PSIF_EPSC_CSR_FLAGS_EXTENT	 = 0x5u,
    98 	PSIF_EPSC_CSR_EPSA_COMMAND_EXTENT	 = 0x4,
    99 	PSIF_VLINK_STATE_EXTENT	 = 0x11u,
    99 	PSIF_EPSA_COMMAND_EXTENT	 = 0xb,
   100 	PSIF_EPSC_CSR_MODIFY_DEVICE_FLAGS_EXTENT	 = 0x3u,
   100 	PSIF_EPSC_QUERY_OP_EXTENT	 = 0x4b,
   101 	PSIF_EPSC_CSR_MODIFY_PORT_FLAGS_EXTENT	 = 0x11u,
   101 	PSIF_EPSC_CSR_UPDATE_OPCODE_EXTENT	 = 0x8,
   102 	PSIF_EPSC_CSR_EPSA_COMMAND_EXTENT	 = 0x4u,
   102 	PSIF_EPSC_FLASH_SLOT_EXTENT	 = 0x6,
   103 	PSIF_EPSA_COMMAND_EXTENT	 = 0xcu,
   103 	PSIF_EPSC_UPDATE_SET_EXTENT	 = 0x5,
   104 	PSIF_EPSC_QUERY_OP_EXTENT	 = 0x55u,
   104 	PSIF_EPSC_CSR_UF_CTRL_OPCODE_EXTENT	 = 0x9,
   105 	PSIF_EPSC_CSR_UPDATE_OPCODE_EXTENT	 = 0x8u,
   105 	PSIF_EPSC_VIMMA_CTRL_OPCODE_EXTENT	 = 0x8,
   106 	PSIF_EPSC_FLASH_SLOT_EXTENT	 = 0x6u,
   106 	PSIF_EPSC_VIMMA_ADMMODE_EXTENT	 = 0x2,
   107 	PSIF_EPSC_UPDATE_SET_EXTENT	 = 0x5u,
   107 	PSIF_EPSC_CSR_PMA_COUNTERS_ENUM_EXTENT	 = 0x17,
   108 	PSIF_EPSC_CSR_UF_CTRL_OPCODE_EXTENT	 = 0x9u,
   108 	PSIF_EPSC_CSR_ATOMIC_OP_EXTENT	 = 0x4,
   109 	PSIF_EPSC_VIMMA_CTRL_OPCODE_EXTENT	 = 0x8u,
   109 	PSIF_CQ_STATE_EXTENT	 = 0x4,
   110 	PSIF_EPSC_VIMMA_ADMMODE_EXTENT	 = 0x2u,
   110 	PSIF_RSS_HASH_SOURCE_EXTENT	 = 0x2
   111 	PSIF_EPSC_CSR_PMA_COUNTERS_ENUM_EXTENT	 = 0x17u,
       
   112 	PSIF_EPSC_CSR_ATOMIC_OP_EXTENT	 = 0x4u,
       
   113 	PSIF_EPSC_CSR_BER_COUNTERS_ENUM_EXTENT	 = 0x5u,
       
   114 	PSIF_CQ_STATE_EXTENT	 = 0x4u,
       
   115 	PSIF_RSS_HASH_SOURCE_EXTENT	 = 0x2u
   111 }; /* enum psif_enum_extent [16 bits] */
   116 }; /* enum psif_enum_extent [16 bits] */
       
   117 
       
   118 /*
       
   119  * Should match definitions in ib_verbs.h
       
   120  */
       
   121 enum psif_port_speed {
       
   122 	PSIF_SPEED_SDR	 = 0x1u,
       
   123 	PSIF_SPEED_DDR	 = 0x2u,
       
   124 	PSIF_SPEED_QDR	 = 0x4u,
       
   125 	PSIF_SPEED_FDR10	 = 0x8u,
       
   126 	PSIF_SPEED_FDR	 = 0x10u,
       
   127 	PSIF_SPEED_EDR	 = 0x20u,
       
   128 	/* Padding out to required bits allocated */
       
   129 	PSIF_PORT_SPEED_FIELD_MAX	 = 0xffu
       
   130 }; /* enum psif_port_speed [ 8 bits] */
       
   131 
       
   132 /** Bits describing the cause(s) for EPSC to have entered degraded mode
       
   133  * \par Used in
       
   134  *      response to `EPSC_QUERY_DEGRADED_MODE` and `psif_eq_entry::event_data`
       
   135  * \par Classification
       
   136  *      driver
       
   137  */
       
   138 enum psif_epsc_degrade_cause {
       
   139 /**< degrade cause: no GUID programmed or not readable */
       
   140 
       
   141 	DEGRADE_CAUSE_FLAG_MISSING_GUID,
       
   142 /**< degrade cause: invalid function name in VPD */
       
   143 
       
   144 	DEGRADE_CAUSE_FLAG_VPD_INVALID_NAME,
       
   145 /**< degrade cause: HW not supported by FW */
       
   146 
       
   147 	DEGRADE_CAUSE_FLAG_HW_UNSUPPORTED,
       
   148 /**< degrade cause: failed MDIO access */
       
   149 
       
   150 	DEGRADE_CAUSE_FLAG_HW_MDIO_ERROR,
       
   151 /**< degrade cause: modify QP timeout */
       
   152 
       
   153 	DEGRADE_CAUSE_FLAG_MODIFY_QP_TIMEOUT,
       
   154 /**< degrade cause: Virtualization mode reconfigured, reset needed */
       
   155 
       
   156 	DEGRADE_CAUSE_FLAG_VIRTMODE_RECONF,
       
   157 /**< degrade cause: no credits for sending multicast packets */
       
   158 
       
   159 	DEGRADE_CAUSE_FLAG_MCAST_LACK_OF_CREDIT,
       
   160 	/* Padding out to required bits allocated */
       
   161 	PSIF_EPSC_DEGRADE_CAUSE_FIELD_MAX	 = 0x1fu
       
   162 }; /* enum psif_epsc_degrade_cause [ 5 bits] */
   112 
   163 
   113 /* MMU operation modes. */
   164 /* MMU operation modes. */
   114 enum psif_mmu_translation {
   165 enum psif_mmu_translation {
   115 	MMU_PASS_THROUGH0,
   166 	MMU_PASS_THROUGH0	 = 0u,
   116 	MMU_PASS_THROUGH_PAD,
   167 	MMU_PASS_THROUGH_PAD,
   117 	MMU_GVA2GPA_MODE,
   168 	MMU_GVA2GPA_MODE,
   118 	MMU_GVA2GPA_MODE_PAD,
   169 	MMU_GVA2GPA_MODE_PAD,
   119 	MMU_PRETRANSLATED,
   170 	MMU_PRETRANSLATED,
   120 	MMU_PRETRANSLATED_PAD,
   171 	MMU_PRETRANSLATED_PAD,
   125 /*
   176 /*
   126  * Enumeration for the different supported page sizes. XXX: Define the page
   177  * Enumeration for the different supported page sizes. XXX: Define the page
   127  * sizes
   178  * sizes
   128  */
   179  */
   129 enum psif_page_size {
   180 enum psif_page_size {
   130 	PAGE_SIZE_IA32E_4KB	 = 0,
   181 	PAGE_SIZE_IA32E_4KB	 = 0u,
   131 	PAGE_SIZE_IA32E_2MB	 = 0x1,
   182 	PAGE_SIZE_IA32E_2MB	 = 0x1u,
   132 	PAGE_SIZE_IA32E_1GB	 = 0x2,
   183 	PAGE_SIZE_IA32E_1GB	 = 0x2u,
   133 	PAGE_SIZE_S64_8KB	 = 0x8,
   184 	PAGE_SIZE_S64_8KB	 = 0x8u,
   134 	PAGE_SIZE_S64_64KB	 = 0x9,
   185 	PAGE_SIZE_S64_64KB	 = 0x9u,
   135 	PAGE_SIZE_S64_512KB	 = 0xa,
   186 	PAGE_SIZE_S64_512KB	 = 0xau,
   136 	PAGE_SIZE_S64_4MB	 = 0xb,
   187 	PAGE_SIZE_S64_4MB	 = 0xbu,
   137 	PAGE_SIZE_S64_32MB	 = 0xc,
   188 	PAGE_SIZE_S64_32MB	 = 0xcu,
   138 	PAGE_SIZE_S64_2GB	 = 0xd,
   189 	PAGE_SIZE_S64_2GB	 = 0xdu,
   139 	PAGE_SIZE_S64_16GB	 = 0xe
   190 	PAGE_SIZE_S64_16GB	 = 0xeu
   140 }; /* enum psif_page_size [ 4 bits] */
   191 }; /* enum psif_page_size [ 4 bits] */
   141 
   192 
   142 /*
   193 /*
   143  * These are the different work request opcodes supported by PSIF.
   194  * These are the different work request opcodes supported by PSIF.
   144  * PSIF_WR_ENTER_SQ_MODE and PSIF_WR_CANCEL_CMD are special opcodes only used
   195  * PSIF_WR_ENTER_SQ_MODE and PSIF_WR_CANCEL_CMD are special opcodes only used
   145  * when writing to a special offset of the VCBs. RQS must check that the
   196  * when writing to a special offset of the VCBs. RQS must check that the
   146  * PSIF_WR_SEND_EPS and PSIF_WR_SEND_EPS_DR really comes from the EPS. CBU
   197  * PSIF_WR_SEND_EPS and PSIF_WR_SEND_EPS_DR really comes from the EPS. CBU
   147  * must report the source of a WR to RQS.
   198  * must report the source of a WR to RQS.
   148  */
   199  */
   149 enum psif_wr_type {
   200 enum psif_wr_type {
   150 	PSIF_WR_SEND,
   201 	PSIF_WR_SEND	 = 0u,
   151 	PSIF_WR_SEND_IMM,
   202 	PSIF_WR_SEND_IMM,
   152 	PSIF_WR_SPECIAL_QP_SEND,
   203 	PSIF_WR_SPECIAL_QP_SEND,
   153 	PSIF_WR_QP0_SEND_DR_XMIT,
   204 	PSIF_WR_QP0_SEND_DR_XMIT,
   154 	PSIF_WR_QP0_SEND_DR_LOOPBACK,
   205 	PSIF_WR_QP0_SEND_DR_LOOPBACK,
   155 	PSIF_WR_EPS_SPECIAL_QP_SEND,
   206 	PSIF_WR_EPS_SPECIAL_QP_SEND,
   161 	PSIF_WR_CMP_SWAP,
   212 	PSIF_WR_CMP_SWAP,
   162 	PSIF_WR_FETCH_ADD,
   213 	PSIF_WR_FETCH_ADD,
   163 	PSIF_WR_MASK_CMP_SWAP,
   214 	PSIF_WR_MASK_CMP_SWAP,
   164 	PSIF_WR_MASK_FETCH_ADD,
   215 	PSIF_WR_MASK_FETCH_ADD,
   165 	PSIF_WR_LSO,
   216 	PSIF_WR_LSO,
   166 	PSIF_WR_INVALIDATE_RKEY	 = 0x80,
   217 	PSIF_WR_INVALIDATE_RKEY	 = 0x80u,
   167 	PSIF_WR_INVALIDATE_LKEY,
   218 	PSIF_WR_INVALIDATE_LKEY,
   168 	PSIF_WR_INVALIDATE_BOTH_KEYS,
   219 	PSIF_WR_INVALIDATE_BOTH_KEYS,
   169 	PSIF_WR_INVALIDATE_TLB,
   220 	PSIF_WR_INVALIDATE_TLB,
   170 	PSIF_WR_RESIZE_CQ,
   221 	PSIF_WR_RESIZE_CQ,
   171 	PSIF_WR_SET_SRQ_LIM,
   222 	PSIF_WR_SET_SRQ_LIM,
   180 	PSIF_WR_INVALIDATE_SGL_CACHE
   231 	PSIF_WR_INVALIDATE_SGL_CACHE
   181 }; /* enum psif_wr_type [ 8 bits] */
   232 }; /* enum psif_wr_type [ 8 bits] */
   182 
   233 
   183 /* Port number the IB packet is transimitted on. */
   234 /* Port number the IB packet is transimitted on. */
   184 enum psif_port {
   235 enum psif_port {
   185 	PORT_1	 = 0,
   236 	PORT_1	 = 0u,
   186 	PORT_2	 = 0x1
   237 	PORT_2	 = 0x1u
   187 }; /* enum psif_port [ 1 bits] */
   238 }; /* enum psif_port [ 1 bits] */
   188 
   239 
   189 /*
   240 /*
   190  * Enumeration for using AHA or not. When set, AHA should be used instead of
   241  * Enumeration for using AHA or not. When set, AHA should be used instead of
   191  * information from the QP state in appropriate places.
   242  * information from the QP state in appropriate places.
   192  */
   243  */
   193 enum psif_use_ah {
   244 enum psif_use_ah {
   194 	NO_AHA	 = 0,
   245 	NO_AHA	 = 0u,
   195 	USE_AHA	 = 0x1
   246 	USE_AHA	 = 0x1u
   196 }; /* enum psif_use_ah [ 1 bits] */
   247 }; /* enum psif_use_ah [ 1 bits] */
   197 
   248 
   198 /*
   249 /*
   199  * Indicating if this QP is configured as a high bandwidth or a low latency
   250  * Indicating if this QP is configured as a high bandwidth or a low latency
   200  * QP.
   251  * QP.
   201  */
   252  */
   202 enum psif_tsu_qos {
   253 enum psif_tsu_qos {
   203 	QOSL_HIGH_BANDWIDTH	 = 0,
   254 	QOSL_HIGH_BANDWIDTH	 = 0u,
   204 	QOSL_LOW_LATENCY	 = 0x1
   255 	QOSL_LOW_LATENCY	 = 0x1u
   205 }; /* enum psif_tsu_qos [ 1 bits] */
   256 }; /* enum psif_tsu_qos [ 1 bits] */
   206 
   257 
   207 /*
   258 /*
   208  * Completion entry opcode indicating what type of request this completion
   259  * Completion entry opcode indicating what type of request this completion
   209  * entry is completed.
   260  * entry is completed.
   210  */
   261  */
   211 enum psif_wc_opcode {
   262 enum psif_wc_opcode {
   212 	PSIF_WC_OPCODE_SEND	 = 0,
   263 	PSIF_WC_OPCODE_SEND	 = 0u,
   213 	PSIF_WC_OPCODE_RDMA_WR	 = 0x1,
   264 	PSIF_WC_OPCODE_RDMA_WR	 = 0x1u,
   214 	PSIF_WC_OPCODE_RDMA_READ	 = 0x2,
   265 	PSIF_WC_OPCODE_RDMA_READ	 = 0x2u,
   215 	PSIF_WC_OPCODE_CMP_SWAP	 = 0x3,
   266 	PSIF_WC_OPCODE_CMP_SWAP	 = 0x3u,
   216 	PSIF_WC_OPCODE_FETCH_ADD	 = 0x4,
   267 	PSIF_WC_OPCODE_FETCH_ADD	 = 0x4u,
   217 	PSIF_WC_OPCODE_LSO	 = 0x6,
   268 	PSIF_WC_OPCODE_LSO	 = 0x6u,
   218 	PSIF_WC_OPCODE_MASKED_CMP_SWAP	 = 0x9,
   269 	PSIF_WC_OPCODE_MASKED_CMP_SWAP	 = 0x9u,
   219 	PSIF_WC_OPCODE_MASKED_FETCH_ADD,
   270 	PSIF_WC_OPCODE_MASKED_FETCH_ADD,
   220 	PSIF_WC_OPCODE_INVALIDATE_RKEY	 = 0x40,
   271 	PSIF_WC_OPCODE_INVALIDATE_RKEY	 = 0x40u,
   221 	PSIF_WC_OPCODE_INVALIDATE_LKEY,
   272 	PSIF_WC_OPCODE_INVALIDATE_LKEY,
   222 	PSIF_WC_OPCODE_INVALIDATE_BOTH_KEYS,
   273 	PSIF_WC_OPCODE_INVALIDATE_BOTH_KEYS,
   223 	PSIF_WC_OPCODE_INVALIDATE_TLB,
   274 	PSIF_WC_OPCODE_INVALIDATE_TLB,
   224 	PSIF_WC_OPCODE_RESIZE_CQ,
   275 	PSIF_WC_OPCODE_RESIZE_CQ,
   225 	PSIF_WC_OPCODE_SET_SRQ_LIM,
   276 	PSIF_WC_OPCODE_SET_SRQ_LIM,
   231 	PSIF_WC_OPCODE_INVALIDATE_RQ,
   282 	PSIF_WC_OPCODE_INVALIDATE_RQ,
   232 	PSIF_WC_OPCODE_INVALIDATE_CQ,
   283 	PSIF_WC_OPCODE_INVALIDATE_CQ,
   233 	PSIF_WC_OPCODE_INVALIDATE_RB,
   284 	PSIF_WC_OPCODE_INVALIDATE_RB,
   234 	PSIF_WC_OPCODE_INVALIDATE_XRCSRQ,
   285 	PSIF_WC_OPCODE_INVALIDATE_XRCSRQ,
   235 	PSIF_WC_OPCODE_INVALIDATE_SGL_CACHE,
   286 	PSIF_WC_OPCODE_INVALIDATE_SGL_CACHE,
   236 	PSIF_WC_OPCODE_RECEIVE_SEND	 = 0x80,
   287 	PSIF_WC_OPCODE_RECEIVE_SEND	 = 0x80u,
   237 	PSIF_WC_OPCODE_RECEIVE_RDMA_WR_IMM,
   288 	PSIF_WC_OPCODE_RECEIVE_RDMA_WR_IMM,
   238 	PSIF_WC_OPCODE_RECEIVE_CONDITIONAL_WR_IMM
   289 	PSIF_WC_OPCODE_RECEIVE_CONDITIONAL_WR_IMM
   239 }; /* enum psif_wc_opcode [ 8 bits] */
   290 }; /* enum psif_wc_opcode [ 8 bits] */
   240 
   291 
   241 /* Completion status for this completion. */
   292 /* Completion status for this completion. */
   242 enum psif_wc_status {
   293 enum psif_wc_status {
   243 	PSIF_WC_STATUS_SUCCESS,
   294 	PSIF_WC_STATUS_SUCCESS	 = 0u,
   244 	PSIF_WC_STATUS_LOC_LEN_ERR,
   295 	PSIF_WC_STATUS_LOC_LEN_ERR,
   245 	PSIF_WC_STATUS_LOC_QP_OP_ERR,
   296 	PSIF_WC_STATUS_LOC_QP_OP_ERR,
   246 	PSIF_WC_STATUS_LOC_EEC_OP_ERR,
   297 	PSIF_WC_STATUS_LOC_EEC_OP_ERR,
   247 	PSIF_WC_STATUS_LOC_PROT_ERR,
   298 	PSIF_WC_STATUS_LOC_PROT_ERR,
   248 	PSIF_WC_STATUS_WR_FLUSH_ERR,
   299 	PSIF_WC_STATUS_WR_FLUSH_ERR,
   261 	PSIF_WC_STATUS_INV_EEC_STATE_ERR,
   312 	PSIF_WC_STATUS_INV_EEC_STATE_ERR,
   262 	PSIF_WC_STATUS_FATAL_ERR,
   313 	PSIF_WC_STATUS_FATAL_ERR,
   263 	PSIF_WC_STATUS_RESP_TIMEOUT_ERR,
   314 	PSIF_WC_STATUS_RESP_TIMEOUT_ERR,
   264 	PSIF_WC_STATUS_GENERAL_ERR,
   315 	PSIF_WC_STATUS_GENERAL_ERR,
   265 	/* Padding out to required bits allocated */
   316 	/* Padding out to required bits allocated */
   266 	PSIF_WC_STATUS_FIELD_MAX	 = 0xff
   317 	PSIF_WC_STATUS_FIELD_MAX	 = 0xffu
   267 }; /* enum psif_wc_status [ 8 bits] */
   318 }; /* enum psif_wc_status [ 8 bits] */
   268 
   319 
   269 /* TSU Service level required in the QP and WR */
   320 /* TSU Service level required in the QP and WR */
   270 enum psif_tsl_qp_wr {
   321 enum psif_tsl_qp_wr {
   271 	/* Dataplane traffic separated in 4 TSLs */
   322 	/* Dataplane traffic separated in 4 TSLs */
   272 	TSL_DATA,
   323 	TSL_DATA	 = 0u,
   273 	TSL_DATA_1,
   324 	TSL_DATA_1,
   274 	TSL_DATA_2,
   325 	TSL_DATA_2,
   275 	TSL_DATA_3,
   326 	TSL_DATA_3,
   276 	/* TSL for privelidge QP */
   327 	/* TSL for privelidge QP */
   277 	TSL_PRIV	 = 0xe,
   328 	TSL_PRIV	 = 0xeu,
   278 	/* Strapped down TSL for testing */
   329 	/* Strapped down TSL for testing */
   279 	TSL_JUNK	 = 0xf
   330 	TSL_JUNK	 = 0xfu
   280 }; /* enum psif_tsl_qp_wr [ 4 bits] */
   331 }; /* enum psif_tsl_qp_wr [ 4 bits] */
   281 
   332 
   282 /* MMU table level definition
   333 /* MMU table level definition
   283  *  If page level is not applicable it should be set to  PAGE_LEVEL0
   334  *  If page level is not applicable it should be set to  PAGE_LEVEL0
   284  *  Values beyond PAGE_LEVEL4 (5-7) are reserved by HW
   335  *  Values beyond PAGE_LEVEL4 (5-7) are reserved by HW
   285  */
   336  */
   286 enum psif_table_level {
   337 enum psif_table_level {
   287 	/* */
   338 	/* */
   288 	PAGE_LEVEL0	 = 0,
   339 	PAGE_LEVEL0	 = 0u,
   289 	PAGE_LEVEL1,
   340 	PAGE_LEVEL1,
   290 	PAGE_LEVEL2,
   341 	PAGE_LEVEL2,
   291 	PAGE_LEVEL3,
   342 	PAGE_LEVEL3,
   292 	/* PAGE_LEVEL4 is SPARC only ? */
   343 	/* PAGE_LEVEL4 is SPARC only ? */
   293 	PAGE_LEVEL4,
   344 	PAGE_LEVEL4,
   294 	PAGE_LEVEL_RESERVED
   345 	PAGE_LEVEL_RESERVED
   295 }; /* enum psif_table_level [ 3 bits] */
   346 }; /* enum psif_table_level [ 3 bits] */
   296 
   347 
   297 
   348 
   298 enum ib_opcode {
   349 enum ib_opcode {
   299 	RC_SEND_First	 = 0,
   350 	RC_SEND_First	 = 0u,
   300 	RC_SEND_Middle	 = 0x1,
   351 	RC_SEND_Middle	 = 0x1u,
   301 	RC_SEND_Last	 = 0x2,
   352 	RC_SEND_Last	 = 0x2u,
   302 	RC_SEND_Last_Imm	 = 0x3,
   353 	RC_SEND_Last_Imm	 = 0x3u,
   303 	RC_SEND_Only	 = 0x4,
   354 	RC_SEND_Only	 = 0x4u,
   304 	RC_SEND_Only_Imm	 = 0x5,
   355 	RC_SEND_Only_Imm	 = 0x5u,
   305 	RC_RDMA_WR_First	 = 0x6,
   356 	RC_RDMA_WR_First	 = 0x6u,
   306 	RC_RDMA_WR_Middle	 = 0x7,
   357 	RC_RDMA_WR_Middle	 = 0x7u,
   307 	RC_RDMA_WR_Last	 = 0x8,
   358 	RC_RDMA_WR_Last	 = 0x8u,
   308 	RC_RDMA_WR_Last_Imm	 = 0x9,
   359 	RC_RDMA_WR_Last_Imm	 = 0x9u,
   309 	RC_RDMA_WR_Only	 = 0xa,
   360 	RC_RDMA_WR_Only	 = 0xau,
   310 	RC_RDMA_WR_Only_Imm	 = 0xb,
   361 	RC_RDMA_WR_Only_Imm	 = 0xbu,
   311 	RC_RDMA_RD_Req	 = 0xc,
   362 	RC_RDMA_RD_Req	 = 0xcu,
   312 	RC_RDMA_RD_Resp_First	 = 0xd,
   363 	RC_RDMA_RD_Resp_First	 = 0xdu,
   313 	RC_RDMA_RD_Resp_Middle	 = 0xe,
   364 	RC_RDMA_RD_Resp_Middle	 = 0xeu,
   314 	RC_RDMA_RD_Resp_Last	 = 0xf,
   365 	RC_RDMA_RD_Resp_Last	 = 0xfu,
   315 	RC_RDMA_RD_Resp_Only	 = 0x10,
   366 	RC_RDMA_RD_Resp_Only	 = 0x10u,
   316 	RC_ACK	 = 0x11,
   367 	RC_ACK	 = 0x11u,
   317 	RC_Atomic_ACK	 = 0x12,
   368 	RC_Atomic_ACK	 = 0x12u,
   318 	RC_CmpSwap	 = 0x13,
   369 	RC_CmpSwap	 = 0x13u,
   319 	RC_FetchAdd	 = 0x14,
   370 	RC_FetchAdd	 = 0x14u,
   320 	RC_Reserved	 = 0x15,
   371 	RC_Reserved	 = 0x15u,
   321 	RC_SEND_Last_Invalid	 = 0x16,
   372 	RC_SEND_Last_Invalid	 = 0x16u,
   322 	RC_SEND_Only_Invalid	 = 0x17,
   373 	RC_SEND_Only_Invalid	 = 0x17u,
   323 	RC_MaskCmpSwap	 = 0x18,
   374 	RC_MaskCmpSwap	 = 0x18u,
   324 	RC_MaskFetchAdd	 = 0x19,
   375 	RC_MaskFetchAdd	 = 0x19u,
   325 	UC_SEND_First	 = 0x20,
   376 	UC_SEND_First	 = 0x20u,
   326 	UC_SEND_Middle	 = 0x21,
   377 	UC_SEND_Middle	 = 0x21u,
   327 	UC_SEND_Last	 = 0x22,
   378 	UC_SEND_Last	 = 0x22u,
   328 	UC_SEND_Last_Imm	 = 0x23,
   379 	UC_SEND_Last_Imm	 = 0x23u,
   329 	UC_SEND_Only	 = 0x24,
   380 	UC_SEND_Only	 = 0x24u,
   330 	UC_SEND_Only_Imm	 = 0x25,
   381 	UC_SEND_Only_Imm	 = 0x25u,
   331 	UC_RDMA_WR_First	 = 0x26,
   382 	UC_RDMA_WR_First	 = 0x26u,
   332 	UC_RDMA_WR_Middle	 = 0x27,
   383 	UC_RDMA_WR_Middle	 = 0x27u,
   333 	UC_RDMA_WR_Last	 = 0x28,
   384 	UC_RDMA_WR_Last	 = 0x28u,
   334 	UC_RDMA_WR_Last_Imm	 = 0x29,
   385 	UC_RDMA_WR_Last_Imm	 = 0x29u,
   335 	UC_RDMA_WR_Only	 = 0x2a,
   386 	UC_RDMA_WR_Only	 = 0x2au,
   336 	UC_RDMA_WR_Only_Imm	 = 0x2b,
   387 	UC_RDMA_WR_Only_Imm	 = 0x2bu,
   337 	RD_SEND_First	 = 0x40,
   388 	RD_SEND_First	 = 0x40u,
   338 	RD_SEND_Middle	 = 0x41,
   389 	RD_SEND_Middle	 = 0x41u,
   339 	RD_SEND_Last	 = 0x42,
   390 	RD_SEND_Last	 = 0x42u,
   340 	RD_SEND_Last_Imm	 = 0x43,
   391 	RD_SEND_Last_Imm	 = 0x43u,
   341 	RD_SEND_Only	 = 0x44,
   392 	RD_SEND_Only	 = 0x44u,
   342 	RD_SEND_Only_Imm	 = 0x45,
   393 	RD_SEND_Only_Imm	 = 0x45u,
   343 	RD_RDMA_WR_First	 = 0x46,
   394 	RD_RDMA_WR_First	 = 0x46u,
   344 	RD_RDMA_WR_Middle	 = 0x47,
   395 	RD_RDMA_WR_Middle	 = 0x47u,
   345 	RD_RDMA_WR_Last	 = 0x48,
   396 	RD_RDMA_WR_Last	 = 0x48u,
   346 	RD_RDMA_WR_Last_Imm	 = 0x49,
   397 	RD_RDMA_WR_Last_Imm	 = 0x49u,
   347 	RD_RDMA_WR_Only	 = 0x4a,
   398 	RD_RDMA_WR_Only	 = 0x4au,
   348 	RD_RDMA_WR_Only_Imm	 = 0x4b,
   399 	RD_RDMA_WR_Only_Imm	 = 0x4bu,
   349 	RD_RDMA_RD_Req	 = 0x4c,
   400 	RD_RDMA_RD_Req	 = 0x4cu,
   350 	RD_RDMA_RD_Resp_First	 = 0x4d,
   401 	RD_RDMA_RD_Resp_First	 = 0x4du,
   351 	RD_RDMA_RD_Resp_Middle	 = 0x4e,
   402 	RD_RDMA_RD_Resp_Middle	 = 0x4eu,
   352 	RD_RDMA_RD_Resp_Last	 = 0x4f,
   403 	RD_RDMA_RD_Resp_Last	 = 0x4fu,
   353 	RD_RDMA_RD_Resp_Only	 = 0x50,
   404 	RD_RDMA_RD_Resp_Only	 = 0x50u,
   354 	RD_ACK	 = 0x51,
   405 	RD_ACK	 = 0x51u,
   355 	RD_Atomic_ACK	 = 0x52,
   406 	RD_Atomic_ACK	 = 0x52u,
   356 	RD_CmpSwap	 = 0x53,
   407 	RD_CmpSwap	 = 0x53u,
   357 	RD_FetchAdd	 = 0x54,
   408 	RD_FetchAdd	 = 0x54u,
   358 	RD_RESYNC	 = 0x55,
   409 	RD_RESYNC	 = 0x55u,
   359 	UD_SEND_Only	 = 0x64,
   410 	UD_SEND_Only	 = 0x64u,
   360 	UD_SEND_Only_Imm	 = 0x65,
   411 	UD_SEND_Only_Imm	 = 0x65u,
   361 	CNP	 = 0x80,
   412 	CNP	 = 0x80u,
   362 	XRC_SEND_First	 = 0xa0,
   413 	XRC_SEND_First	 = 0xa0u,
   363 	XRC_SEND_Middle	 = 0xa1,
   414 	XRC_SEND_Middle	 = 0xa1u,
   364 	XRC_SEND_Last	 = 0xa2,
   415 	XRC_SEND_Last	 = 0xa2u,
   365 	XRC_SEND_Last_Imm	 = 0xa3,
   416 	XRC_SEND_Last_Imm	 = 0xa3u,
   366 	XRC_SEND_Only	 = 0xa4,
   417 	XRC_SEND_Only	 = 0xa4u,
   367 	XRC_SEND_Only_Imm	 = 0xa5,
   418 	XRC_SEND_Only_Imm	 = 0xa5u,
   368 	XRC_RDMA_WR_First	 = 0xa6,
   419 	XRC_RDMA_WR_First	 = 0xa6u,
   369 	XRC_RDMA_WR_Middle	 = 0xa7,
   420 	XRC_RDMA_WR_Middle	 = 0xa7u,
   370 	XRC_RDMA_WR_Last	 = 0xa8,
   421 	XRC_RDMA_WR_Last	 = 0xa8u,
   371 	XRC_RDMA_WR_Last_Imm	 = 0xa9,
   422 	XRC_RDMA_WR_Last_Imm	 = 0xa9u,
   372 	XRC_RDMA_WR_Only	 = 0xaa,
   423 	XRC_RDMA_WR_Only	 = 0xaau,
   373 	XRC_RDMA_WR_Only_Imm	 = 0xab,
   424 	XRC_RDMA_WR_Only_Imm	 = 0xabu,
   374 	XRC_RDMA_RD_Req	 = 0xac,
   425 	XRC_RDMA_RD_Req	 = 0xacu,
   375 	XRC_RDMA_RD_Resp_First	 = 0xad,
   426 	XRC_RDMA_RD_Resp_First	 = 0xadu,
   376 	XRC_RDMA_RD_Resp_Middle	 = 0xae,
   427 	XRC_RDMA_RD_Resp_Middle	 = 0xaeu,
   377 	XRC_RDMA_RD_Resp_Last	 = 0xaf,
   428 	XRC_RDMA_RD_Resp_Last	 = 0xafu,
   378 	XRC_RDMA_RD_Resp_Only	 = 0xb0,
   429 	XRC_RDMA_RD_Resp_Only	 = 0xb0u,
   379 	XRC_ACK	 = 0xb1,
   430 	XRC_ACK	 = 0xb1u,
   380 	XRC_Atomic_ACK	 = 0xb2,
   431 	XRC_Atomic_ACK	 = 0xb2u,
   381 	XRC_CmpSwap	 = 0xb3,
   432 	XRC_CmpSwap	 = 0xb3u,
   382 	XRC_FetchAdd	 = 0xb4,
   433 	XRC_FetchAdd	 = 0xb4u,
   383 	XRC_Reserved	 = 0xb5,
   434 	XRC_Reserved	 = 0xb5u,
   384 	XRC_SEND_Last_Invalid	 = 0xb6,
   435 	XRC_SEND_Last_Invalid	 = 0xb6u,
   385 	XRC_SEND_Only_Invalid	 = 0xb7,
   436 	XRC_SEND_Only_Invalid	 = 0xb7u,
   386 	XRC_MaskCmpSwap	 = 0xb8,
   437 	XRC_MaskCmpSwap	 = 0xb8u,
   387 	XRC_MaskFetchAdd	 = 0xb9,
   438 	XRC_MaskFetchAdd	 = 0xb9u,
   388 	MANSP1_INVALID	 = 0xc0,
   439 	MANSP1_INVALID	 = 0xc0u,
   389 	MANSP1_HOST_READ	 = 0xc1,
   440 	MANSP1_HOST_READ	 = 0xc1u,
   390 	MANSP1_HOST_WRITE	 = 0xc2,
   441 	MANSP1_HOST_WRITE	 = 0xc2u,
   391 	MANSP1_HOST_READ_NO_DMAVT	 = 0xc3,
   442 	MANSP1_HOST_READ_NO_DMAVT	 = 0xc3u,
   392 	MANSP1_HOST_WRITE_NO_DMAVT	 = 0xc4,
   443 	MANSP1_HOST_WRITE_NO_DMAVT	 = 0xc4u,
   393 	MANSP1_INTERNAL_TYPE	 = 0xc5,
   444 	MANSP1_INTERNAL_TYPE	 = 0xc5u,
   394 	MANSP1_INTERNAL_TYPE_MMU_BYPASS	 = 0xc6,
   445 	MANSP1_INTERNAL_TYPE_MMU_BYPASS	 = 0xc6u,
   395 	MANSP1_HOST_CMP_SWAP	 = 0xc7,
   446 	MANSP1_HOST_CMP_SWAP	 = 0xc7u,
   396 	MANSP1_DR_LOOPBACK	 = 0xc8,
   447 	MANSP1_DR_LOOPBACK	 = 0xc8u,
   397 	MANSP1_ARP_LOOPBACK	 = 0xc9
   448 	MANSP1_ARP_LOOPBACK	 = 0xc9u
   398 }; /* enum ib_opcode [ 8 bits] */
   449 }; /* enum ib_opcode [ 8 bits] */
   399 
   450 
   400 /*
   451 /*
   401  * This is a ring buffer type defining the type of transaction this
   452  * This is a ring buffer type defining the type of transaction this
   402  * represents.
   453  * represents.
   403  */
   454  */
   404 enum psif_rb_type {
   455 enum psif_rb_type {
   405 	PSIF_RB_TYPE_INVALID,
   456 	PSIF_RB_TYPE_INVALID	 = 0u,
   406 	PSIF_RB_TYPE_DM_PUT,
   457 	PSIF_RB_TYPE_DM_PUT,
   407 	PSIF_RB_TYPE_DM_GET_RESP,
   458 	PSIF_RB_TYPE_DM_GET_RESP,
   408 	PSIF_RB_TYPE_RCV_PROXY_COMPLETION,
   459 	PSIF_RB_TYPE_RCV_PROXY_COMPLETION,
   409 	PSIF_RB_TYPE_RCV_PROXY_COMPLETION_AND_DATA,
   460 	PSIF_RB_TYPE_RCV_PROXY_COMPLETION_AND_DATA,
   410 	PSIF_RB_TYPE_SEND_PROXY_COMPLETION,
   461 	PSIF_RB_TYPE_SEND_PROXY_COMPLETION,
   414 /*
   465 /*
   415  * Core number for EPS-A.1 PSIF_EPS_A_1 PSIF_EPS_A_2 PSIF_EPS_A_3
   466  * Core number for EPS-A.1 PSIF_EPS_A_1 PSIF_EPS_A_2 PSIF_EPS_A_3
   416  * PSIF_EPS_A_4
   467  * PSIF_EPS_A_4
   417  */
   468  */
   418 enum psif_eps_a_core {
   469 enum psif_eps_a_core {
   419 	PSIF_EPS_A_1,
   470 	PSIF_EPS_A_1	 = 0u,
   420 	PSIF_EPS_A_2,
   471 	PSIF_EPS_A_2,
   421 	PSIF_EPS_A_3,
   472 	PSIF_EPS_A_3,
   422 	PSIF_EPS_A_4
   473 	PSIF_EPS_A_4
   423 }; /* enum psif_eps_a_core [ 2 bits] */
   474 }; /* enum psif_eps_a_core [ 2 bits] */
   424 
   475 
   425 /* This is the state this QP is in. */
   476 /* This is the state this QP is in. */
   426 enum psif_qp_state {
   477 enum psif_qp_state {
   427 	PSIF_QP_STATE_RESET	 = 0,
   478 	PSIF_QP_STATE_RESET	 = 0u,
   428 	PSIF_QP_STATE_INIT	 = 0x1,
   479 	PSIF_QP_STATE_INIT	 = 0x1u,
   429 	PSIF_QP_STATE_RTR	 = 0x2,
   480 	PSIF_QP_STATE_RTR	 = 0x2u,
   430 	PSIF_QP_STATE_RTS	 = 0x3,
   481 	PSIF_QP_STATE_RTS	 = 0x3u,
   431 	PSIF_QP_STATE_SQERR	 = 0x5,
   482 	PSIF_QP_STATE_SQERR	 = 0x5u,
   432 	PSIF_QP_STATE_ERROR	 = 0x6,
   483 	PSIF_QP_STATE_ERROR	 = 0x6u,
   433 	PSIF_QP_STATE_INVALID	 = 0x7
   484 	PSIF_QP_STATE_INVALID	 = 0x7u
   434 }; /* enum psif_qp_state [ 3 bits] */
   485 }; /* enum psif_qp_state [ 3 bits] */
   435 
   486 
   436 /*
   487 /*
   437  * CMPL_NO_ERROR CMPL_RQS_INVALID_REQUEST_ERR CMPL_RQS_QP_IN_WRONG_STATE_ERR
   488  * CMPL_NO_ERROR CMPL_RQS_INVALID_REQUEST_ERR CMPL_RQS_QP_IN_WRONG_STATE_ERR
   438  * CMPL_RQS_MAX_OUTSTANDING_REACHED_ERR CMPL_RQS_REQUEST_FENCED_ERR
   489  * CMPL_RQS_MAX_OUTSTANDING_REACHED_ERR CMPL_RQS_REQUEST_FENCED_ERR
   456  * 2 bits (next_opcode) 0x0: No operation in progress 0x1: Expect SEND middle
   507  * 2 bits (next_opcode) 0x0: No operation in progress 0x1: Expect SEND middle
   457  * or last 0x2: Expect RDMA_WR middle or last 0x3: Expect DM_PUT middle or
   508  * or last 0x2: Expect RDMA_WR middle or last 0x3: Expect DM_PUT middle or
   458  * last
   509  * last
   459  */
   510  */
   460 enum psif_expected_op {
   511 enum psif_expected_op {
   461 	NO_OPERATION_IN_PROGRESS	 = 0,
   512 	NO_OPERATION_IN_PROGRESS	 = 0u,
   462 	EXPECT_SEND_MIDDLE_LAST	 = 0x1,
   513 	EXPECT_SEND_MIDDLE_LAST	 = 0x1u,
   463 	EXPECT_RDMA_WR_MIDDLE_LAST	 = 0x2,
   514 	EXPECT_RDMA_WR_MIDDLE_LAST	 = 0x2u,
   464 	EXPECT_DM_PUT_MIDDLE_LAST	 = 0x3
   515 	EXPECT_DM_PUT_MIDDLE_LAST	 = 0x3u
   465 }; /* enum psif_expected_op [ 2 bits] */
   516 }; /* enum psif_expected_op [ 2 bits] */
   466 
   517 
   467 /*
   518 /*
   468  * Migration state (migrated, re-arm and armed). XXX: Assign values to the
   519  * Migration state (migrated, re-arm and armed). XXX: Assign values to the
   469  * states.
   520  * states.
   470  */
   521  */
   471 enum psif_migration {
   522 enum psif_migration {
   472 	APM_OFF,
   523 	APM_OFF	 = 0u,
   473 	APM_MIGRATED,
   524 	APM_MIGRATED,
   474 	APM_REARM,
   525 	APM_REARM,
   475 	APM_ARMED
   526 	APM_ARMED
   476 }; /* enum psif_migration [ 2 bits] */
   527 }; /* enum psif_migration [ 2 bits] */
   477 
   528 
   481  * Unreliable datagram. 0x4: RSVD1 0x5: XRC - Extended reliable connection.
   532  * Unreliable datagram. 0x4: RSVD1 0x5: XRC - Extended reliable connection.
   482  * 0x6: MANSP1 - manufacturer specific opcodes. 0x7: MANSP2 - manufacturer
   533  * 0x6: MANSP1 - manufacturer specific opcodes. 0x7: MANSP2 - manufacturer
   483  * specific opcodes.
   534  * specific opcodes.
   484  */
   535  */
   485 enum psif_qp_trans {
   536 enum psif_qp_trans {
   486 	PSIF_QP_TRANSPORT_RC	 = 0,
   537 	PSIF_QP_TRANSPORT_RC	 = 0u,
   487 	PSIF_QP_TRANSPORT_UC	 = 0x1,
   538 	PSIF_QP_TRANSPORT_UC	 = 0x1u,
   488 	PSIF_QP_TRANSPORT_RD	 = 0x2,
   539 	PSIF_QP_TRANSPORT_RD	 = 0x2u,
   489 	PSIF_QP_TRANSPORT_UD	 = 0x3,
   540 	PSIF_QP_TRANSPORT_UD	 = 0x3u,
   490 	PSIF_QP_TRANSPORT_RSVD1	 = 0x4,
   541 	PSIF_QP_TRANSPORT_RSVD1	 = 0x4u,
   491 	PSIF_QP_TRANSPORT_XRC	 = 0x5,
   542 	PSIF_QP_TRANSPORT_XRC	 = 0x5u,
   492 	PSIF_QP_TRANSPORT_MANSP1	 = 0x6,
   543 	PSIF_QP_TRANSPORT_MANSP1	 = 0x6u,
   493 	PSIF_QP_TRANSPORT_MANSP2	 = 0x7
   544 	PSIF_QP_TRANSPORT_MANSP2	 = 0x7u
   494 }; /* enum psif_qp_trans [ 3 bits] */
   545 }; /* enum psif_qp_trans [ 3 bits] */
   495 
   546 
   496 
   547 
   497 enum psif_bool {
   548 enum psif_bool {
   498 	FALSE	 = 0,
   549 	FALSE	 = 0u,
   499 	TRUE	 = 0x1
   550 	TRUE	 = 0x1u
   500 }; /* enum psif_bool [ 1 bits] */
   551 }; /* enum psif_bool [ 1 bits] */
   501 
   552 
   502 /*
   553 /*
   503  * EoIB types enumerated type having these enumerations: EOIB_FULL,
   554  * EoIB types enumerated type having these enumerations: EOIB_FULL,
   504  * EOIB_PARTIAL, EOIB_QKEY_ONLY, EOIB_NONE.
   555  * EOIB_PARTIAL, EOIB_QKEY_ONLY, EOIB_NONE.
   505  */
   556  */
   506 enum psif_eoib_type {
   557 enum psif_eoib_type {
   507 	EOIB_FULL,
   558 	EOIB_FULL	 = 0u,
   508 	EOIB_PARTIAL,
   559 	EOIB_PARTIAL,
   509 	EOIB_QKEY_ONLY,
   560 	EOIB_QKEY_ONLY,
   510 	EOIB_NONE
   561 	EOIB_NONE
   511 }; /* enum psif_eoib_type [ 2 bits] */
   562 }; /* enum psif_eoib_type [ 2 bits] */
   512 
   563 
   513 /*
   564 /*
   514  * Communication established state. This gets set when a packet is received
   565  * Communication established state. This gets set when a packet is received
   515  * error free when in RTR state.
   566  * error free when in RTR state.
   516  */
   567  */
   517 enum psif_comm_live {
   568 enum psif_comm_live {
   518 	NO_COMM_ESTABLISHED	 = 0,
   569 	NO_COMM_ESTABLISHED	 = 0u,
   519 	COMM_ESTABLISHED	 = 0x1
   570 	COMM_ESTABLISHED	 = 0x1u
   520 }; /* enum psif_comm_live [ 1 bits] */
   571 }; /* enum psif_comm_live [ 1 bits] */
   521 
   572 
   522 /* Definitions for the different supported MTU sizes. */
   573 /* Definitions for the different supported MTU sizes. */
   523 enum psif_path_mtu {
   574 enum psif_path_mtu {
   524 	MTU_INVALID	 = 0,
   575 	MTU_INVALID	 = 0u,
   525 	MTU_256B	 = 0x1,
   576 	MTU_256B	 = 0x1u,
   526 	MTU_512B	 = 0x2,
   577 	MTU_512B	 = 0x2u,
   527 	MTU_1024B	 = 0x3,
   578 	MTU_1024B	 = 0x3u,
   528 	MTU_2048B	 = 0x4,
   579 	MTU_2048B	 = 0x4u,
   529 	MTU_4096B	 = 0x5,
   580 	MTU_4096B	 = 0x5u,
   530 	MTU_10240B	 = 0x6,
   581 	MTU_10240B	 = 0x6u,
   531 	MTU_XXX	 = 0x7
   582 	MTU_XXX	 = 0x7u
   532 }; /* enum psif_path_mtu [ 3 bits] */
   583 }; /* enum psif_path_mtu [ 3 bits] */
   533 
   584 
   534 /* Enumeration for using GRH or not. When set GRH should be used. */
   585 /* Enumeration for using GRH or not. When set GRH should be used. */
   535 enum psif_use_grh {
   586 enum psif_use_grh {
   536 	NO_GRH	 = 0,
   587 	NO_GRH	 = 0u,
   537 	USE_GRH	 = 0x1
   588 	USE_GRH	 = 0x1u
   538 }; /* enum psif_use_grh [ 1 bits] */
   589 }; /* enum psif_use_grh [ 1 bits] */
   539 
   590 
   540 /* Enumeration for loopback indication NO_LOOPBACK = 0 LOOPBACK = 1. */
   591 /* Enumeration for loopback indication NO_LOOPBACK = 0 LOOPBACK = 1. */
   541 enum psif_loopback {
   592 enum psif_loopback {
   542 	NO_LOOPBACK	 = 0,
   593 	NO_LOOPBACK	 = 0u,
   543 	LOOPBACK	 = 0x1
   594 	LOOPBACK	 = 0x1u
   544 }; /* enum psif_loopback [ 1 bits] */
   595 }; /* enum psif_loopback [ 1 bits] */
   545 
       
   546 /*
       
   547  * Should match definitions in ib_verbs.h
       
   548  */
       
   549 enum psif_port_speed {
       
   550 	PSIF_SPEED_SDR	 = 0x1,
       
   551 	PSIF_SPEED_DDR	 = 0x2,
       
   552 	PSIF_SPEED_QDR	 = 0x4,
       
   553 	PSIF_SPEED_FDR10	 = 0x8,
       
   554 	PSIF_SPEED_FDR	 = 0x10,
       
   555 	PSIF_SPEED_EDR	 = 0x20,
       
   556 	/* Padding out to required bits allocated */
       
   557 	PSIF_PORT_SPEED_FIELD_MAX	 = 0xff
       
   558 }; /* enum psif_port_speed [ 8 bits] */
       
   559 
   596 
   560 /* Depricated data type... */
   597 /* Depricated data type... */
   561 enum psif_pcie_wr_offs {
   598 enum psif_pcie_wr_offs {
   562 	WR_CB_START_OFFS	 = 0,
   599 	WR_CB_START_OFFS	 = 0u,
   563 	WR_CB_LAST_OFFS	 = 0x140,
   600 	WR_CB_LAST_OFFS	 = 0x140u,
   564 	WR_SQS_DOORBELL_OFFS	 = 0xfc0,
   601 	WR_SQS_DOORBELL_OFFS	 = 0xfc0u,
   565 	WR_CB_CLEAR_OFFS	 = 0xff8,
   602 	WR_CB_CLEAR_OFFS	 = 0xff8u,
   566 	WR_MAX_BAR_OFFS	 = 0xfff
   603 	WR_MAX_BAR_OFFS	 = 0xfffu
   567 }; /* enum psif_pcie_wr_offs [12 bits] */
   604 }; /* enum psif_pcie_wr_offs [12 bits] */
   568 
   605 
   569 /* Commands used for modify/query QP. */
   606 /* Commands used for modify/query QP. */
   570 enum psif_qp_command {
   607 enum psif_qp_command {
   571 	QP_CMD_INVALID	 = 0,
   608 	QP_CMD_INVALID	 = 0u,
   572 	QP_CMD_MODIFY	 = 0x1,
   609 	QP_CMD_MODIFY	 = 0x1u,
   573 	QP_CMD_QUERY	 = 0x2,
   610 	QP_CMD_QUERY	 = 0x2u,
   574 	QP_CMD_CHECK_TIMEOUT	 = 0x3
   611 	QP_CMD_CHECK_TIMEOUT	 = 0x3u
   575 }; /* enum psif_qp_command [ 2 bits] */
   612 }; /* enum psif_qp_command [ 2 bits] */
   576 
   613 
   577 
   614 
   578 enum psif_sibs_mbox_type {
   615 enum psif_sibs_mbox_type {
   579 	SIBS_MBOX_EPSC,
   616 	SIBS_MBOX_EPSC,
   580 	SIBS_MBOX_EPS_MAX,
   617 	SIBS_MBOX_EPS_MAX,
   581 	/* Padding out to required bits allocated */
   618 	/* Padding out to required bits allocated */
   582 	PSIF_SIBS_MBOX_TYPE_FIELD_MAX	 = 0xff
   619 	PSIF_SIBS_MBOX_TYPE_FIELD_MAX	 = 0xffu
   583 }; /* enum psif_sibs_mbox_type [ 8 bits] */
   620 }; /* enum psif_sibs_mbox_type [ 8 bits] */
   584 
   621 
   585 
   622 
   586 enum psif_mbox_type {
   623 enum psif_mbox_type {
   587 	MBOX_EPSA0,
   624 	MBOX_EPSA0,
   589 	MBOX_EPSA2,
   626 	MBOX_EPSA2,
   590 	MBOX_EPSA3,
   627 	MBOX_EPSA3,
   591 	MBOX_EPSC,
   628 	MBOX_EPSC,
   592 	MBOX_EPS_MAX,
   629 	MBOX_EPS_MAX,
   593 	/* Padding out to required bits allocated */
   630 	/* Padding out to required bits allocated */
   594 	PSIF_MBOX_TYPE_FIELD_MAX	 = 0xff
   631 	PSIF_MBOX_TYPE_FIELD_MAX	 = 0xffu
   595 }; /* enum psif_mbox_type [ 8 bits] */
   632 }; /* enum psif_mbox_type [ 8 bits] */
   596 
   633 
   597 /*
   634 /*
   598  * DMA Validation Key states. The valid states are: PSIF_DMA_KEY_INVALID=0
   635  * DMA Validation Key states. The valid states are: PSIF_DMA_KEY_INVALID=0
   599  * PSIF_DMA_KEY_FREE = 1 PSIF_DMA_KEY_VALID = 2 PSIF_DMA_KEY_MMU_VALID
   636  * PSIF_DMA_KEY_FREE = 1 PSIF_DMA_KEY_VALID = 2 PSIF_DMA_KEY_MMU_VALID
   600  */
   637  */
   601 enum psif_dma_vt_key_states {
   638 enum psif_dma_vt_key_states {
   602 	PSIF_DMA_KEY_INVALID	 = 0,
   639 	PSIF_DMA_KEY_INVALID	 = 0u,
   603 	PSIF_DMA_KEY_FREE	 = 0x1,
   640 	PSIF_DMA_KEY_FREE	 = 0x1u,
   604 	PSIF_DMA_KEY_VALID	 = 0x2,
   641 	PSIF_DMA_KEY_VALID	 = 0x2u,
   605 	PSIF_DMA_KEY_MMU_VALID	 = 0x3
   642 	PSIF_DMA_KEY_MMU_VALID	 = 0x3u
   606 }; /* enum psif_dma_vt_key_states [ 2 bits] */
   643 }; /* enum psif_dma_vt_key_states [ 2 bits] */
   607 
   644 
   608 /**
   645 /**
   609  * Flash image types. More comming...
   646  * Flash image types. More comming...
   610  */
   647  */
   611 enum psif_flash_image_type {
   648 enum psif_flash_image_type {
   612 	PSIF_IMAGE_INVALID	 = 0,
   649 	PSIF_IMAGE_INVALID	 = 0u,
   613 	PSIF_IMAGE_BOOT_LOADER	 = 0x1,
   650 	PSIF_IMAGE_BOOT_LOADER	 = 0x1u,
   614 	PSIF_IMAGE_EPS_C_APPLICATION	 = 0x2,
   651 	PSIF_IMAGE_EPS_C_APPLICATION	 = 0x2u,
   615 	PSIF_IMAGE_EPS_A_APPLICATION	 = 0x3,
   652 	PSIF_IMAGE_EPS_A_APPLICATION	 = 0x3u,
   616 	PSIF_IMAGE_DIAGNOSTICS	 = 0x4,
   653 	PSIF_IMAGE_DIAGNOSTICS	 = 0x4u,
   617 	/* Padding out to required bits allocated */
   654 	/* Padding out to required bits allocated */
   618 	PSIF_FLASH_IMAGE_TYPE_FIELD_MAX	 = 0x7fffffff
   655 	PSIF_FLASH_IMAGE_TYPE_FIELD_MAX	 = 0x7fffffffu
   619 }; /* enum psif_flash_image_type [32 bits] */
   656 }; /* enum psif_flash_image_type [32 bits] */
   620 
   657 
   621 /** \brief SW EQ event type
   658 /** \brief SW EQ event type
   622  *  \details
   659  *  \details
   623  *  Software events use `eq_entry::port_flags` for the event type. As this is
   660  *  Software events use `eq_entry::port_flags` for the event type. As this is
   635  * \par Classification
   672  * \par Classification
   636  *      driver
   673  *      driver
   637  */
   674  */
   638 enum psif_event {
   675 enum psif_event {
   639 	/** Event without a reason... */
   676 	/** Event without a reason... */
   640 	PSIF_EVENT_NO_CHANGE	 = 0,
   677 	PSIF_EVENT_NO_CHANGE	 = 0u,
   641 	/** GID table have been updated */
   678 	/** GID table have been updated */
   642 	PSIF_EVENT_SGID_TABLE_CHANGED,
   679 	PSIF_EVENT_SGID_TABLE_CHANGED,
   643 	/** PKEY table have been updated by the SM */
   680 	/** PKEY table have been updated by the SM */
   644 	PSIF_EVENT_PKEY_TABLE_CHANGED,
   681 	PSIF_EVENT_PKEY_TABLE_CHANGED,
   645 	/** SM lid have been updated by master SM */
   682 	/** SM lid have been updated by master SM */
   668 	PSIF_EVENT_PORT_ERR,
   705 	PSIF_EVENT_PORT_ERR,
   669 	/** Event queue full (replaces the actual event) */
   706 	/** Event queue full (replaces the actual event) */
   670 	PSIF_EVENT_QUEUE_FULL,
   707 	PSIF_EVENT_QUEUE_FULL,
   671 	/** FW entered degraded mode */
   708 	/** FW entered degraded mode */
   672 	PSIF_EVENT_DEGRADED_MODE,
   709 	PSIF_EVENT_DEGRADED_MODE,
   673 	/* Padding out to required bits allocated */
   710 	/** Request a keep-alive message */
   674 	PSIF_EVENT_FIELD_MAX	 = 0x7fffffff
   711 	PSIF_EVENT_EPSC_KEEP_ALIVE,
       
   712 	/** FW finished flushing MMU */
       
   713 	PSIF_EVENT_EPSC_MMU_FLUSH_DONE,
       
   714 	/* Padding out to required bits allocated */
       
   715 	PSIF_EVENT_FIELD_MAX	 = 0x7fffffffu
   675 }; /* enum psif_event [32 bits] */
   716 }; /* enum psif_event [32 bits] */
   676 
   717 
   677 /*
   718 /*
   678  * Enumerations of error types. The following error types are defined for the
   719  * Enumerations of error types. The following error types are defined for the
   679  * TSU: TSU_NO_ERROR = 8'h0 TSU_IBPR_ICRC_ERR TSU_IBPR_INVALID_PKEY_ERR
   720  * TSU: TSU_NO_ERROR = 8'h0 TSU_IBPR_ICRC_ERR TSU_IBPR_INVALID_PKEY_ERR
   731  * TSU_CMPL_NAK_INVALID_REQUEST_ERR TSU_CMPL_NAK_REMOTE_ACCESS_ERR
   772  * TSU_CMPL_NAK_INVALID_REQUEST_ERR TSU_CMPL_NAK_REMOTE_ACCESS_ERR
   732  * TSU_CMPL_NAK_REMOTE_OPS_ERR TSU_CMPL_NAK_INVALID_RD_REQUEST_ERR
   773  * TSU_CMPL_NAK_REMOTE_OPS_ERR TSU_CMPL_NAK_INVALID_RD_REQUEST_ERR
   733  * TSU_CMPL_TIMEOUT_ERR TSU_CMPL_IMPLIED_NAK TSU_CMPL_GHOST_RESP_ERR
   774  * TSU_CMPL_TIMEOUT_ERR TSU_CMPL_IMPLIED_NAK TSU_CMPL_GHOST_RESP_ERR
   734  */
   775  */
   735 enum psif_tsu_error_types {
   776 enum psif_tsu_error_types {
   736 	TSU_NO_ERROR	 = 0,
   777 	TSU_NO_ERROR	 = 0u,
   737 	TSU_IBPR_ICRC_ERR,
   778 	TSU_IBPR_ICRC_ERR,
   738 	TSU_IBPR_INVALID_PKEY_ERR,
   779 	TSU_IBPR_INVALID_PKEY_ERR,
   739 	TSU_IBPR_INVALID_QP_ERR,
   780 	TSU_IBPR_INVALID_QP_ERR,
   740 	TSU_IBPR_VSWITCH_UF_ERR,
   781 	TSU_IBPR_VSWITCH_UF_ERR,
   741 	TSU_IBPR_PKTLEN_ERR,
   782 	TSU_IBPR_PKTLEN_ERR,
   878 /*
   919 /*
   879  * Here are the different EPS core IDs: PSIF_EVENT_EPS_A_1 PSIF_EVENT_EPS_A_2
   920  * Here are the different EPS core IDs: PSIF_EVENT_EPS_A_1 PSIF_EVENT_EPS_A_2
   880  * PSIF_EVENT_EPS_A_3 PSIF_EVENT_EPS_A_4 PSIF_EVENT_EPS_C
   921  * PSIF_EVENT_EPS_A_3 PSIF_EVENT_EPS_A_4 PSIF_EVENT_EPS_C
   881  */
   922  */
   882 enum psif_eps_core_id {
   923 enum psif_eps_core_id {
   883 	PSIF_EVENT_CORE_EPS_A_1,
   924 	PSIF_EVENT_CORE_EPS_A_1	 = 0u,
   884 	PSIF_EVENT_CORE_EPS_A_2,
   925 	PSIF_EVENT_CORE_EPS_A_2,
   885 	PSIF_EVENT_CORE_EPS_A_3,
   926 	PSIF_EVENT_CORE_EPS_A_3,
   886 	PSIF_EVENT_CORE_EPS_A_4,
   927 	PSIF_EVENT_CORE_EPS_A_4,
   887 	PSIF_EVENT_CORE_EPS_C,
   928 	PSIF_EVENT_CORE_EPS_C,
   888 	/* Padding out to required bits allocated */
   929 	/* Padding out to required bits allocated */
   889 	PSIF_EPS_CORE_ID_FIELD_MAX	 = 0xf
   930 	PSIF_EPS_CORE_ID_FIELD_MAX	 = 0xfu
   890 }; /* enum psif_eps_core_id [ 4 bits] */
   931 }; /* enum psif_eps_core_id [ 4 bits] */
   891 
   932 
   892 
   933 /**
   893 enum psif_epsc_log_mode {
   934  * \brief Discriminator for PSIF_QUERY of persistent values
   894 /* Logging completely disabled */
   935  * \details
   895 
   936  * \par Width
   896 	EPSC_LOG_MODE_OFF	 = 0,
   937  *      32 bit
   897 /* See epsfw/src/include/logging.h */
   938  * \par Used in
   898 
   939  * the parameter for the PSIF_QUERY sub-operation EPSC_QUERY_NUM_VFS and EPS_QUERY_JUMBO - set in the index field
   899 	EPSC_LOG_MODE_SCAT	 = 0x1,
   940  * \par Classification
   900 	EPSC_LOG_MODE_MALLOC	 = 0x2,
   941  *      driver
   901 	EPSC_LOG_MODE_LOCAL	 = 0x3,
   942  */
   902 /* Redirect logging to host (dma) */
   943 enum psif_epsc_query_persistent {
   903 
   944 	EPSC_QUERY_PERSISTENT_STORED,
   904 	EPSC_LOG_MODE_HOST	 = 0x4,
   945 	EPSC_QUERY_PERSISTENT_ACTIVE,
   905 /* Save the set log mode in the flash */
   946 	EPSC_QUERY_PERSISTENT_HW_CAP,
   906 
   947 	/* Padding out to required bits allocated */
   907 	EPSC_LOG_MODE_SAVE	 = 0x10,
   948 	PSIF_EPSC_QUERY_PERSISTENT_FIELD_MAX	 = 0x7fffffffu
   908 	/* Padding out to required bits allocated */
   949 }; /* enum psif_epsc_query_persistent [32 bits] */
   909 	PSIF_EPSC_LOG_MODE_FIELD_MAX	 = 0x7fffffff
   950 
   910 }; /* enum psif_epsc_log_mode [32 bits] */
   951 /**
   911 
   952  * \brief Discriminator for the PSIF_QUER sub-operation EPSC_QUERY_NUM_VFS - obsolete interface
   912 /**
   953  * \details
   913  * EPSC_LOG_CTRL
   954  * \par Width
   914  */
   955  *      32 bit
   915 enum psif_epsc_log_level {
   956  * \par Used in
   916 	EPS_LOG_OFF	 = 0,
   957  * the parameter for the PSIF_QUERY sub-operation EPSC_QUERY_NUM_VFS - set in the index field
   917 	EPS_LOG_FATAL	 = 0x1,
   958  * \par Classification
   918 	EPS_LOG_ERROR	 = 0x2,
   959  *      driver
   919 	EPS_LOG_WARN	 = 0x3,
   960  */
   920 	EPS_LOG_INFO	 = 0x4,
   961 enum psif_epsc_query_num_vfs_mode {
   921 	EPS_LOG_DEBUG	 = 0x5,
   962 	EPSC_QUERY_NUM_VFS_MODE_PERSISTENT,
   922 	EPS_LOG_TRACE	 = 0x6,
   963 	EPSC_QUERY_NUM_VFS_MODE_CURRENT,
   923 	EPS_LOG_ALL	 = 0x7,
   964 	EPSC_QUERY_NUM_VFS_MODE_HW_CAP,
   924 	/* Padding out to required bits allocated */
   965 	/* Padding out to required bits allocated */
   925 	PSIF_EPSC_LOG_LEVEL_FIELD_MAX	 = 0x7fffffff
   966 	PSIF_EPSC_QUERY_NUM_VFS_MODE_FIELD_MAX	 = 0x7fffffffu
   926 }; /* enum psif_epsc_log_level [32 bits] */
   967 }; /* enum psif_epsc_query_num_vfs_mode [32 bits] */
   927 
   968 
   928 /**
   969 /**
   929  * \brief Port state
   970  * \brief Port state
   930  * \details
   971  * \details
   931  * This enum specifies the state of a UF port's port state machine. It
   972  * This enum specifies the state of a UF port's port state machine. It
   944  * not contain the information about forcing the state as this is only
   985  * not contain the information about forcing the state as this is only
   945  * for FW.
   986  * for FW.
   946  */
   987  */
   947 enum psif_epsc_port_state {
   988 enum psif_epsc_port_state {
   948 	/** No change */
   989 	/** No change */
   949 	EPSC_PORT_NOP	 = 0,
   990 	EPSC_PORT_NOP	 = 0u,
   950 	/** The port is down. */
   991 	/** The port is down. */
   951 	EPSC_PORT_DOWN	 = 0x1,
   992 	EPSC_PORT_DOWN	 = 0x1u,
   952 	/** The port is in init state. */
   993 	/** The port is in init state. */
   953 	EPSC_PORT_INIT	 = 0x2,
   994 	EPSC_PORT_INIT	 = 0x2u,
   954 	/** The port state is armed. */
   995 	/** The port state is armed. */
   955 	EPSC_PORT_ARMED	 = 0x3,
   996 	EPSC_PORT_ARMED	 = 0x3u,
   956 	/** The port is active. */
   997 	/** The port is active. */
   957 	EPSC_PORT_ACTIVE	 = 0x4,
   998 	EPSC_PORT_ACTIVE	 = 0x4u,
   958 	/** The port is in deferred active state. */
   999 	/** The port is in deferred active state. */
   959 	EPSC_PORT_ACTIVE_DEFER	 = 0x5,
  1000 	EPSC_PORT_ACTIVE_DEFER	 = 0x5u,
   960 	/* Padding out to required bits allocated */
  1001 	/* Padding out to required bits allocated */
   961 	PSIF_EPSC_PORT_STATE_FIELD_MAX	 = 0x7fffffff
  1002 	PSIF_EPSC_PORT_STATE_FIELD_MAX	 = 0x7fffffffu
   962 }; /* enum psif_epsc_port_state [32 bits] */
  1003 }; /* enum psif_epsc_port_state [32 bits] */
   963 
  1004 
   964 /**
  1005 /**
   965  * \brief Version fixed copy of psif_path_mtu
  1006  * \brief Version fixed copy of psif_path_mtu
   966  * \details
  1007  * \details
   978  * \par Classification
  1019  * \par Classification
   979  *      driver
  1020  *      driver
   980  */
  1021  */
   981 enum psif_epsc_path_mtu {
  1022 enum psif_epsc_path_mtu {
   982 	/** Not a valid MTU. */
  1023 	/** Not a valid MTU. */
   983 	EPSC_MTU_INVALID	 = 0,
  1024 	EPSC_MTU_INVALID	 = 0u,
   984 	/** The MTU is 256 bytes. */
  1025 	/** The MTU is 256 bytes. */
   985 	EPSC_MTU_256B	 = 0x1,
  1026 	EPSC_MTU_256B	 = 0x1u,
   986 	/** The MTU is 512 bytes. */
  1027 	/** The MTU is 512 bytes. */
   987 	EPSC_MTU_512B	 = 0x2,
  1028 	EPSC_MTU_512B	 = 0x2u,
   988 	/** The MTU is 1024 bytes. */
  1029 	/** The MTU is 1024 bytes. */
   989 	EPSC_MTU_1024B	 = 0x3,
  1030 	EPSC_MTU_1024B	 = 0x3u,
   990 	/** The MTU is 2048 bytes. */
  1031 	/** The MTU is 2048 bytes. */
   991 	EPSC_MTU_2048B	 = 0x4,
  1032 	EPSC_MTU_2048B	 = 0x4u,
   992 	/** The MTU is 4069 bytes. */
  1033 	/** The MTU is 4069 bytes. */
   993 	EPSC_MTU_4096B	 = 0x5,
  1034 	EPSC_MTU_4096B	 = 0x5u,
   994 	/** The MTU is 10240 bytes. */
  1035 	/** The MTU is 10240 bytes. */
   995 	EPSC_MTU_10240B	 = 0x6,
  1036 	EPSC_MTU_10240B	 = 0x6u,
   996 	/** Not a specific MTU. */
  1037 	/** Not a specific MTU. */
   997 	EPSC_MTU_XXX	 = 0x7,
  1038 	EPSC_MTU_XXX	 = 0x7u,
   998 	/* Padding out to required bits allocated */
  1039 	/* Padding out to required bits allocated */
   999 	PSIF_EPSC_PATH_MTU_FIELD_MAX	 = 0x7fffffff
  1040 	PSIF_EPSC_PATH_MTU_FIELD_MAX	 = 0x7fffffffu
  1000 }; /* enum psif_epsc_path_mtu [32 bits] */
  1041 }; /* enum psif_epsc_path_mtu [32 bits] */
  1001 
  1042 
  1002 /**
  1043 /**
  1003  * \brief Monitors handling asynchronous event
  1044  * \brief Monitors handling asynchronous event
  1004  * \details
  1045  * \details
  1019 	PSIF_MONITOR_TRIG,
  1060 	PSIF_MONITOR_TRIG,
  1020 	PSIF_MONITOR_REARM,
  1061 	PSIF_MONITOR_REARM,
  1021 	PSIF_MONITOR_INACTIVE,
  1062 	PSIF_MONITOR_INACTIVE,
  1022 	PSIF_MONITOR_ERROR,
  1063 	PSIF_MONITOR_ERROR,
  1023 	/* Padding out to required bits allocated */
  1064 	/* Padding out to required bits allocated */
  1024 	PSIF_EPSC_MONITOR_FIELD_MAX	 = 0xf
  1065 	PSIF_EPSC_MONITOR_FIELD_MAX	 = 0xfu
  1025 }; /* enum psif_epsc_monitor [ 4 bits] */
  1066 }; /* enum psif_epsc_monitor [ 4 bits] */
       
  1067 
       
  1068 
       
  1069 enum psif_epsc_log_mode {
       
  1070 /* Logging completely disabled */
       
  1071 
       
  1072 	EPSC_LOG_MODE_OFF	 = 0u,
       
  1073 /* See epsfw/src/include/logging.h */
       
  1074 
       
  1075 	EPSC_LOG_MODE_SCAT	 = 0x1u,
       
  1076 	EPSC_LOG_MODE_MALLOC	 = 0x2u,
       
  1077 	EPSC_LOG_MODE_LOCAL	 = 0x3u,
       
  1078 /* Redirect logging to host (dma) */
       
  1079 
       
  1080 	EPSC_LOG_MODE_HOST	 = 0x4u,
       
  1081 /* Save the set log mode in the flash */
       
  1082 
       
  1083 	EPSC_LOG_MODE_SAVE	 = 0x10u,
       
  1084 	/* Padding out to required bits allocated */
       
  1085 	PSIF_EPSC_LOG_MODE_FIELD_MAX	 = 0x7fffffffu
       
  1086 }; /* enum psif_epsc_log_mode [32 bits] */
       
  1087 
       
  1088 /**
       
  1089  * EPSC_LOG_CTRL
       
  1090  */
       
  1091 enum psif_epsc_log_level {
       
  1092 	EPS_LOG_OFF	 = 0u,
       
  1093 	EPS_LOG_FATAL	 = 0x1u,
       
  1094 	EPS_LOG_ERROR	 = 0x2u,
       
  1095 	EPS_LOG_WARN	 = 0x3u,
       
  1096 	EPS_LOG_INFO	 = 0x4u,
       
  1097 	EPS_LOG_DEBUG	 = 0x5u,
       
  1098 	EPS_LOG_TRACE	 = 0x6u,
       
  1099 	EPS_LOG_ALL	 = 0x7u,
       
  1100 	/* Padding out to required bits allocated */
       
  1101 	PSIF_EPSC_LOG_LEVEL_FIELD_MAX	 = 0x7fffffffu
       
  1102 }; /* enum psif_epsc_log_level [32 bits] */
  1026 
  1103 
  1027 /**
  1104 /**
  1028  * \brief Interrupt sources definitions as bit indexes.
  1105  * \brief Interrupt sources definitions as bit indexes.
  1029  * \details
  1106  * \details
  1030  * In a mask the active interrupt sources are represented by set bits
  1107  * In a mask the active interrupt sources are represented by set bits
  1126 	/** HCA atomicity guarantee */
  1203 	/** HCA atomicity guarantee */
  1127 	EPSC_ATOMIC_HCA,
  1204 	EPSC_ATOMIC_HCA,
  1128 	/** global atomicity guarantee */
  1205 	/** global atomicity guarantee */
  1129 	EPSC_ATOMIC_GLOB,
  1206 	EPSC_ATOMIC_GLOB,
  1130 	/* Padding out to required bits allocated */
  1207 	/* Padding out to required bits allocated */
  1131 	PSIF_EPSC_ATOMIC_CAP_FIELD_MAX	 = 0x7fffffff
  1208 	PSIF_EPSC_ATOMIC_CAP_FIELD_MAX	 = 0x7fffffffu
  1132 }; /* enum psif_epsc_atomic_cap [32 bits] */
  1209 }; /* enum psif_epsc_atomic_cap [32 bits] */
  1133 
  1210 
  1134 /**
  1211 /**
  1135  * \brief The EPS-C FW status return codes
  1212  * \brief The EPS-C FW status return codes
  1136  * \details These error codes are retured from the EPS-C.
  1213  * \details These error codes are retured from the EPS-C.
  1141  * \par Classification
  1218  * \par Classification
  1142  *      external, driver
  1219  *      external, driver
  1143  */
  1220  */
  1144 enum psif_epsc_csr_status {
  1221 enum psif_epsc_csr_status {
  1145 	/** Successful exit status. */
  1222 	/** Successful exit status. */
  1146 	EPSC_SUCCESS	 = 0,
  1223 	EPSC_SUCCESS	 = 0u,
  1147 	/** Key was rejected by service. */
  1224 	/** Key was rejected by service. */
  1148 	EPSC_EKEYREJECTED	 = 0x1,
  1225 	EPSC_EKEYREJECTED	 = 0x1u,
  1149 	/** Cannot assign requested address. */
  1226 	/** Cannot assign requested address. */
  1150 	EPSC_EADDRNOTAVAIL	 = 0x2,
  1227 	EPSC_EADDRNOTAVAIL	 = 0x2u,
  1151 	/** Operation not supported on transport endpoint. */
  1228 	/** Operation not supported on transport endpoint. */
  1152 	EPSC_EOPNOTSUPP	 = 0x3,
  1229 	EPSC_EOPNOTSUPP	 = 0x3u,
  1153 	/** Out of memory. */
  1230 	/** Out of memory. */
  1154 	EPSC_ENOMEM	 = 0x4,
  1231 	EPSC_ENOMEM	 = 0x4u,
  1155 	/** No data available. */
  1232 	/** No data available. */
  1156 	EPSC_ENODATA	 = 0x5,
  1233 	EPSC_ENODATA	 = 0x5u,
  1157 	/** Try again. */
  1234 	/** Try again. */
  1158 	EPSC_EAGAIN	 = 0x6,
  1235 	EPSC_EAGAIN	 = 0x6u,
  1159 	/** Operation canceled. */
  1236 	/** Operation canceled. */
  1160 	EPSC_ECANCELED	 = 0x7,
  1237 	EPSC_ECANCELED	 = 0x7u,
  1161 	/** Connection reset by peer. */
  1238 	/** Connection reset by peer. */
  1162 	EPSC_ECONNRESET	 = 0x8,
  1239 	EPSC_ECONNRESET	 = 0x8u,
  1163 	/** CSR operation failed. */
  1240 	/** CSR operation failed. */
  1164 	EPSC_ECSR	 = 0x9,
  1241 	EPSC_ECSR	 = 0x9u,
  1165 	/** Modify queue pair error: QP index out of range. */
  1242 	/** Modify queue pair error: QP index out of range. */
  1166 	EPSC_MODIFY_QP_OUT_OF_RANGE	 = 0xa,
  1243 	EPSC_MODIFY_QP_OUT_OF_RANGE	 = 0xau,
  1167 	/** Modify queue pair error: QP is invalid. */
  1244 	/** Modify queue pair error: QP is invalid. */
  1168 	EPSC_MODIFY_QP_INVALID	 = 0xb,
  1245 	EPSC_MODIFY_QP_INVALID	 = 0xbu,
  1169 	/** Modify queue pair error: failed to change QP attribute. */
  1246 	/** Modify queue pair error: failed to change QP attribute. */
  1170 	EPSC_MODIFY_CANNOT_CHANGE_QP_ATTR	 = 0xc,
  1247 	EPSC_MODIFY_CANNOT_CHANGE_QP_ATTR	 = 0xcu,
  1171 	/** Modify queue pair error: failed to change QP due to invalid or not matching state. */
  1248 	/** Modify queue pair error: failed to change QP due to invalid or not matching state. */
  1172 	EPSC_MODIFY_INVALID_QP_STATE	 = 0xd,
  1249 	EPSC_MODIFY_INVALID_QP_STATE	 = 0xdu,
  1173 	/** Modify queue pair error: failed to change QP due to invalid or not matching migration state. */
  1250 	/** Modify queue pair error: failed to change QP due to invalid or not matching migration state. */
  1174 	EPSC_MODIFY_INVALID_MIG_STATE	 = 0xe,
  1251 	EPSC_MODIFY_INVALID_MIG_STATE	 = 0xeu,
  1175 	/** Modify queue pair error: the operation timed out. */
  1252 	/** Modify queue pair error: the operation timed out. */
  1176 	EPSC_MODIFY_TIMEOUT	 = 0xf,
  1253 	EPSC_MODIFY_TIMEOUT	 = 0xfu,
  1177 	/** DMA test failure in HEAD. */
  1254 	/** DMA test failure in HEAD. */
  1178 	EPSC_ETEST_HEAD	 = 0x10,
  1255 	EPSC_ETEST_HEAD	 = 0x10u,
  1179 	/** DMA test failure in TAIL. */
  1256 	/** DMA test failure in TAIL. */
  1180 	EPSC_ETEST_TAIL	 = 0x11,
  1257 	EPSC_ETEST_TAIL	 = 0x11u,
  1181 	/** DMA test failure in PATTERN. */
  1258 	/** DMA test failure in PATTERN. */
  1182 	EPSC_ETEST_PATTERN	 = 0x12,
  1259 	EPSC_ETEST_PATTERN	 = 0x12u,
  1183 	/** Multicast address already exist. */
  1260 	/** Multicast address already exist. */
  1184 	EPSC_EADDRINUSE	 = 0x13,
  1261 	EPSC_EADDRINUSE	 = 0x13u,
  1185 	/** vHCA out of range */
  1262 	/** vHCA out of range */
  1186 	EPSC_EINVALID_VHCA	 = 0x14,
  1263 	EPSC_EINVALID_VHCA	 = 0x14u,
  1187 	/** Port out of range */
  1264 	/** Port out of range */
  1188 	EPSC_EINVALID_PORT	 = 0x15,
  1265 	EPSC_EINVALID_PORT	 = 0x15u,
  1189 	/** Address out of range */
  1266 	/** Address out of range */
  1190 	EPSC_EINVALID_ADDRESS	 = 0x16,
  1267 	EPSC_EINVALID_ADDRESS	 = 0x16u,
  1191 	/** Parameter out of range */
  1268 	/** Parameter out of range */
  1192 	EPSC_EINVALID_PARAMETER	 = 0x17,
  1269 	EPSC_EINVALID_PARAMETER	 = 0x17u,
  1193 	/** General failure. */
  1270 	/** General failure. */
  1194 	EPSC_FAIL	 = 0xff
  1271 	EPSC_FAIL	 = 0xffu
  1195 }; /* enum psif_epsc_csr_status [ 8 bits] */
  1272 }; /* enum psif_epsc_csr_status [ 8 bits] */
  1196 
  1273 
  1197 /**
  1274 /**
  1198  * \brief Host to EPS operation codes
  1275  * \brief Host to EPS operation codes
  1199  * \details
  1276  * \details
  1224  *   current value of \ref EPSC_LAST_OP and the value of \ref EPSC_LAST_OP
  1301  *   current value of \ref EPSC_LAST_OP and the value of \ref EPSC_LAST_OP
  1225  *   must be incremented by the number of newly inserted codes.
  1302  *   must be incremented by the number of newly inserted codes.
  1226  */
  1303  */
  1227 enum psif_epsc_csr_opcode {
  1304 enum psif_epsc_csr_opcode {
  1228 	/** Not a valid operation code. */
  1305 	/** Not a valid operation code. */
  1229 	EPSC_NOOP	 = 0,
  1306 	EPSC_NOOP	 = 0u,
  1230 	/** EPS-C ping over mailbox. */
  1307 	/** EPS-C ping over mailbox. */
  1231 	EPSC_MAILBOX_PING	 = 0x4c,
  1308 	EPSC_MAILBOX_PING	 = 0x4cu,
  1232 	/** Host patting of EPS-C SW watch-dog. */
  1309 	/** Host patting of EPS-C SW watch-dog. */
  1233 	EPSC_KEEP_ALIVE	 = 0x4d,
  1310 	EPSC_KEEP_ALIVE	 = 0x4du,
  1234 	/** Initial configuration request per UF.
  1311 	/** Initial configuration request per UF.
  1235 	 * This request is transferred from the host to the epsc at driver
  1312 	 * This request is transferred from the host to the epsc at driver
  1236 	 * attach using an encoding of the physical mailbox register. It
  1313 	 * attach using an encoding of the physical mailbox register. It
  1237 	 * is not a legal request on an operational mailbox communication
  1314 	 * is not a legal request on an operational mailbox communication
  1238 	 *
  1315 	 *
  1261 	 * \par Restrictions
  1338 	 * \par Restrictions
  1262 	 *      none (all UF)
  1339 	 *      none (all UF)
  1263 	 * \par Classification
  1340 	 * \par Classification
  1264 	 *      driver
  1341 	 *      driver
  1265 	 */
  1342 	 */
  1266 	EPSC_SETUP	 = 0x1,
  1343 	EPSC_SETUP	 = 0x1u,
  1267 	/** Final de-configuration request.
  1344 	/** Final de-configuration request.
  1268 	 * This request is sent from the host driver to indicate that it has
  1345 	 * This request is sent from the host driver to indicate that it has
  1269 	 * cleaned up all queues and flushed caches associated with the current
  1346 	 * cleaned up all queues and flushed caches associated with the current
  1270 	 * UF. It is the last command for that UF and the firmware will take down
  1347 	 * UF. It is the last command for that UF and the firmware will take down
  1271 	 * the associated virtual links and mailbox settings. For further
  1348 	 * the associated virtual links and mailbox settings. For further
  1279 	 * \par Restrictions
  1356 	 * \par Restrictions
  1280 	 *      none (all UF)
  1357 	 *      none (all UF)
  1281 	 * \par Classification
  1358 	 * \par Classification
  1282 	 *      driver
  1359 	 *      driver
  1283 	 */
  1360 	 */
  1284 	EPSC_TEARDOWN	 = 0x36,
  1361 	EPSC_TEARDOWN	 = 0x36u,
  1285 	/** Operation code for a general set request.
  1362 	/** Operation code for a general set request.
  1286 	 * The request usees the same parameter structure as the \ref EPSC_QUERY
  1363 	 * The request usees the same parameter structure as the \ref EPSC_QUERY
  1287 	 * request. Upon recieve the mailbox thread first processes the set request
  1364 	 * request. Upon receive the mailbox thread first processes the set request
  1288 	 * in \ref psif_epsc_csr_query_t::info and then the request in
  1365 	 * in \ref psif_epsc_csr_query_t::info and then the request in
  1289 	 * \ref psif_epsc_csr_query_t::data. Both members are of type
  1366 	 * \ref psif_epsc_csr_query_t::data. Both members are of type
  1290 	 * \ref psif_epsc_query_req_t and have their own sub-operation codes in
  1367 	 * \ref psif_epsc_query_req_t and have their own sub-operation codes in
  1291 	 * \ref psif_epsc_query_req_t::op (of type \ref psif_epsc_query_op_t).
  1368 	 * \ref psif_epsc_query_req_t::op (of type \ref psif_epsc_query_op_t).
  1292 	 * Therefore requests instantiating only one set attribute
  1369 	 * Therefore requests instantiating only one set attribute
  1304 	 * \par Restrictions
  1381 	 * \par Restrictions
  1305 	 *      none (all UF)
  1382 	 *      none (all UF)
  1306 	 * \par Classification
  1383 	 * \par Classification
  1307 	 *      external
  1384 	 *      external
  1308 	 */
  1385 	 */
  1309 	EPSC_SET	 = 0x46,
  1386 	EPSC_SET	 = 0x46u,
  1310 	/** Operation code for a single CSR write request.
  1387 	/** Operation code for a single CSR write request.
  1311 	 * \note
  1388 	 * \note
  1312 	 * The request is deprecated and will be removed as soon as all
  1389 	 * The request is deprecated and will be removed as soon as all
  1313 	 * references to this opcode have been cleaned up.
  1390 	 * references to this opcode have been cleaned up.
  1314 	 * \par Return Codes
  1391 	 * \par Return Codes
  1315 	 *      \ref EPSC_EADDRNOTAVAIL
  1392 	 *      \ref EPSC_EADDRNOTAVAIL
  1316 	 */
  1393 	 */
  1317 	EPSC_SET_SINGLE	 = 0x2,
  1394 	EPSC_SET_SINGLE	 = 0x2u,
  1318 	/** Operation code for setting an arbitrary CSR.
  1395 	/** Operation code for setting an arbitrary CSR.
  1319 	 * \note
  1396 	 * \note
  1320 	 * The request is used mainly for debugging tools and will be either removed
  1397 	 * The request is used mainly for debugging tools and will be either removed
  1321 	 * completely or limited to certain register addresses.
  1398 	 * completely or limited to certain register addresses.
  1322 	 *
  1399 	 *
  1338 	 * \par Restrictions
  1415 	 * \par Restrictions
  1339 	 *      valid register addresses depend on UF
  1416 	 *      valid register addresses depend on UF
  1340 	 * \par Classification
  1417 	 * \par Classification
  1341 	 *      driver, development
  1418 	 *      driver, development
  1342 	 */
  1419 	 */
  1343 	EPSC_SET_ONE_CSR	 = 0x3,
  1420 	EPSC_SET_ONE_CSR	 = 0x3u,
  1344 	/** Old operation code to set up a descriptor base address.
  1421 	/** Old operation code to set up a descriptor base address.
  1345 	 * \note
  1422 	 * \note
  1346 	 * The request is deprecated and will be removed as soon as all
  1423 	 * The request is deprecated and will be removed as soon as all
  1347 	 * references to this opcode have been cleaned up.
  1424 	 * references to this opcode have been cleaned up.
  1348 	 *
  1425 	 *
  1349 	 * \par Return Codes
  1426 	 * \par Return Codes
  1350 	 *      \ref EPSC_EADDRNOTAVAIL
  1427 	 *      \ref EPSC_EADDRNOTAVAIL
  1351 	 * \par Classification
  1428 	 * \par Classification
  1352 	 *      driver
  1429 	 *      driver
  1353 	 */
  1430 	 */
  1354 	EPSC_SETUP_BASEADDR	 = 0x4,
  1431 	EPSC_SETUP_BASEADDR	 = 0x4u,
  1355 	/** Operation code to set up a descriptor base address.
  1432 	/** Operation code to set up a descriptor base address.
  1356 	 * With this request the driver configures the descriptor base addresses
  1433 	 * With this request the driver configures the descriptor base addresses
  1357 	 * of queues, queue pairs and address handles.
  1434 	 * of queues, queue pairs and address handles.
  1358 	 *
  1435 	 *
  1359 	 * \par Request
  1436 	 * \par Request
  1368 	 * \par Restrictions
  1445 	 * \par Restrictions
  1369 	 *      none (all UF)
  1446 	 *      none (all UF)
  1370 	 * \par Classification
  1447 	 * \par Classification
  1371 	 *      driver, development
  1448 	 *      driver, development
  1372 	 */
  1449 	 */
  1373 	EPSC_SET_BASEADDR	 = 0x5,
  1450 	EPSC_SET_BASEADDR	 = 0x5u,
  1374 	/** Operation code to set up an event queue (EQ).
  1451 	/** Operation code to set up an event queue (EQ).
  1375 	 * With this request the driver configures an EQ descriptor base address
  1452 	 * With this request the driver configures an EQ descriptor base address
  1376 	 * as well as the associated interrupt.
  1453 	 * as well as the associated interrupt.
  1377 	 *
  1454 	 *
  1378 	 * \par Request
  1455 	 * \par Request
  1387 	 * \par Restrictions
  1464 	 * \par Restrictions
  1388 	 *      none (all UF)
  1465 	 *      none (all UF)
  1389 	 * \par Classification
  1466 	 * \par Classification
  1390 	 *      driver
  1467 	 *      driver
  1391 	 */
  1468 	 */
  1392 	EPSC_SET_BASEADDR_EQ	 = 0x6,
  1469 	EPSC_SET_BASEADDR_EQ	 = 0x6u,
  1393 	/* Set Local ID for UF (backdoor) */
  1470 	/* Set Local ID for UF (backdoor) */
  1394 	EPSC_SET_LID	 = 0x7,
  1471 	EPSC_SET_LID	 = 0x7u,
  1395 	OBSOLETE_1	 = 0x8,
  1472 	OBSOLETE_1	 = 0x8u,
  1396 	OBSOLETE_2	 = 0x9,
  1473 	OBSOLETE_2	 = 0x9u,
  1397 	/* Set Global ID for UF (backdoor) */
  1474 	/* Set Global ID for UF (backdoor) */
  1398 	EPSC_SET_GID	 = 0xa,
  1475 	EPSC_SET_GID	 = 0xau,
  1399 	/* Set EoIB MAC address (backdoor) */
  1476 	/* Set EoIB MAC address (backdoor) */
  1400 	EPSC_SET_EOIB_MAC	 = 0x40,
  1477 	EPSC_SET_EOIB_MAC	 = 0x40u,
  1401 	/* Set Vlink state */
  1478 	/* Set Vlink state */
  1402 	EPSC_SET_VLINK_STATE	 = 0xb,
  1479 	EPSC_SET_VLINK_STATE	 = 0xbu,
  1403 	/* Get Vlink state */
  1480 	/* Get Vlink state */
  1404 	EPSC_QUERY_VLINK_STATE	 = 0xc,
  1481 	EPSC_QUERY_VLINK_STATE	 = 0xcu,
  1405 	/* Reset UF at startup */
  1482 	/* Reset UF at startup */
  1406 	EPSC_UF_RESET	 = 0xd,
  1483 	EPSC_UF_RESET	 = 0xdu,
  1407 	/* Modify QP complete w/kick */
  1484 	/* Modify QP complete w/kick */
  1408 	EPSC_MODIFY_QP	 = 0xe,
  1485 	EPSC_MODIFY_QP	 = 0xeu,
  1409 	/* Get single 64bit register - depricated */
  1486 	/* Get single 64bit register - deprecated */
  1410 	EPSC_GET_SINGLE	 = 0xf,
  1487 	EPSC_GET_SINGLE	 = 0xfu,
  1411 	/* Get one 64bit register using CSR addr */
  1488 	/* Get one 64bit register using CSR addr */
  1412 	EPSC_GET_ONE_CSR	 = 0x10,
  1489 	EPSC_GET_ONE_CSR	 = 0x10u,
  1413 	/* Query QP sub-entry */
  1490 	/* Query QP sub-entry */
  1414 	EPSC_QUERY_QP	 = 0x11,
  1491 	EPSC_QUERY_QP	 = 0x11u,
  1415 	/** Query HW receive queue. */
  1492 	/** Query HW receive queue. */
  1416 	EPSC_QUERY_HW_RQ	 = 0x42,
  1493 	EPSC_QUERY_HW_RQ	 = 0x42u,
  1417 	/** Query HW SQ. */
  1494 	/** Query HW SQ. */
  1418 	EPSC_QUERY_HW_SQ	 = 0x43,
  1495 	EPSC_QUERY_HW_SQ	 = 0x43u,
  1419 	/* Non-MAD query device */
  1496 	/* Non-MAD query device */
  1420 	EPSC_QUERY_DEVICE	 = 0x12,
  1497 	EPSC_QUERY_DEVICE	 = 0x12u,
  1421 	/* Non-MAD query port */
  1498 	/* Non-MAD query port */
  1422 	EPSC_QUERY_PORT_1	 = 0x13,
  1499 	EPSC_QUERY_PORT_1	 = 0x13u,
  1423 	EPSC_QUERY_PORT_2	 = 0x14,
  1500 	EPSC_QUERY_PORT_2	 = 0x14u,
  1424 	/* Non-MAD SMA attribute query */
  1501 	/* Non-MAD SMA attribute query */
  1425 	EPSC_QUERY_PKEY	 = 0x15,
  1502 	EPSC_QUERY_PKEY	 = 0x15u,
  1426 	EPSC_QUERY_GID	 = 0x16,
  1503 	EPSC_QUERY_GID	 = 0x16u,
  1427 	/* Non-MAD SMA attribute setting */
  1504 	/* Non-MAD SMA attribute setting */
  1428 	EPSC_MODIFY_DEVICE	 = 0x17,
  1505 	EPSC_MODIFY_DEVICE	 = 0x17u,
  1429 	EPSC_MODIFY_PORT_1	 = 0x18,
  1506 	EPSC_MODIFY_PORT_1	 = 0x18u,
  1430 	EPSC_MODIFY_PORT_2	 = 0x19,
  1507 	EPSC_MODIFY_PORT_2	 = 0x19u,
  1431 	/* Local MC subscription handling */
  1508 	/* Local MC subscription handling */
  1432 	EPSC_MC_ATTACH	 = 0x1a,
  1509 	EPSC_MC_ATTACH	 = 0x1au,
  1433 	EPSC_MC_DETACH	 = 0x1b,
  1510 	EPSC_MC_DETACH	 = 0x1bu,
  1434 	EPSC_MC_QUERY	 = 0x1c,
  1511 	EPSC_MC_QUERY	 = 0x1cu,
  1435 	/* Handle asynchronous events */
  1512 	/* Handle asynchronous events */
  1436 	EPSC_EVENT_ACK	 = 0x1d,
  1513 	EPSC_EVENT_ACK	 = 0x1du,
  1437 	EPSC_EVENT_INDEX	 = 0x1e,
  1514 	EPSC_EVENT_INDEX	 = 0x1eu,
  1438 	/* Program flash content */
  1515 	/* Program flash content */
  1439 	EPSC_FLASH_START	 = 0x1f,
  1516 	EPSC_FLASH_START	 = 0x1fu,
  1440 	EPSC_FLASH_INFO	 = 0x20,
  1517 	EPSC_FLASH_INFO	 = 0x20u,
  1441 	EPSC_FLASH_ERASE_SECTOR	 = 0x21,
  1518 	EPSC_FLASH_ERASE_SECTOR	 = 0x21u,
  1442 	EPSC_FLASH_RD	 = 0x22,
  1519 	EPSC_FLASH_RD	 = 0x22u,
  1443 	EPSC_FLASH_WR	 = 0x23,
  1520 	EPSC_FLASH_WR	 = 0x23u,
  1444 	EPSC_FLASH_CHECK	 = 0x24,
  1521 	EPSC_FLASH_CHECK	 = 0x24u,
  1445 	EPSC_FLASH_SCAN	 = 0x25,
  1522 	EPSC_FLASH_SCAN	 = 0x25u,
  1446 	EPSC_FLASH_STOP	 = 0x26,
  1523 	EPSC_FLASH_STOP	 = 0x26u,
  1447 	/* new update handling */
  1524 	/* new update handling */
  1448 	EPSC_UPDATE	 = 0x47,
  1525 	EPSC_UPDATE	 = 0x47u,
  1449 	/* IB packet tracer */
  1526 	/* IB packet tracer */
  1450 	EPSC_TRACE_STATUS	 = 0x27,
  1527 	EPSC_TRACE_STATUS	 = 0x27u,
  1451 	EPSC_TRACE_SETUP	 = 0x28,
  1528 	EPSC_TRACE_SETUP	 = 0x28u,
  1452 	EPSC_TRACE_START	 = 0x29,
  1529 	EPSC_TRACE_START	 = 0x29u,
  1453 	EPSC_TRACE_STOP	 = 0x2a,
  1530 	EPSC_TRACE_STOP	 = 0x2au,
  1454 	EPSC_TRACE_ACQUIRE	 = 0x2b,
  1531 	EPSC_TRACE_ACQUIRE	 = 0x2bu,
  1455 	/* Test operations */
  1532 	/* Test operations */
  1456 	EPSC_TEST_HOST_RD	 = 0x2c,
  1533 	EPSC_TEST_HOST_RD	 = 0x2cu,
  1457 	EPSC_TEST_HOST_WR	 = 0x2d,
  1534 	EPSC_TEST_HOST_WR	 = 0x2du,
  1458 	/* Get EPS-C version details */
  1535 	/* Get EPS-C version details */
  1459 	EPSC_FW_VERSION	 = 0x2e,
  1536 	EPSC_FW_VERSION	 = 0x2eu,
  1460 	/* Redirection/configuration of EPSC's internal log subsystem */
  1537 	/* Redirection/configuration of EPSC's internal log subsystem */
  1461 	EPSC_LOG_CTRL	 = 0x2f,
  1538 	EPSC_LOG_CTRL	 = 0x2fu,
  1462 	EPSC_LOG_REQ_NOTIFY	 = 0x30,
  1539 	EPSC_LOG_REQ_NOTIFY	 = 0x30u,
  1463 	/* Force & read back link speed */
  1540 	/* Force & read back link speed */
  1464 	EPSC_LINK_CNTRL	 = 0x31,
  1541 	EPSC_LINK_CNTRL	 = 0x31u,
  1465 	/* EPS-A control & communication (to EPS-C) */
  1542 	/* EPS-A control & communication (to EPS-C) */
  1466 	EPSC_A_CONTROL	 = 0x33,
  1543 	EPSC_A_CONTROL	 = 0x33u,
  1467 	/* EPS-A targeted commands (to EPS-A) */
  1544 	/* EPS-A targeted commands (to EPS-A) */
  1468 	EPSC_A_COMMAND	 = 0x35,
  1545 	EPSC_A_COMMAND	 = 0x35u,
  1469 	/* Exercise mmu with access from epsc */
  1546 	/* Exercise mmu with access from epsc */
  1470 	EPSC_EXERCISE_MMU	 = 0x34,
  1547 	EPSC_EXERCISE_MMU	 = 0x34u,
  1471 	/* Access to EPS-C CLI */
  1548 	/* Access to EPS-C CLI */
  1472 	EPSC_CLI_ACCESS	 = 0x37,
  1549 	EPSC_CLI_ACCESS	 = 0x37u,
  1473 	/* IB packet proxy to/from host */
  1550 	/* IB packet proxy to/from host */
  1474 	EPSC_MAD_PROCESS	 = 0x38,
  1551 	EPSC_MAD_PROCESS	 = 0x38u,
  1475 	EPSC_MAD_SEND_WR	 = 0x39,
  1552 	EPSC_MAD_SEND_WR	 = 0x39u,
  1476 	/** Generic query epsc interface. */
  1553 	/** Generic query epsc interface. */
  1477 	EPSC_QUERY	 = 0x41,
  1554 	EPSC_QUERY	 = 0x41u,
  1478 	/* Setup interrupt coalescing etc. */
  1555 	/* Setup interrupt coalescing etc. */
  1479 	EPSC_HOST_INT_COMMON_CTRL	 = 0x44,
  1556 	EPSC_HOST_INT_COMMON_CTRL	 = 0x44u,
  1480 	EPSC_HOST_INT_CHANNEL_CTRL	 = 0x45,
  1557 	EPSC_HOST_INT_CHANNEL_CTRL	 = 0x45u,
  1481 	/** UF control depends on \ref psif_epsc_csr_uf_ctrl_t::opcode. */
  1558 	/** UF control depends on \ref psif_epsc_csr_uf_ctrl_t::opcode. */
  1482 	EPSC_UF_CTRL	 = 0x48,
  1559 	EPSC_UF_CTRL	 = 0x48u,
  1483 	/* Flush MMU and-or PTW Caches */
  1560 	/* Flush MMU and-or PTW Caches */
  1484 	EPSC_FLUSH_CACHES	 = 0x49,
  1561 	EPSC_FLUSH_CACHES	 = 0x49u,
  1485 	/* Query PMA counters - alternative path to sending MAD's */
  1562 	/* Query PMA counters - alternative path to sending MAD's */
  1486 	EPSC_PMA_COUNTERS	 = 0x4a,
  1563 	EPSC_PMA_COUNTERS	 = 0x4au,
  1487 	/** VIMMA operations depends on \ref psif_epsc_csr_vimma_ctrl_t::opcode. */
  1564 	/** VIMMA operations depends on \ref psif_epsc_csr_vimma_ctrl_t::opcode. */
  1488 	EPSC_VIMMA_CTRL	 = 0x4b,
  1565 	EPSC_VIMMA_CTRL	 = 0x4bu,
       
  1566 	/* EPSC BER (Bit Error Report) Data */
       
  1567 	EPSC_BER_DATA	 = 0x4eu,
  1489 	/** EOF marker - must be last and highest in this enum type. */
  1568 	/** EOF marker - must be last and highest in this enum type. */
  1490 	EPSC_LAST_OP	 = 0x4e,
  1569 	EPSC_LAST_OP	 = 0x4fu,
  1491 	/* Padding out to required bits allocated */
  1570 	/* Padding out to required bits allocated */
  1492 	PSIF_EPSC_CSR_OPCODE_FIELD_MAX	 = 0xff
  1571 	PSIF_EPSC_CSR_OPCODE_FIELD_MAX	 = 0xffu
  1493 }; /* enum psif_epsc_csr_opcode [ 8 bits] */
  1572 }; /* enum psif_epsc_csr_opcode [ 8 bits] */
  1494 
  1573 
  1495 /**
  1574 /**
  1496  * The eps-c fw csr flags
  1575  * The eps-c fw csr flags
  1497  */
  1576  */
  1498 enum psif_epsc_csr_flags {
  1577 enum psif_epsc_csr_flags {
  1499 	EPSC_FL_NONE	 = 0,
  1578 	EPSC_FL_NONE	 = 0u,
  1500 	/* Request notification (interrupt) when completion is ready */
  1579 	/* Request notification (interrupt) when completion is ready */
  1501 	EPSC_FL_NOTIFY	 = 0x1,
  1580 	EPSC_FL_NOTIFY	 = 0x1u,
  1502 	/* Privileged QP indicator only valid for query and modify QP */
  1581 	/* Privileged QP indicator only valid for query and modify QP */
  1503 	EPSC_FL_PQP	 = 0x2,
  1582 	EPSC_FL_PQP	 = 0x2u,
  1504 	/* Allways report opertion success */
  1583 	/* Allways report opertion success */
  1505 	EPSC_FL_IGNORE_ERROR	 = 0x4,
  1584 	EPSC_FL_IGNORE_ERROR	 = 0x4u,
  1506 	/* Padding out to required bits allocated */
  1585 	/* Padding out to required bits allocated */
  1507 	PSIF_EPSC_CSR_FLAGS_FIELD_MAX	 = 0xff
  1586 	PSIF_EPSC_CSR_FLAGS_FIELD_MAX	 = 0xffu
  1508 }; /* enum psif_epsc_csr_flags [ 8 bits] */
  1587 }; /* enum psif_epsc_csr_flags [ 8 bits] */
  1509 
  1588 
  1510 /*
  1589 /*
  1511  * Link states for the virtual HCA and switch. The following onehot encoded
  1590  * Link states for the virtual HCA and switch. The following onehot encoded
  1512  * states exist: PSIF_LINK_DISABLED = 1 PSIF_LINK_DOWN = 2 PSIF_LINK_INIT = 4
  1591  * states exist: PSIF_LINK_DISABLED = 1 PSIF_LINK_DOWN = 2 PSIF_LINK_INIT = 4
  1513  * PSIF_LINK_ARM = 8 PSIF_LINK_ACTIVE = 16
  1592  * PSIF_LINK_ARM = 8 PSIF_LINK_ACTIVE = 16
  1514  */
  1593  */
  1515 enum psif_vlink_state {
  1594 enum psif_vlink_state {
  1516 	PSIF_LINK_DISABLED	 = 0x1,
  1595 	PSIF_LINK_DISABLED	 = 0x1u,
  1517 	PSIF_LINK_DOWN	 = 0x2,
  1596 	PSIF_LINK_DOWN	 = 0x2u,
  1518 	PSIF_LINK_INIT	 = 0x4,
  1597 	PSIF_LINK_INIT	 = 0x4u,
  1519 	PSIF_LINK_ARM	 = 0x8,
  1598 	PSIF_LINK_ARM	 = 0x8u,
  1520 	PSIF_LINK_ACTIVE	 = 0x10
  1599 	PSIF_LINK_ACTIVE	 = 0x10u
  1521 }; /* enum psif_vlink_state [ 5 bits] */
  1600 }; /* enum psif_vlink_state [ 5 bits] */
  1522 
  1601 
  1523 /**
  1602 /**
  1524  * EPSC_MODIFY_DEVICE operations
  1603  * EPSC_MODIFY_DEVICE operations
  1525  */
  1604  */
  1526 enum psif_epsc_csr_modify_device_flags {
  1605 enum psif_epsc_csr_modify_device_flags {
  1527 	PSIF_DEVICE_MODIFY_SYS_IMAGE_GUID	 = 0x1,
  1606 	PSIF_DEVICE_MODIFY_SYS_IMAGE_GUID	 = 0x1u,
  1528 	PSIF_DEVICE_MODIFY_NODE_DESC	 = 0x2,
  1607 	PSIF_DEVICE_MODIFY_NODE_DESC	 = 0x2u,
  1529 	/* Padding out to required bits allocated */
  1608 	/* Padding out to required bits allocated */
  1530 	PSIF_EPSC_CSR_MODIFY_DEVICE_FLAGS_FIELD_MAX	 = 0xffff
  1609 	PSIF_EPSC_CSR_MODIFY_DEVICE_FLAGS_FIELD_MAX	 = 0xffffu
  1531 }; /* enum psif_epsc_csr_modify_device_flags [16 bits] */
  1610 }; /* enum psif_epsc_csr_modify_device_flags [16 bits] */
  1532 
  1611 
  1533 /**
  1612 /**
  1534  * EPSC_MODIFY_PORT_{1,2} operations
  1613  * EPSC_MODIFY_PORT_{1,2} operations
  1535  */
  1614  */
  1536 enum psif_epsc_csr_modify_port_flags {
  1615 enum psif_epsc_csr_modify_port_flags {
  1537 	PSIF_PORT_SHUTDOWN	 = 0x1,
  1616 	PSIF_PORT_SHUTDOWN	 = 0x1u,
  1538 	PSIF_PORT_INIT_TYPE	 = 0x4,
  1617 	PSIF_PORT_INIT_TYPE	 = 0x4u,
  1539 	PSIF_PORT_RESET_QKEY_CNTR	 = 0x8,
  1618 	PSIF_PORT_RESET_QKEY_CNTR	 = 0x8u,
  1540 	PSIF_PORT_RESET_PKEY_CNTR	 = 0x10,
  1619 	PSIF_PORT_RESET_PKEY_CNTR	 = 0x10u,
  1541 	/* Padding out to required bits allocated */
  1620 	/* Padding out to required bits allocated */
  1542 	PSIF_EPSC_CSR_MODIFY_PORT_FLAGS_FIELD_MAX	 = 0xffff
  1621 	PSIF_EPSC_CSR_MODIFY_PORT_FLAGS_FIELD_MAX	 = 0xffffu
  1543 }; /* enum psif_epsc_csr_modify_port_flags [16 bits] */
  1622 }; /* enum psif_epsc_csr_modify_port_flags [16 bits] */
  1544 
  1623 
  1545 
  1624 
  1546 enum psif_epsc_csr_epsa_command {
  1625 enum psif_epsc_csr_epsa_command {
  1547 	EPSC_A_LOAD,
  1626 	EPSC_A_LOAD,
  1548 	EPSC_A_START,
  1627 	EPSC_A_START,
  1549 	EPSC_A_STOP,
  1628 	EPSC_A_STOP,
  1550 	EPSC_A_STATUS,
  1629 	EPSC_A_STATUS,
  1551 	/* Padding out to required bits allocated */
  1630 	/* Padding out to required bits allocated */
  1552 	PSIF_EPSC_CSR_EPSA_COMMAND_FIELD_MAX	 = 0x7fffffff
  1631 	PSIF_EPSC_CSR_EPSA_COMMAND_FIELD_MAX	 = 0x7fffffffu
  1553 }; /* enum psif_epsc_csr_epsa_command [32 bits] */
  1632 }; /* enum psif_epsc_csr_epsa_command [32 bits] */
  1554 
  1633 
  1555 /*
  1634 /*
  1556  */
  1635  */
  1557 enum psif_epsa_command {
  1636 enum psif_epsa_command {
  1564 	EPSA_TEST_SKJM_MEMLOCK,
  1643 	EPSA_TEST_SKJM_MEMLOCK,
  1565 	EPSA_SKJM_LOAD,
  1644 	EPSA_SKJM_LOAD,
  1566 	EPSA_SKJM_ACC,
  1645 	EPSA_SKJM_ACC,
  1567 	EPSA_SKJM_MEMACC,
  1646 	EPSA_SKJM_MEMACC,
  1568 	EPSA_GET_PROXY_QP_SQ_KEY,
  1647 	EPSA_GET_PROXY_QP_SQ_KEY,
  1569 	/* Padding out to required bits allocated */
  1648 	EPSA_GENERIC_CMD,
  1570 	PSIF_EPSA_COMMAND_FIELD_MAX	 = 0x7fffffff
  1649 	/* Padding out to required bits allocated */
       
  1650 	PSIF_EPSA_COMMAND_FIELD_MAX	 = 0x7fffffffu
  1571 }; /* enum psif_epsa_command [32 bits] */
  1651 }; /* enum psif_epsa_command [32 bits] */
  1572 
  1652 
  1573 /**
  1653 /**
  1574  * \brief Sub-operation codes as used by EPSC_QUERY and EPSC_SET requests.
  1654  * \brief Sub-operation codes as used by EPSC_QUERY and EPSC_SET requests.
  1575  * \details
  1655  * \details
  1579  *      psif_epsc_query_req member `op`
  1659  *      psif_epsc_query_req member `op`
  1580  * \par Classification
  1660  * \par Classification
  1581  *      internal, development
  1661  *      internal, development
  1582  */
  1662  */
  1583 enum psif_epsc_query_op {
  1663 enum psif_epsc_query_op {
  1584 	/** If initiated from a EPSC_QUERY this operation code will always return zero and report success.
  1664 	/** If initiated from a EPSC_QUERY this operation code will always return zero
  1585 	 *  In case of a intended set request (EPSC_SET) this operation code ignore the request and return success.
  1665 	 *  and report success. In case of a intended set request (EPSC_SET) this
       
  1666 	 *  operation code ignore the request and return success.
  1586 	 */
  1667 	 */
  1587 	EPSC_QUERY_BLANK	 = 0,
  1668 	EPSC_QUERY_BLANK	 = 0u,
  1588 	/* Obsolete - use EPSC_QUERY_CAP_VCB_{LO HI} */
  1669 	/* Obsolete - use EPSC_QUERY_CAP_VCB_{LO HI} */
  1589 	EPSC_QUERY_CAP_VCB	 = 0x1,
  1670 	EPSC_QUERY_CAP_VCB	 = 0x1u,
  1590 	/* Obsolete - use EPSC_QUERY_CAP_PCB_{LO HI} */
  1671 	/* Obsolete - use EPSC_QUERY_CAP_PCB_{LO HI} */
  1591 	EPSC_QUERY_CAP_PCB	 = 0x2,
  1672 	EPSC_QUERY_CAP_PCB	 = 0x2u,
  1592 	EPSC_QUERY_NUM_UF	 = 0x3,
  1673 	EPSC_QUERY_NUM_UF	 = 0x3u,
  1593 	EPSC_QUERY_GID_HI	 = 0x4,
  1674 	EPSC_QUERY_GID_HI	 = 0x4u,
  1594 	EPSC_QUERY_GID_LO	 = 0x5,
  1675 	EPSC_QUERY_GID_LO	 = 0x5u,
  1595 	EPSC_QUERY_P_KEY	 = 0x6,
  1676 	EPSC_QUERY_P_KEY	 = 0x6u,
  1596 	EPSC_QUERY_Q_KEY	 = 0x7,
  1677 	EPSC_QUERY_Q_KEY	 = 0x7u,
  1597 	EPSC_QUERY_UF	 = 0x8,
  1678 	EPSC_QUERY_UF	 = 0x8u,
  1598 	EPSC_QUERY_LINK_STATE	 = 0x9,
  1679 	EPSC_QUERY_LINK_STATE	 = 0x9u,
  1599 	EPSC_QUERY_VHCA_STATE	 = 0xa,
  1680 	EPSC_QUERY_VHCA_STATE	 = 0xau,
  1600 	/* Corresponds to register TSU_HOST_INT_CTRL_ADDR */
  1681 	/* Corresponds to register TSU_HOST_INT_CTRL_ADDR */
  1601 	EPSC_QUERY_INT_COMMON	 = 0xb,
  1682 	EPSC_QUERY_INT_COMMON	 = 0xbu,
  1602 	/* Corresponds to register TSU_HOST_INT_CHAN_CTRL_0 */
  1683 	/* Corresponds to register TSU_HOST_INT_CHAN_CTRL_0 */
  1603 	EPSC_QUERY_INT_CHAN_RATE	 = 0xc,
  1684 	EPSC_QUERY_INT_CHAN_RATE	 = 0xcu,
  1604 	/* Corresponds to register TSU_HOST_INT_CHAN_CTRL_1 */
  1685 	/* Corresponds to register TSU_HOST_INT_CHAN_CTRL_1 */
  1605 	EPSC_QUERY_INT_CHAN_AUSEC	 = 0xd,
  1686 	EPSC_QUERY_INT_CHAN_AUSEC	 = 0xdu,
  1606 	/* Corresponds to register TSU_HOST_INT_CHAN_CTRL_2 */
  1687 	/* Corresponds to register TSU_HOST_INT_CHAN_CTRL_2 */
  1607 	EPSC_QUERY_INT_CHAN_PUSEC	 = 0xe,
  1688 	EPSC_QUERY_INT_CHAN_PUSEC	 = 0xeu,
  1608 	/* Number of VCBs in PCI lo BAR */
  1689 	/* Number of VCBs in PCI lo BAR */
  1609 	EPSC_QUERY_CAP_VCB_LO	 = 0xf,
  1690 	EPSC_QUERY_CAP_VCB_LO	 = 0xfu,
  1610 	/* Number of VCBs in PCI hi BAR */
  1691 	/* Number of VCBs in PCI hi BAR */
  1611 	EPSC_QUERY_CAP_VCB_HI	 = 0x10,
  1692 	EPSC_QUERY_CAP_VCB_HI	 = 0x10u,
  1612 	/* Number of PCBs mapped to lo BAR VCBs */
  1693 	/* Number of PCBs mapped to lo BAR VCBs */
  1613 	EPSC_QUERY_CAP_PCB_LO	 = 0x11,
  1694 	EPSC_QUERY_CAP_PCB_LO	 = 0x11u,
  1614 	/* Number of PCBs mapped to hi BAR VCBs */
  1695 	/* Number of PCBs mapped to hi BAR VCBs */
  1615 	EPSC_QUERY_CAP_PCB_HI	 = 0x12,
  1696 	EPSC_QUERY_CAP_PCB_HI	 = 0x12u,
  1616 	/* psif_epsc_query_req.index = IB port number [1 2] */
  1697 	/*
  1617 	EPSC_QUERY_PMA_REDIRECT_QP	 = 0x13,
  1698 	 * QP number for EPS-C to forward PMA responces to host
       
  1699 	 * psif_epsc_query_req.index = IB port number [1,2]
       
  1700 	 */
       
  1701 	EPSC_QUERY_PMA_REDIRECT_QP	 = 0x13u,
  1618 	/* uptime in seconds */
  1702 	/* uptime in seconds */
  1619 	EPSC_QUERY_FW_UPTIME	 = 0x14,
  1703 	EPSC_QUERY_FW_UPTIME	 = 0x14u,
  1620 	/* date the firmware was programmed in epoch time */
  1704 	/* date the firmware was programmed in epoch time */
  1621 	EPSC_QUERY_FW_PROG_DATE	 = 0x15,
  1705 	EPSC_QUERY_FW_PROG_DATE	 = 0x15u,
  1622 	/* date the firmware was built in epoch time */
  1706 	/* date the firmware was built in epoch time */
  1623 	EPSC_QUERY_FW_BUILD_DATE	 = 0x16,
  1707 	EPSC_QUERY_FW_BUILD_DATE	 = 0x16u,
  1624 	/* current firmware image number (flash slot) */
  1708 	/* current firmware image number (flash slot) */
  1625 	EPSC_QUERY_FW_CURR_IMG	 = 0x17,
  1709 	EPSC_QUERY_FW_CURR_IMG	 = 0x17u,
  1626 	/* oneshot firmware image number (flash slot) */
  1710 	/* oneshot firmware image number (flash slot) */
  1627 	EPSC_QUERY_FW_ONESHOT_IMG	 = 0x18,
  1711 	EPSC_QUERY_FW_ONESHOT_IMG	 = 0x18u,
  1628 	/* autostart firmware image number (flash slot) */
  1712 	/* autostart firmware image number (flash slot) */
  1629 	EPSC_QUERY_FW_AUTOSTART_IMG	 = 0x19,
  1713 	EPSC_QUERY_FW_AUTOSTART_IMG	 = 0x19u,
  1630 	/* bit field encoding why the FW image was booted */
  1714 	/* bit field encoding why the FW image was booted */
  1631 	EPSC_QUERY_FW_START_CAUSE	 = 0x1a,
  1715 	EPSC_QUERY_FW_START_CAUSE	 = 0x1au,
  1632 	/* firmware version */
  1716 	/* firmware version */
  1633 	EPSC_QUERY_FW_VERSION	 = 0x1b,
  1717 	EPSC_QUERY_FW_VERSION	 = 0x1bu,
  1634 	/* Requester - number of bad response errors. */
  1718 	/* Requester - number of bad response errors. */
  1635 	EPSC_QUERY_SQ_NUM_BRE	 = 0x1c,
  1719 	EPSC_QUERY_SQ_NUM_BRE	 = 0x1cu,
  1636 	/* Requester - number of bad response errors. */
  1720 	/* Requester - number of bad response errors. */
  1637 	EPSC_QUERY_NUM_CQOVF	 = 0x1d,
  1721 	EPSC_QUERY_NUM_CQOVF	 = 0x1du,
  1638 	/* Requester - number of CQEs with status flushed in error. */
  1722 	/* Requester - number of CQEs with status flushed in error. */
  1639 	EPSC_QUERY_SQ_NUM_WRFE	 = 0x1e,
  1723 	EPSC_QUERY_SQ_NUM_WRFE	 = 0x1eu,
  1640 	/* Responder - number of CQEs with status flushed in error. */
  1724 	/* Responder - number of CQEs with status flushed in error. */
  1641 	EPSC_QUERY_RQ_NUM_WRFE	 = 0x1f,
  1725 	EPSC_QUERY_RQ_NUM_WRFE	 = 0x1fu,
  1642 	/* Responder - number of local access errors. */
  1726 	/* Responder - number of local access errors. */
  1643 	EPSC_QUERY_RQ_NUM_LAE	 = 0x20,
  1727 	EPSC_QUERY_RQ_NUM_LAE	 = 0x20u,
  1644 	/* Responder - number of local protection errors. */
  1728 	/* Responder - number of local protection errors. */
  1645 	EPSC_QUERY_RQ_NUM_LPE	 = 0x21,
  1729 	EPSC_QUERY_RQ_NUM_LPE	 = 0x21u,
  1646 	/* Requester - number of local length errors. */
  1730 	/* Requester - number of local length errors. */
  1647 	EPSC_QUERY_SQ_NUM_LLE	 = 0x22,
  1731 	EPSC_QUERY_SQ_NUM_LLE	 = 0x22u,
  1648 	/* Responder - number of local length errors. */
  1732 	/* Responder - number of local length errors. */
  1649 	EPSC_QUERY_RQ_NUM_LLE	 = 0x23,
  1733 	EPSC_QUERY_RQ_NUM_LLE	 = 0x23u,
  1650 	/* Requester - number local QP operation error. */
  1734 	/* Requester - number local QP operation error. */
  1651 	EPSC_QUERY_SQ_NUM_LQPOE	 = 0x24,
  1735 	EPSC_QUERY_SQ_NUM_LQPOE	 = 0x24u,
  1652 	/* Responder - number local QP operation error. */
  1736 	/* Responder - number local QP operation error. */
  1653 	EPSC_QUERY_RQ_NUM_LQPOE	 = 0x25,
  1737 	EPSC_QUERY_RQ_NUM_LQPOE	 = 0x25u,
  1654 	/* Requester - number of NAK-Sequence Error received. */
  1738 	/* Requester - number of NAK-Sequence Error received. */
  1655 	EPSC_QUERY_SQ_NUM_OOS	 = 0x26,
  1739 	EPSC_QUERY_SQ_NUM_OOS	 = 0x26u,
  1656 	/* Responder - number of NAK-Sequence Error sent. */
  1740 	/* Responder - number of NAK-Sequence Error sent. */
  1657 	EPSC_QUERY_RQ_NUM_OOS	 = 0x27,
  1741 	EPSC_QUERY_RQ_NUM_OOS	 = 0x27u,
  1658 	/* Requester - number of RNR nak retries exceeded errors. */
  1742 	/* Requester - number of RNR nak retries exceeded errors. */
  1659 	EPSC_QUERY_SQ_NUM_RREE	 = 0x28,
  1743 	EPSC_QUERY_SQ_NUM_RREE	 = 0x28u,
  1660 	/* Requester - number of transport retries exceeded errors. */
  1744 	/* Requester - number of transport retries exceeded errors. */
  1661 	EPSC_QUERY_SQ_NUM_TREE	 = 0x29,
  1745 	EPSC_QUERY_SQ_NUM_TREE	 = 0x29u,
  1662 	/* Requester - number of NAK-Remote Access Error received. */
  1746 	/* Requester - number of NAK-Remote Access Error received. */
  1663 	EPSC_QUERY_SQ_NUM_ROE	 = 0x2a,
  1747 	EPSC_QUERY_SQ_NUM_ROE	 = 0x2au,
  1664 	/*
  1748 	/*
  1665 	 * Responder - number of NAK-Remote Access Error sent. NAK-Remote Operation
  1749 	 * Responder - number of NAK-Remote Access Error sent. NAK-Remote Operation
  1666 	 * Error on: 1. Malformed WQE: Responder detected a malformed Receive Queue
  1750 	 * Error on: 1. Malformed WQE: Responder detected a malformed Receive Queue
  1667 	 * WQE while processing the packet. 2. Remote Operation Error: Responder
  1751 	 * WQE while processing the packet. 2. Remote Operation Error: Responder
  1668 	 * encountered an error, (local to the responder), which prevented it from
  1752 	 * encountered an error, (local to the responder), which prevented it from
  1669 	 * completing the request.
  1753 	 * completing the request.
  1670 	 */
  1754 	 */
  1671 	EPSC_QUERY_RQ_NUM_ROE	 = 0x2b,
  1755 	EPSC_QUERY_RQ_NUM_ROE	 = 0x2bu,
  1672 	/*
  1756 	/*
  1673 	 * Requester - number of NAK-Remote Access Error received. R_Key Violation:
  1757 	 * Requester - number of NAK-Remote Access Error received. R_Key Violation:
  1674 	 * Responder detected an invalid R_Key while executing an RDMA Request.
  1758 	 * Responder detected an invalid R_Key while executing an RDMA Request.
  1675 	 */
  1759 	 */
  1676 	EPSC_QUERY_SQ_NUM_RAE	 = 0x2c,
  1760 	EPSC_QUERY_SQ_NUM_RAE	 = 0x2cu,
  1677 	/*
  1761 	/*
  1678 	 * Responder - number of NAK-Remote Access Error sent. R_Key Violation
  1762 	 * Responder - number of NAK-Remote Access Error sent. R_Key Violation
  1679 	 * Responder detected an R_Key violation while executing an RDMA request.
  1763 	 * Responder detected an R_Key violation while executing an RDMA request.
  1680 	 */
  1764 	 */
  1681 	EPSC_QUERY_RQ_NUM_RAE	 = 0x2d,
  1765 	EPSC_QUERY_RQ_NUM_RAE	 = 0x2du,
  1682 	/*
  1766 	/*
  1683 	 * The number of UD packets silently discarded on the receive queue due to
  1767 	 * The number of UD packets silently discarded on the receive queue due to
  1684 	 * lack of receive descriptor.
  1768 	 * lack of receive descriptor.
  1685 	 */
  1769 	 */
  1686 	EPSC_QUERY_RQ_NUM_UDSDPRD	 = 0x2e,
  1770 	EPSC_QUERY_RQ_NUM_UDSDPRD	 = 0x2eu,
  1687 	/*
  1771 	/*
  1688 	 * The number of UC packets silently discarded on the receive queue due to
  1772 	 * The number of UC packets silently discarded on the receive queue due to
  1689 	 * lack of receive descriptor.
  1773 	 * lack of receive descriptor.
  1690 	 */
  1774 	 */
  1691 	EPSC_QUERY_RQ_NUM_UCSDPRD	 = 0x2f,
  1775 	EPSC_QUERY_RQ_NUM_UCSDPRD	 = 0x2fu,
  1692 	/*
  1776 	/*
  1693 	 * Requester - number of remote invalid request errors NAK-Invalid Request
  1777 	 * Requester - number of remote invalid request errors NAK-Invalid Request
  1694 	 * on: 1. Unsupported OpCode: Responder detected an unsupported OpCode. 2.
  1778 	 * on: 1. Unsupported OpCode: Responder detected an unsupported OpCode. 2.
  1695 	 * Unexpected OpCode: Responder detected an error in the sequence of OpCodes,
  1779 	 * Unexpected OpCode: Responder detected an error in the sequence of OpCodes,
  1696 	 * such as a missing Last packet.
  1780 	 * such as a missing Last packet.
  1697 	 */
  1781 	 */
  1698 	EPSC_QUERY_SQ_NUM_RIRE	 = 0x30,
  1782 	EPSC_QUERY_SQ_NUM_RIRE	 = 0x30u,
  1699 	/*
  1783 	/*
  1700 	 * Responder - number of remote invalid request errors. NAK may or may not be
  1784 	 * Responder - number of remote invalid request errors. NAK may or may not be
  1701 	 * sent. 1. QP Async Affiliated Error: Unsupported or Reserved OpCode (RC,RD
  1785 	 * sent. 1. QP Async Affiliated Error: Unsupported or Reserved OpCode (RC,RD
  1702 	 * only): Inbound request OpCode was either reserved, or was for a function
  1786 	 * only): Inbound request OpCode was either reserved, or was for a function
  1703 	 * not supported by thisQP. (E.g. RDMA or ATOMIC on QP not set up for this).
  1787 	 * not supported by thisQP. (E.g. RDMA or ATOMIC on QP not set up for this).
  1715 	 * was not consistent with the opcode: a: only is between 0 and PMTU bytes b:
  1799 	 * was not consistent with the opcode: a: only is between 0 and PMTU bytes b:
  1716 	 * (first or middle) equals PMTU bytes c: last is between 1 byte and PMTU
  1800 	 * (first or middle) equals PMTU bytes c: last is between 1 byte and PMTU
  1717 	 * bytes 9. Length error: Inbound message exceeded the size supported by the
  1801 	 * bytes 9. Length error: Inbound message exceeded the size supported by the
  1718 	 * CA port.
  1802 	 * CA port.
  1719 	 */
  1803 	 */
  1720 	EPSC_QUERY_RQ_NUM_RIRE	 = 0x31,
  1804 	EPSC_QUERY_RQ_NUM_RIRE	 = 0x31u,
  1721 	/* Requester - the number of RNR Naks received. */
  1805 	/* Requester - the number of RNR Naks received. */
  1722 	EPSC_QUERY_SQ_NUM_RNR	 = 0x32,
  1806 	EPSC_QUERY_SQ_NUM_RNR	 = 0x32u,
  1723 	/* Responder - the number of RNR Naks sent. */
  1807 	/* Responder - the number of RNR Naks sent. */
  1724 	EPSC_QUERY_RQ_NUM_RNR	 = 0x33,
  1808 	EPSC_QUERY_RQ_NUM_RNR	 = 0x33u,
  1725 	/* twoshot firmware image number (flash slot) */
  1809 	/* twoshot firmware image number (flash slot) */
  1726 	EPSC_QUERY_FW_TWOSHOT_IMG	 = 0x34,
  1810 	EPSC_QUERY_FW_TWOSHOT_IMG	 = 0x34u,
  1727 	/* firmware type */
  1811 	/* firmware type */
  1728 	EPSC_QUERY_FW_TYPE	 = 0x35,
  1812 	EPSC_QUERY_FW_TYPE	 = 0x35u,
  1729 	/* firmware size */
  1813 	/* firmware size */
  1730 	EPSC_QUERY_FW_SIZE	 = 0x36,
  1814 	EPSC_QUERY_FW_SIZE	 = 0x36u,
  1731 	/* firmware slot size (available space for an image) */
  1815 	/* firmware slot size (available space for an image) */
  1732 	EPSC_QUERY_FW_SLOT_SIZE	 = 0x37,
  1816 	EPSC_QUERY_FW_SLOT_SIZE	 = 0x37u,
  1733 	/* version of boot loader that has started the application */
  1817 	/* version of boot loader that has started the application */
  1734 	EPSC_QUERY_BL_VERSION	 = 0x38,
  1818 	EPSC_QUERY_BL_VERSION	 = 0x38u,
  1735 	/* boot loader build date in epoch time format */
  1819 	/* boot loader build date in epoch time format */
  1736 	EPSC_QUERY_BL_BUILD_DATE	 = 0x39,
  1820 	EPSC_QUERY_BL_BUILD_DATE	 = 0x39u,
  1737 	/* only used by EPSC_SET mark a PQP CQ ID as clean (WA bug 3769) */
  1821 	/* only used by EPSC_SET mark a PQP CQ ID as clean (WA bug 3769) */
  1738 	EPSC_QUERY_CLEAN_CQ_ID	 = 0x3a,
  1822 	EPSC_QUERY_CLEAN_CQ_ID	 = 0x3au,
  1739 	/* Number of TSL supported by FW */
  1823 	/* Number of TSL supported by FW */
  1740 	EPSC_QUERY_CAP_TSL_TX	 = 0x3b,
  1824 	EPSC_QUERY_CAP_TSL_TX	 = 0x3bu,
  1741 	EPSC_QUERY_CAP_TSL_RX	 = 0x3c,
  1825 	EPSC_QUERY_CAP_TSL_RX	 = 0x3cu,
  1742 	/* Reset CBLD Diag counters. Only used by EPSC_SET */
  1826 	/* Reset CBLD Diag counters. Only used by EPSC_SET */
  1743 	EPSC_QUERY_RESET_CBLD_DIAG_COUNTERS	 = 0x3d,
  1827 	EPSC_QUERY_RESET_CBLD_DIAG_COUNTERS	 = 0x3du,
  1744 	/* Max QP index used since power-on or host reset - to optimize WA for HW bug 3251 */
  1828 	/* Max QP index used since power-on or host reset - to optimize WA for HW bug 3251 */
  1745 	EPSC_QUERY_MAX_QP_USED	 = 0x3e,
  1829 	EPSC_QUERY_MAX_QP_USED	 = 0x3eu,
  1746 	/** the UF and QP where modify QP timed out ((uf << 32) | (qp)) */
  1830 	/** the UF and QP where modify QP timed out ((uf << 32) | (qp)) */
  1747 	EPSC_QUERY_MODQP_TO_SOURCE	 = 0x3f,
  1831 	EPSC_QUERY_MODQP_TO_SOURCE	 = 0x3fu,
  1748 	/** the debug register when modify QP timed out */
  1832 	/** the debug register when modify QP timed out */
  1749 	EPSC_QUERY_MODQP_TO_DEBUG	 = 0x40,
  1833 	EPSC_QUERY_MODQP_TO_DEBUG	 = 0x40u,
  1750 	/** the bit vector containing the reasons for entering degraded mode */
  1834 	/** the bit vector containing the reasons for entering degraded mode */
  1751 	EPSC_QUERY_DEGRADED_CAUSE	 = 0x41,
  1835 	EPSC_QUERY_DEGRADED_CAUSE	 = 0x41u,
  1752 	/** CMPL spin set mode (safe = 1 fast = 0) */
  1836 	/** CMPL spin set mode (safe = 1 fast = 0) */
  1753 	EPSC_QUERY_SPIN_SET_CONTROL	 = 0x42,
  1837 	EPSC_QUERY_SPIN_SET_CONTROL	 = 0x42u,
  1754 	/** VPD MAC address */
  1838 	/** VPD MAC address */
  1755 	EPSC_QUERY_VPD_MAC	 = 0x43,
  1839 	EPSC_QUERY_VPD_MAC	 = 0x43u,
  1756 	/** VPD part number */
  1840 	/** VPD part number */
  1757 	EPSC_QUERY_VPD_PART_NUMBER	 = 0x44,
  1841 	EPSC_QUERY_VPD_PART_NUMBER	 = 0x44u,
  1758 	/** VPD revision */
  1842 	/** VPD revision */
  1759 	EPSC_QUERY_VPD_REVISION	 = 0x45,
  1843 	EPSC_QUERY_VPD_REVISION	 = 0x45u,
  1760 	/** VPD serial number (big endian sub-string) - 8 byte offset in query index */
  1844 	/** VPD serial number (big endian sub-string) - 8 byte offset in query index */
  1761 	EPSC_QUERY_VPD_SERIAL_NUMBER	 = 0x46,
  1845 	EPSC_QUERY_VPD_SERIAL_NUMBER	 = 0x46u,
  1762 	/** VPD manufacturer = = Oracle Corporation - 8 byte offset in query index */
  1846 	/** VPD manufacturer = = Oracle Corporation - 8 byte offset in query index */
  1763 	EPSC_QUERY_VPD_MANUFACTURER	 = 0x47,
  1847 	EPSC_QUERY_VPD_MANUFACTURER	 = 0x47u,
       
  1848 	/** VPD product name (big endian sub-string) - 8 byte offset in query index */
       
  1849 	EPSC_QUERY_VPD_PRODUCT_NAME	 = 0x4bu,
       
  1850 	/** VPD Base GUID */
       
  1851 	EPSC_QUERY_VPD_BASE_GUID	 = 0x4eu,
       
  1852 	/** PSIF TSU SL and QoS mapping for for QP 0 - port number in query index */
       
  1853 	EPSC_QUERY_MAP_QP0_TO_TSL	 = 0x52u,
  1764 	/** PSIF TSU SL and QoS mapping for priv QP - port number in query index */
  1854 	/** PSIF TSU SL and QoS mapping for priv QP - port number in query index */
  1765 	EPSC_QUERY_MAP_PQP_TO_TSL	 = 0x48,
  1855 	EPSC_QUERY_MAP_PQP_TO_TSL	 = 0x48u,
  1766 	/** PSIF TSU SL and QoS mapping for IB SL 0-7 - port number in query index */
  1856 	/** PSIF TSU SL and QoS mapping for IB SL 0-7 - port number in query index */
  1767 	EPSC_QUERY_MAP_SL_TO_TSL_LO	 = 0x49,
  1857 	EPSC_QUERY_MAP_SL_TO_TSL_LO	 = 0x49u,
  1768 	/** PSIF TSU SL and QoS mapping for IB SL 8-15 - port number in query index */
  1858 	/** PSIF TSU SL and QoS mapping for IB SL 8-15 - port number in query index */
  1769 	EPSC_QUERY_MAP_SL_TO_TSL_HI	 = 0x4a,
  1859 	EPSC_QUERY_MAP_SL_TO_TSL_HI	 = 0x4au,
  1770 	/** VPD Product Name - 8 byte offset in query index */
  1860 	/** MMU static configuration of TA_UPPER_TWELVE bits (SPARC only) */
  1771 	EPSC_QUERY_VPD_PRODUCT_NAME	 = 0x4b,
  1861 	EPSC_QUERY_TA_UPPER_TWELVE	 = 0x4cu,
  1772 	/* Padding out to required bits allocated */
  1862 	/** MMU static configuration of PA_UPPER_TWELVE bits (SPARC only) */
  1773 	PSIF_EPSC_QUERY_OP_FIELD_MAX	 = 0x7fffffff
  1863 	EPSC_QUERY_PA_UPPER_TWELVE	 = 0x4du,
       
  1864 	/** Number of VFs configured - valid values limited to power-of-two.
       
  1865 	 * For BARE_METAL mode, number of VFs is -1 i.e. not applicable.
       
  1866 	 * PSIF_QUERY index as defined in psif_epsc_query_num_vfs_mode
       
  1867 	 * PSIF_SET   index = #VFs for next restart
       
  1868 	 */
       
  1869 	EPSC_QUERY_NUM_VFS	 = 0x4fu,
       
  1870 	/** Development debug only operation: SET and QUERY the TSU credit
       
  1871 	 * mode setup as defined by epsc_cli: cfg tsu_credit
       
  1872 	 */
       
  1873 	EPSC_QUERY_CREDIT_MODE	 = 0x50u,
       
  1874 	/** Query version on onboard CPLD (Titan only Other platforms will return EPSC_ENODATA) */
       
  1875 	EPSC_QUERY_CPLD_VERSION	 = 0x51u,
       
  1876 	/** Query portinfo on exernal port (defined in psif_epsc_query_external_port_info_t) */
       
  1877 	EPSC_QUERY_EXTERNAL_PORT_INFO	 = 0x53u,
       
  1878 	/* EOF marker - must be last and highest in this enum type. */
       
  1879 	EPSC_QUERY_LAST	 = 0x54u,
       
  1880 	/* Padding out to required bits allocated */
       
  1881 	PSIF_EPSC_QUERY_OP_FIELD_MAX	 = 0x7fffffffu
  1774 }; /* enum psif_epsc_query_op [32 bits] */
  1882 }; /* enum psif_epsc_query_op [32 bits] */
  1775 
  1883 
  1776 /**
  1884 /**
  1777  * Valid values for struct psif_epsc_csr_update::opcode
  1885  * Valid values for struct psif_epsc_csr_update::opcode
  1778  */
  1886  */
  1779 enum psif_epsc_csr_update_opcode {
  1887 enum psif_epsc_csr_update_opcode {
  1780 	EPSC_UPDATE_OP_POLL	 = 0,
  1888 	EPSC_UPDATE_OP_POLL	 = 0u,
  1781 	EPSC_UPDATE_OP_START,
  1889 	EPSC_UPDATE_OP_START,
  1782 	EPSC_UPDATE_OP_ERASE,
  1890 	EPSC_UPDATE_OP_ERASE,
  1783 	EPSC_UPDATE_OP_WRITE,
  1891 	EPSC_UPDATE_OP_WRITE,
  1784 	EPSC_UPDATE_OP_READ,
  1892 	EPSC_UPDATE_OP_READ,
  1785 	EPSC_UPDATE_OP_STOP,
  1893 	EPSC_UPDATE_OP_STOP,
  1786 	EPSC_UPDATE_OP_SET,
  1894 	EPSC_UPDATE_OP_SET,
  1787 	EPSC_UPDATE_OP_MAX,
  1895 	EPSC_UPDATE_OP_MAX,
  1788 	/* Padding out to required bits allocated */
  1896 	/* Padding out to required bits allocated */
  1789 	PSIF_EPSC_CSR_UPDATE_OPCODE_FIELD_MAX	 = 0xffff
  1897 	PSIF_EPSC_CSR_UPDATE_OPCODE_FIELD_MAX	 = 0xffffu
  1790 }; /* enum psif_epsc_csr_update_opcode [16 bits] */
  1898 }; /* enum psif_epsc_csr_update_opcode [16 bits] */
  1791 
  1899 
  1792 /**
  1900 /**
  1793  * Flash slot numbers used by e.g. EPSC_QUERY::EPSC_QUERY_FW_CURR_IMG
  1901  * Flash slot numbers used by e.g. EPSC_QUERY::EPSC_QUERY_FW_CURR_IMG
  1794  */
  1902  */
  1799 	EPSC_FLASH_SLOT_EPS_A_IMG,
  1907 	EPSC_FLASH_SLOT_EPS_A_IMG,
  1800 	EPSC_FLASH_SLOT_BOOT_IMG,
  1908 	EPSC_FLASH_SLOT_BOOT_IMG,
  1801 	/* always last */
  1909 	/* always last */
  1802 	EPSC_FLASH_SLOT_COUNT,
  1910 	EPSC_FLASH_SLOT_COUNT,
  1803 	/* Padding out to required bits allocated */
  1911 	/* Padding out to required bits allocated */
  1804 	PSIF_EPSC_FLASH_SLOT_FIELD_MAX	 = 0xffff
  1912 	PSIF_EPSC_FLASH_SLOT_FIELD_MAX	 = 0xffffu
  1805 }; /* enum psif_epsc_flash_slot [16 bits] */
  1913 }; /* enum psif_epsc_flash_slot [16 bits] */
  1806 
  1914 
  1807 /**
  1915 /**
  1808  * Valid values for struct psif_epsc_csr_update::u::set
  1916  * Valid values for struct psif_epsc_csr_update::u::set
  1809  */
  1917  */
  1812 	EPSC_UPDATE_SET_AUTOSTART_IMG,
  1920 	EPSC_UPDATE_SET_AUTOSTART_IMG,
  1813 	EPSC_UPDATE_SET_ONESHOT_IMG,
  1921 	EPSC_UPDATE_SET_ONESHOT_IMG,
  1814 	EPSC_UPDATE_SET_TWOSHOT_IMG,
  1922 	EPSC_UPDATE_SET_TWOSHOT_IMG,
  1815 	EPSC_UPDATE_SET_IMG_VALID,
  1923 	EPSC_UPDATE_SET_IMG_VALID,
  1816 	/* Padding out to required bits allocated */
  1924 	/* Padding out to required bits allocated */
  1817 	PSIF_EPSC_UPDATE_SET_FIELD_MAX	 = 0x7fffffff
  1925 	PSIF_EPSC_UPDATE_SET_FIELD_MAX	 = 0x7fffffffu
  1818 }; /* enum psif_epsc_update_set [32 bits] */
  1926 }; /* enum psif_epsc_update_set [32 bits] */
  1819 
  1927 
  1820 /**
  1928 /**
  1821  * Opcodes for psif_epsc_csr_uf_ctrl_t::opcode
  1929  * Opcodes for psif_epsc_csr_uf_ctrl_t::opcode
  1822  */
  1930  */
  1823 enum psif_epsc_csr_uf_ctrl_opcode {
  1931 enum psif_epsc_csr_uf_ctrl_opcode {
  1824 	EPSC_UF_CTRL_MMU_FLUSH,
  1932 	EPSC_UF_CTRL_MMU_FLUSH,
  1825 	EPSC_UF_CTRL_GET_UF_USED_QP,
  1933 	EPSC_UF_CTRL_GET_UF_USED_QP,
  1826 	EPSC_UF_CTRL_CLEAR_UF_USED_QP,
  1934 	EPSC_UF_CTRL_CLEAR_UF_USED_QP,
  1827 	/** For SMP {en dis}able is the flag param a bitvector for which ports to update 0x6 hence indicate P1 and P2. */
  1935 	/** For SMP {en dis}able is the flag param a bitvector for which ports
       
  1936 	 *  to update, 0x6 hence indicate P1 and P2.
       
  1937 	 */
  1828 	EPSC_UF_CTRL_SMP_ENABLE,
  1938 	EPSC_UF_CTRL_SMP_ENABLE,
  1829 	EPSC_UF_CTRL_SMP_DISABLE,
  1939 	EPSC_UF_CTRL_SMP_DISABLE,
  1830 	/** For Vlink {dis }connect is the flag param a bitvector for which ports to update 0x6 hence indicate P1 and P2. */
  1940 	/** For Vlink {dis }connect is the flag param a bitvector for which ports
       
  1941 	 * to update, 0x6 hence indicate P1 and P2.
       
  1942 	 */
  1831 	EPSC_UF_CTRL_VLINK_CONNECT,
  1943 	EPSC_UF_CTRL_VLINK_CONNECT,
  1832 	EPSC_UF_CTRL_VLINK_DISCONNECT,
  1944 	EPSC_UF_CTRL_VLINK_DISCONNECT,
  1833 	/** Retrieve the highest QP number used by the given UF */
  1945 	/** Retrieve the highest QP number used by the given UF */
  1834 	EPSC_UF_CTRL_GET_HIGHEST_QP_IDX,
  1946 	EPSC_UF_CTRL_GET_HIGHEST_QP_IDX,
  1835 	/** Reset the highest QP number cache for the given UF */
  1947 	/** Reset the highest QP number cache for the given UF */
  1836 	EPSC_UF_CTRL_RESET_HIGHEST_QP_IDX,
  1948 	EPSC_UF_CTRL_RESET_HIGHEST_QP_IDX,
  1837 	/* Padding out to required bits allocated */
  1949 	/* Padding out to required bits allocated */
  1838 	PSIF_EPSC_CSR_UF_CTRL_OPCODE_FIELD_MAX	 = 0x7fffffff
  1950 	PSIF_EPSC_CSR_UF_CTRL_OPCODE_FIELD_MAX	 = 0x7fffffffu
  1839 }; /* enum psif_epsc_csr_uf_ctrl_opcode [32 bits] */
  1951 }; /* enum psif_epsc_csr_uf_ctrl_opcode [32 bits] */
  1840 
  1952 
  1841 /**
  1953 /**
  1842  * \brief Host to VIMMA operation codes
  1954  * \brief Host to VIMMA operation codes
  1843  * \details
  1955  * \details
  1909 	/* no DMA. */
  2021 	/* no DMA. */
  1910 	EPSC_VIMMA_CTRL_SET_VFP_VHCA_DEREGISTER,
  2022 	EPSC_VIMMA_CTRL_SET_VFP_VHCA_DEREGISTER,
  1911 	/* no DMA or DMA if multiple UFs */
  2023 	/* no DMA or DMA if multiple UFs */
  1912 	EPSC_VIMMA_CTRL_SET_ADMIN_MODE,
  2024 	EPSC_VIMMA_CTRL_SET_ADMIN_MODE,
  1913 	/* Padding out to required bits allocated */
  2025 	/* Padding out to required bits allocated */
  1914 	PSIF_EPSC_VIMMA_CTRL_OPCODE_FIELD_MAX	 = 0x7fffffff
  2026 	PSIF_EPSC_VIMMA_CTRL_OPCODE_FIELD_MAX	 = 0x7fffffffu
  1915 }; /* enum psif_epsc_vimma_ctrl_opcode [32 bits] */
  2027 }; /* enum psif_epsc_vimma_ctrl_opcode [32 bits] */
  1916 
  2028 
  1917 
  2029 
  1918 enum psif_epsc_vimma_admmode {
  2030 enum psif_epsc_vimma_admmode {
  1919 	EPSC_VIMMA_CTRL_IB_ADM_MODE_SM_STANDARD,
  2031 	EPSC_VIMMA_CTRL_IB_ADM_MODE_SM_STANDARD,
  1920 	/* VFP used as short for VM Fabric Profile */
  2032 	/* VFP used as short for VM Fabric Profile */
  1921 	EPSC_VIMMA_CTRL_IB_ADM_MODE_VM_FABRIC_PROFILE,
  2033 	EPSC_VIMMA_CTRL_IB_ADM_MODE_VM_FABRIC_PROFILE,
  1922 	/* Padding out to required bits allocated */
  2034 	/* Padding out to required bits allocated */
  1923 	PSIF_EPSC_VIMMA_ADMMODE_FIELD_MAX	 = 0xffff
  2035 	PSIF_EPSC_VIMMA_ADMMODE_FIELD_MAX	 = 0xffffu
  1924 }; /* enum psif_epsc_vimma_admmode [16 bits] */
  2036 }; /* enum psif_epsc_vimma_admmode [16 bits] */
  1925 
  2037 
  1926 /**
  2038 /**
  1927  * For response structure to EPSC_PMA_COUNTERS Op.
  2039  * For response structure to EPSC_PMA_COUNTERS Op.
  1928  * Common PMA counters for TSU and IBU layers.
  2040  * Common PMA counters for TSU and IBU layers.
  1929  */
  2041  */
  1930 enum psif_epsc_csr_pma_counters_enum {
  2042 enum psif_epsc_csr_pma_counters_enum {
  1931 	/** Regular counters - IB Spec chapter 16.1.3.5 */
  2043 	/** Regular counters - IB Spec chapter 16.1.3.5 */
  1932 	EPSC_PMA_SYMBOL_ERR_CNTR	 = 0,
  2044 	EPSC_PMA_SYMBOL_ERR_CNTR	 = 0u,
  1933 	EPSC_PMA_LINK_ERR_RECOVERY_CNTR,
  2045 	EPSC_PMA_LINK_ERR_RECOVERY_CNTR,
  1934 	EPSC_PMA_LINK_DOWNED_CNTR,
  2046 	EPSC_PMA_LINK_DOWNED_CNTR,
  1935 	EPSC_PMA_PORT_RCV_ERR,
  2047 	EPSC_PMA_PORT_RCV_ERR,
  1936 	EPSC_PMA_PORT_RCV_REMOTE_PHYSICAL_ERR,
  2048 	EPSC_PMA_PORT_RCV_REMOTE_PHYSICAL_ERR,
  1937 	EPSC_PMA_PORT_RCV_SWITCH_RELAY_ERR,
  2049 	EPSC_PMA_PORT_RCV_SWITCH_RELAY_ERR,
  1959 	/* IB Spec Chapter 16.1.4.1 */
  2071 	/* IB Spec Chapter 16.1.4.1 */
  1960 	EPSC_PMA_PORT_LOCAL_PHYSICAL_ERR,
  2072 	EPSC_PMA_PORT_LOCAL_PHYSICAL_ERR,
  1961 	/* Keep this in End */
  2073 	/* Keep this in End */
  1962 	EPSC_PMA_COUNTERS_TOTAL,
  2074 	EPSC_PMA_COUNTERS_TOTAL,
  1963 	/* Padding out to required bits allocated */
  2075 	/* Padding out to required bits allocated */
  1964 	PSIF_EPSC_CSR_PMA_COUNTERS_ENUM_FIELD_MAX	 = 0x7fffffff
  2076 	PSIF_EPSC_CSR_PMA_COUNTERS_ENUM_FIELD_MAX	 = 0x7fffffffu
  1965 }; /* enum psif_epsc_csr_pma_counters_enum [32 bits] */
  2077 }; /* enum psif_epsc_csr_pma_counters_enum [32 bits] */
  1966 
  2078 
  1967 /**
  2079 /**
  1968  * \brief PSIF atomic op requester config values.
  2080  * \brief PSIF atomic op requester config values.
  1969  * \details
  2081  * \details
  1974  * \par Classification
  2086  * \par Classification
  1975  *      driver
  2087  *      driver
  1976  */
  2088  */
  1977 enum psif_epsc_csr_atomic_op {
  2089 enum psif_epsc_csr_atomic_op {
  1978 	/** PSIF requests atomic operations for IB and SQS. */
  2090 	/** PSIF requests atomic operations for IB and SQS. */
  1979 	PSIF_PCIE_ATOMIC_OP_BOTH	 = 0,
  2091 	PSIF_PCIE_ATOMIC_OP_BOTH	 = 0u,
  1980 	/** PSIF requests atomic operations for IB. */
  2092 	/** PSIF requests atomic operations for IB. */
  1981 	PSIF_PCIE_ATOMIC_OP_IB,
  2093 	PSIF_PCIE_ATOMIC_OP_IB,
  1982 	/** PSIF requests atomic operations for SQS. */
  2094 	/** PSIF requests atomic operations for SQS. */
  1983 	PSIF_PCIE_ATOMIC_OP_SQS,
  2095 	PSIF_PCIE_ATOMIC_OP_SQS,
  1984 	/** PSIF doesn't request atomic operations. */
  2096 	/** PSIF doesn't request atomic operations. */
  1985 	PSIF_PCIE_ATOMIC_OP_NONE
  2097 	PSIF_PCIE_ATOMIC_OP_NONE
  1986 }; /* enum psif_epsc_csr_atomic_op [ 2 bits] */
  2098 }; /* enum psif_epsc_csr_atomic_op [ 2 bits] */
  1987 
  2099 
       
  2100 /**
       
  2101  * For data in response structure of EPSC_BER_DATA Op.
       
  2102  */
       
  2103 enum psif_epsc_csr_ber_counters_enum {
       
  2104 	/* IBU_P1_STATUS_ADDR */
       
  2105 	EPSC_BER_PORT_STATUS	 = 0u,
       
  2106 	/* IBU_P1_LINK_SPEED_ACTIVE_ADDR */
       
  2107 	EPSC_BER_LINK_SPEED_ACTIVE,
       
  2108 	/* IBU_P1_LINK_WIDTH_ACTIVE_ADDR */
       
  2109 	EPSC_BER_LINKWIDTH_ACTIVE,
       
  2110 	/* IBU_P1_PCLINK_ERR_REC_CNT_ADDR */
       
  2111 	EPSC_BER_PCLINK_ERR_REC_CNT,
       
  2112 	/* IBU_P1_PCLINK_DOWNED_CNT_ADDR */
       
  2113 	EPSC_BER_PCLINK_DOWNED_CNT
       
  2114 }; /* enum psif_epsc_csr_ber_counters_enum [ 3 bits] */
       
  2115 
  1988 /*
  2116 /*
  1989  * Completion notification states. Could take any of these values:
  2117  * Completion notification states. Could take any of these values:
  1990  * PSIF_CQ_UNARMED PSIF_CQ_ARMED_SE PSIF_CQ_ARMED_ALL PSIF_CQ_TRIGGERED
  2118  * PSIF_CQ_UNARMED PSIF_CQ_ARMED_SE PSIF_CQ_ARMED_ALL PSIF_CQ_TRIGGERED
  1991  */
  2119  */
  1992 enum psif_cq_state {
  2120 enum psif_cq_state {
  1993 	PSIF_CQ_UNARMED,
  2121 	PSIF_CQ_UNARMED	 = 0u,
  1994 	PSIF_CQ_ARMED_SE,
  2122 	PSIF_CQ_ARMED_SE,
  1995 	PSIF_CQ_ARMED_ALL,
  2123 	PSIF_CQ_ARMED_ALL,
  1996 	PSIF_CQ_TRIGGERED
  2124 	PSIF_CQ_TRIGGERED
  1997 }; /* enum psif_cq_state [ 2 bits] */
  2125 }; /* enum psif_cq_state [ 2 bits] */
  1998 
  2126 
  1999 /*
  2127 /*
  2000  * This is an indication if the RSS hash was generated with port inputs or
  2128  * This is an indication if the RSS hash was generated with port inputs or
  2001  * not.
  2129  * not.
  2002  */
  2130  */
  2003 enum psif_rss_hash_source {
  2131 enum psif_rss_hash_source {
  2004 	RSS_WITHOUT_PORT,
  2132 	RSS_WITHOUT_PORT	 = 0u,
  2005 	RSS_WITH_PORT
  2133 	RSS_WITH_PORT
  2006 }; /* enum psif_rss_hash_source [ 1 bits] */
  2134 }; /* enum psif_rss_hash_source [ 1 bits] */
  2007 
  2135 
  2008 #if defined (HOST_LITTLE_ENDIAN)
  2136 #if defined(HOST_LITTLE_ENDIAN)
  2009 #include "psif_hw_data_le.h"
  2137 #include "psif_hw_data_le.h"
  2010 #elif defined (HOST_BIG_ENDIAN)
  2138 #elif defined(HOST_BIG_ENDIAN)
  2011 #include "psif_hw_data_be.h"
  2139 #include "psif_hw_data_be.h"
  2012 #else
  2140 #else
  2013 #error "Could not determine byte order in psif_hw_data.h !?"
  2141 #error "Could not determine byte order in psif_hw_data.h !?"
  2014 #endif
  2142 #endif
  2015 
  2143