david/ipxe
david
/
ipxe
Archived
1
0
Fork 0
Commit Graph

5288 Commits

Author SHA1 Message Date
Michael Brown 29cb090f98 [crypto] Dual-license more selected DRBG files
Allow the use of the iPXE DRBG implementation in BSD-licensed
projects.

Requested-by: Sean Davis <dive@hq.endersgame.net>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-01-04 15:39:07 +00:00
Michael Brown ae8dfd74c0 [smsc95xx] Fetch MAC from SMBIOS OEM string for Honeywell VM3
The Honeywell VM3 has no attached EEPROM, and records the MAC address
within an SMBIOS OEM string.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-01-04 15:31:26 +00:00
Michael Brown 0c396dd405 [crypto] Dual-license selected DRBG files
Allow the use of the iPXE DRBG implementation in BSD-licensed
projects.

Requested-by: Sean Davis <dive@hq.endersgame.net>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-12-31 14:44:45 +00:00
Michael Brown 82e03764d8 [smsc95xx] Allow for multiple methods for obtaining the MAC address
The SMSC95xx devices tend to be used in embedded systems with a
variety of ad-hoc mechanisms for storing the MAC address.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-12-23 15:29:55 +00:00
Michael Brown 721302fa54 [settings] Expose SMBIOS settings as global variables
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-12-23 15:29:55 +00:00
Michael Brown 0f67f2edb7 [bios] Add support for injecting keypresses
When USB network card drivers are used, the BIOS' legacy USB
capability is necessarily disabled since there is no way to share the
host controller between the BIOS and iPXE.

Commit 3726722 ("[usb] Add basic support for USB keyboards") added
support allowing a USB keyboard to be used within iPXE.  However,
external code such as a PXE NBP has no way to utilise this support,
and so a USB keyboard cannot be used to control a PXE NBP loaded from
a USB network card.

Add support for injecting keypresses from any iPXE console into the
BIOS keyboard buffer.  This allows external code such as a PXE NBP to
function with a USB keyboard even after the BIOS' legacy USB
capability has been disabled.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-12-23 11:47:17 +00:00
Michael Brown 91dd5524b7 [build] Allow extra objects to be included in an all-drivers build
The build system allows for additional drivers (or other objects) to
be specified using build targets such as

  make bin/intel--realtek.usb
  make bin/8086100e--8086100f.mrom

This currently fails if the base target is the "bin/ipxe.*" all-drivers
target, e.g.

  make bin/ipxe--acm.usb

Fix the build target parsing logic to allow additional drivers (or
other objects) to be included on top of the base all-drivers target.

This can be used to include USB network card drivers, which are not
yet included by default in the all-drivers build.

Reported-by: Andrew Sloma <asloma@lenovo.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-12-17 13:54:51 +00:00
Michael Brown e3012f9949 [efi] Centralise EFI file system info GUIDs
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-12-09 17:36:08 +00:00
Michael Brown ee8388ec69 [xhci] Ensure that zero-length packets are not part of a TRB chain
Some xHCI controllers (such as qemu's emulated xHCI controller) do not
correctly handle zero-length packets that are part of a TRB chain.
The zero-length TRB ends up being squashed and does not result in a
zero-length packet as seen by the device.

Work around this problem by marking the zero-length packet as
belonging to a separate transfer descriptor.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-12-07 22:40:47 +00:00
Torgeir Wulfsberg d6945925d8 [intel] Add INTEL_NO_PHY_RST for I217-LM
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-12-07 19:52:16 +00:00
Michael Brown 296dee6d38 [acm] Add support for CDC-ACM (aka USB RNDIS) devices
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-12-07 13:16:53 +00:00
Michael Brown 53ba5936b5 [usb] Allow additional settling time for out-of-spec hubs
Some hubs (e.g. the Avocent Corp. Virtual Hub on a Lenovo x3550
Integrated Management Module) have been observed to require more than
the standard 200ms for ports to stabilise, with the result that
devices appear to disconnect and immediately reconnect during the
initial bus enumeration.

Work around this problem by allowing specific hubs an extra 500ms of
settling time.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-12-07 13:16:47 +00:00
Michael Brown fb8c52de9b [usb] Allow USB device IDs to include arbitrary driver-specific data
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-12-07 13:08:23 +00:00
Michael Brown eb1fc1e957 [usb] Record USB device speed separately from current port speed
Record the speed of a USB device based on the port's speed at the time
that the device was enabled.  This allows us to remember the device's
speed even after the device has been disconnected (and so the port's
current speed has changed).

In particular, this allows us to correctly identify the transaction
translator for a low-speed or full-speed device after the device has
been disconnected.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-12-07 13:08:23 +00:00
Michael Brown 15ce7ce355 [usb] Use port->disconnected to check for disconnected devices
The usb_message() and usb_stream() functions currently check for
port->speed==USB_SPEED_NONE to determine whether or not a device has
been unplugged.  This test will give a false negative result if a new
device has been plugged in before the hotplug mechanism has finished
handling the removal of the old device.

Fix by checking instead the port->disconnected flag, which is now
cleared only after completing the removal of the old device.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-12-07 13:08:22 +00:00
Michael Brown 7f65a08f3e [efi] Add %.usb target for building EFI-bootable USB (or other) disk images
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-12-07 13:08:22 +00:00
Michael Brown 1fcd4223cc [bitops] Provide BIT_QWORD_PTR()
Provide BIT_QWORD_PTR() to allow for easy extraction of non-endian
fields (e.g. Infiniband GUIDs) without unnecessary byte swapping.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-12-01 23:56:27 +00:00
Michael Brown 89c767bfd6 [smsc95xx] Add driver for SMSC/Microchip LAN95xx USB Ethernet NICs
Tested using QEMU and usbredir to expose the LAN9512 chip present on a
Raspberry Pi.

There is a known issue with the LAN9512: an extra two bytes are
appended to every transmitted packet.  These two bytes comprise:

  {   0x00,   0x08 } if packet length == 0 (mod 8)
  { CRC[0],   0x00 } if packet length == 7 (mod 8)
  { CRC[0], CRC[1] } otherwise

The extra bytes are appended whether the Ethernet CRC is generated
manually or added automatically by the hardware.  The issue occurs
with the Linux kernel driver as well as the iPXE driver.  It appears
to be an undocumented hardware errata.

TCP/IP traffic is not affected, since the IP header length field
causes the extraneous bytes to be discarded by the receiver.  However,
protocols that rely on the length of the Ethernet frame (such as FCoE
or iPXE's "lotest" protocol) will be unusable on this hardware.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-12-01 15:37:37 +00:00
Michael Brown 4957285b22 [bitops] Fix definitions for big-endian devices
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-11-30 22:22:13 +00:00
Michael Brown ed18cd5678 [pci] Add definitions for PCI Express function level reset (FLR)
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-11-30 22:13:27 +00:00
Michael Brown 475cc92b0b [infiniband] Add qword accessors for ib_guid and ib_gid
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-11-30 22:13:27 +00:00
Michael Brown 8aa2026a9f [infiniband] Add definitions for FDR and EDR link speeds
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-11-30 22:13:27 +00:00
Michael Brown f3c2da7d4a [intel] Correct definition of receive overrun bit
Reported-by: Robin Smidsrød <robin@smidsrod.no>
Tested-by: Robin Smidsrød <robin@smidsrod.no>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-11-22 19:17:24 +00:00
Michael Brown fff9281b84 [intel] Forcibly skip PHY reset on some models
On some models (notably ICH), the PHY reset mechanism appears to be
broken.  In particular, the PHY_CTRL register will be correctly loaded
from NVM but the values will not be propagated to the "OEM bits" PHY
register.  This typically has the effect of dropping the link speed to
10Mbps.

Since the original version of this driver in commit 945e428 ("[intel]
Replace driver for Intel Gigabit NICs"), we have always worked around
this problem by skipping the PHY reset if the link is already up.
Enhance this workaround by explicitly checking for known-broken PCI
IDs.

Reported-by: Robin Smidsrød <robin@smidsrod.no>
Tested-by: Robin Smidsrød <robin@smidsrod.no>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-11-22 19:08:09 +00:00
Michael Brown 309c58824f [comboot] Reset console before starting COMBOOT executable
iPXE does not call shutdown() before invoking a COMBOOT executable,
since the executable is allowed to make API calls back into iPXE.  If
a background picture is used, then the console will not be restored to
text mode before invoking the COMBOOT executable.  This can cause
undefined behaviour.

Fix by adding an explicit call to console_reset() immediately before
invoking a COMBOOT or COM32 executable, analogous to the call made to
console_reset() immediately before invokving a PXE NBP.

Debugged-by: Andrew Widdersheim <awiddersheim@inetu.net>
Tested-by: Andrew Widdersheim <awiddersheim@inetu.net>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-11-17 14:20:35 +00:00
Michael Brown ed0d7c4f6f [dhcp] Limit maximum number of DHCP discovery deferrals
For switches which remain permanently in the non-forwarding state (or
which erroneously report a non-forwarding state), ensure that iPXE
will eventually give up waiting for the link to become unblocked.

Originally-fixed-by: Wissam Shoukair <wissams@mellanox.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-11-10 14:05:46 +00:00
Kyösti Mälkki d5f7ee60e7 [intel] Add PCI IDs for i210/i211 flashless operation
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-11-04 20:47:39 +00:00
Michael Brown 7cc7e0ec86 [dhcp] Reset start time when deferring discovery
If we detect (via STP) that a switch port is in a non-forwarding
state, then the link is marked as being temporarily blocked and DHCP
discovery will be deferred until the link becomes unblocked.

The timer used to decide when to give up waiting for ProxyDHCPOFFERs
is currently based on the time that DHCP discovery was started, and
makes no allowances for any time spent waiting for the link to become
unblocked.  Consequently, if STP is used then the timeout for
ProxyDHCPOFFERs becomes essentially zero.

Fix by resetting the recorded start time whenever DHCP discovery is
deferred due to a blocked link.

Debugged-by: Sebastian Roth <sebastian.roth@zoho.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-10-30 13:29:03 +00:00
Michael Brown 6847232e70 [efi] Add support for EFI_GRAPHICS_OUTPUT_PROTOCOL frame buffer consoles
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-10-16 16:38:41 +01:00
Michael Brown 4b7443d132 [build] Generalise CONSOLE_VESAFB to CONSOLE_FRAMEBUFFER
The name "vesafb" is intrinsically specific to a BIOS environment.
Generalise the build configuration option CONSOLE_VESAFB to
CONSOLE_FRAMEBUFFER, in preparation for adding EFI framebuffer
support.

Existing configurations using CONSOLE_VESAFB will continue to work.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-10-16 16:38:39 +01:00
Michael Brown bede691986 [console] Tidy up config/console.h
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-10-16 16:17:41 +01:00
Michael Brown 79afe60b09 [fbcon] Move margin calculations to fbcon.c
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-10-14 22:16:45 +01:00
Michael Brown bc69777a40 [fbcon] Allow character height to be selected at runtime
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-10-14 22:16:40 +01:00
Michael Brown fb2af441c2 [efi] Import EFI_HII_FONT_PROTOCOL definitions
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-10-07 08:34:27 +01:00
Michael Brown 42e0c7e956 [efi] Update to current EDK2 headers
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-10-07 08:34:27 +01:00
Michael Brown 1880691774 [efi] Reset root directory when installing EFI_SIMPLE_FILE_SYSTEM_PROTOCOL
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-10-07 08:34:27 +01:00
Michael Brown 3bd0d340f4 [http] Verify server port when reusing a pooled connection
Reported-by: Allen <allen@gtf.org>
Reported-by: Andreas Hammarskjöld <junior@2PintSoftware.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-10-02 07:54:51 +01:00
Michael Brown 0a4805bf94 [peerdist] Avoid NULL pointer dereference for plaintext blocks
Avoid accidentally dereferencing a NULL cipher context pointer for
plaintext blocks (which are usually messages with a block length of
zero, indicating a missing block).

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-09-29 01:24:36 +01:00
Michael Brown f3fbb5ff1c [malloc] Avoid integer overflow for excessively large memory allocations
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-09-29 01:07:08 +01:00
Michael Brown 300a371bfb [efi] Expose an UNDI interface alongside the existing SNP interface
UEFI UNDI is a hideously ugly lump of poorly specified garbage bolted
on as an appendix of the UEFI specification.  My personal favourite
line from the UNDI 'specification' is section E.2.2, which states
"Basically, the rule is: Do it right, or don't do it at all".  The
author appears to believe that such exhortations are a viable
substitute for documenting what it is that the wretched reader is
supposed to, in fact, do.

(Second favourite is the section listing the pros and cons of various
driver types.  This fails to identify a single con for the mythical
"Hardware UNDI", a design so insanely intrinsically slow that it
appears to have been the inspiration for the EFI_USB_IO_PROTOCOL.)

UNDI is functionally isomorphic to the substantially less preposterous
EFI_SIMPLE_NETWORK_PROTOCOL.  Provide an UNDI interface (as a thin
wrapper around the existing SNP interface) to allow for use by
third-party software that has made poor life choices.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-09-28 03:42:09 +01:00
Michael Brown 9ff6d08bf5 [efi] Avoid infinite loops when asked to stop non-existent devices
Calling EDK2's OpenProtocol() with attributes BY_DRIVER|EXCLUSIVE will
call DisconnectController() in a loop to attempt to dislodge any
existing openers with attributes BY_DRIVER.  The loop will continue
indefinitely until either no such openers remain, or until
DisconnectController() returns an error.

If our driver binding protocol's Stop() method is ever called to
disconnect a device that we are not in fact driving, then return
EFI_DEVICE_ERROR rather than EFI_SUCCESS, in order to break this
potentially infinite loop.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-09-28 03:20:59 +01:00
Michael Brown 7b976dd300 [efi] Work around broken 32-bit PE executable parsing in ImageHlp.dll
The Microsoft PE/COFF specification defines the MajorLinkerVersion and
MinorLinkerVersion fields as "The linker major version number" and
"The linker minor version number" respectively, and has nothing more
to say on the matter.  These fields have no significance: they do not
affect the interpretation of the remainder of the file, but merely
provide diagnostic information for interested humans to read.

Apparently, versions 2.4 and earlier of the Microsoft linker produced
binaries so incorrigibly cursed that even to attempt to parse such a
binary would risk summoning a plague of enraged spiders.  To protect
users from unwanted arachnids, ImageHlp.dll's MapAndLoad() function
will helpfully fail to map and/or load a 32-bit binary unless the
linker version field indicates version 2.5 or later.  (64-bit binaries
are exempt from such helpfulness.)

Work around the broken Microsoft ImageHlp.dll library by providing a
linker version number that will satisfy the arbitrary whims of the
MapAndLoad() function.

This mirrors wimboot commit 670c7e2 ("[efi] Work around broken 32-bit
PE executable parsing in ImageHlp.dll").

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-09-25 13:41:32 +01:00
Carl Henrik Lunde 3f8da985aa [vmxnet3] Avoid completely filling the TX descriptor ring
Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-09-16 11:10:30 +01:00
Michael Brown 1852803e46 [pxe] Notify BIOS via INT 1a,564e for each new network device
Use INT 1a,564e to notify the BIOS of each network device that we
detect.  This provides an opportunity for the BIOS to implement
platform policy such as changing the MAC address by issuing a call to
PXENV_UNDI_SET_STATION_ADDRESS.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-09-15 13:43:35 +01:00
Michael Brown 3b586c8e29 [pxe] Invoke INT 1a,564e when PXE stack is activated
Invoke INT 1a,564e whenever a PXE stack is activated, passing the
address of the PXENV+ structure in %es:%bx.  This is designed to allow
a BIOS to be notified when a PXE stack has been installed, providing
an opportunity for start-of-day commands such as setting the MAC
address according to a policy chosen by the BIOS.

PXE defines INT 1a,5650 as a means of locating the PXENV+ structure:
this call returns %ax=0x564e and the address of the PXENV+ structure
in %es:%bx.  We choose INT 1a,564e as a fairly natural notification
call, using the parameters as would be returned by INT 1a,5650.

The full calling convention (documented as per section 3.1 of the PXE
specification) is:

  INT 1a,564e - PXE installation notification
  Enter:
    %ax = 0x564e
    %es = 16-bit segment address of the PXENV+ structure
    %bx = 16-bit offset of the PXENV+ structure
  Exit:
    %edx may be trashed (as is the case for INT 1a,5650)
    All other register contents must be preserved
    CF is cleared
    IF is preserved
    All other flags are undefined

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-09-15 13:33:44 +01:00
Michael Brown fdad22a1ed [efi] Minimise use of iPXE header files when building host utilities
Avoid dragging in unnecessary iPXE header files such as <ipxe/uuid.h>
and <ipxe/tables.h> when building host utilities, and ensure that
FILE_LICENCE() (present in the imported EDK2 headers) expands to a
no-op.

Reported-by: Michael Tautschnig <mt@debian.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-09-14 23:29:24 +01:00
Michael Brown 40a9a0f097 [build] Remove dependency on libiberty
Commit 7d36a1b ("[build] Explicitly link efilink against -liberty")
introduced a dependency on libiberty to cope with old versions of
libbfd.  This commit dates from 2008 and seems to apply only to what
are now extremely old versions of libbfd (prior to binutils 2.12).

There are systems (such as current Debian) which do not include
libiberty within the binutils packages.  On such systems, our build
dependency on libiberty represents a pointless hurdle.

Remove the explicit dependency on libiberty, hoping that there are no
modern systems where this will cause a problem.

Suggested-by: Ben Hildred <42656e@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-09-14 22:55:40 +01:00
Michael Brown 79443785cd [ncm] Support setting MAC address
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-09-14 22:45:56 +01:00
Michael Brown 5df081d6c0 [efi] Expose unused USB devices via EFI_USB_IO_PROTOCOL
Allow the UEFI platform firmware to provide drivers for unrecognised
devices, by exposing our own implementation of EFI_USB_IO_PROTOCOL.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-09-14 22:11:37 +01:00
Michael Brown 668dc73d52 [usb] Allow for wildcard USB class IDs
Make the class ID a property of the USB driver (rather than a property
of the USB device ID), and allow USB drivers to specify a wildcard ID
for any of the three component IDs (class, subclass, or protocol).

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-09-14 21:56:40 +01:00