xref: /linux/drivers/infiniband/hw/ocrdma/ocrdma_ah.h (revision 8be98d2f2a0a262f8bf8a0bc1fdf522b3c7aab17)
171ee6730SDevesh Sharma /* This file is part of the Emulex RoCE Device Driver for
271ee6730SDevesh Sharma  * RoCE (RDMA over Converged Ethernet) adapters.
371ee6730SDevesh Sharma  * Copyright (C) 2012-2015 Emulex. All rights reserved.
471ee6730SDevesh Sharma  * EMULEX and SLI are trademarks of Emulex.
571ee6730SDevesh Sharma  * www.emulex.com
671ee6730SDevesh Sharma  *
771ee6730SDevesh Sharma  * This software is available to you under a choice of one of two licenses.
871ee6730SDevesh Sharma  * You may choose to be licensed under the terms of the GNU General Public
971ee6730SDevesh Sharma  * License (GPL) Version 2, available from the file COPYING in the main
1071ee6730SDevesh Sharma  * directory of this source tree, or the BSD license below:
1171ee6730SDevesh Sharma  *
1271ee6730SDevesh Sharma  * Redistribution and use in source and binary forms, with or without
1371ee6730SDevesh Sharma  * modification, are permitted provided that the following conditions
1471ee6730SDevesh Sharma  * are met:
1571ee6730SDevesh Sharma  *
1671ee6730SDevesh Sharma  * - Redistributions of source code must retain the above copyright notice,
1771ee6730SDevesh Sharma  *   this list of conditions and the following disclaimer.
1871ee6730SDevesh Sharma  *
1971ee6730SDevesh Sharma  * - Redistributions in binary form must reproduce the above copyright
2071ee6730SDevesh Sharma  *   notice, this list of conditions and the following disclaimer in
2171ee6730SDevesh Sharma  *   the documentation and/or other materials provided with the distribution.
2271ee6730SDevesh Sharma  *
2371ee6730SDevesh Sharma  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
2471ee6730SDevesh Sharma  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,THE
2571ee6730SDevesh Sharma  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2671ee6730SDevesh Sharma  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
2771ee6730SDevesh Sharma  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
2871ee6730SDevesh Sharma  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
2971ee6730SDevesh Sharma  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
3071ee6730SDevesh Sharma  * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
3171ee6730SDevesh Sharma  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
3271ee6730SDevesh Sharma  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
3371ee6730SDevesh Sharma  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34fe2caefcSParav Pandit  *
35fe2caefcSParav Pandit  * Contact Information:
36fe2caefcSParav Pandit  * linux-drivers@emulex.com
37fe2caefcSParav Pandit  *
38fe2caefcSParav Pandit  * Emulex
39fe2caefcSParav Pandit  * 3333 Susan Street
40fe2caefcSParav Pandit  * Costa Mesa, CA 92626
4171ee6730SDevesh Sharma  */
42fe2caefcSParav Pandit 
43fe2caefcSParav Pandit #ifndef __OCRDMA_AH_H__
44fe2caefcSParav Pandit #define __OCRDMA_AH_H__
45fe2caefcSParav Pandit 
4629565f2fSDevesh Sharma enum {
4729565f2fSDevesh Sharma 	OCRDMA_AH_ID_MASK		= 0x3FF,
4829565f2fSDevesh Sharma 	OCRDMA_AH_VLAN_VALID_MASK	= 0x01,
49834d16d6SDevesh Sharma 	OCRDMA_AH_VLAN_VALID_SHIFT	= 0x1F,
50834d16d6SDevesh Sharma 	OCRDMA_AH_L3_TYPE_MASK		= 0x03,
51834d16d6SDevesh Sharma 	OCRDMA_AH_L3_TYPE_SHIFT		= 0x1D /* 29 bits */
5229565f2fSDevesh Sharma };
53477864c8SMoni Shoua 
54fa5d010cSMaor Gottlieb int ocrdma_create_ah(struct ib_ah *ah, struct rdma_ah_init_attr *init_attr,
55d3456914SLeon Romanovsky 		     struct ib_udata *udata);
569a9ebf8cSLeon Romanovsky int ocrdma_destroy_ah(struct ib_ah *ah, u32 flags);
5790898850SDasaratharaman Chandramouli int ocrdma_query_ah(struct ib_ah *ah, struct rdma_ah_attr *ah_attr);
58fe2caefcSParav Pandit 
59e26e7b88SLeon Romanovsky int ocrdma_process_mad(struct ib_device *dev, int process_mad_flags,
60*1fb7f897SMark Bloch 		       u32 port_num, const struct ib_wc *in_wc,
61e26e7b88SLeon Romanovsky 		       const struct ib_grh *in_grh, const struct ib_mad *in,
62e26e7b88SLeon Romanovsky 		       struct ib_mad *out, size_t *out_mad_size,
634cd7c947SIra Weiny 		       u16 *out_mad_pkey_index);
64fe2caefcSParav Pandit #endif				/* __OCRDMA_AH_H__ */
65