viosrp.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. /*****************************************************************************/
  2. /* srp.h -- SCSI RDMA Protocol definitions */
  3. /* */
  4. /* Written By: Colin Devilbis, IBM Corporation */
  5. /* */
  6. /* Copyright (C) 2003 IBM Corporation */
  7. /* */
  8. /* This program is free software; you can redistribute it and/or modify */
  9. /* it under the terms of the GNU General Public License as published by */
  10. /* the Free Software Foundation; either version 2 of the License, or */
  11. /* (at your option) any later version. */
  12. /* */
  13. /* This program is distributed in the hope that it will be useful, */
  14. /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
  15. /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
  16. /* GNU General Public License for more details. */
  17. /* */
  18. /* You should have received a copy of the GNU General Public License */
  19. /* along with this program; if not, write to the Free Software */
  20. /* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
  21. /* */
  22. /* */
  23. /* This file contains structures and definitions for IBM RPA (RS/6000 */
  24. /* platform architecture) implementation of the SRP (SCSI RDMA Protocol) */
  25. /* standard. SRP is used on IBM iSeries and pSeries platforms to send SCSI */
  26. /* commands between logical partitions. */
  27. /* */
  28. /* SRP Information Units (IUs) are sent on a "Command/Response Queue" (CRQ) */
  29. /* between partitions. The definitions in this file are architected, */
  30. /* and cannot be changed without breaking compatibility with other versions */
  31. /* of Linux and other operating systems (AIX, OS/400) that talk this protocol*/
  32. /* between logical partitions */
  33. /*****************************************************************************/
  34. #ifndef VIOSRP_H
  35. #define VIOSRP_H
  36. #include "srp.h"
  37. enum viosrp_crq_formats {
  38. VIOSRP_SRP_FORMAT = 0x01,
  39. VIOSRP_MAD_FORMAT = 0x02,
  40. VIOSRP_OS400_FORMAT = 0x03,
  41. VIOSRP_AIX_FORMAT = 0x04,
  42. VIOSRP_LINUX_FORMAT = 0x06,
  43. VIOSRP_INLINE_FORMAT = 0x07
  44. };
  45. struct viosrp_crq {
  46. u8 valid; /* used by RPA */
  47. u8 format; /* SCSI vs out-of-band */
  48. u8 reserved;
  49. u8 status; /* non-scsi failure? (e.g. DMA failure) */
  50. u16 timeout; /* in seconds */
  51. u16 IU_length; /* in bytes */
  52. u64 IU_data_ptr; /* the TCE for transferring data */
  53. };
  54. /* MADs are Management requests above and beyond the IUs defined in the SRP
  55. * standard.
  56. */
  57. enum viosrp_mad_types {
  58. VIOSRP_EMPTY_IU_TYPE = 0x01,
  59. VIOSRP_ERROR_LOG_TYPE = 0x02,
  60. VIOSRP_ADAPTER_INFO_TYPE = 0x03,
  61. VIOSRP_HOST_CONFIG_TYPE = 0x04
  62. };
  63. /*
  64. * Common MAD header
  65. */
  66. struct mad_common {
  67. u32 type;
  68. u16 status;
  69. u16 length;
  70. u64 tag;
  71. };
  72. /*
  73. * All SRP (and MAD) requests normally flow from the
  74. * client to the server. There is no way for the server to send
  75. * an asynchronous message back to the client. The Empty IU is used
  76. * to hang out a meaningless request to the server so that it can respond
  77. * asynchrouously with something like a SCSI AER
  78. */
  79. struct viosrp_empty_iu {
  80. struct mad_common common;
  81. u64 buffer;
  82. u32 port;
  83. };
  84. struct viosrp_error_log {
  85. struct mad_common common;
  86. u64 buffer;
  87. };
  88. struct viosrp_adapter_info {
  89. struct mad_common common;
  90. u64 buffer;
  91. };
  92. struct viosrp_host_config {
  93. struct mad_common common;
  94. u64 buffer;
  95. };
  96. union mad_iu {
  97. struct viosrp_empty_iu empty_iu;
  98. struct viosrp_error_log error_log;
  99. struct viosrp_adapter_info adapter_info;
  100. struct viosrp_host_config host_config;
  101. };
  102. union viosrp_iu {
  103. union srp_iu srp;
  104. union mad_iu mad;
  105. };
  106. struct mad_adapter_info_data {
  107. char srp_version[8];
  108. char partition_name[96];
  109. u32 partition_number;
  110. u32 mad_version;
  111. u32 os_type;
  112. u32 port_max_txu[8]; /* per-port maximum transfer */
  113. };
  114. #endif