11590Srgrimes/*
21590Srgrimes * Copyright (c) 2004, 2005 Topspin Communications.  All rights reserved.
31590Srgrimes * Copyright (c) 2006 Cisco Systems.  All rights reserved.
41590Srgrimes *
51590Srgrimes * This software is available to you under a choice of one of two
61590Srgrimes * licenses.  You may choose to be licensed under the terms of the GNU
71590Srgrimes * General Public License (GPL) Version 2, available from the file
81590Srgrimes * COPYING in the main directory of this source tree, or the
91590Srgrimes * OpenIB.org BSD license below:
101590Srgrimes *
111590Srgrimes *     Redistribution and use in source and binary forms, with or
121590Srgrimes *     without modification, are permitted provided that the following
131590Srgrimes *     conditions are met:
141590Srgrimes *
151590Srgrimes *      - Redistributions of source code must retain the above
161590Srgrimes *        copyright notice, this list of conditions and the following
171590Srgrimes *        disclaimer.
181590Srgrimes *
191590Srgrimes *      - Redistributions in binary form must reproduce the above
201590Srgrimes *        copyright notice, this list of conditions and the following
211590Srgrimes *        disclaimer in the documentation and/or other materials
221590Srgrimes *        provided with the distribution.
231590Srgrimes *
241590Srgrimes * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
251590Srgrimes * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
261590Srgrimes * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
271590Srgrimes * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
281590Srgrimes * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
291590Srgrimes * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
301590Srgrimes * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
311590Srgrimes * SOFTWARE.
321590Srgrimes */
331590Srgrimes
341590Srgrimes#ifndef MTHCA_ABI_H
3527314Scharnier#define MTHCA_ABI_H
361590Srgrimes
371590Srgrimes#include <infiniband/kern-abi.h>
381590Srgrimes
391590Srgrimes#define MTHCA_UVERBS_ABI_VERSION	1
401590Srgrimes
4127314Scharnierstruct mthca_alloc_ucontext_resp {
4223693Speter	struct ibv_get_context_resp	ibv_resp;
4327314Scharnier	__u32				qp_tab_size;
4427314Scharnier	__u32				uarc_size;
4527314Scharnier};
461590Srgrimes
471590Srgrimesstruct mthca_alloc_pd_resp {
481590Srgrimes	struct ibv_alloc_pd_resp	ibv_resp;
4923693Speter	__u32				pdn;
5023693Speter	__u32				reserved;
5127314Scharnier};
5223693Speter
531590Srgrimesstruct mthca_reg_mr {
541590Srgrimes	struct ibv_reg_mr		ibv_cmd;
5523693Speter/*
561590Srgrimes * Mark the memory region with a DMA attribute that causes
571590Srgrimes * in-flight DMA to be flushed when the region is written to:
581590Srgrimes */
591590Srgrimes#define MTHCA_MR_DMASYNC	0x1
601590Srgrimes	__u32				mr_attrs;
611590Srgrimes	__u32				reserved;
621590Srgrimes};
631590Srgrimes
6424665Salexstruct mthca_create_cq {
651590Srgrimes	struct ibv_create_cq		ibv_cmd;
661590Srgrimes	__u32				lkey;
671590Srgrimes	__u32				pdn;
681590Srgrimes	__u64				arm_db_page;
691590Srgrimes	__u64				set_db_page;
701590Srgrimes	__u32				arm_db_index;
711590Srgrimes	__u32				set_db_index;
721590Srgrimes};
731590Srgrimes
741590Srgrimesstruct mthca_create_cq_resp {
751590Srgrimes	struct ibv_create_cq_resp	ibv_resp;
761590Srgrimes	__u32				cqn;
7724665Salex	__u32				reserved;
781590Srgrimes};
791590Srgrimes
801590Srgrimesstruct mthca_resize_cq {
8124665Salex	struct ibv_resize_cq		ibv_cmd;
821590Srgrimes	__u32				lkey;
8324665Salex	__u32				reserved;
8424665Salex};
8524665Salex
8627314Scharnierstruct mthca_create_srq {
8724665Salex	struct ibv_create_srq		ibv_cmd;
881590Srgrimes	__u32				lkey;
891590Srgrimes	__u32				db_index;
901590Srgrimes	__u64				db_page;
9127314Scharnier};
921590Srgrimes
931590Srgrimesstruct mthca_create_srq_resp {
941590Srgrimes	struct ibv_create_srq_resp	ibv_resp;
951590Srgrimes	__u32				srqn;
961590Srgrimes	__u32				reserved;
971590Srgrimes};
981590Srgrimes
991590Srgrimesstruct mthca_create_qp {
10024665Salex	struct ibv_create_qp		ibv_cmd;
10127314Scharnier	__u32				lkey;
10224665Salex	__u32				reserved;
10324665Salex	__u64				sq_db_page;
10424665Salex	__u64				rq_db_page;
1051590Srgrimes	__u32				sq_db_index;
1061590Srgrimes	__u32				rq_db_index;
10727314Scharnier};
1081590Srgrimes
1091590Srgrimes#endif /* MTHCA_ABI_H */
1101590Srgrimes