#include <assert.h>
#include <realmode.h>
#include <gpxe/srp.h>
#include <gpxe/ib_srp.h>
#include <gpxe/acpi.h>
#include <gpxe/sbft.h>
Go to the source code of this file.
Defines | |
| #define | sbftab __use_data16 ( sbftab ) |
Functions | |
| FILE_LICENCE (BSD2) | |
| struct gpxe_sbft | __data16 (sbftab) |
| The sBFT used by gPXE. | |
| int | sbft_fill_data (struct srp_device *srp) |
| Fill in all variable portions of sBFT. | |
Definition in file sbft.c.
| #define sbftab __use_data16 ( sbftab ) |
| FILE_LICENCE | ( | BSD2 | ) |
| struct gpxe_sbft __data16 | ( | sbftab | ) | [read] |
The sBFT used by gPXE.
| int sbft_fill_data | ( | struct srp_device * | srp | ) |
Fill in all variable portions of sBFT.
| srp | SRP device |
| rc | Return status code |
Definition at line 71 of file sbft.c.
References __from_data16, acpi_fix_checksum(), assert, DBGC, DBGC_HDA, ib_srp_parameters::dgid, sbft_ib_subtable::dgid, ib_srp_params(), ib_srp_transport, srp_device::lun, sbft_scsi_subtable::lun, memcpy, segoff::offset, ib_srp_parameters::pkey, sbft_ib_subtable::pkey, srp_device::port_ids, sbft_srp_subtable::port_ids, rm_ds, sbftab, segoff::segment, ib_srp_parameters::service_id, sbft_ib_subtable::service_id, ib_srp_parameters::sgid, sbft_ib_subtable::sgid, and srp_device::transport.
Referenced by ib_srpboot().
00071 { 00072 struct sbft_scsi_subtable *sbft_scsi = &sbftab.scsi; 00073 struct sbft_srp_subtable *sbft_srp = &sbftab.srp; 00074 struct sbft_ib_subtable *sbft_ib = &sbftab.ib; 00075 struct ib_srp_parameters *ib_params; 00076 struct segoff rm_sbftab = { 00077 .segment = rm_ds, 00078 .offset = __from_data16 ( &sbftab ), 00079 }; 00080 00081 /* Fill in the SCSI subtable */ 00082 memcpy ( &sbft_scsi->lun, &srp->lun, sizeof ( sbft_scsi->lun ) ); 00083 00084 /* Fill in the SRP subtable */ 00085 memcpy ( &sbft_srp->port_ids, &srp->port_ids, 00086 sizeof ( sbft_srp->port_ids ) ); 00087 00088 /* Fill in the IB subtable */ 00089 assert ( srp->transport == &ib_srp_transport ); 00090 ib_params = ib_srp_params ( srp ); 00091 memcpy ( &sbft_ib->sgid, &ib_params->sgid, sizeof ( sbft_ib->sgid ) ); 00092 memcpy ( &sbft_ib->dgid, &ib_params->dgid, sizeof ( sbft_ib->dgid ) ); 00093 memcpy ( &sbft_ib->service_id, &ib_params->service_id, 00094 sizeof ( sbft_ib->service_id ) ); 00095 sbft_ib->pkey = ib_params->pkey; 00096 00097 /* Update checksum */ 00098 acpi_fix_checksum ( &sbftab.table.acpi ); 00099 00100 DBGC ( &sbftab, "SRP Boot Firmware Table at %04x:%04x:\n", 00101 rm_sbftab.segment, rm_sbftab.offset ); 00102 DBGC_HDA ( &sbftab, rm_sbftab, &sbftab, sizeof ( sbftab ) ); 00103 00104 return 0; 00105 }
1.5.7.1