1*9517SBill.Taylor@Sun.COM /* 2*9517SBill.Taylor@Sun.COM * CDDL HEADER START 3*9517SBill.Taylor@Sun.COM * 4*9517SBill.Taylor@Sun.COM * The contents of this file are subject to the terms of the 5*9517SBill.Taylor@Sun.COM * Common Development and Distribution License (the "License"). 6*9517SBill.Taylor@Sun.COM * You may not use this file except in compliance with the License. 7*9517SBill.Taylor@Sun.COM * 8*9517SBill.Taylor@Sun.COM * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9*9517SBill.Taylor@Sun.COM * or http://www.opensolaris.org/os/licensing. 10*9517SBill.Taylor@Sun.COM * See the License for the specific language governing permissions 11*9517SBill.Taylor@Sun.COM * and limitations under the License. 12*9517SBill.Taylor@Sun.COM * 13*9517SBill.Taylor@Sun.COM * When distributing Covered Code, include this CDDL HEADER in each 14*9517SBill.Taylor@Sun.COM * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15*9517SBill.Taylor@Sun.COM * If applicable, add the following below this CDDL HEADER, with the 16*9517SBill.Taylor@Sun.COM * fields enclosed by brackets "[]" replaced with your own identifying 17*9517SBill.Taylor@Sun.COM * information: Portions Copyright [yyyy] [name of copyright owner] 18*9517SBill.Taylor@Sun.COM * 19*9517SBill.Taylor@Sun.COM * CDDL HEADER END 20*9517SBill.Taylor@Sun.COM */ 21*9517SBill.Taylor@Sun.COM 22*9517SBill.Taylor@Sun.COM /* 23*9517SBill.Taylor@Sun.COM * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 24*9517SBill.Taylor@Sun.COM * Use is subject to license terms. 25*9517SBill.Taylor@Sun.COM */ 26*9517SBill.Taylor@Sun.COM 27*9517SBill.Taylor@Sun.COM #ifndef _SYS_IB_ADAPTERS_MLNX_UMAP_H 28*9517SBill.Taylor@Sun.COM #define _SYS_IB_ADAPTERS_MLNX_UMAP_H 29*9517SBill.Taylor@Sun.COM 30*9517SBill.Taylor@Sun.COM #ifdef __cplusplus 31*9517SBill.Taylor@Sun.COM extern "C" { 32*9517SBill.Taylor@Sun.COM #endif 33*9517SBill.Taylor@Sun.COM 34*9517SBill.Taylor@Sun.COM /* 35*9517SBill.Taylor@Sun.COM * mlnx_umap.h 36*9517SBill.Taylor@Sun.COM * Contains all of the definions necessary for communicating the data 37*9517SBill.Taylor@Sun.COM * needed for direct userland access to resources on Mellanox HCAs. 38*9517SBill.Taylor@Sun.COM */ 39*9517SBill.Taylor@Sun.COM 40*9517SBill.Taylor@Sun.COM /* 41*9517SBill.Taylor@Sun.COM * Note: The structs in this file are used in the interface(s) 42*9517SBill.Taylor@Sun.COM * between kernel service drivers, e.g. daplt, and the libraries 43*9517SBill.Taylor@Sun.COM * on top of them, e.g. udapl_tavor.so.1. When any of the 44*9517SBill.Taylor@Sun.COM * structs in this file change, any version control between the 45*9517SBill.Taylor@Sun.COM * kernel service driver and the library will need to change. 46*9517SBill.Taylor@Sun.COM * 47*9517SBill.Taylor@Sun.COM * There is a version control on the structs defined here. The library 48*9517SBill.Taylor@Sun.COM * (consumer of structs from ibt_ci_data_out()) must verify a version 49*9517SBill.Taylor@Sun.COM * field to correctly read the data provided by the kernel driver 50*9517SBill.Taylor@Sun.COM * (tavor, arbel, and hermon). 51*9517SBill.Taylor@Sun.COM */ 52*9517SBill.Taylor@Sun.COM 53*9517SBill.Taylor@Sun.COM #define MLNX_UMAP_IF_VERSION 2 54*9517SBill.Taylor@Sun.COM 55*9517SBill.Taylor@Sun.COM /* 56*9517SBill.Taylor@Sun.COM * The following defines are used in the database type field for each database 57*9517SBill.Taylor@Sun.COM * entry. They specify the type of object (UAR pages, PIDs, CQ, QP, and MR 58*9517SBill.Taylor@Sun.COM * umemcookie) that corresponds to the database key value. On database queries, 59*9517SBill.Taylor@Sun.COM * this type value must match the search criterion. 60*9517SBill.Taylor@Sun.COM */ 61*9517SBill.Taylor@Sun.COM #define MLNX_UMAP_UARPG_RSRC 0x11 62*9517SBill.Taylor@Sun.COM #define MLNX_UMAP_BLUEFLAMEPG_RSRC 0x12 63*9517SBill.Taylor@Sun.COM #define MLNX_UMAP_PID_RSRC 0x22 64*9517SBill.Taylor@Sun.COM #define MLNX_UMAP_CQMEM_RSRC 0x33 65*9517SBill.Taylor@Sun.COM #define MLNX_UMAP_QPMEM_RSRC 0x44 66*9517SBill.Taylor@Sun.COM #define MLNX_UMAP_MRMEM_RSRC 0x55 67*9517SBill.Taylor@Sun.COM #define MLNX_UMAP_SRQMEM_RSRC 0x66 68*9517SBill.Taylor@Sun.COM #define MLNX_UMAP_DBRMEM_RSRC 0x77 69*9517SBill.Taylor@Sun.COM #define MLNX_UMAP_RSRC_TYPE_MASK 0xFF 70*9517SBill.Taylor@Sun.COM #define MLNX_UMAP_RSRC_TYPE_SHIFT 8 71*9517SBill.Taylor@Sun.COM 72*9517SBill.Taylor@Sun.COM /* umap structures */ 73*9517SBill.Taylor@Sun.COM 74*9517SBill.Taylor@Sun.COM typedef struct mlnx_umap_cq_data_out_s { 75*9517SBill.Taylor@Sun.COM uint_t mcq_rev; 76*9517SBill.Taylor@Sun.COM uint32_t mcq_cqnum; 77*9517SBill.Taylor@Sun.COM uint64_t mcq_mapoffset; 78*9517SBill.Taylor@Sun.COM uint64_t mcq_maplen; 79*9517SBill.Taylor@Sun.COM uint32_t mcq_numcqe; 80*9517SBill.Taylor@Sun.COM uint32_t mcq_cqesz; 81*9517SBill.Taylor@Sun.COM 82*9517SBill.Taylor@Sun.COM /* Arbel/Hermon doorbell records */ 83*9517SBill.Taylor@Sun.COM uint64_t mcq_armdbr_mapoffset; 84*9517SBill.Taylor@Sun.COM uint64_t mcq_armdbr_maplen; 85*9517SBill.Taylor@Sun.COM uint64_t mcq_polldbr_mapoffset; 86*9517SBill.Taylor@Sun.COM uint64_t mcq_polldbr_maplen; 87*9517SBill.Taylor@Sun.COM uint32_t mcq_armdbr_offset; 88*9517SBill.Taylor@Sun.COM uint32_t mcq_polldbr_offset; 89*9517SBill.Taylor@Sun.COM } mlnx_umap_cq_data_out_t; 90*9517SBill.Taylor@Sun.COM 91*9517SBill.Taylor@Sun.COM typedef struct mlnx_umap_qp_data_out_s { 92*9517SBill.Taylor@Sun.COM uint_t mqp_rev; 93*9517SBill.Taylor@Sun.COM uint32_t mqp_qpnum; 94*9517SBill.Taylor@Sun.COM uint64_t mqp_mapoffset; 95*9517SBill.Taylor@Sun.COM uint64_t mqp_maplen; 96*9517SBill.Taylor@Sun.COM 97*9517SBill.Taylor@Sun.COM uint32_t mqp_rq_off; 98*9517SBill.Taylor@Sun.COM uint32_t mqp_rq_desc_addr; 99*9517SBill.Taylor@Sun.COM uint32_t mqp_rq_numwqe; 100*9517SBill.Taylor@Sun.COM uint32_t mqp_rq_wqesz; 101*9517SBill.Taylor@Sun.COM 102*9517SBill.Taylor@Sun.COM uint32_t mqp_sq_off; 103*9517SBill.Taylor@Sun.COM uint32_t mqp_sq_desc_addr; 104*9517SBill.Taylor@Sun.COM uint32_t mqp_sq_numwqe; 105*9517SBill.Taylor@Sun.COM uint32_t mqp_sq_wqesz; 106*9517SBill.Taylor@Sun.COM 107*9517SBill.Taylor@Sun.COM /* Arbel/Hermon doorbell records */ 108*9517SBill.Taylor@Sun.COM uint64_t mqp_sdbr_mapoffset; 109*9517SBill.Taylor@Sun.COM uint64_t mqp_sdbr_maplen; 110*9517SBill.Taylor@Sun.COM uint64_t mqp_rdbr_mapoffset; 111*9517SBill.Taylor@Sun.COM uint64_t mqp_rdbr_maplen; 112*9517SBill.Taylor@Sun.COM uint32_t mqp_sdbr_offset; 113*9517SBill.Taylor@Sun.COM uint32_t mqp_rdbr_offset; 114*9517SBill.Taylor@Sun.COM 115*9517SBill.Taylor@Sun.COM /* Hermon send queue headroom, in units of wqes */ 116*9517SBill.Taylor@Sun.COM uint32_t mqp_sq_headroomwqes; 117*9517SBill.Taylor@Sun.COM } mlnx_umap_qp_data_out_t; 118*9517SBill.Taylor@Sun.COM 119*9517SBill.Taylor@Sun.COM typedef struct mlnx_umap_srq_data_out_s { 120*9517SBill.Taylor@Sun.COM uint_t msrq_rev; 121*9517SBill.Taylor@Sun.COM uint32_t msrq_srqnum; 122*9517SBill.Taylor@Sun.COM uint64_t msrq_mapoffset; 123*9517SBill.Taylor@Sun.COM uint64_t msrq_maplen; 124*9517SBill.Taylor@Sun.COM uint32_t msrq_desc_addr; 125*9517SBill.Taylor@Sun.COM uint32_t msrq_numwqe; 126*9517SBill.Taylor@Sun.COM uint32_t msrq_wqesz; 127*9517SBill.Taylor@Sun.COM uint32_t msrq_pad1; /* reserved */ 128*9517SBill.Taylor@Sun.COM 129*9517SBill.Taylor@Sun.COM /* Arbel/Hermon doorbell records */ 130*9517SBill.Taylor@Sun.COM uint64_t msrq_rdbr_mapoffset; 131*9517SBill.Taylor@Sun.COM uint64_t msrq_rdbr_maplen; 132*9517SBill.Taylor@Sun.COM uint32_t msrq_rdbr_offset; 133*9517SBill.Taylor@Sun.COM uint32_t msrq_reserved; 134*9517SBill.Taylor@Sun.COM } mlnx_umap_srq_data_out_t; 135*9517SBill.Taylor@Sun.COM 136*9517SBill.Taylor@Sun.COM typedef struct mlnx_umap_pd_data_out_s { 137*9517SBill.Taylor@Sun.COM uint_t mpd_rev; 138*9517SBill.Taylor@Sun.COM uint32_t mpd_pdnum; 139*9517SBill.Taylor@Sun.COM } mlnx_umap_pd_data_out_t; 140*9517SBill.Taylor@Sun.COM 141*9517SBill.Taylor@Sun.COM #ifdef __cplusplus 142*9517SBill.Taylor@Sun.COM } 143*9517SBill.Taylor@Sun.COM #endif 144*9517SBill.Taylor@Sun.COM 145*9517SBill.Taylor@Sun.COM #endif /* _SYS_IB_ADAPTERS_MLNX_UMAP_H */ 146