summaryrefslogtreecommitdiffstats
path: root/src/interface
Commit message (Collapse)AuthorAgeFilesLines
* [efi] Do not try to fetch loaded image device path protocolMichael Brown2014-05-201-23/+0Star
| | | | | | | | | | | Some UEFI systems (observed with a Mac Pro) do not provide a loaded image device path protocol. We don't currently use the loaded image device path protocol for anything beyond printing a debug message, so simply remove the code which attempts to fetch it. Reported-by: Matt Woodward <pxematt@woodwardcc.com> Tested-by: Matt Woodward <pxematt@woodwardcc.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Make EFI_HII_DATABASE_PROTOCOL optionalMichael Brown2014-05-201-1/+10
| | | | | | | | | | | | Some UEFI systems (observed with a Mac Pro) do not provide EFI_HII_DATABASE_PROTOCOL. We can continue to function without providing access to network device settings via HII, so make this protocol optional and fall back to simply not providing any HII protocols. Reported-by: Matt Woodward <pxematt@woodwardcc.com> Tested-by: Matt Woodward <pxematt@woodwardcc.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Make EFI_DEVICE_PATH_TO_TEXT_PROTOCOL optionalMichael Brown2014-05-201-9/+15
| | | | | | | | | | | Some UEFI systems (observed with a Mac Pro) do not provide EFI_DEVICE_PATH_TO_TEXT_PROTOCOL. Since we use this protocol only for debug messages, make it optional and fall back to printing the raw device path bytes. Reported-by: Matt Woodward <pxematt@woodwardcc.com> Tested-by: Matt Woodward <pxematt@woodwardcc.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Allow for optional protocolsMichael Brown2014-05-191-2/+3
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Disable SNP devices when running iPXE as the applicationMichael Brown2014-03-141-7/+126
| | | | | | | | | | | | | Some UEFI builds will set up a timer to continuously poll any SNP devices. This can drain packets from the network device's receive queue before iPXE gets a chance to process them. Use netdev_rx_[un]freeze() to explicitly indicate when we expect our network devices to be driven via the external SNP API (as we do with the UNDI API on the standard BIOS build), and disable the SNP API except when receive queue processing is frozen. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Connect driver to devices as part of installationMichael Brown2014-03-121-20/+69
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Allow driver to be unloadedMichael Brown2014-03-104-4/+158
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [linux] Avoid starting currticks() from zero every timeMichael Brown2014-03-071-1/+7
| | | | | | | | | | | | | | | | | | | iPXE uses currticks() (along with the MAC address(es) of any network devices) to seed the (non-cryptographic) random number generator. The current implementation of linux_currticks() ensures that the first call to currticks() will always return zero; this results in identical random number sequences on each run of iPXE on a given machine. This can cause odd-looking behaviour due to e.g. the reuse of local TCP port numbers. Fix by effectively rounding down the start time recorded by linux_currticks() to the nearest whole second; this makes it unlikely that consecutive runs of iPXE will use the exact same RNG sequence. (Note that none of this affects the cryptographic RNG, which uses /dev/random as a source of entropy.) Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Allow for multiple definitions of each predefined settingMichael Brown2013-12-051-0/+4
| | | | | | | | | | Allow for multiple setting definitions with the same name but different scopes and tags. For example, allow for a "filename" setting with default scope and tag value 67 (for DHCPv4) and a corresponding "filename" setting with IPv6 scope and tag value 59 (for DHCPv6). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Force settings into alphabetical order within sectionsMichael Brown2013-12-051-39/+44
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [linux] Provide access to SMBIOS via /dev/memMichael Brown2013-12-052-9/+135
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Explicitly separate the concept of a completed fetched settingMichael Brown2013-12-052-6/+10
| | | | | | | | | | The fetch_setting() family of functions may currently modify the definition of the specified setting (e.g. to add missing type information). Clean up this interface by requiring callers to provide an explicit buffer to contain the completed definition of the fetched setting, if required. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [console] Pass escape sequence context to ANSI escape sequence handlersMichael Brown2013-11-271-4/+10
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Clarify usage of the term "named setting"Michael Brown2013-07-181-2/+2
| | | | | | | | | | | | There are currently two conflicting usages of the term "named setting" within iPXE: one refers to predefined settings (such as show up in the "config" UI), the other refers to settings identified by a name (such as "net0.dhcp/ip"). Split these usages into the term "predefined setting" and "named setting" to avoid ambiguity. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [cmdline] Add "poweroff" commandMarin Hannache2013-07-151-0/+17
| | | | | | Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Marin Hannache <git@mareo.fr> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [linux] Add missing #include <stddef.h>Marin Hannache2013-07-142-0/+2
| | | | | Signed-off-by: Marin Hannache <git@mareo.fr> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [linux] Add support for accessing PCI configuration space via /proc/bus/pciMichael Brown2013-07-131-0/+185
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [smbios] Allow access to multiple instances of SMBIOS structuresMichael Brown2013-05-012-4/+9
| | | | | | | | | | | | | | | | | | | | | | | Extend the syntax for numerical SMBIOS settings from smbios/<type>.<offset>.<length> to smbios/[<instance>.]<type>.<offset>.<length> Where SMBIOS provides multiple structures with the same <type>, this extended syntax allows for access to structures other than the first. If <instance> is omitted then it will default to zero, giving access to the first instance (and so matching existing behaviour). The 16-bit SMBIOS handle (which is an alternative way to disambiguate multiple instances of the same type of structure) can be accessed, if required, using smbios/<instance>.<type>.2.2:uint16 Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [smbios] Allow access to unreferenced SMBIOS stringsMichael Brown2013-05-011-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | iPXE allows access to general SMBIOS settings using the syntax: smbios/<type>.<offset>.<length> This provides access to any fixed-offset field within an SMBIOS structure. This syntax is currently overloaded to interpret a zero <length> as meaning that the byte at <offset> contains a string index; this provides access to SMBIOS strings (which are not located at fixed offsets). The "OEM Strings" SMBIOS structure contains strings which are not referenced by any fixed string index field within the structure. iPXE currently provides no way to access these strings. Fix by overloading the syntax for numerical SMBIOS settings to interpret an <offset> of zero as implying that <length> contains a literal string index. The OEM Strings can then be accessed using: smbios/11.0.1 smbios/11.0.2 smbios/11.0.3 ... The actual byte at offset zero will always contain the structure type, which is already known since it must be specified in order to access the structure. There is thus no plausible existing use case for an offset of zero; overloading the syntax in this way should therefore not break compatibility with any existing scripts. The corner case where both <offset> and <length> are zero is undefined (and, for now, will simply return a "not found" error). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Eliminate settings "tag magic"Michael Brown2013-05-011-21/+11Star
| | | | | | | Create an explicit concept of "settings scope" and eliminate the magic values used for numerical setting tags. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Perform meaningful error code conversionsMichael Brown2013-04-1913-137/+131Star
| | | | | | | | Exploit the redefinition of iPXE error codes to include a "platform error code" to allow for meaningful conversion of EFI_STATUS values to iPXE errors and vice versa. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Remove obsolete EFI I/O implementation using EFI_CPU_IO_PROTOCOLMichael Brown2013-04-191-218/+0Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Fetch device path for loaded image during initialisationMichael Brown2013-03-271-13/+37
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [cmdline] Add ability to perform a warm rebootMichael Brown2013-03-221-2/+3
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Add "reboot" command for EFIMichael Brown2013-03-221-0/+43
| | | | | | | | | Abstract out the ability to reboot the system to a separate reboot() function (with platform-specific implementations), add an EFI implementation, and make the existing "reboot" command available under EFI. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Provide efi_guid_ntoa() for printing EFI GUIDsMichael Brown2013-03-203-12/+31
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [uuid] Abstract UUID mangling code out to a separate uuid_mangle() functionMichael Brown2013-03-201-4/+1Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [smbios] Mangle UUIDs for SMBIOS version 2.6 and newerMichael Brown2013-03-201-9/+33
| | | | | | | | | | | | | | | | iPXE treats UUIDs as being in network byte order (big-endian). The SMBIOS specification version 2.6 states that UUIDs are stored with little-endian values in the first three fields; earlier versions did not specify an endianness. This results in some inconsistency between the BIOS, vendor PXE, iPXE, and operating system interpretations of the SMBIOS UUID. dmidecode assumes that the byte order is little-endian if and only if the SMBIOS version is 2.6 or higher. Choose to match this behaviour. Reported-by: Matthew Helton <mwhelton@gmail.com> Reported-by: Alexandru Bordei <alexandru.bordei@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [smbios] Provide SMBIOS version number via smbios_version()Michael Brown2013-03-202-0/+19
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Add EFI-specific debugging macrosMichael Brown2013-03-201-0/+95
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Add our own EFI_LOAD_FILE_PROTOCOL implementationMichael Brown2013-03-141-1/+56
| | | | | | | | | | | | | When iPXE is used as a UEFI driver, the UEFI PXE base code currently provides the TCP/IP stack, network protocols, and user interface. This represents a substantial downgrade from the standard BIOS iPXE user experience. Fix by installing our own EFI_LOAD_FILE_PROTOCOL implementation which initiates the standard iPXE boot procedure. This upgrades the UEFI iPXE user experience to match the standard BIOS iPXE user experience. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Expose downloaded images via EFI_SIMPLE_FILE_SYSTEM_PROTOCOLMichael Brown2013-03-132-21/+607
| | | | | | | | | | | | | | | | | Expose iPXE's images as a UEFI file system, allowing the booted image to access all images downloaded by iPXE. This functionality is complementary to the custom iPXE download protocol. The iPXE download protocol allows a booted image to utilise iPXE to download arbitrary URIs, but requires the booted image to specifically support the custom iPXE download protocol. The new functionality limits the booted image to accessing only files that were already downloaded by iPXE (e.g. as part of a script), but can work with any generic UEFI image (e.g. the UEFI shell). Both protocols are provided simultaneously, and are attached to the SNP device handle. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Add last_opened_snpdev()Michael Brown2013-03-131-0/+15
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Include product short name in EFI SNP device namesMichael Brown2012-11-211-3/+5
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Delegate to child device's EFI_COMPONENT_NAME2_PROTOCOL, if presentMichael Brown2012-11-211-5/+22
| | | | | | | | | | EFI's device naming model requires drivers to provide names for child devices. Allow the driver's GetControllerName() method to delegate to an instance of EFI_COMPONENT_NAME2_PROTOCOL installed on the child device itself (if present); this allows the SNP device to expose its own device name via the PCI driver's GetControllerName() method. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Include version number within only a single object fileMichael Brown2012-11-021-1/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Add EFI_COMPONENT_NAME2_PROTOCOL instance for each SNP deviceMichael Brown2012-10-231-0/+68
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Add missing RC_TO_EFIRC() conversionMichael Brown2012-10-221-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Expose net device non-volatile settings via HIIMichael Brown2012-10-162-216/+1069
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Split SNP HII functionality into a separate fileMichael Brown2012-10-162-418/+439
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Mark SNP formset compliant with IBM's Unified Configuration ManagerMichael Brown2012-10-051-2/+3
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Provide guaranteed space in transmitted packetsMichael Brown2012-09-141-6/+7
| | | | | | | | | | | | | eIPoIB requires space to expand a transmitted ARP packet. This guarantee is met by ensuring that a transmitted packet consists of at least MAX_LL_HEADER_LEN bytes from the start of the I/O buffer up to the end of the link-layer header, and at least IOB_ZLEN bytes thereafter. Adjust the I/O buffer allocation for SNP transmitted packets to ensure that this guarantee is met. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [smbios] Default to "hex" type for non-string SMBIOS settingsMichael Brown2012-09-101-3/+10
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ipoib] Expose Ethernet-compatible eIPoIB link-layer addresses and headersMichael Brown2012-08-311-1/+2
| | | | | | | | | | | | | Almost all clients of the raw-packet interfaces (UNDI and SNP) can handle only Ethernet link layers. Expose an Ethernet-compatible link layer to local clients, while remaining compatible with IPoIB on the wire. This requires manipulation of ARP (but not DHCP) packets within the IPoIB driver. This is ugly, but it's the only viable way to allow IPoIB devices to be driven via the raw-packet interfaces. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legal] Update FSF mailing address in GPL licence textsMichael Brown2012-07-2019-19/+38
| | | | | Suggested-by: Daniel P. Berrange <berrange@redhat.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Work around platforms which choke on EFI_PCI_DEVICE_ENABLEMichael Brown2012-05-161-10/+12
| | | | | | | | | | | | | | | | | | | | | | | | | EFI_PCI_DEVICE_ENABLE is a list of the standard attributes that must be enabled for a PCI device to function: I/O cycles, memory cycles, and bus-mastering. We currently call EFI_PCI_IO_PROTOCOL::Attribute() with the parameter EFI_PCI_DEVICE_ENABLE to enable a PCI device. This should translate to a single write to PCI configuration space. Simplicity is not a virtue within the UEFI world. Some platforms will 'helpfully' report an error if EFI_PCI_DEVICE_ENABLE is used on a device that doesn't actually support all three of the relevant attributes. For example, if a PCI device provides only memory-mapped accesses (and so hardwires the I/O enable bit to zero), then using EFI_PCI_DEVICE_ENABLE on such a platform will result in an EFI_UNSUPPORTED error. There is no plausible use case in which it is useful for the platform to return an error in this way, and doing so makes it impossible to distinguish genuine errors from noise. Work around this broken behaviour by attempting to enable the three attributes individually, and ignoring any errors. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [time] Add Linux time source using gettimeofday()Michael Brown2012-05-041-0/+45
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Update link state in SNP device mode dataMichael Brown2012-04-191-2/+15
| | | | | | | | | | | There is no explicit SNP API call to determine link state; the SNP interface user may check the MediaPresent field within the mode data at any time. Update the MediaPresent field whenever the link state changes. Reported-by: Michael R Turner <mikeyt@us.ibm.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [console] Remove "log message" usage from interactive console defaultsMichael Brown2012-03-272-2/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [console] Allow usage to be defined independently for each consoleMichael Brown2012-03-262-0/+17
| | | | | | | | | | | | | | | | | | | | | Add the concept of a "console usage", such as "standard output" or "debug messages". Allow usages to be associated with each console independently. For example, to send debugging output via the serial port, while preventing it from appearing on the local console: #define CONSOLE_SERIAL CONSOLE_USAGE_ALL #define CONSOLE_PCBIOS ( CONSOLE_USAGE_ALL & ~CONSOLE_USAGE_DEBUG ) If no usages are explicitly specified, then a default set of usages will be applied. For example: #define CONSOLE_SERIAL will have the same affect as #define CONSOLE_SERIAL CONSOLE_USAGE_ALL Signed-off-by: Michael Brown <mcb30@ipxe.org>