xref: /linux/drivers/infiniband/hw/ocrdma/ocrdma_ah.h (revision 93df8a1ed6231727c5db94a80b1a6bd5ee67cec3)
1 /*******************************************************************
2  * This file is part of the Emulex RoCE Device Driver for          *
3  * RoCE (RDMA over Converged Ethernet) adapters.                   *
4  * Copyright (C) 2008-2012 Emulex. All rights reserved.            *
5  * EMULEX and SLI are trademarks of Emulex.                        *
6  * www.emulex.com                                                  *
7  *                                                                 *
8  * This program is free software; you can redistribute it and/or   *
9  * modify it under the terms of version 2 of the GNU General       *
10  * Public License as published by the Free Software Foundation.    *
11  * This program is distributed in the hope that it will be useful. *
12  * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND          *
13  * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY,  *
14  * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE      *
15  * DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD *
16  * TO BE LEGALLY INVALID.  See the GNU General Public License for  *
17  * more details, a copy of which can be found in the file COPYING  *
18  * included with this package.                                     *
19  *
20  * Contact Information:
21  * linux-drivers@emulex.com
22  *
23  * Emulex
24  * 3333 Susan Street
25  * Costa Mesa, CA 92626
26  *******************************************************************/
27 
28 #ifndef __OCRDMA_AH_H__
29 #define __OCRDMA_AH_H__
30 
31 enum {
32 	OCRDMA_AH_ID_MASK		= 0x3FF,
33 	OCRDMA_AH_VLAN_VALID_MASK	= 0x01,
34 	OCRDMA_AH_VLAN_VALID_SHIFT	= 0x1F
35 };
36 
37 struct ib_ah *ocrdma_create_ah(struct ib_pd *, struct ib_ah_attr *);
38 int ocrdma_destroy_ah(struct ib_ah *);
39 int ocrdma_query_ah(struct ib_ah *, struct ib_ah_attr *);
40 int ocrdma_modify_ah(struct ib_ah *, struct ib_ah_attr *);
41 
42 int ocrdma_process_mad(struct ib_device *,
43 		       int process_mad_flags,
44 		       u8 port_num,
45 		       const struct ib_wc *in_wc,
46 		       const struct ib_grh *in_grh,
47 		       const struct ib_mad_hdr *in, size_t in_mad_size,
48 		       struct ib_mad_hdr *out, size_t *out_mad_size,
49 		       u16 *out_mad_pkey_index);
50 #endif				/* __OCRDMA_AH_H__ */
51