You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

sbft.h 3.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. #ifndef _IPXE_SBFT_H
  2. #define _IPXE_SBFT_H
  3. /*
  4. * Copyright (C) 2009 Fen Systems Ltd <mbrown@fensystems.co.uk>.
  5. * All rights reserved.
  6. *
  7. * Redistribution and use in source and binary forms, with or without
  8. * modification, are permitted provided that the following conditions
  9. * are met:
  10. *
  11. * Redistributions of source code must retain the above copyright
  12. * notice, this list of conditions and the following disclaimer.
  13. *
  14. * Redistributions in binary form must reproduce the above copyright
  15. * notice, this list of conditions and the following disclaimer in
  16. * the documentation and/or other materials provided with the
  17. * distribution.
  18. *
  19. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  20. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  21. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  22. * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  23. * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  24. * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  25. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  26. * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  27. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  28. * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  29. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
  30. * OF THE POSSIBILITY OF SUCH DAMAGE.
  31. */
  32. FILE_LICENCE ( BSD2 );
  33. /** @file
  34. *
  35. * SRP boot firmware table
  36. *
  37. * The working draft specification for the SRP boot firmware table can
  38. * be found at
  39. *
  40. * http://ipxe.org/wiki/srp/sbft
  41. *
  42. */
  43. #include <stdint.h>
  44. #include <ipxe/acpi.h>
  45. #include <ipxe/scsi.h>
  46. #include <ipxe/srp.h>
  47. #include <ipxe/ib_srp.h>
  48. /** SRP Boot Firmware Table signature */
  49. #define SBFT_SIG "sBFT"
  50. /** An offset from the start of the sBFT */
  51. typedef uint16_t sbft_off_t;
  52. /**
  53. * SRP Boot Firmware Table
  54. */
  55. struct sbft_table {
  56. /** ACPI header */
  57. struct acpi_description_header acpi;
  58. /** Offset to SCSI subtable */
  59. sbft_off_t scsi_offset;
  60. /** Offset to SRP subtable */
  61. sbft_off_t srp_offset;
  62. /** Offset to IB subtable, if present */
  63. sbft_off_t ib_offset;
  64. /** Reserved */
  65. uint8_t reserved[6];
  66. } __attribute__ (( packed ));
  67. /**
  68. * sBFT SCSI subtable
  69. */
  70. struct sbft_scsi_subtable {
  71. /** LUN */
  72. struct scsi_lun lun;
  73. } __attribute__ (( packed ));
  74. /**
  75. * sBFT SRP subtable
  76. */
  77. struct sbft_srp_subtable {
  78. /** Initiator and target ports */
  79. struct srp_port_ids port_ids;
  80. } __attribute__ (( packed ));
  81. /**
  82. * sBFT IB subtable
  83. */
  84. struct sbft_ib_subtable {
  85. /** Source GID */
  86. struct ib_gid sgid;
  87. /** Destination GID */
  88. struct ib_gid dgid;
  89. /** Service ID */
  90. struct ib_gid_half service_id;
  91. /** Partition key */
  92. uint16_t pkey;
  93. /** Reserved */
  94. uint8_t reserved[6];
  95. } __attribute__ (( packed ));
  96. /**
  97. * An sBFT created by iPXE
  98. */
  99. struct ipxe_sbft {
  100. /** The table header */
  101. struct sbft_table table;
  102. /** The SCSI subtable */
  103. struct sbft_scsi_subtable scsi;
  104. /** The SRP subtable */
  105. struct sbft_srp_subtable srp;
  106. /** The IB subtable */
  107. struct sbft_ib_subtable ib;
  108. } __attribute__ (( packed, aligned ( 16 ) ));
  109. struct srp_device;
  110. extern int sbft_fill_data ( struct srp_device *srp );
  111. #endif /* _IPXE_SBFT_H */