134192Sjdp/* 255687Sjdp * Copyright (c) 2005 Topspin Communications. All rights reserved. 334192Sjdp * 434192Sjdp * This software is available to you under a choice of one of two 534192Sjdp * licenses. You may choose to be licensed under the terms of the GNU 634192Sjdp * General Public License (GPL) Version 2, available from the file 734192Sjdp * COPYING in the main directory of this source tree, or the 834192Sjdp * OpenIB.org BSD license below: 934192Sjdp * 1034192Sjdp * Redistribution and use in source and binary forms, with or 1134192Sjdp * without modification, are permitted provided that the following 1234192Sjdp * conditions are met: 1334192Sjdp * 1434192Sjdp * - Redistributions of source code must retain the above 1534192Sjdp * copyright notice, this list of conditions and the following 1634192Sjdp * disclaimer. 1734192Sjdp * 1834192Sjdp * - Redistributions in binary form must reproduce the above 1934192Sjdp * copyright notice, this list of conditions and the following 2034192Sjdp * disclaimer in the documentation and/or other materials 2134192Sjdp * provided with the distribution. 2234192Sjdp * 2334192Sjdp * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 2434192Sjdp * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 2550476Speter * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 2634192Sjdp * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 2734192Sjdp * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 2834192Sjdp * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 2934192Sjdp * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 3034192Sjdp * SOFTWARE. 3176224Sobrien */ 3234192Sjdp 3350608Sjdp#ifndef KERN_ABI_H 3434192Sjdp#define KERN_ABI_H 3576224Sobrien 3635529Sdfr#include <linux/types.h> 3734192Sjdp 3834192Sjdp/* 39115396Skan * Increment this value if any changes that break userspace ABI 4045501Sjdp * compatibility are made. 4145501Sjdp */ 42127250Speter#define IB_USER_VERBS_ABI_VERSION 1 43127250Speter 44127250Speterenum { 45127250Speter IB_USER_VERBS_CMD_GET_CONTEXT, 46127250Speter IB_USER_VERBS_CMD_GET_EVENT_FDS, 47127250Speter IB_USER_VERBS_CMD_ALLOC_PD, 48127250Speter IB_USER_VERBS_CMD_DEALLOC_PD, 49127250Speter IB_USER_VERBS_CMD_REG_MR, 50127250Speter IB_USER_VERBS_CMD_DEREG_MR 5134192Sjdp}; 52119013Sgordon 5334192Sjdp/* 54127250Speter * Make sure that all structs defined in this file remain laid out so 55127250Speter * that they pack the same way on 32-bit and 64-bit architectures (to 56127250Speter * avoid incompatibility between 32-bit userspace and 64-bit kernels). 5734192Sjdp * In particular do not use pointer types -- pass pointers in __u64 5834192Sjdp * instead. 5934192Sjdp */ 6034192Sjdp 6134192Sjdpstruct ibv_kern_async_event { 6234192Sjdp __u32 event_type; 6334192Sjdp __u32 element; 6434192Sjdp}; 6534192Sjdp 6650609Sjdpstruct ibv_comp_event { 6734192Sjdp __u32 cq_handle; 6834192Sjdp}; 6955687Sjdp 7050608Sjdp/* 7160938Sjake * All commands from userspace should start with a __u32 command field 7250608Sjdp * followed by __u16 in_words and out_words fields (which give the 7350608Sjdp * length of the command block and response buffer if any in 32-bit 7450608Sjdp * words). The kernel driver will read these fields first and read 7560938Sjake * the rest of the command struct based on these value. 7650608Sjdp */ 7763870Sjdp 7855687Sjdpstruct ibv_get_context { 7955687Sjdp __u32 command; 8055687Sjdp __u16 in_words; 8134192Sjdp __u16 out_words; 8234192Sjdp __u64 response; 8334192Sjdp}; 8434192Sjdp 8534192Sjdpstruct ibv_get_context_resp { 8634192Sjdp __u32 num_cq_events; 8762801Sjdp}; 8862801Sjdp 8962801Sjdpstruct ibv_get_event_fds { 9062801Sjdp __u32 command; 9162801Sjdp __u16 in_words; 9262801Sjdp __u16 out_words; 9362801Sjdp __u64 response; 9462801Sjdp}; 9562801Sjdp 9662801Sjdpstruct ibv_get_event_fds_resp { 9762801Sjdp __u32 async_fd; 9862801Sjdp __u32 cq_fd[1]; 9962801Sjdp}; 10062801Sjdp 10162801Sjdp#endif /* KERN_ABI_H */ 10262801Sjdp