2 * Copyright (c) 2004 Topspin Communications. All rights reserved.
3 * Copyright (c) 2005 Intel Corporation. All rights reserved.
4 * Copyright (c) 2005 Sun Microsystems, Inc. All rights reserved.
6 * This software is available to you under a choice of one of two
7 * licenses. You may choose to be licensed under the terms of the GNU
8 * General Public License (GPL) Version 2, available from the file
9 * COPYING in the main directory of this source tree, or the
10 * OpenIB.org BSD license below:
12 * Redistribution and use in source and binary forms, with or
13 * without modification, are permitted provided that the following
16 * - Redistributions of source code must retain the above
17 * copyright notice, this list of conditions and the following
20 * - Redistributions in binary form must reproduce the above
21 * copyright notice, this list of conditions and the following
22 * disclaimer in the documentation and/or other materials
23 * provided with the distribution.
25 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
26 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
27 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
28 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
29 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
30 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
31 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
38 #include <rdma/ib_verbs.h>
40 int rdma_query_gid(struct ib_device *device, u8 port_num, int index,
42 const struct ib_gid_attr *rdma_find_gid(struct ib_device *device,
43 const union ib_gid *gid,
44 enum ib_gid_type gid_type,
45 struct net_device *ndev);
46 const struct ib_gid_attr *rdma_find_gid_by_port(struct ib_device *ib_dev,
47 const union ib_gid *gid,
48 enum ib_gid_type gid_type,
50 struct net_device *ndev);
51 const struct ib_gid_attr *rdma_find_gid_by_filter(
52 struct ib_device *device, const union ib_gid *gid, u8 port_num,
53 bool (*filter)(const union ib_gid *gid, const struct ib_gid_attr *,
57 int rdma_read_gid_l2_fields(const struct ib_gid_attr *attr,
58 u16 *vlan_id, u8 *smac);
61 * ib_get_cached_pkey - Returns a cached PKey table entry
62 * @device: The device to query.
63 * @port_num: The port number of the device to query.
64 * @index: The index into the cached PKey table to query.
65 * @pkey: The PKey value found at the specified index.
67 * ib_get_cached_pkey() fetches the specified PKey table entry stored in
68 * the local software cache.
70 int ib_get_cached_pkey(struct ib_device *device_handle,
76 * ib_find_cached_pkey - Returns the PKey table index where a specified
78 * @device: The device to query.
79 * @port_num: The port number of the device to search for the PKey.
80 * @pkey: The PKey value to search for.
81 * @index: The index into the cached PKey table where the PKey was found.
83 * ib_find_cached_pkey() searches the specified PKey table in
84 * the local software cache.
86 int ib_find_cached_pkey(struct ib_device *device,
92 * ib_find_exact_cached_pkey - Returns the PKey table index where a specified
93 * PKey value occurs. Comparison uses the FULL 16 bits (incl membership bit)
94 * @device: The device to query.
95 * @port_num: The port number of the device to search for the PKey.
96 * @pkey: The PKey value to search for.
97 * @index: The index into the cached PKey table where the PKey was found.
99 * ib_find_exact_cached_pkey() searches the specified PKey table in
100 * the local software cache.
102 int ib_find_exact_cached_pkey(struct ib_device *device,
108 * ib_get_cached_lmc - Returns a cached lmc table entry
109 * @device: The device to query.
110 * @port_num: The port number of the device to query.
111 * @lmc: The lmc value for the specified port for that device.
113 * ib_get_cached_lmc() fetches the specified lmc table entry stored in
114 * the local software cache.
116 int ib_get_cached_lmc(struct ib_device *device,
121 * ib_get_cached_port_state - Returns a cached port state table entry
122 * @device: The device to query.
123 * @port_num: The port number of the device to query.
124 * @port_state: port_state for the specified port for that device.
126 * ib_get_cached_port_state() fetches the specified port_state table entry stored in
127 * the local software cache.
129 int ib_get_cached_port_state(struct ib_device *device,
131 enum ib_port_state *port_active);
133 bool rdma_is_zero_gid(const union ib_gid *gid);
134 const struct ib_gid_attr *rdma_get_gid_attr(struct ib_device *device,
135 u8 port_num, int index);
136 void rdma_put_gid_attr(const struct ib_gid_attr *attr);
137 void rdma_hold_gid_attr(const struct ib_gid_attr *attr);
139 #endif /* _IB_CACHE_H */