sbft.h

Go to the documentation of this file.
00001 #ifndef _GPXE_SBFT_H
00002 #define _GPXE_SBFT_H
00003 
00004 /*
00005  * Copyright (C) 2009 Fen Systems Ltd <mbrown@fensystems.co.uk>.
00006  * All rights reserved.
00007  *
00008  * Redistribution and use in source and binary forms, with or without
00009  * modification, are permitted provided that the following conditions
00010  * are met:
00011  *
00012  *   Redistributions of source code must retain the above copyright
00013  *   notice, this list of conditions and the following disclaimer.
00014  *
00015  *   Redistributions in binary form must reproduce the above copyright
00016  *   notice, this list of conditions and the following disclaimer in
00017  *   the documentation and/or other materials provided with the
00018  *   distribution.
00019  *
00020  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00021  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00022  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
00023  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
00024  * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
00025  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
00026  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00027  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
00028  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
00029  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
00030  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
00031  * OF THE POSSIBILITY OF SUCH DAMAGE.
00032  */
00033 
00034 FILE_LICENCE ( BSD2 );
00035 
00036 /** @file
00037  *
00038  * SRP boot firmware table
00039  *
00040  * The working draft specification for the SRP boot firmware table can
00041  * be found at
00042  *
00043  *   http://etherboot.org/wiki/srp/sbft
00044  *
00045  */
00046 
00047 #include <stdint.h>
00048 #include <gpxe/acpi.h>
00049 #include <gpxe/scsi.h>
00050 #include <gpxe/srp.h>
00051 #include <gpxe/ib_srp.h>
00052 
00053 /** SRP Boot Firmware Table signature */
00054 #define SBFT_SIG "sBFT"
00055 
00056 /** An offset from the start of the sBFT */
00057 typedef uint16_t sbft_off_t;
00058 
00059 /**
00060  * SRP Boot Firmware Table
00061  */
00062 struct sbft_table {
00063         /** ACPI header */
00064         struct acpi_description_header acpi;
00065         /** Offset to SCSI subtable */
00066         sbft_off_t scsi_offset;
00067         /** Offset to SRP subtable */
00068         sbft_off_t srp_offset;
00069         /** Offset to IB subtable, if present */
00070         sbft_off_t ib_offset;
00071         /** Reserved */
00072         uint8_t reserved[6];
00073 } __attribute__ (( packed ));
00074 
00075 /**
00076  * sBFT SCSI subtable
00077  */
00078 struct sbft_scsi_subtable {
00079         /** LUN */
00080         struct scsi_lun lun;
00081 } __attribute__ (( packed ));
00082 
00083 /**
00084  * sBFT SRP subtable
00085  */
00086 struct sbft_srp_subtable {
00087         /** Initiator and target ports */
00088         struct srp_port_ids port_ids;
00089 } __attribute__ (( packed ));
00090 
00091 /**
00092  * sBFT IB subtable
00093  */
00094 struct sbft_ib_subtable {
00095         /** Source GID */
00096         struct ib_gid sgid;
00097         /** Destination GID */
00098         struct ib_gid dgid;
00099         /** Service ID */
00100         struct ib_gid_half service_id;
00101         /** Partition key */
00102         uint16_t pkey;
00103         /** Reserved */
00104         uint8_t reserved[6];
00105 } __attribute__ (( packed ));
00106 
00107 /**
00108  * An sBFT created by gPXE
00109  */
00110 struct gpxe_sbft {
00111         /** The table header */
00112         struct sbft_table table;
00113         /** The SCSI subtable */
00114         struct sbft_scsi_subtable scsi;
00115         /** The SRP subtable */
00116         struct sbft_srp_subtable srp;
00117         /** The IB subtable */
00118         struct sbft_ib_subtable ib;
00119 } __attribute__ (( packed, aligned ( 16 ) ));
00120 
00121 struct srp_device;
00122 
00123 extern int sbft_fill_data ( struct srp_device *srp );
00124 
00125 #endif /* _GPXE_SBFT_H */

Generated on Tue Apr 6 20:00:50 2010 for gPXE by  doxygen 1.5.7.1