162306a36Sopenharmony_ci/* This file is part of the Emulex RoCE Device Driver for 262306a36Sopenharmony_ci * RoCE (RDMA over Converged Ethernet) adapters. 362306a36Sopenharmony_ci * Copyright (C) 2012-2015 Emulex. All rights reserved. 462306a36Sopenharmony_ci * EMULEX and SLI are trademarks of Emulex. 562306a36Sopenharmony_ci * www.emulex.com 662306a36Sopenharmony_ci * 762306a36Sopenharmony_ci * This software is available to you under a choice of one of two licenses. 862306a36Sopenharmony_ci * You may choose to be licensed under the terms of the GNU General Public 962306a36Sopenharmony_ci * License (GPL) Version 2, available from the file COPYING in the main 1062306a36Sopenharmony_ci * directory of this source tree, or the BSD license below: 1162306a36Sopenharmony_ci * 1262306a36Sopenharmony_ci * Redistribution and use in source and binary forms, with or without 1362306a36Sopenharmony_ci * modification, are permitted provided that the following conditions 1462306a36Sopenharmony_ci * are met: 1562306a36Sopenharmony_ci * 1662306a36Sopenharmony_ci * - Redistributions of source code must retain the above copyright notice, 1762306a36Sopenharmony_ci * this list of conditions and the following disclaimer. 1862306a36Sopenharmony_ci * 1962306a36Sopenharmony_ci * - Redistributions in binary form must reproduce the above copyright 2062306a36Sopenharmony_ci * notice, this list of conditions and the following disclaimer in 2162306a36Sopenharmony_ci * the documentation and/or other materials provided with the distribution. 2262306a36Sopenharmony_ci * 2362306a36Sopenharmony_ci * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 2462306a36Sopenharmony_ci * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,THE 2562306a36Sopenharmony_ci * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2662306a36Sopenharmony_ci * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 2762306a36Sopenharmony_ci * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 2862306a36Sopenharmony_ci * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 2962306a36Sopenharmony_ci * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 3062306a36Sopenharmony_ci * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 3162306a36Sopenharmony_ci * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 3262306a36Sopenharmony_ci * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 3362306a36Sopenharmony_ci * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 3462306a36Sopenharmony_ci * 3562306a36Sopenharmony_ci * Contact Information: 3662306a36Sopenharmony_ci * linux-drivers@emulex.com 3762306a36Sopenharmony_ci * 3862306a36Sopenharmony_ci * Emulex 3962306a36Sopenharmony_ci * 3333 Susan Street 4062306a36Sopenharmony_ci * Costa Mesa, CA 92626 4162306a36Sopenharmony_ci */ 4262306a36Sopenharmony_ci 4362306a36Sopenharmony_ci#ifndef __OCRDMA_AH_H__ 4462306a36Sopenharmony_ci#define __OCRDMA_AH_H__ 4562306a36Sopenharmony_ci 4662306a36Sopenharmony_cienum { 4762306a36Sopenharmony_ci OCRDMA_AH_ID_MASK = 0x3FF, 4862306a36Sopenharmony_ci OCRDMA_AH_VLAN_VALID_MASK = 0x01, 4962306a36Sopenharmony_ci OCRDMA_AH_VLAN_VALID_SHIFT = 0x1F, 5062306a36Sopenharmony_ci OCRDMA_AH_L3_TYPE_MASK = 0x03, 5162306a36Sopenharmony_ci OCRDMA_AH_L3_TYPE_SHIFT = 0x1D /* 29 bits */ 5262306a36Sopenharmony_ci}; 5362306a36Sopenharmony_ci 5462306a36Sopenharmony_ciint ocrdma_create_ah(struct ib_ah *ah, struct rdma_ah_init_attr *init_attr, 5562306a36Sopenharmony_ci struct ib_udata *udata); 5662306a36Sopenharmony_ciint ocrdma_destroy_ah(struct ib_ah *ah, u32 flags); 5762306a36Sopenharmony_ciint ocrdma_query_ah(struct ib_ah *ah, struct rdma_ah_attr *ah_attr); 5862306a36Sopenharmony_ci 5962306a36Sopenharmony_ciint ocrdma_process_mad(struct ib_device *dev, int process_mad_flags, 6062306a36Sopenharmony_ci u32 port_num, const struct ib_wc *in_wc, 6162306a36Sopenharmony_ci const struct ib_grh *in_grh, const struct ib_mad *in, 6262306a36Sopenharmony_ci struct ib_mad *out, size_t *out_mad_size, 6362306a36Sopenharmony_ci u16 *out_mad_pkey_index); 6462306a36Sopenharmony_ci#endif /* __OCRDMA_AH_H__ */ 65