/*1* Copyright (c) 2004 Topspin Communications. All rights reserved.2* Copyright (c) 2005 Intel Corporation. All rights reserved.3* Copyright (c) 2005 Sun Microsystems, Inc. All rights reserved.4*5* This software is available to you under a choice of one of two6* licenses. You may choose to be licensed under the terms of the GNU7* General Public License (GPL) Version 2, available from the file8* COPYING in the main directory of this source tree, or the9* OpenIB.org BSD license below:10*11* Redistribution and use in source and binary forms, with or12* without modification, are permitted provided that the following13* conditions are met:14*15* - Redistributions of source code must retain the above16* copyright notice, this list of conditions and the following17* disclaimer.18*19* - Redistributions in binary form must reproduce the above20* copyright notice, this list of conditions and the following21* disclaimer in the documentation and/or other materials22* provided with the distribution.23*24* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,25* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF26* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND27* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS28* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN29* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN30* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE31* SOFTWARE.32*/3334#ifndef _IB_CACHE_H35#define _IB_CACHE_H3637#include <rdma/ib_verbs.h>3839/**40* ib_get_cached_gid - Returns a cached GID table entry41* @device: The device to query.42* @port_num: The port number of the device to query.43* @index: The index into the cached GID table to query.44* @gid: The GID value found at the specified index.45*46* ib_get_cached_gid() fetches the specified GID table entry stored in47* the local software cache.48*/49int ib_get_cached_gid(struct ib_device *device,50u8 port_num,51int index,52union ib_gid *gid);5354/**55* ib_find_cached_gid - Returns the port number and GID table index where56* a specified GID value occurs.57* @device: The device to query.58* @gid: The GID value to search for.59* @port_num: The port number of the device where the GID value was found.60* @index: The index into the cached GID table where the GID was found. This61* parameter may be NULL.62*63* ib_find_cached_gid() searches for the specified GID value in64* the local software cache.65*/66int ib_find_cached_gid(struct ib_device *device,67union ib_gid *gid,68u8 *port_num,69u16 *index);7071/**72* ib_get_cached_pkey - Returns a cached PKey table entry73* @device: The device to query.74* @port_num: The port number of the device to query.75* @index: The index into the cached PKey table to query.76* @pkey: The PKey value found at the specified index.77*78* ib_get_cached_pkey() fetches the specified PKey table entry stored in79* the local software cache.80*/81int ib_get_cached_pkey(struct ib_device *device_handle,82u8 port_num,83int index,84u16 *pkey);8586/**87* ib_find_cached_pkey - Returns the PKey table index where a specified88* PKey value occurs.89* @device: The device to query.90* @port_num: The port number of the device to search for the PKey.91* @pkey: The PKey value to search for.92* @index: The index into the cached PKey table where the PKey was found.93*94* ib_find_cached_pkey() searches the specified PKey table in95* the local software cache.96*/97int ib_find_cached_pkey(struct ib_device *device,98u8 port_num,99u16 pkey,100u16 *index);101102/**103* ib_get_cached_lmc - Returns a cached lmc table entry104* @device: The device to query.105* @port_num: The port number of the device to query.106* @lmc: The lmc value for the specified port for that device.107*108* ib_get_cached_lmc() fetches the specified lmc table entry stored in109* the local software cache.110*/111int ib_get_cached_lmc(struct ib_device *device,112u8 port_num,113u8 *lmc);114115#endif /* _IB_CACHE_H */116117118