xref: /freebsd/sys/ofed/drivers/infiniband/core/agent.h (revision 95ee2897e98f5d444f26ed2334cc7c439f9c16c6)
1*fe267a55SPedro F. Giffuni /*-
2*fe267a55SPedro F. Giffuni  * SPDX-License-Identifier: BSD-2-Clause OR GPL-2.0
3*fe267a55SPedro F. Giffuni  *
4aa0a1e58SJeff Roberson  * Copyright (c) 2004 Mellanox Technologies Ltd.  All rights reserved.
5aa0a1e58SJeff Roberson  * Copyright (c) 2004 Infinicon Corporation.  All rights reserved.
6aa0a1e58SJeff Roberson  * Copyright (c) 2004 Intel Corporation.  All rights reserved.
7aa0a1e58SJeff Roberson  * Copyright (c) 2004 Topspin Corporation.  All rights reserved.
8aa0a1e58SJeff Roberson  * Copyright (c) 2004 Voltaire Corporation.  All rights reserved.
9aa0a1e58SJeff Roberson  *
10aa0a1e58SJeff Roberson  * This software is available to you under a choice of one of two
11aa0a1e58SJeff Roberson  * licenses.  You may choose to be licensed under the terms of the GNU
12aa0a1e58SJeff Roberson  * General Public License (GPL) Version 2, available from the file
13aa0a1e58SJeff Roberson  * COPYING in the main directory of this source tree, or the
14aa0a1e58SJeff Roberson  * OpenIB.org BSD license below:
15aa0a1e58SJeff Roberson  *
16aa0a1e58SJeff Roberson  *     Redistribution and use in source and binary forms, with or
17aa0a1e58SJeff Roberson  *     without modification, are permitted provided that the following
18aa0a1e58SJeff Roberson  *     conditions are met:
19aa0a1e58SJeff Roberson  *
20aa0a1e58SJeff Roberson  *      - Redistributions of source code must retain the above
21aa0a1e58SJeff Roberson  *        copyright notice, this list of conditions and the following
22aa0a1e58SJeff Roberson  *        disclaimer.
23aa0a1e58SJeff Roberson  *
24aa0a1e58SJeff Roberson  *      - Redistributions in binary form must reproduce the above
25aa0a1e58SJeff Roberson  *        copyright notice, this list of conditions and the following
26aa0a1e58SJeff Roberson  *        disclaimer in the documentation and/or other materials
27aa0a1e58SJeff Roberson  *        provided with the distribution.
28aa0a1e58SJeff Roberson  *
29aa0a1e58SJeff Roberson  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
30aa0a1e58SJeff Roberson  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
31aa0a1e58SJeff Roberson  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
32aa0a1e58SJeff Roberson  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
33aa0a1e58SJeff Roberson  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
34aa0a1e58SJeff Roberson  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
35aa0a1e58SJeff Roberson  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
36aa0a1e58SJeff Roberson  * SOFTWARE.
37aa0a1e58SJeff Roberson  */
38aa0a1e58SJeff Roberson 
39aa0a1e58SJeff Roberson #ifndef __AGENT_H_
40aa0a1e58SJeff Roberson #define __AGENT_H_
41aa0a1e58SJeff Roberson 
42aa0a1e58SJeff Roberson #include <linux/err.h>
43aa0a1e58SJeff Roberson #include <rdma/ib_mad.h>
44aa0a1e58SJeff Roberson 
45aa0a1e58SJeff Roberson extern int ib_agent_port_open(struct ib_device *device, int port_num);
46aa0a1e58SJeff Roberson 
47aa0a1e58SJeff Roberson extern int ib_agent_port_close(struct ib_device *device, int port_num);
48aa0a1e58SJeff Roberson 
49478d3005SHans Petter Selasky extern void agent_send_response(const struct ib_mad_hdr *mad_hdr, const struct ib_grh *grh,
50478d3005SHans Petter Selasky 				const struct ib_wc *wc, const struct ib_device *device,
51478d3005SHans Petter Selasky 				int port_num, int qpn, size_t resp_mad_len, bool opa);
52aa0a1e58SJeff Roberson 
53aa0a1e58SJeff Roberson #endif	/* __AGENT_H_ */
54