ib_cache.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. /*
  2. * Copyright (c) 2004 Topspin Communications. All rights reserved.
  3. *
  4. * This software is available to you under a choice of one of two
  5. * licenses. You may choose to be licensed under the terms of the GNU
  6. * General Public License (GPL) Version 2, available from the file
  7. * COPYING in the main directory of this source tree, or the
  8. * OpenIB.org BSD license below:
  9. *
  10. * Redistribution and use in source and binary forms, with or
  11. * without modification, are permitted provided that the following
  12. * conditions are met:
  13. *
  14. * - Redistributions of source code must retain the above
  15. * copyright notice, this list of conditions and the following
  16. * disclaimer.
  17. *
  18. * - Redistributions in binary form must reproduce the above
  19. * copyright notice, this list of conditions and the following
  20. * disclaimer in the documentation and/or other materials
  21. * provided with the distribution.
  22. *
  23. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  24. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  25. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  26. * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
  27. * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
  28. * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  29. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  30. * SOFTWARE.
  31. *
  32. * $Id: ib_cache.h 1349 2004-12-16 21:09:43Z roland $
  33. */
  34. #ifndef _IB_CACHE_H
  35. #define _IB_CACHE_H
  36. #include <ib_verbs.h>
  37. /**
  38. * ib_get_cached_gid - Returns a cached GID table entry
  39. * @device: The device to query.
  40. * @port_num: The port number of the device to query.
  41. * @index: The index into the cached GID table to query.
  42. * @gid: The GID value found at the specified index.
  43. *
  44. * ib_get_cached_gid() fetches the specified GID table entry stored in
  45. * the local software cache.
  46. */
  47. int ib_get_cached_gid(struct ib_device *device,
  48. u8 port_num,
  49. int index,
  50. union ib_gid *gid);
  51. /**
  52. * ib_find_cached_gid - Returns the port number and GID table index where
  53. * a specified GID value occurs.
  54. * @device: The device to query.
  55. * @gid: The GID value to search for.
  56. * @port_num: The port number of the device where the GID value was found.
  57. * @index: The index into the cached GID table where the GID was found. This
  58. * parameter may be NULL.
  59. *
  60. * ib_find_cached_gid() searches for the specified GID value in
  61. * the local software cache.
  62. */
  63. int ib_find_cached_gid(struct ib_device *device,
  64. union ib_gid *gid,
  65. u8 *port_num,
  66. u16 *index);
  67. /**
  68. * ib_get_cached_pkey - Returns a cached PKey table entry
  69. * @device: The device to query.
  70. * @port_num: The port number of the device to query.
  71. * @index: The index into the cached PKey table to query.
  72. * @pkey: The PKey value found at the specified index.
  73. *
  74. * ib_get_cached_pkey() fetches the specified PKey table entry stored in
  75. * the local software cache.
  76. */
  77. int ib_get_cached_pkey(struct ib_device *device_handle,
  78. u8 port_num,
  79. int index,
  80. u16 *pkey);
  81. /**
  82. * ib_find_cached_pkey - Returns the PKey table index where a specified
  83. * PKey value occurs.
  84. * @device: The device to query.
  85. * @port_num: The port number of the device to search for the PKey.
  86. * @pkey: The PKey value to search for.
  87. * @index: The index into the cached PKey table where the PKey was found.
  88. *
  89. * ib_find_cached_pkey() searches the specified PKey table in
  90. * the local software cache.
  91. */
  92. int ib_find_cached_pkey(struct ib_device *device,
  93. u8 port_num,
  94. u16 pkey,
  95. u16 *index);
  96. #endif /* _IB_CACHE_H */